You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GNUSyntax uses . to denote the address of the next instruction, but that doesn't match GNU as' definition. This makes it impossible to round trip the disassembly (GNU as will not be able to assemble je .-0x80 into two-byte short jump.)
GNU: je .-0x80
Go : JE .-128
GNU: jmp .-0x80
Go : JMP .-128
GNU: ja .-0x80
Go : JA .-128
GNU: jmpq .-0x80
Go : JMP .-128
However, in AT&T syntax, . means the address of the current instruction, whereas the encoding actually means (conditional) jumps to the address of next instruction - 0x80.
I think to better test the disassembler, we need to do round-trip test (disassemble -> use GNU assembler to assemble the instruction -> disassemble again and verify the two Insts are deep equal.)
I want to fix this issue, but the current behavior is locked down the the current testdata/decode.txt.
Should I change the data?
The GNUSyntax uses
.
to denote the address of the next instruction, but that doesn't match GNU as' definition. This makes it impossible to round trip the disassembly (GNU as will not be able to assembleje .-0x80
into two-byte short jump.)Output:
However, in AT&T syntax,
.
means the address of the current instruction, whereas the encoding actually means (conditional) jumps to the address of next instruction - 0x80.I think to better test the disassembler, we need to do round-trip test (disassemble -> use GNU assembler to assemble the instruction -> disassemble again and verify the two Insts are deep equal.)
I want to fix this issue, but the current behavior is locked down the the current testdata/decode.txt.
Should I change the data?
/cc @rsc
The text was updated successfully, but these errors were encountered: