Posts Tagged ‘assembler c++’

C++ 64-bit Inline Assembly Primer – Part 1

We can talk directly to our machines in C++ by inserting assembly code via the asm() or extended assembly __asm__ commands.

Doing so allows us to exploit potential performance gains, learn more about our machines, and is in all cases, a fascinating exercise in the lowest level of computer programming.

In this post I want to share a few tips and tricks I’ve learned when using AT&T style syntax on Linux/gcc, and also explain how basic assembly coding works. We’ll start by creating a simple function and checking out the gcc created assembly code. We’ll then take this apart and step through the code to understand how it works.

Read More