hc-05传输数据指令
8086 instructions are divided into following types:
8086指令分为以下几种类型 :
Data copy/ Transfer Instruction
数据复制/传输指令
Branch instruction
分支指令
Loop instruction
循环指令
Machine control instruction
机器控制指令
Flag manipulation instruction
标志操作指令
Shift and rotate instruction
移位和旋转指令
String instruction
字符串指令
数据复制/传输指令 (Data copy/ Transfer Instruction)
1)移动 (1) MOV- Move)
Transfers data from 1 register/memory to another register/memory. Direct loading of segment register with immediate data is not permitted.
将数据从一个寄存器/存储器传输到另一个寄存器/存储器。 不允许直接加载带有立即数据的段寄存器。
Example:
例:
Mov Ax,Bx
Mov Ax,1000x
Mov Ds,1000H
Load 5000H
Load Ds with 5000H
Mov Ds,As
2)PUSH:推入堆叠 (2) PUSH: Push to stack)
This instruction pushes the content of specified register or memory location onto the stack. Stack pointer decremented by 2.
该指令将指定寄存器或存储器位置的内容压入堆栈。 堆栈指针减2。
First- Higher byte
第一个高字节
Second-Lower byte
低位字节
![Instruction set push](https://i-blog.csdnimg.cn/blog_migrate/ec3d726da1f6894d0b6398618d77b07f.png)
3)POP:从堆栈弹出 (3) POP: Pop from stack)
This instruction when executed loads a specified register memory location with the contents of the memory location of which the address is formed using the current stack segment and stack pointer.
该指令在执行时将使用当前堆栈段和堆栈指针形成地址的存储位置的内容加载到指定的寄存器存储位置。
4)XCHG:交换 (4) XCHG: Exchange)
Exchanges the content of specified source and destination operand.
交换指定的源和目标操作数的内容。
Note: Exchange of two memory location is not allowed.
注意:不允许交换两个内存位置。
5)IN:输入代码 (5) IN: input code)
This is used for reading an input code address of input code, may be specified either directly or indirectly.
这用于读取输入代码的输入代码地址,可以直接或间接指定。
AL (8 bit) & AX (16bit) are destination register.
AL(8位)和AX(16位)是目标寄存器。
Dx is the default register which is allowed to have implicit post register.
Dx是默认寄存器,允许具有隐式后置寄存器。
IN AL, O3H – reads data from 8bit port whose address is 03H.
IN AL,O3H –从地址为03H的 8位端口读取数据。
6)OUT:输出到端口 (6) OUT: Output to the port)
It is used for writing output to the port. The address may be specified directly or indirectly data odd address is transfer from D18 – D15 even address code is transfer from D0-D7.
用于将输出写入端口。 可以直接或间接指定地址,即使从D0-D7传送地址代码,也可以从D18 – D15传送数据奇数地址。
Example:
例:
OUT 03H, AL
7)XLAT:翻译 (7) XLAT: Translate)
The translate instruction is used for finding out the Codes in case of code conversion problem using lookup table technique.
如果使用查找表技术进行代码转换时遇到问题,则翻译指令用于查找代码。
8)LEA指令(负载有效平衡) (8) LEA instruction (load effective balance))
It loads the effective address formed by destination operant into the specified source register.
它将目标操作形成的有效地址加载到指定的源寄存器中。
LEA BX, ADR( offset of label ADR is transferred to reg- BX)
LEA BX,ADR(标签ADR的偏移量已转移到regBX)
9)LDS / LES指令:加载DS / ES的指针 (9) LDS/LES instruction: load pointer to DS/ES)
It loads the Ds and Es register with the content of memory location specified as source in the instruction.
它将指令中指定为源的存储器位置的内容加载到Ds和Es寄存器中。
Example:
例:
LDS DS, 5000H
10)LAHF:从标志的低字节加载AH (10) LAHF: Load AH from lower byte of flag)
Store AH to lower byte of the flag Register.
将AH存储到标志寄存器的低字节。
![Instruction sex LAHF](https://i-blog.csdnimg.cn/blog_migrate/c9e9e14e58f52e8563a626effc13aa63.png)
11)SAHF:将AH存储到标志寄存器的低字节 (11) SAHF: Store AH to lower byte of flag register)
![Instruction sex SAHF](https://www.includehelp.com/embedded-system/Images/instruction-set-3.jpg)
翻译自: https://www.includehelp.com/embedded-system/instruction-set-of-8086-microprocessor.aspx
hc-05传输数据指令