# Programming Exercise 6: Assembly Printing This is the continuation of hw5 and the last part of this series. You can continue from your own code or use the parser from the website as starting point. ## Implementation Print out assembly code from your instruction-selected-and-register-allocated-LLVM-IR that can be compiled by a standard assembler (e.g., GNU as). - Export functions with `.global` and set a proper symbol type and size, e.g. using `.type func, @function` and (at the end) `.size func, .-func`. - Create a sufficiently large and suitably aligned stack frame, which you clean up before return. If your architecture uses a link register, remember to store it as well. Calculate offsets into your stack frame for all alloca instructions. - Take care of basic block labels; make use of fallthrough where easily possible, but don't forget to emit proper branches if this is impossible. - Annotate your function correctly with CFI directives. Enjoy your working compiler! # Submission Send an e-mail to engelke+cghomework@in.tum.de until 2024-02-07, 23:59 with: - Subject: "Homework 6: YourMatrNr YourName" - A single(!) .tar.xz file attached named with "hw6-YourMatrNr-YourLastName.tar.xz", which contains a single folder "hw6-YourMatrNr-YourLastName", which contains your submission - The message body can remain empty - Include a Makefile with compilation directives s.t. `make` compiles the code - Specify correct dependencies in the Makefile - Use `llvm-config --cppflags --ldflags --libs` to find LLVM. - Avoid external dependencies and complex build systems (no cmake, cargo, etc.) - Put the source in a single source file (if easily possible) - Include answers to theory questions as comments in the source file