Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Electrical & Electronics Expert

Write a program in machine code 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.
Copy and paste the source code.
Copy and paste the assembly, register, and memory after the first JSR instruction to verify that stack holds the return address.
Copy and paste the memory window to show the values of Sum1 and Sum2.

Electrical & Electronics, Engineering

  • Category:- Electrical & Electronics
  • Reference No.:- M9886386

Have any Question?


Related Questions in Electrical & Electronics

Questions -problem 1 - a series rlc network has r 2 komega

Questions - Problem 1 - A series RLC network has R = 2 kΩ, L = 40 mH and C = 1μF. Calculate the impedance at resonance and at one-fourth, one-half, twice, and four times the resonant frequency. Problem 2 - Design a serie ...

Case studythis assignment consists of a written report of

CASE STUDY This assignment consists of a written report of approximately 1000 words and any diagrams in which you are asked to critically compare different process methods used to achieve the same result and show an awar ...

Question 1 - for the transistor in the circuit shown in

Question 1 - For the transistor in the circuit shown in Figure, assume β = 120. Design the circuit such that I CQ = 0.15 mA and R TH = 200kΩ. What is the value of V CEQ ? Question 2 - (a) For the circuit shown in figure, ...

Research report1 read 3 to 4 journal articles about digital

Research report 1. Read 3 to 4 journal articles about digital control or industrial control, eg. one particular application, implementation aspect such as selection of sampling time, hardware etc. No text book example is ...

Electrical engineering questions -q1 two ideal voltage

Electrical Engineering Questions - Q1. Two ideal voltage sources designated as machines 1 and 2 are connected, as shown in the figure below. Given E 1 = 65∠0 o V, E 2 = 65∠30 o V, Z = 3Ω. Determine if Machine 1 is genera ...

Questions -q1 a single-phase transformer rated 21 kv130 v

Questions - Q1. A single-phase transformer rated 2.1 kV/130 V, 7.8 kVA has the following winding parameters: r1= 0.7Ω, x1 = 0.9Ω, r2 = 0.04Ω and x2 = 0.05Ω. Determine: a. The combined winding resistance ________ Ω and le ...

Questions -problem 1 - determine the laplace transform ofa

Questions - Problem 1 - Determine the Laplace transform of: (a) cos(ωt + θ) (b) sin(ωt + θ) Problem 2 - Obtain the Laplace transform of each of the following functions: (a) e -2t cos(3t)u(t) (b) e -2t sin(4t)u(t) (c) e - ...

Questions -problem 1 - given the sinuosidal voltage vt 50

Questions - Problem 1 - Given the sinuosidal voltage v(t) = 50 cos(30t+10 o ) V, find: (a) the amplitude V m (b) the period T, (c) the frequency f and (d) v(t) at t = 10 ms. Problem 2 - A current source in a linear circu ...

Assignment - power distribution system transformerscomplete

Assignment - Power Distribution System Transformers Complete your calculations, drawings, and answers, neatly handwritten on these sheets and hand in at the start of lecture in week 6. Absolutely no late submissions will ...

1 a name the three major groups of contamination and

1. (a) Name the three major groups of contamination and briefly describe their physical characteristics. (b) Where do the above contamination types come from? Give one example of each. 2. Name two processes metrics which ...

  • 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