5.19.3 String Formats
Forth commonly uses two different methods for representing character
As a counted string, represented by a c-addr. The char
addressed by c-addr contains a character-count, n, of the
string and the string occupies the subsequent n char addresses in
- As cell pair on the stack; c-addr u, where u is the length
of the string in characters, and c-addr is the address of the
first byte of the string.
Standard Forth encourages the use of the cell pair format when
count ( c-addr1 – c-addr2 u ) core “count”
c-addr2 is the first character and u the length of the
counted string at c-addr1.
For words that move, copy and search for strings see Memory Blocks. For words that display characters and strings see
Displaying characters and strings.