Homework 12 - ELEC 2220 Computer Systems Homework #12 Due:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Homework #12 Due: Wednesday, June 30 Program 1 (parameters passed in registers) Write a subroutine that finds and returns the smallest value in an array of signed 16-bit numbers. The subroutine should be capable of searching an array of any size (up to 256 words), and starting at any address in memory. Pass the starting address of the array to the subroutine in the X register, and the size of the array in accumulator B. Return the smallest value in the array to the calling program in register Y. To test the subroutine, define the following variables in the data area, and write a single "main" program that calls the subroutine two times, once to find the smallest value in Array1, storing it in Value1, and once to find and store the smallest value from Array2 in Value2. Array1: dc.w 30,-5500,129,-1080,25000,-20000,200,-4,-220,0 Array2: dc.w -200,-1000,50,12800,70 Value1: ds.w 1 Value2: ds.w 1 Main Program Example: ...set up first call ...call subroutine ...store first result
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Homework 12 - ELEC 2220 Computer Systems Homework #12 Due:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online