|
Statement: Write a program to shift an eight bit data four bits right. Assume data is in register C.
Sample problem:
(4200H) = 58
Result = (4300H) = 08 and
(4301H) = 05
|
Source program 1:
- MOV A, C
- RAR
- RAR
- RAR
- RAR
- MOV C, A
- HLT
|
Flowchart for Source program1

|
Statement: Write a program to shift a 16 bit data, 1 bit right. Assume that data is in BC register pair.
|
Source program 2
- MOV A, B
- RAR
- MOV B, A
- MOV A, C
- RAR
- MOV C, A
- HLT
|
Flowchart for Source program1
 |
|
Related Programs for Beginners: (Click down)
Store 8-bit data in memory
Add two 16-bit numbers
Finding Two's complement of a number
Exchange the contents of memory locations
Pack-the-unpacked-BCD-numbers