mirror of
https://github.com/remko/waforth
synced 2025-01-30 08:34:58 +01:00
COMPILE,
This commit is contained in:
parent
d2fee658dd
commit
c9ae5e0a03
2 changed files with 205 additions and 199 deletions
392
src/waforth.wat
392
src/waforth.wat
|
@ -64,7 +64,7 @@
|
|||
;; COMPILE_CALL_INDEX := 5
|
||||
;; PUSH_INDIRECT_INDEX := 6
|
||||
;; END_DO_INDEX := 9
|
||||
(table (export "table") 0xaf funcref)
|
||||
(table (export "table") 0xb0 funcref)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -411,7 +411,7 @@
|
|||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $Sq)
|
||||
(call $emitICall (i32.const 0) (i32.const 0x9d (; = index("TYPE") ;))))
|
||||
(call $emitICall (i32.const 0) (i32.const 0x9e (; = index("TYPE") ;))))
|
||||
(data (i32.const 0x20178) "\6c\01\02\00" "\82" (; F_IMMEDIATE ;) ".\22 " "\22\00\00\00")
|
||||
(elem (i32.const 0x22) $.q)
|
||||
|
||||
|
@ -797,7 +797,7 @@
|
|||
(local.get $tos)
|
||||
(call $compileIf)
|
||||
(call $Sq)
|
||||
(call $emitICall (i32.const 0) (i32.const 0x9d (; = index("TYPE") ;)))
|
||||
(call $emitICall (i32.const 0) (i32.const 0x9e (; = index("TYPE") ;)))
|
||||
(call $emitICall (i32.const 0) (i32.const 0x43 (; = index("ABORT") ;)))
|
||||
(call $compileThen))
|
||||
(data (i32.const 0x20344) "\34\03\02\00" "\86" (; F_IMMEDIATE ;) "ABORT\22 " "\44\00\00\00")
|
||||
|
@ -983,6 +983,12 @@
|
|||
(data (i32.const 0x2044c) "\3c\04\02\00" "\05" "CHARS " "\55\00\00\00")
|
||||
(elem (i32.const 0x55) $CHARS)
|
||||
|
||||
;; [6.2.0945](https://forth-standard.org/standard/core/COMPILEComma)
|
||||
(func $COMPILEComma (param $tos i32) (result i32)
|
||||
(call $compileCall (call $pop (local.get $tos))))
|
||||
(data (i32.const 0x2045c) "\4c\04\02\00" "\08" "COMPILE, " "\56\00\00\00")
|
||||
(elem (i32.const 0x56) $COMPILEComma)
|
||||
|
||||
;; [6.1.0950](https://forth-standard.org/standard/core/CONSTANT)
|
||||
(func $CONSTANT (param $tos i32) (result i32)
|
||||
(local $v i32)
|
||||
|
@ -992,8 +998,8 @@
|
|||
(local.set $v (call $pop))
|
||||
(i32.store (global.get $here) (local.get $v))
|
||||
(global.set $here (i32.add (global.get $here) (i32.const 4))))
|
||||
(data (i32.const 0x2045c) "\4c\04\02\00" "\08" "CONSTANT " "\56\00\00\00")
|
||||
(elem (i32.const 0x56) $CONSTANT)
|
||||
(data (i32.const 0x20470) "\5c\04\02\00" "\08" "CONSTANT " "\57\00\00\00")
|
||||
(elem (i32.const 0x57) $CONSTANT)
|
||||
|
||||
;; [6.1.0980](https://forth-standard.org/standard/core/COUNT)
|
||||
(func $COUNT (param $tos i32) (result i32)
|
||||
|
@ -1004,14 +1010,14 @@
|
|||
(i32.const 4)))))))
|
||||
(i32.store (local.get $btos) (i32.add (local.get $addr) (i32.const 1)))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20470) "\5c\04\02\00" "\05" "COUNT " "\57\00\00\00")
|
||||
(elem (i32.const 0x57) $COUNT)
|
||||
(data (i32.const 0x20484) "\70\04\02\00" "\05" "COUNT " "\58\00\00\00")
|
||||
(elem (i32.const 0x58) $COUNT)
|
||||
|
||||
;; [6.1.0990](https://forth-standard.org/standard/core/CR)
|
||||
(func $CR (param $tos i32) (result i32)
|
||||
(call $push (local.get $tos) (i32.const 10)) (call $EMIT))
|
||||
(data (i32.const 0x20480) "\70\04\02\00" "\02" "CR " "\58\00\00\00")
|
||||
(elem (i32.const 0x58) $CR)
|
||||
(data (i32.const 0x20494) "\84\04\02\00" "\02" "CR " "\59\00\00\00")
|
||||
(elem (i32.const 0x59) $CR)
|
||||
|
||||
;; [6.1.1000](https://forth-standard.org/standard/core/CREATE)
|
||||
(func $CREATE (param $tos i32) (result i32)
|
||||
|
@ -1026,31 +1032,31 @@
|
|||
(i32.const 0x40 (; = F_DATA ;))
|
||||
(i32.const 0x3 (; = PUSH_DATA_ADDRESS_INDEX ;)))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x2048c) "\80\04\02\00" "\06" "CREATE " "\59\00\00\00")
|
||||
(elem (i32.const 0x59) $CREATE)
|
||||
(data (i32.const 0x204a0) "\94\04\02\00" "\06" "CREATE " "\5a\00\00\00")
|
||||
(elem (i32.const 0x5a) $CREATE)
|
||||
|
||||
;; [6.1.1170](https://forth-standard.org/standard/core/DECIMAL)
|
||||
(func $DECIMAL (param $tos i32) (result i32)
|
||||
(i32.store (i32.const 0x203bc (; = body(BASE) ;)) (i32.const 10))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x2049c) "\8c\04\02\00" "\07" "DECIMAL" "\5a\00\00\00")
|
||||
(elem (i32.const 0x5a) $DECIMAL)
|
||||
(data (i32.const 0x204b0) "\a0\04\02\00" "\07" "DECIMAL" "\5b\00\00\00")
|
||||
(elem (i32.const 0x5b) $DECIMAL)
|
||||
|
||||
;; [6.1.1200](https://forth-standard.org/standard/core/DEPTH)
|
||||
(func $DEPTH (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos)
|
||||
(i32.shr_u (i32.sub (local.get $tos) (i32.const 0x10000 (; = STACK_BASE ;))) (i32.const 2)))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x204ac) "\9c\04\02\00" "\05" "DEPTH " "\5b\00\00\00")
|
||||
(elem (i32.const 0x5b) $DEPTH)
|
||||
(data (i32.const 0x204c0) "\b0\04\02\00" "\05" "DEPTH " "\5c\00\00\00")
|
||||
(elem (i32.const 0x5c) $DEPTH)
|
||||
|
||||
;; [6.1.1240](https://forth-standard.org/standard/core/DO)
|
||||
(func $DO (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileDo (i32.const 0)))
|
||||
(data (i32.const 0x204bc) "\ac\04\02\00" "\82" (; F_IMMEDIATE ;) "DO " "\5c\00\00\00")
|
||||
(elem (i32.const 0x5c) $DO)
|
||||
(data (i32.const 0x204d0) "\c0\04\02\00" "\82" (; F_IMMEDIATE ;) "DO " "\5d\00\00\00")
|
||||
(elem (i32.const 0x5d) $DO)
|
||||
|
||||
;; [6.1.1250](https://forth-standard.org/standard/core/DOES)
|
||||
(func $DOES> (param $tos i32) (result i32)
|
||||
|
@ -1061,37 +1067,37 @@
|
|||
(call $endColon)
|
||||
(call $startColon (i32.const 1))
|
||||
(call $compilePushLocal (i32.const 1)))
|
||||
(data (i32.const 0x204c8) "\bc\04\02\00" "\85" (; F_IMMEDIATE ;) "DOES> " "\5d\00\00\00")
|
||||
(elem (i32.const 0x5d) $DOES>)
|
||||
(data (i32.const 0x204dc) "\d0\04\02\00" "\85" (; F_IMMEDIATE ;) "DOES> " "\5e\00\00\00")
|
||||
(elem (i32.const 0x5e) $DOES>)
|
||||
|
||||
;; [6.1.1260](https://forth-standard.org/standard/core/DROP)
|
||||
(func $DROP (param $tos i32) (result i32)
|
||||
(i32.sub (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x204d8) "\c8\04\02\00" "\04" "DROP " "\5e\00\00\00")
|
||||
(elem (i32.const 0x5e) $DROP)
|
||||
(data (i32.const 0x204ec) "\dc\04\02\00" "\04" "DROP " "\5f\00\00\00")
|
||||
(elem (i32.const 0x5f) $DROP)
|
||||
|
||||
;; [6.1.1290](https://forth-standard.org/standard/core/DUP)
|
||||
(func $DUP (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos)
|
||||
(i32.load (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x204e8) "\d8\04\02\00" "\03" "DUP" "\5f\00\00\00")
|
||||
(elem (i32.const 0x5f) $DUP)
|
||||
(data (i32.const 0x204fc) "\ec\04\02\00" "\03" "DUP" "\60\00\00\00")
|
||||
(elem (i32.const 0x60) $DUP)
|
||||
|
||||
;; [6.1.1310](https://forth-standard.org/standard/core/ELSE)
|
||||
(func $ELSE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $emitElse))
|
||||
(data (i32.const 0x204f4) "\e8\04\02\00" "\84" (; F_IMMEDIATE ;) "ELSE " "\60\00\00\00")
|
||||
(elem (i32.const 0x60) $ELSE)
|
||||
(data (i32.const 0x20508) "\fc\04\02\00" "\84" (; F_IMMEDIATE ;) "ELSE " "\61\00\00\00")
|
||||
(elem (i32.const 0x61) $ELSE)
|
||||
|
||||
;; [6.1.1320](https://forth-standard.org/standard/core/EMIT)
|
||||
(func $EMIT (param $tos i32) (result i32)
|
||||
(call $shell_emit (i32.load (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(i32.sub (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20504) "\f4\04\02\00" "\04" "EMIT " "\61\00\00\00")
|
||||
(elem (i32.const 0x61) $EMIT)
|
||||
(data (i32.const 0x20518) "\08\05\02\00" "\04" "EMIT " "\62\00\00\00")
|
||||
(elem (i32.const 0x62) $EMIT)
|
||||
|
||||
;; [6.1.1345](https://forth-standard.org/standard/core/ENVIRONMENTq)
|
||||
(func $ENVIRONMENT? (param $tos i32) (result i32)
|
||||
|
@ -1115,8 +1121,8 @@
|
|||
(else
|
||||
(i32.store (local.get $bbtos) (i32.const 0))
|
||||
(local.get $btos))))))
|
||||
(data (i32.const 0x20514) "\04\05\02\00" "\0c" "ENVIRONMENT? " "\62\00\00\00")
|
||||
(elem (i32.const 0x62) $ENVIRONMENT?)
|
||||
(data (i32.const 0x20528) "\18\05\02\00" "\0c" "ENVIRONMENT? " "\63\00\00\00")
|
||||
(elem (i32.const 0x63) $ENVIRONMENT?)
|
||||
|
||||
;; [6.2.1350](https://forth-standard.org/standard/core/ERASE)
|
||||
(func $ERASE (param $tos i32) (result i32)
|
||||
|
@ -1126,8 +1132,8 @@
|
|||
(i32.const 0)
|
||||
(i32.load (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(local.get $bbtos))
|
||||
(data (i32.const 0x2052c) "\14\05\02\00" "\05" "ERASE " "\63\00\00\00")
|
||||
(elem (i32.const 0x63) $ERASE)
|
||||
(data (i32.const 0x20540) "\28\05\02\00" "\05" "ERASE " "\64\00\00\00")
|
||||
(elem (i32.const 0x64) $ERASE)
|
||||
|
||||
;; [6.1.1360](https://forth-standard.org/standard/core/EVALUATE)
|
||||
(func $EVALUATE (param $tos i32) (result i32)
|
||||
|
@ -1155,28 +1161,28 @@
|
|||
(i32.store (i32.const 0x202f8 (; = body(>IN) ;)) (local.get $prevIn))
|
||||
(global.set $inputBufferBase (local.get $prevInputBufferBase))
|
||||
(global.set $inputBufferSize (local.get $prevInputBufferSize)))
|
||||
(data (i32.const 0x2053c) "\2c\05\02\00" "\08" "EVALUATE " "\64\00\00\00")
|
||||
(elem (i32.const 0x64) $EVALUATE)
|
||||
(data (i32.const 0x20550) "\40\05\02\00" "\08" "EVALUATE " "\65\00\00\00")
|
||||
(elem (i32.const 0x65) $EVALUATE)
|
||||
|
||||
;; [6.1.1370](https://forth-standard.org/standard/core/EXECUTE)
|
||||
(func $EXECUTE (param $tos i32) (result i32)
|
||||
(call $execute (call $pop (local.get $tos))))
|
||||
(data (i32.const 0x20550) "\3c\05\02\00" "\07" "EXECUTE" "\65\00\00\00")
|
||||
(elem (i32.const 0x65) $EXECUTE)
|
||||
(data (i32.const 0x20564) "\50\05\02\00" "\07" "EXECUTE" "\66\00\00\00")
|
||||
(elem (i32.const 0x66) $EXECUTE)
|
||||
|
||||
;; [6.1.1380](https://forth-standard.org/standard/core/EXIT)
|
||||
(func $EXIT (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $emitReturn))
|
||||
(data (i32.const 0x20560) "\50\05\02\00" "\84" (; F_IMMEDIATE ;) "EXIT " "\66\00\00\00")
|
||||
(elem (i32.const 0x66) $EXIT)
|
||||
(data (i32.const 0x20574) "\64\05\02\00" "\84" (; F_IMMEDIATE ;) "EXIT " "\67\00\00\00")
|
||||
(elem (i32.const 0x67) $EXIT)
|
||||
|
||||
;; [6.2.1485](https://forth-standard.org/standard/core/FALSE)
|
||||
(func $FALSE (param $tos i32) (result i32)
|
||||
(call $push (local.get $tos) (i32.const 0x0)))
|
||||
(data (i32.const 0x20570) "\60\05\02\00" "\05" "FALSE " "\67\00\00\00")
|
||||
(elem (i32.const 0x67) $FALSE)
|
||||
(data (i32.const 0x20584) "\74\05\02\00" "\05" "FALSE " "\68\00\00\00")
|
||||
(elem (i32.const 0x68) $FALSE)
|
||||
|
||||
;; [6.1.1540](https://forth-standard.org/standard/core/FILL)
|
||||
(func $FILL (param $tos i32) (result i32)
|
||||
|
@ -1186,8 +1192,8 @@
|
|||
(i32.load (i32.sub (local.get $tos) (i32.const 4)))
|
||||
(i32.load (i32.sub (local.get $tos) (i32.const 8))))
|
||||
(local.get $bbbtos))
|
||||
(data (i32.const 0x20580) "\70\05\02\00" "\04" "FILL " "\68\00\00\00")
|
||||
(elem (i32.const 0x68) $FILL)
|
||||
(data (i32.const 0x20594) "\84\05\02\00" "\04" "FILL " "\69\00\00\00")
|
||||
(elem (i32.const 0x69) $FILL)
|
||||
|
||||
;; [6.1.1550](https://forth-standard.org/standard/core/FIND)
|
||||
(func $FIND (param $tos i32) (result i32)
|
||||
|
@ -1203,8 +1209,8 @@
|
|||
(else (i32.store (i32.sub (local.get $tos) (i32.const 4)) (local.get $xt))))
|
||||
(i32.store (local.get $tos) (local.get $r))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20590) "\80\05\02\00" "\04" "FIND " "\69\00\00\00")
|
||||
(elem (i32.const 0x69) $FIND)
|
||||
(data (i32.const 0x205a4) "\94\05\02\00" "\04" "FIND " "\6a\00\00\00")
|
||||
(elem (i32.const 0x6a) $FIND)
|
||||
|
||||
;; [6.1.1561](https://forth-standard.org/standard/core/FMDivMOD)
|
||||
(func $FM/MOD (param $tos i32) (result i32)
|
||||
|
@ -1231,22 +1237,22 @@
|
|||
(i32.store (local.get $bbbtos) (local.get $mod))
|
||||
(i32.store (i32.sub (local.get $tos) (i32.const 8)) (local.get $q))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x205a0) "\90\05\02\00" "\06" "FM/MOD " "\6a\00\00\00")
|
||||
(elem (i32.const 0x6a) $FM/MOD)
|
||||
(data (i32.const 0x205b4) "\a4\05\02\00" "\06" "FM/MOD " "\6b\00\00\00")
|
||||
(elem (i32.const 0x6b) $FM/MOD)
|
||||
|
||||
;; [6.1.1650](https://forth-standard.org/standard/core/HERE)
|
||||
(func $HERE (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (global.get $here))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x205b0) "\a0\05\02\00" "\04" "HERE " "\6b\00\00\00")
|
||||
(elem (i32.const 0x6b) $HERE)
|
||||
(data (i32.const 0x205c4) "\b4\05\02\00" "\04" "HERE " "\6c\00\00\00")
|
||||
(elem (i32.const 0x6c) $HERE)
|
||||
|
||||
;; [6.2.1660](https://forth-standard.org/standard/core/HEX)
|
||||
(func $HEX (param $tos i32) (result i32)
|
||||
(i32.store (i32.const 0x203bc (; = body(BASE) ;)) (i32.const 16))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x205c0) "\b0\05\02\00" "\03" "HEX" "\6c\00\00\00")
|
||||
(elem (i32.const 0x6c) $HEX)
|
||||
(data (i32.const 0x205d4) "\c4\05\02\00" "\03" "HEX" "\6d\00\00\00")
|
||||
(elem (i32.const 0x6d) $HEX)
|
||||
|
||||
;; [6.1.1670](https://forth-standard.org/standard/core/HOLD)
|
||||
(func $HOLD (param $tos i32) (result i32)
|
||||
|
@ -1257,30 +1263,30 @@
|
|||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))))
|
||||
(global.set $po (local.get $npo))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x205cc) "\c0\05\02\00" "\04" "HOLD " "\6d\00\00\00")
|
||||
(elem (i32.const 0x6d) $HOLD)
|
||||
(data (i32.const 0x205e0) "\d4\05\02\00" "\04" "HOLD " "\6e\00\00\00")
|
||||
(elem (i32.const 0x6e) $HOLD)
|
||||
|
||||
;; [6.1.1680](https://forth-standard.org/standard/core/I)
|
||||
(func $I (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (i32.load (i32.sub (global.get $tors) (i32.const 4))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x205dc) "\cc\05\02\00" "\01" "I " "\6e\00\00\00")
|
||||
(elem (i32.const 0x6e) $I)
|
||||
(data (i32.const 0x205f0) "\e0\05\02\00" "\01" "I " "\6f\00\00\00")
|
||||
(elem (i32.const 0x6f) $I)
|
||||
|
||||
;; [6.1.1700](https://forth-standard.org/standard/core/IF)
|
||||
(func $IF (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileIf))
|
||||
(data (i32.const 0x205e8) "\dc\05\02\00" "\82" (; F_IMMEDIATE ;) "IF " "\6f\00\00\00")
|
||||
(elem (i32.const 0x6f) $IF)
|
||||
(data (i32.const 0x205fc) "\f0\05\02\00" "\82" (; F_IMMEDIATE ;) "IF " "\70\00\00\00")
|
||||
(elem (i32.const 0x70) $IF)
|
||||
|
||||
;; [6.1.1710](https://forth-standard.org/standard/core/IMMEDIATE)
|
||||
(func $IMMEDIATE (param $tos i32) (result i32)
|
||||
(call $setFlag (i32.const 0x80 (; = F_IMMEDIATE ;)))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x205f4) "\e8\05\02\00" "\09" "IMMEDIATE " "\70\00\00\00")
|
||||
(elem (i32.const 0x70) $IMMEDIATE)
|
||||
(data (i32.const 0x20608) "\fc\05\02\00" "\09" "IMMEDIATE " "\71\00\00\00")
|
||||
(elem (i32.const 0x71) $IMMEDIATE)
|
||||
|
||||
;; [6.1.1720](https://forth-standard.org/standard/core/INVERT)
|
||||
(func $INVERT (param $tos i32) (result i32)
|
||||
|
@ -1288,52 +1294,52 @@
|
|||
(i32.store (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))
|
||||
(i32.xor (i32.load (local.get $btos)) (i32.const -1)))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x20608) "\f4\05\02\00" "\06" "INVERT " "\71\00\00\00")
|
||||
(elem (i32.const 0x71) $INVERT)
|
||||
(data (i32.const 0x2061c) "\08\06\02\00" "\06" "INVERT " "\72\00\00\00")
|
||||
(elem (i32.const 0x72) $INVERT)
|
||||
|
||||
;; [6.1.1730](https://forth-standard.org/standard/core/J)
|
||||
(func $J (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (i32.load (i32.sub (global.get $tors) (i32.const 8))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20618) "\08\06\02\00" "\01" "J " "\72\00\00\00")
|
||||
(elem (i32.const 0x72) $J)
|
||||
(data (i32.const 0x2062c) "\1c\06\02\00" "\01" "J " "\73\00\00\00")
|
||||
(elem (i32.const 0x73) $J)
|
||||
|
||||
;; [6.1.1750](https://forth-standard.org/standard/core/KEY)
|
||||
(func $KEY (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (call $shell_key))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20624) "\18\06\02\00" "\03" "KEY" "\73\00\00\00")
|
||||
(elem (i32.const 0x73) $KEY)
|
||||
(data (i32.const 0x20638) "\2c\06\02\00" "\03" "KEY" "\74\00\00\00")
|
||||
(elem (i32.const 0x74) $KEY)
|
||||
|
||||
(func $LATEST (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (global.get $latest))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20630) "\24\06\02\00" "\06" "LATEST " "\74\00\00\00")
|
||||
(elem (i32.const 0x74) $LATEST)
|
||||
(data (i32.const 0x20644) "\38\06\02\00" "\06" "LATEST " "\75\00\00\00")
|
||||
(elem (i32.const 0x75) $LATEST)
|
||||
|
||||
;; [6.1.1760](https://forth-standard.org/standard/core/LEAVE)
|
||||
(func $LEAVE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileLeave))
|
||||
(data (i32.const 0x20640) "\30\06\02\00" "\85" (; F_IMMEDIATE ;) "LEAVE " "\75\00\00\00")
|
||||
(elem (i32.const 0x75) $LEAVE)
|
||||
(data (i32.const 0x20654) "\44\06\02\00" "\85" (; F_IMMEDIATE ;) "LEAVE " "\76\00\00\00")
|
||||
(elem (i32.const 0x76) $LEAVE)
|
||||
|
||||
;; [6.1.1780](https://forth-standard.org/standard/core/LITERAL)
|
||||
(func $LITERAL (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compilePushConst (call $pop)))
|
||||
(data (i32.const 0x20650) "\40\06\02\00" "\87" (; F_IMMEDIATE ;) "LITERAL" "\76\00\00\00")
|
||||
(elem (i32.const 0x76) $LITERAL)
|
||||
(data (i32.const 0x20664) "\54\06\02\00" "\87" (; F_IMMEDIATE ;) "LITERAL" "\77\00\00\00")
|
||||
(elem (i32.const 0x77) $LITERAL)
|
||||
|
||||
;; [6.1.1800](https://forth-standard.org/standard/core/LOOP)
|
||||
(func $LOOP (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileLoop))
|
||||
(data (i32.const 0x20660) "\50\06\02\00" "\84" (; F_IMMEDIATE ;) "LOOP " "\77\00\00\00")
|
||||
(elem (i32.const 0x77) $LOOP)
|
||||
(data (i32.const 0x20674) "\64\06\02\00" "\84" (; F_IMMEDIATE ;) "LOOP " "\78\00\00\00")
|
||||
(elem (i32.const 0x78) $LOOP)
|
||||
|
||||
;; [6.1.1805](https://forth-standard.org/standard/core/LSHIFT)
|
||||
(func $LSHIFT (param $tos i32) (result i32)
|
||||
|
@ -1343,8 +1349,8 @@
|
|||
(i32.shl (i32.load (local.get $bbtos))
|
||||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4))))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x20670) "\60\06\02\00" "\06" "LSHIFT " "\78\00\00\00")
|
||||
(elem (i32.const 0x78) $LSHIFT)
|
||||
(data (i32.const 0x20684) "\74\06\02\00" "\06" "LSHIFT " "\79\00\00\00")
|
||||
(elem (i32.const 0x79) $LSHIFT)
|
||||
|
||||
;; [6.1.1810](https://forth-standard.org/standard/core/MTimes)
|
||||
(func $M* (param $tos i32) (result i32)
|
||||
|
@ -1354,8 +1360,8 @@
|
|||
(i64.extend_i32_s (i32.load (i32.sub (local.get $tos)
|
||||
(i32.const 4))))))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x20680) "\70\06\02\00" "\02" "M* " "\79\00\00\00")
|
||||
(elem (i32.const 0x79) $M*)
|
||||
(data (i32.const 0x20694) "\84\06\02\00" "\02" "M* " "\7a\00\00\00")
|
||||
(elem (i32.const 0x7a) $M*)
|
||||
|
||||
;; [6.1.1870](https://forth-standard.org/standard/core/MAX)
|
||||
(func $MAX (param $tos i32) (result i32)
|
||||
|
@ -1368,8 +1374,8 @@
|
|||
(then
|
||||
(i32.store (local.get $bbtos) (local.get $v))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x2068c) "\80\06\02\00" "\03" "MAX" "\7a\00\00\00")
|
||||
(elem (i32.const 0x7a) $MAX)
|
||||
(data (i32.const 0x206a0) "\94\06\02\00" "\03" "MAX" "\7b\00\00\00")
|
||||
(elem (i32.const 0x7b) $MAX)
|
||||
|
||||
;; [6.1.1880](https://forth-standard.org/standard/core/MIN)
|
||||
(func $MIN (param $tos i32) (result i32)
|
||||
|
@ -1382,8 +1388,8 @@
|
|||
(then
|
||||
(i32.store (local.get $bbtos) (local.get $v))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x20698) "\8c\06\02\00" "\03" "MIN" "\7b\00\00\00")
|
||||
(elem (i32.const 0x7b) $MIN)
|
||||
(data (i32.const 0x206ac) "\a0\06\02\00" "\03" "MIN" "\7c\00\00\00")
|
||||
(elem (i32.const 0x7c) $MIN)
|
||||
|
||||
;; [6.1.1890](https://forth-standard.org/standard/core/MOD)
|
||||
(func $MOD (param $tos i32) (result i32)
|
||||
|
@ -1393,8 +1399,8 @@
|
|||
(i32.rem_s (i32.load (local.get $bbtos))
|
||||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4))))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x206a4) "\98\06\02\00" "\03" "MOD" "\7c\00\00\00")
|
||||
(elem (i32.const 0x7c) $MOD)
|
||||
(data (i32.const 0x206b8) "\ac\06\02\00" "\03" "MOD" "\7d\00\00\00")
|
||||
(elem (i32.const 0x7d) $MOD)
|
||||
|
||||
;; [6.1.1900](https://forth-standard.org/standard/core/MOVE)
|
||||
(func $MOVE (param $tos i32) (result i32)
|
||||
|
@ -1404,8 +1410,8 @@
|
|||
(i32.load (local.tee $bbbtos (i32.sub (local.get $tos) (i32.const 12))))
|
||||
(i32.load (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(local.get $bbbtos))
|
||||
(data (i32.const 0x206b0) "\a4\06\02\00" "\04" "MOVE " "\7d\00\00\00")
|
||||
(elem (i32.const 0x7d) $MOVE)
|
||||
(data (i32.const 0x206c4) "\b8\06\02\00" "\04" "MOVE " "\7e\00\00\00")
|
||||
(elem (i32.const 0x7e) $MOVE)
|
||||
|
||||
;; [6.1.1910](https://forth-standard.org/standard/core/NEGATE)
|
||||
(func $NEGATE (param $tos i32) (result i32)
|
||||
|
@ -1413,15 +1419,15 @@
|
|||
(i32.store (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))
|
||||
(i32.sub (i32.const 0) (i32.load (local.get $btos))))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x206c0) "\b0\06\02\00" "\06" "NEGATE " "\7e\00\00\00")
|
||||
(elem (i32.const 0x7e) $NEGATE)
|
||||
(data (i32.const 0x206d4) "\c4\06\02\00" "\06" "NEGATE " "\7f\00\00\00")
|
||||
(elem (i32.const 0x7f) $NEGATE)
|
||||
|
||||
;; [6.2.1930](https://forth-standard.org/standard/core/NIP)
|
||||
(func $NIP (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $SWAP) (call $DROP))
|
||||
(data (i32.const 0x206d0) "\c0\06\02\00" "\03" "NIP" "\7f\00\00\00")
|
||||
(elem (i32.const 0x7f) $NIP)
|
||||
(data (i32.const 0x206e4) "\d4\06\02\00" "\03" "NIP" "\80\00\00\00")
|
||||
(elem (i32.const 0x80) $NIP)
|
||||
|
||||
;; [6.1.1980](https://forth-standard.org/standard/core/OR)
|
||||
(func $OR (param $tos i32) (result i32)
|
||||
|
@ -1431,23 +1437,23 @@
|
|||
(i32.or (i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(i32.load (local.get $bbtos))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x206dc) "\d0\06\02\00" "\02" "OR " "\80\00\00\00")
|
||||
(elem (i32.const 0x80) $OR)
|
||||
(data (i32.const 0x206f0) "\e4\06\02\00" "\02" "OR " "\81\00\00\00")
|
||||
(elem (i32.const 0x81) $OR)
|
||||
|
||||
;; [6.1.1990](https://forth-standard.org/standard/core/OVER)
|
||||
(func $OVER (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos)
|
||||
(i32.load (i32.sub (local.get $tos) (i32.const 8))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x206e8) "\dc\06\02\00" "\04" "OVER " "\81\00\00\00")
|
||||
(elem (i32.const 0x81) $OVER)
|
||||
(data (i32.const 0x206fc) "\f0\06\02\00" "\04" "OVER " "\82\00\00\00")
|
||||
(elem (i32.const 0x82) $OVER)
|
||||
|
||||
;; [6.2.2000](https://forth-standard.org/standard/core/PAD)
|
||||
(func $PAD (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (i32.add (global.get $here) (i32.const 0x304 (; = PAD_OFFSET ;))))
|
||||
(i32.add (local.get $tos) (i32.const 0x4)))
|
||||
(data (i32.const 0x206f8) "\e8\06\02\00" "\03" "PAD" "\82\00\00\00")
|
||||
(elem (i32.const 0x82) $PAD)
|
||||
(data (i32.const 0x2070c) "\fc\06\02\00" "\03" "PAD" "\83\00\00\00")
|
||||
(elem (i32.const 0x83) $PAD)
|
||||
|
||||
;; [6.2.2008](https://forth-standard.org/standard/core/PARSE)
|
||||
(func $PARSE (param $tos i32) (result i32)
|
||||
|
@ -1460,8 +1466,8 @@
|
|||
(i32.store (local.get $btos) (local.get $addr))
|
||||
(i32.store (local.get $tos) (local.get $len))
|
||||
(i32.add (local.get $tos) (i32.const 0x4)))
|
||||
(data (i32.const 0x20704) "\f8\06\02\00" "\05" "PARSE " "\83\00\00\00")
|
||||
(elem (i32.const 0x83) $PARSE)
|
||||
(data (i32.const 0x20718) "\0c\07\02\00" "\05" "PARSE " "\84\00\00\00")
|
||||
(elem (i32.const 0x84) $PARSE)
|
||||
|
||||
;; [6.2.2020](https://forth-standard.org/standard/core/PARSE-NAME)
|
||||
(func $PARSE-NAME (param $tos i32) (result i32)
|
||||
|
@ -1471,8 +1477,8 @@
|
|||
(i32.store (local.get $tos) (local.get $addr))
|
||||
(i32.store (i32.add (local.get $tos) (i32.const 0x4)) (local.get $len))
|
||||
(i32.add (local.get $tos) (i32.const 0x8)))
|
||||
(data (i32.const 0x20714) "\04\07\02\00" "\0a" "PARSE-NAME " "\84\00\00\00")
|
||||
(elem (i32.const 0x84) $PARSE-NAME)
|
||||
(data (i32.const 0x20728) "\18\07\02\00" "\0a" "PARSE-NAME " "\85\00\00\00")
|
||||
(elem (i32.const 0x85) $PARSE-NAME)
|
||||
|
||||
;; [6.2.2030](https://forth-standard.org/standard/core/PICK)
|
||||
(func $PICK (param $tos i32) (result i32)
|
||||
|
@ -1483,8 +1489,8 @@
|
|||
(local.get $tos)
|
||||
(i32.shl (i32.add (i32.load (local.get $btos)) (i32.const 2)) (i32.const 2)))))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x20728) "\14\07\02\00" "\04" "PICK " "\85\00\00\00")
|
||||
(elem (i32.const 0x85) $PICK)
|
||||
(data (i32.const 0x2073c) "\28\07\02\00" "\04" "PICK " "\86\00\00\00")
|
||||
(elem (i32.const 0x86) $PICK)
|
||||
|
||||
;; [6.1.2033](https://forth-standard.org/standard/core/POSTPONE)
|
||||
(func $POSTPONE (param $tos i32) (result i32)
|
||||
|
@ -1499,38 +1505,38 @@
|
|||
(else
|
||||
(call $emitConst (local.get $FINDToken))
|
||||
(call $emitICall (i32.const 1) (i32.const 0x5 (; = COMPILE_CALL_INDEX ;))))))
|
||||
(data (i32.const 0x20738) "\28\07\02\00" "\88" (; F_IMMEDIATE ;) "POSTPONE " "\86\00\00\00")
|
||||
(elem (i32.const 0x86) $POSTPONE)
|
||||
(data (i32.const 0x2074c) "\3c\07\02\00" "\88" (; F_IMMEDIATE ;) "POSTPONE " "\87\00\00\00")
|
||||
(elem (i32.const 0x87) $POSTPONE)
|
||||
|
||||
;; [6.1.2050](https://forth-standard.org/standard/core/QUIT)
|
||||
(func $QUIT (param $tos i32) (result i32)
|
||||
(global.set $error (i32.const 0x2 (; = ERR_QUIT ;)))
|
||||
(call $quit (local.get $tos)))
|
||||
(data (i32.const 0x2074c) "\38\07\02\00" "\04" "QUIT " "\87\00\00\00")
|
||||
(elem (i32.const 0x87) $QUIT)
|
||||
(data (i32.const 0x20760) "\4c\07\02\00" "\04" "QUIT " "\88\00\00\00")
|
||||
(elem (i32.const 0x88) $QUIT)
|
||||
|
||||
;; [6.1.2060](https://forth-standard.org/standard/core/Rfrom)
|
||||
(func $R> (param $tos i32) (result i32)
|
||||
(global.set $tors (i32.sub (global.get $tors) (i32.const 4)))
|
||||
(i32.store (local.get $tos) (i32.load (global.get $tors)))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x2075c) "\4c\07\02\00" "\02" "R> " "\88\00\00\00")
|
||||
(elem (i32.const 0x88) $R>)
|
||||
(data (i32.const 0x20770) "\60\07\02\00" "\02" "R> " "\89\00\00\00")
|
||||
(elem (i32.const 0x89) $R>)
|
||||
|
||||
;; [6.1.2070](https://forth-standard.org/standard/core/RFetch)
|
||||
(func $R@ (param $tos i32) (result i32)
|
||||
(i32.store (local.get $tos) (i32.load (i32.sub (global.get $tors) (i32.const 4))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x20768) "\5c\07\02\00" "\02" "R@ " "\89\00\00\00")
|
||||
(elem (i32.const 0x89) $R@)
|
||||
(data (i32.const 0x2077c) "\70\07\02\00" "\02" "R@ " "\8a\00\00\00")
|
||||
(elem (i32.const 0x8a) $R@)
|
||||
|
||||
;; [6.1.2120](https://forth-standard.org/standard/core/RECURSE)
|
||||
(func $RECURSE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileRecurse))
|
||||
(data (i32.const 0x20774) "\68\07\02\00" "\87" (; F_IMMEDIATE ;) "RECURSE" "\8a\00\00\00")
|
||||
(elem (i32.const 0x8a) $RECURSE)
|
||||
(data (i32.const 0x20788) "\7c\07\02\00" "\87" (; F_IMMEDIATE ;) "RECURSE" "\8b\00\00\00")
|
||||
(elem (i32.const 0x8b) $RECURSE)
|
||||
|
||||
;; [6.2.2125](https://forth-standard.org/standard/core/REFILL)
|
||||
(func $REFILL (param $tos i32) (result i32)
|
||||
|
@ -1549,16 +1555,16 @@
|
|||
(if (param i32) (result i32) (i32.eqz (global.get $inputBufferSize))
|
||||
(then (call $push (i32.const 0)))
|
||||
(else (call $push (i32.const -1)))))
|
||||
(data (i32.const 0x20784) "\74\07\02\00" "\06" "REFILL " "\8b\00\00\00")
|
||||
(elem (i32.const 0x8b) $REFILL)
|
||||
(data (i32.const 0x20798) "\88\07\02\00" "\06" "REFILL " "\8c\00\00\00")
|
||||
(elem (i32.const 0x8c) $REFILL)
|
||||
|
||||
;; [6.1.2140](https://forth-standard.org/standard/core/REPEAT)
|
||||
(func $REPEAT (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileRepeat))
|
||||
(data (i32.const 0x20794) "\84\07\02\00" "\86" (; F_IMMEDIATE ;) "REPEAT " "\8c\00\00\00")
|
||||
(elem (i32.const 0x8c) $REPEAT)
|
||||
(data (i32.const 0x207a8) "\98\07\02\00" "\86" (; F_IMMEDIATE ;) "REPEAT " "\8d\00\00\00")
|
||||
(elem (i32.const 0x8d) $REPEAT)
|
||||
|
||||
;; [6.1.2160](https://forth-standard.org/standard/core/ROT)
|
||||
(func $ROT (param $tos i32) (result i32)
|
||||
|
@ -1573,8 +1579,8 @@
|
|||
(i32.load (local.tee $bbtos (i32.sub (local.get $tos) (i32.const 8)))))
|
||||
(i32.store (local.get $bbtos) (local.get $tmp))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x207a4) "\94\07\02\00" "\03" "ROT" "\8d\00\00\00")
|
||||
(elem (i32.const 0x8d) $ROT)
|
||||
(data (i32.const 0x207b8) "\a8\07\02\00" "\03" "ROT" "\8e\00\00\00")
|
||||
(elem (i32.const 0x8e) $ROT)
|
||||
|
||||
;; [6.1.2162](https://forth-standard.org/standard/core/RSHIFT)
|
||||
(func $RSHIFT (param $tos i32) (result i32)
|
||||
|
@ -1584,8 +1590,8 @@
|
|||
(i32.shr_u (i32.load (local.get $bbtos))
|
||||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4))))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x207b0) "\a4\07\02\00" "\06" "RSHIFT " "\8e\00\00\00")
|
||||
(elem (i32.const 0x8e) $RSHIFT)
|
||||
(data (i32.const 0x207c4) "\b8\07\02\00" "\06" "RSHIFT " "\8f\00\00\00")
|
||||
(elem (i32.const 0x8f) $RSHIFT)
|
||||
|
||||
;; [6.1.2165](https://forth-standard.org/standard/core/Sq)
|
||||
(func $Sq (param $tos i32) (result i32)
|
||||
|
@ -1600,8 +1606,8 @@
|
|||
(call $compilePushConst (local.get $len))
|
||||
(global.set $here
|
||||
(call $aligned (i32.add (global.get $here) (local.get $len)))))
|
||||
(data (i32.const 0x207c0) "\b0\07\02\00" "\82" (; F_IMMEDIATE ;) "S\22 " "\8f\00\00\00")
|
||||
(elem (i32.const 0x8f) $Sq)
|
||||
(data (i32.const 0x207d4) "\c4\07\02\00" "\82" (; F_IMMEDIATE ;) "S\22 " "\90\00\00\00")
|
||||
(elem (i32.const 0x90) $Sq)
|
||||
|
||||
;; [6.1.2170](https://forth-standard.org/standard/core/StoD)
|
||||
(func $S>D (param $tos i32) (result i32)
|
||||
|
@ -1609,15 +1615,15 @@
|
|||
(i64.store (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))
|
||||
(i64.extend_i32_s (i32.load (local.get $btos))))
|
||||
(i32.add (local.get $tos) (i32.const 4)))
|
||||
(data (i32.const 0x207cc) "\c0\07\02\00" "\03" "S>D" "\90\00\00\00")
|
||||
(elem (i32.const 0x90) $S>D)
|
||||
(data (i32.const 0x207e0) "\d4\07\02\00" "\03" "S>D" "\91\00\00\00")
|
||||
(elem (i32.const 0x91) $S>D)
|
||||
|
||||
(func $SCALL (param $tos i32) (result i32)
|
||||
(global.set $tos (local.get $tos))
|
||||
(call $shell_call)
|
||||
(global.get $tos))
|
||||
(data (i32.const 0x207d8) "\cc\07\02\00" "\05" "SCALL " "\91\00\00\00")
|
||||
(elem (i32.const 0x91) $SCALL)
|
||||
(data (i32.const 0x207ec) "\e0\07\02\00" "\05" "SCALL " "\92\00\00\00")
|
||||
(elem (i32.const 0x92) $SCALL)
|
||||
|
||||
;; [6.1.2210](https://forth-standard.org/standard/core/SIGN)
|
||||
(func $SIGN (param $tos i32) (result i32)
|
||||
|
@ -1628,8 +1634,8 @@
|
|||
(i32.store8 (local.tee $npo (i32.sub (global.get $po) (i32.const 1))) (i32.const 0x2d (; = '-' ;)))
|
||||
(global.set $po (local.get $npo))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x207e8) "\d8\07\02\00" "\04" "SIGN " "\92\00\00\00")
|
||||
(elem (i32.const 0x92) $SIGN)
|
||||
(data (i32.const 0x207fc) "\ec\07\02\00" "\04" "SIGN " "\93\00\00\00")
|
||||
(elem (i32.const 0x93) $SIGN)
|
||||
|
||||
;; [6.1.2214](https://forth-standard.org/standard/core/SMDivREM)
|
||||
;;
|
||||
|
@ -1650,29 +1656,29 @@
|
|||
(i32.wrap_i64
|
||||
(i64.div_s (local.get $n1) (local.get $n2))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x207f8) "\e8\07\02\00" "\06" "SM/REM " "\93\00\00\00")
|
||||
(elem (i32.const 0x93) $SM/REM)
|
||||
(data (i32.const 0x2080c) "\fc\07\02\00" "\06" "SM/REM " "\94\00\00\00")
|
||||
(elem (i32.const 0x94) $SM/REM)
|
||||
|
||||
;; [6.1.2216](https://forth-standard.org/standard/core/SOURCE)
|
||||
(func $SOURCE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $push (global.get $inputBufferBase))
|
||||
(call $push (global.get $inputBufferSize)))
|
||||
(data (i32.const 0x20808) "\f8\07\02\00" "\06" "SOURCE " "\94\00\00\00")
|
||||
(elem (i32.const 0x94) $SOURCE)
|
||||
(data (i32.const 0x2081c) "\0c\08\02\00" "\06" "SOURCE " "\95\00\00\00")
|
||||
(elem (i32.const 0x95) $SOURCE)
|
||||
|
||||
;; [6.2.2218](https://forth-standard.org/standard/core/SOURCE-ID)
|
||||
(func $SOURCE-ID (param $tos i32) (result i32)
|
||||
(call $push (local.get $tos) (global.get $sourceID)))
|
||||
(data (i32.const 0x20818) "\08\08\02\00" "\09" "SOURCE-ID " "\95\00\00\00")
|
||||
(elem (i32.const 0x95) $SOURCE-ID)
|
||||
(data (i32.const 0x2082c) "\1c\08\02\00" "\09" "SOURCE-ID " "\96\00\00\00")
|
||||
(elem (i32.const 0x96) $SOURCE-ID)
|
||||
|
||||
;; [6.1.2220](https://forth-standard.org/standard/core/SPACE)
|
||||
(func $SPACE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $BL) (call $EMIT))
|
||||
(data (i32.const 0x2082c) "\18\08\02\00" "\05" "SPACE " "\96\00\00\00")
|
||||
(elem (i32.const 0x96) $SPACE)
|
||||
(data (i32.const 0x20840) "\2c\08\02\00" "\05" "SPACE " "\97\00\00\00")
|
||||
(elem (i32.const 0x97) $SPACE)
|
||||
|
||||
;; [6.1.2230](https://forth-standard.org/standard/core/SPACES)
|
||||
(func $SPACES (param $tos i32) (result i32)
|
||||
|
@ -1685,11 +1691,11 @@
|
|||
(call $SPACE)
|
||||
(local.set $i (i32.sub (local.get $i) (i32.const 1)))
|
||||
(br $loop))))
|
||||
(data (i32.const 0x2083c) "\2c\08\02\00" "\06" "SPACES " "\97\00\00\00")
|
||||
(elem (i32.const 0x97) $SPACES)
|
||||
(data (i32.const 0x20850) "\40\08\02\00" "\06" "SPACES " "\98\00\00\00")
|
||||
(elem (i32.const 0x98) $SPACES)
|
||||
|
||||
;; [6.1.2250](https://forth-standard.org/standard/core/STATE)
|
||||
(data (i32.const 0x2084c) "\3c\08\02\00" "\45" (; F_DATA ;) "STATE " "\03\00\00\00" (; = pack(PUSH_DATA_ADDRESS_INDEX) ;) "\00\00\00\00" (; = pack(0) ;))
|
||||
(data (i32.const 0x20860) "\50\08\02\00" "\45" (; F_DATA ;) "STATE " "\03\00\00\00" (; = pack(PUSH_DATA_ADDRESS_INDEX) ;) "\00\00\00\00" (; = pack(0) ;))
|
||||
|
||||
;; [6.1.2260](https://forth-standard.org/standard/core/SWAP)
|
||||
(func $SWAP (param $tos i32) (result i32)
|
||||
|
@ -1701,16 +1707,16 @@
|
|||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))))
|
||||
(i32.store (local.get $btos) (local.get $tmp))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x20860) "\4c\08\02\00" "\04" "SWAP " "\98\00\00\00")
|
||||
(elem (i32.const 0x98) $SWAP)
|
||||
(data (i32.const 0x20874) "\60\08\02\00" "\04" "SWAP " "\99\00\00\00")
|
||||
(elem (i32.const 0x99) $SWAP)
|
||||
|
||||
;; [6.1.2270](https://forth-standard.org/standard/core/THEN)
|
||||
(func $THEN (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileThen))
|
||||
(data (i32.const 0x20870) "\60\08\02\00" "\84" (; F_IMMEDIATE ;) "THEN " "\99\00\00\00")
|
||||
(elem (i32.const 0x99) $THEN)
|
||||
(data (i32.const 0x20884) "\74\08\02\00" "\84" (; F_IMMEDIATE ;) "THEN " "\9a\00\00\00")
|
||||
(elem (i32.const 0x9a) $THEN)
|
||||
|
||||
;; [6.2.2295](https://forth-standard.org/standard/core/TO)
|
||||
(func $TO (param $tos i32) (result i32)
|
||||
|
@ -1721,21 +1727,21 @@
|
|||
(i32.store (i32.add (call $body (local.get $xt)) (i32.const 4))
|
||||
(i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4)))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x20880) "\70\08\02\00" "\02" "TO " "\9a\00\00\00")
|
||||
(elem (i32.const 0x9a) $TO)
|
||||
(data (i32.const 0x20894) "\84\08\02\00" "\02" "TO " "\9b\00\00\00")
|
||||
(elem (i32.const 0x9b) $TO)
|
||||
|
||||
;; [6.2.2298](https://forth-standard.org/standard/core/TRUE)
|
||||
(func $TRUE (param $tos i32) (result i32)
|
||||
(call $push (local.get $tos) (i32.const 0xffffffff)))
|
||||
(data (i32.const 0x2088c) "\80\08\02\00" "\04" "TRUE " "\9b\00\00\00")
|
||||
(elem (i32.const 0x9b) $TRUE)
|
||||
(data (i32.const 0x208a0) "\94\08\02\00" "\04" "TRUE " "\9c\00\00\00")
|
||||
(elem (i32.const 0x9c) $TRUE)
|
||||
|
||||
;; [6.2.2300](https://forth-standard.org/standard/core/TUCK)
|
||||
(func $TUCK (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $SWAP) (call $OVER))
|
||||
(data (i32.const 0x2089c) "\8c\08\02\00" "\04" "TUCK " "\9c\00\00\00")
|
||||
(elem (i32.const 0x9c) $TUCK)
|
||||
(data (i32.const 0x208b0) "\a0\08\02\00" "\04" "TUCK " "\9d\00\00\00")
|
||||
(elem (i32.const 0x9d) $TUCK)
|
||||
|
||||
;; [6.1.2310](https://forth-standard.org/standard/core/TYPE)
|
||||
(func $TYPE (param $tos i32) (result i32)
|
||||
|
@ -1745,16 +1751,16 @@
|
|||
(local.set $len (call $pop))
|
||||
(local.set $p (call $pop))
|
||||
(call $type (local.get $p) (local.get $len)))
|
||||
(data (i32.const 0x208ac) "\9c\08\02\00" "\04" "TYPE " "\9d\00\00\00")
|
||||
(elem (i32.const 0x9d) $TYPE)
|
||||
(data (i32.const 0x208c0) "\b0\08\02\00" "\04" "TYPE " "\9e\00\00\00")
|
||||
(elem (i32.const 0x9e) $TYPE)
|
||||
|
||||
;; [6.1.2320](https://forth-standard.org/standard/core/Ud)
|
||||
(func $U. (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $U._ (call $pop) (i32.load (i32.const 0x203bc (; = body(BASE) ;))))
|
||||
(call $shell_emit (i32.const 0x20)))
|
||||
(data (i32.const 0x208bc) "\ac\08\02\00" "\02" "U. " "\9e\00\00\00")
|
||||
(elem (i32.const 0x9e) $U.)
|
||||
(data (i32.const 0x208d0) "\c0\08\02\00" "\02" "U. " "\9f\00\00\00")
|
||||
(elem (i32.const 0x9f) $U.)
|
||||
|
||||
;; [6.1.2340](https://forth-standard.org/standard/core/Uless)
|
||||
(func $U< (param $tos i32) (result i32)
|
||||
|
@ -1765,8 +1771,8 @@
|
|||
(then (i32.store (local.get $bbtos) (i32.const -1)))
|
||||
(else (i32.store (local.get $bbtos) (i32.const 0))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x208c8) "\bc\08\02\00" "\02" "U< " "\9f\00\00\00")
|
||||
(elem (i32.const 0x9f) $U<)
|
||||
(data (i32.const 0x208dc) "\d0\08\02\00" "\02" "U< " "\a0\00\00\00")
|
||||
(elem (i32.const 0xa0) $U<)
|
||||
|
||||
;; [6.1.2360](https://forth-standard.org/standard/core/UMTimes)
|
||||
(func $UM* (param $tos i32) (result i32)
|
||||
|
@ -1776,8 +1782,8 @@
|
|||
(i64.extend_i32_u (i32.load (i32.sub (local.get $tos)
|
||||
(i32.const 4))))))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x208d4) "\c8\08\02\00" "\03" "UM*" "\a0\00\00\00")
|
||||
(elem (i32.const 0xa0) $UM*)
|
||||
(data (i32.const 0x208e8) "\dc\08\02\00" "\03" "UM*" "\a1\00\00\00")
|
||||
(elem (i32.const 0xa1) $UM*)
|
||||
|
||||
;; [6.1.2370](https://forth-standard.org/standard/core/UMDivMOD)
|
||||
(func $UM/MOD (param $tos i32) (result i32)
|
||||
|
@ -1796,50 +1802,50 @@
|
|||
(i32.wrap_i64
|
||||
(i64.div_u (local.get $n1) (local.get $n2))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x208e0) "\d4\08\02\00" "\06" "UM/MOD " "\a1\00\00\00")
|
||||
(elem (i32.const 0xa1) $UM/MOD)
|
||||
(data (i32.const 0x208f4) "\e8\08\02\00" "\06" "UM/MOD " "\a2\00\00\00")
|
||||
(elem (i32.const 0xa2) $UM/MOD)
|
||||
|
||||
;; [6.1.2380](https://forth-standard.org/standard/core/UNLOOP)
|
||||
(func $UNLOOP (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $emitICall (i32.const 0) (i32.const 0x9 (; = END_DO_INDEX ;))))
|
||||
(data (i32.const 0x208f0) "\e0\08\02\00" "\86" (; F_IMMEDIATE ;) "UNLOOP " "\a2\00\00\00")
|
||||
(elem (i32.const 0xa2) $UNLOOP)
|
||||
(data (i32.const 0x20904) "\f4\08\02\00" "\86" (; F_IMMEDIATE ;) "UNLOOP " "\a3\00\00\00")
|
||||
(elem (i32.const 0xa3) $UNLOOP)
|
||||
|
||||
;; [6.1.2390](https://forth-standard.org/standard/core/UNTIL)
|
||||
(func $UNTIL (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileUntil))
|
||||
(data (i32.const 0x20900) "\f0\08\02\00" "\85" (; F_IMMEDIATE ;) "UNTIL " "\a3\00\00\00")
|
||||
(elem (i32.const 0xa3) $UNTIL)
|
||||
(data (i32.const 0x20914) "\04\09\02\00" "\85" (; F_IMMEDIATE ;) "UNTIL " "\a4\00\00\00")
|
||||
(elem (i32.const 0xa4) $UNTIL)
|
||||
|
||||
;; [6.2.2395](https://forth-standard.org/standard/core/UNUSED)
|
||||
(func $UNUSED (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $push (i32.shr_s (i32.sub (i32.const 0x6400000 (; = MEMORY_SIZE ;)) (global.get $here)) (i32.const 2))))
|
||||
(data (i32.const 0x20910) "\00\09\02\00" "\06" "UNUSED " "\a4\00\00\00")
|
||||
(elem (i32.const 0xa4) $UNUSED)
|
||||
(data (i32.const 0x20924) "\14\09\02\00" "\06" "UNUSED " "\a5\00\00\00")
|
||||
(elem (i32.const 0xa5) $UNUSED)
|
||||
|
||||
;; [6.2.2405](https://forth-standard.org/standard/core/VALUE)
|
||||
(data (i32.const 0x20920) "\10\09\02\00" "\05" "VALUE " "\56\00\00\00" (; = pack(index("CONSTANT")) ;))
|
||||
(data (i32.const 0x20934) "\24\09\02\00" "\05" "VALUE " "\57\00\00\00" (; = pack(index("CONSTANT")) ;))
|
||||
|
||||
;; [6.1.2410](https://forth-standard.org/standard/core/VARIABLE)
|
||||
(func $VARIABLE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $CREATE)
|
||||
(global.set $here (i32.add (global.get $here) (i32.const 4))))
|
||||
(data (i32.const 0x20930) "\20\09\02\00" "\08" "VARIABLE " "\a5\00\00\00")
|
||||
(elem (i32.const 0xa5) $VARIABLE)
|
||||
(data (i32.const 0x20944) "\34\09\02\00" "\08" "VARIABLE " "\a6\00\00\00")
|
||||
(elem (i32.const 0xa6) $VARIABLE)
|
||||
|
||||
;; [6.1.2430](https://forth-standard.org/standard/core/WHILE)
|
||||
(func $WHILE (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(call $compileWhile))
|
||||
(data (i32.const 0x20944) "\30\09\02\00" "\85" (; F_IMMEDIATE ;) "WHILE " "\a6\00\00\00")
|
||||
(elem (i32.const 0xa6) $WHILE)
|
||||
(data (i32.const 0x20958) "\44\09\02\00" "\85" (; F_IMMEDIATE ;) "WHILE " "\a7\00\00\00")
|
||||
(elem (i32.const 0xa7) $WHILE)
|
||||
|
||||
;; [6.1.2450](https://forth-standard.org/standard/core/WORD)
|
||||
(func $WORD (param $tos i32) (result i32)
|
||||
|
@ -1859,8 +1865,8 @@
|
|||
(local.get $len))
|
||||
(i32.store8 (local.get $wordBase) (local.get $len))
|
||||
(call $push (local.get $wordBase)))
|
||||
(data (i32.const 0x20954) "\44\09\02\00" "\04" "WORD " "\a7\00\00\00")
|
||||
(elem (i32.const 0xa7) $WORD)
|
||||
(data (i32.const 0x20968) "\58\09\02\00" "\04" "WORD " "\a8\00\00\00")
|
||||
(elem (i32.const 0xa8) $WORD)
|
||||
|
||||
;; 15.6.1.2465
|
||||
(func $WORDS (param $tos i32) (result i32)
|
||||
|
@ -1881,8 +1887,8 @@
|
|||
(local.set $entryP (i32.load (local.get $entryP)))
|
||||
(br_if $loop (local.get $entryP)))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x20964) "\54\09\02\00" "\05" "WORDS " "\a8\00\00\00")
|
||||
(elem (i32.const 0xa8) $WORDS)
|
||||
(data (i32.const 0x20978) "\68\09\02\00" "\05" "WORDS " "\a9\00\00\00")
|
||||
(elem (i32.const 0xa9) $WORDS)
|
||||
|
||||
;; [6.1.2490](https://forth-standard.org/standard/core/XOR)
|
||||
(func $XOR (param $tos i32) (result i32)
|
||||
|
@ -1892,16 +1898,16 @@
|
|||
(i32.xor (i32.load (local.tee $btos (i32.sub (local.get $tos) (i32.const 4))))
|
||||
(i32.load (local.get $bbtos))))
|
||||
(local.get $btos))
|
||||
(data (i32.const 0x20974) "\64\09\02\00" "\03" "XOR" "\a9\00\00\00")
|
||||
(elem (i32.const 0xa9) $XOR)
|
||||
(data (i32.const 0x20988) "\78\09\02\00" "\03" "XOR" "\aa\00\00\00")
|
||||
(elem (i32.const 0xaa) $XOR)
|
||||
|
||||
;; [6.1.2500](https://forth-standard.org/standard/core/Bracket)
|
||||
(func $left-bracket (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(call $ensureCompiling)
|
||||
(i32.store (i32.const 0x2085c (; = body(STATE) ;)) (i32.const 0)))
|
||||
(data (i32.const 0x20980) "\74\09\02\00" "\81" (; F_IMMEDIATE ;) "[ " "\aa\00\00\00")
|
||||
(elem (i32.const 0xaa) $left-bracket)
|
||||
(i32.store (i32.const 0x20870 (; = body(STATE) ;)) (i32.const 0)))
|
||||
(data (i32.const 0x20994) "\88\09\02\00" "\81" (; F_IMMEDIATE ;) "[ " "\ab\00\00\00")
|
||||
(elem (i32.const 0xab) $left-bracket)
|
||||
|
||||
;; [6.1.2510](https://forth-standard.org/standard/core/BracketTick)
|
||||
(func $bracket-tick (param $tos i32) (result i32)
|
||||
|
@ -1909,8 +1915,8 @@
|
|||
(call $ensureCompiling)
|
||||
(call $')
|
||||
(call $compilePushConst (call $pop)))
|
||||
(data (i32.const 0x2098c) "\80\09\02\00" "\83" (; F_IMMEDIATE ;) "[']" "\ab\00\00\00")
|
||||
(elem (i32.const 0xab) $bracket-tick)
|
||||
(data (i32.const 0x209a0) "\94\09\02\00" "\83" (; F_IMMEDIATE ;) "[']" "\ac\00\00\00")
|
||||
(elem (i32.const 0xac) $bracket-tick)
|
||||
|
||||
;; [6.1.2520](https://forth-standard.org/standard/core/BracketCHAR)
|
||||
(func $bracket-char (param $tos i32) (result i32)
|
||||
|
@ -1918,22 +1924,22 @@
|
|||
(call $ensureCompiling)
|
||||
(call $CHAR)
|
||||
(call $compilePushConst (call $pop)))
|
||||
(data (i32.const 0x20998) "\8c\09\02\00" "\86" (; F_IMMEDIATE ;) "[CHAR] " "\ac\00\00\00")
|
||||
(elem (i32.const 0xac) $bracket-char)
|
||||
(data (i32.const 0x209ac) "\a0\09\02\00" "\86" (; F_IMMEDIATE ;) "[CHAR] " "\ad\00\00\00")
|
||||
(elem (i32.const 0xad) $bracket-char)
|
||||
|
||||
;; [6.2.2535](https://forth-standard.org/standard/core/bs)
|
||||
(func $\ (param $tos i32) (result i32)
|
||||
(drop (drop (call $parse (i32.const 0x0a (; '\n' ;)))))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x209a8) "\98\09\02\00" "\81" (; F_IMMEDIATE ;) "\5c " "\ad\00\00\00")
|
||||
(elem (i32.const 0xad) $\)
|
||||
(data (i32.const 0x209bc) "\ac\09\02\00" "\81" (; F_IMMEDIATE ;) "\5c " "\ae\00\00\00")
|
||||
(elem (i32.const 0xae) $\)
|
||||
|
||||
;; [6.1.2540](https://forth-standard.org/standard/right-bracket)
|
||||
(func $right-bracket (param $tos i32) (result i32)
|
||||
(i32.store (i32.const 0x2085c (; = body(STATE) ;)) (i32.const 1))
|
||||
(i32.store (i32.const 0x20870 (; = body(STATE) ;)) (i32.const 1))
|
||||
(local.get $tos))
|
||||
(data (i32.const 0x209b4) "\a8\09\02\00" "\01" "] " "\ae\00\00\00")
|
||||
(elem (i32.const 0xae) $right-bracket)
|
||||
(data (i32.const 0x209c8) "\bc\09\02\00" "\01" "] " "\af\00\00\00")
|
||||
(elem (i32.const 0xaf) $right-bracket)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -1971,7 +1977,7 @@
|
|||
;; It's a number. Are we compiling?
|
||||
(then
|
||||
(local.set $number)
|
||||
(if (i32.load (i32.const 0x2085c (; = body(STATE) ;)))
|
||||
(if (i32.load (i32.const 0x20870 (; = body(STATE) ;)))
|
||||
(then
|
||||
;; We're compiling. Pop it off the stack and
|
||||
;; add it to the compiled list
|
||||
|
@ -1987,7 +1993,7 @@
|
|||
;; Name found in the dictionary.
|
||||
;; Are we compiling and is the word non-immediate?
|
||||
(if (i32.and
|
||||
(i32.load (i32.const 0x2085c (; = body(STATE) ;)))
|
||||
(i32.load (i32.const 0x20870 (; = body(STATE) ;)))
|
||||
(i32.ne (local.get $FINDResult) (i32.const 1)))
|
||||
(then
|
||||
;; We're compiling a non-immediate.
|
||||
|
@ -2089,7 +2095,7 @@
|
|||
(global.set $tos (local.get $tos))
|
||||
(global.set $tors (i32.const 0x2000 (; = RETURN_STACK_BASE ;)))
|
||||
(global.set $sourceID (i32.const 0))
|
||||
(i32.store (i32.const 0x2085c (; = body(STATE) ;)) (i32.const 0))
|
||||
(i32.store (i32.const 0x20870 (; = body(STATE) ;)) (i32.const 0))
|
||||
(unreachable))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -2110,9 +2116,9 @@
|
|||
(global $sourceID (mut i32) (i32.const 0))
|
||||
|
||||
;; Dictionary pointers
|
||||
(global $latest (mut i32) (i32.const 0x209b4))
|
||||
(global $here (mut i32) (i32.const 0x209c0))
|
||||
(global $nextTableIndex (mut i32) (i32.const 0xaf))
|
||||
(global $latest (mut i32) (i32.const 0x209c8))
|
||||
(global $here (mut i32) (i32.const 0x209d4))
|
||||
(global $nextTableIndex (mut i32) (i32.const 0xb0))
|
||||
|
||||
;; Pictured output pointer
|
||||
(global $po (mut i32) (i32.const -1))
|
||||
|
@ -2642,7 +2648,7 @@
|
|||
|
||||
(func $ensureCompiling (param $tos i32) (result i32)
|
||||
(local.get $tos)
|
||||
(if (param i32) (result i32) (i32.eqz (i32.load (i32.const 0x2085c (; = body(STATE) ;))))
|
||||
(if (param i32) (result i32) (i32.eqz (i32.load (i32.const 0x20870 (; = body(STATE) ;))))
|
||||
(call $fail (i32.const 0x2002e (; = str("word not supported in interpret mode") ;)))))
|
||||
|
||||
;; Toggle the hidden flag
|
||||
|
@ -2850,7 +2856,7 @@
|
|||
;; Show prompt
|
||||
(if (i32.eqz (local.get $silent))
|
||||
(then
|
||||
(if (i32.ge_s (i32.load (i32.const 0x2085c (; = body(STATE) ;))) (i32.const 0))
|
||||
(if (i32.ge_s (i32.load (i32.const 0x20870 (; = body(STATE) ;))) (i32.const 0))
|
||||
(then
|
||||
;; Write ok
|
||||
(call $shell_emit (i32.const 111))
|
||||
|
|
|
@ -518,13 +518,13 @@ T{ : CQ2 C" " ; -> }T
|
|||
T{ CQ2 COUNT EVALUATE -> }T
|
||||
T{ : CQ3 C" 2345"COUNT EVALUATE ; CQ3 -> 2345 }T
|
||||
|
||||
\ \ -----------------------------------------------------------------------------
|
||||
\ TESTING COMPILE,
|
||||
\ -----------------------------------------------------------------------------
|
||||
TESTING COMPILE,
|
||||
|
||||
\ :NONAME DUP + ; CONSTANT DUP+
|
||||
\ T{ : Q DUP+ COMPILE, ; -> }T
|
||||
\ T{ : AS1 [ Q ] ; -> }T
|
||||
\ T{ 123 AS1 -> 246 }T
|
||||
:NONAME DUP + ; CONSTANT DUP+
|
||||
T{ : Q DUP+ COMPILE, ; -> }T
|
||||
T{ : AS1 [ Q ] ; -> }T
|
||||
T{ 123 AS1 -> 246 }T
|
||||
|
||||
\ \ -----------------------------------------------------------------------------
|
||||
\ \ Cannot automatically test SAVE-INPUT and RESTORE-INPUT from a console source
|
||||
|
|
Loading…
Add table
Reference in a new issue