aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-11 17:15:36 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-11 17:15:36 +0100
commite316dc79408850e55b06d088a00d403bd7c24e25 (patch)
tree843eef6d121df36f9ea191e1095c453eeeb734a7
parent81cef95a0235e917975919a0f58527ba963f11b6 (diff)
downloadtr8vm-e316dc79408850e55b06d088a00d403bd7c24e25.tar.gz
tr8vm-e316dc79408850e55b06d088a00d403bd7c24e25.zip
Fix dw immediate
-rw-r--r--tr8as.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tr8as.c b/tr8as.c
index 6206132..a32839e 100644
--- a/tr8as.c
+++ b/tr8as.c
@@ -713,10 +713,9 @@ static uint8_t parse_dw(As *as, char **c)
if (wlen == 0)
return error_l("Syntax error", &as->loc, "expected immediate");
- if (next_imm(as, word, &imm))
- return error_l("Syntax error", &as->loc, word);
- else if (!new_ref(as, word, 0xffff, as->addr))
- return 0;
+ if (!next_imm(as, word, &imm))
+ if (!new_ref(as, word, 0xffff, as->addr))
+ return 0;
as->out[as->addr++] = imm & 0xff;
as->out[as->addr++] = imm >> 8;