]> git.proxmox.com Git - qemu.git/blame - tests/test-i386-code16.S
configure: Copy test data to build directory
[qemu.git] / tests / test-i386-code16.S
CommitLineData
e5918247
FB
1 .code16
2 .globl code16_start
3 .globl code16_end
4
5CS_SEG = 0xf
6
7code16_start:
8
9 .globl code16_func1
3b46e624 10
e5918247
FB
11 /* basic test */
12code16_func1 = . - code16_start
13 mov $1, %eax
14 data32 lret
15
16/* test push/pop in 16 bit mode */
17 .globl code16_func2
18code16_func2 = . - code16_start
19 xor %eax, %eax
20 mov $0x12345678, %ebx
21 movl %esp, %ecx
22 push %bx
23 subl %esp, %ecx
24 pop %ax
25 data32 lret
26
3b46e624 27/* test various jmp opcodes */
e5918247
FB
28 .globl code16_func3
29code16_func3 = . - code16_start
30 jmp 1f
31 nop
321:
33 mov $4, %eax
34 mov $0x12345678, %ebx
35 xor %bx, %bx
36 jz 2f
37 add $2, %ax
382:
3b46e624 39
e5918247 40 call myfunc
3b46e624 41
e5918247
FB
42 lcall $CS_SEG, $(myfunc2 - code16_start)
43
44 ljmp $CS_SEG, $(myjmp1 - code16_start)
45myjmp1_next:
46
efd0c206 47 cs lcall *myfunc2_addr - code16_start
e5918247 48
efd0c206 49 cs ljmp *myjmp2_addr - code16_start
e5918247
FB
50myjmp2_next:
51
52 data32 lret
3b46e624 53
e5918247
FB
54myfunc2_addr:
55 .short myfunc2 - code16_start
56 .short CS_SEG
57
58myjmp2_addr:
59 .short myjmp2 - code16_start
60 .short CS_SEG
61
62myjmp1:
63 add $8, %ax
64 jmp myjmp1_next
65
66myjmp2:
67 add $16, %ax
68 jmp myjmp2_next
69
70myfunc:
71 add $1, %ax
72 ret
73
74myfunc2:
75 add $4, %ax
76 lret
77
78
79code16_end: