fix(disasm): render amd64 in the toolchain's Go syntax

Assisted-by: GLM 5.3 Flash
This commit is contained in:
petrbalvin committed 2026-10-07 01:00:45 +02:00
1 parent 9b751f6e58
commit b394551af8
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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
}
}
+2 -2
View File
@@ -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},