3 ms·
Can you elaborate on what you mean by that, for those of us with little prior exposure to x86 assembly? (my own ASM experience is limited to using TASM to writ
by vanderZwan 3y ago
Can you elaborate on what you mean by that, for those of us with little prior exposure to x86 assembly?
(my own ASM experience is limited to using TASM to write some games in Z80 on my TI-83 graphing calculator)
- pjmlp 3y agox86 is one of the few architectures that has more than one official syntax. The Intel syntax, common in the PC world since the MS-DOS days, used across Windows and OS/2 as well. In macro Assemblers, inline Assembly in high level languages, and naturally Intel and other x86 manufacturers CPU manuals. It uses the format, op dest, source Then you have the AT&T syntax, for whatever reason when support was added to UNIX for x86, they chose the format used by other architectures. It is only found on GNU/Linux and BSDs, and follows op source, dest Where op is written with the data size prefix, and addressing modes are somehow more complex. Intel: lea eax, [eax + eax * 4] AT&T: lea (%eax, %eax, 4), %eax
- vanderZwan 3y agoThank you for explaining. Since this book targets Ubuntu I'm assuming Linux supports Intel syntax now, so I guess that this also means that it will be a more "portable skill" across different systems.
- pjmlp 3y agoIt has supported Intel syntax for decades now, and yasm/nasm also exist on Linux and BSDs, doesn't change the fact that it is still quite common. Android is probably the only Linux based system where Intel's syntax is favoured via yasm's inclusion on the NDK.
- fredoralive 3y agox86 assembly has two main forms, Intel’s own syntax that is also used by Microsoft’s MASM and other DOS / Windows assemblers, and an AT&T syntax that is traditionally used by Unix type operating systems, that is similar to PDP-11 assembly. Notably, source and destination are generally flipped amongst other differences. Generally AT&T syntax is seen as a bit weird in the x86 realm, and there are some Unix assemblers like NASM that use Intel syntax.