Question: The following code fragment adds two 32-bit signed (two's complement) numbers, numberl and number2, and leaves the result in number2, number: .word 0x8C50, 0x0012 number2:

The following code fragment adds two 32-bit signed (two's complement) numbers, numberl and number2, and leaves the result in number2, number: .word 0x8C50, 0x0012 number2: .word 0x21B7, 0x010A mov number1, wO add number2 mov number1+2,wO addc number2+2 Please answer the following: (a) How many bytes of program memory are occupied by this code fragment? (b) After the addition is completed what values do you expect in the each of the bytes of numberi and of number2? List the 4 bytes for each (in the order low to high) and the corresponding value of each byte. (c) What are the values of the DC, N, OV, Z, and C bits in the status register i. Immediately after the instruction add executes ii. Immediately after the instruction addc executes. (d) What registers have changed after the code fragment given above executes? (List the registers, including file registers (data memory locations), you do not need to give their values)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
