summaryrefslogtreecommitdiff
path: root/warriors/epson.red
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2023-05-30 14:02:35 -0400
committerBenji Dial <benji@benjidial.net>2023-05-30 14:02:35 -0400
commitd97c1a6497cc41c30edb6d5322a6deac56fd2293 (patch)
tree07920c6b83e687b75b268db44937f5fa362febd0 /warriors/epson.red
parent6678dccccdfffb9c40f64a828fd769c53bb2d29f (diff)
downloadlib94-d97c1a6497cc41c30edb6d5322a6deac56fd2293.tar.gz
rewrite compiler, add for/rof support
Diffstat (limited to 'warriors/epson.red')
-rw-r--r--warriors/epson.red22
1 files changed, 13 insertions, 9 deletions
diff --git a/warriors/epson.red b/warriors/epson.red
index eeceee1..688ad8d 100644
--- a/warriors/epson.red
+++ b/warriors/epson.red
@@ -1,16 +1,20 @@
;author Benji Dial
;name Epson
-period equ 10
+intrascan_period equ 10
+interscan_period equ 2
-scan_init equ the_end - (the_end - scan) % period + period
+;interscan period must divide intrascan period
+;intrascan period must divide 8000
+
+scan_init equ the_end - scan - (the_end - scan) % intrascan_period + intrascan_period
scan
- seq.i -period, scan_init
+ seq.i -intrascan_period, scan_init
jmp found
found_ret
- add.ab #period, scan
+ add.ab #intrascan_period, scan
seq.ab scan, scan
jmp scan
@@ -18,17 +22,17 @@ found_ret
jmn.a scan, scan
clear
- mov the_end, - 1
- sub.ab #2, clear
+ mov the_end, scan - interscan_period
+ sub.ab #interscan_period, clear
- seq.ab #the_end - clear - (the_end - clear) % 2 + 3, clear
+ seq.ab #scan_add - 1 - clear - (scan_add - 1 - scan) % interscan_period + interscan_period, clear
jmp clear
- mov.ab #-1, clear
+ mov.ab #scan - interscan_period - clear, clear
jmp clear
scan_add
- dat 2, period + scan_init + 2
+ dat interscan_period, intrascan_period + scan_init + interscan_period
found
mov bomb, >scan