Closed
Description
addi
and cmpwi
instructions do arithmetic/comparisons with a signed immediate. However capstone emits integers as unsigned integers rather than signed.
Examples:
cstool ppc64be "\x2f\x85\xff\xfe" 0x0
> 0 2f 85 ff fe cmpwi cr7, r5, 0xfffe
cstool ppc64be "\x38\x43\x80\x00" 0x0
> 0 38 43 80 00 addi r2, r3, 0x8000
One could argue this notation is correct, however attempting to assemble them with keystone will throw KS_ERR_INVALIDOPERAND