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

Question 1 Write a single ARM assembly instruction equivalent to the following i

ID: 3725425 • Letter: Q

Question

Question 1 Write a single ARM assembly instruction equivalent to the following instruction sequence MOV r1, r1, LSL #4 SUB rl, r2, rl Write a single ARM assembly instruction which will multiply an integer stored in r3 by 33, placing the product in r4. Do not use an explicit multiplication instruction (MLA, MUL, SMLAL, or SMULL) Write a single ARM assembly instruction equivalent to the following MOV r10, #0x22 SUB r11, r10, r8 Write a short ARM assembly program which loads the value 0x08CB85A1 into register rO. You may only use the instructions AND and OR, as well as the barrel shifter. Assume all source registers may be used as scratch registers Question 5 Write a short ARM assembly program that evaluates the following expression. You should not destroy the value of any register other than r0 which will get the computed expression value (and of course R15, which is the PC) rO(r3r4 r5) 18+156 (4 r1) Question 6 Which ones of the following are valid ARM immediates and which ones are not valid? For invalid immediates, explain why they are invalid #0xC000000A #0x0ab1 0000 #0x00002D80 #0x0000030E #9536

Explanation / Answer

Question 1:

SUB r1,r2,r1,LSL #4

Question 2:

ADD r4,r3,r3,LSL #5

Question 3:

SUB r11,r8,#0x22

Question 4:

AND r0,r0,#0
OR r0,r0,#0x08CB
OR r0,r0,LSL #4,#0x85A1

Question 5:

add r0,r3,r4
add r0,r0,r5
lsr r0,r0,#3
add r0,r0,#156
sub r0,r0,r1,LSL #2

Question 6:

Valid :-
#0xC000000A
#0x00002D80
#0x0000030E
#9536

Invalid :-

#0x0ab10000 - hexadecimals should be written in capital after # as they are immediate values

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