Table of Contents
BLOCK -- BLOCK file access
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: Historically Forth was implemented on small computers as an operating system in its own right. Mass storage was not organized in files but as a sequence of 1 KB blocks. A block was addressed with a block number. This way a diskette drive provided a few hundred blocks and if you had a fixed disk you simply had thousands of those blocks.
Both program text and arbitrary data can be stored in blocks. In order to hold source text the 1K block is treated as having 16 lines with 64 charactes each. This is often referred to as a 'screen'.
When loading (i.e. interpreting) a block with source text it is simply taking to be a single line of 1024 characters. The only exception to this is the word \ (begin comment to end of line) which skips text up to the end of a 64-char line in a block.
FORTH
BLK
( .. )(
)
;
as:"blk";
threadstate variable BLK
input.blk (no special usage info)
dpANS 7.6.1.0790 - standard forth word
FORTH
BLOCK
( u -- addr )(
)
;
p4:"block";
load the specified block into a block buffer and return the address of that block buffer - see also BUFFER
dpANS 7.6.1.0800 - standard forth word
FORTH
BUFFER
( u -- addr )(
)
;
p4:"buffer";
get the block buffer address for the specified block - if it had not been loaded already it is not filled with data from the disk unlike BLOCK does.
dpANS 7.6.1.0820 - standard forth word
FORTH
FLUSH
( -- )(
)
;
p4:"flush";
call SAVE-BUFFERS and then unassign all block buffers with EMPTY-BUFFERS
dpANS 7.6.1.1559 - standard forth word
FORTH
LOAD
( u -- )(
)
;
p4:"load";
dpANS 7.6.1.1790 - standard forth word
FORTH
SAVE-BUFFERS
( -- )(
)
;
p4:"save-buffers";
write all modified buffer to the disk, see UPDATE and FLUSH
dpANS 7.6.1.2180 - standard forth word
FORTH
UPDATE
( -- )(
)
;
p4:"update";
mark the current block buffer as modified, see FLUSH
dpANS 7.6.1.2400 - standard forth word
FORTH
EMPTY-BUFFERS
( -- )(
)
;
p4:"empty-buffers";
unassign all block buffers, does not even UPDATE
dpANS 7.6.2.1330 - standard forth word
FORTH
LIST
( u -- )(
)
;
p4:"list";
display the block
dpANS 7.6.2.1770 - standard forth word
FORTH
SCR
( .. )(
)
;
as:"scr";
threadstate variable SCR
scr (no special usage info)
dpANS 7.6.2.2190 - standard forth word
FORTH
THRU
( u1 u2 -- )(
)
;
p4:"thru";
LOAD a number of block in sequence.
dpANS 7.6.2.2280 - standard forth word
ENVIRONMENT
BLOCK-EXT
( .. )(
)
;
as:"block-minus-ext";
( 1994 ) constant BLOCK-EXT
an ordinary constant (no special usage info)