The data between internal RAM location
or SFR, are called internal data moves. These are possible by writing move
instruction in different addressing modes.
·
Using an
immediate addressing mode:-
1] MOV A,
#data
Description: Move an immediate
data in accumulator. The immediate data in this instruction
is always an eight bit.
Operation :Move
Aß A, # data
Example :MOV
A, #32H
Move data 32h into accumulator.
2] MOV Rn, #data
Description : Move an immediate data in any register
(R0……..R7).
The immediate data in this
instruction is always an eight bit.
Operation : Move
Rnß#data
Example
: MOV R2, #50H
Move data 50H into register R2.
3] MOV
direct, #data
Description : 8-dit immediate data in copied into
internal RAM location whose address is specified directly in to instruction.
The destination can be SFR also.
Operation : MOV
(direct address)ß#data
Example
: MOV 30H, #9AH
The internal RAM location 30H is
loaded with data 9AH.
MOV 02H, #50H
The internal RAM location 02H
(Register R2 of Bank 0) is loaded with data 50H.
4] MOV @ Rp, #data
Description : An immediate data moved to a location
whose address is specified by Rp only
Registers R0 o r1 are used as
indirect mode of operation.
Operation
: MOV
[(Rp)]ß#data
Example
: Suppose R0 contains 7FH
MOV @R0, #36h
Data 36H is copied to location whose address
is specified by R0 i.e. after executing this
instruction,
internal RAM location 7FH is loaded with data 36H.
·
Using register
–addressing mode:-
6]
MOV A, Rn
Description : Move the con
AßRn
Example : Move A, R2: Move contacts of R2
into accumulator the of R2 remain as it is .This
means contacts of destination always change after
data teamster instruction is
executed.
7] MOV Rn, A
Description: Move the contact of accumulator into
register. Rn presents register from R0 to R7.
Operation : MOV
RnßA
Example :Move R5, A: Move contact of
accumulator into R5.
The contacts of Rs change after
execution but contacts of accumulator remain as it is.
·
Using direct
addressing Mode:-
8] Move A, direct
Description : the content of memory location
(internal Ram or SFR) Specified by direct address is
moved into
accumulator.
Operation : MOV
A ß(direct address)
Example : Move A, 40H.
The contacts of memory location
40H are moved into accumulator. If a content of 40H is
5AH, then after
execution of this instruction accumulator has 5AH
9] MOV direct, A
Description : The content of accumulator to the
specified memory location specified by direct
address.
Operation : MOV
(Direct address)ßA
Example : Move 90H, A, the content
of accumulator is moved to port 1(address of part 1 is 90H).If
content of
accumulator is 7FH then after execution of this instruction part 1 has 7FH.
10] MOV Rn,direct.
Description : Move the contect of memory location
specified by direct address into register
R0 to R7.
Opreation : Mov
Rn ß (direct
address)
Example : MOV R5,80H ; 80H is address of port 0. Move
contacts of port 0 into R5.
MOV R3,47H ;47H address of internal RAM location.
Move the contents
of memory location 47H into R3.
11]
MOV direct , Rn.
·
Description : Move the contect of register Rn [R0……R7]
into memory location specified
by direct address.
·
Operation : Mov
[direct address] ß Rn.
·
Example : Mov 20H,R7
Move contents of R7 into memory
location 20H.
Mov 03H,R7
Move contents of R7 into R3.
(Memory location 03H is the
address of register R3).
12] MOV direct , direct.
·
Description : Move the contect of internal RAM or SFR
into another RAM location or
SFR.
·
Operation
: Mov
(direct address) ß (direct address).
·
Example : MOV 20H , 07H
Move contects of register R7 into memory
location 20H.
(memory location 07H is the
address of register R7).
MOV 03H , 07H
MOV contents of R7 into R3.
·
Using The
Indirect Addressing Mode:-
13] Mov A,@Rp.
·
Description
: Move the contect of memory location
specified by Rp to accumulator.Only
register R0 or R1 are
used as indirect mode of operation.
·
Operation
: Mov
A ß [(Rp)]
·
Example : Suppose R0 contains 75H and RAM location
7FH contain data 25H,then
after executing this
instruction.
MOV
A,@R0
Accumulator is loaded with data
25H.
14] Mov @ Rp,A.
·
Description
: Move the contents of accumulator into
the memory location specified by
Rp.
·
Operation
: Mov
[(Rp)]
ß A
·
Example:
Suppose accumulator contains 50H and
R0 contains 70H.
Then after executing this instruction Mov @ R0
, A.
Internal RAM location 70h is loaded specified
by rp into50H.
15] Mov direct ,@ Rp
·
Description : Move
the contents of memory location specified by Rp into direct memory
location.
·
Operation
: Mov
·
Example
: Suppose R0 contains 70H contains
55H.then after executing this
instruction
Mov 90H ,@R0 ; 90H is Address at port 1
Port 1 is loaded with data 50H
This instruction performs similar operation
like Mov P1 , @R0.
16] Mov @ Rp , direct
·
Description
: Move the contents of direct memory
location into the memory location
·
specified by Rp.
·
Operetion : Mov
[(Rp)]
ß (direct address)
·
Example
: Suppose port 1 contains 50H and R0
contains 70H,then after executing this
instruction
Mov
@ R0,90H ; 90His address of port 1
Internal RAM location 70H is loaded with
data 50H.
0 comments:
Post a Comment
If you have any questions or droughts feel free to ask here.