commit 63205c73d9c1a696f6fd482055621c8601611930
parent 65a143c4e5ab822dd47961dcb53a096f2e302dd7
Author: thing1 <l.standen@posteo.com>
Date: Wed, 1 Oct 2025 19:58:01 +0100
added examples and removed debug strings
Diffstat:
5 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/examples/Makefile b/examples/Makefile
@@ -1,7 +1,9 @@
-all: cat
+all: cat loadprog
cat: cat.ll
lliasm cat.ll cat.rom
+loadprog: loadprog.ll
+ lliasm loadprog.ll loadprog.rom
run: all
lli ./cat.rom
diff --git a/examples/cat.ll b/examples/cat.ll
@@ -1,18 +1,12 @@
-|0x0 @stdin
-|0x1 @stdout
-|0x2 @stderr
+|0x0 @stdin |0x1 @stdout |0x2 @stderr
|0x1000
-@while
+@loop
-&stdin
-loadb
+&stdin loadb
+&stdout storeb
-&stdout
-storeb
-
-&while
-jmp
+&loop jmp
halt
diff --git a/examples/loadprog.ll b/examples/loadprog.ll
@@ -0,0 +1,9 @@
+|0x0 @stdin |0x1 @stdout |0x2 @stderr
+
+|0x100 @prog
+
+|0x1000
+
+&stdin loadb
+&prog storeb
+&prog jmp
diff --git a/lli.c b/lli.c
@@ -113,7 +113,6 @@ step:
goto step;
end:
- printf("%s\n", s.arr);
free(s.arr);
}
diff --git a/lli.h b/lli.h
@@ -26,7 +26,7 @@ typedef enum ttype {
LOADI,
JMP,
- HALT,
+ HALT = 'A',
} ttype;
typedef struct tval {