Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thumb2: incorrect LDR addressing and immediate field #14

Open
pistol opened this issue Oct 17, 2013 · 0 comments
Open

thumb2: incorrect LDR addressing and immediate field #14

pistol opened this issue Oct 17, 2013 · 0 comments

Comments

@pistol
Copy link
Contributor

pistol commented Oct 17, 2013

>>> 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant