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