From dde7d0d71020bc8e0e394a47eb34e9dac89de5e1 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Thu, 26 Feb 2026 18:10:56 +0000 Subject: [PATCH] Fill in addresses of constants and variables (and add a few more) --- wipforth.wat | 109 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 40 deletions(-) diff --git a/wipforth.wat b/wipforth.wat index 19f4595..da4a186 100644 --- a/wipforth.wat +++ b/wipforth.wat @@ -1004,61 +1004,90 @@ ;; Built-in constants and variables - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\05DOCOL\00\00" - ;; "\01\00\00\00" - ;; "\00\00\00\00") + (data (i32.const 0x04b8) + "\a8\04\00\00" + "\05DOCOL\00\00" + "\01\00\00\00" + "\00\00\00\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\07DOCONST" - ;; "\01\00\00\00" - ;; "\01\00\00\00") + (data (i32.const 0x04cc) + "\b8\04\00\00" + "\07DOCONST" + "\01\00\00\00" + "\01\00\00\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\05DOVAR\00\00" - ;; "\01\00\00\00" - ;; "\02\00\00\00") + (data (i32.const 0x04e0) + "\cc\04\00\00" + "\05DOVAR\00\00" + "\01\00\00\00" + "\02\00\00\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\02R0\00" - ;; "\01\00\00\00" - ;; "\00\00\01\00") + (data (i32.const 0x04f4) + "\e0\04\00\00" + "\07LIT-CFA" + "\01\00\00\00" + "\10\04\00\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\02S0\00" - ;; "\01\00\00\00" - ;; "\00\f0\00\00") + (data (i32.const 0x0508) + "\f4\04\00\00" + "\02R0\00" + "\01\00\00\00" + "\00\00\01\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\05STATE\00\00" - ;; "\02\00\00\00" - ;; "\00\00\00\00") + (data (i32.const 0x0518) + "\08\05\00\00" + "\02S0\00" + "\01\00\00\00" + "\00\f0\00\00") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" - ;; "\04BASE\00\00\00" - ;; "\02\00\00\00" - ;; "\0a\00\00\00") + (data (i32.const 0x0528) + "\18\05\00\00" + "\04TRUE\00\00\00" + "\01\00\00\00" + "\ff\ff\ff\ff") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" + (data (i32.const 0x053c) + "\82\05\00\00" + "\05FALSE\00\00" + "\01\00\00\00" + "\00\00\00\00") + + (data (i32.const 0x0550) + "\3c\05\00\00" + "\05STATE\00\00" + "\02\00\00\00" + "\00\00\00\00") + + (data (i32.const 0x0564) + "\50\05\00\00" + "\04BASE\00\00\00" + "\02\00\00\00" + "\0a\00\00\00") + + ;; (data (i32.const 0x0578) + ;; "\64\05\00\00" ;; "\04HERE\00\00\00" ;; "\02\00\00\00" ;; "\??\??\??\??") - ;; (data (i32.const 0x????) - ;; "\??\??\??\??" + ;; (data (i32.const 0x058c) + ;; "\78\05\00\00" ;; "\06LATEST\00" ;; "\02\00\00\00" ;; "\??\??\??\??") - ;; Outer interpreter + (data (i32.const 0x05a0) + "\8c\05\00\00" + "\07WORDBUF" + "\02\00\00\00") + + ;; Skip 0x20 bytes for the word buffer + + (data (i32.const 0x05d0) + "\a0\05\00\00" + "\05ERROR\00\00" + "\02\00\00\00" + "\00\00\00\00") ;; The trampoline is a workaround for WebAssembly's lack of indirect ;; jumps and code addresses. Instead of jumping into the next