mirror of https://github.com/xemu-project/xemu.git
iret and popl (%esp) tests
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@264 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7d83131cc5
commit
dd3587f38e
|
@ -77,4 +77,21 @@ myfunc2:
|
||||||
|
|
||||||
|
|
||||||
code16_end:
|
code16_end:
|
||||||
|
|
||||||
|
|
||||||
|
/* other 32 bits tests */
|
||||||
|
.code32
|
||||||
|
|
||||||
|
.globl func_lret32
|
||||||
|
func_lret32:
|
||||||
|
movl $0x87654321, %eax
|
||||||
|
lret
|
||||||
|
|
||||||
|
.globl func_iret32
|
||||||
|
func_iret32:
|
||||||
|
movl $0xabcd4321, %eax
|
||||||
|
iret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -937,6 +937,9 @@ void test_code16(void)
|
||||||
printf("func3() = 0x%08x\n", res);
|
printf("func3() = 0x%08x\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern char func_lret32;
|
||||||
|
extern char func_iret32;
|
||||||
|
|
||||||
void test_misc(void)
|
void test_misc(void)
|
||||||
{
|
{
|
||||||
char table[256];
|
char table[256];
|
||||||
|
@ -946,6 +949,21 @@ void test_misc(void)
|
||||||
res = 0x12345678;
|
res = 0x12345678;
|
||||||
asm ("xlat" : "=a" (res) : "b" (table), "0" (res));
|
asm ("xlat" : "=a" (res) : "b" (table), "0" (res));
|
||||||
printf("xlat: EAX=%08x\n", res);
|
printf("xlat: EAX=%08x\n", res);
|
||||||
|
|
||||||
|
asm volatile ("pushl %%cs ; call %1"
|
||||||
|
: "=a" (res)
|
||||||
|
: "m" (func_lret32): "memory", "cc");
|
||||||
|
printf("func_lret32=%x\n", res);
|
||||||
|
|
||||||
|
asm volatile ("pushfl ; pushl %%cs ; call %1"
|
||||||
|
: "=a" (res)
|
||||||
|
: "m" (func_iret32): "memory", "cc");
|
||||||
|
printf("func_iret32=%x\n", res);
|
||||||
|
|
||||||
|
/* specific popl test */
|
||||||
|
asm volatile ("pushl $12345432 ; pushl $0x9abcdef ; popl (%%esp) ; popl %0"
|
||||||
|
: "=g" (res));
|
||||||
|
printf("popl esp=%x\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t str_buffer[4096];
|
uint8_t str_buffer[4096];
|
||||||
|
|
Loading…
Reference in New Issue