diff --git a/blk/090 b/blk/090 index a6ca6df..156d5a5 100644 --- a/blk/090 +++ b/blk/090 @@ -1,15 +1,10 @@ -4. Call INTERPRET +4. Call INTERPRET which interprets boot source code until + ASCII EOT (4) is met. This usually init drivers. +5. Initialize rdln buffer, _sys entry (for EMPTY), prints + "CollapseOS" and then calls (main). +6. (main) interprets from rdln input (usually from KEY) until + EOT is met, then calls BYE. -In other words, BOOT interprets bytes directly following -CURRENT as Forth source code. This code will typically -initialize all subsystems and then call RDLN$. As soon as -this is called, INTERPRET will begin reading from RDLN< which -reads from KEY. - -In the "/emul" binaries, "HERE" is readjusted to "CURRENT @" so -that we don't have to relocate compiled dicts. Note that in -this context, the initialization code is fighting for space -with HERE: New entries to the dict will overwrite that code! -Also, because we're barebone, we can't have comments. This can -lead to peculiar code in this area where we try to "waste" -space in initialization code. +In RAM-only environment, we will typically have a +"CURRENT @ HERE !" line during init to have HERE begin at the +end of the binary instead of RAMEND. diff --git a/blk/405 b/blk/405 index 33eb3ba..8977d54 100644 --- a/blk/405 +++ b/blk/405 @@ -1,5 +1,6 @@ : WS? 33 < ; : EOT? 4 = ; ( 4 == ASCII EOT, CTRL+D ) +: EOT, 4 C, ; : TOWORD 0 ( dummy ) BEGIN diff --git a/blk/417 b/blk/417 index 931cc51..11037da 100644 --- a/blk/417 +++ b/blk/417 @@ -2,8 +2,8 @@ H@ 0x3c ( BLK(* ) RAM+ ! 1024 ALLOT ( LOAD detects end of block with ASCII EOT. This is why - we write it there. EOT == 0x04 ) - 4 C, + we write it there. ) + EOT, 0 BLKDTY ! -1 BLK> ! ; diff --git a/blk/421 b/blk/421 index 3c7e85b..4ac1c29 100644 --- a/blk/421 +++ b/blk/421 @@ -11,6 +11,5 @@ : BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ; : CRLF CR LF ; : SPC 32 EMIT ; : NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ; -: (ok) SPC LIT" ok" (print) NL ; : (uflw) LIT" stack underflow" ERR ; : (wnf) (print) SPC LIT" word not found" ERR ; diff --git a/blk/432 b/blk/432 index 079e6de..f3883ca 100644 --- a/blk/432 +++ b/blk/432 @@ -2,7 +2,7 @@ BEGIN WORD DUP C@ EOT? IF DROP EXIT THEN (find) NOT IF (parse) ELSE EXECUTE THEN - C