Now even more acceptable!
This commit is contained in:
@@ -1,11 +1,58 @@
|
|||||||
;Detect hardware and map out screen
|
;;;;;;;;;;;;;;;;;;;
|
||||||
|
jsr init_devices
|
||||||
|
jsr Hello_World
|
||||||
|
set PC,end
|
||||||
|
;;;;;;;;;;;;;;;;;;;
|
||||||
|
:dev_screen dat 0
|
||||||
|
:dev_keyboard dat 0
|
||||||
|
:dev_clock dat 0
|
||||||
|
:device_count dat 0
|
||||||
|
;;;;;;;;;;;;;;;;;;;
|
||||||
|
:find_devices
|
||||||
|
hwn [device_count]
|
||||||
|
set I,0
|
||||||
|
:find_devices_loop
|
||||||
hwq i
|
hwq i
|
||||||
ifn a,62997
|
ife A,0x7406
|
||||||
sti pc,0
|
set [dev_keyboard],1
|
||||||
set a,0
|
ife A,0xb402
|
||||||
set b,8
|
set [dev_clock],1
|
||||||
hwi i
|
ife A,0xf615
|
||||||
sub pc,1
|
set [dev_screen],1
|
||||||
;Output
|
add I,1
|
||||||
dat 0x5048,0x5065,0x506C,0x506C,0x506F,0 ;hello and the space
|
ifn I,device_count
|
||||||
dat 0x5077,0x506F,0x5072,0x506C,0x5064 ;world
|
set PC,find_devices_loop
|
||||||
|
set PC,pop
|
||||||
|
:init_devices
|
||||||
|
jsr find_devices
|
||||||
|
;set up display
|
||||||
|
set A,0
|
||||||
|
set B,0x8000
|
||||||
|
hwi [dev_screen]
|
||||||
|
;set up clock
|
||||||
|
set B, 0
|
||||||
|
hwi [dev_clock]
|
||||||
|
;set up keyboard
|
||||||
|
set A,0
|
||||||
|
hwi [dev_keyboard]
|
||||||
|
;set up clock
|
||||||
|
set PC,pop
|
||||||
|
|
||||||
|
:Hello_World
|
||||||
|
set [0x8000],0x1048
|
||||||
|
set [0x8001],0x1065
|
||||||
|
set [0x8002],0x106c
|
||||||
|
set [0x8003],0x106c
|
||||||
|
set [0x8004],0x106f
|
||||||
|
set [0x8005],0x102c
|
||||||
|
set [0x8006],0
|
||||||
|
set [0x8007],0x1077
|
||||||
|
set [0x8008],0x106f
|
||||||
|
set [0x8009],0x1072
|
||||||
|
set [0x800a],0x106c
|
||||||
|
set [0x800b],0x1064
|
||||||
|
set [0x800c],0x1021
|
||||||
|
set PC,pop
|
||||||
|
|
||||||
|
:end
|
||||||
|
set PC,end
|
||||||
Reference in New Issue
Block a user