1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 21:58:06 +11:00

Improve late-stage xcomp

This commit is contained in:
Virgil Dupras 2020-05-14 09:45:42 -04:00
parent 179c66be8a
commit 4143e2a699
4 changed files with 18 additions and 26 deletions

View File

@ -1,14 +1,13 @@
VARIABLE XCURRENT VARIABLE XCURRENT
: XCON XCURRENT CURRENT* ! ; : XCON XCURRENT CURRENT* ! ;
: XCOFF 0x02 RAM+ CURRENT* ! ; : XCOFF 0x02 RAM+ CURRENT* ! ;
: (xentry) XCON (entry) XCOFF ; : (xentry) XCON (entry) XCOFF ;
: XCREATE (xentry) 11 C, ; : XCREATE (xentry) 11 C, ;
: XCODE XCON CODE XCOFF ; : XCODE XCON CODE XCOFF ;
: XIMM XCON IMMEDIATE XCOFF ; : XIMM XCON IMMEDIATE XCOFF ;
: _xapply ( a -- a-off ) : _xapply ( a -- a-off )
DUP ORG @ > IF ORG @ - BIN( @ + THEN ; DUP ORG @ > IF ORG @ - BIN( @ + THEN ;
: X' XCON ' XCOFF ;
: X['] XCON ' _xapply LITA XCOFF ; : X['] XCON ' _xapply LITA XCOFF ;
: XCOMPILE : XCOMPILE
XCON ' _xapply LITA XCON ' _xapply LITA

16
blk/437
View File

@ -3,11 +3,11 @@
: LOOP COMPILE (loop) H@ - , ; IMMEDIATE : LOOP COMPILE (loop) H@ - , ; IMMEDIATE
( LEAVE is implemented in low xcomp ) ( LEAVE is implemented in low xcomp )
: LITN 32 , , ( 32 == NUMBER ) ; : LITN 32 , , ( 32 == NUMBER ) ;
: _ ( : will get its name at the very end )
( ';' can't have its name right away because, when created, it (entry)
is not an IMMEDIATE yet and will not be treated properly by [ 14 ( == compiledWord ) LITN ] C,
xcomp. ) BEGIN
: _ WORD (find)
['] EXIT , IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN
R> DROP ( exit : ) ELSE ( maybe number ) (parse) LITN THEN
; IMMEDIATE AGAIN ;

25
blk/438
View File

@ -1,16 +1,9 @@
XCURRENT @ ( to PSP ) ( ';' can't have its name right away because, when created, it
: : is not an IMMEDIATE yet and will not be treated properly by
(entry) xcomp. )
( We cannot use LITN as IMMEDIATE because of bootstrapping : _
issues. Same thing for ",". ['] EXIT ,
32 == NUMBER 14 == compiledWord ) R> DROP ( exit : )
[ 32 H@ ! 2 ALLOT 14 H@ ! 2 ALLOT ] C, ; IMMEDIATE
BEGIN ';' XCURRENT @ 4 - C!
WORD ':' X' _ 4 - C! ( give : its name )
(find)
( is word )
IF DUP IMMED? IF EXECUTE ELSE , THEN
( maybe number )
ELSE (parse) LITN THEN
AGAIN ;
( from PSP ) ';' SWAP 4 - C!

Binary file not shown.