CSC 6Fh Programming Assignment 02h Due Wednesday March 6th For this assignment you are to write a procedure that prints 32 bit two's complement values as base ten numbers. For example, for 0FFFFFFFFh you should print "-1". You cannot assume that the number has a fixed number of digits, and you must not print 0's in front of a number, like "034". Here's my suggested algorithm: Reserve a byte variable or register to indicate if the number is negative if the number is negative, remember it as such and "neg" it into a positive number. (I'll be nice and not ask you to handle a special case here - but can you figure out what I mean?) check for the special case where the value is 0. if it is, you can just print 0 and exit (ret). (you might not need to handle the special case, depending on how you set up your loop). if not special case, loop until the value becomes 0: divide the value (div) by 10. Be careful: before dividing, make sure edx contain 0. Read the discription of the div instruction carefully. Add 48 to the remainder. This is the ascii code for this digit. I suggest you use the stack to store this digit, since you'll be printing them out backwards at the end. You can also use a buffer if you wish. The quotient after division now becomes the new "value" in your loop. When loop terminates, first print "-" (code 45) if the number is negative, then print the digits backwards. You obviously also need a counter to keep track of the number of digits in your number. Write this program as a procedure. The parameter to be printed should be passed using a register. Demonstrate the procedure for both positive and negative numbers containing varying numbers of digits. On the class homepage you can find a Java version of the program that implements this algorithm.