News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Multiple calling conventions

Started by Vortex, July 23, 2006, 08:28:44 PM

Previous topic - Next topic

Vortex

Poasm supports multiple calling conventions, this is interesting :

.386
.model flat, stdcall

.code

proc_stdcall PROC x:DWORD,y:DWORD
    mov eax,x
    add eax,y
    ret
proc_stdcall ENDP

.model flat,c

proc_C PROC x:DWORD,y:DWORD
    mov eax,x
    add eax,y
    ret
proc_C ENDP

END


\pellesc\bin\poasm /AIA32 Callconv.asm
\pellesc\bin\podump /DISASM Callconv.obj >Disasm.txt


_proc_stdcall@8:
  [00000000] 55                   push      ebp
  [00000001] 89E5                 mov       ebp,esp
  [00000003] 8B4508               mov       eax,dword ptr [ebp+8]
  [00000006] 03450C               add       eax,dword ptr [ebp+C]
  [00000009] C9                   leave     
  [0000000A] C20800               ret       8

_proc_C:
  [0000000D] 55                   push      ebp
  [0000000E] 89E5                 mov       ebp,esp
  [00000010] 8B4508               mov       eax,dword ptr [ebp+8]
  [00000013] 03450C               add       eax,dword ptr [ebp+C]
  [00000016] C9                   leave     
  [00000017] C3                   ret