summaryrefslogtreecommitdiff
path: root/asm.myr
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-12-27 17:10:11 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>2019-12-27 17:10:11 -0500
commit0667a16224c5501e38b96c8c17cd041b5d2c73c3 (patch)
treeddd8992cf797bcd409625b9ed25e5f1ada625e07 /asm.myr
parentbc5fc660caa7881458e0d62905a1aec38dd2aaf0 (diff)
Implement SNE instruction.
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]))
;;