summaryrefslogtreecommitdiff
path: root/c32.mac
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-04-30 20:54:58 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-04-30 20:54:58 +0000
commitce14ce6fc4bf6a8a73bd7061177f8dfa696b37db (patch)
treef44620fa214c3d1c4ec5eed664fd538e24832f26 /c32.mac
parent900fa5b26b8f1374416d6dfbdacfed65f10ae5eb (diff)
downloadnasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.gz
nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.tar.bz2
nasm-ce14ce6fc4bf6a8a73bd7061177f8dfa696b37db.zip
NASM 0.98p3.2
Diffstat (limited to 'c32.mac')
-rw-r--r--c32.mac26
1 files changed, 26 insertions, 0 deletions
diff --git a/c32.mac b/c32.mac
new file mode 100644
index 0000000..6abad99
--- /dev/null
+++ b/c32.mac
@@ -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