irqEntryPoint = $dc1c
STA .interruptAccumulator save A
PLA read flags
PHA store flags again
AND #%00010000 check BRK flag
BNE .brkRoutine if (BRK flag set) then branch (to
BRK handler)
... and on into the IRQ handler
This is nice and fast, but (perhaps notably) not re-entrant. Whether the ISR should be re-entrant is of course a system design decision.
irqEntryPoint = $dc1c
STA .interruptAccumulator save A
PLA read flags
PHA store flags again
AND #%00010000 check BRK flag
BNE .brkRoutine if (BRK flag set) then branch (to
BRK handler)
... and on into the IRQ handler
This is nice and fast, but (perhaps notably) not re-entrant. Whether the ISR should be re-entrant is of course a system design decision.
Woz did somthing very similar on the Apple ][, but curiously decided to ASL ASL ASL BMI instead of AND# BNE ... it wasn't like him to seemingly "waste" a byte of ROM like that, but there you have it. He wouldn't hesitate to spend a handful of cycles to save a byte, but this is larger and slower, so I'm stumped.
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!