16

Ideally there would be a version of Intel's Software Developer's Manuals written in AT&T syntax, but I would be happy to find anything that is close enough.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
sigjuice
  • 28,661
  • 12
  • 68
  • 93
  • For AT&T basics, see the GAS manual https://sourceware.org/binutils/docs/as/i386_002dDependent.html, and https://stackoverflow.com/tags/att/info. The GAS manual mentions mnemonics that are different, for the rest you simply reverse the list of operands. (And apply the normal rules that immediates always use a `$`.) – Peter Cordes Apr 16 '22 at 17:40

1 Answers1

14

Sun's manual uses gas syntax, with a correspondence table for the Intel/AMD-sanctioned opcode names (PDF).

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
  • The link is a 404 unfortunately. I assume the content has been moved over to oracle.com, but I was unable to find it using a quick google tour. – Johannes Rudolph Oct 31 '11 at 16:26
  • 1
    @JohannesRudolph Fixed (googling for "solaris assembly manual intel") – Pascal Cuoq Oct 31 '11 at 19:37
  • Thanks! Googling is black magic sometimes (always getting different results when running through company vpn and have other geo-ip etc.)... – Johannes Rudolph Oct 31 '11 at 21:22
  • 2
    Nice! But this still does not document how on the holy Earth should I order the operands of a 3op imul! :p (It only [mentions](http://docs.oracle.com/cd/E19253-01/817-5477/eoxvu/index.html) there are 3op instruction but gives nothing on how they are formed, [the instruction list](http://docs.oracle.com/cd/E19253-01/817-5477/eoizh/index.html) does not cover these) – Jubatian Sep 26 '13 at 16:32
  • @Jubatian Trial and error? :) – Pascal Cuoq Sep 26 '13 at 16:35
  • Is that part of the "official" docs? :)) (A complete spec. should be complete, eh?) – Jubatian Sep 26 '13 at 16:37
  • @Jubatian Documenting an assembler is perhaps even more boring than implementing it. To my knowledge, this kind of documentation is not available in any “official” fashion for GAS (and we should be thankful to have any open-source assembler at all). However, Sun used to ship GAS as its assembler for SunOS/Solaris, so they wrote the manuals I referenced in my answer. – Pascal Cuoq Sep 26 '13 at 16:59
  • No problem, thanks for the insight! (My job involves safety-related software, so I got used to have / create / demand rigorous docs as required by the standards we follow - my question is not related though, so no problem with the "empirical" methods :) ) – Jubatian Sep 26 '13 at 17:09
  • Downvoter, what's wrong with the answer? – Pascal Cuoq Apr 15 '17 at 20:54
  • 2
    @Jubatian: Instead of trial and error, disassemble something with `objdump -d`. Where "something" is either manually created binary, or output from `gas`'s `.intel_syntax noprefix` mode, or output from NASM or YASM. (Future readers: AT&T syntax reverses the order of the operand list vs. Intel's manuals, regardless of how many operands there are. Also note the [`fsub` vs. `fsubr` mnemonic swap](https://sourceware.org/binutils/docs/as/i386_002dMnemonics.html#AT_0026T-Mnemonic-versus-Intel-Mnemonic) for register operands, originally a bug and now standardized.) – Peter Cordes Sep 09 '17 at 01:50
  • Downvoter, care to leave a note explaining what would improve this answer? – Pascal Cuoq Sep 09 '17 at 21:56