Define ALIGN
This commit is contained in:
26
wipforth.wat
26
wipforth.wat
@@ -1794,6 +1794,32 @@
|
|||||||
|
|
||||||
;; => 0x20 bytes
|
;; => 0x20 bytes
|
||||||
|
|
||||||
|
;; : ALIGN
|
||||||
|
;; DUP 3 AND 0BRANCH [32]
|
||||||
|
;; 0 OVER C! 1+ BRANCH [-48]
|
||||||
|
;; ;
|
||||||
|
|
||||||
|
(data (i32.const 0x0c50)
|
||||||
|
"\30\0c\00\00"
|
||||||
|
"\05ALIGN\00\00"
|
||||||
|
"\00\00\00\00"
|
||||||
|
"\08\02\00\00" ;; DUP
|
||||||
|
"\18\04\00\00" ;; LIT
|
||||||
|
"\03\00\00\00" ;; 3
|
||||||
|
"\8c\03\00\00" ;; AND
|
||||||
|
"\b4\04\00\00" ;; 0BRANCH
|
||||||
|
"\20\00\00\00" ;; 32
|
||||||
|
"\18\04\00\00" ;; LIT
|
||||||
|
"\00\00\00\00" ;; 0
|
||||||
|
"\54\02\00\00" ;; OVER
|
||||||
|
"\f0\03\00\00" ;; C!
|
||||||
|
"\90\02\00\00" ;; 1+
|
||||||
|
"\a4\04\00\00" ;; BRANCH
|
||||||
|
"\d0\ff\ff\ff" ;; -48
|
||||||
|
"\0c\04\00\00") ;; EXIT
|
||||||
|
|
||||||
|
;; => 0x48 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