寄存器的十六进制值? 86 [英] Hex values of registers? x86

查看:332
本文介绍了寄存器的十六进制值? 86的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MOV DL,AL

MOV DL= B2

"MOV DL" = B2

但是,什么是AL十六进制字节值?在哪里这些上市?

But what is the hex byte value for AL? Where are these listed?

我才意识到它必须是另一个运code!任何人都可以点我在正确的方向?

推荐答案

英特尔架构软件开发人员手册,第2卷:指令集参考手册,表3-1。注册相关的编码与+ RB + RW和+ RD命名,3-3页:

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:

AL = 0 AX = 0 EAX = 0
CL = 1 CX = 1 ECX = 1
DL = 2 DX = 2 EDX = 2
BL = 3 BX = 3 EBX = 3
AH = 4 SP = 4 ESP = 4
CH = 5 BP = 5 EBP = 5
DH = 6 SI = 6 ESI = 6
BH = 7 DI = 7 EDI = 7


要回答你的问题(啊哈伟大的,我有一个很难找到的指令列表到寄存器移动到寄存器你能摆脱任何光线。?):


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?"):

首先这里有一些鱼:(8位暂存器)

First here are some fish: (for 8-bit regs)

8a c0        mov     al, al
8a c1        mov     al, cl
8a c2        mov     al, dl
8a c3        mov     al, bl
8a c8        mov     cl, al
8a c9        mov     cl, cl
8a ca        mov     cl, dl
8a cb        mov     cl, bl
8a d0        mov     dl, al
8a d1        mov     dl, cl
8a d2        mov     dl, dl
8a d3        mov     dl, bl
8a d8        mov     bl, al
8a d9        mov     bl, cl
8a da        mov     bl, dl
8a db        mov     bl, bl


和这里是如何开始钓鱼:


And here's how to get started fishing:

在英特尔指令集手册中,查找MOV指令,在3-402页。你会发现一个表格,列出了MOV指令的各种风味,起价:

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:

88 /r MOV r/m8,r8 Move r8 to r/m8
89 /r MOV r/m16,r16 Move r16 to r/m16
89 /r MOV r/m32,r32 Move r32 to r/m32
8A /r MOV r8,r/m8 Move r/m8 to r8
8B /r MOV r16,r/m16 Move r/m16 to r16
8B /r MOV r32,r/m32 Move r/m32 to r32

请注意如何通过上述我们的鱼使用8A运code。因为你可能猜测,R8是一个8位寄存器,并且r / M8可以是一个8位寄存器,或从存储器的一个字节。还要注意MOV运codeS多么的不同可用于16位和32位寄存器和值(R16,R32)。页面3-2 3-5解释不同类型的参数,你可以在一个MOV指令指定。

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.

不过,你可能会说,这不告诉你足够了解如何构建在指令后面的字节。对于这一点,看2.1节 - 通用指令格式,在开始第2-1页。 x86指令可能由多达6个字节序列:prefixes,运code,MODR / M,SIB,位移和立即值。我们的寄存器传送指令是简单,只包括一个运算code(8A)和MODR / M字节。

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.

在MODR / M字节的细目记录在2.4节,并在2-5至2-6页包罗万象表。该你会发现MODR / M字节可以连接code源和目的寄存器。例如,从AL移到DL,您将使用D0 MODR / M值,给予8A D0指令。

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.

这篇关于寄存器的十六进制值? 86的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆