mist64/cbmsrc

QPLOP vs NQPLOP

gabrielsroka opened this issue · 3 comments

Hi,

Thank you for the excellent Ultimate Commodore 64 BASIC & KERNAL ROM Disassembly!!!

I was looking at PLOOP1:
https://www.pagetable.com/c64disasm/#A700

The first column, which is "Microsoft/Commodore source" in green, 4th line in PLOOP1 says
BNE QPLOP (QPLOP is $A71A)
but if you look at the hex it's actually BNE $A717.

I did a search of your repo for QPLOP :
https://github.com/mist64/cbmsrc/search?q=qplop&unscoped_q=qplop

and found these 3:
https://github.com/mist64/cbmsrc/blob/master/BASIC_C64/code3#L53-L64
https://github.com/mist64/cbmsrc/blob/master/BASIC_CBM2_A/bverbs1#L53-L64
https://github.com/mist64/cbmsrc/blob/master/BASIC_CBM2_B/bverbs1#L53-L64

all have a QPLOP (which is the JMP (IQPLOP) using the IQPLOP vector) and a NQPLOP which is the actual QPLOP (if you will -- the target of the vector), whereas:
https://github.com/mist64/cbmsrc/blob/master/BASIC_PET2001/M6502.MAC#L2030-L2041

doesn't use the vector (there's no NQPLOP -- it jumps directly to the code, and there's a mysterious [?] blank line above it). This is PET 2001 version. Did it not use a vector?

I'm not sure if it's a bug, and if so, how to fix it. Are they supposed to be different?

Long story short, I was using both the ML and the assembly code to write my own, custom LIST and QPLOP for the 64, but this difference threw me off.

Thanks!

This also seems to be the case for most (all?) other BASIC vectors in $300-$30B: IERROR, IMAIN, ICRNCH, IGONE, IEVAL (and maybe KERNAL vectors, too)

@gabrielsroka Indeed, as versions progressed, more and more vectors and jump tables were introduced. If the C64 ROM has some sort of indirection somewhere, it is not guaranteed that it was like that in earlier versions.

@Rhialto is right.