Linux x64 Assembly Tutorial 1: Getting a Value from NASM into G++ @WhatsACreel
Linux x64 Assembly Tutorial 1: Getting a Value from NASM into G++  @WhatsACreel
Uploaded December 2012 | Updated November 2026, 4 hours ago
This tutorial is a remake of the first Windows C++ and ASM tutorial only I'm using Ubuntu. I'm in Ubuntu 12.10 here with G++ and NASM. For a text editor I'm a big fan of the ultra minimalist Nano. We'll probably have to shift to something a little heavier weight eventually.

This tute is just a little example of how to return an integer from assembly to C++. We'll look at inline assembly first using the GNU assembler. This assembler uses AT&T syntax, in the following tutorial we look at how to link a native GAS AT&T syntax object file.

The crux of the tutorial is creating an external NASM assembly source file, assembling it to an elf object file and linking it to our executable with G++.

I hope this helps. I've not explained very much in this tutorial but hopefully we can get to that later.

FaceBook:
facebook.com/pages/WhatsaCreel/167732956665435
Linux x64 Assembly Tutorial 1: Getting a Value from NASM into G++AES Encryption 1: Intro and OutlineIntroduction to Quantum ComputingTop 10 Data Structures in Computer Science (Crash Course)C++ Tutorial 4: ++   and Compound AssignmentsIntroduction to Neural Networks (AI vs Biological Neural Nets)Computer Science Lockdown Quizx64 Assembly Tutorial 51: Shuffle InstructionsC# Windows 8 Tutorial 4: A Token Classx64 Assembly Tutorial 57: SSE Inserting and Extracting InstructionsLinux x64 Assembly Tutorial 6: Shifting BitsAmendment to Vector vs List
Creel |

Linux x64 Assembly Tutorial 1: Getting a Value from NASM into G++

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER