summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm.myr40
1 files changed, 20 insertions, 20 deletions
diff --git a/asm.myr b/asm.myr
index c0f92c7..be8c0ca 100644
--- a/asm.myr
+++ b/asm.myr
@@ -107,7 +107,7 @@ const emitinstr = {p
| `Label(l): b = `std.Some([0x00, 0x00])
mark = `std.Some(strdup(l))
| _:
- -> `std.Err(std.fmt("invalid argument to SYS: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SYS: {}", p[1:]))
;;
| "CALL":
if p.len < 2
@@ -118,7 +118,7 @@ const emitinstr = {p
| `Label(l): b = `std.Some([0x20, 0x00])
mark = `std.Some(strdup(l))
| _:
- -> `std.Err(std.fmt("invalid argument to CALL: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to CALL: {}", p[1:]))
;;
| "JP":
if p.len < 2
@@ -129,7 +129,7 @@ const emitinstr = {p
| `Label(l): b = `std.Some([0x10, 0x00])
mark = `std.Some(strdup(l))
| _:
- -> `std.Err(std.fmt("invalid argument to JP: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to JP: {}", p[1:]))
;;
else
match (parselit(p[1]), parselit(p[2]))
@@ -138,7 +138,7 @@ const emitinstr = {p
| (`Register(0), `Label(l)): b = `std.Some([0xb0, 0x00])
mark = `std.Some(strdup(l))
| _:
- -> `std.Err(std.fmt("invalid arguments to JP: {}, {}", p[1], p[2]))
+ -> `std.Err(std.fmt("invalid arguments to JP: {}", p[1:]))
;;
;;
| "SE":
@@ -151,7 +151,7 @@ const emitinstr = {p
| (`Register(m), `Register(n)):
b = `std.Some([0x50 | (m & 0x0f), (n & 0x0f) << 1])
| _:
- -> `std.Err(std.fmt("invalid arguments to SE: {}, {}", p[1], p[2]))
+ -> `std.Err(std.fmt("invalid arguments to SE: {}", p[1:]))
;;
| "SNE":
if p.len < 3
@@ -163,7 +163,7 @@ const emitinstr = {p
| (`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("invalid arguments to SNE: {}", p[1:]))
;;
| "SKP":
if p.len < 2
@@ -172,7 +172,7 @@ const emitinstr = {p
match parselit(p[1])
| `Register(n): b = `std.Some([0xe0 | (n & 0x0f), 0x9e])
| _:
- -> `std.Err(std.fmt("invalid argument to SKP: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SKP: {}", p[1:]))
;;
| "SKNP":
if p.len < 2
@@ -181,7 +181,7 @@ const emitinstr = {p
match parselit(p[1])
| `Register(n): b = `std.Some([0xe0 | (n & 0x0f), 0xa1])
| _:
- -> `std.Err(std.fmt("invalid argument to SKNP: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SKNP: {}", p[1:]))
;;
| "LD":
if p.len < 3
@@ -200,7 +200,7 @@ const emitinstr = {p
| (`DerefAddr, `Register(n)): b = `std.Some([0xf0 | (n & 0x0f), 0x55])
| (`Register(n), `DerefAddr): b = `std.Some([0xf0 | (n & 0x0f), 0x65])
| _:
- -> `std.Err(std.fmt("invalid argument to LD: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to LD: {}", p[1:]))
;;
| "ADD":
if p.len < 3
@@ -211,7 +211,7 @@ const emitinstr = {p
| (`Register(m), `Number(n)): b = `std.Some([0x70 | (m & 0x0f), n & 0xff])
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x04])
| _:
- -> `std.Err(std.fmt("invalid argument to ADD: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to ADD: {}", p[1:]))
;;
| "SUB":
if p.len < 3
@@ -220,7 +220,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x05])
| _:
- -> `std.Err(std.fmt("invalid argument to SUB: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SUB: {}", p[1:]))
;;
| "SUBN":
if p.len < 3
@@ -229,7 +229,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x07])
| _:
- -> `std.Err(std.fmt("invalid argument to SUBN: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SUBN: {}", p[1:]))
;;
| "OR":
if p.len < 3
@@ -238,7 +238,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x01])
| _:
- -> `std.Err(std.fmt("invalid argument to OR: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to OR: {}", p[1:]))
;;
| "AND":
if p.len < 3
@@ -247,7 +247,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x02])
| _:
- -> `std.Err(std.fmt("invalid argument to AND: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to AND: {}", p[1:]))
;;
| "XOR":
if p.len < 3
@@ -256,7 +256,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Register(n)): b = `std.Some([0x80 | (m & 0x0f), ((n & 0x0f) << 1) | 0x03])
| _:
- -> `std.Err(std.fmt("invalid argument to XOR: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to XOR: {}", p[1:]))
;;
| "SHR":
if p.len < 2
@@ -265,7 +265,7 @@ const emitinstr = {p
match parselit(p[1])
| `Register(n): `std.Some([0x80 | (n & 0x0f), 0x06])
| _:
- -> `std.Err(std.fmt("invalid argument to SHR: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SHR: {}", p[1:]))
;;
| "SHL":
if p.len < 2
@@ -274,7 +274,7 @@ const emitinstr = {p
match parselit(p[1])
| `Register(n): `std.Some([0x80 | (n & 0x0f), 0x0e])
| _:
- -> `std.Err(std.fmt("invalid argument to SHL: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to SHL: {}", p[1:]))
;;
| "BCD":
if p.len < 2
@@ -283,7 +283,7 @@ const emitinstr = {p
match parselit(p[1])
| `Register(n): `std.Some([0xf0 | (n & 0x0f), 0x33])
| _:
- -> `std.Err(std.fmt("invalid argument to BCD: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to BCD: {}", p[1:]))
;;
| "RND":
if p.len < 3
@@ -292,7 +292,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]))
| (`Register(m), `Number(n)): b = `std.Some([0xc0 | (m & 0x0f), n & 0xff])
| _:
- -> `std.Err(std.fmt("invalid argument to RND: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to RND: {}", p[1:]))
;;
| "DRW":
if p.len < 4
@@ -301,7 +301,7 @@ const emitinstr = {p
match (parselit(p[1]), parselit(p[2]), parselit(p[3]))
| (`Register(m), `Register(n), `Number(q)): b = `std.Some([0xc0 | (m & 0x0f), (n & 0x0f) << 1 | (q & 0x0f)])
| _:
- -> `std.Err(std.fmt("invalid argument to DRW: {}", p[1]))
+ -> `std.Err(std.fmt("invalid arguments to DRW: {}", p[1:]))
;;
| _:
-> `std.Err(std.fmt("unrecognized instruction {}", p[0]))