summaryrefslogtreecommitdiff
path: root/asm.myr
diff options
context:
space:
mode:
Diffstat (limited to 'asm.myr')
-rw-r--r--asm.myr12
1 files changed, 12 insertions, 0 deletions
diff --git a/asm.myr b/asm.myr
index cd0db90..94d80f0 100644
--- a/asm.myr
+++ b/asm.myr
@@ -140,6 +140,18 @@ const emitinstr = {p
| _:
-> `std.Err(std.fmt("invalid arguments to SE: {}, {}", p[1], p[2]))
;;
+ | "SNE":
+ if p.len < 3
+ -> `std.Err("SNE missing arguments")
+ ;;
+ match (parselit(p[1]), parselit(p[2]))
+ | (`Register(m), `Number(n)):
+ b = `std.Some([0x40 | (m & 0x0f), (n & 0xff)])
+ | (`Register(m), `Register(n)):
+ b = `std.Some([0x90 | (m & 0x0f), (n & 0x0f) << 1])
+ | _:
+ -> `std.Err(std.fmt("invalid arguments to SNE: {}, {}", p[1], p[2]))
+ ;;
| _:
-> `std.Err(std.fmt("unrecognized instruction {}", p[0]))
;;