Table of Contents |
See:
A.7 The optional Block word set
See:
A.7.2 Additional terms
See:
3.2.6 Environmental queries
Table 7.1 - Environmental Query Strings
String Value data type Constant? Meaning ------ --------------- --------- ------- BLOCK flag no block word set present BLOCK-EXT flag no block extensions word set present
See:
3.3.3 Data Space
If the input source is a block, these restrictions also apply to the address returned by SOURCE.
Block buffers are uniquely assigned to blocks.
A block is conventionally displayed as 16 lines of 64 characters.
A program may switch the input source to a block by using LOAD or THRU. Input sources may be nested using LOAD and EVALUATE in any order.
A program may reposition the parse area within a block by manipulating >IN. More extensive repositioning can be accomplished using SAVE-INPUT and RESTORE-INPUT.
See:
3.4.1 Parsing
See:
3.4.4 Possible action on an ambiguous
condition
The phrase Providing name(s) from the Block Extensions word set shall be appended to the label of any Standard System that provides portions of the Block Extensions word set.
The phrase Providing the Block Extensions word set shall be appended to the label of any Standard System that provides all of the Block and Block Extensions word sets.
The phrase Requiring name(s) from the Block Extensions word set shall be appended to the label of Standard Programs that require the system to provide portions of the Block Extensions word set.
The phrase Requiring the Block Extensions word set shall be appended to the label of Standard Programs that require the system to provide all of the Block and Block Extensions word sets.
7.6.1.0790 BLK
( -- a-addr )
a-addr is the address of a cell containing zero or the number of the mass-storage block being interpreted. If BLK contains zero, the input source is not a block and can be identified by SOURCE-ID, if SOURCE-ID is available. An ambiguous condition exists if a program directly alters the contents of BLK.
See:
7.3.3 Block buffer regions
7.6.1.0800 BLOCK
( u -- a-addr )
a-addr is the address of the first character of the block buffer assigned to mass-storage block u. An ambiguous condition exists if u is not an available block number.
If block u is already in a block buffer, a-addr is the address of that block buffer.
If block u is not already in memory and there is an unassigned block buffer, transfer block u from mass storage to an unassigned block buffer. a-addr is the address of that block buffer.
If block u is not already in memory and there are no unassigned block buffers, unassign a block buffer. If the block in that buffer has been UPDATEd, transfer the block to mass storage and transfer block u from mass storage into that buffer. a-addr is the address of that block buffer.
At the conclusion of the operation, the block buffer pointed to by a-addr is the current block buffer and is assigned to u.
7.6.1.0820 BUFFER
( u -- a-addr )
a-addr is the address of the first character of the block buffer assigned to block u. The contents of the block are unspecified. An ambiguous condition exists if u is not an available block number.
If block u is already in a block buffer, a-addr is the address of that block buffer.
If block u is not already in memory and there is an unassigned buffer, a-addr is the address of that block buffer.
If block u is not already in memory and there are no unassigned block buffers, unassign a block buffer. If the block in that buffer has been UPDATEd, transfer the block to mass storage. a-addr is the address of that block buffer.
At the conclusion of the operation, the block buffer pointed to by a-addr is the current block buffer and is assigned to u.
See:
7.6.1.0800 BLOCK
7.6.1.1360E EVALUATE
Extend the semantics of 6.1.1360 EVALUATE to include:
Store zero in BLK.
7.6.1.1559 FLUSH
( -- )
Perform the function of SAVE-BUFFERS, then unassign all block buffers.
7.6.1.1790 LOAD
( i*x u -- j*x )
Save the current input-source specification. Store u in BLK (thus making block u the input source and setting the input buffer to encompass its contents), set >IN to zero, and interpret. When the parse area is exhausted, restore the prior input source specification. Other stack effects are due to the words LOADed.
An ambiguous condition exists if u is zero or is not a valid block number.
See:
3.4 The Forth text interpreter
7.6.1.2180 SAVE-BUFFERS
( -- )
Transfer the contents of each UPDATEd block buffer to mass storage. Mark all buffers as unmodified.
7.6.1.2400 UPDATE
( -- )
Mark the current block buffer as modified. An ambiguous condition exists if there is no current block buffer.
UPDATE does not immediately cause I/O.
See:
7.6.1.0800 BLOCK ,
7.6.1.0820 BUFFER ,
7.6.1.1559 FLUSH ,
7.6.1.2180 SAVE-BUFFERS
7.6.2.1330 EMPTY-BUFFERS
( -- )
Unassign all block buffers. Do not transfer the contents of any UPDATEd block buffer to mass storage.
See:
7.6.1.0800 BLOCK
7.6.2.1770 LIST
( u -- )
Display block u in an implementation-defined format. Store u in SCR.
See:
7.6.1.0800 BLOCK
7.6.2.2125 REFILL
( -- flag )
Extend the execution semantics of 6.2.2125 REFILL with the following:
When the input source is a block, make the next block the input source and current input buffer by adding one to the value of BLK and setting >IN to zero. Return true if the new value of BLK is a valid block number, otherwise false.
See:
11.6.2.2125 REFILL
7.6.2.2190 SCR
( -- a-addr )
a-addr is the address of a cell containing the block number of the block most recently LISTed.
See:
A.7.6.2.2190 SCR
7.6.2.2280 THRU
( i*x u1 u2 -- j*x )
LOAD the mass storage blocks numbered u1 through u2 in sequence. Other stack effects are due to the words LOADed.
7.6.2.2535 \
Extend the semantics of 6.2.2535 \ to be:
Compilation: Perform the execution semantics given below.
Execution: ( ccc<eol>-- )
If BLK contains zero, parse and discard the remainder of the parse area; otherwise parse and discard the portion of the parse area corresponding to the remainder of the current line. \ is an immediate word.