1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 12:38:05 +11:00
collapseos/blk/398
Virgil Dupras 94cb76520a Refer to stable wordref by direct offset in "hot zone" immediates
Previously, it was impossible to cross-compile Collapse OS from a
binary-offsetted Collapse OS because stable ABI wordrefs would have
a wrongly offsetted address.

This solves the problem by replacing those wordrefs by direct,
hardcoded stable ABI offset references.
2020-07-05 07:09:11 -04:00

13 lines
326 B
Plaintext

: IF ( -- a | a: br cell addr )
0x67 ( ?br ) , H@ 2 ALLOT ( br cell allot )
; IMMEDIATE
: THEN ( a -- | a: br cell addr )
DUP H@ -^ _bchk SWAP ( a-H a ) !
; IMMEDIATE
: ELSE ( a1 -- a2 | a1: IF cell a2: ELSE cell )
0x53 ( br ) ,
2 ALLOT
[COMPILE] THEN
H@ 2- ( push a. -2 for allot offset )
; IMMEDIATE