If the data at address $BDDC is FE 5E 15 then the "indexer" is working fine.
Hexdigitcnt is set to the # of bytes in this opcode ( 1-3).
The code uses the X reg as a flag to print either the ASCII character or the Hex value.
The Y register is an index to the memory, where Startaddr points to the opcode.
X is set to 1 at the start - this sets up the printing of the ASCII characters.
The address get printed ok, as does the - after it and 2 spaces.
Next, I see the ASCII character are printed - this happens when
Code:
CPX #$00 ;
BNE List8 ;
jumps to List8. Good so far.
It seems to have a problem determining when to quit that part so it can do the DEX (below List10 - not shown)
Code:
JSR Print2SP ;
DEX ;
BEQ List4 ;---------
to start printing the HEX values. While stuck, it prints spaces.
After much scanning, here is my suggestion:
Check that you CPY command is setting the C flag. It is for sure setting the Z flag or other routines would be failing. List5 and just after List10 are the only two places in the entire source that CPY is followed by BCC or BCS. There are some BPL/BMI that use CPY so be sure the N flag is being adjusted too.
Let me know if that helps!
Daryl
_________________
Please visit my website ->
https://sbc.rictor.org/