Homework Assignment 6 CS 350c Unique Number: 51160 Spring, 2016 Given: February 23, 2016 Due: March 3, 2016 This homework concerns improving your knowledge of our simple microprocessor (SM). You are asked to implement these C-language functions (see below) using the SM (simulator). You may write this code any way you see fit. But, you are more likely to get reliable results if you build some tools to assist your effort. Having good tools can be the difference between success and failure. So, creating a calling convention, figuring out a way to resolve jumps, idioms for indexing arrays, etc., are all issues that it would be best to get clear in your mind before you start trying to code. Remember, you are the designer. You are trying to cooperate with the hardware designers that have created SM without too much input from you. Now, you have to deal with what you have -- can you? short int tarai( short int x, short int y, short int z ) // From homework #2, but using signed, 16-bit numbers. { if (y < x) return tarai( tarai( x-1, y, z ), tarai( y-1, z, x ), tarai( z-1, x, y )); else return y; } short int sorted( short int *mem_ptr, unsigned short int entries ) // For all entries, routine checks that // mem_ptr[ i ] <= mem_prt[ i + 1 ] // Returns 1 if true; otherwise, returns 0 { short int ans = 1; short int i; for( i = 0 ; ans && i < (entries - 1) ; i++ ) ans = mem_ptr[ i ] <= mem_ptr[ i + 1 ]; return( ans ); }