int x, int y, int


//
#pragma hdrstop
#include <condefs.h>
#include <stdio.h>
//---------------------------------------------------------------------------
USEASM("std.asm");
USEASM("std1.asm");
USEASM("std2.asm");
USEASM("std3.asm");
USEASM("std4.asm");
//---------------------------------------------------------------------------
#pragma argsused
int __stdcall substract ( int x, int y, int *z);
int substract1 (int x, int y, int *z);
int __fastcall substract2 (int x, int y, int *z);
extern "C" int substract3 (int x, int y, int *z);
int pascal substract4 (int x, int y, int *z);
int __fastcall sum (int *x, int y);
int main(int argc, char **argv)
{
int z;
substract (3, 2, &z); printf ("%d\n", z);
substract1 (3, 2, &z); printf ("%d\n", z);
substract2 (3, 2, &z); printf ("%d\n", z);
substract3 (3, 2, &z); printf ("%d\n", z);
substract4 (3, 2, &z); printf ("%d\n", z);
getchar ();
return 0;
}
; stdcall
ideal
p586
model flat
codeseg
proc @substract1$qiipi
public @substract1$qiipi
arg a:dword, b:dword, c:dword=s
push ebp
mov ebp, esp
push ebx
mov eax, [a]
sub eax, [b]
mov ebx, [c]
mov [ebx], eax
pop ebx ebp
ret
endp
end
;fastcall
ideal
p586
model flat
codeseg
proc @substract2$qqriipi
public @substract2$qqriipi
push esi
mov esi, eax
sub esi, edx
mov [ecx], esi
pop esi
ret
endp
end

;extern C
ideal
p586
model flat
codeseg
proc _substract3
public _substract3
arg a:dword, b:dword, c:dword=s
push ebp
mov ebp, esp
push esi
mov esi, [a]
sub esi, [b]
mov ecx, [c]
mov [ecx], esi
pop esi ebp
ret
endp
end
; pascal
ideal
p586
model flat
codeseg
proc @SUBSTRACT4$QIIPI
public @SUBSTRACT4$QIIPI
arg c:dword, b:dword, a:dword=s
push ebp
mov ebp, esp
push esi
mov esi, [a]
sub esi, [b]
mov ecx, [c]
mov [ecx], esi
pop esi ebp
ret s
endp
end