0

I'm trying to make sense of PowerPC instructions and ultimately disassemble them. I've found http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=/com.ibm.aix.aixassem/doc/alangref/ppc_instr.htm and already I'm confused - how do addic and si have the same opcode?

Rena
  • 606
  • 7
  • 21

2 Answers2

1

They are the same instruction. The difference is that the assembler changes the sign of your supplied immediate in the case of si.

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
1

Apparently it's some kind of syntactic sugar on the assembler's part. They both perform addition, but si does it with a negative number:

The si instruction subtracts the 16-bit signed integer specified by the
SINT parameter from the contents of general-purpose register (GPR) RA and
stores the result in the target GPR RT. This instruction has the same
effect as the ai instruction used with a negative SINT value. The
assembler negates SINT and places this value (SI) in the machine
instruction:

    ai RT,RA,-SINT

Source: si (Subtract Immediate) Instruction

echristopherson
  • 6,974
  • 2
  • 21
  • 31