0% found this document useful (0 votes)
1K views

Shift Left 8 Bit by 1 Bit

This program shifts an 8-bit number stored in memory location 3000H left by one bit. It loads the number from 3000H into the accumulator, shifts the accumulator left using the RAL instruction, and stores the result in memory location 3001H. For example, if the initial value at 3000H was 05H, after executing the program the value at 3001H would be 0AH, representing a left shift of the binary value.

Uploaded by

Prashanth9999
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Shift Left 8 Bit by 1 Bit

This program shifts an 8-bit number stored in memory location 3000H left by one bit. It loads the number from 3000H into the accumulator, shifts the accumulator left using the RAL instruction, and stores the result in memory location 3001H. For example, if the initial value at 3000H was 05H, after executing the program the value at 3001H would be 0AH, representing a left shift of the binary value.

Uploaded by

Prashanth9999
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

8085 Programs

Program 5: Shift left 8-bit number by 1 bit.


Flowchart:
Start

Load accumulator with


operand from memory.

Shift left accumulator.

Store the result from


accumulator to memory.

Stop

Program:
Address

Mnemonics

Operand

Opcode

2000

LDA

3000H

3A

Load H-L pair with data from 3000H.

2001

00

Lower-order of 3000H.

2002

30

Higher-order of 3000H.

17

Shift left accumulator.

32

Store the result at memory location 3001H.

2005

01

Lower-order of 3001H.

2006

30

Higher-order of 3001H.

76

Halt.

2003

RAL

2004

STA

2007

3001H

HLT

Remarks

Explanation:

This program performs the left 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 05H.

The operand is moved to accumulator from memory location 3000H.

Then, shift left operation is done by using RAL instruction.

The result is stored at memory location 3001H.

Gursharan Singh Tatla

Page 1 of 2

8085 Programs

Output:
Before Execution:
3000H:

05H

After Execution:
3001H:

Gursharan Singh Tatla

0AH

Page 2 of 2

You might also like