Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are x86 Assembly Mnemonic standarized?

Does the x86 standard include Mnemonics or does it just define the opcodes?

If it does not include them, is there another standard for the different assemblers?

like image 471
mame98 Avatar asked Dec 07 '22 12:12

mame98


1 Answers

Mnemonics are not standardised and different assemblers use different mnemonics. Some examples:

  • AT&T-style assemblers apply b, w, l, and q suffixes to all mnemonics to indicate operand size. Intel-style assemblers typically indicate this with the keywords byte, word, dword, and qword
  • AT&T-style assemblers recognise cbtw, cwtl, cltq, and cqto while Intel-style assemblers recognise the same instructions as cbw, cwd, cdq, and cqo
  • AT&T-style assemblers recognise movz?? and movs?? where ?? are two size suffixes for what Intel-style assemblers call movzx, movsx, and movsxd
  • some Intel-style assemblers only recognise 63 /r as movsxd while others recognise movsx as a variant of this instruction, too
  • Plan 9-style assemblers (such as used in Go) are just plain weird and differ in a whole lot of ways, such as using Motorola-style mnemonics for conditional jumps
  • historically, the NEC assembler provided for the NEC V20 clone of the 8086 came with almost entirely different mnemonics. For example, int was called brk.
like image 124
fuz Avatar answered Dec 30 '22 11:12

fuz