commit 8388b8d04e1a9316dd73befe0bd5d56d541ef304
parent 583b1e743a9e1da9b5405e104049a1674382512c
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Fri, 2 Apr 2021 22:16:33 +0000
asm.c: match full labels
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/asm.c b/asm.c
@@ -102,7 +102,7 @@ label(char *s)
{
int i;
for (i = 0; i < lc; i++) {
- if (strncmp(s, labels[i].name, 2) == 0) {
+ if (strncmp(s, labels[i].name, strlen(s)) == 0) {
write(1, &labels[i].addr, sizeof(CELL));
return 0;
}
@@ -163,6 +163,8 @@ main(int argc, char **argv)
pushlabel("if", VSM_IF);
pushlabel("ca", VSM_CALL);
pushlabel("ex", VSM_EXIT);
+ pushlabel("pu", VSM_PUTC);
+ pushlabel("ge", VSM_GETC);
pass1(argv[0]);
pass2();