This lab is not submitted.
You might be helped with this assembler summary.
To generate assembly from the compiler, use the -S switch instead of the -c switch. That will generate a .s file with the assembly in it.For example,
If your machine is configured to run 64 bit code, you will need to add the -m32 switch to get the compiler to generate code that is like we have been using in class.
Write a file min.c that contains a simple function min that takes three ints and returns the minimum of the three. Do not include a main function.
Generate the min.s file and comment it, identifying where each parameter or variable is stored and what each instruction does.
2) hello world
Write a hello.c file that contains two functions.
The function sayHello should take a single string (char *) parameter and write the message "hello" followed by the value passed in.So if you call sayHello("world"), the result should print
You should use printf to do the printing.
The function main should call sayHello("world") as its only work.
Make sure your hello can be compiled all the way and correctly runs.
Generate hello.s and comment it as above. Note that the compiler can do some different things for main.
Modify your hello.s file to make it say goodbye instead of hello.
Compile it with gcc (you can do -c with a .s file) and link it normally to try running it.