Mercurial > pub > dyncall > dyncall
comparison doc/disas_examples/x86.cdecl.disas @ 471:4e84d6faed54
- "
author | Tassilo Philipp |
---|---|
date | Mon, 07 Feb 2022 23:29:24 +0100 |
parents | 984e6652b975 |
children | cb19b2fe2422 |
comparison
equal
deleted
inserted
replaced
470:79e76734bb5c | 471:4e84d6faed54 |
---|---|
551 ; | 551 ; |
552 ; struct A { int x; short y; char z; long long t; }; | 552 ; struct A { int x; short y; char z; long long t; }; |
553 ; | 553 ; |
554 ; struct A leaf_call(struct A a, short b, long long c, char d, int e, int f, int g, long long h) | 554 ; struct A leaf_call(struct A a, short b, long long c, char d, int e, int f, int g, long long h) |
555 ; { | 555 ; { |
556 ; a.x += 1; | 556 ; a.x += 1; |
557 ; return a; | 557 ; return a; |
558 ; } | 558 ; } |
559 ; | 559 ; |
560 ; int main() | 560 ; int main() |
561 ; { | 561 ; { |
562 ; struct A a ={9, 99, 23, 12LL}; | 562 ; struct A a = {9, 99, 23, 12LL}; |
563 ; leaf_call(a, 1, 2, 3, 4, 5, 6, 7LL); | 563 ; leaf_call(a, 1, 2, 3, 4, 5, 6, 7LL); |
564 ; return 0; | 564 ; return 0; |
565 ; } | 565 ; } |
566 | 566 |
567 | 567 |
568 | 568 |
569 ; output from godbolt compiler explorer w/ msvc 19.0 | 569 ; output from godbolt compiler explorer w/ msvc 19.0 |
620 mov edx, DWORD PTR _a$[ebp+8] ; | | 620 mov edx, DWORD PTR _a$[ebp+8] ; | |
621 mov DWORD PTR [ecx+8], edx ; | | 621 mov DWORD PTR [ecx+8], edx ; | |
622 mov eax, DWORD PTR _a$[ebp+12] ; | | 622 mov eax, DWORD PTR _a$[ebp+12] ; | |
623 mov DWORD PTR [ecx+12], eax ; / | 623 mov DWORD PTR [ecx+12], eax ; / |
624 lea ecx, DWORD PTR $T1[ebp] ; \ ptr to space used for struct retval (pushed as hidden first arg) | 624 lea ecx, DWORD PTR $T1[ebp] ; \ ptr to space used for struct retval (pushed as hidden first arg) |
625 push ecx | | 625 push ecx ; | |
626 call _leaf_call ; push return address and call | 626 call _leaf_call ; push return address and call |
627 add esp, 56 ; | | 627 add esp, 56 ; | |
628 xor eax, eax ; : return value | 628 xor eax, eax ; : return value |
629 mov esp, ebp ; | | 629 mov esp, ebp ; | |
630 pop ebp ; | epilog | 630 pop ebp ; | epilog |