De-stabilize (n)

This commit is contained in:
Virgil Dupras 2020-09-19 19:44:15 -04:00
parent 68dd800bd1
commit 53239c8f84
12 changed files with 14 additions and 17 deletions

View File

@ -5,11 +5,8 @@ CREATE XCURRENT 0 ,
: _xapply ( a -- a-off ) : _xapply ( a -- a-off )
DUP ORG @ > IF ORG @ - BIN( @ + THEN ; DUP ORG @ > IF ORG @ - BIN( @ + THEN ;
: XFIND XCURRENT @ SWAP _find DROP _xapply ; : XFIND XCURRENT @ SWAP _find DROP _xapply ;
: X' XCON ' XCOFF ; : X['] XCON ' _xapply LITN XCOFF ; : XLITN LIT" (n)" XFIND , , ;
: XCOMPILE XCON ' _xapply LITN : X' XCON ' XCOFF ; : X['] XCON ' _xapply XLITN XCOFF ;
: XCOMPILE XCON ' _xapply XLITN
LIT" ," FIND DROP _xapply , XCOFF ; LIT" ," FIND DROP _xapply , XCOFF ;
: X[COMPILE] XCON ' _xapply , XCOFF ; : X[COMPILE] XCON ' _xapply , XCOFF ;
: XDO LIT" 2>R" XFIND , H@ ;
: XLOOP LIT" (loop)" XFIND , H@ - C, ;
: XIF LIT" (?br)" XFIND , H@ 1 ALLOT ;
: XELSE LIT" (br)" XFIND , 1 ALLOT [COMPILE] THEN H@ 1- ;

View File

@ -1,3 +1,7 @@
: XDO LIT" 2>R" XFIND , H@ ;
: XLOOP LIT" (loop)" XFIND , H@ - C, ;
: XIF LIT" (?br)" XFIND , H@ 1 ALLOT ;
: XELSE LIT" (br)" XFIND , 1 ALLOT [COMPILE] THEN H@ 1- ;
: XAGAIN LIT" (br)" XFIND , H@ - C, ; : XAGAIN LIT" (br)" XFIND , H@ - C, ;
: XUNTIL LIT" (?br)" XFIND , H@ - C, ; : XUNTIL LIT" (?br)" XFIND , H@ - C, ;
: XLIT" : XLIT"

View File

@ -8,7 +8,7 @@
ELSE ( w ) ELSE ( w )
0x02 RAM+ @ SWAP ( cur w ) _find ( a f ) 0x02 RAM+ @ SWAP ( cur w ) _find ( a f )
IF DUP IMMED? NOT IF ABORT THEN EXECUTE IF DUP IMMED? NOT IF ABORT THEN EXECUTE
ELSE (parse) LITN THEN ELSE (parse) XLITN THEN
THEN THEN
AGAIN AGAIN
; ;

View File

@ -5,7 +5,7 @@
: DO XDO ; IMMEDIATE : LOOP XLOOP ; IMMEDIATE : DO XDO ; IMMEDIATE : LOOP XLOOP ; IMMEDIATE
: IF XIF ; IMMEDIATE : ELSE XELSE ; IMMEDIATE : IF XIF ; IMMEDIATE : ELSE XELSE ; IMMEDIATE
: AGAIN XAGAIN ; IMMEDIATE : UNTIL XUNTIL ; IMMEDIATE : AGAIN XAGAIN ; IMMEDIATE : UNTIL XUNTIL ; IMMEDIATE
: LIT" XLIT" ; IMMEDIATE : LIT" XLIT" ; IMMEDIATE : LITN XLITN ;
: IMMEDIATE XIMM ; : IMMEDIATE XIMM ;
: (entry) (xentry) ; : (entry) (xentry) ;
: CREATE XCREATE ; : CREATE XCREATE ;

View File

@ -5,7 +5,7 @@ NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST ) NOP, ( unused )
0 JP, ( RST 10 ) NOP, NOP, ( 13, oflw ) 0 JP, ( RST 10 ) NOP, NOP, ( 13, oflw )
NOP, NOP, NOP, NOP, NOP, ( unused ) NOP, NOP, NOP, NOP, NOP, ( unused )
0 JP, ( 1a, next ) NOP, NOP, NOP, ( unused ) 0 JP, ( 1a, next ) NOP, NOP, NOP, ( unused )
0 JP, ( RST 20 ) 0 A, 0 JP, ( 23, (n) ) NOP, ( unused ) 0 JP, ( RST 20 ) 0 A, 0 A, 0 A, 0 A, 0 A, ( unused )
0 JP, ( RST 28 ) 0 A, 0 A, 0 A, 0 A, 0 A, ( unused ) 0 JP, ( RST 28 ) 0 A, 0 A, 0 A, 0 A, 0 A, ( unused )
0 JP, ( RST 30 ) 0 A, 0 A, 0 A, 0 A, 0 A, ( unused ) 0 JP, ( RST 30 ) 0 A, 0 A, 0 A, 0 A, 0 A, ( unused )
0 JP, ( RST 38 ) 0 JP, ( RST 38 )

View File

@ -1,5 +1,4 @@
CODE (n) ( number literal ) CODE (n) ( number literal )
PC ORG @ 0x25 + ! ( stable ABI JP )
( Literal value to push to stack is next to (n) reference ( Literal value to push to stack is next to (n) reference
in the atom list. That is where IP is currently pointing. in the atom list. That is where IP is currently pointing.
Read, push, then advance IP. ) Read, push, then advance IP. )

View File

@ -3,7 +3,7 @@
: DO COMPILE 2>R H@ ; IMMEDIATE : DO COMPILE 2>R H@ ; IMMEDIATE
: LOOP COMPILE (loop) H@ - _bchk C, ; IMMEDIATE : LOOP COMPILE (loop) H@ - _bchk C, ; IMMEDIATE
( LEAVE is implemented in low xcomp ) ( LEAVE is implemented in low xcomp )
: LITN 0x23 ( n ) , , ; : LITN COMPILE (n) , ;
( gets its name at the very end. can't comment afterwards ) ( gets its name at the very end. can't comment afterwards )
: _ BEGIN LIT" )" WORD S= UNTIL ; IMMEDIATE : _ BEGIN LIT" )" WORD S= UNTIL ; IMMEDIATE
: _ ( : will get its name almost at the very end ) : _ ( : will get its name almost at the very end )

View File

@ -6,5 +6,4 @@ JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno )
JMPn, 0 A,, ( 0b, EXIT ) JMPn, 0 A,, ( 0b, EXIT )
0 A,, 0 A,, ( unused ) 0 A,, ( 13, oflw ) 0 A,, 0 A,, ( unused ) 0 A,, ( 13, oflw )
0 A,, 0 A,, 0 A, ( unused ) 0 A,, 0 A,, 0 A, ( unused )
JMPn, 0 A,, ( 1a, next ) 0 A,, 0 A,, 0 A,, ( unused ) JMPn, 0 A,, ( 1a, next )
0 A, JMPn, 0 A,, ( 23, (n) )

View File

@ -1,5 +1,4 @@
CODE (n) ( number literal ) CODE (n) ( number literal )
PC 0x27 - ORG @ 0x25 + ! ( stable abi )
DI DX MOVxx, DI [DI] MOVx[], DI PUSHx, DI DX MOVxx, DI [DI] MOVx[], DI PUSHx,
DX INCx, DX INCx, DX INCx, DX INCx,
;CODE ;CODE

Binary file not shown.

View File

@ -13,8 +13,7 @@ CREATE BIN( 0 ,
H@ ORG ! H@ ORG !
0x0b ALLOT0 0x0b ALLOT0
0 C, 0 C, ( EXIT ) 0 C, 0 C, ( EXIT )
0x16 ALLOT0 0x08 ALLOT0
0 C, 0x05 C, ( (n) )
( END OF STABLE ABI ) ( END OF STABLE ABI )
H@ 4 + XCURRENT ! ( make next CODE have 0 prev field ) H@ 4 + XCURRENT ! ( make next CODE have 0 prev field )
0x00 CODE EXIT 0x00 CODE EXIT

View File

@ -195,7 +195,7 @@ otherwise be difficult to access. Here's the complete list of
these references: these references:
04 BOOT addr 06 (uflw) addr 08 LATEST 04 BOOT addr 06 (uflw) addr 08 LATEST
0b EXIT wordref 13 (oflw) addr 23 (n) wordref 0b EXIT wordref 13 (oflw) addr 1a next addr
BOOT, (uflw) and (oflw) exist because they are referred to BOOT, (uflw) and (oflw) exist because they are referred to
before those words are defined (in core words). LATEST is a before those words are defined (in core words). LATEST is a