<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>
In Parsing Words in TurboForth Kernal
Reads characters from the current input device (either the keyboard, or a disk block).
Note: this example is for version 1.2
: test ( -- )
tib @ 80 expect \ get up to 80 characters of text into TIB in VDP RAM
begin bl word dup while cr type repeat
test fred bloggs was ere
Note: each invocation of WORD copies a word from the Termial Input Buffer (TIB) in VDP memory to a word buffer in CPU memory; thus the address returned by WORD and passed to TYPE in the above example is a CPU memory address.
Receive length (up to a maximum of C/L) characters and store each received character into VDP memory.
The transfer begins at vdp_address, proceeding towards higher addresses one byte per character until either a "return" is received or until length or C/L characters have been transferred.
No more than length or C/L characters will be stored. The "return" is not stored into memory.
No characters are received or transferred if length is zero.
On exit, SPAN is set to the number of characters actually received and >IN shall be reset to 0.