NASM 0.98p3.5
[nasm.git] / c32.mac
blobf0c116ba3b538d5c9664c38bd90921ac2491b88b
1 ; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*-
5 %imacro proc 1                  ; begin a procedure definition
7 %push proc
9           global %1
11 %1:       push ebp
13           mov ebp,esp
15 %assign %$arg 8
17 %define %$procname %1
19 %endmacro
23 %imacro arg 0-1 4               ; used with the argument name as a label
25 %00       equ %$arg
27 %assign %$arg %1+%$arg
29 %endmacro
33 %imacro endproc 0
35 %ifnctx proc
37 %error Mismatched `endproc'/`proc'
39 %else
41           leave
43           ret
45 __end_%$procname:               ; useful for calculating function size
47 %pop
49 %endif
51 %endmacro