aw / fiveforths

32-bit RISC-V Forth for microcontrollers
https://fiveforths.a1w.ca
MIT License
66 stars 3 forks source link

TOIN should not be an address #13

Closed aw closed 1 year ago

aw commented 1 year ago

The TOIN variable should not contain the address of the current location into the buffer, but rather the number of bytes into the buffer. That's how it works in other Forths, and this current implementation would make it difficult to use >in as intended (ex: as a counter) without first subtracting the value of TIB.

Since TOIN is used in quite a few places, it might be difficult to change this functionality without breaking something... so some tests should be written beforehand.