0% found this document useful (0 votes)
6 views2 pages

Program 1

The document outlines a program for the 8085 microprocessor that swaps two 8-bit numbers stored in memory locations 3500 and 3501. It includes the assembly code with memory addresses, opcodes, and comments explaining each step of the process. An example of input and output is provided, along with a prompt for users to try swapping different numbers.

Uploaded by

hemugowda0502
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)
6 views2 pages

Program 1

The document outlines a program for the 8085 microprocessor that swaps two 8-bit numbers stored in memory locations 3500 and 3501. It includes the assembly code with memory addresses, opcodes, and comments explaining each step of the process. An example of input and output is provided, along with a prompt for users to try swapping different numbers.

Uploaded by

hemugowda0502
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

Microprocessor 8085 1

Computer Architecture

Program 1: Write a program to swap two 8 bit numbers.

Program:

Memory Opcode &


Mnemonics Comments
Address Operand

Load the first 8 bit number into Accumulator from


2000 LDA 3500
memory location 3500.

2001

2002

2003 MOV B, A Move the content of Register A to Register B

Load the Second 8 bit number into Accumulator


2004 LDA 3501
from memory location 3501.

2005

2006

Store the second 8 bit number in memory location


2007 STA 3500
3500 from Accumulator.

2008

2009

200A MOV A, B Move the content of Register B to Register A

Store the first 8 bit number in the memory location


200B STA 3501
3501 from Accumulator.

200C

200D

Bac he lor of Co mp uter Ap pl ica tions I Se mes ter V E I T Deg ree C ol leg e , Ban ga lo re
Microprocessor 8085 2
Computer Architecture

200E HLT Stop the program execution

Execution:

Example

Memory Address Input Output


First 8 bit number 3500 AA 11
Second 8 bit
3501 11 AA
number

Try yourself:

Memory Address Input Output


First 16 bit number 3500 78
Second 16 bit
3501 AB
number
___________________________E n d o f P r o g r a m 1 ____________________________

Bac he lor of Co mp uter Ap pl ica tions I Se mes ter V E I T Deg ree C ol leg e , Ban ga lo re

You might also like