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