assembly - Fourth parameter on ARM SUBtract instruction -
can explain/confirm (particularly sub line) me:
cmp align,#2 cmpne align,#5 cmpne align,#8 subeq xpos,xpos,width,lsr#1
i thinking might equivilant c code:
if ((align==2) || (align==5) || (align==8)) { xpos -= width >> 1; }
i have found documentation don't understand forth parameter, imm12
. says:
the sub instruction subtracts value of operand2 or imm12 value in rn.
your assumption code looks correct me.
but don't understand forth parameter, imm12
the fourth parameter not imm12
, rather a shift operation on width
(which assume alias 1 of general purpose registers).
Comments
Post a Comment