Вы находитесь на странице: 1из 23

DATA TRANSFER GROUP

Instructions, which are used to transfer data from one register to another register, from memory to register or register to memory, come under this group. When an instruction of data transfer group is executed, data is transferred from the source to the destination without altering the contents of the source.

DATA TRANSFER GROUP


1) MOV r1, r2
(Move Data; Move the content of the one register to another).

[r1]
Example:

[r2].

MOV C,B. Move the content of register B to C.

Initially
After execution
Flags Affected Addressing mode Memory require Machine Cycle require T- States

B=10H.
B=10H.
Register.

C=20H.
C=10H.

No flags affected. 1Byte Instruction 1 4

DATA TRANSFER GROUP


2) MOV R, M (Move the content of memory to register). r [M] Move the content of memory location, whose adders is in H-l pair to register r
Flags Affected Addressing mode Memory require No flags affected. Indirect. 1Byte Instruction

Machine Cycle require


T- States

2
7

EXAMPLE:
MOV C, M Move the content of memory location (M) , whose adders is in H-l pair {2000H} to register C

Initially content of memory location (M) 32H After execution content of memory location (M) 32H

C=00 H. C=32H.

Register C H- L

20 00 H

32H

32 00 H H

DATA TRANSFER GROUP


3) MOV M, R (Move the content of register to memory). [M] R Move the content of register R to memory location(M),

whose adders is in H-l pair


Flags Affected Addressing mode No flags affected. Indirect.

Memory require Machine Cycle require


T- States

1Byte Instruction 2
7

EXAMPLE:
MOV M,C Move the content of register C to memory location (M) whose adders is in H-l pair {2000H}

Initially content of memory location (M) 00 H After execution content of memory location (M) 32H

C=32 H. C=32H.

Register C H- L

20 00 H

00H 32H

32 H

DATA TRANSFER GROUP


4) MVI r, data. (Move immediate data to register). [r] data.(8 bit)
Example: MVI B, 30H. (Move the data 30 H to Register B) Initially After execution
Flags Affected Addressing mode Memory require Machine Cycle require T- States

B=40H B=30H
No flags affected. Immediate. 2Byte Instruction 2 7

DATA TRANSFER GROUP


5) MVI M, data. (Move immediate data to memory whose adders is in H-l pair {2000H}. [M]
Flags Affected Addressing mode

data.(8 bit)
No flags affected. Immediate.

Memory require
Machine Cycle require T- States

2Byte Instruction
2 7

DATA TRANSFER GROUP


Example:
MVI M, 32H. (Move the data 30 H to memory whose adders is in H-l pair {2000H}. Initially content of memory location (M) After execution content of memory location (M)
Data

=40H =32H

H- L

20 00 H

40H 32H

32 H

DATA TRANSFER GROUP


6) LXI rp, data 16. (Load register pair immediate 16 bits data). [rp] data 16 bits
We have 3 register pair 1) B-C 2) D-E 3) H-L Example: LXI B, C200H. (Load register pair B-C with C200H). Initially B=C800H After execution B=C200H.
Flags Affected
Addressing mode Memory require Machine Cycle require

No flags affected.
Immediate. 3Byte Instruction 3

T- States

10

DATA TRANSFER GROUP


7) LDA adders. (Load Accumulator direct) (load accumulator direct by the content of memory
location (M) whose adders is directly given in instruction its self).

[A]
Flags Affected

[adders].
No flags affected.

Addressing mode
Memory require Machine Cycle require T- States

Direct
3Byte Instruction 4 13

DATA TRANSFER GROUP


Example:
LDA 2000H (load accumulator direct by the content of memory location (2000H) whose adders is directly given in instruction its self.) Initially A = 40H After execution A = 32H

Accumulator

2000 H

32H

40 32 H H

DATA TRANSFER GROUP


8) STA adders. (Store accumulator direct) (Store the content of accumulator direct to the memory
location (M) whose adders is directly given in instruction its self).

[A]
Flags Affected

[adders].
No flags affected.

Addressing mode
Memory require Machine Cycle require T- States

Direct
3Byte Instruction 4 13

DATA TRANSFER GROUP


Example:
STA 2000H (Store the content of accumulator direct to the memory location (2000H) whose adders is directly given in instruction its self) Initially content of memory location (M) After execution content of memory location (M) =40H =32H

Accumulator

2000 H

40H 32H

32 H

DATA TRANSFER GROUP


9) LHLD adders (Load H-L pair direct) (load register L by the content of memory location
whose adders is directly given in instruction its self. Load register H by the content of next memory location).

[L] [H]
Flags Affected Addressing mode Memory require Machine Cycle require

[addr], [addr+1].
No flags affected. Direct 3Byte Instruction 5

T- States

16

DATA TRANSFER GROUP


Example:
LHLD 2000H (load register L by the content of memory location(2000) whose adders is directly given in instruction its self. Load register H by the content of next memory location(2001)) Initially L = 00H After execution L = 32H H = 23H H = 00H

2000 H 2001 H

32H 23H

00 32 HH 23 00 HH

L H

DATA TRANSFER GROUP


9) SHLD adders (Store H-L pair direct) (Store the content register L to the memory location
whose adders is directly given in instruction its self. Store the content register H to the of next memory location).

[L] [H]
Flags Affected Addressing mode Memory require Machine Cycle require

[addr], [addr+1].
No flags affected. Direct 3Byte Instruction 5

T- States

16

DATA TRANSFER GROUP


Example:
SHLD 2000H (Store the content register L to the memory location(2000) whose adders is directly given in instruction its self. Store the content register H to the of next memory location(2001)) Initially content of memory location (M) 2000 = 40H, 2001 = 41 After execution content of memory location (M)2000 = 32H, 2001 = 23H

2000 H 2001 H

32H 40H 41H 23H

32 H 23 H

L H

DATA TRANSFER GROUP


10) LDAX Rp. (LOAD accumulator indirect) (Load accumulator by the content of memory location
(M) whose adders is given in register pair).

[A]

[Rp].

Flags Affected

No flags affected.

Addressing mode
Memory require Machine Cycle require T- States

Indirect
1Byte Instruction 2 7

DATA TRANSFER GROUP


Example:
LDAX B (Load accumulator by the content of memory location (2000H) whose adders is given in register pair.) Initially A = 40H After execution A = 32H

B- C

Accumulator

20 00 H

32H

40 32 H H

DATA TRANSFER GROUP


11) STAX Rp. (Store accumulator indirect) (Store the content of accumulator to the memory
location (M) whose adders is given in register pair).

[A]

[adders].

Flags Affected

No flags affected.

Addressing mode
Memory require Machine Cycle require T- States

Register indirect
1Byte Instruction 2 7

DATA TRANSFER GROUP


Example:
STAX B (Store the content of accumulator to the memory location (2000H) whose adders is given in register pair) Initially content of memory location (M) After execution content of memory location (M) =40H =32H

Accumulator

20 00 H

32H 00H

32 H

DATA TRANSFER GROUP


12) XCHG.
(Exchange the contents of H-L with D-E pair) [H-L] [D-E].
Example: XCHG Initially L = 15H H = 16H D = 32H E = 23H L = 32H H = 23H D = 15H E = 16H
No flags affected.
Regiser 1Byte Instruction 1 4

After execution
Flags Affected

Addressing mode Memory require Machine Cycle require T- States

Вам также может понравиться