diff --git a/blk/089 b/blk/089 index 518d49c..9a9a773 100644 --- a/blk/089 +++ b/blk/089 @@ -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. diff --git a/blk/283 b/blk/283 index 5e993d6..562302d 100644 --- a/blk/283 +++ b/blk/283 @@ -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 ) diff --git a/blk/298 b/blk/298 index 695ce64..9fd728a 100644 --- a/blk/298 +++ b/blk/298 @@ -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 ) diff --git a/blk/299 b/blk/299 index cc1b2c8..321c417 100644 --- a/blk/299 +++ b/blk/299 @@ -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 ) diff --git a/blk/381 b/blk/381 index bf91477..6a83d74 100644 --- a/blk/381 +++ b/blk/381 @@ -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 ; diff --git a/blk/396 b/blk/396 index 251d1ce..5b3f24b 100644 --- a/blk/396 +++ b/blk/396 @@ -13,4 +13,4 @@ 1 0x06 RAM+ ! INTERPRET RDLN$ LIT< _sys [entry] LIT< CollapseOS (print) NL (main) ; - +XCURRENT @ _xapply ORG @ 0x04 ( stable ABI BOOT ) + ! diff --git a/blk/821 b/blk/821 index d68111e..4e45526 100644 --- a/blk/821 +++ b/blk/821 @@ -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 ) diff --git a/emul/forth.bin b/emul/forth.bin index 70d1e8d..0357af0 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ