A bunch of prerequisites before we can do arrays, part 3, the pool pointer

This commit is contained in:
2023-11-13 00:32:57 -06:00
parent 0e766aebcf
commit 325288d7ba
6 changed files with 70 additions and 29 deletions
+3 -3
View File
@@ -108,9 +108,9 @@ fn cursed_call_test() {
"call _forge_gensym_3",
"hlt",
"_forge_gensym_1:", // foo()
"pushr","push 2","jmpr @_forge_gensym_2","push 0","_forge_gensym_2:","popr","pop","ret",
"dup", "pushr", "pushr","push 2","jmpr @_forge_gensym_2","push 0","_forge_gensym_2:","popr","pop", "popr","pop","ret",
"_forge_gensym_3:", // main()
"pushr", // preamble (no args)
"dup", "add 6", "pushr", "pushr", // preamble (no args, but 3 locals)
"push 0", "peekr", "storew", // repeat counter var (n)
"push 2", // repeat limit
"#while",
@@ -136,7 +136,7 @@ fn cursed_call_test() {
"pop", // Drop the loop limit off
"push 0", // Implicit return value
"_forge_gensym_4:",
"popr","pop","ret", // Standard outro
"popr","pop","popr","pop","ret", // Standard outro
"stack: .db 0", // The stack
].join("\n"))
}