# Advanced Procedures, Stack Parameters, Locals and BCD Solution

1.      Write a procedure named ArrayFill that fills an array of ten (10) numbers with the geometric progression 3, 6, 12, 24, … etc.  You must only use the first two integers in the series to generate the series.  The procedure receives two arguments:  the first is the offset of an array, and the second is an integer that specifies the array length.  The first argument is passed by value and the second is passed by reference.  In the main program, you should set the parameters of the array and print the array values before and after call to the procedure.

Please embed your code into your homework solution along with a screen shot of the run of the program.

2.      Draft a program that adds two BCD numbers (9-digits each). The first BCD number is stored in an array named myAuburnID, and the second in an array named All1s. The first number is your actual Auburn ID number; the second is 111111111h. Your program should do the following:

1)      Display contents of the memory before program execution,

3)      Store the sum in a variable named Result, and;

4)      Display contents of memory post execution.

3.      Draft a procedure called AddThree that is similar to the AddTwo program within the slides (at or about #30). AddThree receives three parameters x, y and z from the stack and outputs a value equal to x + 2*y + z.   In order to receive credit, your submission must do the following:

1)      Pass parameters x, y, and z by value on the stack using the push instruction.  Use  x= 102, y = 54 and z = 23,

2)      AddThree must get its inputs from the stack,

3)      Call AddThree and print the result to the screen.