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

Wrong assembly generated for: "movk x1, 0x30, lsl #16" (ARM64) #16969

Closed
dezmondc8 opened this issue May 29, 2020 · 0 comments
Closed

Wrong assembly generated for: "movk x1, 0x30, lsl #16" (ARM64) #16969

dezmondc8 opened this issue May 29, 2020 · 0 comments
Assignees
Labels
ARM ARM architecture support issues RAsm-Assembler

Comments

@dezmondc8
Copy link

I have attached an example comparing the assembly generated by kstool (keystone) and rasm2 for two instructions:

  1. "movk x1, 0x30"
  2. "movk x1, 0x30, lsl fix build on mips using android ndk r8 #16"
$ ./kstool arm64 "movk x1, 0x30"
movk x1, 0x30 = [ 01 06 80 f2 ]
$ ../../../../../bin/rasm2 -a arm -b 64 "movk x1, 0x30"
010680f2

$ ./kstool arm64 "movk x1, 0x30, lsl 16"
movk x1, 0x30, lsl 16 = [ 01 06 a0 f2 ]
$ ../../../../../bin/rasm2 -a arm -b 64 "movk x1, 0x30, lsl 16"
010680f2

rasm2 treats the second instruction no differently than the first instruction, while kstool is able to generate the correct assembly code for the second instruction.

I would also add that disassembly works well for the instruction generated by kstool:

$ ../../../../../bin/rasm2 -d -a arm -b 64 0106a0f2
movk x1, 0x30, lsl 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM ARM architecture support issues RAsm-Assembler
Projects
None yet
Development

No branches or pull requests

4 participants