Loading a typical CO file: Difference between revisions
Line 3: | Line 3: | ||
If you've ever loaded and tried to run a CO program, you may have found that the laptop emits a beep sound and fails to launch the program. | If you've ever loaded and tried to run a CO program, you may have found that the laptop emits a beep sound and fails to launch the program. | ||
That beep is your Model T alerting you to the fact that you are making an error. | |||
Model T CO files contain machine language programs designed to run at a fixed location in memory. But a .CO file that you see on the main menu is just a file. It cannot run from the place it sits at as a file in RAM, because all the jumps and calls and loads and stores are within the range that it is assembled (or "ORGed") to run at. | |||
To run the program, BASIC copies | To run the program, BASIC copies the CO file contents to whatever "start" address it was designed to run at. Unless you tell your laptop otherwise, however, it reserves all memory to the filesystem, the BASIC interpreter and the stack. When BASIC beeps, it is telling you that the space the program you selected needs to run at is currently reserved for other purposes. | ||
So, before you can execute such a program you need to reserve memory for | So, before you can execute such a program you need to reserve memory for the program at the place it is assembled to run at. | ||
This article documents the common procedure for reserving this memory. | This article documents the common procedure for reserving this memory. |
Latest revision as of 08:41, 31 October 2011
Overview
If you've ever loaded and tried to run a CO program, you may have found that the laptop emits a beep sound and fails to launch the program.
That beep is your Model T alerting you to the fact that you are making an error.
Model T CO files contain machine language programs designed to run at a fixed location in memory. But a .CO file that you see on the main menu is just a file. It cannot run from the place it sits at as a file in RAM, because all the jumps and calls and loads and stores are within the range that it is assembled (or "ORGed") to run at.
To run the program, BASIC copies the CO file contents to whatever "start" address it was designed to run at. Unless you tell your laptop otherwise, however, it reserves all memory to the filesystem, the BASIC interpreter and the stack. When BASIC beeps, it is telling you that the space the program you selected needs to run at is currently reserved for other purposes.
So, before you can execute such a program you need to reserve memory for the program at the place it is assembled to run at.
This article documents the common procedure for reserving this memory.
Determining the START Address
From the main menu, hit the SPACE bar until the wide bar cursor highlights BASIC.
Hit ENTER.
At the BASIC prompt type
LOADM”FOO”
But replace FOO with the name of your CO file. If you don't remember what it is, first type FILES to get a list.
Your screen will display
- The Start address
- The End address
- The Execution address
Reserving RAM To Run Your Program
Now, with the Start address in hand type
CLEAR 0,ADDRESS
But replace ADDRESS with the number BASIC printed out for the Start address.
Press F8 to return to the main menu.
Press the spacebar until the widebar cursor highlights the CO program you just cleared space for. Press ENTER, and it should launch. If you made a mistake, it will beep. If this happens, try walking through these steps again.