Skip to content

thumb2: incorrect LDR addressing and immediate field #14

@pistol

Description

@pistol
>>> darm.disasm_thumb2(0xf8519003).__str__()
'ldr r9, [r1], r3, lsl #0'
>>> darm.disasm_thumb2(0xf8519003)
Darm(instr=I_LDR, instr_type=T_INVLD, cond=C_AL, Rn=r1, Rm=r3, Rt=r9, I=True, rotate=0, Shift(type_=S_LSL, shift=0))

objdump: f851 9003 ldr.w r9, [r1, r3]

  1. Note the addressing difference, darm's [r1], r3 versus proper [r1, r3].

  2. I bit should not be set and there is no shifting. According to the manual A8.8.65:
    For encoding T2, <shift> can only be omitted, encoded as imm2 = 0b00, or LSL #<imm> with <imm> = 1, 2, or 3, and <imm> encoded in imm2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions