Define [ and ]

This commit is contained in:
2026-02-28 17:36:16 +00:00
parent c0b2c7d7d2
commit f314234078

View File

@@ -1764,6 +1764,36 @@
"\04HALT\00\00\00" "\04HALT\00\00\00"
"\3e\00\00\00") "\3e\00\00\00")
;; And now to make myself obsolete as the compiler (finally)
;; : [ 0 STATE ! ; IMMEDIATE
(data (i32.const 0x0c10)
"\00\0c\00\00"
"\81[\00\00"
"\00\00\00\00"
"\18\04\00\00" ;; LIT
"\00\00\00\00" ;; 0
"\5c\05\00\00" ;; STATE
"\c0\03\00\00" ;; !
"\0c\04\00\00") ;; EXIT
;; => 0x20 bytes
;; : ] 1 STATE ! ;
(data (i32.const 0x0c30)
"\10\0c\00\00"
"\01]\00\00"
"\00\00\00\00"
"\18\04\00\00" ;; LIT
"\01\00\00\00" ;; 1
"\5c\05\00\00" ;; STATE
"\c0\03\00\00" ;; !
"\0c\04\00\00") ;; EXIT
;; => 0x20 bytes
;; The trampoline is a workaround for WebAssembly's lack of indirect ;; The trampoline is a workaround for WebAssembly's lack of indirect
;; jumps and code addresses. Instead of jumping into the next ;; jumps and code addresses. Instead of jumping into the next
;; codeword, NEXT sets the $fn global to the function index of the ;; codeword, NEXT sets the $fn global to the function index of the