<<< Pointer Arguments | Index | Automated Local Variables >>> |
In high-level languages like C local variables are visible only within a procedure.
Local variables are usually constructed on the stack.
Assembly-language procedure can define and use its own local variables in a similar manner.
To use local variables, procedure makes indirect access to stack via base pointer register EBP.
The address of the first local variable is defined as
[ EBP - varsize ]
where varsize is the variable size.
Sample program: local_vars.asm
<<< Pointer Arguments | Index | Automated Local Variables >>> |