diff --git a/wipforth.wat b/wipforth.wat index cce38fb..5f67416 100644 --- a/wipforth.wat +++ b/wipforth.wat @@ -1902,6 +1902,51 @@ ;; => 0x6c bytes + ;; : : + ;; WORD + ;; CREATE + ;; DOCOL , + ;; LATEST @ HIDDEN + ;; ] + ;; ; + + (data (i32.const 0x0d78) + "\0c\0d\00\00" + "\01:\00\00" + "\00\00\00\00" + "\74\06\00\00" ;; WORD + "\18\0d\00\00" ;; CREATE + "\c4\04\00\00" ;; DOCOL + "\5c\0a\00\00" ;; , + "\98\05\00\00" ;; LATEST + "\cc\03\00\00" ;; @ + "\a4\0c\00\00" ;; HIDDEN + "\38\0c\00\00" ;; ] + "\0c\04\00\00") ;; EXIT + + ;; => 0x30 bytes + + ;; : ; + ;; LIT EXIT , + ;; LATEST @ HIDDEN + ;; [ + ;; ; IMMEDIATE + + (data (i32.const 0xdb4) + "\78\0d\00\00" + "\81;\00\00" + "\00\00\00\00" + "\18\04\00\00" ;; LIT + "\0c\04\00\00" ;; EXIT + "\5c\0a\00\00" ;; , + "\98\05\00\00" ;; LATEST + "\cc\03\00\00" ;; @ + "\a4\0c\00\00" ;; HIDDEN + "\18\0c\00\00" ;; [ + "\0c\04\00\00") ;; EXIT + + ;; => 0x2c 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