A "Hello World" example in x86-64 assembly for macOS
Follow along the full tutorial: Learn x86-64 Assembly for macOS: Hello World
The full tutorial includes core concepts in assembly and a line-by-line code explanation. You'll need to understand what the code means in order to write your own assembly code or to use your knowledge for reverse engineering. To simply assemble and run the program, open Terminal and follow the steps below:
Clone this project:
git clone https://github.com/ZeroDayArcade/x86-64-assembly-macos-hello-world.git
cd into the project directory:
cd x86-64-assembly-macos-hello-world
Assemble the code into an object (.o) file:
as hello_assembly.s -o hello_assembly.o
Create a UNIX executable with the object file using gcc:
gcc -o hello_assembly hello_assembly.o -nostdlib -static
./hello_assembly
You should now see "Hello World" printed in the Terminal.