【译】x86程序员手册06 - 2.4指令格式
2.4 Instruction Format 指令格式
The information encoded in an 80386 instruction includes a specification of the operation to be performed, the type of the operands to be manipulated, and the location of these operands. If an operand is located in memory, the instruction must also select, explicitly or implicitly, which of the currently addressable segments contains the operand.
80386指令的编码信息包括操作如何进行的说明,操作数类型,操作数的位置。如果一个操作数在内存中,指令必须明确或隐式地选择当前包含操作数的可编址段。
80386 instructions are composed of various elements and have various formats. The exact format of instructions is shown in Appendix B; the elements of instructions are described below. Of these instruction elements, only one, the opcode, is always present. The other elements may or may not be present, depending on the particular operation involved and on the location and type of the operands. The elements of an instruction, in order of occurrence are as follows:
80386的指令由可变元素组成,并且有多种格式。准确的指令格式被列在附录B中;指令的元素在下面说明。在这些指令元素中,只有一个元素,即opcode,就必须存在项。其他的元素可以有也可以没有,这依赖于特定的操作和操作数类型的位置。这些元素,按出现的顺序列在下面:
- Prefixes -- one or more bytes preceding an instruction that modify the operation of the instruction. The following types of prefixes can be used by applications programs:
前缀 —— 一个或多个字节出现在指令中,修改指令操作。下面列出的前缀类型可以在应用程序中使用:
- Segment override -- explicitly specifies which segment register an instruction should use, thereby overriding the default segment-register selection used by the 80386 for that instruction.
段覆盖 —— 明确指定该指令使用哪个段寄存器,因此会覆盖掉80386为这些指令选择的默认寄存器。
- Address size -- switches between 32-bit and 16-bit address generation.
地址大小 —— 32位和16位地址开关
- Operand size -- switches between 32-bit and 16-bit operands.
操作数大小 —— 32位和16位操作数开关
- Repeat -- used with a string instruction to cause the instruction to act on each element of the string.
重复 —— 在字符串指令中使用,指示指令在字符串的每个元素中使用。
- Opcode -- specifies the operation performed by the instruction. Some operations have several different opcodes, each specifying a different variant of the operation.
操作符 —— 指定指令的操作。一些操作有多个不同的操作符,每一个指定不同的可变的操作。
- Register specifier -- an instruction may specify one or two register operands. Register specifiers may occur either in the same byte as the opcode or in the same byte as the addressing-mode specifier.
寄存器区分符 —— 一条指令可指定一个或两个寄存器操作数。寄存器区分符即可以放在一个字节中作为操作符,或者放在同一个字节中作为地址模式区分符。
- Addressing-mode specifier -- when present, specifies whether an operand is a register or memory location; if in memory, specifies whether a displacement, a base register, an index register, and scaling are to be used.
地址模式区分符 —— 当出现时,用来区分一个操作数是在寄存器还是内存位置;如果在内存中,区分是一个置位符、基址寄存器、索引寄存器还是比例因子。
- SIB (scale, index, base) byte -- when the addressing-mode specifier indicates that an index register will be used to compute the address of an operand, an SIB byte is included in the instruction to encode the base register, the index register, and a scaling factor.
SIB(比例,索引,基址)字节 —— 当地址模式区分符表明有一个索引寄存器被用来计算一个操作数的地址时,SIB字节也被包含在指令中,用来编码基址寄存器、索引寄存器和比例因子。
- Displacement -- when the addressing-mode specifier indicates that a displacement will be used to compute the address of an operand, the displacement is encoded in the instruction. A displacement is a signed integer of 32, 16, or eight bits. The eight-bit form is used in the common case when the displacement is sufficiently small. The processor extends an eight-bit displacement to 16 or 32 bits, taking into account the sign.
置位符 —— 当地址模式区分符表明一个置位符被用来计算一个操作数的地址时,置位符也被编码到指令中。一个置位符是一个32、16或8位的整数。8位通常用来表示置位符相当小。处理器扩展一个8位置位符到16或者32位,包括符号。
- Immediate operand -- when present, directly provides the value of an operand of the instruction. Immediate operands may be 8, 16, or 32 bits wide. In cases where an eight-bit immediate operand is combined in some way with a 16- or 32-bit operand, the processor automatically extends the size of the eight-bit operand, taking into account the sign.
立即数 —— 当存在时,为指令直接提供一个数值。立即数可以是8、16或32位宽度。一旦8位立即数和16位或32位操作数进行组合时,处理器自动扩展8位操作数的大小,包括符号位。
【译】x86程序员手册06 - 2.4指令格式的更多相关文章
- 【译】x86程序员手册01
Intel 80386 Reference Programmer's Manual 80386程序员参考手册 Chapter 1 -- Introduction to the 80386 第1章 - ...
- 【译】x86程序员手册03 - 2.1内存组织和分段
2.1 Memory Organization and Segmentation 内存组织和分段 The physical memory of an 80386 system is organized ...
- 【译】x86程序员手册00 - 翻译起因
从上一次学习MIT的操作系统课程又过去了一年.上次学习并没有坚持下去.想来虽有种种原因,其还在自身无法坚持罢了.故此次再鼓起勇气重新学习,发现课程都已由2014改版为2016了.但大部分内容并没有改变 ...
- 【译】x86程序员手册38-10.2实在址模式下的软件初始化
10.2 Software Initialization for Real-Address Mode 实地址模式的软件初始化 In real-address mode a few structur ...
- 【译】x86程序员手册09-第3章程序指令集
注:觉得本章内容与理解操作系统不直接相关,所以本章并未看完,也就没有翻译完,放在这里中是为了保证手册的完整.有兴趣的人可以去原址查看. https://pdos.csail.mit.edu/6.828 ...
- 【译】x86程序员手册02 - 基本的程序模式
Chapter 2 -- Basic Programming Model: 基本的程序模式 Introduces the models of memory organization. Defines ...
- 【译】x86程序员手册40-10.5初始化的例子
10.5 Initialization Example初始化的例子 译注:本来想把这个例子全部注释完,但由于对intel汇编实不熟悉,有太多的伪指令,本人也是免强看懂,所以就不再做翻译了. $TITL ...
- 【译】x86程序员手册39-10.3切换到保护模式
10.3 Switching to Protected Mode 切换到保护模式 Setting the PE bit of the MSW in CR0 causes the 80386 to b ...
- 【译】x86程序员手册37-第10章 初始化
Chapter 10 Initialization 第10章 初始化 After a signal on the RESET pin, certain registers of the 80386 a ...
随机推荐
- 洛谷—— P2330 [SCOI2005]繁忙的都市
P2330 [SCOI2005]繁忙的都市 题目描述 城市C是一个非常繁忙的大都市,城市中的道路十分的拥挤,于是市长决定对其中的道路进行改造.城市C的道路是这样分布的:城市中有n个交叉路口,有些交叉路 ...
- 玲珑杯 ACM Round #12
A =w= B 占坑 C 题意:有长度为n的序列A和长度为n的序列W,以及一个G,对于Ui,1<=Ui<=Wi,求Σgcd(Ai,Ui)=G的方案数,n<=1e3,Ai<=1e ...
- VS2017-NetCore项目整合Log4Net
1新建NetCore项目,我这里NetCoreSDK版本是2.2.0. 2.进入NuGet程序包官网 : https://www.nuget.org,搜索以下两个包并安装到项目中. Microsoft ...
- SVN提交代码冲突解决方法总结
在近期svn提交代码时遇到多种情况的问题,现做一个解决办法的总结如下: 插播一条:idea下被svn版本控制各类文件的颜色区分,红棕色,未加入版本控制:绿色,已经加入控制暂未提交:蓝色,加入,已提交, ...
- Android Application Digital Signatures - Android 数字签名
Android 数字签名 同一个开发人员的多个程序尽可能使用同一个数字证书,这能够带来下面优点. (1)有利于程序升级,当新版程序和旧版程序的数字证书同样时,Android系统才会觉得这两个程序是同一 ...
- hdoj 4925 Apple tree 【最小割】
题目:pid=4925">hdoj 4925 Apple tree 来源:2014 Multi-University Training Contest 6 题意:给出一个矩阵,然后每一 ...
- 树莓派玩耍笔记1 -- 开箱 & 安装系统以及简单配置
零.前言 树莓派是什么? 吃的么? 呵呵,假设您连这个还不知道,真是out 了. 麻烦出门左拐.百度去(或者,看看官网去?),算了.还是粘贴一些大家都知道的树莓派百科吧: 树莓派由注冊于英国的慈善组织 ...
- Timus 1009. K-based Numbers
1009. K-based Numbers Time limit: 0.5 secondMemory limit: 64 MB Let’s consider K-based numbers, cont ...
- (函数即服务)Faas的现状与未来
刚看到jolestar一位从法律转行程序员的前辈写了一篇Faas现状与未来的文章,里面很多观点都很有启发,或许正如他说的那样,由于Faas能较好的解决资源利用率和开发效率问题,2018年Faas将变得 ...
- 洛谷P2340 奶牛会展
题目背景 奶牛想证明它们是聪明而风趣的.为此,贝西筹备了一个奶牛博览会,她已经对N 头奶牛进行 了面试,确定了每头奶牛的智商和情商. 题目描述 贝西有权选择让哪些奶牛参加展览.由于负的智商或情商会造成 ...