> For the complete documentation index, see [llms.txt](https://computerscienceeducation.gitbook.io/co-lab-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://computerscienceeducation.gitbook.io/co-lab-manual/assignments/mandatory-assignments/a1-hello-world.md).

# 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:

```
Computer Organization 2024
Assignment 1 - hello
by: <your names>
```

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

1. Start by inspecting the given skeleton file in the framework.\
   *Where does your program start? Where do you place the needed string(s)? ...*
2. 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.
3. Extend the program such that it prints the message (using a call to the `printf` library function).

{% hint style="success" %}
**Reminder:**

You can **build your program** with the

```bash
make a1-hello/a1-hello
```

command and **execute** the resulting binary with

```bash
./a1-hello/a1-hello
```

You can alternatively **build and run your program** in one step with the `make a1` command.
{% endhint %}

***

## 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](/co-lab-manual/reference-documentation/instructions.md) and [Registers](/co-lab-manual/reference-documentation/registers.md).
* For your `main` routine you should understand how to write a [Prologue](/co-lab-manual/reference-documentation/subroutines/writing-subroutines.md#prologue) and [Epilogue](/co-lab-manual/reference-documentation/subroutines/writing-subroutines.md#epilogue) from the page about [Writing Subroutines](/co-lab-manual/reference-documentation/subroutines/writing-subroutines.md) and you should understand the difference between Callee and Caller Saved Registers.
* Furthermore, you should read the page about [Printing to the Terminal](/co-lab-manual/reference-documentation/input-output/printing-to-the-terminal.md), however, for this assignment, you do not yet need to work with additional arguments, so the first part should be sufficient.

***

## Note on Submission

{% hint style="warning" %}
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.
{% endhint %}
