Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program of this exercise deals with arrays of numbers and subroutines. At the beginning of your program you will allocate empty storage for two

The program of this exercise deals with arrays of numbers and subroutines. At the beginning of your program you will allocate empty storage for two original arrays and their sorted versions. For the overall program layout, use the program skeleton file (lab2-v32-inA-skl).

;Memory allocation of Arrays must be done before the RESET and StopWDT

ARY1.set0x0200 ;Memory allocation ARY1

ARY1S.set0x0210 ;Memory allocation ARYS

ARY2.set0x0220 ;Memory allocation ARY2

ARY2S.set0x0230 ;Memory allocation AR2S

;------------------------------------ Main Block -----------------------------------

clrR4 ;clearing all register being use is a good

clrR5 ;programming practice

SORT1 mov.w #ARY1, R5 ;initialize R5 as a pointer to array1

mov.w #ARY1S, R6 ;initialize R6 as a pointer to array1 sorted

call #ArraySetup1;then call subroutine ArraySetup1

Call SORT ;then call subroutine SORT

SORT2 ......

......

SORT ...... ;subroutine SORT sorts array from ...... ;lowest to highest value

Mainloop jmp Mainloop ;Infinite Loop

ArraySetup1mov.b#10, 0(R5) ;Memory allocation Subroutine

mov.b#1, 1(R5) ;First start with the number of elements

mov.b#2, 2(R5) ;and then fill in the element.

......

ret

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 Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago