NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: avcaballero on April 13, 2010, 09:10:57 AM
-
Hello. Is there a way to define local variables inside a procedure as masm local "LOCAL myvar:DWORD" alike for example. I have revised win32 demos from nasmx package and I haven't found any.
Thank you
-
The NASMX way:
proc app
LOCALS
LOCAL stackvar, DWORD
ENDLOCALS
;... rest of proc code...
endproc
The NASM way: Stack Relative Preprocessor Directives (http://www.nasm.us/doc/nasmdoc4.html#section-4.8).
Between the two, I would go with the one that has better documentation :P
-
Since Nasm expects macro parameters to be separated by commas, it's going to have trouble with "myvar:dword". With the (relatively new) substring capabilities, it "should" be possible to "parse" for the colon, and make two parameters out of one. If you can live with the comma, Alfonso, that would be much easier.
Best,
Frank