1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:38:05 +11:00

Move a bunch of words from XPACKed core to xcomp core

This commit is contained in:
Virgil Dupras 2020-05-14 09:54:33 -04:00
parent 4143e2a699
commit 640e3321fc
7 changed files with 9 additions and 32 deletions

5
blk/414 Normal file
View File

@ -0,0 +1,5 @@
: [IF]
IF EXIT THEN
LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ;
: [THEN] ;

View File

@ -3,7 +3,9 @@
: LOOP COMPILE (loop) H@ - , ; IMMEDIATE
( LEAVE is implemented in low xcomp )
: LITN 32 , , ( 32 == NUMBER ) ;
: _ ( : will get its name at the very end )
( gets its name at the very end. can't comment afterwards )
: _ BEGIN LIT< ) WORD S= UNTIL ; IMMEDIATE
: _ ( : will get its name almost at the very end )
(entry)
[ 14 ( == compiledWord ) LITN ] C,
BEGIN

View File

@ -7,3 +7,4 @@
; IMMEDIATE
';' XCURRENT @ 4 - C!
':' X' _ 4 - C! ( give : its name )
'(' X' _ 4 - C!

14
blk/439
View File

@ -1,14 +0,0 @@
XPACKed core
Most of Collapse OS' core words are cross compiled (B390).
However, some of them are too dynamically referenced to be
cross-compiled without great pain, so we XPACK (B267) them,
that is, we put them in source form in the target's
initialization section (see B89).
These words will be compiled into RAM at initialization, which
is a bit wasteful both in RAM and in boot time, so we will
typically relink (B120) that newly compiled binary and append
it to our existing binary for optimal resource usage.
Load range: 440-446

13
blk/441
View File

@ -1,13 +0,0 @@
: _ BEGIN LIT< ) WORD S= UNTIL ; IMMEDIATE
40 CURRENT @ 4 - C!
( Hello, hello, krkrkrkr... do you hear me?
Ah, voice at last! Some lines above need comments
BTW: Forth lines limited to 64 cols because of default
input buffer size in Collapse OS
40 is ASCII for '('. We do this to simplify XPACK's task of
not mistakenly consider '(' definition as a comment.
LIT<: 34 == litWord
LITA: 36 == addrWord
COMPILE: Tough one. Get addr of caller word (example above
(br)) and then call LITA on it. )

View File

@ -6,7 +6,3 @@
H@ 2- ( push a. -2 for allot offset )
; IMMEDIATE
: [IF]
IF EXIT THEN
LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ;
: [THEN] ;

Binary file not shown.