Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is the value of r0 after the following executes? mov r0, 22 mov r1, 15 sub

ID: 3802288 • Letter: W

Question

What is the value of r0 after the following executes?

mov r0, 22
mov r1, 15
sub r0, r1, r0

   -7
   15
   22
   7

What is the value of r0 after the following executes?

mov r0, 0
ldrh r1, [r0], 4

   8
   0
   4
   16

What is the value of r0 after the following executes?

mov r0, 22
and r0, 2

   22
   24
   2
   26

Why is there no arithmetic shift left?

   It requires that the data type be unsigned.
   It is identical to logical shift left
   There is no way to insert a sign rather than a 0
   It requires a data type that doesn't exist.

What is the value of r0 after the following executes?

mov r0, 7
lsl r0, 2

   7
   2
   28
   14

What is the value of r0 after the following executes?

mov r0, 123
mov r1, r0
add r0, r1, r0

   246
   1
   123
   0
   -123

What is the value of r0 after the following executes?

mov r0, 122
ldrh r1, [r0, 4]

   138
   122
   126
   130

What is the value of r0 after the following executes?

mov r0, 123
mvn r0, r0

   23
   -124
   -44
   123

Explanation / Answer

What is the value of r0 after the following executes?

mov r0, 22
mov r1, 15
sub r0, r1, r0

   -7
   15
   22
   7

Ans:sub r0, r1, r0 this will do r1-r0 and store result in r0.r0=15-22=-7

Hence answer is -7

===============================================================================

What is the value of r0 after the following executes?

mov r0, 22
and r0, 2

   22
   24
   2
   26

It will do 22 & 2=2 and store in r0.Hence answer is 2

=============================================================

Why is there no arithmetic shift left?

   It requires that the data type be unsigned.
   It is identical to logical shift left
   There is no way to insert a sign rather than a 0
   It requires a data type that doesn't exist.

Ans:  It is identical to logical shift left

===============================================================================

What is the value of r0 after the following executes?

mov r0, 7
lsl r0, 2

   7
   2
   28
   14

Ans:It will shift 7 left by 2 bits.Store result in r0

7 in binary is 111

Shift left by 2

11100i.e. 28 in decimal

===============================================================

  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote