SlideShare a Scribd company logo
1 of 20
MCS-51 Data Transfer
Instructions
MCS51 Instruction 12 April 2016
Developing
2 April 2016 MCS51 Instruction 2
Save / Load
Build
Assembly file
(.asm)
Hex file
Emulator
Circuit
Simulator
Microcontroller
Board
Assembly Editor
Assembly Language
• Low-level programming
• Specific to physical computer architecture
Assembly Language structure
• [Header]
• [Program Instructions]
• [END Instruction]
MCS51 Instruction 32 April 2016
Assembly Language Sample
ORG 00H
MOV A, #45H
ANL A, P1 ; Get status from sensors and process
MOV R0, P2 ; Get setting
Loop:
MOV P3, A ; Send Output to Display unit
DJNZ R0, Loop
END
MCS51 Instruction 42 April 2016
• Appendix 2: MCS-51 Instruction set
2 April 2016 MCS51 Instruction 5
Instruction set
• MCS51 is 8 bit microcontroller, there for 28 or
256 difference instructions possible for CPU.
• Types of instructions
– Data Transfer Instruction
– Logical Instruction
– Arithmetic Instruction
– Branch Instruction
– Bit Operation Instruction
MCS51 Instruction 62 April 2016
Machine Code
2 April 2016 MCS51 Instruction 7
Description of MCS51 instruction’s
parameter
• A
• Rn
• Ri
• Rx (Ry)
• Address
• #X
• #X16
• Rel
• Bit
• C
MCS51 Instruction 82 April 2016
Data Transfer Instructions
• These instructions move the content of one register to
another one. The register which content is moved
remains unchanged. If they have the suffix “X” (MOVX),
the data is exchanged with external memory.
• MOV
• MOVC
• MOVX
• PUSH
• POP
• XCH
MCS51 Instruction 92 April 2016
MOV A, Rn
• MOV A, R3
• MOV A, 03h
MCS51 Instruction 102 April 2016
MOV A, #X
• MOV A, #78H
• MOV A, #00101010B
MCS51 Instruction 112 April 2016
MOV @Ri, #X
• MOV @R1, #78H
• MOV @R0, #00101010B
MCS51 Instruction 122 April 2016
MOV DPTR, #XX
• MOV DPTR, #78E5H
• MOV DPTR, #1101010100101010B
MCS51 Instruction 132 April 2016
78 E5
DPH DPL
DPTR
MOV @Ri, A
E E
0001
0002
0003
0004
0005
…
0 4
Ri
Acc
Data Memory
Ri is R0 or R1 register
MCS51 Instruction 142 April 2016
3 5
7 E
6 8
E E
5 F
MOV A, @Ri
6 8
0001
0002
0003
0004
0005
…
0 3
Ri
Acc
Data Memory
Ri is R0 or R1 register
MCS51 Instruction 152 April 2016
3 5
7 E
6 8
E E
5 F
XCH A, @Ri
1 5
0001
0002
0003
0004
0005
…
0 5
Ri
Acc
Data Memory
Ri is R0 or R1 register
MCS51 Instruction 162 April 2016
3 5
7 E
6 8
E E
5 F
PUSH Rx
1 5
0006
0007
0008
0009
000A
000B
0 7
SP
Rx
Data Memory
Increase SP. then …
To address SP+1
MCS51 Instruction 172 April 2016
0 D
0 0
1 5
0 0
0 0
0 0
POP Rx
4 B
0006
0007
0008
0009
000A
000B
0 A
SP
Rx
Data Memory
Then decrease SP.
from address SP
MCS51 Instruction 182 April 2016
0 D
0 0
1 5
E F
4 B
0 0
XCH A, Rn
MCS51 Instruction 192 April 2016
XCHD A, @Ri
1 5
0001
0002
0003
0004
0005
0006
0 5
Ri
Acc
Data Memory
Ri is R0 or R1 register
MCS51 Instruction 202 April 2016
3 5
7 E
6 8
E E
3 F
E 2

More Related Content

What's hot (6)

Digital and logic designs presentation
Digital and logic designs presentationDigital and logic designs presentation
Digital and logic designs presentation
 
Lecture15 fsm i_ic
Lecture15 fsm i_icLecture15 fsm i_ic
Lecture15 fsm i_ic
 
Reactive Extensions for .NET
Reactive Extensions for .NETReactive Extensions for .NET
Reactive Extensions for .NET
 
Efficiently Performing Arithmetic Operation over Fq18 Extension Field
Efficiently Performing Arithmetic Operation over Fq18 Extension FieldEfficiently Performing Arithmetic Operation over Fq18 Extension Field
Efficiently Performing Arithmetic Operation over Fq18 Extension Field
 
Boothmultiplication
BoothmultiplicationBoothmultiplication
Boothmultiplication
 
Scilab-by-dr-gomez-june2014
Scilab-by-dr-gomez-june2014Scilab-by-dr-gomez-june2014
Scilab-by-dr-gomez-june2014
 

Similar to Microprocessor Week2: Data Transfer

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
vipinkmenon1
 
My seminar new 28
My seminar new 28My seminar new 28
My seminar new 28
rajeshkvdn
 

Similar to Microprocessor Week2: Data Transfer (20)

Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
 
Microprocessor system - summarize
Microprocessor system - summarizeMicroprocessor system - summarize
Microprocessor system - summarize
 
Microcontroller 8051 1
Microcontroller 8051  1Microcontroller 8051  1
Microcontroller 8051 1
 
Intelligent Transportation System
Intelligent Transportation SystemIntelligent Transportation System
Intelligent Transportation System
 
8051,chapter2
8051,chapter28051,chapter2
8051,chapter2
 
PROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNITPROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNIT
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine
 
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using KurentoFIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
 
My seminar new 28
My seminar new 28My seminar new 28
My seminar new 28
 
Microprocessor Laboratory 2: Logical instructions
Microprocessor Laboratory 2: Logical instructionsMicroprocessor Laboratory 2: Logical instructions
Microprocessor Laboratory 2: Logical instructions
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Lect05 Prog Model
Lect05 Prog ModelLect05 Prog Model
Lect05 Prog Model
 
IEC 61850 Lessons Learned 2016 04-11
IEC 61850 Lessons Learned 2016 04-11IEC 61850 Lessons Learned 2016 04-11
IEC 61850 Lessons Learned 2016 04-11
 
ConnecTechAsia 2020: Introduction to IPv6
ConnecTechAsia 2020: Introduction to IPv6ConnecTechAsia 2020: Introduction to IPv6
ConnecTechAsia 2020: Introduction to IPv6
 
MLflow with R
MLflow with RMLflow with R
MLflow with R
 
8085 instruction set and Programming
8085 instruction set and Programming 8085 instruction set and Programming
8085 instruction set and Programming
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptx
 

More from Arkhom Jodtang

More from Arkhom Jodtang (13)

MCS51 Training board Model CATC2016A
MCS51 Training board Model CATC2016AMCS51 Training board Model CATC2016A
MCS51 Training board Model CATC2016A
 
Microprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsMicroprocessor Week 10: Applications
Microprocessor Week 10: Applications
 
Microprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and CounterMicroprocessor Week 9: Timer and Counter
Microprocessor Week 9: Timer and Counter
 
Microprocessor Week 8: Advance programming
Microprocessor Week 8: Advance programmingMicroprocessor Week 8: Advance programming
Microprocessor Week 8: Advance programming
 
Microprocessor Week 2: CH2 Circuit and Operation
Microprocessor Week 2: CH2 Circuit and OperationMicroprocessor Week 2: CH2 Circuit and Operation
Microprocessor Week 2: CH2 Circuit and Operation
 
Microprocessor Week1: Introduction
Microprocessor Week1: IntroductionMicroprocessor Week1: Introduction
Microprocessor Week1: Introduction
 
Microprocessor laboratory 03 Arithmetic Operation (Additional and Subtraction)
Microprocessor laboratory 03 Arithmetic Operation (Additional and Subtraction)Microprocessor laboratory 03 Arithmetic Operation (Additional and Subtraction)
Microprocessor laboratory 03 Arithmetic Operation (Additional and Subtraction)
 
Use of Computer & IT, Laboratory MS Word
Use of Computer & IT, Laboratory MS WordUse of Computer & IT, Laboratory MS Word
Use of Computer & IT, Laboratory MS Word
 
Microprocessor: Delay technique
Microprocessor: Delay techniqueMicroprocessor: Delay technique
Microprocessor: Delay technique
 
Distance Measuring Car
Distance Measuring CarDistance Measuring Car
Distance Measuring Car
 
Microprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch InstructionMicroprocessor Week 7: Branch Instruction
Microprocessor Week 7: Branch Instruction
 
Tamech 2013 Presentation
Tamech 2013 PresentationTamech 2013 Presentation
Tamech 2013 Presentation
 
Electronics & Avionics project
Electronics & Avionics projectElectronics & Avionics project
Electronics & Avionics project
 

Recently uploaded

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Microprocessor Week2: Data Transfer

  • 1. MCS-51 Data Transfer Instructions MCS51 Instruction 12 April 2016
  • 2. Developing 2 April 2016 MCS51 Instruction 2 Save / Load Build Assembly file (.asm) Hex file Emulator Circuit Simulator Microcontroller Board Assembly Editor
  • 3. Assembly Language • Low-level programming • Specific to physical computer architecture Assembly Language structure • [Header] • [Program Instructions] • [END Instruction] MCS51 Instruction 32 April 2016
  • 4. Assembly Language Sample ORG 00H MOV A, #45H ANL A, P1 ; Get status from sensors and process MOV R0, P2 ; Get setting Loop: MOV P3, A ; Send Output to Display unit DJNZ R0, Loop END MCS51 Instruction 42 April 2016
  • 5. • Appendix 2: MCS-51 Instruction set 2 April 2016 MCS51 Instruction 5
  • 6. Instruction set • MCS51 is 8 bit microcontroller, there for 28 or 256 difference instructions possible for CPU. • Types of instructions – Data Transfer Instruction – Logical Instruction – Arithmetic Instruction – Branch Instruction – Bit Operation Instruction MCS51 Instruction 62 April 2016
  • 7. Machine Code 2 April 2016 MCS51 Instruction 7
  • 8. Description of MCS51 instruction’s parameter • A • Rn • Ri • Rx (Ry) • Address • #X • #X16 • Rel • Bit • C MCS51 Instruction 82 April 2016
  • 9. Data Transfer Instructions • These instructions move the content of one register to another one. The register which content is moved remains unchanged. If they have the suffix “X” (MOVX), the data is exchanged with external memory. • MOV • MOVC • MOVX • PUSH • POP • XCH MCS51 Instruction 92 April 2016
  • 10. MOV A, Rn • MOV A, R3 • MOV A, 03h MCS51 Instruction 102 April 2016
  • 11. MOV A, #X • MOV A, #78H • MOV A, #00101010B MCS51 Instruction 112 April 2016
  • 12. MOV @Ri, #X • MOV @R1, #78H • MOV @R0, #00101010B MCS51 Instruction 122 April 2016
  • 13. MOV DPTR, #XX • MOV DPTR, #78E5H • MOV DPTR, #1101010100101010B MCS51 Instruction 132 April 2016 78 E5 DPH DPL DPTR
  • 14. MOV @Ri, A E E 0001 0002 0003 0004 0005 … 0 4 Ri Acc Data Memory Ri is R0 or R1 register MCS51 Instruction 142 April 2016 3 5 7 E 6 8 E E 5 F
  • 15. MOV A, @Ri 6 8 0001 0002 0003 0004 0005 … 0 3 Ri Acc Data Memory Ri is R0 or R1 register MCS51 Instruction 152 April 2016 3 5 7 E 6 8 E E 5 F
  • 16. XCH A, @Ri 1 5 0001 0002 0003 0004 0005 … 0 5 Ri Acc Data Memory Ri is R0 or R1 register MCS51 Instruction 162 April 2016 3 5 7 E 6 8 E E 5 F
  • 17. PUSH Rx 1 5 0006 0007 0008 0009 000A 000B 0 7 SP Rx Data Memory Increase SP. then … To address SP+1 MCS51 Instruction 172 April 2016 0 D 0 0 1 5 0 0 0 0 0 0
  • 18. POP Rx 4 B 0006 0007 0008 0009 000A 000B 0 A SP Rx Data Memory Then decrease SP. from address SP MCS51 Instruction 182 April 2016 0 D 0 0 1 5 E F 4 B 0 0
  • 19. XCH A, Rn MCS51 Instruction 192 April 2016
  • 20. XCHD A, @Ri 1 5 0001 0002 0003 0004 0005 0006 0 5 Ri Acc Data Memory Ri is R0 or R1 register MCS51 Instruction 202 April 2016 3 5 7 E 6 8 E E 3 F E 2