Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Other Engineering Expert

Write a program to use a subroutine to find the sum of the array elements. For simplicity, assume that the sum of the data values is less than $FF. You do not need to use the BCC to check for carry flag. Follow the following steps to write this program.

- Define two arrays called List1 and List2 using DC.B directive. Initialize List1 with byte-size values of $6, $12, $4, $0F, and $11. Initialize List2 with byte-size values of $4, $5, and $7. Reserve two byte-size locations called Sum1 and Sum2 using DS.B directive.

- The subroutine must find the sum of the elements of the array list1. Before calling the subroutine, the main program must initialize Register X to have the address of the array and Register B to have the size of the array. 

- The subroutine must use a loop and indexed addressing mode using Register X as the index register and Register B as the loop counter. The subroutine must return the sum in Register A.

- The main program must call the subroutine two times. The first time, the subroutine will find the sum of the array List1. After returning from the subroutine, the main code must save Register A in Sum1. Then, the subroutine is called for a second time to find the sum of the elements in List2. After the return from the subroutine, the value of Register A is saved in Sum2.

- Since this code is using a subroutine, make sure to initialize the SP register using: LDS   #$4000.

This line must be added to the main code before calling any subroutines.

Other Engineering, Engineering

  • Category:- Other Engineering
  • Reference No.:- M91375277
  • Price:- $30

Guranteed 24 Hours Delivery, In Price:- $30

Have any Question?


Related Questions in Other Engineering

Mine safety amp environmental engineeringpart 1 questions1

Mine Safety & Environmental Engineering Part 1. Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the following terms ...

Part 1configure verify and troubleshoot wan links and ip

Part 1 Configure, verify and troubleshoot WAN links and IP services Answer to all questions below: 1. What is the name of the Safe Work Australia code of practise that provides guidance on how to manage the risks of elec ...

This is your second design assignment this assignment

This is your second design assignment. This assignment requires you to design a complex state machine. You are designing a digital alarm clock. There are various designs you can attempt. More complex designs are worth mo ...

Mine safety amp environmental engineeringpart 1 questions1

Mine Safety & Environmental Engineering Part 1. Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the following terms ...

Mine safety amp environmental engineering assignment -part

Mine Safety & Environmental Engineering Assignment - Part 1 - Questions 1. Occupational health and safety is the primary factor that needs to be considered in the mining industry. Discuss this statement. 2. Define the fo ...

Projectflow processing of liquor in a mineral refining

Project Flow Processing of Liquor in a Mineral Refining Plant The aim of this project is to design a flow processing system of liquor (slurry) in a mineral (aluminum) refining plant. Aluminum is manufactured in two phase ...

Question 1 define rock mechanics discuss the main

Question 1 . Define rock mechanics. Discuss the main objectives of the application of rock mechanics in mining. Question 2. Define stress. Draw a diagram and define the normal and shear stress by resolving the resultant ...

Assignment 11 what is the purpose of ore reserve and

ASSIGNMENT 1 1. What is the purpose of ore reserve and resource estimation? Why are resource and reserve estimates important to the mining industry? 2. What is meant by ore? What is meant by the term waste? How is the di ...

Question - show that the zero-point energy of a simple

Question - Show that the zero-point energy of a simple harmonic oscillator does not contribute to its entropy or heat capacity, but does contribute to its energy and Helmholtz function.

Control theory - lab reportsfor experiments 1 to 4 you must

Control Theory - Lab Reports For experiments 1 to 4 you must undertake the following: a) At the start of each section (including the pre-lab activities) there are a number learning outcomes. That is, what students should ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As