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))
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?
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- HCS12 Series MC9S12DP512MPVE Microcontroller 16Bit Flash 112LQFP
- Annoying technology
- Can a PMOS be connected in series on the communication line as a switch?
- How to achieve positive and negative pulse output using a single battery power supply
- 【GD32E231 DIY】Serial communication
- Allow ubinascii.crc32() function in rp2/stm32
- 【McQueen Trial】McQueen's new ultrasonic drive
- Dial design based on lvgl
- Soldering example of SMA coaxial connector to PCB board
- 100% duty design of buck chip