Write a subroutine to sort an array of 8b values in ascending order. The parameters are to the sort are passed on the stack. These include a pointer to the start of the array (16b) and the size of the array (8b). Nothing is returned. Write a subroutine that returns an 8 bit random number in accumulator B. The subroutine takes no arguments, should callee save all the registers and flags, and should use a static variable (global variable) to hold the last random number generated. Write a program that uses these two functions to fill an array of bytes with random numbers and sort them. Then modify your sort function to allow sorting in asecnding or descnding order. You need to add an additional argument to the function to choose between ascending and descending order. This program requires the simulator HC12SIM. You are able to find this simulator easily on any search engines. The simulator is a .jar. file. Create a program with mini ide. Simulator uses bgnd instead of swi to end programs. I have tried to do it, but somehow it doesn't work. I have attached what I did (see other files). You can either rewrite it or modify it, as long as it works.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.
## Platform
HC12SIM