From d97c1a6497cc41c30edb6d5322a6deac56fd2293 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 30 May 2023 14:02:35 -0400 Subject: rewrite compiler, add for/rof support --- warriors/big-nothing.red | 12 +++--------- warriors/epson.red | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'warriors') 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 -- cgit v1.2.3