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.

Details

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.

Pseudocode 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.

Example

subfc. r3, r4, r5

Encoding

Binary Layout
01000
0
LI
6
AA
30
LK
31
 
Format XO-form
Opcode 0x7C000011
Extension Base
Registers Altered CR0, XER

Operands

  • RT
    Target General Purpose Register
  • RA
    Source General Purpose Register
  • RB
    Source General Purpose Register