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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -