ya7on/mb8

"Add with carry", "Subtract with borrow" pseudo opcodes

Open

#85 geöffnet am 27. Dez. 2025

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (3 Forks)auto 404
enhancementgood first issuehelp wantedisa-extension

Repository-Metriken

Stars
 (5 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

To simplify 16-bit arithmetic, it would be useful to introduce ADC/SBC pseudo-opcodes that add or subtract the carry flag from the previous operation.

Currently 16-bit addition requires explicit carry handling

; R0:R1 x (hi:lo)
; R2:R3 y (hi:lo)

ADD R1 R3
JNCR [.no_carry]
INC R0
.no_carry:
ADD R0 R2

With an ADC pseudo opcode the same operation becomes shorter and clearer

ADD R1 R3
ADC R0
ADD R0 R2

Contributor Guide