c32.mac 550 B

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