danglin
February 10th, 2005, 01:21 PM
I've done this several times and keep getting it wrong. Can one of you genius help. This is driving me nuts. Thank you
Question 27:
Write a GAL subprogram called min, which finds the smallest value in an array of 100 integers. Assume the base address of the array is given in reg0, and return the smallest value in reg1. Any other registers that your subprogram modifies should be saved and restored to their original states.
Question 31:
Rewrite your answer to Question 27, using a stack to pass parameters according to the following model,
**************
Return_address <------------SP(top-of-stack register)
**************
Array_base
**************
Var_location
*************
*************
System stack
Where the value contained in var_location is the address where the smallest value in the array should be stored. Assume that reg7 is acting as SP, the top-of stack pointer.
Question 27:
Write a GAL subprogram called min, which finds the smallest value in an array of 100 integers. Assume the base address of the array is given in reg0, and return the smallest value in reg1. Any other registers that your subprogram modifies should be saved and restored to their original states.
Question 31:
Rewrite your answer to Question 27, using a stack to pass parameters according to the following model,
**************
Return_address <------------SP(top-of-stack register)
**************
Array_base
**************
Var_location
*************
*************
System stack
Where the value contained in var_location is the address where the smallest value in the array should be stored. Assume that reg7 is acting as SP, the top-of stack pointer.