Question: COMPLETE USING CODE WARRIOR Allocate a 7-byte array, samples and a variable tsum in the RAM area of memory. Initialize the array, samples, with the
COMPLETE USING CODE WARRIOR
Allocate a 7-byte array, samples and a variable tsum in the RAM area of memory. Initialize the array, samples, with the signed integers, $D0, $B0, $90, $70, $50, $30 and $10. Write a program which computes the sum of the seven integers in the array, samples and stores the total sum in the variable, tsum. The integers in samples are to be added to the register a in the reverse order, i.e., the last (the 7th) integer rst and the rst one last. Use the register a as an accumulator and tsum should be accessed only after the total sum is obtained. You are required to use all of the 4 addressing modes, i.e., extended, constant oset indexed, register oset indexed and autoincrement/decrement indexed addressing modes. Your program should work correctly independent of the contents in the array. The auto-increment/decrement indexed addressing mode should be used at least twice in a row. RAMStart=$0800 and ROMStart=$4000. Assemble the program and execute it in the single-step mode with the contents of samples and tsum displayed in the memory window. Do screen-captures (the source, register and memory windows) at each of the following instances:
Right after each of the 3rd, 5th and 7th additions is completed and also right after the total sum is stored in tsum.
Submit the list le of your code with the 4 sets of screen-captures attached. Also, record the 4 ags (N, Z, C, and V) right after each addition is performed and determine if and when an overow occurs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
