subfc.
Subtract from Complement with Carry-Out
subfc. RT,RA,RB
Subtracts the contents of one register from the complement of another and updates the carry-out flag.
Encoding
Binary Layout
01000
0:5
LI
6:29
AA
30
LK
31
Operands
-
RT
Target General Purpose Register -
RA
Source General Purpose Register -
RB
Source General Purpose Register
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
For subfc., the complement of the contents of register RB is subtracted from the contents of register RA, and the result is placed into register RT. The carry-out flag is updated based on the operation.
Operation
if 'subfc.' then
RT <- (RA) - (~RB)
XER.CA <- carry-out
Programming Note
Use subfc. to subtract the bitwise complement of one register from another, updating the carry-out flag in XER.CA. Ensure registers are properly aligned and consider the effect on CR0 for conditional branching.