video not played or not found error
click on direct switch
Hosted by Dailymotion. For legal issues: Copyright Center · DMC · Instant Removal
x86-64 Assembly: Local Variables, Stack Frames & Alignment Explained
6 Views • Mar 16, 2026
Description
Great for anyone studying systems programming, computer architecture, or just trying to figure out why their assembly program randomly crashes on a library call.
Like + subscribe if you want more clear, practical assembly tutorials!
00:00 Introduction to Local Variables on the Stack
00:28 C++ Example of Function and Local Variables
01:06 Incoming Arguments in RDI vs Stack Variables
03:24 Pointers as Local Variables on Stack
04:34 Why the Stack ? Recursion and Multiple Calls
05:18 Visualizing Multiple Stack Frames
09:24 How Function Returns Adjust RSP
10:35 Stack Grows Downward in Memory
11:33 Program Setup ? Hybrid C++/Assembly
12:46 Assembly Module Overview
14:00 Function Prologue ? Register Push & Alignment
15:30 Allocating Stack Space for Local Array
17:45 Initializing Array in Loop
20:10 Printing Loop with printf
49:48 First Run ? Segfault Observed
51:00 16-Byte Stack Alignment Requirement
51:55 Fix 1 ? Extra Push/Pop in Prologue/Epilogue
53:15 Fix 2 ? Push/Pop Around Each printf Call
55:04 Testing Different Array Sizes
56:52 Debugging Alignment Behavior
58:54 Summary ? Creating Any Local Data on Stack
59:59 Closing Remarks & Subscribe Call
x86-64 assembly, x86 assembly tutorial, local variables stack, stack frame assembly, yasm tutorial, nasm tutorial, stack alignment, 16 byte alignment, printf crash assembly, assembly stack allocation, sub rsp assembly, rbp rbp stack, assembly array on stack, low level programming, systems programming, computer architecture, reverse engineering, assembly language, x64 assembly, calling convention
=-=-=-=-=-=-=-=-=
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
- Twitter / X: https://x.com/NeuralLantern
- Rumble: https://rumble.com/c/c-3696939
- BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt
- Daily Motion: https://www.dailymotion.com/neurallantern
- Minds: https://www.minds.com/neurallantern/
- Odysee: https://odysee.com/@NeuralLantern:5
Please show your support!
- Buy me a coffee: https://ko-fi.com/neurallantern
- Subscribe + Sharing on Social Media
- Leave a comment or suggestion
- Subscribe to the Blog: https://www.NeuralLantern.com
- Watch the main "pinned" video of this channel for offers and extras
More from User
4 Graph Types: Undirected vs Directed, Weighted vs Unweighted
Neural Lantern
AVL Trees: Adding Linear Data and Performing Rotations
Neural Lantern
AVL Tree Rotations Practice: Balancing a Huge Linear Tree Step by Step
Neural Lantern
How to Perform AVL Tree Rotations - Step By Step Example
Neural Lantern
AVL Tree Rotations Tutorial: Fixing Imbalance After Adding a Node
Neural Lantern
AVL Tree Rotation Types Explained for Self-Balancing Binary Search Trees
Neural Lantern
Related Videos
The Call Stack Explained: Call Frames, Return Addresses, Local Variables
Neural Lantern
x86-64 Assembly Segfault on printf? Fix Stack Alignment (Yasm + GCC Demo)
Neural Lantern
3 - 1 - Functions Variables and the Call Stack (506)
aesthetix7
LINEAR EQUATIONS IN TWO VARIABLES NCERT CBSE CLASS 9 EX 4.2 Q3 EXPLAINED
Yogesh TechNews.
LINEAR EQUATIONS IN TWO VARIABLES NCERT CBSE CLASS 9 EX 4.2 Q2 EXPLAINED
Yogesh TechNews.
LINEAR EQUATIONS IN TWO VARIABLES NCERT CBSE CLASS 9 EX 4.2 Q1 EXPLAINED
Yogesh TechNews.