New load command
Programming Features - The New Load Command
The Color 64 ML provides an enhanced LOAD command that extends the functionality of the standard BASIC LOAD. The syntax is:
- ↑<filename>, <device> [, <load address> ]
Parameters:
- <filename> – The name of the file to load. In Color 64 it is common to use dr$+"filename".
- <device> – The device number.
- <load address> – Optional. Specifies the memory address where the file will be loaded.
Load behavior depends on whether a load address is supplied:
- If no load address is specified, the system assumes a BASIC program. The file loads at BASIC start, checks for variable overrun, and automatically runs.
- If a load address of 0-254 is specified, the file loads into memory at the address defined internally within the file (typical for ML files or memory tables) and will not auto-run.
- If a load address of 255 is specified, the file will load at BASIC start, update program end, and will not auto-run.
- If a load address greater than 255 is specified, the file loads directly into memory at the address you provide. This also does not auto-run BASIC.
Examples:
| ↑dr$+"√bbs.ini*",8 | Loads and runs "√bbs.ini*" from device 8 using drive dr$. |
| ↑dr$+"√bbs.ans*",8,0 | Loads "√bbs.ans*" from device 8 into memory at the address specified within the file itself. |
| ↑dr$+"√some file",8,58000 | Loads "√some file" from device 8 into memory starting at address 58000. |
Overflow Protection
The enhanced LOAD command includes protection against BASIC memory overflow. If a BASIC overlay being loaded exceeds the allocated program space and overwrites variable memory, the BBS automatically shuts down and displays a LOAD overflow error.
When this occurs:
- All variables are lost.
- The message index must be regenerated.
This situation typically happens when an overlay file is larger than √bbs.init. Allowing it to load would overwrite variable memory and destabilize the system.
If you encounter a LOAD overflow error, reduce the size of the overlay so that it is smaller than √bbs.init before attempting to load it again.
Next Section: Output Commands