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

arm assembler bugs #489

Closed
plutooo opened this issue Dec 25, 2013 · 1 comment
Closed

arm assembler bugs #489

plutooo opened this issue Dec 25, 2013 · 1 comment

Comments

@plutooo
Copy link

plutooo commented Dec 25, 2013

"mvn" gets assembled to "mov":

$ rasm2 -a arm "mvneq r3, #1"
0130a003
$ rasm2 -d -a arm 0130a003
moveq r3, #1 ; 0x1

"cmp" is broken:

$ rasm2 -a arm "cmp r3, #0x400"
ff0043e1
$ rasm2 -d -a arm ff0043e1
strd r0, [r3, #-15]

"swp" instructions are not implemented.

s-flag not working:

$ rasm2 -a arm "movs r5, r8"
0850a0e1
$ rasm2 -a arm -d 0850a0e1
mov r5, r8

@radare
Copy link
Collaborator

radare commented Dec 29, 2013

Which version of r2 are you using? is this from git? you should pass -b32 if you want to disassemble ARM32, otherwise it defaults to your system bits (x86-64 will be arm64 if only used -aarm)

Also, the '#' is not a valid char in the r2 disasm, in fact it gives no useful information to the reader, so i decided to remove it, because it conflicts with the comment char used by r2 commands and rasm2 files. So instead of using 'mvneq r3, #1' use 'movneq r3,1'.

That first example works fine:

$ rasm2 -b32 -aarm -D `rasm2 -aarm -b32 'mvneq r3, 1'`
0x00000000   4                 0130e003  mvneq r3, 1
"mvn" gets assembled to "mov": < ---- this is fixed/works fine here

$ rasm2 -a arm "mvneq r3, #1"
0130a003
$ rasm2 -d -a arm 0130a003
moveq r3, #1 ; 0x1

I have recently pushed a fix for that. 'cmp' should work fine now

"cmp" is broken: <- not anymore

$ rasm2 -a arm "cmp r3, #0x400"
ff0043e1
$ rasm2 -d -a arm ff0043e1
strd r0, [r3, #-15]

"swp" instructions are not implemented.

---> i have implemented the 'swp' instruction

I have also implemented 'movs'

s-flag not working:

$ rasm2 -a arm "movs r5, r8"
0850a0e1
$ rasm2 -a arm -d 0850a0e1
mov r5, r8

@radare radare closed this as completed Dec 29, 2013
yossizap pushed a commit to yossizap/radare2 that referenced this issue Dec 30, 2019
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

2 participants