BigEd wrote:
For comparison, Acorn's MOS does the same thing in both the
early 6502 and
later 65C02 versions:
Code:
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!
Mike B.
(about me) (learning how to github)