I printed out blargg's tips to file them. I especially like the S-register ideas, but some others should have a note telling that they are to make up for a deficiency in the NMOS 6502, which only a few here on the forum have any reason to be using in place of the CMOS. The extra work-arounds are not needed for the CMOS 65c02 since it has more instructions. BIT# and BRA are a couple that come to mind from these tips.
Quote:
A single byte can be skipped by overlapping instructions: ...
Code:
sub1 sei
db $C9 ; cmp #immediate
sub2 cli
...
Steve Wozniak did this kind of thing in the Apple II system too IIRC, using a BIT or CMP absolute, in order to have various choices of what to load into the accumulator at the beginning of a routine, based on the exact entry point:
Code:
label1: LDA #$10
.DB $CD
label2: LDA #$17
.DB $CD
label3: LDA #$2F
.DB
...etc.
This way you can enter at the right LDA# and the following ones become CMP# xx xx which take only one extra byte per entry point and do nothing to the accumulator. Just make sure it's ok to read the extra address, which in this case would be 17A9 and 2FA9. Since reading the status register of an I/O IC can change the status, reading it from outside an I/O routine could cause problems in some cases. This kind of thing caused some debugging nightmares with the NMOS 6502's extra read of invalid addresses in certain operations. (This too was corrected in the CMOS version.) It would be pretty unlikely however that you would have the status register of an I/O IC at an address ending in A9.