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