Skip to content

Incorrect disassembly of call/jmp reg #164

@neldredge

Description

@neldredge

Assemble the following file with nasm -f bin -o foo.bin foo.asm:

bits 64
	call rax

The output is a two-byte file 0xff 0xd0 which I believe is correct. Trying to disassemble this file with ndisasm -b 64 foo.bin outputs:

00000000  FF                db 0xff
00000001  D0                db 0xd0

so ndisasm apparently fails to recognize these bytes as a valid instruction.

The same issue seems to affect call reg as well as jmp reg for any register, and affects disassembly in -b 32 and -b 16 as well.

Memory operands like call [rax] are disassembled correctly.

This is nasm/ndisasm 3.01 running on MacOS ARM64, installed via homebrew.

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