Define [ and ]
This commit is contained in:
30
wipforth.wat
30
wipforth.wat
@@ -1764,6 +1764,36 @@
|
||||
"\04HALT\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
|
||||
;; jumps and code addresses. Instead of jumping into the next
|
||||
;; codeword, NEXT sets the $fn global to the function index of the
|
||||
|
||||
Reference in New Issue
Block a user