From b1a95648f142d108766a887ead75deb7b990a9d5 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 19 Sep 2020 20:35:35 -0400 Subject: [PATCH] De-stabilize EXIT This marks the end of wordrefs in stable ABI. Nice. --- blk/265 | 6 +++--- blk/280 | 9 ++++----- blk/281 | 4 ---- blk/283 | 4 ++-- blk/287 | 5 ----- blk/305 | 1 - blk/397 | 2 +- blk/805 | 2 +- blk/811 | 1 - cvm/forth.bin | Bin 5208 -> 5208 bytes cvm/xcomp.fs | 4 +--- doc/impl.txt | 25 +++++-------------------- 12 files changed, 17 insertions(+), 46 deletions(-) delete mode 100644 blk/281 diff --git a/blk/265 b/blk/265 index 905ce9b..534dbcb 100644 --- a/blk/265 +++ b/blk/265 @@ -1,7 +1,8 @@ : X: (xentry) 1 ( compiled ) C, BEGIN - WORD DUP LIT" ;" S= IF DROP 0x0b , EXIT THEN + WORD DUP LIT" ;" S= IF + DROP LIT" EXIT" XFIND , EXIT THEN XCURRENT @ SWAP ( xcur w ) _find ( a f ) IF ( a ) DUP IMMED? IF ABORT THEN @@ -11,5 +12,4 @@ IF DUP IMMED? NOT IF ABORT THEN EXECUTE ELSE (parse) XLITN THEN THEN - AGAIN -; + AGAIN ; diff --git a/blk/280 b/blk/280 index ace73f8..9892f73 100644 --- a/blk/280 +++ b/blk/280 @@ -9,8 +9,7 @@ is IP. SP points to PSP TOS, but you can still use the stack in native code. you just have to make sure you've restored it before "next". -STABLE ABI: The boot binary starts with a list of references. -The address of these references have to stay to those addr- -esses. The rest of the Collapse OS code depend on it. In fact, -up until 0x67, the (?br) wordref, pretty much everything has -to stay put. (cont.) +The boot binary is loaded in 2 parts. The first part, "decla- +rations", are loaded after xcomp, before xcomp overrides, with +"282 LOAD". The rest, after xcomp overrides, with "283 335 +LOADR". diff --git a/blk/281 b/blk/281 deleted file mode 100644 index 5c2b1c8..0000000 --- a/blk/281 +++ /dev/null @@ -1,4 +0,0 @@ -The boot binary is loaded in 2 parts. The first part, "decla- -rations", are loaded after xcomp, before xcomp overrides, with -"282 LOAD". The rest, after xcomp overrides, with "283 335 -LOADR". diff --git a/blk/283 b/blk/283 index cf18906..de4815d 100644 --- a/blk/283 +++ b/blk/283 @@ -1,7 +1,7 @@ H@ ORG ! ( STABLE ABI ) 0 JP, ( 00, main ) NOP, ( unused ) NOP, NOP, ( 04, BOOT ) -NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST ) NOP, ( unused ) -0 A, 0 JP, ( 0b, EXIT ) NOP, ( unused ) +NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST ) +NOP, NOP, NOP, NOP, NOP, NOP, ( unused ) 0 JP, ( RST 10 ) NOP, NOP, ( 13, oflw ) NOP, NOP, NOP, NOP, NOP, ( unused ) 0 JP, ( 1a, next ) NOP, NOP, NOP, ( unused ) diff --git a/blk/287 b/blk/287 index 43dbbae..9f66c93 100644 --- a/blk/287 +++ b/blk/287 @@ -1,10 +1,5 @@ lblexec BSET L1 FSET ( B284 ) L2 FSET ( B286 ) ( DE -> wordref ) - ( When we have a BIN( offset, we need to adjust stable - ABI offsets. ) - BIN( @ [IF] - A XORr, D ORr, IFZ, D BIN( @ 256 / LDri, THEN, - [THEN] LDA(DE), DE INCd, A ORr, IFZ, EXDEHL, JP(HL), THEN, A DECr, JRZ, L1 FWR ( compiled B289 ) diff --git a/blk/305 b/blk/305 index df45427..26fb37a 100644 --- a/blk/305 +++ b/blk/305 @@ -4,7 +4,6 @@ CODE EXECUTE lblexec @ JP, CODE EXIT -PC ORG @ 0x0d + ! ( stable ABI JP ) C 0 IX+ LDrIXY, B 1 IX+ LDrIXY, IX DECd, IX DECd, diff --git a/blk/397 b/blk/397 index 81bc1a9..b1af1cd 100644 --- a/blk/397 +++ b/blk/397 @@ -9,7 +9,7 @@ : _ ( : will get its name almost at the very end ) (entry) 1 ( compiled ) C, BEGIN - WORD DUP LIT" ;" S= IF DROP 0x0b , EXIT THEN + WORD DUP LIT" ;" S= IF DROP COMPILE EXIT EXIT THEN FIND IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN ELSE ( maybe number ) (parse) LITN THEN AGAIN ; diff --git a/blk/805 b/blk/805 index 6db43f3..dbc7e12 100644 --- a/blk/805 +++ b/blk/805 @@ -3,7 +3,7 @@ H@ ORG ! JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno ) 0 A,, ( 04, BOOT ) 0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) 0 A,, ( unused ) -JMPn, 0 A,, ( 0b, EXIT ) +0 A, 0 A,, ( 0b, EXIT ) 0 A,, 0 A,, ( unused ) 0 A,, ( 13, oflw ) 0 A,, 0 A,, 0 A, ( unused ) JMPn, 0 A,, ( 1a, next ) diff --git a/blk/811 b/blk/811 index cabbdca..f4a2892 100644 --- a/blk/811 +++ b/blk/811 @@ -2,7 +2,6 @@ CODE EXECUTE 1 chkPS, DI POPx, JMPn, lblexec @ RPCn, CODE EXIT -PC 0x0f - ORG @ 0x0d + ! ( stable abi ) DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS ) ;CODE diff --git a/cvm/forth.bin b/cvm/forth.bin index 5f034940a54960d1e6b9b209fd71cf3441ecd784..1062b4b576e7f711e326673ce25de1b7144586a1 100644 GIT binary patch delta 2200 zcmYjSU2GIp6h3!$yF0tx|D`|3RQliDZ96Ru720gu-EFsJ?RK`^pF&d#NUWhiE0PjL ziA1PD6H#OmO-*z)F;ZWMCYosC?~D58gD*s)F(%@RFC>H)u=t%j-QdHVne&~Wd+s^k zy>laSBl5|g;=D$wjM3>OyGRj{A~f2U&ZjNiPB)>Cmh$d)RUuof> zgbTs<1b>fbjInAYY=)&wmw{xAVISEL-7BLrM#Ll4KGJW>kc<(v91?U;;UXeSD^Hz_ z2FW2zaZp*KDWyR)2+e#$X-CP)R4!j^qbhMsysc=I&gb38_c%Etr%o@etVZKX57}1f zTiAx`NQjH#K4}zJ<>&k27Vu%WRMw@^8?Q$7DSB{zlTAac-Bx7G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2ox0bH&}V-BXx#E^B0p?3kt|9(}3%z^tV@XaHahBzorI8)=7U+ml$kxCL}blS(cR z;>WD}#4WXvf~9#kwcHqYW8Ra8XK`wTDaPw?ppmNva-%MTP>vO9BioV(l<`Q)czA%n z$))dkqWEt0CJ;G12oAQ0m{&7TdfU-K{kb+-5s62@x&YOSXS^;CKd>Fxx@oHyYu+`) zeD9s-z4-VTkNDaKct^u6sBD$ebe?W06}(lv|3N<{GP4b`=(3#W!!pa7W`5w~Ob>j_ zttNjTWYND12SM-a!J3@TjYEyWJ@4USEBoG4Cs$xxgUZ*|c^(ieXz36{^1fMQkb=w@Mz8luRYL&%1+6EEpqk z>wlEAj1i5kCCh3a4|brctHItN7_{`n;&M#KB6s`;f&LPF9r9=>HmT8QzLhRuk_Ecr z&~Yp9HS4EUAcGQ7#fcCf%v`o))Jm$QfnNcFzu`;xdx_W?=L?|pUCq1^VrtzDHD~bi z92=H-dt{b1fn!X3Lc_?tO1koy?L??Taqv5nE8@8Gif!;^&;GEk@YO#bZb9{W^A2QM z2&XCT!Mf&~;V?R#&WvY`0KJUs2dx-SWeqnJD~GOBt1cU*Y_3iktU{`Wxe$uK 0x100 and be broken. - -For this reason, any stable wordref compiled in the "hot zone" -(B397-B400) has to be compiled by direct offset reference to -avoid having any binary offset applied to it. +All Collapse OS binaries, regardless of architecture, have +those values at those offsets of them. Some binaries are built +to run at offset different than zero. This stable ABI lives at +that offset, not 0.