A BASIC command that loads a program (or a reasonably program-resembling object) to memory from disk or tape.
In Commodore basic, the syntax is LOAD "filename",primary,secondary, where
primary generally says the device from where to load from (1 = tape drive, 8 = disk drive) if omitted, 1 is assumed (though C64 Executive defaulted on 8).
secondary often has no intricate special meaning; in BASIC its existence just controls where the code is being load (see below for example).
Filenames may have wildcards * and ?. First that matches will be loaded.
Some handy commands for Commodore 64 and disk drive:
- LOAD "$",8
- Loads disk catalog to memory. (Just type LIST then to see what's on that disk.)
- LOAD "*",8,1
- Loads the last loaded program (or, if no files are previously loaded, the first program on catalog) to memory. (Tip: True Hackers try this command first when confronted with unfamiliar shell. =)
- LOAD "name",8
- Loads a BASIC program to memory starting from $0801.
- LOAD "name",8,1
- Loads a program to memory location specified by the file header - use this when loading machine code.
Plain LOAD will try to load the next file from tape.
LOAD is the name of Kernal (sic) routine that loads the file. Here's an exaple of how to use it to load a file from disk to memory:
;; Say that we read from disk drive
LDA #$ff ; File no
LDX #8 ; Disk drive
LDY #1 ; Address number
;; Say what file we want to read from file
;; Load the file
LDA #0 ; 0 = load
LDX #$FF ; Addr hibyte (irrelevant)
LDY #$FF ; Addr lobyte (irrelevant)
See SAVE. Also see 1541, LOAD "*",8,1, ",8" or ",8,1"? and LOAD"$",8