diff options
author | Benji Dial <benji@benjidial.net> | 2023-05-30 00:22:29 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2023-05-30 00:22:29 -0400 |
commit | 28e855f5424df395dd1ba98354a53536d4598d47 (patch) | |
tree | 21e17429958fedf754ac7aad59377f6fdac2a08f /warriors | |
parent | e56afe88854d3da8d0d9d5c836da6024b02a9bac (diff) | |
download | lib94-28e855f5424df395dd1ba98354a53536d4598d47.tar.gz |
fix djn again, and pre-dec / post-inc; few other changes
Diffstat (limited to 'warriors')
-rw-r--r-- | warriors/big-nothing.red | 30 | ||||
-rw-r--r-- | warriors/dwarf-replicator.red | 55 | ||||
-rw-r--r-- | warriors/dwarf.red | 12 | ||||
-rw-r--r-- | warriors/epson.red | 42 | ||||
-rw-r--r-- | warriors/imp.red | 4 | ||||
-rw-r--r-- | warriors/simple-clear.red | 9 | ||||
-rw-r--r-- | warriors/splitter.red | 5 | ||||
-rw-r--r-- | warriors/trap.red | 28 |
8 files changed, 113 insertions, 72 deletions
diff --git a/warriors/big-nothing.red b/warriors/big-nothing.red index 8549f6f..a9aa6c9 100644 --- a/warriors/big-nothing.red +++ b/warriors/big-nothing.red @@ -1,20 +1,14 @@ -;author blah -;name big nothing +;author Benji Dial +;name Big Nothing start: -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -nop -jmp start + nop + nop + nop + nop + nop + nop + nop + nop + nop + jmp start diff --git a/warriors/dwarf-replicator.red b/warriors/dwarf-replicator.red new file mode 100644 index 0000000..f301a05 --- /dev/null +++ b/warriors/dwarf-replicator.red @@ -0,0 +1,55 @@ +;author Benji Dial +;name Dwarf Replicator + +;not a particularly good warrior, but is sufficient to test a few things + +start: + mov 0, 2908 + nop }start, >start + jmp 2 + + dat + + seq.a #end - start, start + jmp start + jmp 2 + + dat + + sub.ab #end - start, start + spl @start + jmp 2, <start + + dat + +dwarf: + mov end, end + 4 + add.ab #4, dwarf + jmp 2 + + dat + + seq.ab #start + 723 - dwarf, dwarf + jmp dwarf + jmp 2 + + dat + +core_clear: + mov end, end + 1 + add.ab #1, 0-1 + jmp 2 + + dat + + seq.a #0-1, core_clear + jmp core_clear + jmp 2 + + dat + + mov.ab #end + 1, core_clear + jmp core_clear + dat + +end: diff --git a/warriors/dwarf.red b/warriors/dwarf.red index 17c075c..e0e2638 100644 --- a/warriors/dwarf.red +++ b/warriors/dwarf.red @@ -1,10 +1,6 @@ -;author standard -;name dwarf +;author Standard +;name Dwarf -;assert (0 - bomb_step) % bomb_step == 0 - -bomb_step equ 4 - -mov 0-1, 3 -add.ab #bomb_step, 0-1 +mov 3, 7 +add.ab #4, 0-1 jmp 0-2 diff --git a/warriors/epson.red b/warriors/epson.red new file mode 100644 index 0000000..b0409f0 --- /dev/null +++ b/warriors/epson.red @@ -0,0 +1,42 @@ +;author Benji Dial +;name Epson + +period equ 10 + +scan_init equ end - (end - scan) % period + period + +scan: + seq.i 0 - period, scan_init + jmp found + +found_ret: + add.ab #period, scan + seq.ab scan, scan + jmp scan + + add.f scan_add, scan + jmn.a scan, scan + +clear: + mov end, 0 - 1 + sub.ab #2, clear + + seq.ab #end - clear - (end - clear) % 2 + 3, clear + jmp clear + + mov.ab #0 - 1, clear + jmp clear + +scan_add: + dat 2, period + scan_init + 2 + +found: + mov bomb, >scan + mov bomb + 1, @scan + jmp found_ret, <scan + +bomb: + spl 1 + jmp bomb + +end: diff --git a/warriors/imp.red b/warriors/imp.red deleted file mode 100644 index 5ba74c4..0000000 --- a/warriors/imp.red +++ /dev/null @@ -1,4 +0,0 @@ -;author standard -;name imp - -mov 0, 1 diff --git a/warriors/simple-clear.red b/warriors/simple-clear.red deleted file mode 100644 index b40215e..0000000 --- a/warriors/simple-clear.red +++ /dev/null @@ -1,9 +0,0 @@ -;name simple core clear -;author blah - -start: -mov background, background + 1 -sne.ab #0-1, start -mov.ab #background - start, start -jmp start, >start -background: diff --git a/warriors/splitter.red b/warriors/splitter.red deleted file mode 100644 index 17016c4..0000000 --- a/warriors/splitter.red +++ /dev/null @@ -1,5 +0,0 @@ -;author blah -;name splitter - -spl 0 -jmp 0-1 diff --git a/warriors/trap.red b/warriors/trap.red deleted file mode 100644 index 681ea6e..0000000 --- a/warriors/trap.red +++ /dev/null @@ -1,28 +0,0 @@ -;author benji -;name trap - -org start - -trap: -spl 1 -jmp trap - -start: -mov.i bomb, bomb + 8 -add.ab #8, start -sub.ab #8, bomb -sne.ab #bomb - 8 - start, start -jmp core_clear -jmp start - -bomb: -jmp trap - 8 - -core_clear: -mov background, background + 1 -add.ab #1, core_clear -jnz.b core_clear, core_clear -mov.ab #background + 1 - core_clear, core_clear -jmp core_clear - -background: |