How can ARM's MOV instruction work with a large number as the second operand?

前端 未结 7 2006
陌清茗
陌清茗 2020-12-28 17:23

I just begin to study ARM assembly language, and am not clear about how to use MOV to transfer an immediate number into a register.

From both the ARM reference manual

7条回答
  •  无人及你
    2020-12-28 18:06

    One possibility is that the ARM assembler throws away the significant bits of the number and uses only the lowest FF.

    The MOV instruction is a staple in many CPU instruction sets, and usually the assembler resolves the size of the target register and the immediate value being supplied.

    For example the following MOV instructions from the x86 set are

    MOV BL, 80h, ; 8bit
    MOV BX, ACACh ;16bit
    MOV EBX, 12123434h ; 32bit
    

提交回复
热议问题