New load command
Programming Features - The New Load Command
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:
- ↑<filename>, <device> [, <load address> ]
- <filename>: the name of the file to be loaded (in Color 64, its common to use dr$+"filename").
- <device>: the device number.
- <load address>: the load address at which you wish the program to load. If you do not include <load address>, then the computer assumes that you are loading a BASIC program. This means that the program will auto-run when it loads. If you use a load address less than 256, then the computer assumes you are loading a file directly into memory at the address specified in the file (either an ML file or memory table). This type of load will not cause the BASIC program in memory to auto-run. If the load address is greater than 255 then the file is loaded directly into memory at the specified address.
Again, loading files without a loading address will load and runs BASIC files. Loading files with a loading address does not affect BASIC (unless of course a program is loading directly into the program or variable memory sections). Here are a few examples of the command:
| ↑dr$+"√bbs.ini*",8 | Loads and runs "√bbs.ini*" from device 8, drive dr$ |
| ↑dr$+"√bbs.ans*",8,0 | Loads into memory "√bbs.ans*" from device 8, drive dr$ into the location specified in the file |
| ↑dr$+"√some file",8,58000 | Loads the program file "√some file" into memory from device 8, drive dr$ into memory at address 58000 |
Another feature of the new LOAD command is that it checks if a BASIC program has overflowed memory and overwritten variables. If this does occur, then the BBS program automatically shuts down and displays an error message indicating a LOAD overflow. All variables will be lost, and the message index will have to be regenerated. This error occurs when an overlay you are loading is larger in size than √bbs.init. If it were permitted, it would overwrite variable memory which would wreak havoc on the system. If you encounter this, you must reduce the size of the overlay to something smaller than √bbs.init.
Next Section: Output Commands