mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 04:28: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...
16 lines
631 B
Plaintext
16 lines
631 B
Plaintext
CREATE XCURRENT 0 ,
|
|
: XCON XCURRENT CURRENT* ! ; : XCOFF 0x02 RAM+ CURRENT* ! ;
|
|
: (xentry) XCON (entry) XCOFF ; : XCREATE (xentry) 2 C, ;
|
|
: XCODE XCON CODE XCOFF ; : XIMM XCON IMMEDIATE XCOFF ;
|
|
: _xapply ( a -- a-off )
|
|
DUP ORG @ > IF ORG @ - BIN( @ + THEN ;
|
|
: XFIND XCURRENT @ SWAP _find DROP _xapply ;
|
|
: X' XCON ' XCOFF ; : X['] XCON ' _xapply LITN XCOFF ;
|
|
: XCOMPILE XCON ' _xapply LITN
|
|
LIT< , FIND DROP _xapply , XCOFF ;
|
|
: X[COMPILE] XCON ' _xapply , XCOFF ;
|
|
: XDO LIT< 2>R XFIND , H@ ;
|
|
: XLOOP LIT< (loop) XFIND , H@ - C, ;
|
|
: XIF LIT< (?br) XFIND , H@ 1 ALLOT ;
|
|
: XELSE LIT< (br) XFIND , 1 ALLOT [COMPILE] THEN H@ 1- ;
|