diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:54:58 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:54:58 +0000 |
commit | ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db (patch) | |
tree | f44620fa214c3d1c4ec5eed664fd538e24832f26 /c32.mac | |
parent | 900fa5b26b8f1374416d6dfbdacfed65f10ae5eb (diff) | |
download | nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.gz nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.bz2 nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.zip |
NASM 0.98p3.2
Diffstat (limited to 'c32.mac')
-rw-r--r-- | c32.mac | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*-
+
+%imacro proc 1 ; begin a procedure definition
+%push proc
+ global %1
+%1: push ebp
+ mov ebp,esp
+%assign %$arg 8
+%define %$procname %1
+%endmacro
+
+%imacro arg 0-1 4 ; used with the argument name as a label
+%00 equ %$arg
+%assign %$arg %1+%$arg
+%endmacro
+
+%imacro endproc 0
+%ifnctx proc
+%error Mismatched `endproc'/`proc'
+%else
+ leave
+ ret
+__end_%$procname: ; useful for calculating function size
+%pop
+%endif
+%endmacro
|