summaryrefslogtreecommitdiff
path: root/warriors
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2023-05-30 01:07:38 -0400
committerBenji Dial <benji@benjidial.net>2023-05-30 01:07:38 -0400
commit78835a06e4fe2429a658d849c59d999eb97bc03c (patch)
tree40df6b28f3119f41705f30a4c88b78a65ad9d5cb /warriors
parentfbabd9f8019cb5c9ca0736182eac40ea79d295e9 (diff)
downloadlib94-78835a06e4fe2429a658d849c59d999eb97bc03c.tar.gz
unary + and - in compiler
Diffstat (limited to 'warriors')
-rw-r--r--warriors/dwarf-replicator.red2
-rw-r--r--warriors/dwarf.red4
-rw-r--r--warriors/epson.red6
3 files changed, 6 insertions, 6 deletions
diff --git a/warriors/dwarf-replicator.red b/warriors/dwarf-replicator.red
index f301a05..01a1494 100644
--- a/warriors/dwarf-replicator.red
+++ b/warriors/dwarf-replicator.red
@@ -37,7 +37,7 @@ dwarf:
core_clear:
mov end, end + 1
- add.ab #1, 0-1
+ add.ab #1, -1
jmp 2
dat
diff --git a/warriors/dwarf.red b/warriors/dwarf.red
index e0e2638..d2df37e 100644
--- a/warriors/dwarf.red
+++ b/warriors/dwarf.red
@@ -2,5 +2,5 @@
;name Dwarf
mov 3, 7
-add.ab #4, 0-1
-jmp 0-2
+add.ab #4, -1
+jmp -2
diff --git a/warriors/epson.red b/warriors/epson.red
index b0409f0..a327807 100644
--- a/warriors/epson.red
+++ b/warriors/epson.red
@@ -6,7 +6,7 @@ period equ 10
scan_init equ end - (end - scan) % period + period
scan:
- seq.i 0 - period, scan_init
+ seq.i -period, scan_init
jmp found
found_ret:
@@ -18,13 +18,13 @@ found_ret:
jmn.a scan, scan
clear:
- mov end, 0 - 1
+ mov end, - 1
sub.ab #2, clear
seq.ab #end - clear - (end - clear) % 2 + 3, clear
jmp clear
- mov.ab #0 - 1, clear
+ mov.ab #-1, clear
jmp clear
scan_add: