New load command: Difference between revisions
Created page with "Programming Features - <strong>The New Load Command</strong> The Color 64 ML adds a new LOAD command that is very much like the original BASIC LOAD command, except it adds a couple new features. The format for the new command is: : <strong>↑<filename>, <device> [, <load address> ] </strong> :: <filename>: the name of the file to be loaded (in Color 64, its common to use dr$+"filename"). :: <device>: the device number. :: <load address>..." |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[programming features|Programming Features]] - <strong>The New Load Command</strong> | [[programming features|Programming Features]] - <strong>The New Load Command</strong> | ||
The Color 64 ML | The Color 64 ML provides an enhanced LOAD command that extends the functionality of the standard BASIC LOAD. The syntax is: | ||
: <strong>↑<filename>, <device> [, <load address> ]</strong> | |||
{| class="wikitable | 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 and automatically runs. | |||
* If a load address less than 256 is specified, the file loads into memory at the address defined internally within the file (typical for ML files or memory tables). The BASIC program in memory 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. | |||
In summary: | |||
* No load address → Loads and runs BASIC programs. | |||
* Load address specified → Loads directly into memory without auto-running BASIC (unless loading directly into BASIC program or variable memory areas). | |||
Examples: | |||
{| class="wikitable" | |||
|- | |- | ||
| ↑dr$+"√bbs.ini*",8 | | ↑dr$+"√bbs.ini*",8 | ||
| Loads and runs "√bbs.ini*" from device 8 | | Loads and runs "√bbs.ini*" from device 8 using drive dr$. | ||
|- | |- | ||
| ↑dr$+"√bbs.ans*",8,0 | | ↑dr$+"√bbs.ans*",8,0 | ||
| Loads | | Loads "√bbs.ans*" from device 8 into memory at the address specified within the file itself. | ||
|- | |- | ||
| ↑dr$+"√some file",8,58000 | | ↑dr$+"√some file",8,58000 | ||
| Loads | | 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|Output Commands]] | Next Section: [[output commands|Output Commands]] | ||
[[programming features|Programming Features]] | [[programming features|Programming Features]] | ||
Latest revision as of 22:56, 27 February 2026
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 and automatically runs.
- If a load address less than 256 is specified, the file loads into memory at the address defined internally within the file (typical for ML files or memory tables). The BASIC program in memory 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.
In summary:
- No load address → Loads and runs BASIC programs.
- Load address specified → Loads directly into memory without auto-running BASIC (unless loading directly into BASIC program or variable memory areas).
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