Define IMMEDIATE
This commit is contained in:
23
wipforth.wat
23
wipforth.wat
@@ -1838,6 +1838,29 @@
|
|||||||
|
|
||||||
;; => 0x34 bytes
|
;; => 0x34 bytes
|
||||||
|
|
||||||
|
;; : IMMEDIATE
|
||||||
|
;; LATEST @
|
||||||
|
;; 4+ DUP C@ 128 XOR SWAP C!
|
||||||
|
;; ; IMMEDIATE
|
||||||
|
|
||||||
|
(data (i32.const 0x0ccc)
|
||||||
|
"\98\0c\00\00"
|
||||||
|
"\89IMMEDIATE\00\00"
|
||||||
|
"\00\00\00\00"
|
||||||
|
"\98\05\00\00" ;; LATEST
|
||||||
|
"\cc\03\00\00" ;; @
|
||||||
|
"\a8\02\00\00" ;; 4+
|
||||||
|
"\08\02\00\00" ;; DUP
|
||||||
|
"\fc\03\00\00" ;; C@
|
||||||
|
"\18\04\00\00" ;; LIT
|
||||||
|
"\80\00\00\00" ;; 128
|
||||||
|
"\a4\03\00\00" ;; XOR
|
||||||
|
"\28\02\00\00" ;; SWAP
|
||||||
|
"\f0\03\00\00" ;; C!
|
||||||
|
"\0c\04\00\00") ;; EXIT
|
||||||
|
|
||||||
|
;; => 0x40 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
|
||||||
|
|||||||
Reference in New Issue
Block a user