Future ISA: consider replacing EXX with PUSHA/POPA #15

Open
opened 2026-03-29 06:27:33 +00:00 by bcox · 0 comments
Owner

EXX (exchange shadow registers) is inherited from the Z80 but is barely useful on the SBC7 — you can't nest it, and ISRs still need to save/restore registers manually since there's no guarantee the interrupted code wasn't already using the shadow set.

For a future ISA revision, consider dropping EXX and replacing it with single-instruction push-all/pop-all:

  • PUSHA — push all general registers (A, B, C, D, E, F, G, H or whatever subset makes sense) onto the stack in one instruction
  • POPA — pop them all back

This would make ISR prologues/epilogues trivial and save significant code space in interrupt-heavy programs. It's what EXX was trying to do (fast context save) but actually useful.

This is a "future revision" / "Super 7" idea, not something to do in the current ISA.

EXX (exchange shadow registers) is inherited from the Z80 but is barely useful on the SBC7 — you can't nest it, and ISRs still need to save/restore registers manually since there's no guarantee the interrupted code wasn't already using the shadow set. For a future ISA revision, consider dropping EXX and replacing it with single-instruction push-all/pop-all: - **PUSHA** — push all general registers (A, B, C, D, E, F, G, H or whatever subset makes sense) onto the stack in one instruction - **POPA** — pop them all back This would make ISR prologues/epilogues trivial and save significant code space in interrupt-heavy programs. It's what EXX was *trying* to do (fast context save) but actually useful. This is a "future revision" / "Super 7" idea, not something to do in the current ISA.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bcox/sbc7#15
No description provided.