Program to Shift Left 8-bit By 1-bit

Q. Write an 8085 program and draw a flowchart to Shift Left 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 RAL 17 Shift left 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: 05H 

After Execution:

3001H: 0AH

Program Explanation

  1. This program performs the left shift operation on an 8-bit number by one bit stored in memory location 3000H.
  2. Let us assume that the operand stored at memory location 3000H is 05H.
  3. The operand is moved to accumulator from memory location 3000H.
  4. Then, shift left operation is done by using RAL instruction.
  5. The result is stored at memory location 3001H.

2 thoughts on “Program to Shift Left 8-bit By 1-bit”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.