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

1. Assume that your register R4 holds the hexadecimal number 4001h and the memor

ID: 1841155 • Letter: 1

Question

1. Assume that your register R4 holds the hexadecimal number 4001h and the memory location 02F7h holds the hexadecimal number 0F18h. Write a program in assembly language such that:

a) These two numbers are added.

b) One’s complement of the sum is saved in register R6.

c) The least significant two hexadecimal digits of the sum are swapped with its two most significant hexadecimal digits. The output is written to register R12.

d) Show the updated bits of the Status Register after each instruction in your mainloop section of your program.

e) Show the contents of all registers and memory locations used after executing each instruction in your mainloop section of your program.

Explanation / Answer

Well, you must specify what Microcontroller are using..

in most microcontrollers, the sum is carried out with specific registers

for example, in the intel 8051 is the A register, now you have to read the instructions, datasheet for make sure what register use.

its the same for the others operations but please indicate what micro are using.

regards.