8085 micro processor programs
TRANSCRIPT
8085 ProgramsDr Vinita Kumari
1's COMPLEMENT OF AN 8-BIT NUMBER
(CMA)
// The number to be complemented is stored in C050
// Answer is stored in C051
# BEGIN 0000H
LDA C050
CMA
STA C051
HLT
// EXAMPLE-> C050=96
// Answer-> C051=69
# ORG C050
# DB 96H
1's COMPLEMENT OF A 16-BIT NUMBER
(stored in memory)
// The 16bit number is stored in C050,C051
// The answer is stored in C052,C053
# BEGIN 0000H
LXI H,C050
MOV A,M
CMA
STA C052
INX H
MOV A,M
CMA
STA C053
HLT
// EXAMPLE-> C050=85,C051=54
// Answer-> C052=7A,C053=AB
# ORG C050
# DB 85H,54H
LXI H,C050
LXI B, C053
MOV A,M
CMA
STAX B
INX H
INX B
MOV A,M
CMA
STAX B
HLT
2's COMPLEMENT OF AN 8-BIT NUMBER
// The number to be complemented is stored in C050
// Answer is stored in C051
# BEGIN 0000H
LDA C050
CMA
INR A
STA C051
HLT
// EXAMPLE-> C050=96
// Answer-> C051=6A
# ORG C050
# DB 96H
Addition of two 8 bit numbers and sum
is 16-bit
Addition of two 8 bit numbers and sum
is 16-bit (Addition with carry)
LXI B, 8501
LXI H,8502
MVI C,00
LDAX B
ADD M
JNC NEXT
INR C
NEXT: INX H
MOV M,A
INX H
MOV M,C
HLT
Transfer of a block of number from one
location to another location
Transfer of a block of number
from one location to another
location
Largest of two numbers (CMP)
Largest of two numbers
Largest number from an array
Largest number from an array
Smallest of two numbers
Smallest of two numbers
Smallest number from array
Smallest number from array
Multiplication of 8 bit numbers with successive addition
Division of 8 bit numbers