x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)

x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)

Your x86-64 assembly program looks correct, links with GCC, calls printf, and then crashes with a segfault. This video shows exactly why it happens and how to fix it.br br We build a hybrid program using Yasm and GCC on Linux, print a message from C++, call an assembly function, and hit the crash. Then we fix it with a push and pop of RAX, move the fix into the function prologue and epilogue, and run experiments to prove it works.br br No long lectures, just code, a real crash, and a real solution that stops the problem for good.


User: Neural Lantern

Views: 4

Uploaded: 2025-11-16

Duration: 18:43