Hello
I have this code:
Code:
proc _gegeben1_171202asm
;Dies ist die gegebene ASM Prozedur fuer die 1.Aufgabe im Modul 1A171202.C.
;Dort ist der C Aufruf dieser gegebenen ASM Prozedur zu programmieren.
;Die Prozedur hat einen Rueckgabewert.
push bp
mov bp,sp
push di
mov al,[bp+6] ;signed char
cbw ;ax=signed int
cwd ;dx,ax=signed long int
push ax
call [word ptr bp+8]
add sp,2
mov di,[bp+4]
fstp [qword ptr di] ;store and pop
pop di
mov sp,bp
pop bp
ret
endp _gegeben1_171202asm
I have to program a call in c of this asm-code.
The solution is:
Code:
//variables i have got
signed char s_c1;
double d1;
(*proz)(int)
signed long int s_l1;
//call
s_l1 = gegeben1_171202asm (&d1,s_c1,proz);
I unterstand the order of the parameters, s_c1 and proz, but i don`t understand, why i have a "*d1" instead of "d1" and why the surrender value is from type "long int" instead of "double"(qword is the lenght of a double)
I hope somebody can helps me.
many thanks in advance.
regards
sphreak