1complete the following program to store the listed data


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

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

ORG $2000
LDS #$3000
LDX #$55AA
PSHX
LDX
.
.
PULX
SWI

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?
Why index register X has been used to load data and not ACCA?
Does the high byte store first or the low byte?
What data index register X will contain at the end of the program?
2.

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.

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

ORG $2000
LDS #$3000
LDX #$55AA
PSHX
LDX
.
.
PULX
SWI


SQUARE:

.

TAB

MUL

.

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

(Hint: When a subroutine is called the two-byte return address is pushed into stack. If you use stack in the subroutine you need to consider these two bytes. Read and store them somewhere before using stack, store return address into the stack right before RET instruction in the subroutine.

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: 1complete the following program to store the listed data
Reference No:- TGS0965649

Expected delivery within 24 Hours