27.10.2013 Views

5 - Forth Interest Group

5 - Forth Interest Group

5 - Forth Interest Group

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If CHR is a period then set DPL to<br />

zero and leave true flag else leave<br />

false flag.<br />

?ASCII flag --- flag<br />

If CHR equals character following<br />

?ASCII then leave true flag else<br />

leave false flat.<br />

?BOTH flag --- flag<br />

If flag is true and CHR is a blank<br />

then leave a true flag else leave<br />

a false flag.<br />

?END flag --- flag<br />

If CHR is a blank then leave a true<br />

flag else leave a false flag.<br />

?SIGN false d flag --- sign d flag<br />

If CHR equals - change false flag<br />

to a true flag and leave true flag<br />

on top else leave false flag on<br />

top.<br />

?SKIP flag --- flag<br />

Make flag true. Used to skip past<br />

character if flag was false.<br />

ASCII -- char<br />

Place following character on data<br />

stack a8 a number.<br />

CHR flag -- char<br />

Add flag to >CHR and fetch char-<br />

acter at >CHR to data stack.<br />

N: A definining word used in the<br />

form :<br />

Page 130<br />

N: . . . ;<br />

--- d true<br />

--- false<br />

Convert word at here leaving double<br />

number and a true flag on the data<br />

stack. If word does not convert<br />

leave only a false flag on the data<br />

stack.<br />

N dl flag --- d2 flag<br />

Convert digit at CHR into doriblt<br />

number beneath. If successful<br />

leave true flag else a false flag.<br />

NNN dl flag --- d2 flag<br />

Do three N leaving true flag if<br />

successful else false flag.<br />

NS dl flag --- d2 flag<br />

Do N until failure, leaving a true<br />

flag on top of data stack with >CHR<br />

pointing to last character accepted<br />

(N) dl digit --- d2<br />

Convert binary digit into number<br />

be nea t h .<br />

REQUIRED flag --- flag<br />

TRAIT<br />

If flag is false exit this word<br />

leaving false flag. If flag is<br />

true leave true flag and continue.<br />

---<br />

addr<br />

A variable containing the word<br />

count from the last UNTIL: defined<br />

word.<br />

UNTIL :<br />

A defining word used in the form:<br />

UNTIL: . . . ;<br />

Words created by UNTIL: are like<br />

colon-definitions except the run<br />

time function is to execute words<br />

in the definition until there is a<br />

true flag on the data stack, then<br />

exit the word leaving the word<br />

count of the words executed in the<br />

variable TRAIT.<br />

FORTH DIMENSIONS 11/ 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!