Q. Write an 8085 program and draw a flowchart to Shift Right 8-bit By 2-bit.(8085 Microprocessor Program)
Flowchart/Algorithm
Program
Address | Mnemonics | Operand | Opcode | Comments |
2000 | LDA | 3000 H | 3A | Load A with data from 3000 H |
2001 | 00 | |||
2002 | 30 | |||
2003 | RAR | 1F | Shift Right Accumulator | |
2004 | RAR | 1F | Shift Right Accumulator | |
2005 | STA | 3001 H | 32 | Store the result at location 3001 H |
2006 | 01 | |||
2007 | 30 | |||
2008 | HLT | 76 | Halt |
Output
Before Execution:
3000H: 05H
After Execution:
3001H: C1H
Program Explanation
this program is to rotate by 2 bits and the qwestion is to shift by two bits.
OR there is no differences between shift and rotate while writing program?