Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use code warrior to code it please screenshot for code Allocate a 6-byte array samples and a variable tsum in the RAM area of
please use code warrior to code it
Allocate a 6-byte array samples and a variable tsum in the RAM area of memory. Initialize the array, samples, with the signed integers, $10, $20, $30, $AO, $BO and $CO. Write a program (do not use a loop) which computes the sum of the six 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 from the first integer toward the last (6th) one, i.e., using the register a as an accumulator. The variable 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 offset indexed, register offset indexed and auto- increment/decrement indexed addressing modes. Your program should work correctly independent of the contents (integer values) of the array. The auto-increment/ decrement indexed addressing mode should be used at least twice in a row. RAMStart=80800 and ROMStart=84000. 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 1st, 3rdh and 5th additions is completed and also right after the total sum is stored in tsum. Submit a single PDF file including the list file of your code, the 4 sets of screen-captures, and the 4 flags (if each of N, Z, C, and V is set or cleared) right after each addition (also determine if and when an overflow occurs) please screenshot for code
Allocate a 6-byte array samples and a variable tsum in the RAM area of memory. Initialize
the array, samples, with the signed integers, $10, $20, $30, $A0, $B0 and $C0. Write a program
(do not use a loop) which computes the sum of the six 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 from the
first integer toward the last (6th) one, i.e., using the register a as an accumulator. The variable
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 offset indexed, register offset indexed and auto-
increment/decrement indexed addressing modes. Your program should work correctly independent
of the contents (integer values) of 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 1st,3rdh and 5th additions is completed and also right after the total
sum is stored in tsum.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started