6) Chose the C code that most likely created this assembly code here CMP RO,R:1
ID: 3590784 • Letter: 6
Question
6) Chose the C code that most likely created this assembly code here CMP RO,R:1 ADD R0,R0, #15 BEQ here a) if(R01-R1)( R0-R0+15) b) while(ROI= R1) { c) while(R0 =-15) { } d) while(R1 -- R0) {RO-R0+15) e) none of the above 7) Chose the C code that most likely created this assembly code ORRS RO,RO,R1 BNE here MOV R1,#1 B there MOV R0,#1 here there a) if (RO I| R1) R0-1; b) if (R0 ||l R1) R1-1; c) if (R0 =-R1) R0-1; d) if (R0 =-R1) R1-1; else R1 -1; else RO - 1; else R1 - 1; else R0 -1; e) none of the aboveExplanation / Answer
6)
a) as the branch is checking the equality not the inequality
b) as the branch is checking the equality not the inequality and R0 is not incrementing
c) the branch is checking equality with R1 and not 15
so ans is d) the branch is checking the equality and if equal increment the value of R0 by 15
7)
a) here if condition is true assign R0 to 1 instead of R1
c) here it is checking if both R0 and R1 are equal instead of check if either one is true the condtion is true.
d) same as c) here it is checking if both R0 and R1 are equal instead of check if either one is true the condtion is true.
so ans is b) if either one (R0 or R1) is true the condition is true and assign R1 to 1
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.