MOV DL,AL
“MOV DL” = B2
But what is the hex byte value for AL? Where are these listed?
I just realized it must be another opcode! Can anyone point me in the right direction?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the Intel Architecture Software Developer’s Manual, Volume 2: Instruction Set Reference Manual, Table 3-1. Register Encodings Associated with the +rb, +rw, and +rd Nomenclature, page 3-3:
To answer your question (“aha great. I’m having a hard time finding the a list of instructions to move registers into registers. Can you shed any light?”):
First here are some fish: (for 8-bit regs)
And here’s how to get started fishing:
In the intel instruction set manual, look up the MOV instruction, in page 3-402. You will find a table listing various flavors of the MOV instruction, starting with:
Note how our fish above use the 8A opcode. As you may guess, r8 is an 8-bit register, and r/m8 can be either an 8-bit register or a byte from memory. Also note how different MOV opcodes are available for 16- and 32-bit registers and values (r16, r32). Pages 3-2 to 3-5 explain the various types of arguments you can specify on a MOV instruction.
But, you may say, this doesn’t tell you enough about how to construct the following bytes in the instruction. For that, look at section 2.1 – General Instruction Format, starting at page 2-1. x86 instructions may be composed of up to 6 byte sequences: prefixes, opcode, ModR/M, SIB, displacement and immediate values. Our register move instructions are simple, and include only an opcode (8A) and a ModR/M byte.
The breakdown of the ModR/M byte is documented in section 2.4, and in all-encompassing tables in pages 2-5 to 2-6. The you will find that the ModR/M byte can encode both the source and destination register. For example, to move from AL to DL you will use the D0 ModR/M value, giving the 8A D0 instruction.