2017-11-22 19:57:43 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#if defined _WIN32 && !defined __TINYC__
|
2017-11-27 03:09:50 +03:00
|
|
|
# define _ "_"
|
2017-11-22 19:57:43 +03:00
|
|
|
#else
|
2017-11-27 03:09:50 +03:00
|
|
|
# define _
|
2017-11-22 19:57:43 +03:00
|
|
|
#endif
|
|
|
|
|
2017-11-27 03:09:50 +03:00
|
|
|
static int x1_c(void)
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf(" x1");
|
2017-11-27 03:09:50 +03:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
asm(".text;"_"x1: call "_"x1_c; ret");
|
2017-11-22 19:57:43 +03:00
|
|
|
|
2017-11-27 06:03:03 +03:00
|
|
|
void callx4(void);
|
2017-12-04 05:51:14 +03:00
|
|
|
void callx5_again(void);
|
2017-12-12 19:57:20 +03:00
|
|
|
|
|
|
|
void x6()
|
|
|
|
{
|
|
|
|
printf(" x6-1");
|
|
|
|
}
|
|
|
|
|
2017-11-22 19:57:43 +03:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf("*");
|
2017-11-27 03:09:50 +03:00
|
|
|
asm("call "_"x1");
|
|
|
|
asm("call "_"x2");
|
|
|
|
asm("call "_"x3");
|
2017-11-27 06:03:03 +03:00
|
|
|
callx4();
|
2017-12-04 05:51:14 +03:00
|
|
|
asm("call "_"x5");
|
|
|
|
callx5_again();
|
2017-12-12 19:57:20 +03:00
|
|
|
x6();
|
|
|
|
printf(" *\n");
|
2017-11-22 19:57:43 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
int x2(void)
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf(" x2");
|
2017-11-22 19:57:43 +03:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern int x3(void);
|
2017-11-27 06:03:03 +03:00
|
|
|
|
|
|
|
void x4(void)
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf(" x4");
|
2017-11-27 06:03:03 +03:00
|
|
|
}
|
2017-12-04 05:51:14 +03:00
|
|
|
|
|
|
|
void x5(void);
|
|
|
|
void x5(void)
|
|
|
|
{
|
2017-12-12 19:57:20 +03:00
|
|
|
printf(" x5");
|
2017-12-04 05:51:14 +03:00
|
|
|
}
|