3 ms·
It would be cool to add some FORTH words to support arbitrarily sized byte addressing! Mitch Bradley's Forth (which evolved into Open Firmware) [1], which is a
by DonHopkins 11y ago
It would be cool to add some FORTH words to support arbitrarily sized byte addressing!
Mitch Bradley's Forth (which evolved into Open Firmware) [1], which is a purposefully word-size agnostic dialect, had the decoratively named word @c@++ which pops an address and pushes the address incremented by one ("++") and the byte at ("c@") the initial address ("@"), and the corresponding word @c!++ which went the other way. On a PDP-10 Forth that address could be a sized byte pointer!
If you had a complete set of arbitrarily sized byte processing words, then you could implement your string words in FORTH on top of those, and use whatever byte size for strings you want!
[1] https://en.wikipedia.org/wiki/Open_Firmware https://en.wikipedia.org/wiki/Open_Firmware
- aap_ 11y agoYeah, I was thinking about something similar to this. The other idea I had was to have virtual byte addresses (some flags in the left halfword would be set) that are converted to real byte addresses on use. This means you could perform pointer arithmetic on them without needing extra words for that. On the other hand you'd have to convert them all the time...