From c26c454cbfe5fd3e2bba1f455eda2f9761669f3e Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 3 Jun 2020 20:26:41 -0400 Subject: [PATCH] extra words: allow finer-grained loading --- blk/102 | 4 ++-- blk/150 | 7 ++++--- blk/152 | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/blk/102 b/blk/102 index a1d4b73..f72edc7 100644 --- a/blk/102 +++ b/blk/102 @@ -1,6 +1,6 @@ -50 LOAD+ ( B152, extras ) +'? CASE NOT [IF] 51 52 LOADR+ [THEN] DROP ( B152-153 ) +'? FILL NOT [IF] 53 LOAD+ [THEN] DROP ( B154 ) 1 7 LOADR+ - : BROWSE 0 ACC ! L BEGIN diff --git a/blk/150 b/blk/150 index ca16a1f..91dc1a7 100644 --- a/blk/150 +++ b/blk/150 @@ -1,6 +1,6 @@ Extra words -The Core words (B420) section contains the absolute minimum +The Core words (B350) section contains the absolute minimum needed to get a usable Forth interpreter with input buffer and disk blocks access running. The goal here is to minimize the binary size of a minimum Collapse OS install. @@ -10,5 +10,6 @@ are generally useful. They are so useful that they are part of the Dictionary (B30). Some programs need them, so they will automatically LOAD them. -To that end, the loader is conditional: it aborts if extra -words are already present. Load with "152 LOAD". +Because more than one program can use the same extra words, +conditional loaders are recommended. If you want to load all +words do "152 LOAD" which conditionally loads all extra words. diff --git a/blk/152 b/blk/152 index 4e561e4..0a47e8b 100644 --- a/blk/152 +++ b/blk/152 @@ -1,3 +1,4 @@ -'? CASE NOT [IF] - 1 5 LOADR+ -[THEN] DROP ( from '? ) +'? CASE NOT [IF] 1 2 LOADR+ [THEN] DROP ( from '? ) +'? FILL NOT [IF] 3 LOAD+ [THEN] DROP +'? EMPTY NOT [IF] 4 LOAD+ [THEN] DROP +'? WIPE NOT [IF] 5 LOAD+ [THEN] DROP