SlideShare a Scribd company logo
1 of 2
The following codes are supposed to add ten Bytes stored in an array and store the sum in R4.
However, there is an error. Which of the four choices pick up the bug? MOV r0, #10; load r0
with 10 MOV r4. #0 LDR, r1, = Array; load r1 with address Array loop LDRB r2, r1; load one
byte to r2 ADD r4, r4, r2; r4 = r4 + r2 ADD r1, r1, #1; increase r1 by 1 SUBS r0, r0, #1;
decrease r0 by 1 BNE loop a. BNE loop should be BEQ loop b. loop should not take one line by
itself. c. MOV r0, #10 should be MOV r0, #A d. LDRB r2, r1 should be LDRB r2, [r1] Multiple
loading and multiple storing instructions allow you to load or store multiple registers from or to
memory. Which of the following instructions load r2 with the memory location [r0 + 4] a.
LDMIA r2, {r1, r0, r4} b. STMIA r2, {r1, r0, r4}) c. STMIA r0, {r1, r2, r4} d. LDMIA r0, {r1,
r2, r4} Let's assume r0, r1, r2,r3, r4, r5 and r6 have the contents of 0 times 90, 0 times 91, 0
times 92,.. and 0 times 96. After the following two stack operations, determine the content of r1.
PUSH {r0, r2-r6} POP {r0-r5}. a. 0 times 91 b. 0 times 93 c. 0 times 90 d. 0 times 92
Solution
Answers
4. Multiple loading and multiple storing instructions allow you to load multiple registers from
memory. which of the following load r2 with the memory location r0+4.
(b) STMA r2{r1,r0,r4}
5.Let’s assume r0,r1,r2,r3,r4,r5 and r6 have the contents of 0x90,0x91,…. and 0x96. After
following two stack operations , determine the content of r1
(a) 0x91
The following codes are supposed to add ten Bytes stored in an array a.docx

More Related Content

Similar to The following codes are supposed to add ten Bytes stored in an array a.docx

Similar to The following codes are supposed to add ten Bytes stored in an array a.docx (20)

15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5
 
Ch9a
Ch9aCh9a
Ch9a
 
module 5.1.pptx
module 5.1.pptxmodule 5.1.pptx
module 5.1.pptx
 
module 5.pptx
module 5.pptxmodule 5.pptx
module 5.pptx
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
커널코드분석 20140621(head.s restart)
커널코드분석 20140621(head.s restart)커널코드분석 20140621(head.s restart)
커널코드분석 20140621(head.s restart)
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
ch2-arm-1.ppt
ch2-arm-1.pptch2-arm-1.ppt
ch2-arm-1.ppt
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Ch2 arm-1
Ch2 arm-1Ch2 arm-1
Ch2 arm-1
 
How would you write this in MARIE assembly languageint count = 0;.pdf
How would you write this in MARIE assembly languageint count = 0;.pdfHow would you write this in MARIE assembly languageint count = 0;.pdf
How would you write this in MARIE assembly languageint count = 0;.pdf
 
Please convert the following C code to assembly Y86int i,j; ......pdf
Please convert the following C code to assembly Y86int i,j; ......pdfPlease convert the following C code to assembly Y86int i,j; ......pdf
Please convert the following C code to assembly Y86int i,j; ......pdf
 
mup
mupmup
mup
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
 
Buy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects OnlineBuy Embedded Systems Projects Online,Buy B tech Projects Online
Buy Embedded Systems Projects Online,Buy B tech Projects Online
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 

More from carold11

The Federal Reserve attempts to keep prices stable and unemployment lo.docx
The Federal Reserve attempts to keep prices stable and unemployment lo.docxThe Federal Reserve attempts to keep prices stable and unemployment lo.docx
The Federal Reserve attempts to keep prices stable and unemployment lo.docx
carold11
 
The executive officers of Rouse Corporation have a performance-based c.docx
The executive officers of Rouse Corporation have a performance-based c.docxThe executive officers of Rouse Corporation have a performance-based c.docx
The executive officers of Rouse Corporation have a performance-based c.docx
carold11
 
The enqueue operation on the Queue ADT adds a new item to the back of (1).docx
The enqueue operation on the Queue ADT adds a new item to the back of (1).docxThe enqueue operation on the Queue ADT adds a new item to the back of (1).docx
The enqueue operation on the Queue ADT adds a new item to the back of (1).docx
carold11
 
The Fed follows the theory of bureaucratic behavior in what sense-.docx
The Fed follows the theory of bureaucratic behavior in what sense-.docxThe Fed follows the theory of bureaucratic behavior in what sense-.docx
The Fed follows the theory of bureaucratic behavior in what sense-.docx
carold11
 

More from carold11 (20)

The Financial Management Decision Process What are the three types of.docx
The Financial Management Decision Process What are the three types of.docxThe Financial Management Decision Process What are the three types of.docx
The Financial Management Decision Process What are the three types of.docx
 
The Federal Reserve attempts to keep prices stable and unemployment lo.docx
The Federal Reserve attempts to keep prices stable and unemployment lo.docxThe Federal Reserve attempts to keep prices stable and unemployment lo.docx
The Federal Reserve attempts to keep prices stable and unemployment lo.docx
 
The following class stores a list of integer values and contains a met.docx
The following class stores a list of integer values and contains a met.docxThe following class stores a list of integer values and contains a met.docx
The following class stores a list of integer values and contains a met.docx
 
The following accounts were taken from ABC CompanySolutionCalculation.docx
The following accounts were taken from ABC CompanySolutionCalculation.docxThe following accounts were taken from ABC CompanySolutionCalculation.docx
The following accounts were taken from ABC CompanySolutionCalculation.docx
 
The following are key terms in Chapter 14 that relate to regulatory an.docx
The following are key terms in Chapter 14 that relate to regulatory an.docxThe following are key terms in Chapter 14 that relate to regulatory an.docx
The following are key terms in Chapter 14 that relate to regulatory an.docx
 
The following account balances relate to the stockholders equity accou.docx
The following account balances relate to the stockholders equity accou.docxThe following account balances relate to the stockholders equity accou.docx
The following account balances relate to the stockholders equity accou.docx
 
The following accounts were taken from ABC CompanySolutionCalculation (3).docx
The following accounts were taken from ABC CompanySolutionCalculation (3).docxThe following accounts were taken from ABC CompanySolutionCalculation (3).docx
The following accounts were taken from ABC CompanySolutionCalculation (3).docx
 
The following accounts were taken from ABC CompanySolutionCalculation (2).docx
The following accounts were taken from ABC CompanySolutionCalculation (2).docxThe following accounts were taken from ABC CompanySolutionCalculation (2).docx
The following accounts were taken from ABC CompanySolutionCalculation (2).docx
 
The following accounts were taken from ABC CompanySolutionCalculation (1).docx
The following accounts were taken from ABC CompanySolutionCalculation (1).docxThe following accounts were taken from ABC CompanySolutionCalculation (1).docx
The following accounts were taken from ABC CompanySolutionCalculation (1).docx
 
The fiscal 2012 financial statements of Barney Services shows average.docx
The fiscal 2012 financial statements of Barney Services shows average.docxThe fiscal 2012 financial statements of Barney Services shows average.docx
The fiscal 2012 financial statements of Barney Services shows average.docx
 
The equity sections from Atticus Group The equity sections from.docx
The equity sections from Atticus Group        The equity sections from.docxThe equity sections from Atticus Group        The equity sections from.docx
The equity sections from Atticus Group The equity sections from.docx
 
The executive officers of Rouse Corporation have a performance-based c.docx
The executive officers of Rouse Corporation have a performance-based c.docxThe executive officers of Rouse Corporation have a performance-based c.docx
The executive officers of Rouse Corporation have a performance-based c.docx
 
The Federal Reserve had to resort to non-standard methods to try to st.docx
The Federal Reserve had to resort to non-standard methods to try to st.docxThe Federal Reserve had to resort to non-standard methods to try to st.docx
The Federal Reserve had to resort to non-standard methods to try to st.docx
 
The EU recently admitted the Eastern European countries- How do you as.docx
The EU recently admitted the Eastern European countries- How do you as.docxThe EU recently admitted the Eastern European countries- How do you as.docx
The EU recently admitted the Eastern European countries- How do you as.docx
 
The Esposito Import Company had 1 million shares of common stock outst.docx
The Esposito Import Company had 1 million shares of common stock outst.docxThe Esposito Import Company had 1 million shares of common stock outst.docx
The Esposito Import Company had 1 million shares of common stock outst.docx
 
The energy levels of electrons are related to their- a) Position on t.docx
The energy levels of electrons are related to their-  a) Position on t.docxThe energy levels of electrons are related to their-  a) Position on t.docx
The energy levels of electrons are related to their- a) Position on t.docx
 
The Electron in a Hydrogen Atom transforms from its n-1 state to its n.docx
The Electron in a Hydrogen Atom transforms from its n-1 state to its n.docxThe Electron in a Hydrogen Atom transforms from its n-1 state to its n.docx
The Electron in a Hydrogen Atom transforms from its n-1 state to its n.docx
 
The enqueue operation on the Queue ADT adds a new item to the back of (1).docx
The enqueue operation on the Queue ADT adds a new item to the back of (1).docxThe enqueue operation on the Queue ADT adds a new item to the back of (1).docx
The enqueue operation on the Queue ADT adds a new item to the back of (1).docx
 
The Fed follows the theory of bureaucratic behavior in what sense-.docx
The Fed follows the theory of bureaucratic behavior in what sense-.docxThe Fed follows the theory of bureaucratic behavior in what sense-.docx
The Fed follows the theory of bureaucratic behavior in what sense-.docx
 
Pay structures Union contracts Wage and price contracts Levels of reve.docx
Pay structures Union contracts Wage and price contracts Levels of reve.docxPay structures Union contracts Wage and price contracts Levels of reve.docx
Pay structures Union contracts Wage and price contracts Levels of reve.docx
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 

The following codes are supposed to add ten Bytes stored in an array a.docx

  • 1. The following codes are supposed to add ten Bytes stored in an array and store the sum in R4. However, there is an error. Which of the four choices pick up the bug? MOV r0, #10; load r0 with 10 MOV r4. #0 LDR, r1, = Array; load r1 with address Array loop LDRB r2, r1; load one byte to r2 ADD r4, r4, r2; r4 = r4 + r2 ADD r1, r1, #1; increase r1 by 1 SUBS r0, r0, #1; decrease r0 by 1 BNE loop a. BNE loop should be BEQ loop b. loop should not take one line by itself. c. MOV r0, #10 should be MOV r0, #A d. LDRB r2, r1 should be LDRB r2, [r1] Multiple loading and multiple storing instructions allow you to load or store multiple registers from or to memory. Which of the following instructions load r2 with the memory location [r0 + 4] a. LDMIA r2, {r1, r0, r4} b. STMIA r2, {r1, r0, r4}) c. STMIA r0, {r1, r2, r4} d. LDMIA r0, {r1, r2, r4} Let's assume r0, r1, r2,r3, r4, r5 and r6 have the contents of 0 times 90, 0 times 91, 0 times 92,.. and 0 times 96. After the following two stack operations, determine the content of r1. PUSH {r0, r2-r6} POP {r0-r5}. a. 0 times 91 b. 0 times 93 c. 0 times 90 d. 0 times 92 Solution Answers 4. Multiple loading and multiple storing instructions allow you to load multiple registers from memory. which of the following load r2 with the memory location r0+4. (b) STMA r2{r1,r0,r4} 5.Let’s assume r0,r1,r2,r3,r4,r5 and r6 have the contents of 0x90,0x91,…. and 0x96. After following two stack operations , determine the content of r1 (a) 0x91