Beruflich Dokumente
Kultur Dokumente
LAB MANUAL
(2013 Regulation)
Table of Contents
CYCLE I EXPERIMENTS
S.No.
Date
8 BIT SUBTRACTION
MULTIBYTE SUBTRACTION
10
11
8 BIT MULTIPLICATION
12
8 BIT DIVISION
13
DECIMAL TO HEXADECIMAL
CONVERSION
14
15
HEXADECIMAL TO DECIMAL
CONVERSION
STEPPER MOTOR CONTROLLER
16
TEMPERATURE CONTROLLLER
Page
No.
Marks Signature
8085 PROGRAMS
Ex. No.
CARRY
Date:
AIM: To write an assembly language program to perform an addition operation with and
without carry using 8085 microprocessor kit.
ALGORITHM
8-BIT ADDITION WITHOUT CARRY
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Get two 8-bit numbers from the input memory locations to B and A registers.
Clear C register to store the carry condition.
Add the contents of B to A register and store the result in A.
Check carry flag, If CF = 0 then go to step 6.
Increment C register by 1.
Store the contents of Sum and Carry to output memory locations.
Stop the execution.
Memory
Address
Label
Mnemonics
Opcode
Comments
21
2001
00
2002
30
2000
LXI H,3000H
2003
MOV A,M
7E
2004
INX H
23
2005
MOV B,M
46
2006
ADD B
INX H
80
MOV M,A
HLT
77
2007
2008
2009
Increment HL pair
Move the 2nd operand from memory
to register B
Add B with A
Increment HL pair
Move the result from reg A to
memory
Halt
23
76
Label
Mnemonics
LDA 8300 H
MOV B, A
LDA 8301H
Opcodes
3A
00
83
47
3A
01
83
Comments
(A) (8300 H)
(B) (A)
(A) (8301 H)
8207 H
8208 H
8209 H
820A H
820B H
820C H
820D H
820E H
820F H
8210 H
8211 H
8212 H
8213 H
8214 H
8215 H
MVI C, 00 H
ADD B
JNC loop-1
INR C
loop-1 STA 8400H
MOV A, C
STA 8401H
HLT
0E
00
80
D2
0E
82
0C
32
00
84
79
32
01
84
76
(C)00H
(A) (A) + (B)
If CF=0, then go to loop-1
(C) (C) + 1
(8400H) (A)
(A) (C)
(8401H) (A)
Stop the execution
Procedure
ProgramEntry:
Reset
INC
ADS
ADS
Enter Opcode
ADS
ADS
EXEC
INC
...
8-Bit Addition
Input
Output
Address
8300H
Data
Data
06
Address
8400H
8301H
02
8401H
00
8300H
8400H
8301H
8401H
08
8-Bit Subtraction
Input
Output
Address
8300H
Data
Address
8400H
Data
05
8301H
03
8401H
00
8300H
8400H
8301H
8401H
02
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.
Date:
AIM: To write an assembly language program for perform an addition of 2 8bit numbers
and show the result in decimal.
ALGORITHM
8-BIT ADDITION
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Step8:
Step 9:
Step 10:
Step 11:
Step 12:
Memory
Address
Labe
l
Mnemonic
s
Opcode
s
Comments
21
2001
00
2002
30
2000
LXI H,300H
2003
MOV A,M
7E
2004
INX H
23
2005
MOV B,M
46
Increment HL pair
Move the 2nd operand from memory to
register
2006
MVI C,00H
0E
00
2007
2008
ADD B
80
Add B with A
2009
200A
DAA
27
JNC 200EH
D2
200B
0E
200C
20
200D
INR C
0C
Increment reg C
200E
INX H
23
Increment HL pair
200F
MOV M,A
77
2010
INX H
23
Increment HL Pair
2011
MOV M,C
71
2012
HLT
76
Halt
RESULT:
The above programs were successfully executed and results were verified.
8-BIT SUBTRACTION
Ex. No.
Date:
AIM: To write an assembly language program for perform an 8 subtraction using 8085
microprocessor kit.
Get two 8-bit numbers from the input memory locations to B and A
Registers.
Clear C register to store the carry condition.
Subtract the contents of B from A register and store the result in A.
Check carry flog, If CF = 0 then go to step 6.
Increment C register by 1.
Store the contents of Difference and Borrow to output memory
locations.
Stop the execution.
Memory
Address
8200 H
8201 H
8202 H
8203 H
8204 H
8205 H
8206 H
8207 H
8208 H
8209 H
820A H
820B H
820C H
820DH
820E H
820F H
8210 H
8211 H
8212 H
8213 H
8214 H
8215 H
Label
Mnemonics
LDA 8300
MOV B, A
LDA 8301H
MVI C, 00
SUB B
JNC loop-1
loop-1
INR C
STA 8400H
MOV A, C
STA 8401H
HLT
Opcodes
3A
00
83
47
3A
01
83
0E
00
90
D2
0E
82
0C
32
00
84
79
32
01
84
76
Comments
(A) (8300 H)
(B) (A)
(A) (8301 H)
(C) 00H
(A) (A) - (B)
If CF=0, then go to loop-1
(C) (C) + 1
(8400H)(A)
(A)(C)
(8401H)(A)
Stop the execution
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.
Date:
AIM: To write an assembly language program for perform an 8 bit decimal subtraction
using 8085 microprocessor kit.
Memory
Address
8000H
8001H
8002H
8003H
8004H
8005h
8006h
8007h
8008h
8009h
800AH
800BH
800CH
800Dh
Label
Mnemonics
Opcodes
LXI H, 8D01h
21
01
8D
3E
99
96
3C
2B
86
27
32
02
8D
76
MVI A, 99
SUB M
INR A
DCX H
ADD M
DAA
STA 8D02h
HLT
Comments
RESULT:
The above programs were successfully executed and results were verified.
16-BIT ADDITION
Ex. No.
Date:
AIM: To write an assembly language program for perform an addition of two 16 bit
numbers using 8085 microprocessor kit.
ALGORITHM
16-BIT ADDITION
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Get two 16-bit numbers from the input memory locations to DE and HL
register pairs.
Clear A register to store the carry condition.
Add the contents of DE to HL register pairs and store the result in HL.
Check carry flag, If CF = 0 then go to step 6.
Increment A register by 1.
Store the contents of Sum and Carry to output memory locations.
Stop the execution.
Program with opcode 16-Bit Addition
Memory
Address
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
820A
820B
820C
820D
820E
820F
8210
8211
8212
8213
8214
Label
Mnemonics
LHLD 8300
XCHG
LDA 8302H
MVI A, 00
DAD D
JNC loop-1
loop-1
INR A
SHLD 8400H
STA 8401H
HLT
Opcodes
Comments
(HL) (8300 H)
2A
00
83
EB
2A
02
83
3E
00
19
D2
0E
82
3C
22
00
84
32
02
84
76
(DE) (HL)
(HL) (8302 H)
(A) 00H
(HL) (HL) + (DE)
If CF=0, then go to loop-1
(A) (A) + 1
(8400H)(HL)
(8402H)(A)
Procedure
ProgramEntry:
Reset
INC
ADS
Enter Opcode
ADS
ADS
ADS
EXEC
INC
...
16-Bit Addition
Input
Address
8300H
8301H
8302H
8303H
Output
Data
77
88
99
11
Address
8400H
8401H
8402H
8300H
8400H
8301H
8401H
8302H
8402H
Data
10
9A
00
8303H
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.6
6Date:
ALGORITHM
8-BIT ASCENDING ORDER
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Step 8:
Step 9:
MVI C, 04
loop-3 MVI D, 04
LXI H, 8300H
loop-2 MOV A, M
INX H
MOV B, M
CMP B
JC loop-1
MOV M, B
DCX H
MOV M, A
INX H
loop-1 DCR D
JNZ loop-2
DCR C
JNZ loop-3
HLT
0E
04
16
04
21
00
83
7E
23
46
B8
DA
12
82
70
2B
77
23
15
C2
07
82
0C
C2
02
82
76
Comments
(C) 04H
(D) 04H
(HL) 8300
(A) (M)
(HL) (HL) + 1
(B) (M)
Compare A and B registers
If CF=1, then go to loop-1
(M)(B)
(HL) (HL) - 1
(M)(A)
(HL) (HL) + 1
(D) (D) - 1
If ZF=0, then go to loop-2
(C) (C) - 1
If ZF=0, then go to loop-2
Output
Data
03
05
02
06
01
Address
8300H
8301H
8302H
8303H
8304H
8300H
8301H
8302H
8303H
8304H
Data
01
02
03
05
06
Procedure
ProgramEntry:
Reset
INC
ADS
ADS
Enter Opcode
ADS
ADS
EXEC
INC
...
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.
6
Date:
AIM: To write an assembly language program to sort an array in descending order
of five 8-bit numbers using 8085 microprocessor kit.
Step 8:
Step 9:
Label
loop-3
Mnemonics
MVI C, 04
MVI D, 04
LXI H, 8300H
loop-2
loop-1
MOV A, M
INX H
MOV B, M
CMP B
JNC loop-1
MOV M, B
DCX H
MOV M, A
INX H
DCR D
JNZ loop-2
DCR C
JNZ loop-3
HLT
Opcodes
0E
04
16
04
21
00
83
7E
23
46
B8
D2
12
82
70
2B
77
23
15
C2
07
82
0C
C2
02
82
76
Comments
(C) 04H
(D) 04H
(HL) 8300
(A) (M)
(HL) (HL) + 1
(B) (M)
Compare A and B registers
If CF=0, then go to loop-1
(M)(B)
(HL) (HL) - 1
(M)(A)
(HL) (HL) + 1
(D) (D) - 1
If ZF=0, then go to loop-2
(C) (C) - 1
If ZF=0, then go to loop-2
Output
Data
03
05
02
06
07
Address
8300H
8301H
8302H
8303H
8304H
8300H
8301H
8302H
8303H
8304H
Data
07
06
05
03
02
Procedure
ProgramEntry:
Reset
INC
ADS
ADS
Enter Opcode
ADS
ADS
EXEC
INC
...
RESULT:
The above programs were successfully executed and results were verified.
8-BIT MULTIPLICATION
Ex. No.
Date:
AIM: To write an assembly language program perform multiplication two 8-bit numbers
using 8085 microprocessor kit.
ALGORITHM
8-BIT MULTIPLICATION
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Get two 8-bit numbers from the input memory locations to B and C
registers.
Clear A and D registers to store the lower and higher order products.
Add the contents of B with A register and store the lower product in A.
Check carry flog, If CF = 0 then go to step 6.
Increment D register by 1 for higher product.
Store the contents of product to output memory locations.
Stop the execution.
Label
Mnemonics
LDA 8300H
MOV B, A
LDA 8301H
MOV C, A
MVI A, 00H
MVI D, 00H
loop2
ADD B
JNC loop-1
loop1
INR D
DCR C
JNZ loop-2
STA 8400H
MOV A, D
STA 8401H
HLT
Opcodes
3A
00
83
47
3A
01
83
4F
3E
00
16
00
80
D2
11
82
14
0D
C2
0C
82
32
00
84
7A
32
01
84
76
Comments
(A) (8300 H)
(B) (A)
(A) (8301 H)
(C) (A)
(A) 00H
(D) 00H
(A) (A) + (B)
If CF=0, then go to loop-1
(D) (D) + 1
(C) (C) - 1
If ZF=0, then go to loop-2
(8400H)(A)
(A)(D)
(8401H)(A)
Stop the execution
8-Bit Multiplication
Input
Output
Address
8300H
Data
02
Address
8400H
8301H
06
03
8401H
00
8300H
8400H
8301H
8401H
Data
Procedure
ProgramEntry:
Reset
INC
ADS
ADS
Enter Opcode
ADS
ADS
EXEC
INC
...
RESULT:
The above programs were successfully executed and results were verified.
8-BIT DIVISION
Ex. No.
Date:
AIM: To write an assembly language program perform division of two 8-bit numbers
using 8085 microprocessor kit.
ALGORITHM
16-BIT DIVISION
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Get two 16-bit numbers from the input memory locations to DE and HL
register pairs.
Clear BC register pair to store the Quotient.
Increment BC register pair by 1.
Subtract the contents of DE from HL register and store the result in HL.
Check carry flog, If CF = 0 then go to step 3.
Store the contents of quotient and reminder to output memory locations.
Stop the execution.
Memory
Address
Label
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
820A
820B
820C
820D
820E
820F
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
821A
821B
821C
Mnemonics
LDA 8300H
3A
00
83
47
3A
01
83
0E
3E
00
16
00
80
D2
11
82
14
0D
C2
0C
82
32
00
84
7A
32
01
84
76
MOV B, A
LDA 8301H
MVI C, 00H
MVI D, 00H
loop2
ADD B
JNC loop-1
loop-
INR D
DCR C
JNZ loop-2
Opcodes
STA 8400H
MOV A, D
STA 8401H
HLT
Comments
(A) (8300 H)
(B) (A)
(A) (8301 H)
(C) (A)
(A) 00H
(D) 00H
(B) (A) + (B)
If CF=0, then go to loop-1
(D) (D) + 1
(C) (C) - 1
If ZF=0, then go to loop-2
(8400H)(A)
(A)(D)
(8401H)(A)
8-Bit Division
Input
Output
Address
8300H
Data
Data
20
Address
8400H
8301H
60
8401H
03
8300H
8400H
8301H
8401H
00
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.
Date:
AIM: To write an assembly language program perform division of two 8-bit numbers
using 8085 microprocessor kit.
ALGORITHM
Step 1 : Access the channel of ADC
Step 2 : Intialise the accumulator with start of conversion signal & output it to the ADC
Step 3 : Send 0 signal for ending the conversion for ADC
Step 4 : Get the analog value converted to display from ADC
Step 5 : The digital signal is separated into two nibbles and displayed in hexadecimal from by calling
service subroutine.
Step 6 : Go to step 1
Memor
y
Addres
5000
5001
5002
5003
Label
Mnemonics
MVI A,10
OUT C8
Opcode
s
Comment
s
Initialize a with 10
Output channel throuth
5004
5005
5006
OUT C8
5007
5008
5009
500A
NOP
NOP
MVI A,10
No operation
No operation
Initialize A with 2nd signal
500B
500C
OUT C8
500D
500E
500F
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
501A
501B
501C
501D
501E
501F
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
502A
502B
502C
502D
502E
502F
5030
5031
5032
5033
MVI A,18
MVI A,01
OUT D0
NOP
NOP
NOP
NOP
MVI A,00
Initialize A with 18
OUT DO
IN D8
ANI 01
JZ L1
IN CO
MOV B,A
ANI 0F
B -> A
And of with A
STA 5151
Store in 5151
MOV A,B
ANI FO
B->A
And of with A
RRC
RRC
RRC
RRC
STA 550
Rotate content A
MVI A,03
MVI C,08
LXI 5150
5034
5036
5037
5038
5039
503A
503B
503C
CALL 0005
JMP 500E
Jump to 500E
RESULT:
The above programs were successfully executed and results were verified.
Ex. No.
Date:
Aim:
To write an assembly program to make the stepper motor run in forward and reverse direction.
Algorithm:
Step 1 : Load the HL pair wit value from table
Step 2 : Move it to B register for setting the counter
Step 3 : Move the memory value to accumulator and display it by control word
Step 4 : Load DE register pair with FFFF for starting delay subroutine
Step 5 : Run the delay loop control D-register becomes zero.
Step 6 : Increment H address for next value from table
Step 7 : Jump on no zero
Memory
Address
4100
4101
4102
4103
4104
4105
4106
Label
START
410D
410E
410E
410F
4010
4111
4112
4113
4114
4115
4116
4117
LXI H,look up
MVI B,04
Repat
4107
4108
4109
410A
410B
410C
Mnemonics
MOV A,M
OUT CO
LXI D,03,03
Delay
NOP
DCX D
MOV A,E
ORA D
JNZ DELAY
INX H
DCR B
JNZ REPEAT
JMP START
Opcodes
Comments