News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Local variables on the stack

Started by ASMManiac, March 02, 2012, 08:16:12 PM

Previous topic - Next topic

ASMManiac

Right now I am creating local variables and placing them on the stack manually, such as this:

mov rbp, rsp
....  code ...
push 0
push 100
i TEXTEQU <qword ptr [rbp - 8*1]>    ; i=0
j TEXTEQU <qword ptr [rbp - 8*2]>    ; j = 100
....  code ...
mov rdx, i
mov r8, j
....  code ...

Is there a way to make jwasm (or masm) do this automatically for me?
If I declare variables through the assembler and let it do this for me, do I need to keep rbp or other registers free?