Q. Write an 8085 program and draw a flowchart to Shift Right 8-bit By 1-bit.(8085 Microprocessor Program)
Flowchart/Algorithm
Program
Address | Mnemonics | Operand | Opcode | Comments |
2000 | LDA | 3000H | 3A | Load H-L pair with data from 3000H. |
2001 | 00 | |||
2002 | 30 | |||
2003 | RAR | 1F | Shift right accumulator | |
2004 | STA | 3001H | 32 | Store the result at memory location 3001H. |
2005 | 01 | |||
2006 | 30 | |||
2007 a | HLT | 76 | Halt |
Output
Before Execution:
3000H: 04H
After Execution:
3001H: 02H
Program Explanation
- This program performs the right shift operation on an 8-bit number by one bit stored in memory location 3000H.
- Let us assume that the operand stored at memory location 3000H is 04H.
- The operand is moved to accumulator from memory location 3000H.
- Then, shift right operation is done by using RAR instruction.
- The result is stored at memory location 3001H.
Related posts:
Difference between 8085 and 8086 Microprocessor
Program to Subtract two 8-bit numbers with the borrow
Status or Flag Register in 8085 Microprocessor
Program to Shift Left 8-bit By 1-bit
Instruction Word Size | 8085 Microprocessor
16 Bit Data Transfer Instructions | 8085 Microprocessor
Program to Shift Right 8-bit By 2-bit
Program to add two 8-bit numbers & show result in Decimal Number System
Opcodes of 8085 Microprocessor
Program to find 1’s complement of an 8-bit number