CSC 124: x86 Assembly Warmup. Following the examples on the web page and posted in class, you are to hand-code the following programs in assembly language. Make a .s file and use gcc to produce an executable. 1. Write a program that prints the first 20 Fibonacci numbers: 0 1 1 2 3 5 8 13 ... To print, call printf. Declare STR0: .string "%d " in the .data section, Then to print the contents of the eax register, for example, do push %eax push $STR0 call printf add $8, %esp Arguments must be pushed on to the stack in reverse order. The function will expect the first argument on top of the rest. 2. Write a program with a function MAX that takes three parameters and returns the largest of the parameters passed to it. Then write a main with both scanf and printf calls as well as a call to this function. Follow the C calling convention. In C, int a, b, c; scanf("%d %d %d",&a,&b,&c); will read three ints into a,b,c. You have to think carefully about what should be on top of the stack. --- For these programs, you can always write it in C and use gcc -S to get the assembly, but you will be fooling yourself because soon or later you'll have to produce assembly code yourself. There'll also be obvious signs that you used gcc to produce the assembly, so please don't do that.