aboutsummaryrefslogtreecommitdiff
path: root/tr8as.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-06 12:05:38 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-06 12:05:38 +0100
commitdd194bf4de0d54cef7e14aeb7576d799acb61840 (patch)
tree65f9c75121368ca11862ab689cd575c49931937a /tr8as.c
parente55d0bef8fdaa1c5a1b963968d12c40b29dcba3b (diff)
downloadtr8vm-dd194bf4de0d54cef7e14aeb7576d799acb61840.tar.gz
tr8vm-dd194bf4de0d54cef7e14aeb7576d799acb61840.zip
Fixes port parsing and r3
Diffstat (limited to 'tr8as.c')
-rw-r--r--tr8as.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tr8as.c b/tr8as.c
index fcc2c21..1b354ce 100644
--- a/tr8as.c
+++ b/tr8as.c
@@ -1037,6 +1037,11 @@ static uint8_t parse_port(As *as, char **c)
if (r1 == 0xff)
return error_l("Syntax error", &as->loc, word);
+ *c = skip_whitespace(*c);
+ if (**c != ',')
+ return error_l("Syntax error", &as->loc, "expected ,");
+ (*c)++;
+
if (!next_word(as, c, word, &wlen))
return 0;
@@ -1047,7 +1052,7 @@ static uint8_t parse_port(As *as, char **c)
if (r2 == 0xff)
return error_l("Syntax error", &as->loc, word);
- return emit(as, 0, r1, FHH, r2);
+ return emit(as, 0, r1, FHH, r2 << 6);
}
static uint8_t parse_pop(As *as, char **c)