mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 22:08:05 +11:00
eefbf66e95
When writing the xcomp documentation, I realized that with careful threading and by accepting a bit of code duplication in the xcomp toolset, I could de-stabilize a couple of words. (n) and EXIT are a bit trickier, but I think it can be done. It would be nice to get rid of stable wordrefs...
13 lines
325 B
Plaintext
13 lines
325 B
Plaintext
: IF ( -- a | a: br cell addr )
|
|
COMPILE (?br) H@ 1 ALLOT ( br cell allot )
|
|
; IMMEDIATE
|
|
: THEN ( a -- | a: br cell addr )
|
|
DUP H@ -^ _bchk SWAP ( a-H a ) C!
|
|
; IMMEDIATE
|
|
: ELSE ( a1 -- a2 | a1: IF cell a2: ELSE cell )
|
|
COMPILE (br)
|
|
1 ALLOT
|
|
[COMPILE] THEN
|
|
H@ 1- ( push a. 1- for allot offset )
|
|
; IMMEDIATE
|