Re:Can you tell an assembly language when you see one?
by pansa2 on Saturday April 24, 2021 @06:04AM
(#26923724)
> assembly language must have an unambiguous bidirectional mapping between the target binary code and the assembly language.
This isn’t true for many CPU assembly languages, though. For example, the x86 instruction `add eax, ecx` can be assembled to either `01 c8` or `03 c1`.
> you can still unambiguously recover some sort of assembly which can be used to generate an identical binary output
If your binary contains `01 c8`, information is lost when that’s disassembled to `add eax, ecx` and there’s no guarantee that a newly assembled binary won’t contain `03 c1` in its place.
That is not to say that you can't have macros in an assembly language. While you can't unambiguously recover any macros (or label names, for that matter) used when generating assembly language from the binary output, you can still unambiguously recover some sort of assembly which can be used to generate an identical binary output, excepting any junk your particular platform does that prevents reproducible builds such as embedding timestamps.