Commit Graph

41 Commits

Author SHA1 Message Date
66188f6984 Add a halt mechanism 2026-02-28 20:00:22 +00:00
b06f32bbe3 Define some additional memory codewords 2026-02-28 20:00:22 +00:00
95d82a91c2 Indent loops, ifs etc 2026-02-28 13:10:26 +00:00
aceeebd3ff Move definition of $execute function 2026-02-28 13:09:22 +00:00
fa5a6dbb1d Add EXECUTE 2026-02-28 02:06:51 +00:00
093e4188bd Fix wrong branch offset in FIND 2026-02-28 01:36:27 +00:00
973eba9f0a Fix NUMBER?
I wasn't able to keep the length the same so had to update the
addresses of , IMMEDIATE? INTERPRET QUIT and the cold start (and
therefore also the values of LATEST and HERE).
2026-02-27 22:56:26 +00:00
4f50321c26 Fix FIND 2026-02-27 22:40:15 +00:00
c57792f7c7 Fix 0<> address in WORD 2026-02-27 19:54:35 +00:00
6474c2f227 Logically flip SPACE? to NSPACE
WORD was using it like this, and it's easier to fix it this way rather
than insert an INVERT into WORD.
2026-02-27 19:52:44 +00:00
42a9c5db08 Fix 0BRANCH function table entry 2026-02-27 19:50:50 +00:00
83022925f7 Fix bugs from round 1 of debugging
There were several issues I ran into immediately:

- The cold start was pointing to the dictionary entry of QUIT instead
  of the CFA
- The RSP needed to be set before calling QUIT, as DOCOL uses the
  return stack
- I'd forgotten LITs before values in a couple of places
- I'd not accounted for LITs in several branch offsets
- A few dictionary links were wrong
2026-02-27 18:35:17 +00:00
74ff0b037c Set values of HERE and LATEST 2026-02-27 16:20:36 +00:00
ca6ac0f9bf Implement cold start 2026-02-27 16:20:36 +00:00
2fafd02e28 Compile QUIT 2026-02-27 16:20:36 +00:00
bf65c7470a Compile INTERPRET 2026-02-27 16:20:36 +00:00
62f3bff926 Compile IMMEDIATE? 2026-02-27 16:20:36 +00:00
797a95204f Compile , 2026-02-27 16:20:36 +00:00
c4303cc2ca Compile NUMBER? 2026-02-27 16:20:36 +00:00
78d45c61de Compile NEGATE 2026-02-27 16:20:36 +00:00
dda02a1d9f Compile DIGIT 2026-02-27 16:20:36 +00:00
c2b0c55893 Compile >CFA 2026-02-27 16:20:36 +00:00
a8c51d0703 Compile FIND 2026-02-27 16:20:36 +00:00
a4e7673b7a Compile NAME-LEN 2026-02-27 16:20:36 +00:00
938bd98ef6 Untabify WAT source 2026-02-27 16:20:36 +00:00
777531abc4 Compile STRING= 2026-02-27 16:20:36 +00:00
a7c96fc56c Compile WORD 2026-02-27 16:20:36 +00:00
05a3e72669 Compile SPACE? 2026-02-27 16:20:36 +00:00
55bc5060e4 Compile TUCK 2026-02-27 16:20:36 +00:00
93f0b312a8 Re-wrap top comment 2026-02-26 18:30:49 +00:00
ef8e9ad3fd Add source code comments for colon words 2026-02-26 18:20:42 +00:00
dde7d0d710 Fill in addresses of constants and variables (and add a few more) 2026-02-26 18:10:56 +00:00
5dcc5de722 Reword comment about $trampoline a little 2026-02-26 18:10:43 +00:00
59ee6149e5 Switch to -1 for true, 0 for false
This means you can use the bitwise operators for booleans too.
2026-02-26 18:09:36 +00:00
3b3807e802 Fix 0BRANCH implementation 2026-02-26 18:09:04 +00:00
c2a8b304b1 Fix INVERT's link 2026-02-26 18:08:50 +00:00
9d671ad8ef Fix 2DUP implementation 2026-02-26 18:07:49 +00:00
db13287c91 Implement BRANCH and 0BRANCH 2026-02-25 21:37:27 +00:00
a830998617 Replace local set then get with tee 2026-02-25 21:29:14 +00:00
cc7609b847 Implement a bunch of core forth stuff
Not quite ready yet, but getting there.
2026-02-25 13:45:52 +00:00
d3e2407f3b Create initial emulator and hello world demo 2026-02-24 15:52:48 +00:00