Lab 8
- Download and save the files
test.c
and Diff.asm
- gcc -S test.c produces the assembly language version
test.s
. Examine the assembly file to see the code produced by the compiler to
implement a function call.
- Write assembly code for the function with the following
prototype DWORD32 max(DWORD32 , DWORD32), and save it to the
file Max.asm
- Add a call to the function max in the function main
in the file test.c
- Assemble the file Max.asm using the nasm
assembler. Compile the C file. Link the two modules together. Click
here
for details on the mechanics.
- Execute your program and verify that your code works correctly.
- Write assembly code for the function DWORD32 factorial(DWORD32)
in the file Factorial.asm and test it by calling it from the
function main in test.c.