Question

Hello, I am trying to do an assignment that requires writing an MSP432 code to add...

Hello, I am trying to do an assignment that requires writing an MSP432 code to add two 64 bit numbers together and store the result in memory location 0x2000_0000. The problem is that the it is a 32 bit register. I don't know how to add to a load 64 bit numbers. The question is below but please feel free to use your own examples, I will understand better. Thank you very much.

Write a small MSP432 code segment that adds the 64-bit binary numbers 0x1122_3344_5566_7788 and 0x8877_6655_4433_2211 together and stores the 64-bit binary result to memory location 0x2000_0000. Enter the code in your lab tools and cross-check your answer. Include a printout of your source assembly file with the final answer.

Homework Answers

Answer #1

Answer:- The addition can be done using ADDS and ADC instruction. ADD instruction simply adds two data values but ADC adds the data value with carry flag also.

We load the values in registers as-

R1 = 0x5566_7788, R2 = 0x4433_2211 then
R3 = 0x1122_3344, R4 = 0x8877_6655

perform ADDS for R1 and R2 as-
ADDS R5, R1, R2 => R5 = R1 + R2 and update the flag bits

then use ADC i.e. add with carry instruction as-
ADC R6, R3, R4 => R6 = R3 + R4 + Carry from last addition.

Now, R6:R5 has the overall addition result of the 64-bit data mentioned in the question. To store this in the memory we can use STRD instruction i.e. store double. Like-

MOV R1, =0x0x20000000 ;R1 = the address
STRD R5, R6, [R1] ;keep the value of R5 and R6 in the memory 0x20000000.

Dear student, please comment if you have any query. Thank you.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The software I am using Is Logisim. Design and build a circuit to add 2 2-bit...
The software I am using Is Logisim. Design and build a circuit to add 2 2-bit binary numbers. This means that you will have 4 input lines and 3 output lines. The three output lines are 2 bits for the sum and a carry out line. Use logisim to construct your circuit. Upload the .circ file to blackboard
Please answer in JAVA IDS 401 Assignment 4 Deadline In order to receive full credit, this...
Please answer in JAVA IDS 401 Assignment 4 Deadline In order to receive full credit, this assignment must be submitted by the deadline on Blackboard. Submitting your assignment early is recommended, in case problems arise with the submission process. Late submissions will be accepted (but penalized 10pts for each day late) up to one week after the submission deadline. After that, assignments will not be accepted. Assignment The object of this assignment is to construct a mini-banking system that helps...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input...
Using the following code perform ALL of the tasks below in C++: ------------------------------------------------------------------------------------------------------------------------------------------- Implementation: Overload input operator>> a bigint in the following manner: Read in any number of digits [0-9] until a semi colon ";" is encountered. The number may span over multiple lines. You can assume the input is valid. Overload the operator+ so that it adds two bigint together. Overload the subscript operator[]. It should return the i-th digit, where i is the 10^i position. So the first...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...