0% found this document useful (0 votes)
8 views106 pages

Ee8681-Mp MC Eee

The document outlines the laboratory work for the Microprocessor and Microcontroller course at P.T. Lee Chengalvaraya Naicker College of Engineering & Technology. It includes a bonafide certificate, a list of experiments conducted with 8085 microprocessor and 8051 microcontroller, and detailed algorithms and programs for basic arithmetic operations. Additionally, it provides sample input and output data for various operations such as addition, subtraction, multiplication, and sorting algorithms.
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)
8 views106 pages

Ee8681-Mp MC Eee

The document outlines the laboratory work for the Microprocessor and Microcontroller course at P.T. Lee Chengalvaraya Naicker College of Engineering & Technology. It includes a bonafide certificate, a list of experiments conducted with 8085 microprocessor and 8051 microcontroller, and detailed algorithms and programs for basic arithmetic operations. Additionally, it provides sample input and output data for various operations such as addition, subtraction, multiplication, and sorting algorithms.
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/ 106

P.T.Lee.

CHENGALVARAYA NAICKER COLLEGE OF


ENGINEERING & TECHNOLOGY
CHENGALVARAYA NAGAR, OOVERY
KANCHIPURAM-631 502

DEPARTMENT OF
ELECTRICAL & ELECTRONICS ENGINEERING
EE8681-MICROPROCESSOR AND MICROCONTROLLER
LABORATORY

NAME :
REG.NO :
YEAR :
DEPT :
P.T.Lee.CHENGALVARAYA NAICKER COLLEGE OF
ENGINEERING & TECHNOLOGY
CHENGALVARAYA NAGAR, OOVERY
KANCHIPURAM-631 502

BONAFIDE CERTIFICATE

This is to certify that record work done by with

Reg. No: of Year B.E, Department of EEE


in the EE8691 MICROPROCESSOR AND MICROCONTROLLER laboratory
during this academic year 2021-2022

LAB INCHARGE HOD

Submitted for the practical examination held on

INTERNAL EXAMINER EXTERNAL EXAMINER


PAGE SIGNATU
S.NO DATE EXPERIMENT NAME NUMB RE
ER
8085 MICROPROCESSOR EXPERIMENTS
1 SIMPLE ARITHMATIC OPERATION
(addition,subtraction,multiplication,division)
ACEDING ORDER and DECENDING
2. ORDER,MINIMUM and MAXIMUM OF
NUMBERS
3 FIND THE ODD AND EVEN NUMBER,
POSITIVE AND NEGATIVEIN BLOCK OF DATA
4. CODE CONVERSION
(ASCII to hexadecimal,hexadecimal to ASCII,
hexadecimal to decimal number,decimal to hexa
decimal,hexadecimal to binary)
5.
INTERFACING A/D and D/A CONVERTER
USING 8085

6. TRAFFIC LIGHT CONTROLLER

7 INTERFACING 8251 WITH 8085

8. INTERFACING 8279 WITH 8085

8051 MICROCONTROLLER EXPERIMENTS


9. BASIC SIMPLE PROGRAM
(Addition,Subtraction,Multiplication,Division)

10. SUM OF ELEMENTS IN AN ARRAY

11. CHECK ODD/EVEN NUMBER USING CALL


OPTIONS

12. INTERFACING A/D and D/A CONVERTER


USING 8051

13. INTERFACING 8253 WITH 8051

14. STEPPER MOTOR INTERFACE USING 8051

15. 8085 PROGRAMMING PRACTICES WITH


SIMULATER/JUBIN OPEN SOURCE SOFTWARE
8085 MICROPROCESSOR
Ex. No: 1 SIMPLE ARITHMETIC OPERATIONS

AIM:

a. 8BIT DATA ADDITION:

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the first number from memory in accumulator.
3. Get the second number and add it to the accumulator.
4. Store the answer at another memory location.
PROGRAM: 8 BIT ADDITION

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


4100 0E START MVI C, 00 Clear C reg.
4101 00
4102 21 LXI H, 4500 Initialize HL reg. to
4103 00 4500
4104 45
4105 7E MOV A, M Transfer first data to
accumulator
4106 23 INX H Increment HL reg. to
point next memory
Location.
4107 86 ADD M Add first number to
acc. Content.
4108 D2 JNC L1 Jump to location if
4109 0C result does not yield
410A 41 carry.
410B 0C INR C Increment C reg.
410C 23 L1 INX H Increment HL reg. to
point next memory
Location.
410D 77 MOV M, A Transfer the result from
acc. to memory.
410E 23 INX H Increment HL reg. to
point next memory
Location.
410F 71 MOV M, C Move carry to memory
4110 76 HLT Stop the program
b. 8BITDATA SUBTRACTION

ALGORITHM:

1. Initialize memory pointer to data location.


2. Get the first number from memory in accumulator.
3. Get the second number and subtract from the accumulator.
4. If the result yields a borrow, the content of the acc. is complemented and 01H is added
to it (2’s complement). A register is cleared and the content of that reg. is incremented
in case there is a borrow. If there is no borrow the content of the acc. is directly taken as
the result.
5. Store the answer at next memory location.
PROGRAM: 8 BIT SUBTRACTION

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


4100 0E START MVI C, 00 Clear C reg.
4101 00
4102 21 LXI H, 4500 Initialize HL reg. to
4103 00 4500
4104 45
4105 7E MOV A, M Transfer first data to
accumulator
4106 23 INX H Increment HL reg. to
point next mem.
Location.
4107 96 SUB M Subtract first number
from acc. Content.
4108 D2 JNC L1 Jump to location if
4109 0F result does not yield
410A 41 borrow.
410B 0C INR C Increment C reg.
410C 2F CMA Complement the Acc.
content
410D C6 ADI 01H Add 01H to content of
410E 01 acc.
410F 23 L1 INX H Increment HL reg. to
point next mem.
Location.
4110 77 MOV M, A Transfer the result from
acc. to memory.
4111 23 INX H Increment HL reg. to
point next mem.
Location.
4112 71 MOV M, C Move carry to mem.
4113 76 HLT Stop the program
c. 8BITDATA MULTIPLICATION:

ALGORITHM:

LOGIC: Multiplication can be done by repeated addition.

1. Initialize memory pointer to data location.


2. Move multiplicand to a register.
3. Move the multiplier to another register.
4. Clear the accumulator.
5. Add multiplicand to accumulator
6. Decrement multiplier
7. Repeat step 5 till multiplier comes to zero.
8. The result, which is in the accumulator, is stored in a memory location.
ROGRAM: 8BIT MULTIPLICATION

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENT


4100 21 START LXI H, 4500 Initialize HL reg. to
4101 00 4500
4102 45
4103 46 MOV B, M Transfer first data to
reg. B
4104 23 INX H Increment HL reg. to
point next mem.
Location.
4105 3E MVI A, 00H Clear the acc.
4106 00
4107 0E MVI C, 00H Clear C reg for carry
4108 00

4109 86 L1 ADD M Add multiplicand


multiplier times.
410A D2 JNC NEXT Jump to NEXT if there
410B 0E is no carry
410C 41
410D 0C INR C Increment C reg
410E 05 NEXT DCR B Decrement B reg
410F C2 JNZ L1 Jump to L1 if B is not
4110 09 zero.
4111 41
4112 23 INX H Increment HL reg. to
point next mem.
Location.
4113 77 MOV M, A Transfer the result from
acc. to memory.
4114 23 INX H Increment HL reg. to
point next mem.
Location.
4115 71 MOV M, C Transfer the result from
C reg. to memory.
4116 76 HLT Stop the program
d. 8BIT DIVISION:
ALGORITHM:

LOGIC: Division is done using the method Repeated subtraction.


1. Load Divisor and Dividend
2. Subtract divisor from dividend
3. Count the number of times of subtraction which equals the quotient
4. Stop subtraction when the dividend is less than the divisor .The dividend now becomes
the remainder. Otherwise go to step 2.
5. Stop the program execution.
PROGRAM: 8 BIT DIVISION

ADDRESS OPCODE LABEL MNEMONICS OPERAND COMMENTS


4100 06 MVI B,00 Clear B reg for quotient
4101 00
4102 21 LXI H,4500 Initialize HL reg. to
4103 00 4500H
4104 45
4105 7E MOV A,M Transfer dividend to
acc.
4106 23 INX H Increment HL reg. to
point next mem.
Location.
4107 96 LOOP SUB M Subtract divisor from
dividend
4108 04 INR B Increment B reg
4109 D2 JNC LOOP Jump to LOOP if
410A 07 result does not yield
410B 41 borrow
410C 86 ADD M Add divisor to acc.
410D 05 DCR B Decrement B reg
410E 23 INX H Increment HL reg. to
point next mem.
Location.
410F 71 MOV M,A Transfer the remainder
from acc. to memory.
4110 23 INX H Increment HL reg. to
point next mem.
Location.
4111 70 MOV M,B Transfer the quotient
from B reg. to memory.
4112 76 HLT Stop the program
OBSERVATION:

ADDITION:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1 4500 40 4502 60
4501 20 4503 00
2 4500 FF 4502 01
4501 02 4503 01

SUBTRACTION:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1 4500 04 4502 03
4501 01 4503 00
2 4500 06 4502 04
4501 07 4503 01

MULTIPLICATION:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1 4500 02 4502 08
4501 04 4503 00
2 4500 FF 4502 01
4501 FF 4503 FE

DIVISION:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1 4500 06 4502(Remainder) 00
4501 02 4503(Quotient) 03
2 4500 23 4502 01
4501 11 4503 02
RESULT:
Ex. No: 2 Ascending/Descendingorder,Maximum/Minimumof numbers

AIM:

a. ASCENDING ORDER
ALGORITHM:

1. Get the numbers to be sorted from the memory locations.


2. Compare the first two numbers and if the first number is larger than second then I
interchange the number.
3. If the first number is smaller, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order
PROGRAM: ACCENDING ORDER

ADDRESS OPC LABEL MNEMONICS OPERA COMMENTS


ODE ND
4100 21 LXI H,4200 Set pointer for array
4101 00
4102 42
4103 4E MOV C,M Load the Count
4104 0D DCR C Decrement Count
4105 51 LOOP 3 MOV D,C Transfer data from C to
D
4106 21 LXI H,4201 Load data from 4201
4107 01
4108 42
4109 7E LOOP2 MOV A,M Copy content of M to A
410A 23 INX H Increment HL reg. to
point next memory
location
410B BE CMP M Compare M & A
410C DA JC LOOP1 If A is lesser than M
then go to loop1
410D 14
410E 41
410F 46 MOV B,M Transfer data from M to
D reg
4110 77 MOV M,A Transfer data from acc
to M
4111 2B DCX H Decrement HL pair
4112 70 MOV M,B Transfer data from B to
M
4113 23 INX H Increment HL pair
4114 15 LOOP1 DCR D Decrement Dreg
4115 C2 JNZ LOOP2 If D is not zero go to
4116 09 loop2
4117 41
4118 0D DCR C Decrement Creg
4119 C2 JNZ LOOP3 If C is not Zero go to
411A 05 loop3
411B 41
411C 76 HLT Stop the program
b. DESCENDING ORDER

ALGORITHM:

1. Get the numbers to be sorted from the memory locations.


2. Compare the first two numbers and if the first number is smaller than second then I
interchange the number.
3. If the first number is larger, go to step 4
4. Repeat steps 2 and 3 until the numbers are in required order
PROGRAM: DECENDING ORDER

ADDRESS OPC LABEL MNEMONICS OPERA COMMENTS


ODE ND
4100 21 LXI H,4200 Set pointer for array
4101 00
4102 42
4103 4E MOV C,M Load the Count
4104 0D DCR C Decrement Count
4105 51 LOOP 3 MOV D,C Transfer data from C to
D
4106 21 LXI H,4201 Load data from 4201
4107 01
4108 42
4109 7E LOOP2 MOV A,M Copy content of M to A
410A 23 INX H Increment HL reg. to
point next memory
location
410B BE CMP M Compare M & A
410C D2 JNC LOOP1 If A is lesser than M
then go to loop1
410D 14
410E 41
410F 46 MOV B,M Transfer data from M to
D reg
4110 77 MOV M,A Transfer data from acc
to M
4111 2B DCX H Decrement HL pair
4112 70 MOV M,B Transfer data from B to
M
4113 23 INX H Increment HL pair
4114 15 LOOP1 DCR D Decrement D reg
4115 C2 JNZ LOOP2 If D is not zero go to
4116 09 loop2
4117 41
4118 0D DCR C Decrement C reg
4119 C2 JNZ LOOP3 If C is not Zero go to
411A 05 loop3
411B 41
411C 76 HLT Stop the program
c. LARGESTELEMENTINAN ARRAY

ALGORITHM:
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content (next
element).
7. If the accumulator content is smaller, then move the memory content
(largest element) to the accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
PROGRAM: LARGEST NUMBER IN ANA ARRAY

ADDRESS OP LABEL MNEM OPER COMMENTS


CODE ONICS AND
4101 21 LXI H,4200 Initialize HL reg. to
4102 00 4200H
4103 42
4104 46 MOV B,M Initialize B reg with no. of
4105 05 DCR B comparisons(n-1)
4106 23 INX H
Transfer first data to acc.
4107 7E MOV A,M
4108 23 LOOP1 INX H Increment HL reg. to point
next memory location
4109 BE CMP M Compare M & A
410A D2 JNC LOOP If A is greater than M then go
410B 0E to loop
410C 41
410D 7E MOV A,M Transfer data from M to A reg
410E 05 LOOP DCR B Decrement B reg
410F C2 JNZ LOOP1 If B is not Zero go to loop1
4110 08
4111 41
4112 32 STA 4300 Store the result in a memory
4113 00 location.
4114 43
4115 76 HLT Stop the program
d. SMALLESTELEMENTINAN ARRAY

ALGORITHM:
1. Place all the elements of an array in the consecutive memory locations.
2. Fetch the first element from the memory location and load it in the accumulator.
3. Initialize a counter (register) with the total number of elements in an array.
4. Decrement the counter by 1.
5. Increment the memory pointer to point to the next element.
6. Compare the accumulator content with the memory content (next
element).
7. If the accumulator content is smaller, then move the memory content
(largest element) to the accumulator. Else continue.
8. Decrement the counter by 1.
9. Repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
PROGRAM: SMALLEST NUMBER IN AN ARRAY

ADDRE OPCO LABEL MNEM OPER COMMENTS


SS DE ONICS AND
4101 21 LXI H,4200 Initialize HL reg. to
4102 00 4200H
4103 42
4104 46 MOV B,M Initialize B reg with no. of
4105 05 DCR B comparisons(n-1)
4106 23 INX H
Transfer first data to acc.
4107 7E MOV A,M
4108 23 LOOP1 INX H Increment HL reg. to point
next memory location
4109 BE CMP M Compare M & A
410A DA JC LOOP If A is greater than M then go
410B 0E to loop
410C 41
410D 7E MOV A,M Transfer data from M to A reg
410E 05 LOOP DCR B Decrement B reg
410F C2 JNZ LOOP1 If B is not Zero go to loop1
4110 08
4111 41
4112 32 STA 4300 Store the result in a memory
4113 00 location.
4114 43
4115 76 HLT Stop the program
OBSERVATION:
A. ASCENDING ORDER
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200(Array Size) 05
4201 08 4201 02
4202 02 4202 08
4203 1F 4203 10
4204 2A 4204 1F
4205 10 4205 2A

B. DESCENDING ORDER
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200(Array Size) 05
4201 08 4201 2A
4202 02 4202 1F
4203 1F 4203 10
4204 2A 4204 08
4205 10 4205 02

C. SMALLEST ELEMENT
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200(Array Size) 05
4201 08
4202 02 4300 02
4203 1F
4204 2A
4205 10

D. LARGEST ELEMENT
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200(Array 05
Size)
4201 08
4202 02 4300 2A
4203 IF
4204 2A
4205 10
RESULT:
Ex. No: 3 FIND THE NUMBER OFEVENANDODDNUMBERINA
BLOCKOFDATA

AIM:

a. OddandEven Number

ALGORITHM:
1. Start.
2. Load the given data.
3. Clear the data in accumulator.
4. Move the content of accumulator to D and B register.
5. Increment HL register pair and move the content of memory to accumulator.
6. Rotate the obtain data in the form of RAR.
7. If carry occur increment B else increment D.
8. Decrement C, if C ≠0 go to step 5. Else increment HL pair.
9. Move the content of D to memory and increment HL pair and move the content B to
memory.
10. Stop.
PROGRAM-FIND THE EVEN AND ODD NUMBER

ADDRE OPCO LABEL MNEM OPER COMMENTS


SS DE ONICS AND
4100 21 LXI H,4200 Load the number of data
4101 00
4102 42
4103 4E MOV C, M Move M to C
4104 AF XRA A Exclusive OR Reg A
4105 57 MOV D, A Move A to D
4106 47 MOV B, A Move A to B
4107 23 L3 INX H H Increment H
4108 7E MOV A,M Move M to A
4109 1F Rotate right through
RAR carry
410A D2 JNC L1 Jump no carry
410B 11
410C 41
410D 14 INR D Increment D
410E C3 JMP L2 Jump to L2
410F 12
4110 41
4111 04 L1 INR B Increment B
4112 0D L2 DCR C Decrement C
4113 C2 JNZ L3 Jump non Zero
4114 07
4115 41
4116 23 INX H Increment H
4117 72 LOOP MOV M, D Move D to M
4118 24 INX H H Increment H
4119 70 MOV M, B Move B to M
411A 76 HLT Halt the program
b. PositiveandNegative Number

ALGORITHM:
1. Start.
2. Load the given data.
3. Clear the data in accumulator.
4. Move the content of accumulator to D and B register.
5. Increment HL register pair and move the content of memory to accumulator.
6. Rotate the obtain data in the form of RAL.
7. If carry occur increment B else increment D.
8. Decrement C, if C ≠0 go to step 5. Else increment HL pair.
9. Move the content of D to memory and increment HL pair and move the content B to
memory.
10. Stop.
PROGRAM-FIND THE POSITIVE AND NEGATIVE NUMBER

ADDRE OPCO LABEL MNEM OPER COMMENTS


SS DE ONICS AND
4100 21 LXI H,4200 Load the number of data
4101 00
4102 42
4103 4E MOV C, M Move M to C
4104 AF XRA A Exclusive OR reg A
4105 57 MOV D, A Move A to D
4106 47 MOV B, A Move A to B
4107 23 L3 INX H H Increment H
4108 7E MOV A,M Move M to A
4109 17 RAL Rotate left through carry
410A D2 JNC L1 Jump no carry
410B 11
410C 41
410D 14 INR D Increment D
410E C3 JMP L2 Jump to L2
410F 12
4110 41
4111 04 L1 INR B Increment B
4112 0D L2 DCR C Decrement C
4113 C2 JNZ L3 Jump non Zero
4114 07
4115 41
4116 23 INX H Increment H
4117 72 LOOP MOV M, D Move D to M
4118 23 INX H H Increment H
4119 70 MOV M, B Move B to M
411A 76 HLT Halt the program
Observation
a. Odd and even number
INPUT: OUTPUT:
4200 = 04 (Array Size) 4205=03(Odd numbers)
4201= 01 4206=01(Even numbers)
4202 =05
4203 =03
4204 =04

b. Positive and negative number


INPUT: OUTPUT:
4200 = 04 (Array Size) 4205=01 (Negative numbers)
4201= 01 4206=03(Positive numbers)
4202 =F5
4203 =03
4204 =74

RESULT:
Ex. No: 4 CODECONVERSIONS

AIM:

a. ASCIITO HEXADECIMAL

ALGORITHM:

We know that the ASCII of number 00H is 30H (48D), and ASCII of 09H is39H (57D). So all
other numbers are in the range 30H to 39H. The ASCII value of 0AH is 41H (65D) and ASCII
of 0FH is 46H (70D), so all other alphabets (B, C, D, E, F) are in the range 41H to 46H

1. Start the program


2. Load the data from address 4200 to A
3. Subtract the data 30 from A
4. Compare the content of accumulator with 0AH.
5. If content of accumulator is less than 0A then goto step 7 else goto step 5.
6. Subtract 07H from accumulator.
7. Store content of accumulator to memory location 4300.
8. Terminate the program.
PROGRAM: ASCII TO HEXA DECIMAL CONVERSION

ADDRE OPCO LABEL MNEM OPER COMMENTS


SS DE ONICS AND
4100 3A LDA 4200 Load data 4200 to A
4101 00
4102 42
4103 D6 SUI 30 Subtract 30 from A
4104 30
4105 FE CPI 0A compare immediately
0AH with the data of
accumulator.
4106 0A
4107 DA JC SKIP check for carry if yes
then go to SKIP
4108 0C
4109 41
410A D6 SUI 07 subtracts 07H
immediately from
accumulator
410B 07
410C 32 SKIP STA 4300 store the content of
accumulator to memory
location 3050.
410D 00
410E 43
410F 76 HLT stops the execution of
program
b. HEXADECIMALTO ASCII

ALGORITHM:

We know that the ASCII of number 00H is 30H (48D), and ASCII of 09H is39H
(57D). So all other numbers are in the range 30H to 39H. The ASCII value of
0AH is 41H (65D) and ASCII of 0FH is 46H (70D), so all other alphabets (B, C,
D, E, F) are in the range 41H to 46H.
1. Start the program
2. Load the data from address 4200 to A
3. Compare Accumulator value with 0A
4. If Carry is set, Add 30 and 07 to Accumulator
Else, Add 30 to Accumulator
5. Store the result to 4300
6. Stop the Execution
PROGRAM: HEXA DECIMAL TO ASCII

ADDRE OPCO LABEL MNEM OPERAND COMMENTS


SS DE ONICS
4100 3A LDA 4200H Load the hex data
4101 00
4102 42
4103 FE CPI 0A compare accumulator
content with 0AH value
4104 0A
4105 DA JC SKIP jump to memory location
SKIP if the carry bit is set.
4106 0A
4107 41
4108 C6 ADI 07H add 07H value to the
content of accumulator
4109 07
410A C6 SKIP ADI 30H add 30H value to the
content of accumulator
410B 30
410C 32 STA 4300H store the content of
accumulator in the
memory location 4300H
410D 00
410E 43
410F 76 HLT stops executing the
program and halts any
further execution
c. HEXADECIMALTO BINARY

ALGORITHM:

1. Start the program


2. Move the content of memory to accumulator
3. Move data 0B o register B
4. Increment the content of HL register pair
5. Rotate the accumulator right
6. Jump to the specified address if carry generated
7. Move 00 to memory
8. Jump to specified address if there is no zero
9. Move 01 to memory
10. Jump to specified address if there is no zero
11. End the program
PROGRAM: HEXA DECIMAL TO BINARY

ADDRE OPCO LABEL MNEM OPERAND COMMENTS


SS DE ONICS
4100 21 LXI H,4200 Load address in HL pair
4101 00
4102 42
4103 7E MOV A,M Move content of M to A
4104 06 MVI B, 08 Move 0B to register pair
4105 08
4106 23 L3 INX H Increment the content of
HL pair
4107 0F RRC Rotate accumulator right
4108 DA JC L1 Jump to specified address
if carry
4109 10
410A 41
410B 36 MVI M, 00 Move 00 to M
410C 00
410D C3 JMP L2 Decrement B register
410E 12
411F 41
4110 36 L1 MVI M, 01 Move 01 to M
4111 01
4112 05 L2 DCR B Decrement B by 1
4113 C2 JNZ L3 Jump to the specified
address if no zero
4114 06
4115 41
4116 76 HLT Stop the program
d. BCDTO HEXADECIMAL
ALGORITHM:

1. Start the Program


2. Load the address in HL pair
3. Move the content of M to C Reg
4. AMove the content of M Reg to Accumulator
5. Extract Lower nibble of A Reg& copy to E Reg
6. Copy Value of C Reg to A Reg
7. Move Values of Higher nibble to Lower nibble
8. Copy Value of A Reg to D Reg
9. Clear A Reg
10. ADD 0A with ‘D’ no of times
11. 4300 A (o/p- Hexadecimal)
12. A=A+E
13. Stop
PROGRAM: BCD TO HEXA DECIMAL

ADDRE OPCO LABEL MNEM OPERAND COMMENTS


SS DE ONICS
4100 21 LXI H, 4200 Load address in HL pair
4101 00
4102 42
4103 4E MOV C,M Move content of M to C
4104 79 MOV A,C Move content of C to A
4105 E6 ANI 0F And the data byte of
OFHwith the content of
aaccumulator
4106 0F
4107 5F MOV E,A Move content of A to E
4108 79 MOV A,C Add B content with A
4109 E6 ANI F0 And the data byte
FOHwith the content of
410A F0
410B 0F RRC Rotate right through
carry the accumulator
410C 0F RRC Rotate right through
carry the accumulator
410D 0F RRC Rotate right through
carry the accumulator
410E 0F RRC Rotate right through
carry the accumulator
410F 57 MOV D,A Move content of D to A
4110 3E MVI A,00 Move immediate
00Hto the
accumulator

4111 00
4112 C6 L1 ADI 0A Add immediate data
OAHto the accumulator
4113 0A
4114 15 DCR D Decrement the D
register
4115 C2 JNZ L1 Jump if no zero to
4112H
4116 12
4117 41
4118 83 ADD E Add the content of E
register to Accumulator
4119 32 STA 4300 Store the accumulator
411A 00 content at 4300h
411B 43
411C 76 HLT Halt the execution
e. HEXADECIMALTO DECIMAL

ALGORITHM:

1. Start the program


2. Load the address in HL pair
3. Move the content from HL to A
4. Subtract 64 from A
5. Increment BC pair
6. Jump to address 4207
7. Subtract 0A from A
8. Increment HL pair
9. Rotate accumulator left
10. Increment HL pair
11. End the program
PROGRAM: HEXADECIMAL TO DECIMAL

ADDRE OPCODE LABEL MNEM OPER COMMENTS


SS ONICS AND
4100 21 LXI H, 4150 Load data from 4150 to HL pair
4101 50
4102 41
4103 01 LXI B, 0000 Load data from address to BC
4104 00
4105 00
4106 7E MOV A, M Move the content from HL to A
4107 06 L4 SUI 64 Subtract 64 from A
4108 64
4109 DA JC L1 Stop if A has carry
410A 10
410B 41
410C 04 INR B Increment BC
410D C3 JMP L4 Jump to specified address
410E 07
410F 41
4110 C6 L1 ADI 64 Add 64 to A
4111 64
4112 D6 L3 SUI 0A Subtract 0A from A
4113 0A
4114 DA JC L2 Stop if A has carry
4115 1B
4116 41
4117 0C INR C Increment HL
4118 C3 JMP L3 Stop if A has no carry
4119 12
411A 41
411B C6 L2 ADI 0A Add 0A to A
411C 0A
411D 23 INX H Increment HL
411E 70 MOV M, B Move B to M
411F 47 MOV B, A Move A to B
4120 79 MOV A, C Move B to A
4121 07 RLC Rotate accumulator
4122 07 RLC Rotate accumulator
4123 07 RLC Rotate accumulator
4124 07 RLC Rotate accumulator
4125 80 ADD B Add B to A
4126 23 INX H Increment H by 1
4127 77 MOV M, A Move content of A to M
4128 76 HLT Stop the program
OBSERVATION:

a. ASCII TO HEXADECIMAL

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200 42 4300 0B
4200 35 4300 05

b. HEXADECIMAL TO ASCII

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4200 06 4300 36
4200 0C 4300 43

c. HEXADECIMAL TO BINARY
INPUT OUTPUT
MEMORY DATA MEMORY DATA MEMORY DATA
LOCATION LOCATION LOCATION
A9 4201 01 4205 00
4200 4202 00 4206 01
4203 00 4207 00
4204 01 4208 01

d. BCD TO HEXADECIMAL

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
1D
4200 29 4300

e. HEXADECIMAL TO DECIMAL

INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
4150 21 4151 00
4152 33
RESULT

.
EX.No:5 INTERFACINGA/DANDD/ACONVERTERWITH8085

A IM:

a. ADCINTERFACINGWITH 8085

APPARATUS REQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY


1 Microprocessor kit 8085,Vi Microsystems 1
2 Power supply +5 V dc 1
3 ADC Interface board Vi Microsystems 1

PROBLEM STATEMENT:

To program starts from memory location 4100H. The program is executed for various values
of analog voltage which are set with the help of a potentiometer. The LED display is verified with the
digital value that is stored in the memory location 4150H.

THEORY:
An ADC usually has two additional control lines: the SOC input to tell the ADC when to
start the conversion and the EOC output to announce when the conversion is complete. The following
program initiates the conversion process, checks the EOC pin of ADC 0419 as to whether the
conversion is over and then inputs the data to the processor. It also instructs the processor to store the
converted digital data at RAM 4200H.

ALGORITHM:
1. Select the channel and latch the address.
2. Send the start conversion pulse.
3. Read EOC signal.
4. If EOC =1 continue else go to step (3)
5. Read the digital output.
6. Store it in a memory location.
PROGRAM: ADC INTERFACE WITH 8085
ADDRESS OPCODE LABEL MNEMON ICS OPERA COMMENTS
ND
4100 3E MVI A, 10 Select channel 0 and to
make accumulator low
4101 10
4102 D3 OUT C8 Output the data
4103 C8
4104 3E MVI A, 18 Make accumulator high
4105 18
4106 D3 OUT C8 Display the data
4107 C8
4108 3E MVI A, 01 Make 01 to accumulator
4109 01
410A D3 OUT D0 Display the data
410B D0
410C 00 NOP
410D 00 NOP
410E 00 NOP
410F 3E MVI A, 00 Make 00 to accumulator
4110 00
4111 D3 OUT D0 Load D0 in output port
4112 D0
4113 DB LOOP IN D8
4114 D8
4115 E6 ANI 01 Do and operation directly
4116 01
4117 FE CPI 01 Compare with accumulator
4118 01
4119 C2 JNZ LOOP Jump to specified address
411A 13
411B 41
411C DB IN C0
411D C0
411E 32 STA 4150 Store the data
411F 50
4120 41
4121 76 HLT End the program

OBSERVATION

ANALOG VOLTAGE DIGITAL DATA ON HEX CODE IN


LED DISPLAY LOCATION 4150
3.45 1011 1001 B9
4.69 1111 1101 FD
2.21 0111 0111 77
ADC-CIRCUIT:

SOCJUMPERSELECTION:

J2: SOC Jumper selection


J5: Channel selection
b. DAC INTERFACING WITH 8085

APPARATUSREQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY


1 Microprocessor kit 8085,Vi Microsystems 1
2 Power supply +5 V dc 1
3 DAC Interface board Vi Microsystems 1

SOFTWAREEXAMPLES

The following examples illustrate how to control the DAC using 8085 and generate sine
wave, saw tooth wave by means of software.

(a) SQUAREWAVE GENERATION:

The basic idea behind the generation of waveforms is the continuous generation of
Analog output of DAC. With 00(HEX) as input to DAC2, the analog output is -5V.
Similarly, with FF (Hex) as input, the output is +5V. Outputting digital data 00 and FF at
regular intervals, to DAC2, results in a square wave of amplitude I5 Volts

ALGORITHM:
1. Load the initial value (00) to Accumulator and move it to DAC.
2. Call the delay program
3. Load the final value (FF) to accumulator and move it to DAC.
4. Call the delay program.
5. Repeat steps 2 to 5.
PROGRAM: SQUARE WAVE FORM

ADDRESS OPCO LABEL MNEMON ICS OPERAND COMMENT


DE
4100 3E START MVI A, 00 Move 00 to A register
4101 00
4102 D3 OUT C8 Load C8 to output port
4103 C8
4104 CD CALL DELAY Call delay program
4105 11
4106 41
4107 3E MVI A, FF Load FF to B register
4108 FF
4109 D3 OUT C8
410A C8
410B CD CALL DELAY
410C 11
410D 41
410E C3 JMP START START Jump to start of address
410F 00
4110 41
4111 06 DELAY MVI B, 05 Move 05 to B register
4112 05
4113 OE L1 MVI C, FF Move FF to C register
4114 FF
4115 0D L2 DCR C Decrement C
4116 C2 JNZ L2 Jump to L2 if no zero
4117 15
4118 41
4119 05 DCR B Decrement B register
411A C2 JNZ L1 Jump to L1 if no zero
411B 13
411C 41
411D C9 RET

Execute the program and using a CRO, verify that the waveform at the DAC2 output is a
square-wave. Modify the frequency of the square-wave, by varying the time delay.
(b) SAWTOOTH GENERATION:

ALGORITHM:
1. Load the initial value (00) to Accumulator
2. Move the accumulator content to DAC.
3. Increment the accumulator content by 1.
4. Repeat steps 3 and 4.
Output digital data from 00 to FF constant steps of 01 to DAC1 repeat this sequence again and
again. As a result a saw – tooth wave will be generated at DAC1 output.
PROGRAM: SAW TOOTH WAVE FORM

ADDRESS OPCO LABEL MNEMON OPERAND COMMENT


4100 3E
DE START MVI
ICS A, 00 Load 00 to
4101 00 accumulator
4102 D3 L1 OUT C0 Load CO in output
4103 C0 port
4104 3C INR A Increment A
4105 C2 JNZ L1 register
Jump to L1 if no
4106 02 zero
4107 41
4108 C3 JMP START Go to START
4109 00 unconditionally
410A 41
(c) TRIANGULARWAVE GENERATION:

ALGORITHM:

1. Load the initial value (00) to Accumulator.


2. Move the accumulator content to DAC
3. Increment the accumulator content by 1.
4. If accumulator content is zero proceed to next step. Else go to step 3.
5. Load value (FF) to accumulator.
6. Move the accumulator content to DAC.
7. Decrement the accumulator content by 1.
8. If accumulator content is zero go to step 2. Else go to step 2.
The following program will generate a triangular wave at DAC2 output.

PROGRAM: TRIANGULAR WAVE FORM

ADDRESS OPCOD LABE MNEMON ICS OPERA COMMENT


E L ND
4100 2E START MVI L, 00 Move 00 to L register
4101 00
4102 7D L1 MOV A, L Load L to a register
4103 D3 OUT C8 Load c8 to output port
4104 C8
4105 2C INR L Increment L register
4106 C2 JNZ L1 Jump to L1 if no zero
4107 02
4108 41
4109 2E MVI L, FF Load FF to L register
410A FF
410B 7D L2 MOV A, L Move L to a register
410C D3 OUT C8 Load C8 to output port
410D C8
410E 2D DCR L Decrement L register
410F C2 JNZ L2 Jump to L2 if no zero
4110 0B
4111 41
4112 C3 JMP START Go to START unconditionally
4113 00
4114 41
DAC-CIRCUIT:

WAEFORMS:

OBSERVATION:

WAVE FORMS AMPLITUDE TIME PERIOD


Square waveform 1.6 X 5 = 8V 2.6 X 5 =13
Saw tooth waveform 1.6 X 5 = 8V 1.8 X 5 = 9
Triangular waveform 1.6 X 5 = 8V 4X2=8
Result:
EX.No:6 TRAFFICLIGHTCONTROLLERWITH 8085

AIM

APPARATUSREQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY


1 Microprocessor kit 4185,Vi Microsystems 1
2 Power supply +5 V dc 1
3 Traffic light interface kit Vi Microsystems 1

ALGORITHM:
1. Initialize the ports.
2. Initialize the memory content, with some address to the data.
3. Read data for each sequence from the memory and display it through the ports.
4. After completing all the sequences, repeat from step2.

ASAMPLESEQUENCE:
1. (a) Vehicles from south can go to straight or left.
(b) Vehicles from west can cross the road
(c) Each pedestrian can cross the road.
(d) Vehicles from east no movement.
(e) Vehicles from north can go only straight.
2. All ambers are ON, indicating the change of sequence.
3. (a) Vehicles from east can go straight and left.
(b) Vehicles from south can go only left.
(c) North pedestrian can cross the road.
(d) Vehicles from north, no movement.
(e) Vehicles from west can go only straight.
4. All ambers are ON, indicating the change of sequence.
5. (a) Vehicles from north can go straight and left.
(b) Vehicles from east can go only left.
(c) West pedestrian can cross the road.
(d) Vehicles from west, no movement.
(e) Vehicles from south can go only straig6. All ambers are ON, indicating the
change of sequence.
7. (a) Vehicles from west can go straight and left.
(b) Vehicles from north can go only left.
(c) South pedestrian can cross the road.
(d) Vehicles from south, no movement.
(e) Vehicles from east can go only straight.
8. All ambers are ON, indicating the change of sequence.
9. (a) All vehicles from all directions no movement.
(b) All pedestrian can cross the road.
BITALLOCATION:

BIT LED BIT LED BIT LED

PA0 SOUTH LEFT PB0 NORTH LEFT PC0 WEST STRAIGHT


PA1 SOUTH RIGHT PB1 NORTH RIGHT PC1 NORTH STRAIGHT
PA2 SOUTH AMBER PB2 NORTH AMBER PC2 EAST STRAIGHT
PA3 SOUTH RED PB3 NORTH RED PC3 SOUTH STRAIGHT
PA4 EAST LEFT PB4 WEST LEFT PC4 NORTH PD
PA5 EAST RIGHT PB5 WEST RIGHT PC5 WEST PD
PA6 EAST AMBER PB6 WEST AMBER PC6 SOUTH PD
PA7 EAST RED PB7 WEST RED PC7 EAST PD

PATHREPRESENTATION:

CONTROL------0F(FOR 8255 PPI)


PORT A-----0C
PORT B----------0D
PORT C----------0E
PROGRAM:

ADD OPCODE LABEL MNEMON OPERAND COMMENT


RESS ICS
4100 21, 00, 45 START LXI H,DATA Initialize HL reg.to Data
4103 0E, 04 MVI C,04 Initialize C reg with no of
comparisons
4105 7E MOV A,M Move M content to
accumulator
4106 D3, 0F OUT CNT Load address 417B to HL
register
4108 23 INX H Increment H register
4109 7E LOOP 1: MOV A,M Move M content to
accumulator
410A D3, 0C OUT APRT Output contents of
accumulator to OF port
410C 23 INX H Increment H register
410D 7E MOV A,M Move M content to
accumulator
410E D3, 0D OUT BPRT Move M content to
accumulator
4110 CD, 1B, 41 CALL DELAY Call DELAY address
4113 23 INX H Increment H register
4114 0D DCR C Decrement C register
4115 C2, 09, 41 JNZ LOOP 1 Jump to LOOP 1 if no zero
4118 C3, 00, 41 JMP START Jump to start
411B C5 DELAY: PUSH B Push the register B
411C 0E, 05 MVI C,05 Move 05 H immediately to
accumulator.
411E 11, FF, FF LOOP3: LXI D,FFFF Load FF FF in DE register
pair
4121 1B LOOP2 DCX D Decrement D register
4122 7A MOV A,D Move D content to
accumulator
4123 B3 ORA E OR content of E with
accumulator
4124 C2,21,41 JNZ LOOP2 Jump To L2 IF no zero
4127 0D DCR C Decrement C register
4128 C2, 1E, 41 JNZ LOOP3 Jump to LOOP 2 if no zero
412B C1 POP B POP the register B
412C C9 RET Return to subroutine
4500 80,1A, A1, 64 DATA 80, 1A, A1,
4504 A4, 81, 5A, 64 64
A4,81,5A,64
4508 54, 8A, B1, A8 54,8A,B1,A8
450C B4, 88, DA, 68 B4,88,DA,68
4510 D8, 1A, E8, 46 D8,1A,E8,46
4514 E8, 83, 78, 86 E8,83,78,86,
74 74
RESULT:
EX.No:7 INTERFACING 8251 WITH 8085
AIM:

APPARATUSREQUIRED:

1. 8085 Microprocessor kit


2. 8251 Interface board
3. DC regulated power supply.
THEORY:

The 8251 is used as a peripheral device for serial communication and is


programmed by the CPU to operate using virtually any serial data transmission technique.
The USART accepts data characters from the CPU in parallel format and the converts them
in a continuous serial data stream of transmission. Simultaneously, it can receive serial data
streams and convert them into parallel data characters for the CPU. The CPU can read the
status of USART at any time. These include data transmissions errors and control signals.

Prior to starting data transmission or reception, the 8251 must be loaded with a
set of control words generated by the CPU.These control signals define the complete
functional definition of the 8251 and must immediately follow a RESET operation. Control
words should be written in to the control register of 8251. Words should be written in to the
control register of 8251.words should be written in to the control register of
8251.Thesecontrol words are split into two formats.
1. MODE INSTRUCTION WORD
2. COMMAND INSTRUCTION WORD.

1. MODEINSTRUCTIONWORD

This format defines the BAUD rate, character length, parity and stop bits required to
work with asynchronous data communication. By selecting the appropriate BAUD
factor synchronous mode, the 8251 can be operated in synchronous mode.

Initializing 8251 using the Mode instructions to the following conditions.

8 bit data
No parity
Baud rate factor (16X)
1 stop bit
Gives a mode command word of 01001110=4E(X)
PROGRAM:

ADDRESS OPCODE L MNEMON OPERAND COMMENT


A ICS
BE
L
4100 3E,36 MVI A, 36 Move 36 to A
4102 D3, CE OUT CE Output contents of accumulator to
CE port
4104 3E,0A MVI A, 0A Move 0A to accumulator
4106 D3,C8 OUT C8 Output contents of accumulator to
C8 port
4108 3E,00 MVI A, 00 Move 00 to accumulator
410A D3,C8 OUT C8 Output contents of accumulator to
C8 port
410C 3E,4E MVI A, 4E Move 4E to accumulator
410E D3,C2 OUT C2 Output contents of accumulator to
C2 port
4110 3E,37 MVI A, 37 Move 37 to accumulator
4112 D3,C2 OUT C2 Output contents of accumulator to
C2 port
4114 3E,41 MVI A, 41 Move 41 to accumulator
4116 D3,C0 OUT C0 Output contents of accumulator to
C0 port
4118 CF RST1
4119 DB,00 IN C0 Input the contents from port C0 to
accumulator
411B 32,50,41 STA 4150 Store the output from accumulator
to 4150
411E CF RST1
OBSERVATION:

MEMORY LOCATION INPUT DATA OUTPUT DATA


4150 41 41
RESULT:
.
Ex No. 8 INTERFACING 8279WITH8085

AIM:

APPARATUS REQUIRED:

1.8085 Microprocessor toolkit.


2. 8279 Interface board
3. Regulated D.C. power supply.
PROGRAM:
a) Rolling Display

ADDRESS OPCODE LABEL MNEMON OPERAN COMMENT


ICS D

4100 21,30,41 START LXI H, 4130 Store the 16 bit address in


HL pair
4103 16,0F MVI D, 0F Move 0F to D register
4105 3E,10 MVI A, 10 Move 10 to A
4107 D3 C2 OUT C2 Output the contents of A to
C2 output port
4109 3E,CC MVI A, CC Move CC to A
410B D3,C2 OUT C2 Output the contents of A to
C2 output port
410D 3E,90 MVI A, 90 Move 90 to A
410F D3,C2 OUT C2 Output the contents of A to
C2 output port
4111 7E LOOP MOV A, M Move content of M to A
4112 D3,C0 OUT C0 Output the contents of M to A
4114 CD,1F,41 CALL DELAY Call the delay address
4117 23 INX H Increment H register
4118 15 DCR D Decrement D register
4119 C2,11,41 JNZ LOOP Jump to specified address
411C C3,00,41 JMP START START Jump to START address
411F 06,A0 DELAY MVI B, A0 Move a to B register
4121 0E,FF LOOP2 MVI C, FF Move FF to C register
4123 0D LOOP1 DCR C Decrement C register
4124 C2,23,41 JNZ LOOP 1 Jump to LOOP 1 if no zero
4127 05 DCR B Decrement B register
4128 C2,21,41 JNZ LOOP 2 Jump to LOOP 2 if no zero
412B C9 RET
Pointer equal to 4130 .FF repeated eight times

4130 FF
4131 FF
4132 FF
4133 FF
4134 FF
4135 FF
4136 FF
4137 FF
4138 98
4139 68
413ª 7C
413B C8
413C 1C
413D 29
413E FF
413F FF
SEGMENTDEFINITION:

DATA BUS D7 D6 D5 D4 D3 D2 D1 D0
SEGMETS d c b a dp G f e

OBSERVATION:

LETTER 7 DATA BUS


SEGMENT HEXADECIMAL
D7 D6 D5 D4 D3 D2 D1 D0

H fegbc 1 0 0 1 1 0 0 0 98
E fegad 0 1 1 0 1 0 0 0 68
L fed 0 1 1 1 1 1 0 0 7C
P fegab 1 1 0 0 1 0 0 0 C8
U fedbc 0 0 0 1 1 1 0 0 1C
S fgacd 0 0 1 0 1 0 0 1 29
b) Accept a Key and display the same (Two key lock out)

ADDRESS OPCO LABEL MNEMON ICS OPERAN COMMENT


DE D

4100 06,08 MVI B, 08


4102 3E,00 MVI A, 00
4104 D3,C2 OUT C2 Set mode and display
4106 3E,CC MVI A, 0CC Clear Display
4108 D3,C2 OUT C2
410A 3E,90 MVI A, 90 Write display
410C D3,C2 OUT C2
410E 3E,FF MVI A, 0FF
4110 D3,C0 BACK OUT C0 Clear the display ram
4112 05 DCR B
4113 C2,10,4 JNZ BACK
1
4116 DB,C2 LOP IN C2 Pressing of a key
4118 E6,07 ANI 07
411A CA,16,4 JZ LOP
1
411D 3E,40 MVI A, 40 Set to read FIFO ram
411F D3,C2 OUT C2
4121 DB,C0 IN C0
4123 E6,0F ANI 0F get the corresponding code
from lookup table
4125 6F MOV L, A
4126 26,42 MVI H, 42
4128 7E MOV A,M
4129 D3,C0 OUT C0
412B C3,16,4 JMP LOP
1
4200 0C 9F 4A 0B
4204 99 29 28 8F
4208 08 09 88 38
420C 6C 1A 68 E8

81
c) Accept a Key and display the same( N Key rollover)
ADDRESS OPCO LABEL MNEMON ICS OPERAN COMMENT
DE D

4100 06,08 MVI B, 08


4102 3E,02 MVI A, 02
4104 D3,C2 OUT C2 Set mode and display
4106 3E,CC MVI A, 0CC Clear Display
4108 D3,C2 OUT C2
410A 3E,90 MVI A, 90 Write display
410C D3,C2 OUT C2
410E 3E,FF MVI A, 0FF
4110 D3,C0 BACK OUT C0 Clear the display ram
4112 05 DCR B
4113 C2,10,4 JNZ BACK
1
4116 DB,C2 LOP IN C2 Pressing of a key
4118 E6,07 ANI 07
411A CA,16,4 JZ LOP
1
411D 3E,40 MVI A, 40 Set to read FIFO ram
411F D3,C2 OUT C2
4121 DB,C0 IN C0
4123 E6,0F ANI 0F get the corresponding code
from lookup table
4125 6F MOV L, A
4126 26,42 MVI H, 42
4128 7E MOV A,M
4129 D3,C0 OUT C0
412B C3,16,4 JMP LOP
1
4200 0C 9F 4A 0B
4204 99 29 28 8F
4208 08 09 88 38
420C 6C 1A 68 E8
RESULT:
MICROCONTROLLER
Ex. No: 9 8051–BASICSIMPLEPROGRAM

AIM:

a. ADDITIONOFTWO8BIT NUMBERS

Algorithm:

1. Set DPTR as pointer for data.


2. Move first data from external memory to accumulator and save it in R1 register.
3. Increment DPTR.
4. Move second data from external memory to accumulator
5. Clear R0 register to account for carry.
6. Add the content of R1 register to accumulator.
7. Check for carry. If carry is not set go to step 8. Otherwise go to next step.
8. Increment R0 register.
9. Increment DPTR and save the sum in external memory.
10. Increment DPTR, move carry to accumulator and save it in external memory.
11. Stop
PROGRAM- 8BIT ADDITION USING 8031
Label Program Comments
MOV DPTR,#4500 Load address of 1st data in DPTR
MOVX A,@DPTR Move the 1st data to A
MOV R1,A Save the first data in R1
INC DPTR Increment DPTR to point 2nd data
MOVX A,@DPTR Load the 2nd data in A
MOV R0,#00 Clear R0 for the account of carry
ADD A,R1 Get the sum in A reg
JNC AHEAD Check carry flag
INC R0 If carry is set increment R0
AHEAD: INC DPTR Increment DPTR
MOVX @DPTR, A Save the sum in external memory
INC DPTR Increment DPTR
MOV A,R0 Move carry to A reg
MOVX @DPTR, A Save the carry in external memory
HERE: SJMP HERE Remain idle in infinite loop

Observation:

Input:

4500: 05 [Addend]
4501: 06 [Augend]

Output:

4502: 0B [Sum]
4503: 00 [Carry]
b. SUBTRACTIONOFTWO8BIT NUMBERS

Algorithm:

1. Set DPTR as pointer for data.


2. Move the minuend from external memory to accumulator and save it in R1 register.
3. Increment DPTR.
4. Move subtrahend from external memory to accumulator
5. Exchange the contents of R1 and A such that minuend is in A and subtrahend is in
R1
6. Clear R0 register to account for sign.
7. Clear carry flag.
8. Subtract the content of R1 register from accumulator.
9. Check for carry. If carry is not set go to step 12. Otherwise go to next step.
10. Complement the content of A – reg and increment by 1 to get 2’s complement of
result in A – reg
11. Increment R0 register.
12. Increment DPTR and save the result in external memory.
13. Increment DPTR, move R0 (sign bit) to accumulator and then save it in external
memory.
14. Stop
P

Label Program Comments


MOV DPTR,#4500 Load address of minuend in DPTR
MOVX A,@DPTR Move the minuend to A
MOV R1,A Save the minuend in R1
INC DPTR Increment DPTR to point subtrahend
MOVX A,@DPTR Load the subtrahend in A
XCH A,R1 Get minuend in A and Subtrahend in R1
MOV R0,#00 Clear R0 for the account of Sign
CLR C Clear carry
SUBB A,R1 Subtract R1 from A
JNC AHEAD Check Carry flag. If carry is set then
CPL A Get 2’s complement of result in A
INC A
INC R0 Set R0 to indicate negative sign
AHEAD: INC DPTR Increment DPTR
MOVX @DPTR,A Save the result in external memory
INC DPTR Increment DPTR
MOV A,R0 Move sign bit to A reg
MOVX @DPTR,A Save the sign in external memory
HERE: SJMP HERE Remain idle in infinite loop

Observation:
Input:
4500: 09 [Minuend]
4501: 04 [Subtrahend]
Output:
4502: 05 [Difference]
4503: 00 [Sign Bit]
C.MULTIPLICATION OF TWO 8 BIT NUMBERS
Algorithm:

1. Load address of data in DPTR


2. Move the first data from external memory to A and save in B.
3. Increment DPTR and move second data from external memory to B.
4. Perform multiplication to get the product in A and B.
5. Increment DPTR and save A ( lower byte of product) in memory
6. Increment DPTR , move B ( lower byte of product) to A and save it in memory
7. Stop
Label Program Comments
MOV DPTR,#4500 Load address of 1st data in DPTR
MOVX A,@DPTR Move the 1st data to A
MOV B,A Save the 1st data in B
INC DPTR Increment DPTR to point 2nd data
MOVX A,@DPTR Load the 2nd data in A
MUL AB Get the product in A and B
INC DPTR Increment DPTR
MOVX @DPTR,A Save the lower byte of result in external memory
INC DPTR Increment DPTR
MOV A,B Move the higher byte of product to A reg
MOVX @DPTR,A Save it in external memory
HERE: SJMP HERE Remain idle in infinite loop

Observation:

Input:

4500: 22 [1st data]


4501: 43 [2nd data]

Output:

4502: E6 [Lower byte of product]


4503: 08 [Higher byte of product]
d. DIVISIONOFTWO8BIT NUMBERS

Algorithm:

1. Load address of data in DPTR


2. Move the dividend from external memory to A and save it in R0 register.
3. Increment DPTR and move the divisor from external memory to A and save it in B
reg.
4. Move the dividend from R0 to A.
5. Perform division to get quotient in A and remainder in B.
6. Increment DPTR and save quotient (content of A - reg) in memory
7. Increment DPTR.
8. Move the remainder (Content of B – reg) to A and save in memory.
9. Stop
Label Program Comments
MOV DPTR,#4500 Load address of dividend in DPTR
MOVX A,@DPTR Move the dividend to A
MOV R0,A Save the dividend in R0
INC DPTR Increment DPTR to point divisor
MOVX A,@DPTR Load the divisor in A
MOV B,A Move the divisor to B
MOV A,R0 Move the dividend to A
DIV AB Divide the content of A by B
INC DPTR Increment DPTR
MOVX @DPTR,A Save the quotient in external memory
INC DPTR Increment DPTR
MOV A,B Move the remainder to A reg
MOVX @DPTR,A Save it in external memory
HERE: SJMP HERE Remain idle in infinite loop

Observation:

Input:

4500: 99 [Dividend]
4501: 12 [Divisor]

Output:

4502: 08 [Quotient]
4503: 09 [Remainder]
Result:
Ex. No. 10 A)SUMOFELEMENTSINANARRAY

AIM:

ALGORITHM:
1. Load the array in the consecutive memory location and initialize the
memory pointer with the starting address.
2. Load the total number of elements in a separate register as a counter.
3. Clear the accumulator.
4. Load the other register with the value of the memory pointer.
5. Add the register with the accumulator.
6. Check for carry, if exist, increment the carry register by 1. otherwise,
continue
7. Decrement the counter and if it reaches 0, stop. Otherwise increment the
memory pointer by 1 and go to step 4.

97
PROGRAM:
Label Program Comments
MOV DPTR, #4200 Load 4200 to DPTR, get array size
MOVX A, @DPTR Copy array size value to A
MOVR0, A Move contents of A to R0
MOV B, #00
MOVR1, B
CLR C Clear B, R1 & Carry Flag
AGAIN INCDPTR Get value from datapointer
MOVX A, @DPTR
ADD A, B Sum of two numbers
MOV B, A
JNC NC If no carry jump to NC
INC R1 Else increment R1
NC DJNZ R0,AGAIN Decrement size of array, if not zero fetch data from
DPTR and add to the resultant value
MOV DPTR, #4500 Store the result in 4500 memory locations
MOV A, B
MOVX @DPTR, A
INC DPTR
MOV A, R1
MOVX @DPTR, A
HERE SJMP HERE

OBSERVATION:
INPUT OUTPUT
4200(Array Size) 05 4500
60
4201 15
4202 20 00
4501
4203 1A
4204 09
4205 08
RESULT:
Exp. No 11 8051–CheckOddorEvenusingCallOption
AIM:

ALGORITHM:
1. Start
2. Move the data to DPTR
3. Move the data to accumulator
4. Call check function whether given number is odd or even
5. Increment DPTR
6. Resultant value stored in DPTR-4201
7. Halt
Check Function
8. Rotate right through carry
9. If carry copy 00 to B reg (odd number)
10. Else copy EE to B reg (even number)
11. return
PROGRAM:
Label Program Comments
MOV DPTR, #4200 Load 4200 to DPTR, get a number
MOVX A, @DPTR Copy value to A
ACALL CHECK_EV_OD Call check function whether given number is
odd or even
INC DPTR
MOV A,B
MOVX @DPTR, A Resultant value stored in DPTR-4201
HERE SJMP HERE

CHECK_EV_OD RRC A Rotate right through carry


JC L1 If carry copy 00 to B reg (odd number)
MOV B,#0EEH Else copy EE to B reg (even number)
SJMP LAST
L1 MOV B,#00H
LAST RET

OBSERVATION:

INPUT OUTPUT
4200 20 4201 EE
RESULT:
Ex. No: 12 INTERFACINGA/D&D/ACONVERTERWITH8051

AIM

a. ADCINTERFACINGWITH 8051

APPARATUS REQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY


1 Microcontroller kit 8051,Vi Microsystems 1
2 Power supply +5 V dc 1
3 ADC Interface board Vi Microsystems 1

PROBLEM STATEMENT:

To program starts from memory location 4100H. The program is executed for various
values of analog voltage which are set with the help of a potentiometer. The LED display is
verified with the digital value that is stored in the memory location 4150H.

THEORY:

An ADC usually has two additional control lines: the SOC input to tell the ADC when
to start the conversion and the EOC output to announce when the conversion is complete. The
following program initiates the conversion process, checks the EOC pin of ADC 0419 as to
whether the conversion is over and then inputs the data to the processor. It also instructs the
processor to store the converted digital data at RAM 4200H.
ALGORITHM:

1. Select the channel and latch the address.


2. Send the start conversion pulse.
3. Read EOC signal.
4. If EOC =1 continue else go to step (3)
5. Read the digital output.
6. Store it in a memory location.
PROGRAM:

Label Program Comments


MOV DPTR, #FFC8
MOV A,#10 Select Channel 0 and make ALE Low
MOVX @DPTR, A
MOV A,#18 make ALE High
MOVX @DPTR, A
MOV DPTR, #FFD0
MOV A,#01 SOC signal High
MOVX @DPTR, A
MOV A,#00 SOC signal low
MOVX @DPTR, A
MOV DPTR,
WAIT #FFD8 MOVX
A,@DPTR JNB Check for EOC
E0,WAIT MOV Read ADC data
DPTR,#FFC0
MOVX A,@DPTR Store the data in memory location
MOV DPTR,#4150
HERE MOVX @DPTR, A
SJMP HERE

OBSERVATION

ANALOG VOLTAGE DIGITAL DATA ON HEX CODE IN


LED DISPLAY LOCATION 4150
3.45 1011 1001 B9
4.69 1111 1101 FD
2.21 0111 0111 77
ADC-CIRCUIT:

SOCJUMPERSELECTION:

J2: SOC Jumper selection


J5: Channel selection
(b) INTERFACINGD/ACONVERTERWITH8051

APPARATUS REQUIRED:

SL.NO ITEM SPECIFICATION QUANTITY


1 Microprocessor kit 4185,Vi Microsystems 1
2 Power supply +5 V dc 1
3 DAC Interface board Vi Microsystems 1

THEORY:

SOFTWAREEXAMPLES

After going through the software examples you can learn how to control the
DAC using 8051 and generate sine wave, saw tooth wave etc by means of software.

ALGORITHM:

(a) SQUARE WAVE GENERATION:


1. Load the initial value (00) to Accumulator and move it to DAC.
2. Call the delay program
3. Load the final value (FF) to accumulator and move it to DAC.
4. Call the delay program.
5. Repeat steps 2 to 5.

DAC-CIRCUIT:
WAVEFORMS:

OBSERVATION:

WAVE FORMS AMPLITUDE TIME PERIOD


Square waveform 4.7V 1.8ms
Saw tooth waveform 4.5V 2 ms
Triangular waveform 4.8 V 2 ms
(b) SQUARE WAVE GENERATION

The basic idea behind the generation of waveforms is the continuous generation of
Analog output of DAC.
With 00(HEX) as input to DAC2, the analog output is -5V. Similarly, with FF (Hex) as
input, the output is +5V. Outputting digital data 00 and FF at regular intervals, to DAC2,
results in a square wave of amplitude I5 Volts.

PROGRAM:

DDRESS LABEL MNEMON ICS COMMENT


MOV DPTR,#FFC8
START MOV A,#00
MOVX @DPTR,A
LCALL DELAY
MOV A,# FF
MOVX @DPTR,A
LCALL DELAY
LJMP START
DELAY MOV R1,#05
LOO[P MOV R2,#FF
DJNZ R2,HERE
DJNZ R1,LOOP
RET
SJMP START

Execute the program and using a CRO, verify that the waveform at the DAC2 output is
a square-wave. Modify the frequency of the square-wave, by varying the time delay.
(b) SAWTOOTH GENERATION
1. Load the initial value (00) to Accumulator
2. Move the accumulator content to DAC.
3. Increment the accumulator content by 1.
4. Repeat steps 3 and 4.
Output digital data from 00 to FF constant steps of 01 to DAC1 repeat this sequence again and
again. As a result a saw – tooth wave will be generated at DAC1 output.

PROGRAM:

ADDRESS LABEL MNEMON ICS OPCODE


MOV DPTR,#FFC0
MOV A,#00
LOOP MOVX @DPTR,A
INC A
SJMP LOOP
(c) TRIANGULARWAVE GENERATION
1. Load the initial value (00) to Accumulator.
2. Move the accumulator content to DAC
3. Increment the accumulator content by 1.
4. If accumulator content is zero proceed to next step. Else go to step 3.
5. Load value (FF) to accumulator.
6. Move the accumulator content to DAC.
7. Decrement the accumulator content by 1.
8. If accumulator content is zero go to step 2. Else go to step 2.

The following program will generate a triangular wave at DAC2 output. The program is
self explanatory.

ADDRESS LABEL MNEMON ICS COMMENT


MOV DPTR,#FFC8
START MOV A,#00
LOOP1 MOVX @DPTR,A
INC A
JNZ LOOP1
MOV A,#FF
LOOP2 MOVX @DPTR,A
DEC A
JNZ LOOP2
LJMP START
Result:
Ex.No:13 INTERFACING8253TIMERWITH8085

AIM:

To interface 8253 Interface board to 8085 microprocessor to demonstrate the generation of


square wave.

APPARATUSREQUIRED:

1. 8085 microprocessor kit


2. 8253 Interface board
3. DC regulated power supply
4. CRO.

.
PROGRAM:

Address Opcode Label Mnemonic Operands Comments


4100 3E 36 START: MVI A, 36 Channel 0 in mode 3
4102 D3 CE OUT CE Send Mode Control word
4104 3E 0A MVI A, 0A LSB of count
4106 D3 C8 OUT C8 Write count to register
4108 3E 00 MVI A, 00 MSB of count
410A D3 C8 OUT C8 Write count to register
410C 76 HLT

Set the jumper, so that the clock 0 of 8253 is given a square wave of frequency 1.5
MHz. This program divides this PCLK by 10 and thus the output at channel 0 is 150 KHz.

Vary the frequency by varying the count. Here the maximum count is FFFF H. So, the
square wave will remain high for 7FFF H counts and remain low for 7FFF H counts. Thus
with the input clock frequency of 1.5 MHz, which corresponds to a period of 0.067
microseconds, the resulting square wave has an ON time of 0.02184 microseconds and an OFF
time of 0.02184 microseconds.

To increase the time period of square wave, set the jumpers such that CLK2 of 8253 is
connected to OUT 0. Using the above-mentioned program, output a square wave of frequency
150 KHz at channel 0. Now this is the clock to channel 2.
CONTROLWORD:

SC1 SC2 RW1 RW0 M2 M1 M0 BCD

SC-SELECTCOUNTER:

SC1 SC0 SELECT COUNTER


0 0 Select counter 0
0 1 Select counter 1
1 0 Select counter 2

1 1 Read back command

M-MODE:

M2 M1 M0 MODE
0 0 0 Mode 0
0 0 1 Mode 1
X 1 0 Mode 2
X 1 1 Mode 3
1 0 0 Mode 4
1 0 1 Mode 5

READ/WRITE:

RW1 RW0
0 0 Counter latch command
0 1 R/W least significant bit only
1 0 R/W most significant bit only

1 1 R/W least sig first and most sig byte

BCD:

0 Binary counter 16-bit

1 Binary coded decimal counter


Result:
Ex.No:14 STEPPERMOTORINTERFACINGWITH8051

AIM:
To interface a stepper motor with 8051 microcontroller and operate it.

THEORY:
A motor in which the rotor is able to assume only discrete stationary angular position is
a stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium position
to the next. Stepper Motors are used very wisely in position control systems like printers, disk
drives, process control machine tools, etc.
The basic two-phase stepper motor consists of two pairs of stator poles. Each of the
four poles has its own winding. The excitation of any one winding generates a North Pole. A
South Pole gets induced at the diametrically opposite side. The rotor magnetic system has two
end faces. It is a permanent magnet with one face as South Pole and the other as North Pole.
The Stepper Motor windings A1, A2, B1, B2 are cyclically excited with a DC current
to run the motor in clockwise direction. By reversing the phase sequence as A1, B2, A2, B1,
anticlockwise stepping can be obtained.

2-PHASE SWITCHING SCHEME:


In this scheme, any two adjacent stator windings are energized. The switching scheme
is shown in the table given below. This scheme produces more torque.

ANTICLOCKWISE CLOCKWISE
STEP A1 A2 B1 B2 DATA STEP A1 A2 B1 B2 DATA
1 1 0 0 1 9h 1 1 0 1 0 Ah
2 0 1 0 1 5h 2 0 1 1 0 6h
3 0 1 1 0 6h 3 0 1 0 1 5h
4 1 0 1 0 Ah 4 1 0 0 1 9h

ADDRESS DECODING LOGIC:


The 74138 chip is used for generating the address decoding logic to generate the device
select pulses, CS1 & CS2 for selecting the IC 74175.The 74175 latches the data bus to the
stepper motor driving circuitry.
Stepper Motor requires logic signals of relatively high power. Therefore, the interface
circuitry that generates the driving pulses use silicon Darlington pair transistors. The inputs for
the interface circuit are TTL pulses generated under software control using the Microcontroller
Kit. The TTL levels of pulse sequence from the data bus are translated to high voltage output
pulses using a buffer 7407 with open collector.

PROCEDURE:
1. Enter the above program starting from location 4100.and execute the same.
2. The stepper motor rotates.
3. Varying the count at R4 and R5 can vary the speed.
4. Entering the data in the look-up TABLE in the reverse order can vary direction of
rotation.
BLOCKDIAGRAM:

8051
MICROCONTROLLER 8255
DRIVER CIRCUIT STEPPER MOTOR

REPRESENTATION:
PROGRAM :

Label MNEMONICS OPERAND Comments


ORG 4100h

START MOV DPTR, #TABLE Load the start address of switching


scheme data TABLE into Data
Pointer (DPTR)
MOV R0, #04 Load the count in R0
LOOP: MOVX A, @DPTR Load the number in TABLE into A
PUSH DPH Push DPTR value to Stack
PUSH DPL
MOV DPTR, #0FFC0h Load the Motor port address into
DPTR
MOVX @DPTR, A Send the value in A to stepper
Motor port address
MOV R4, #0FFh Delay loop to cause a specific
DELAY: MOV R5, #0FFh amount of time delay before next
DELAY DJNZ R5, DELAY1 data item is sent to the Motor
1:
DJNZ R4, DELAY
POP DPL POP back DPTR value from Stack
POP DPH
INC DPTR Increment DPTR to point to next
item in the table
DJNZ R0, LOOP Decrement R0, if not zero repeat
the loop
SJMP START Short jump to Start of the program
to make the motor rotate
continuously
TABLE: DB 09 05 06 0Ah Values as per two-phase switching
scheme
RESULT:
Ex.No:15 8085ProgrammingPracticeswithSimulators/JubinOpensourceSoftware

Aim

Motivation

Understanding of Intel 8085 microprocessor is fundamental to getting insight into the Von-
Neumann Architecture. It was first introduced in 1976, since then many generations of
computer architecture have come up, some still persists while others are lost in history. This
microprocessor still survives because it is still popular in university and training institutes to
get students acquainted with basic computer architecture. For this purpose 8085 trainer kit are
available on the market.
With this academic learning purpose in mind 8085 simulator software is designed. It helps in
get started easily with example codes, and to learn the architecture playfully. It also provides a
trainer kit as an appealing functional alternative to real hardware. The users can write
assembly code easily and get results quickly without even having the actual hardware.
Jubin 8085 simualor is open source software which is available
at https://8085simulator.codeplex.com/downloads/get/86234
Features
1.Assembler Editor
• Can load Programs written in other simulator
• Auto-correct and auto-indent features
• Supports assembler directives
• Number parameters can be given in binary, decimal and hexadecimal format
• Supports writing of comments
• Supports labeling of instructions, even in macros
• Has error checking facility
• Syntax Highlighting
2.Disassembler Editor
• Supports loading of Intel specific hex file format
• It can successfully reverse trace the original program from the assembly code,
in most of the cases
• Syntax Highlighting and Auto Spacing
3.Assembler Workspace
• Contains the Addressfield, Label, Mnemonics, Hex-code, MnemonicSize, M-Cycles
and T-states
• Static Timing diagram of all instruction sets are supported
• Dynamic Timing diagram during step by step simulation
• It has error checking facility also
4.Memory Editor
• Can directly update data in a specified memory location
• It has 3 types of interface, user can choose from it according to his need.
–Show entire memory content
–Show only loaded memory location
–Store directly to specified memory location
• Allows user to choose memory range
5.I/O Editor
• It is necessary for peripheral interfacing.
• Enables direct editing of content
6.Interrupt Editor
• All possible interrupts are supported. Interrupts are triggered by pressing the
appropriate column (INTR,TRAP,RST7.5,RST6.5,RST5.5) on the interrupt table.
The simulation can be reset any time by pressing the clear memory in the settings
tab.
7.Debugger
• Support of breakpoints
• Step by step execution/debugging of program.
• It supports both forward and backward traversal of programs.
• Allows continuation of program from the
breakpoint. 8.Simulator
• There are 3 level of speed for simulation:
–Step-by-step −→Automatic line by line execution with each line highlighting.
The time to halt at each line is be decided by the user.
–Normal−→Full execution with reflecting intermittent states periodically.
–Ultimate−→Full execution with reflecting final state directly.

119
• There are 2modes of simulator engine:
–Run all at a Time−→It takes the current settings from the simulation speed
level and starts execution accordingly.
-StepbyStep−→It is manual mode of control of FORWARD and BACKWARD
traversal of instruction set. It also displays the in-line comment if available for
currently executed instruction.
• Allows setting of starting address for the simulator.
• Users can choose the mnemonic where program execution should
terminate. 9.Helper
• Help on the mnemonics is integrated.
• CODEWIZARD is a tool added to enable users with very little knowledge of
assembly code could also 8085 assembly programs.
• Already loaded with plenty SAMPLE programs.
• Dynamic loading of user code if placed in user_code folder.
• It also includes a user manual.
10.Printing
• Assembler Content
• Workspace Content
11.Register Bank−→Each register content is accompanied with its equivalent binary value
• Accumulator, RegB, RegC, RegD, RegE, RegH, RegL, Memory(M)
• Flag Register
• Stack Pointer(SP)
• Memory Pointer(HL)
• Program Status Word(PSW)
• Program Counter(PC)
• Clock Cycle Counter
• Instruction Counter\
• Special blocks for monitoring Flag register and the usage of SIM and RIM
instruction.
12.Crash Recovery
• Can recover programs lost due to sudden shutdown or crash of
application. 13.8085 TRAINER KIT

120
• It simulates the kit as if the user is working in the lab. It basically uses the same
simulation engine at the back-end.
14.TOOLS
• Insert DELAY Subroutine TOOL
–It is a powerful wizard to generate delay subroutine with user defined delay
using any sets of register for a particular operating frequency of 8085
microprocessor.
• Interrupt Service Subroutine TOOL
–It is a handy way to set memory values at corresponding vector interrupt
address.
• Number Conversion Tool
–It is a portable interconversion tool for Hexadecimal, decimal and binary
numbers. So, that user do not need to open separate calculator for it.

Directives

Assembler
Directives Example Description

#ORGC000H The next block of instruction should be stored


ORG(Origin) In memory locations starting at C000H

#BEGIN2000H To start simulation from address 2000H


BEGIN (Start)
End of Assembly. It places the mnemonic
#END defined at "Settings→Stop Simulation at
END (Stop) Mnemonic"
#OUTBUFEQU3945 The value of the label OUTBUF is
EQU (Equal) H 3945H. This may be used as memory
location.
DB #DATA:DBF5H,12H Initializes an area byte by byte, in successive memory
(DefineByte) locations until all values are stored. Label DATA stores the
initial address.
DW #LABEL:DW2050H Initializes an area two bytes at a time.
(DefineWord)

DS (DefineStorage) #STACK:DS4 Reserves a specified number of memory locations


and set the initial address to label STACK.

121
Debugging Mode

The debug mode allows the user to view and/or manipulate the program’s internal state
for the purpose of debugging. The software allows stepwise or block wise line monitor with
both forward and backward traversal facility.

PROGRAM

#ORG 2000
#BEGIN 2000
LXI H, 4200
MOV B,M
INX H
MVI C,00
MVI A,00
L2: ADD M
JNC L1
INR C
L1: DCR B
JNZ L2
INX H
MOV M,A
INX H
MOV M,C
HLT
#ORG 4200
#DB 23,42

Click
ASSEMBLE, Run all at a Time and then Memory

Observation

Input Output
4200 4202
4201 4203

Result
Thus the multiplication of two numbers was performed using the 8085 microprocessor
simulator.

122
Appendix A - 8085 Instruction set and Opcodes (Hex code)

You might also like