VirtualBox

source: vbox/trunk/src/recompiler/tests/test-i386-code16.S@ 1

最後變更 在這個檔案從1是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.6 KB
 
1 .code16
2 .globl code16_start
3 .globl code16_end
4
5CS_SEG = 0xf
6
7code16_start:
8
9 .globl code16_func1
10
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
27/* test various jmp opcodes */
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:
39
40 call myfunc
41
42 lcall $CS_SEG, $(myfunc2 - code16_start)
43
44 ljmp $CS_SEG, $(myjmp1 - code16_start)
45myjmp1_next:
46
47 cs lcall myfunc2_addr - code16_start
48
49 cs ljmp myjmp2_addr - code16_start
50myjmp2_next:
51
52 data32 lret
53
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:
80
81
82/* other 32 bits tests */
83 .code32
84
85 .globl func_lret32
86func_lret32:
87 movl $0x87654321, %eax
88 lret
89
90 .globl func_iret32
91func_iret32:
92 movl $0xabcd4321, %eax
93 iret
94
95
96
97
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette