figForth Word - IF
Some parts of this page/site are currently incomplete & will be updated asap
Other parts will change continually so use “Refresh” in your browser !!
There is extensive use of “Tooltips” text to support learning which do
not seem to render on a Smartphone
IF f — (run-time) – addr n (compile) P,C2,L0 Occurs is a colon-definition in form: IF (tp) … ENDIF . IF (tp) … ELSE (fp) … ENDIF At run-time, IF selects execution based on a boolean flag. If f is true (non-zero), execution continues ahead thru the true part. If f is false (zero), execution skips till just after ELSE to execute the false part. After either part, execution resumes after ENDIF. ELSE and its false part are optional.; if missing, false execution skips to just after ENDIF.. At compile-time IF compiles 0BRANCH and reserves space for an offset at addr. addr and n are used later for resolution of the offset and error testing
NFA: 007403 C2 DB 0C2H
007404 49 DB "I"
007405 C6 DB 'F'+80H
LFA: 007406 E473 DW REPEA-9
CFA: 007408 3C28 _IF: DW DOCOL ; :
PFA: 00740A 0B6B DW COMP ; COMPILE
00740C DA21 DW ZBRAN ; 0BRANCH
00740E 0769 DW HERE ; HERE
007410 BF67 DW ZERO ; 0
007412 2369 DW COMMA ; ,
007414 C767 DW TWO ; 2
007416 1725 DW SEMIS ; ;
zxxxvxd
NFA: 0021D0 87 DB 87H
0021D1 30425241 4E43 DB "0BRANC"
0021D7 C8 DB 'H'+80H
LFA: 0021D8 B921 DW BRAN-9
CFA: 0021DA DC21 ZBRAN: DW $+2
PFA: 0021DC E1 POP HL
0021DD 7D LD A,L
0021DE B4 OR H
0021DF 28 E3 JR Z,BRAN1
0021E1 03 INC BC
0021E2 03 INC BC
0021E3 C3 E2 20 JP NEXT