Back to Browse

Mastering the Stack Frame: Subroutines & Local Variables (NASM)

14 views
May 15, 2026
30:39

In this BSCS Zoom Class, we explore one of the most critical topics in Computer Organization and Assembly Language (COAL): How functions work at the hardware level. We break down the life cycle of a Subroutine, from calling it to cleaning up the stack. Key Topics Covered: Subroutines: How to define and call functions using CALL and RET. Parameter Passing: Using registers and the Stack to send data to subroutines. Stack Frames: Understanding the role of the Base Pointer (EBP) and Stack Pointer (ESP). Local Variables: How to allocate and deallocate space on the stack for temporary data. Standard Entry/Exit Sequence: The "Prolog" and "Epilog" of an assembly function. Whether you are preparing for your BSCS exams or learning low-level programming for reverse engineering, this step-by-step guide will simplify the complex world of the Stack! Timestamps: 0:00 - Introduction to Subroutines 03:45 - The Stack Frame Explained 07:20 - Passing Parameters via Stack 12:50 - Creating Local Variables (sub esp, x) 18:15 - Standard Function Prolog & Epilog 25:00 - Practical Coding Example in NASM

Download

0 formats

No download links available.

Mastering the Stack Frame: Subroutines & Local Variables (NASM) | NatokHD