937 |
printf("func3() = 0x%08x\n", res); |
printf("func3() = 0x%08x\n", res); |
938 |
} |
} |
939 |
|
|
940 |
|
extern char func_lret32; |
941 |
|
extern char func_iret32; |
942 |
|
|
943 |
void test_misc(void) |
void test_misc(void) |
944 |
{ |
{ |
945 |
char table[256]; |
char table[256]; |
949 |
res = 0x12345678; |
res = 0x12345678; |
950 |
asm ("xlat" : "=a" (res) : "b" (table), "0" (res)); |
asm ("xlat" : "=a" (res) : "b" (table), "0" (res)); |
951 |
printf("xlat: EAX=%08x\n", res); |
printf("xlat: EAX=%08x\n", res); |
952 |
|
|
953 |
|
asm volatile ("pushl %%cs ; call %1" |
954 |
|
: "=a" (res) |
955 |
|
: "m" (func_lret32): "memory", "cc"); |
956 |
|
printf("func_lret32=%x\n", res); |
957 |
|
|
958 |
|
asm volatile ("pushfl ; pushl %%cs ; call %1" |
959 |
|
: "=a" (res) |
960 |
|
: "m" (func_iret32): "memory", "cc"); |
961 |
|
printf("func_iret32=%x\n", res); |
962 |
|
|
963 |
|
/* specific popl test */ |
964 |
|
asm volatile ("pushl $12345432 ; pushl $0x9abcdef ; popl (%%esp) ; popl %0" |
965 |
|
: "=g" (res)); |
966 |
|
printf("popl esp=%x\n", res); |
967 |
} |
} |
968 |
|
|
969 |
uint8_t str_buffer[4096]; |
uint8_t str_buffer[4096]; |