Search code examples
armarmv7patchdisassemblyida

Assembler STRB instructions armv7


I have this code:

STRB            R2, [R0,R1]

and its opcode is 42 54

I'm using this table http://imrannazar.com/ARM-Opcode-Map

but I so 54 is the opcode of my strb istructions.

What I want is STRB R2, 1

I need to assign to R2 register the decimal value 1.

I can't understand wich opcode for STRB I need to use to do what I want.

help me please


Solution

  • To assign a small immediate to a register, just do:

    mov r2, #1
    

    strb is used to store to memory. You're trying to put a value into a register.