home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nasm097.zip / MISC / C32.MAC < prev    next >
Text File  |  1997-10-01  |  547b  |  27 lines

  1. ; NASM macro set to make interfacing to 32-bit programs easier -*- nasm -*-
  2.  
  3. %imacro proc 1            ; begin a procedure definition
  4. %push proc
  5.           global %1
  6. %1:       push ebp
  7.           mov ebp,esp
  8. %assign %$arg 8
  9. %define %$procname %1
  10. %endmacro
  11.  
  12. %imacro arg 0-1 4        ; used with the argument name as a label
  13.       equ %$arg
  14. %assign %$arg %1+%$arg
  15. %endmacro
  16.  
  17. %imacro endproc 0
  18. %ifnctx proc
  19. %error Mismatched `endproc'/`proc'
  20. %else
  21.       leave
  22.       ret
  23. __end_%$procname:        ; useful for calculating function size
  24. %pop
  25. %endif
  26. %endmacro
  27.