English
Language : 

NSB8 Datasheet, PDF (136/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
grifo®
ITALIAN TECHNOLOGY
FILE BUFFER SIZES, LIFETIMES OF BUFFERS
When each file is opened, an area of RAM memory is reserved as a high speed data transfer buffer
between BASIC and the disk drive. A buffer of 128 bytes is reserved when opening a file. Buffers
are used to make disk access as efficient and quick as possible. When the file is closed, its buffer
region does not return to free memory, but is reserved for later use by any files which will be opened
under the file number associated with the buffer.
PRINT HEAD TABLE
At memory addresses ORG+17 and ORG+18 (ORG+11H and ORG+12H) there exists a pointer
containing the low and high bytes, respectively, of the address in memory where BASIC’s print head
table is stored. Each of the 8 bytes in this table contains the current cursor position for one of BASIC’s
8 possible I/O devices (starting with device #0). For some applications, such as plotting, some users
may wish to EXAM or FILL these bytes to avoid LENGTH ERROR messages or the automatic
carriage return which BASIC supplies when enough characters to fill a line have been printed on a
given device. Users with standard versions of BASIC may use the following user function to return
the address of the table entry for any of the 8 devices. EXAM or FILL this address to determine or
change the value of the print head counter for the given device.
DEF FNH (D) = EXAM (11537) + (EXAM (11538) *256)+D
REM D IS DEVICE NUMBER FROM 0 TO 7
FILE HEADER TABLE
This table follows immediately the 8 bytes of the print head table described above. The file header
table is 80 bytes long, and contains one 10 bytes entry for each of the 8 possible open files (0 to
7). Each entry has the following format:
a) byte 0:
b) bytes1÷2:
c) bytes 3÷4:
d) bytes 5÷6:
e) bytes 7÷9:
status byte
buffer address for the file (low/high)
disk address of the open file (the number of the file’s beginning disk block)
filesize in blocks
current file pointer: this points to the next byte to be accessed, expressed as an
offset from the start of the file. Because three bytes (arranged as middle byte, high
byte, low byte) are used to represent the pointer value, BASIC may access files as
large as an entire diskette.
BASIC PROGRAM PRE PROCESSING
Once program lines are typed into BASIC, they are pre processed automatically into a more compact,
efficient form where each reserved word maps onto a single byte value (named token) and line
number references in GOTO, GOSUB, RESTORE and similar statements are collapsed into 16 bit
values. This permits faster execution, and more efficient use of storage space in both RAM (when
the program is running or under development) and disk (when the program is saved). When the
program is listed, the comaction process is reversed, and the complete text of the program is restored
Page 124
NSB8
Rel. 5.10