

Both are just bit shifts there is no distinction between “arithmetic” and “logical” left shifts like there is between arithmetic and logical right shifts, but the Intel manuals list SAL (with an encoding that happens to be the same as SHL) and all x86 assemblers I’ve ever used accept it. For example, SAL (shift arithmetic left) is a long-standing alias for SHL (shift left). Calling them MOV is essentially nothing but syntactic sugar in the official Intel assembly language.Īnd on the subject of syntactic sugar: some mnemonics are just aliases.

So these instructions may be called MOV, but they’re weird, special snowflakes, and from the processor’s point of view they’re entirely different instructions in a different part of the encoding space and with different rules. And, sure enough, XED counts them as separate instruction classes ( MOV_CR and MOV_DR). Consequently they’re also extremely rare, and are likely to account for approximately 0% of the test sample.
#OPCODE SHEET FOR 8086 PDF CODE#
The latter are sufficiently distinct from “regular” MOV to rate their own documentation pages, they have completely different instruction encodings (not even in the same encoding block as regular MOV), and they’re privileged instructions, meaning lowly user-mode code isn’t even allowed to execute them. And… there are 3 different top-level entries? “MOV-Move”, “MOV-Move to/from Control registers”, “MOV-Move to/from Debug Registers”. So let’s look up MOV in the Intel Architecture manuals.

Is it something with a distinct mnemonic? Let’s first look at what the article I quoted above says is by far the most common x86 instruction, at 33% of the total sample set: MOV. It all depends on how precisely we define an instruction. If you disagree about any of these choices, your count will come out different. For example, the operand-size prefix ( 0圆6) turns integer instructions operating on 32-bit registers into the equivalent instruction operating on their lower 16-bit halves, but unlike with the REP or LOCK prefixes, XED does not count these as separate instruction classes. But it doesn’t handle all prefixes this way in all contexts. The prefix thing crops up elsewhere: is say MOVSD (copy a single 32-bit word) a different “instruction class” from REP MOVSD (block copy several 32-bit words)? XED says yes. An atomic add does very different things from a regular add. And in fact, for the purposes of execution, so do current x86s. Many assembly programmers would consider LOCK a prefix and LOCK ADD an addition with said prefix, not a distinct instruction, but XED disagrees. For example, as per XED, ADD and LOCK ADD are different “instruction classes”. Well, it depends on what you wanted to count. According to Intel’s XED, as of this writing, there are 1503 defined x86 instructions (“iclasses” in XED lingo), from AAA to XTEST (this includes AMD-specific extensions too, by the way). To not leave you hanging: Intel has an official x86 encoder/decoder library called XED. It depends on how you count, and the details are interesting (to me anyway).

It’s surprisingly hard to give a good answer (the question was raised in this article).
