5

So I am looking for a list of instructions that implicitly do stuff like reading or writing to registers. Obvious ones would be

push/pop modifies esp, pushad accesses all

but I'm sure there are more. Does someone know of a comprehensive list?

edit: By implicitly I mean registers that are not explicitly mentioned in the arguments or the opcode. (except eflags)

4
  • 1
    I think a more interesting question would be "instructions that do NOT access registers", with jmp being the only one I can think of right now. Conditional jumps access flags (do they count as registers?), call/ret access [er]sp, even 2 address instructions like movsb access [er]di/[er]si, and [er]cx if they include the rep prefix. Apr 8, 2016 at 16:21
  • 1
    Or, does your implicitly mean "registers that aren't mentioned, explicitly, in the opcode/arguments" ? Apr 8, 2016 at 16:21
  • 1
    Guntram Blohm yes that is exactly what I mean. :) I'll add it. Apr 8, 2016 at 16:24
  • 1
    what's "xcList", by the way?
    – Igor Skochinsky
    Jun 11, 2016 at 11:18

3 Answers 3

5

I do not know of any comprehensive list, but here (32-bit/64-bit) is a very useful reference which contains most of the information you want.

Note their description of the operand columns:

If an operand is set up using italic, it is an implicit operand, which is not explicitly used. If an operand is set up using boldface, it is modified by the instruction.

So for example, in the 8-bit version of the MUL instruction (AX = AL * r/m8), they list the operands as AX, AL, and r/m8. Note that the first two operands are italicized because they are implicit, and the first operand is bolded because it is modified.

Unfortunately, this does not cover all cases of register modification. For example, MOVSD only lists m32 and m32 for the operands and does not mention the fact that ESI and EDI are dereferenced and then adjusted by 4.


Still, it covers almost all cases, including: AAA, AAD, AAM, AAS, CBW, CDQ, CLTS, CMPXCHG, CMPXCHG8B, CPUID, CWD, CWDE, DAA, DAS, DIV, ENTER, IDIV, IMUL, IN, LAHF, LEAVE, LGDT, LIDT, LLDT, LMSW, LOOP, LOOPcc, MONITOR, MUL, OUT, POPA, PUSHA, RDMSR, RDPMC, RDTSC, RDTSCP, REP, SAHF, SALC, SGDT, WRMSR, and many of the float and SSE instructions, as well as a couple instructions that do not have mnemonics.

It does not (completely) cover some others, including: CMPS, INS, LODS, MASKMOVDQU, MASKMOVQ, MOVS, OUTS, SCAS, STOS. Modifications to the stack pointer are generally not mentioned.

If you care about segment registers, there are also LDS, LES, LFS, LGS, LSS, and the segment prefixes. Several other instructions can implicitly modify the segment registers, however. Additionally, instructions that access memory implicitly access cached information from the segment registers.

Note: The above are not comprehensive lists!

Ultimately, you need to read the Intel Manuals to get the official documentation, but this chart should still save you a lot of time.

1

This list is going to contain most of the instructions in the instruction set because most of the instructions modify flags or registers in some way (the 'mov' instruction being one that doesn't). The flags that are accessed for conditional jumps are stored in the EFLAGS register. You can find the information you're looking for by looking at the Intel manual - read the section on the operation of each instruction.

1

Here's my attempt at the list:

DAA, DAS, AAA, AAS, PUSHA, POPA, NOP, PAUSE, CBW, CWD[E], CDQ, CQO, WAIT, AAM, AAD, XLAT, JMP, LOADALL, EMMS, FINIT, CALL, RET[F], INT, INTO, RSM, PUSH, POP, ENTER, LEAVE, any FPU instruction that ends in 'P'...

To find a comprehensive list would require that you clarify the question even further. There are instructions that modify memory using immediate values, for example. They don't access registers, so they seem to qualify but probably not what you intend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.