lib94/warriors/epson.red

46 lines
873 B
Text

;author Benji Dial
;name Epson
intrascan_period equ 10
interscan_period equ 2
;assert intrascan_period % interscan_period == 0
;assert CORESIZE % intrascan_period == 0
scan_init equ (the_end - scan - (the_end - scan) % intrascan_period + intrascan_period)
scan
seq.i -intrascan_period, scan_init
jmp found
found_ret
add.ab #intrascan_period, scan
seq.ab scan, scan
jmp scan
add.f scan_add, scan
jmn.a scan, scan
clear
mov the_end, scan - interscan_period
sub.ab #interscan_period, clear
seq.ab #scan_add - 1 - clear - (scan_add - 1 - scan) % interscan_period + interscan_period, clear
jmp clear
mov.ab #scan - interscan_period - clear, clear
jmp clear
scan_add
dat interscan_period, intrascan_period + scan_init + interscan_period
found
mov bomb, >scan
mov bomb + 1, @scan
jmp found_ret, <scan
bomb
spl 1
jmp bomb
the_end