0% found this document useful (0 votes)
24 views7 pages

Micro-Controller Labortary (Eelr-16) : Experiment No: 1 Roll No: 107119038 Group No: 2 Name: Devisree J Date: 14.02.2022

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)
24 views7 pages

Micro-Controller Labortary (Eelr-16) : Experiment No: 1 Roll No: 107119038 Group No: 2 Name: Devisree J Date: 14.02.2022

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/ 7

MICRO-CONTROLLER LABORTARY(EELR-16)

Experiment no: 1 Roll No: 107119038


Group no: 2 Name: Devisree J
Date: 14.02.2022

Aim of the experiment:


To write an assembly language program to add two hexadecimal number and subtract two hexadecimal
number. Then to execute both using GNUSim8085 software.

PROBLEM 1:
Question:
Write an assembly language program to add two hexadecimal number 30H and 45H stored in memory
location 5000H and 5001H respectively. Display the sum at the LED output PORT 2.

Flowchart:
Algorithm:
1. Move the data 30H immediately to accumulator.
2. Store the accumulator content in memory location 5000H using “STA” instruction.
3. Move the data 45H immediately to accumulator.
4. Store the accumulator content in memory location 5001H using “STA” instruction.
5. Transfer the data from memory location 5000H to accumulator using “LDA” instruction.
6. Move the content of accumulator to H register using “MOV” instruction.
7. Transfer the data from memory location 5001H to accumulator using “LDA” instruction.
8. Add the content of accumulator with content of H using “ADD” instruction.
9. Transfer the result to output port 2 using “OUT” instruction.
Program:
Memory Address Opcode Mnemonics Comment
8000 3EH MVI A, 30H A ← 30H
8001 30H 30H as operand
8002 32H STA 5000H Store A content to 5000H
8003 00H 00H as operand
8004 50H 50H as operand
8005 3EH MVI A, 45H A ← 45H
8006 45H 45H as operand
8007 32H STA 5001H Store A content to 5001H
8008 01H 01H as operand
8009 50H 50H as operand
800A 3AH LDA 5000H Transfer 5000H content to A
800B 00H 00H as operand
800C 50H 50H as operand
800D 67H MOV H,A Move A content to H
800E 3AH LDA 5001H Transfer 5001H content to A
800F 01H 01H as operand
8010 50H 50H as operand
8011 84H ADD H A ←A+H
8012 D3H OUT 02 Transfer result to port 02
8013 02H 02H as operand
8014 76H HLT Halt the program
Raw Code:
Simulator Snapshot:

• Data stored Memory locations:

• Output Port:
PROBLEM 2:
Question:
Write an assembly language program to subtract two hexadecimal number 31H and 47H stored in
memory location 6000H and 001H respectively. Subtract the number in 6000h from the number in
location 6001, and display the sum at the LED output PORT 2.

Flowchart:

Algorithm:
1. Move the data 31H immediately to accumulator.
2. Store the accumulator content in memory location 6000H using “STA” instruction.
3. Move the data 47H immediately to accumulator.
4. Store the accumulator content in memory location 6001H using “STA” instruction.
5. Transfer the data from memory location 6000H to accumulator using “LDA” instruction.
6. Move the content of accumulator to H register using “MOV” instruction.
7. Transfer the data from memory location 6001H to accumulator using “LDA” instruction.
8. Subtract the content of accumulator with content of H using “SUB” instruction.
9. Transfer the result to output port 2 using “OUT” instruction.
Program:
Memory Address Opcode Mnemonics Comment
8000 3EH MVI A, 31H A ← 31H
8001 31H 31H as operand
8002 32H STA 6000H Store A content to 6000H
8003 00H 00H as operand
8004 60H 60H as operand
8005 3EH MVI A, 47H A ← 47H
8006 47H 47H as operand
8007 32H STA 6001H Store A content to 6001H
8008 01H 01H as operand
8009 60H 60H as operand
800A 3AH LDA 6000H Transfer 6000H content to A
800B 00H 00H as operand
800C 60H 60H as operand
800D 67H MOV H,A Move A content to H
800E 3AH LDA 6001H Transfer 6001H content to A
800F 01H 01H as operand
8010 60H 60H as operand
8011 96H SUB H A ←A-H
8012 D3H OUT 02 Transfer result to port 02
8013 02H 02H as operand
8014 76H HLT Halt the program

Raw Code:
Simulator Snapshot:

• Data stored Memory locations:

• Output Port:
Results:
The programs was successfully assembled and executed

You might also like