Using routines in the BASIC ROM
Posted: Wed Jul 05, 2023 7:17 pm
Hi.
In the C64 BASIC2 ROM there is a routine at $A38A. It is called FNDFOR, and amongst its functions is the ability to be used to help remove the last GOSUB's return address from BASIC's stack. In BASIC2 I'd simply SYS to the address at REMGSB to call it.
The ZP variable used by C64's version of basic at $49-$4A is at $E5 in the X16 - that's a simple change, if the *.sym files that come with the emulator are correct.
But for the routines at $A38A (FNDFOR) and $A8E0 (14 bytes in from RETURN) will I instead need to use routines in the X16 BASIC ROM that reside at $C5B8 and $CC64 respectively? Again, this is based on info extracted from the *.sym files.
I'm asking because when I disassemble the BASIC ROM (Bank 4, right?) at these locations, I'm seeing quite different code...
Thanks in advance!
In the C64 BASIC2 ROM there is a routine at $A38A. It is called FNDFOR, and amongst its functions is the ability to be used to help remove the last GOSUB's return address from BASIC's stack. In BASIC2 I'd simply SYS to the address at REMGSB to call it.
Code: Select all
REMGSB LDA #$FF
STA $4A
JSR $A38A
TXS
CMP #$8D
BNE ERROR
PLA
PLA
PLA
PLA
PLA
RTS
ERROR JMP $A8E0
But for the routines at $A38A (FNDFOR) and $A8E0 (14 bytes in from RETURN) will I instead need to use routines in the X16 BASIC ROM that reside at $C5B8 and $CC64 respectively? Again, this is based on info extracted from the *.sym files.
I'm asking because when I disassemble the BASIC ROM (Bank 4, right?) at these locations, I'm seeing quite different code...
Thanks in advance!