Accessing Assembly-Language Subroutines
The SBA function enables you to call assembly-language subroutines. Some of the system subroutines are listed in Appendix C.
The SBA Function
To access an assembly-language subroutine, press { SBA } and enter a three-digit hex value that specifies the location of the subroutine.The first digit, with a valid range of 1 through 6, specifies whether the subroutine is located in the system ROM (read-only memory), a library cartridge, or a file directory such as the calculator's file space or a Constant Memory cartridge.
The last two digits give the pointer offset (in bytes) from the beginning of the table at the front of each chip (memory section).
Location Digit | Meaning |
---|---|
1, 2, 3, or 4 | Specifies a subroutine in system ROM. The system subroutines that can be useful to you are listed in Appendix C. |
5 | Specifies a subroutine in the currently installed library cartridge. (These subroutines are accessible only by a program in the cartridge.) |
6 | Specifies an assembly-language subroutine saves as a file. With this option, the last two digits are ignored. Before using the SBA function, you must place the name of the directory and file into the alpha register in the form DIRFIL, wehre DIR is the directory name and FIL is the file name (for example, MEM+SB). |
Example
One fo the system subroutines in the RPD-95, number 226, displays the value contained in the numeric display register. This subroutine does not pause after showing the value as the PAU fucntion does.This example program counts by twos and uses routine 226 to display each count with no pause. Unprotect the system and then enter the following program.
PC = | Program Mnemonics | Comments |
---|---|---|
0000 | LBL AA | |
0003 | +2= | Counts by twos |
0006 | SBA 226 | Displays without pause |
0009 | GTL AA | Loops to next count |
Running the Example
To run the example, press [ RUN ] { PGM }. The program starts with the number in the numeric display register and rapidly displays each count.To stop the program, press [ BREAK ] or [ HALT ].
☚ Back