Mercurial > pub > dyncall > dyncall
comparison dyncallback/dyncall_callback_x86.S @ 145:63892f03e493
- minix fix for callbacks (floats are also returned via eax/edx on minix)
author | cslag |
---|---|
date | Sat, 20 Aug 2016 22:27:47 +0200 |
parents | d0787f3b81fb |
children | 572aff021627 |
comparison
equal
deleted
inserted
replaced
144:5fa2d7d5de10 | 145:63892f03e493 |
---|---|
22 | 22 |
23 */ | 23 */ |
24 | 24 |
25 | 25 |
26 #include "../portasm/portasm-x86.S" | 26 #include "../portasm/portasm-x86.S" |
27 #include "../dyncall/dyncall_macros.h" | |
28 | |
27 BEGIN_ASM | 29 BEGIN_ASM |
28 DCThunk_size = 16 | 30 DCThunk_size = 16 |
29 DCArgs_size = 20 | 31 DCArgs_size = 20 |
30 DCValue_size = 8 | 32 DCValue_size = 8 |
31 | 33 |
83 ADD(DWORD(EDX,CTX_stack_cleanup),ESP) /* cleanup stack */ | 85 ADD(DWORD(EDX,CTX_stack_cleanup),ESP) /* cleanup stack */ |
84 PUSH(ECX) /* push back return address */ | 86 PUSH(ECX) /* push back return address */ |
85 LEA(DWORD(EBP,frame_DCValue), EDX) | 87 LEA(DWORD(EBP,frame_DCValue), EDX) |
86 MOVL(DWORD(EBP,0), EBP) /* EBP = parent frame */ | 88 MOVL(DWORD(EBP,0), EBP) /* EBP = parent frame */ |
87 /* handle return value */ | 89 /* handle return value */ |
88 | 90 |
91 #if !defined(DC__OS_Minix) | |
89 CMP(LIT(ASCII_f),AL) | 92 CMP(LIT(ASCII_f),AL) |
90 JE(LOCAL(return_f32)) | 93 JE(LOCAL(return_f32)) |
91 CMP(LIT(ASCII_d),AL) | 94 CMP(LIT(ASCII_d),AL) |
92 JE(LOCAL(return_f64)) | 95 JE(LOCAL(return_f64)) |
96 #endif | |
93 | 97 |
94 /* All int cases (+ pointer & string cases) fall in the return_i64 case, here */ | 98 /* All int cases (+ pointer & string cases) fall in the return_i64 case, here */ |
95 LOCAL(return_i64): | 99 LOCAL(return_i64): |
96 MOVL(DWORD(EDX,0),EAX) | 100 MOVL(DWORD(EDX,0),EAX) |
97 MOVL(DWORD(EDX,4),EDX) | 101 MOVL(DWORD(EDX,4),EDX) |