Digest #225 2023-06-15

Contributions

[300] 2023-06-13 11:34:41 deadmarshal wrote:

example -

Usage Example:

10 constant N
variable counts N allot
counts N erase 
counts N dump

Replies

[r1022] 2023-06-09 02:31:22 MitraArdron replies:

proposal - 2C! and 2C@

You say There are Forth words that handle 64-bit values, 32-bit values, 8-bit values but not 16-bit values.. I'm curious - what words do you have in mind. 2! and 2@ work on cell pairs and the size of a cell is system dependent. In my [WebForth] for example in the ESP8266 you set #define CELLL 4 to work on 32 bit cells, in which case 2@ fetches 64 bits but in Arduino you set #define CELLL 2 to work on 16 bit cells in which case 2@ fetches 32 bits.

For system programing it would be dangerous to use @ ! 2@ and 2! unless you knew for sure how this mapped to the underlying system architecture.


[r1023] 2023-06-09 06:04:28 AntonErtl replies:

proposal - 2C! and 2C@

Common practice for reading and writing 16-bit values is w@ ( addr -- u ) and w! ( x addr -- ). We have been discussing standardizing these and related words for many years, maybe we will get around to it at some point.