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

Write short, snappy little assembly code fragments to per-form the following tas

ID: 1846221 • Letter: W

Question

Write short, snappy little assembly code fragments to per-form the following tasks: (a)   Add two 32-bit numbers, one in file registers 0x800 and 0x802, and        the other in file registers 0x804 and 0x806 (little-endian format: most        significant word in the second register in each case.) (b) Write a loop (its body consisting, in this case, of only a NOP in-       struction) which will execute exactly a number of times determined       by the value of the working register, W0. (So, if W0 contains 33, the       NOP in the loop should be executed exactly 33 times.) (c) Load the address of a variable (defined in a .bss segment statement       as Write short, snappy little assembly code fragments to per-form the following tasks: (a)   Add two 32-bit numbers, one in file registers 0x800 and 0x802, and        the other in file registers 0x804 and 0x806 (little-endian format: most        significant word in the second register in each case.) (b) Write a loop (its body consisting, in this case, of only a NOP in-       struction) which will execute exactly a number of times determined       by the value of the working register, W0. (So, if W0 contains 33, the       NOP in the loop should be executed exactly 33 times.) (c) Load the address of a variable (defined in a .bss segment statement       as

Explanation / Answer

d)

LDR W5,[W1+12];

MOV W4,W5 LSR#12;

MOV W5,W5 LSL#4;

STR W5,[W1+12];


LDR W5,[W1+8];

MOV W3,W5 LSR#12;

MOV W5,W5 LSL#4;

OR W5,W5,W4;

STR W5,[W1+8];


LDR W5,[W1+4];

MOV W4,W5 LSR#12;

MOV W5,W5 LSL#4;

OR W5,W5,W3;

STR W5,[W1+4];


LDR W5,[W1];

MOV W3,W5 LSR#12;

MOV W5,W5 LSL#4;

OR W5,W5,W4;

STR W5,[W1];

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote