mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-05 22:00:54 +11:00
2d17b4e8ec
I'm not sure why I chose null-terminated initially. Probably because the z80asm version had null-terminated strings. Length-prefixes strings are the traditional form of strings in Forth and it's a bit easier to work with them with traditional forth words when they're under this form.
11 lines
242 B
Plaintext
11 lines
242 B
Plaintext
: [entry] ( w -- )
|
|
C@+ ( w+1 len ) TUCK MOVE, ( len )
|
|
( write prev value )
|
|
H@ CURRENT @ - ,
|
|
C, ( write size )
|
|
H@ CURRENT !
|
|
;
|
|
: (entry) WORD [entry] ;
|
|
: CREATE (entry) 11 ( 11 == cellWord ) C, ;
|
|
: VARIABLE CREATE 2 ALLOT ;
|