English
Language : 

NSB8 Datasheet, PDF (44/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
FILL
grifo®
ITALIAN TECHNOLOGY
STATEMENT:
FILL <memory address>, <byte value>
ACTION:
The byte value is placed in the RAM memory cell with the specified address. A byte value is a
numeric expression which evaluates to an integer from 0 to 255. The memory address must be a
numeric expression equal to an integer from 0 to 65535.
EXAMPLES:
FILL M+S,0
FILL (2*16^3) + (13*16^2) + (1*16^0) ,16
FILL FNC(“2D13”) ,16
FILL 65535,B
FILL 100,31
REMARKS:
The FILL statement allows the user to change specific bytes in RAM memory, and so is useful in the
following applications (as well as many others):
1) Personalizing BASIC.
2) Loading user defined machine language routines in free memory.
3) Putting parameters to machine language user functions in free memory.
4) Manipulating video display memory for custom graphics applications.
Note that both the memory address and the byte value must be in decimal (base 10) form, and BASIC
will convert them to binary when FILL is executed. NSB8 does not accept hexadecimal (base 16)
numbers. If you wish to use hexadecimal form when specifying addresses of byte values, you should
make use of a hex to decimal conversion function.
If either the byte, or address, values reduce to non integers, the fractional portion is eliminated
(TRUNCATED) and the remaining whole portion is used.
If, after truncation, the byte value is greater than 255, only it’s remainder, when divided by 256 (in
other words, the value modulo 256) is used (for example, 257 module 256 = 1: FILL X, 257 would
put a byte with value 1 in the address represented by X). No similar provision is made for the memory
address, however.
CAUTION:
FILL may reference an address at which no memory cell exists or even an address within GDOS,
BASIC, or the program/data area. Thus, FILL gives the programmer power to make some very bad
mistakes.
ERROR MESSAGES:
OUT OF BOUND ERROR
This error occurs because of one of the following four reasons:
1) The byte value or the memory address (or both) is less than zero.
2) The memory address is greater than 65535.
Page 32
NSB8
Rel. 5.10