LOAD CODE

BASin

LOAD CODE

Command/Statement

LOAD CODE is used to load a section of memory with information that has been stored in a file. The information consists of a set of bytes, and these are sent to a set of addresses in memory. LOAD CODE can be used to load a display, or to load information for user-defined graphics, for example.

How to use LOAD CODE

LOAD CODE may be used as a direct command or it may form a statement in a program. LOAD is followed by a filename, which is a string value, and then CODE, for example

LOAD "data" CODE

The filename following LOAD is the name of the information to be loaded and is subject to the same restrictions as program names (see LOAD. LOAD CODE then searches for the named information and when found, displays Bytes: followed by the name. The BASIC then loads the bytes into memory at the addresses from which they were saved. Any existing information is overwritten.

CODE may also be followed by one or two numeric values, separated by a comma, for example

LOAD "picture" CODE 16384,6912

The values following CODE are rounded to the nearest integer and then define the starting address (16384 above) at which the named information is to be loaded, and the number of bytes (6912) that are to be sent to locations beginning at this address. If the number is wrong, the tape loading error report is given. If only one value follows CODE, it defines the starting address from which all the bytes are to be located.

The above example can also be carried out by the keywords LOAD SCREEN$.

For details on storing bytes, see SAVE CODE.

Format

  • LOAD string-expr CODE [int-num-expr] [,int-num-expr]

See also

Chapter 20.