A1: Hello World
It's time to finally start writing some code. Even though Assembly may be quite different from your usual programming languages, your first program will be something similar: write the customary Hello World program (just this time in x86-64 Assembly).
Your program should use the printf
function to print the following message:
where <your names>
is replaces by your name(s). You should not need more than one call to printf
to display the message.
Recommended Approach
Start by inspecting the given skeleton file in the framework. Where does your program start? Where do you place the needed string(s)? ...
Implement an "empty"
main
routine that exits the program immediately, but with the proper return code and without crashing (-> exiting gracefully). Make sure to give it a proper prologue and epilogue.Extend the program such that it prints the message (using a call to the
printf
library function).
Reminder:
You can build your program with the
command and execute the resulting binary with
You can alternatively build and run your program in one step with the make a1
command.
Required Knowledge
This assignment requires you to write a main
routine that performs a single call to the printf
library function before returning with the proper return value. For this, you need to know and understand various concepts:
You should understand the concepts of Instructions and Registers.
For your
main
routine you should understand how to write a Prologue and Epilogue from the page about Writing Subroutines and you should understand the difference between Callee and Caller Saved Registers.Furthermore, you should read the page about Printing to the Terminal, however, for this assignment, you do not yet need to work with additional arguments, so the first part should be sufficient.
Note on Submission
You can only get your submission for this assignment checked by a TA alongside your submission for assignment 2. Only enter the submission queue when both assignments are fully implemented and pass all tests on CodeGrade.
Last updated