the interpreter implementation is now hidden behing the src/libnoja/noja.h facade. Also I wrote a disassembler that lets you build noja executables by specifying the bytecode directly in a text format

This commit is contained in:
cozis
2022-08-11 16:26:56 +02:00
parent 784914c7e6
commit f8cd57da43
68 changed files with 1260 additions and 263 deletions
+32
View File
@@ -0,0 +1,32 @@
0: PUSHLST 4
1: PUSHINT 0
2: PUSHINT 1
3: INSERT
4: PUSHINT 1
5: PUSHINT 2
6: INSERT
7: PUSHINT 2
8: PUSHINT 3
9: INSERT
10: PUSHINT 3
11: PUSHINT 4
12: INSERT
13: ASS [l]
14: POP 1
15: PUSHSTR [ items.
]
16: PUSHVAR [l]
17: PUSHVAR [count]
18: CALL 1 1
19: PUSHSTR [The list contains ]
20: PUSHVAR [print]
21: CALL 3 1
22: POP 1
23: PUSHSTR [.
]
24: PUSHVAR [l]
25: PUSHSTR [The list is: ]
26: PUSHVAR [print]
27: CALL 3 1
28: POP 1
29: RETURN 0