aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-13 14:31:47 +0200
committerkdx <kikoodx@paranoici.org>2023-04-13 14:31:47 +0200
commit8c2e6ce5fa3c4f7484c52c4a1c1b72d5d80bb0c5 (patch)
treefd8c3c12d1f0828198d80deffae3ca5bf299efc8
parent54e5a3fc57b9cfdaf4650486971834fd111b209b (diff)
downloadorga-8c2e6ce5fa3c4f7484c52c4a1c1b72d5d80bb0c5.tar.gz
too lazy
-rw-r--r--samples/helloworld.orgaasm2
-rw-r--r--src/orgaasm.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/samples/helloworld.orgaasm b/samples/helloworld.orgaasm
index d968543..e3f39a7 100644
--- a/samples/helloworld.orgaasm
+++ b/samples/helloworld.orgaasm
@@ -4,7 +4,7 @@ RET
@putstr ( str -- )
DUP LDA WRT ( write )
- LIT 0001 ADD ( increment pointer )
+ #0001 ADD ( increment pointer )
DUP LDA ( loop until end of string )
JNZ ,putstr
RET
diff --git a/src/orgaasm.c b/src/orgaasm.c
index cafab0e..793a2dd 100644
--- a/src/orgaasm.c
+++ b/src/orgaasm.c
@@ -181,6 +181,12 @@ second_pass(char *s)
if (verbose) printf("opcode: %s\n", tok);
write_opcode(tok);
break;
+ case 5: /* LIT literal */
+ if (tok[0] != '#')
+ fprintf(stderr, "unknown token '%s'\n", tok);
+ write_short(OP_LIT);
+ tok += 1;
+ /* fallthrough */
case 4: /* literal */
if (verbose) printf("literal: %s\n", tok);
write_literal(tok);