From dbd283758c6601b2833e485bb1d08d882a5d4a6f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 21 Jun 2020 11:41:10 -0400 Subject: [PATCH] Refer to BOOT and (uflw) by addr in stable ABI Was previously referred to by name+find, which was wasteful. --- blk/089 | 4 ++-- blk/283 | 4 ++-- blk/298 | 5 +---- blk/299 | 5 +---- blk/381 | 1 + blk/396 | 2 +- blk/821 | 8 ++------ emul/forth.bin | Bin 6195 -> 6174 bytes 8 files changed, 10 insertions(+), 19 deletions(-) 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 70d1e8d781890e40f99c4e57322f665cd3c97a0a..0357af013680c80a66f484b8236a62a043167cab 100644 GIT binary patch literal 6174 zcma)AeQcBGc7NUvf5dSTJ6}L(iyebwCj>%qI*H?x$aj_=k`f`O(e^+AKm5hexE64d+{JToNoe1n550(S*V2^mPU3;*Ks7~PA!Xk2$?*;BW@ICMWiNC<%v9Tk;T45Cn zn}x?%*sLua7Ymnu?YXjWTwA!b?D>al#FAQ-rcik=S;eSEGXs`;{!d(!2 zi`PvAD~Vjp?Wq-24^}M#*O77wU62_-s>1<*8Utueb(De{&^=-(VDb3-flW!PDDf@c zT3vVh#NT^LSFaAOZmPTF(Ovg%<^r{gt5>hSb#ISvd+ylZ28^ZDy_{$6uiJAUFZl59 zWwCHn`*>kgER1MW|Kp`yRvxxSnPTOW-tU*+Um91cDKh2t-IDvOAUR zt0WT7=^dfI5jx626{$(yr7m1~pz97#}-) zIQSG|o$Ky>#+TXM)Uj%m5eo&{o#9K$No+t2a+jfio*WY*s=2xn@DCP7NnE!A=5pY@ew36 zRSHd!B6*H$%}#*GysU=c5Ybpp1U(8(I$XhPRo5z8%#s$ZYK!M<5^U^Ec6(umq5o+$)w2Eu~uYRb{TPx5`L(y^xc;IpG@zPnUxLWFoHgal~6L&6wbGR|%hSIO<2% z9@qLJ-U^uWVQ%T5gu0l+RLC!uULZk?DykfmU_%)MER6noVMO}z_h{0>=&u$=9`HE4 zGg=M-ui!B-K0J}`3p$ZO$k+lRl}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