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

In addition to the MOV and ADD instructions, you can also use the subtraction in

ID: 1809265 • Letter: I

Question

In addition to the MOV and ADD instructions, you can also use the subtraction instruction (described below) in this problem. SUB Dst, Src <---> Dst <--- Src - Dst In this problem, there are two arrays "arr3" and "arr4," each capable of holding three bytes of data. Initially arr3 holds three numeric characters ('0' to '9'). The task for your assembly code is twofold. First the numeric characters in arr3 should be converted into their numeric values. Then these values must be arranged in reverse order in arr4. As an example suppose the three bytes in arr3 are '1', '2' and '3' (in that order). That is, the values (in hexadecimal) in arr3 are 31H, 32H and 33H, respectively (see Table 1-8, page 36 of the text). Then after executing your assembly code, the three bytes of arr4 should contain 03H, 02H and 01H (in that order). Your program should work for any numeric characters in arr3, not just what the example illustrates. Try to use as few instructions as possible. Please explain answer. If the answer is not included, explained in detail, and instructions dont follow the question, 1 star will be given

Explanation / Answer

Let the starting location on arr3 be 1000H and arr4 be 1003H

MOV R0,1000H

SUB R0,#30H

MOV 1003H,r0


MOV R0,1001H

SUB R0,#30H

MOV 1004H,R0


MOV R0,1002H

SUB R0,#30H

MOV 1005H,R0


subtracting 30H gives the actual value

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