Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use codewarrior to do code warrior Allocate a 6-byte array samples and a variable tsum in the RAM area of memory. Initialize the array, samples,

use codewarrior to do
code warrior
image text in transcribed
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=$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. 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). 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=$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. 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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

What roles have these individuals played in your life?

Answered: 1 week ago