Skip to content

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

Closed
@JonathanSalwan

Description

@JonathanSalwan

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions