2016-07-01 15:17:11 +00:00
|
|
|
;
|
|
|
|
; Simple memory transform-and-copy program
|
|
|
|
;
|
|
|
|
_start:
|
2016-07-01 18:20:43 +00:00
|
|
|
|
|
|
|
push 0xFFFF00
|
2016-07-01 15:17:11 +00:00
|
|
|
cpget
|
|
|
|
jmp @cls
|
2016-07-01 18:20:43 +00:00
|
|
|
hwio [ci:1] ; refresh screen
|
|
|
|
|
|
|
|
push 0x00FFFF
|
2016-07-01 15:17:11 +00:00
|
|
|
cpget
|
|
|
|
jmp @cls
|
2016-07-01 18:20:43 +00:00
|
|
|
hwio [ci:1] ; refresh screen
|
|
|
|
|
2016-07-01 15:17:11 +00:00
|
|
|
jmp @_start
|
|
|
|
syscall
|
|
|
|
|
|
|
|
cls:
|
|
|
|
bpget
|
|
|
|
spget
|
|
|
|
bpset
|
|
|
|
push 0
|
|
|
|
cls_copy:
|
|
|
|
dup
|
|
|
|
cmp 1228800 ; 640*480*4 screen size
|
|
|
|
[ex(z)=1] jmp @cls_stop
|
|
|
|
|
|
|
|
get -2 ; Get color argument
|
|
|
|
get 1 ; Get iterator
|
|
|
|
[i0:arg] add 4096 ; Add screen buffer offset
|
|
|
|
|
|
|
|
storei [ci:2] ; Write 32bit value
|
|
|
|
|
|
|
|
; Increase counter
|
|
|
|
[i0:arg] add 4
|
|
|
|
jmp @cls_copy
|
|
|
|
|
|
|
|
cls_stop:
|
|
|
|
bpget
|
|
|
|
spset
|
|
|
|
bpset
|
|
|
|
ret
|