From b394551af849a1073545ece223a3b330e2d5806c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Balv=C3=ADn?= Date: Wed, 7 Oct 2026 00:43:56 +0200 Subject: [PATCH] fix(disasm): render amd64 in the toolchain's Go syntax Assisted-by: GLM 5.3 Flash --- disasm/disasm.go | 2 +- disasm/disasm_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/disasm/disasm.go b/disasm/disasm.go index 464461c..5c3da4c 100644 --- a/disasm/disasm.go +++ b/disasm/disasm.go @@ -70,7 +70,7 @@ func Decode(a arch.Arch, code []byte, addr uint64) (Instruction, error) { if err != nil { return Instruction{Addr: addr, Text: "???", Len: 1}, nil } - return Instruction{Addr: addr, Text: x86asm.IntelSyntax(inst, addr, nil), Len: inst.Len}, nil + return Instruction{Addr: addr, Text: x86asm.GoSyntax(inst, addr, nil), Len: inst.Len}, nil } } diff --git a/disasm/disasm_test.go b/disasm/disasm_test.go index 85bc5e4..5dfa0ec 100644 --- a/disasm/disasm_test.go +++ b/disasm/disasm_test.go @@ -20,8 +20,8 @@ func TestDecodeKnownBytes(t *testing.T) { text string want int }{ - {arch.AMD64, []byte{0x55}, "push rbp", 1}, - {arch.AMD64, []byte{0x48, 0x89, 0xE5}, "mov rbp, rsp", 3}, + {arch.AMD64, []byte{0x55}, "PUSHQ BP", 1}, + {arch.AMD64, []byte{0x48, 0x89, 0xE5}, "MOVQ SP, BP", 3}, {arch.ARM64, []byte{0xc0, 0x03, 0x5f, 0xd6}, "RET", 4}, {arch.RISCV, []byte{0x67, 0x80, 0x00, 0x00}, "RET", 4}, {arch.LOONG64, []byte{0x20, 0x00, 0x00, 0x4c}, "RET", 4},