************************************************************* Using ROM Subroutines on the HX-20 with MBASIC by Justin Bell Here is one way to set registers to execute ROM subroutines: 1. Load BASIC and set aside the memory necessary for your program. The following command sets aside 1000 bytes: MEMSET 3624 2. Use the BASIC command MON to enter the monitor section. 3. Use the monitor's S command to enter codes. 4. Type a period to stop entering codes. 5. Use the monitor's G command to execute the routines. The following example executes ROM subroutine FF64 to produce a tone for a certain duration: 86 0A LDAA #NOTE ;load the note (note 10 in this ;example) into the A register C6 10 LDAB #TIME ;load the time (1.6 seconds here) ;into the B register BD FF64 JSR $FF64 ;jump to the subroutine 39 RTS ;return to the origin - this may ;result in a trap if you did not ;call from a subroutine This is an example program: 10 TITLE "ROMSUBS" 20 MEMSET 3624 110 POKE 2624,&H86 120 POKE 2625,&H0A 130 POKE 2626,&HC6 135 POKE 2627,&H10 140 POKE 2628,&HBD 150 POKE 2629,&HFF 160 POKE 2630,&H64 170 POKE 2631,&H39 180 POKE 2632,&H00 200 EXEC 2624 After the BASIC program has run, memory looks like this: 0A40: 86 0A C6 10 BD 0A45: FF 64 39 00 20 0A4A: 00 00 00 00 00 *************************************************************