summaryrefslogtreecommitdiff
path: root/warriors
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
parent6678dccccdfffb9c40f64a828fd769c53bb2d29f (diff)
downloadlib94-d97c1a6497cc41c30edb6d5322a6deac56fd2293.tar.gz
rewrite compiler, add for/rof support
Diffstat (limited to 'warriors')
-rw-r--r--warriors/big-nothing.red12
-rw-r--r--warriors/epson.red22
2 files changed, 16 insertions, 18 deletions
diff --git a/warriors/big-nothing.red b/warriors/big-nothing.red
index 1d69675..6a1a0dd 100644
--- a/warriors/big-nothing.red
+++ b/warriors/big-nothing.red
@@ -2,13 +2,7 @@
;name Big Nothing
start
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
+ for 19
+ nop
+ rof
jmp start
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