'Would an Instruction Set Architecture benefit from both an ADC and SBC, or could all carry instructions repeat the previous type?
I'm creating an instruction set with only 16 instructions (4 bits opcode, 4 bits immediate), and as such am wondering if I could replace having both ADC (Add-with-carry) and SBC (Subtract-with-carry) with RWC (Repeat-with-carry).
RWC would function as ADC if the last add/subtract/rwc instruction was an add, using its carry.
RWC would function as SBC if the last add/subtract/rwc instruction was a subtract, using its carry (aka borrow).
Simply put, would there ever be a need to use a carry as a borrow or a borrow as a carry (Ex: "add a,b,c; sbc d,e,f;" or "sub a,b,c; adc d,e,f;")? Would there be other potential limitations for this design?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
