10 DIM code 99:P%=code
20 [ SEI:TSX:STX&70:LDX#&21:TXS:JMP&011F:]
30 P%=&011F: REM here's the vital code to test
40 [ JSR &4340: NOP: ]
50 P%=&0123:REM incorrect emulator may land here
60 [ LDX&70: TXS: LDA #ASC("X"):CLI:RTS: ]
70 P%=&140: REM real 6502 will land here
80 [ LDX&70: TXS: LDA #ASC("P"):CLI:RTS: ]
90 P%=&4340:REM incorrect emulator may land here
100 [ LDX&70: TXS: LDA #ASC("F"):CLI:RTS: ]
110 PRINT CHR$ USR code
Test program:
See http://forum.6502.org/viewtopic.php?f=1&t=7640 and https://stardot.org.uk/forums/viewtopic.php?f=2&t=27208