Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Electrical & Electronics Expert

Lab Objective

- Using the stack to store data
- Writing programs using subroutines
- Parameter passing using the stack

Procedure:

Part I: Using the stack to store data

Complete the following program to store the listed data into the RAM locations starting at $3000 using the stack pointer and the PUSH command. Use memory dump (md) command to see the data stored at the memory locations and include in your lab report.

Data: $55AA, $6811, $6CA0, $1ABC, $5AB3

ORG   

$2000

LDS 

#$3000

LDX

#$55AA

PSHX  

 

LDX 

 

.

 

.

 

PULX

 

SWI

 

  1. Add comments for each assembly line in your report. Include a screen shot of data stored. You can use md 2FF0 to see data stored in memory. Why?
  2. Why index register X has been used to load data and not ACCA?
  3. Does the high byte store first or the low byte?
  4. What data index register X will contain at the end of the program?

Part II: Subroutines

Write a program that finds the square of a number listed below in a subroutine and stores the results into the memory locations $2100-$2104. Complete the following program and use memory dump (md) to see the result obtained. Do not forget to add comments to the each program line and explain its operation.

Hint: Multiplying a number by itself will make it square. You can also get some idea from the program on page 117 of the textbook.

Numbers: $0A, $0C, $0B, $0F

ORG   

$2000

LDS 

#$3000

LDX

#$55AA

PSHX  

 

LDX 

 

.

 

.

 

PULX

 

SWI

 

 

SQUARE:

.

TAB

MUL

.

RTS

Part III: Parameter passing using the stack

Write a program to send the following listed data stored at memory locations $2100-$210F to a subroutine that adds them up. Store the result at memory location $21FF. Use "md" to see the result and include in your report.

Data (numbers are in decimal): 10,15,34,4,5,6,9,23,38,2,11,14,15,9,7

Do not forget to include a screen shot of the program with zero compilation error and load to the board successfully.

Electrical & Electronics, Engineering

  • Category:- Electrical & Electronics
  • Reference No.:- M91259415
  • Price:- $55

Guranteed 36 Hours Delivery, In Price:- $55

Have any Question?


Related Questions in Electrical & Electronics

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 ...

Problem 1given a sequence xn for 0lenle3 where x0 1 x1 1

Problem # 1: Given a sequence x(n) for 0≤n≤3, where x(0) = 1, x(1) = 1, x(2) = -1, and x(3) = 0, compute its DFT X(k). (Use DFT formula, don't use MATLAB function) Problem # 2: Use inverse DFT and apply it on the Fourier ...

Problem 1 a two-phase servomotor has rated voltage applied

Problem 1: A two-phase servomotor has rated voltage applied to its excitation winding. The torque speed characteristic of the motor with Vc = 220 V, 60 Hz applied to its control phase winding is shown in Fig.1. The momen ...

Question 1 a pnp transistor withnbspbeta 60 is connected

Question 1. A pnp transistor with β = 60 is connected in a common-base configuration as shown in figure P5.8 (a) The emitter is driven by a constant-current source with I E = 0.75 mA. Determine I B , I C , α, and V C . ( ...

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 - ...

Problem 1given a sequence xn for 0lenle3 where x0 1 x1 1

Problem # 1: Given a sequence x(n) for 0≤n≤3, where x(0) = 1, x(1) = 1, x(2) = -1, and x(3) = 0, compute its DFT X(k). (Use DFT formula, don't use MATLAB function) Problem # 2: Use inverse DFT and apply it on the Fourier ...

Nanotechnology engineering program assignment - passive

Nanotechnology Engineering Program Assignment - Passive Filters Q1) Determine what type of filter is in circuit shown. Calculate the cutoff frequency f c . Q2) Determine what type of filter is in circuit shown. Calculate ...

Research report1 read 3 to 4 journal articles about

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 ...

Advanced computational techniques in engineering assignment

Advanced Computational Techniques in Engineering Assignment - Optimisation For this assignment, you are required to carry out the process of attempting to solve different optimisation problems. For each question, you are ...

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