Closed aw closed 3 years ago
@theandrew168 wait a bit before blindly merging. I think there might be a bug in !
. I'm running tests and will confirm later.
Hah, I accidentally swapped the stack pointer offsets in my initial commit. This is fixed in 272f61f (although technically the order doesn't matter for +
and nand
).
To test, I uploaded lexicons/prelude.forth
and used swap
to verify if the !
store to memory works as expected:
1 2 swap 32 + emit
! ok
2 1 swap 32 + emit
" ok
Previously the results were reversed, which means obviously swap
wasn't working. Sorry!
Nice catch! I always appreciate these small optimizations to the Forth core. Every byte helps!
This is not a big change, but it essentially removes one
addi
instruction in the!
,+
, andnand
words by moving the stack pointer down by 8 instead of 4.