diff --git a/blk/089 b/blk/089 index 0aac0f4..518d49c 100644 --- a/blk/089 +++ b/blk/089 @@ -1,16 +1,16 @@ Initialization sequence -On boot, we jump to the "main" routine in boot.fs which does +On boot, we jump to the "main" routine in B289 which does very few things. -1. Set SP to 0x10000-6 +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. -In a normal system, BOOT is in icore and does a few things: +In a normal system, BOOT is in xcomp core (B411) and does a +few things: -1. Find "(c<)" a set CINPTR to it (what C< calls). -2. Initialize all overrides to 0. -3. Write LATEST in BOOT C< PTR ( see below ) -4. Find "INIT". If found, execute. Otherwise, "INTERPRET"(cont) +1. Initialize all overrides to 0. +2. Write LATEST in BOOT C< PTR ( see below ) +3. Set "C<*", the word that C< calls to (boot<). (cont.) diff --git a/blk/090 b/blk/090 index af74409..a6ca6df 100644 --- a/blk/090 +++ b/blk/090 @@ -1,16 +1,15 @@ -On a bare system (only boot+icore), this sequence will result -in (c<) reading characters from memory starting from CURRENT -(this is why we put CURRENT in BOOT C< PTR, it tracks current -pos ). +4. Call INTERPRET -This means that you can put initialization code in source form -right into your binary, right after your last compiled dict -entry and it's going to be executed as such until you set a new -(c<). +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. -Note that there is no EMIT in a bare system. You have to take -care of supplying one before your load core.fs and its higher -levels. - - - (cont.) +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. diff --git a/blk/091 b/blk/091 deleted file mode 100644 index 531e4fb..0000000 --- a/blk/091 +++ /dev/null @@ -1,16 +0,0 @@ -(cont.) 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. - - - - - - - - - diff --git a/blk/411 b/blk/411 index 22a0271..881afcc 100644 --- a/blk/411 +++ b/blk/411 @@ -9,7 +9,6 @@ ['] (boot<) 0x0c RAM+ ! ( boot< always has a char waiting. 06 == C - 2+ ALLOT (infl) - LIT< RDLN< (find) DROP 0x0c RAM+ ! + ['] RDLN< 0x0c RAM+ ! 1 0x06 RAM+ ! ( 06 == C