<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


WORD Search:

In Parsing Words in TurboForth Kernal

Word Name: WORD
Type: Standard word
Data Stack Signature: delimiter -- address length
Return Stack Signature: --
Availability: V1.0  V1.1  V1.2
Description:

Identifies words from a string of text in the Terminal Input Buffer (which is in VDP memory).

Example:

: test ( -- )
  tib @ 80 expect \ get up to 80 characters of text into TIB in VDP RAM
  begin bl word dup while cr type repeat
  2drop ;

test fred bloggs was ere

Output:

fred
bloggs
was
ere

Comment:

Versions 1.0 & 1.1

Moves through the input buffer defined by TIB returns the address and length of a word identified by the ascii value delimiter. Updates >IN as WORD moves through the buffer. If no word is found, or the end of the buffer (as defined by C/L) is reached then 0 0 is returned.

  • address shall be a VDP address if BLK>0 when WORD is called;
  • length shall be the lenth of the identified word, in bytes.

If no word is found (i.e., the end of the input has been reached) then the length parameter returned shall be zero.

Version 1.2

Moves through the input buffer, which is in VDP memory, and pointed to by the VDP address in the varaible TIB, and copies a single delimited word to the word buffer in CPU RAM.

If no word is found (i.e., the end of the input has been reached) then the length parameter returned shall be zero.

  • address shall be a CPU RAM address where the identified word has been copied to;
  • length shall be the lenth of the identified word, in bytes.
See Also: >IN  C/L  TIB 

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>