📅  最后修改于: 2020-12-13 15:27:28             🧑  作者: Mango
让我们看一下8085微处理器的编程。
指令集是执行某些任务的指令代码。它分为五类。
S.No. | Instruction & Description |
---|---|
1 | Control Instructions
Following is the table showing the list of Control instructions with their meanings. |
2 | Logical Instructions
Following is the table showing the list of Logical instructions with their meanings. |
3 | Branching Instructions
Following is the table showing the list of Branching instructions with their meanings. |
4 | Arithmetic Instructions
Following is the table showing the list of Arithmetic instructions with their meanings. |
5 | Data Transfer Instructions
Following is the table showing the list of Data-transfer instructions with their meanings. |
现在,让我们看一下使用以上指令的一些程序演示-
编写程序以在3005H和3006H存储器位置添加数据,并将结果存储在3007H存储器位置。
问题演示–
(3005H) = 14H
(3006H) = 89H
结果–
14小时以上89H = 9DH
程序代码可以这样写-
LXI H 3005H : "HL points 3005H"
MOV A, M : "Getting first operand"
INX H : "HL points 3006H"
ADD M : "Add second operand"
INX H : "HL points 3007H"
MOV M, A : "Store result at 3007H"
HLT : "Exit program"
编写程序以在5000M和6000M内存位置交换数据。
LDA 5000M : "Getting the contents at5000M location into accumulator"
MOV B, A : "Save the contents into B register"
LDA 6000M : "Getting the contents at 6000M location into accumulator"
STA 5000M : "Store the contents of accumulator at address 5000M"
MOV A, B : "Get the saved contents back into A register"
STA 6000M : "Store the contents of accumulator at address 6000M"
编写程序以升序排列存储地址3000H中的前10个数字。
MVI B, 09 :"Initialize counter"
START :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H :"Initialize counter 2"
BACK: MOV A, M :"Get the number"
INX H :"Increment memory pointer"
CMP M :"Compare number with next number"
JC SKIP :"If less, don’t interchange"
JZ SKIP :"If equal, don’t interchange"
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H :"Interchange two numbers"
SKIP:DCR C :"Decrement counter 2"
JNZ BACK :"If not zero, repeat"
DCR B :"Decrement counter 1"
JNZ START
HLT :"Terminate program execution"