Examples in 8085 Programming
Examples in 8085 Programming
Program 1:
LDA 2000H ; Get the contents of memory location 2000H into accumulator
MOV B, A ; Save the contents into B register
LDA 4000H ; Get the contents of memory location 4000Hinto accumulator
STA 2000H ; Store the contents of accumulator at address 2000H
MOV A, B ; Get the saved contents back into A register
STA 4000H ; Store the contents of accumulator at address 4000H
2. Statement: Store the data byte 32H into memory location 4000H.
Program:
3. Sample problem
(4000H) = 14H
(4001H) = 89H
Source program
1
This document was prepared by Doyin Ajayi of Mathematical Sciences Department and is not for sale.
OUT PORT1
HLT
5. Write an assembly program to find greatest between two numbers
Program
MVI B, 30H
MVI C, 40H
MOV A, B
CMP C
JZ EQU
JC GRT
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT