KEMBAR78
8085 Simple Programs | PDF
0% found this document useful (0 votes)
31 views2 pages

8085 Simple Programs

The document provides examples of 8085 assembly language programs for basic arithmetic operations including addition and subtraction of two and three numbers, as well as computing 1's and 2's complements. Each example includes the assembly code and the expected result stored in specific memory locations. The programs demonstrate fundamental operations that can be performed using the 8085 microprocessor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

8085 Simple Programs

The document provides examples of 8085 assembly language programs for basic arithmetic operations including addition and subtraction of two and three numbers, as well as computing 1's and 2's complements. Each example includes the assembly code and the expected result stored in specific memory locations. The programs demonstrate fundamental operations that can be performed using the 8085 microprocessor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Some Simple of examples of 8085 program

1) Sum of two numbers


MVI A, 5H ; Load 5H into Accumulator
MVI B, 3H ; Load 3H into Register B
ADD B ;A=A+B
STA 3000H ; Store result at memory 3000H
HLT ; Stop
✅ Result: 5H + 3H = 8H stored in 3000H.

2) Subtract of two numbers


MVI A, 45H ; Load 45H into Accumulator
MVI B, 25H ; Load 25H into Register B
SUB B ;A=A-B
STA 3001H ; Store result at memory 3001H
HLT
✅ Result: 45H – 25H = 20H stored in 3001H

3) Addition of 3 numbers ( First number at 3000H, second at 3001H, third at 3002H. Result at
3003H)
LDA 3000H ; Load first number into A
MOV B, A ; Save in B
LDA 3001H ; Load second number
ADD B ; A = A + first number
MOV B, A ; Save result in B
LDA 3002H ; Load third number
ADD B ; A = A + previous sum
STA 3003H ; Store final result
HLT

4) Subtraction of 3 numbers ( First number at 3000H, second at 3001H, third at 3002H. Result at
3003H)

LDA 3000H ; Load first number into A


MOV B, A ; Save in B
LDA 3001H ; Load second number
SUB B ; A = A - first number
MOV B, A ; Save result in B
LDA 3002H ; Load third number
SUB B ; A = A - previous sum
STA 3003H ; Store final result
HLT
5) Addition of two numbers
MVI A, 25H ; Load 25H into Accumulator
MVI B, 15H ; Load 15H into Register B
ADD B ;A=A+B
STA 3000H ; Store result at 3000H
HLT
6) Subtraction of two numbers
MVI A, 55H ; Load 45H into A
MVI B, 10H ; Load 20H into B
SUB B ;A=A-B
STA 3001H ; Store result at 3001H
HLT

7) 1’s Complement of Number


MVI A, 55H ; Load number
CMA ; Complement Accumulator
STA 3002H ; Store result
HLT

8) 2’s Complement of Number


MVI A, 55H ; Load number
CMA ; 1’s complement
ADI 01H ; Add 1 → 2’s complement
STA 3003H ; Store result
HLT

You might also like