1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 16:48:06 +11:00

Refer to BOOT and (uflw) by addr in stable ABI

Was previously referred to by name+find, which was wasteful.
This commit is contained in:
Virgil Dupras 2020-06-21 11:41:10 -04:00
parent dcaa515929
commit dbd283758c
8 changed files with 10 additions and 19 deletions

View File

@ -6,9 +6,9 @@ very few things.
1. Set SP to PS_ADDR and IX to RS_ADDR
2. Sets HERE to RAMEND (RAMSTART+0x80).
3. Sets CURRENT to value of LATEST field in stable ABI.
4. Look for the word "BOOT" and calls it.
4. Execute the word referred to by 0x04 (BOOT) in stable ABI.
In a normal system, BOOT is in xcomp core (B411) and does a
In a normal system, BOOT is in core words at B396 and does a
few things:
1. Initialize all overrides to 0.

View File

@ -1,6 +1,6 @@
H@ ORG !
0 JPnn, ( 00, main ) NOP, NOP, NOP, ( unused )
NOP, NOP, ( unused ) NOP, NOP, ( 08, LATEST )
0 JPnn, ( 00, main ) NOP, ( unused ) NOP, NOP, ( 04, BOOT )
NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST )
NOP, NOP, NOP, NOP, NOP, NOP, NOP, ( 0a, unused )
0 JPnn, ( 11, pushRS ) 0 JPnn, ( 14, popRS )
NOP, NOP, NOP, ( unused )

View File

@ -1,8 +1,5 @@
6 A, '(' A, 'u' A, 'f' A, 'l' A, 'w' A, ')' A,
lblofl BSET ( abortUnderflow )
HL PC 7 - LDddnn,
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
lblfind @ CALLnn,
DE BIN( @ 0x06 ( uflw ) + LDdd(nn),
JR, L2 FWR ( execute, B301 )

View File

@ -1,4 +1,3 @@
L1 BSET 4 A, 'B' A, 'O' A, 'O' A, 'T' A,
PC ORG @ 1 + ! ( main )
( STACK OVERFLOW PROTECTION: See B76 )
SP PS_ADDR LDddnn, IX RS_ADDR LDddnn,
@ -10,7 +9,5 @@ PC ORG @ 1 + ! ( main )
Forth. )
BIN( @ 0x08 + LDHL(nn),
RAMSTART 0x02 ( CURRENT ) + LD(nn)HL,
EXDEHL,
HL L1 @ LDddnn,
lblfind @ CALLnn,
DE BIN( @ 0x04 ( BOOT ) + LDdd(nn),
JR, L1 FWR ( execute, B301 )

View File

@ -6,6 +6,7 @@
: CRLF CR LF ; : SPC 32 EMIT ;
: NL 0x0a RAM+ @ ( NLPTR ) ?DUP IF EXECUTE ELSE CRLF THEN ;
: (uflw) LIT" stack underflow" ERR ;
XCURRENT @ _xapply ORG @ 0x06 ( stable ABI uflw ) + !
: (wnf) (print) SPC LIT" word not found" ERR ;

View File

@ -13,4 +13,4 @@
1 0x06 RAM+ ! INTERPRET
RDLN$ LIT< _sys [entry]
LIT< CollapseOS (print) NL (main) ;
XCURRENT @ _xapply ORG @ 0x04 ( stable ABI BOOT ) + !

View File

@ -1,4 +1,3 @@
L3 BSET 4 A, 'B' A, 'O' A, 'O' A, 'T' A,
PC 3 - ORG @ 1+ ! ( main )
SP PS_ADDR MOVxI, BP RS_ADDR MOVxI,
DI 0x08 MOVxm, ( LATEST )
@ -6,8 +5,5 @@ PC 3 - ORG @ 1+ ! ( main )
BX RAMSTART MOVxI,
[BX] 0x04 ( HERE ) DI MOV[]+x,
[BX] 0x02 ( CURRENT ) DI MOV[]+x,
SI L3 @ MOVxI,
CALLn, lblfind @ RPCn, ( find )
IFZ, JMPn, lblexec @ RPCn, ( execute ) THEN,
AH 0x0e MOVri, ( print char ) AL '!' MOVri, 0x10 INT,
BEGIN, JMPs, AGAIN,
DI 0x04 ( BOOT ) MOVxm,
JMPn, lblexec @ RPCn, ( execute )

Binary file not shown.