MCS-51 MCU assembly language: What are the data transfer instructions?

Publisher:大头玩家Latest update time:2013-05-04 Source: 21ICKeywords:MCS-51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Data transfer instructions are the most frequently used instructions in MCS-51 microcontroller assembly language programming, including data transfer between internal RAM, registers, external RAM and program memory.

Data transfer operation refers to transferring data from a source address to a destination address without changing the content of the source address.

1. Instructions with accumulator A as the destination operand

MOV   A,   #data    ; A← #data


MOV   A,   Rn       ; n=0~7, A← (Rn)

MOV A, @Ri; i=0.1, A← ((Ri))

MOV A, direct; A← (Rn) direct is the internal RAM or SFR address

 


2. Instructions with Rn as the destination operand

MOV    Rn,  A       ;Rn ← (A) ,  n=0~7

MOV    Rn , direct    ;Rn ← (direct) 

MOV    Rn ,#data    ;Rn ← #data

 


3. Instructions with direct addresses as destination operands

MOV   direct,  A        ;direct← (A)

MOV   direct,  Rn       ; direct← (Rn) ,       n=0~7

MOV   direct,  @Ri      ; direct← (( Ri ) ) , i=0,1

MOV   direct,  direct     ;direct← (direct)

MOV   direct,  #data      ;direct← #data

 


4. Instructions with register indirect addresses as destination operands

MOV @Ri, A ; ((Ri) )← (A) ,i=0.1

MOV   @Ri , direct    ; ((Ri) )← (direct)

MOV   @Ri ,#data    ; ((Ri) )← #data

 


Byte swap instructions

XCH A , Rn ; (A) ← →(Ri)

XCH A , direct ; (A) ← →(direct)

XCH  A ,  @Ri     ; (A) ← →(Ri)

 


Nibble swap instruction

XCHD A, @Ri ;(A)0-3 ← →((Ri )) 0-3

 


Accumulator A and external data transfer instructions

MOVX A, @DPTR; A← ((DPTR)) address range 64K

MOVX A, @Ri ; A← ((Ri)) Address range 0~255

MOVX @DPTR, A ; (DPTR) ←(A)

MOVX    @Ri ,  A    ; (Ri) ←(A)

 


Table Lookup Instructions

1)MOVC A, @A+DPTR ; A ←((A)+(DPTR))

2)MOVC  A,   @A+PC   ; A ←((A)+(pc))

Keywords:MCS-51 Reference address:MCS-51 MCU assembly language: What are the data transfer instructions?

Previous article:MCS-51 microcontroller assembly language: What are the arithmetic operation instructions?
Next article:How to access a certain address unit in each space in C51?

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号