Question about Intel IA-32 Software Developer Guide

I am studying the Intel IA-32 Software Developer Guide. In particular, I am reading the following guide: http://www.intel.com/Assets/PDF/manual/253666.pdf . Take, for example, the ADD instruction. On page 79 it is written that you can add r8 (8-bit register) to r / m8 (8-bit register or memory location). A few lines below, it is also written that you can add r / m8 to r8. Question: if I add two 8-bit registers, what instruction do I use? Thanks.

+4
source share
2 answers

The add command has several versions ... the same mnemonics can be encoded for different operation codes, depending on which operands you use. (and answer your specific question: the “add r8, r8” command probably has 2 different possible encodings that do the same)

+8
source

The ADD instruction has 9 different encoding types, and two opcode are reserved for:

Opcode: 00/r = ADD r/m8, r8 Opcode: 02/r = ADD r8, r/m8 

In case "ADD r8, r8" have some effect.

+1
source

Source: https://habr.com/ru/post/1307323/


All Articles