summaryrefslogtreecommitdiff
path: root/asm.myr
diff options
context:
space:
mode:
Diffstat (limited to 'asm.myr')
-rw-r--r--asm.myr11
1 files changed, 11 insertions, 0 deletions
diff --git a/asm.myr b/asm.myr
index dcacbda..800a6ef 100644
--- a/asm.myr
+++ b/asm.myr
@@ -55,11 +55,22 @@ const emitinstr = {p
match upcase(p[0])
| "CLS":
b = `std.Some([0x00, 0xe0])
+ | "RET":
+ b = `std.Some([0x00, 0xee])
| "SYS":
if p.len < 2
-> `std.Err("SYS missing subroutine address")
;;
match parsehex(p[1])
+ | `std.Some(n): b = `std.Some([0x00 | (n & 0x0f00), (n & 0xff)])
+ | `std.None: b = `std.Some([0x20, 0x00])
+ mark = `std.Some(strdup(p[1]))
+ ;;
+ | "CALL":
+ if p.len < 2
+ -> `std.Err("CALL missing subroutine address")
+ ;;
+ match parsehex(p[1])
| `std.Some(n): b = `std.Some([0x20 | (n & 0x0f00), (n & 0xff)])
| `std.None: b = `std.Some([0x20, 0x00])
mark = `std.Some(strdup(p[1]))