mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 12:08:07 +11:00
Move a bunch of words from XPACKed core to xcomp core
This commit is contained in:
parent
4143e2a699
commit
640e3321fc
5
blk/414
Normal file
5
blk/414
Normal file
@ -0,0 +1,5 @@
|
||||
: [IF]
|
||||
IF EXIT THEN
|
||||
LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ;
|
||||
: [THEN] ;
|
||||
|
4
blk/437
4
blk/437
@ -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
|
||||
|
1
blk/438
1
blk/438
@ -7,3 +7,4 @@
|
||||
; IMMEDIATE
|
||||
';' XCURRENT @ 4 - C!
|
||||
':' X' _ 4 - C! ( give : its name )
|
||||
'(' X' _ 4 - C!
|
||||
|
14
blk/439
14
blk/439
@ -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
13
blk/441
@ -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. )
|
4
blk/443
4
blk/443
@ -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] ;
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
Loading…
Reference in New Issue
Block a user