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

AArch64: "mov x0, #0x123400000000" vs "movz x0, #0x1234, lsl #32" #1887

Closed
JonathanSalwan opened this issue Jun 10, 2022 · 1 comment · Fixed by #2026
Closed

AArch64: "mov x0, #0x123400000000" vs "movz x0, #0x1234, lsl #32" #1887

JonathanSalwan opened this issue Jun 10, 2022 · 1 comment · Fixed by #2026

Comments

@JonathanSalwan
Copy link

JonathanSalwan commented Jun 10, 2022

Hey,

With capstone 4.0.2, the opcode \x80\x46\xc2\xd2 is disassembled as movz x0, #0x1234, lsl #32 while with Capstone 5 it's disassembled with mov x0, #0x123400000000. I agree that it's the same thing but we lost information with Capstone 5 like shift information, see below:

With Capstone 4.0.2:

$ cstool -d arm64 \x80\x46\xc2\xd2
 0  80 46 c2 d2  movz	x0, #0x1234, lsl #32
	ID: 191 (movz)
	op_count: 2
		operands[0].type: REG = x0
		operands[0].access: READ | WRITE
		operands[1].type: IMM = 0x1234
		operands[1].access: READ
			Shift: type = 1, value = 32      <--- this information is lost with capstone 5
	Registers read: x0
	Registers modified: x0

With Capstone 5.0

$ cstool -d arm64 \x80\x46\xc2\xd2
 0  80 46 c2 d2  mov	x0, #0x123400000000
	ID: 488 (mov)
	op_count: 2
		operands[0].type: REG = x0
		operands[0].access: READ | WRITE
		operands[1].type: IMM = 0x123400000000
	Registers read: x0
	Registers modified: x0

Is there a specific reason for this move except a better readability?

@Rot127
Copy link
Collaborator

Rot127 commented Nov 2, 2023

Is closes with #2026. Shift info can be retrieved with -r option.

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

Successfully merging a pull request may close this issue.

2 participants