Data Transfer group of Instructions
1 MOV
2 MVI
3 LXI
4 LDA
5 STA
6 LDAX
7 STAX
8 LHLD
9 SHLD
10 XCHG
11 IN
12 OUT
Examples based on above instructions:
P1. Write an ALP for transfer of content of register B to registers A,C,D,E,H and L.
Solution1:
Lable Mnemonic Comments
Start: MOV A,B ; move data of B to A
MOV C,B ; move data of B to C
MOV D,B ; move data of B to D
MOV E,B ; move data of B to E
MOV H,B ; move data of B to H
MOV L,B ; move data of B to L
Stop: HLT
Solution 2:
Lable Mnemonic Comments
Start: MOV A,B ; move data of B to A
MOV C,A ; move data of A to C
MOV D,C ; move data of C to D
MOV E,D ; move data of D to E
MOV H,E ; move data of E to H
MOV L,H ; move data of H to L
Stop: HLT
P2. Write an ALP to load data 33H to Registers A, B and C.
Solution 1:
Lable Mnemonic Comments
Start: MVI A,33H ; move data 33H to A
MVI B,33H ; move data 33H to B
MVI C,33H ; move data 33H to C
Stop: HLT
Solution 2:
Lable Mnemonic Comments
Start: MVI A,33H ; move data 33H to A
MOV B,A ; move data of A to B
MOV C,A ; move data of A to C
Stop: HLT
Comments
Post a Comment