Future ISA: reverse-destination ALU ops (e.g. XOR [GH], A) #16

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

Currently all ALU operations write their result into A: XOR A, [GH] reads memory, XORs with A, and stores back into A.

For a future ISA revision, consider reverse-destination forms like XOR [GH], A — the operation is the same, but the result is written to the memory location pointed to by GH instead of A. A is left untouched. Flags are still affected.

This would be most useful for the bitwise instructions (AND, OR, XOR) where you want to toggle, set, or clear bits in a memory location without disturbing the accumulator. Common use case: flipping flags or status bits in a device register or data structure in-place.

Could also apply to other ALU ops, but the bitwise ones are where the value is clearest.

Currently all ALU operations write their result into A: `XOR A, [GH]` reads memory, XORs with A, and stores back into A. For a future ISA revision, consider reverse-destination forms like `XOR [GH], A` — the operation is the same, but the result is written to the memory location pointed to by GH instead of A. A is left untouched. Flags are still affected. This would be most useful for the bitwise instructions (AND, OR, XOR) where you want to toggle, set, or clear bits in a memory location without disturbing the accumulator. Common use case: flipping flags or status bits in a device register or data structure in-place. Could also apply to other ALU ops, but the bitwise ones are where the value is clearest.
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#16
No description provided.