7 The optional Block word set

7.1 Introduction

7.2 Additional terms

block:
1024 characters of data on mass storage, designated by a block number.

block buffer:
A block-sized region of data space where a block is made temporarily available for use. The current block buffer is the block buffer most recently accessed by BLOCK, BUFFER, LOAD, LIST, or THRU.

7.3 Additional usage requirements

7.3.1 Data space

A program may access memory within a valid block buffer.

See: 3.3.3 Data space.

7.3.2 Block buffer regions

The address of a block buffer returned by BLOCK or BUFFER is transient. A call to BLOCK or BUFFER may render a previously-obtained block-buffer address invalid, as may a call to any word that:

  • parses:
  • displays characters on the user output device, such as TYPE or EMIT;
  • controls the user output device, such as CR or AT-XY;
  • receives or tests for the presence of characters from the user input device such as ACCEPT or KEY;
  • waits for a condition or event, such as MS or EKEY;
  • manages the block buffers, such as FLUSH, SAVE-BUFFERS, or EMPTY-BUFFERS;
  • performs any operation on a file or file-name directory that implies I/O, such as REFILL or any word that returns an ior;
  • implicitly performs I/O, such as text interpreter nesting and un-nesting when files are being used (including un-nesting implied by THROW).

If the input source is a block, these restrictions also apply to the address returned by SOURCE. Block buffers are uniquely assigned to blocks.

See A.7.3.2 Block buffer regions.

7.3.3 Parsing

The Block word set implements an alternative input source for the text interpreter. When the input source is a block, BLK shall contain the non-zero block number and the input buffer is the 1024-character buffer containing that block.

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.

7.3.4 Possible action on an ambiguous condition

See: 3.4.4 Possible actions on an ambiguous condition.

  • A system with the Block word set may set interpretation state and interpret a block.

7.4 Additional documentation requirements

7.4.1 System documentation

7.4.1.1 Implementation-defined options

7.4.1.2 Ambiguous conditions

7.4.1.3 Other system documentation

  • any restrictions a multiprogramming system places on the use of buffer addresses;
  • the number of blocks available for source text and data.

7.4.2 Program documentation

  • the number of blocks required by the program.

7.5 Compliance and labeling

7.5.1 Forth-2012 systems

The phrase "Providing the Block word set" shall be appended to the label of any Standard System that provides all of the Block word set.

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.

7.5.2 Forth-2012 programs

The phrase "Requiring the Block word set" shall be appended to the label of Standard Programs that require the system to provide the Block word set.

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 Glossary

7.6.1 Block words

7.6.2 Block extension words

ContributeContributions