mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-20 16:18:05 +11:00
xcomp: implement X[']
This commit is contained in:
parent
7c20501f27
commit
0434d02818
1
blk/263
1
blk/263
@ -9,6 +9,7 @@ VARIABLE XCURRENT
|
||||
: XIMM XCON IMMEDIATE XCOFF ;
|
||||
: _xapply ( a -- a-off )
|
||||
DUP ORG @ > IF ORG @ - BIN( @ + THEN ;
|
||||
: X['] XCON ' _xapply LITA XCOFF ;
|
||||
: XCOMPILE
|
||||
XCON ' _xapply LITA
|
||||
LIT< , (find) DROP _xapply , XCOFF ;
|
||||
|
4
blk/409
4
blk/409
@ -5,10 +5,10 @@
|
||||
NOT IF (parse) ELSE EXECUTE THEN
|
||||
C<? NOT IF LIT< (ok) (find) IF EXECUTE THEN THEN
|
||||
AGAIN ;
|
||||
XCURRENT @ _xapply ( to PSP )
|
||||
|
||||
( Drop RSP until I-2 == INTERPRET. )
|
||||
: EXIT!
|
||||
[ LITN ] ( I, from PSP )
|
||||
['] INTERPRET ( I )
|
||||
BEGIN ( I )
|
||||
DUP ( I I )
|
||||
R> DROP I 2- @ ( I I a )
|
||||
|
2
blk/411
2
blk/411
@ -6,7 +6,7 @@
|
||||
0 0x55 RAM+ ! ( 55 == (key) override )
|
||||
0 0x0a RAM+ ! ( NLPTR )
|
||||
( 0c == C<* )
|
||||
LIT< (boot<) (find) DROP 0x0c RAM+ !
|
||||
['] (boot<) 0x0c RAM+ !
|
||||
( boot< always has a char waiting. 06 == C<?* )
|
||||
1 0x06 RAM+ !
|
||||
LIT< INIT (find)
|
||||
|
1
blk/432
1
blk/432
@ -9,7 +9,6 @@
|
||||
EXIT!
|
||||
THEN
|
||||
;
|
||||
XCURRENT @ _xapply ( to PSP, for LOAD )
|
||||
( pre-comment for tight LOAD: The 0x08==I check after INTERPRET
|
||||
is to check whether we're restoring to "_", the word above.
|
||||
if yes, then we're in a nested load. Also, the 1 in 0x06 is
|
||||
|
2
blk/433
2
blk/433
@ -5,7 +5,7 @@
|
||||
0x2e RAM+ @ >R ( boot ptr )
|
||||
BLK@
|
||||
BLK( 0x2e RAM+ ! ( Point to beginning of BLK )
|
||||
[ LITN ( from PSP, B432 ) ] 0x08 RAM+ !
|
||||
['] _ 0x08 RAM+ !
|
||||
1 0x06 RAM+ ! ( 06 == C<? )
|
||||
INTERPRET
|
||||
R> 0x2e RAM+ ! R> 0x06 RAM+ !
|
||||
|
BIN
emul/forth.bin
BIN
emul/forth.bin
Binary file not shown.
@ -4,6 +4,7 @@
|
||||
212 LOAD ( z80 assembler )
|
||||
262 LOAD ( xcomp )
|
||||
: CODE XCODE ;
|
||||
: ['] X['] ; IMMEDIATE
|
||||
: COMPILE XCOMPILE ; IMMEDIATE
|
||||
: [COMPILE] X[COMPILE] ; IMMEDIATE
|
||||
: IMMEDIATE XIMM ;
|
||||
|
@ -10,6 +10,7 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM
|
||||
212 LOAD ( z80 assembler )
|
||||
262 LOAD ( xcomp )
|
||||
: CODE XCODE ;
|
||||
: ['] X['] ; IMMEDIATE
|
||||
: COMPILE XCOMPILE ; IMMEDIATE
|
||||
: [COMPILE] X[COMPILE] ; IMMEDIATE
|
||||
: IMMEDIATE XIMM ;
|
||||
|
@ -9,6 +9,7 @@ RAMSTART 0x72 + CONSTANT KBD_MEM
|
||||
262 LOAD ( xcomp )
|
||||
522 LOAD ( font compiler )
|
||||
: CODE XCODE ;
|
||||
: ['] X['] ; IMMEDIATE
|
||||
: COMPILE XCOMPILE ; IMMEDIATE
|
||||
: [COMPILE] X[COMPILE] ; IMMEDIATE
|
||||
: IMMEDIATE XIMM ;
|
||||
|
@ -4,6 +4,7 @@ RS_ADDR 0x80 - CONSTANT RAMSTART
|
||||
212 LOAD ( z80 assembler )
|
||||
262 LOAD ( xcomp )
|
||||
: CODE XCODE ;
|
||||
: ['] X['] ; IMMEDIATE
|
||||
: COMPILE XCOMPILE ; IMMEDIATE
|
||||
: [COMPILE] X[COMPILE] ; IMMEDIATE
|
||||
: IMMEDIATE XIMM ;
|
||||
|
Loading…
Reference in New Issue
Block a user