Cosmetic changes to tc-i386.[ch] + extend x86 gas testsuite jmp and
[binutils.git] / gas / testsuite / gas / i386 / general.s
blobd8be9373e74f27db9ee3f7e2185afef30de74aeb
1 .psize 0
2 .text
3 # test various segment reg insns
4 push %ds
5 pushl %ds
6 pop %ds
7 popl %ds
8 mov %ds,%eax
9 movl %ds,%eax
10 movl %ds,%ax
11 mov %eax,%ds
12 movl %ax,%ds
13 movl %eax,%ds
15 pushw %ds
16 popw %ds
17 mov %ds,%ax
18 movw %ds,%ax
19 movw %ds,%eax
20 mov %ax,%ds
21 movw %ax,%ds
22 movw %eax,%ds
24 # test various pushes
25 pushl $10
26 pushw $10
27 push $10
28 pushl $1000
29 pushw $1000
30 push $1000
31 pushl 1f
32 pushw 1f
33 push 1f
34 push (1f-.)(%ebx)
35 push 1f-.
36 # these, and others like them should have no operand size prefix
37 1: lldt %cx
38 lmsw %ax
40 # Just to make sure these don't become illegal due to over-enthusiastic
41 # register checking
42 movsbw %al,%di
43 movsbl %al,%ecx
44 movswl %ax,%ecx
45 movzbw %al,%di
46 movzbl %al,%ecx
47 movzwl %ax,%ecx
49 in %dx,%al
50 in %dx,%ax
51 in %dx,%eax
52 in (%dx),%al
53 in (%dx),%ax
54 in (%dx),%eax
55 inb %dx,%al
56 inw %dx,%ax
57 inl %dx,%eax
58 inb %dx
59 inw %dx
60 inl %dx
61 inb $255
62 inw $2
63 inl $4
64 outl %eax,%dx
65 out %al, $42
66 in $13, %ax
67 # These are used in AIX.
68 inw (%dx)
69 outw (%dx)
71 movsb
72 cmpsw
73 scasl
74 xlatb
75 movsl %cs:(%esi),%es:(%edi)
76 setae (%ebx)
77 setaeb (%ebx)
78 setae %al
80 #these should give warnings
81 orb $1,%ax
82 orb $1,%eax
83 orb $1,%bx
84 orb $1,%ebx
85 fldl %st(1)
86 fstl %st(2)
87 fstpl %st(3)
88 fcoml %st(4)
89 fcompl %st(5)
90 faddp %st(1),%st
91 fmulp %st(2),%st
92 fsubp %st(3),%st
93 fsubrp %st(4),%st
94 fdivp %st(5),%st
95 fdivrp %st(6),%st
96 fadd
97 fsub
98 fmul
99 fdiv
100 fsubr
101 fdivr
102 #these should all be legal
103 btl %edx, 0x123456
104 btl %edx, %eax
105 orb $1,%al
106 orb $1,%bl
107 movl 17,%eax
108 mov 17,%eax
109 inw %dx,%ax
110 inl %dx,%eax
111 inw (%dx),%ax
112 inl (%dx),%eax
113 in (%dx),%al
114 in (%dx),%ax
115 in (%dx),%eax
116 movzbl (%edi,%esi),%edx
117 movzbl 28(%ebp),%eax
118 movzbl %al,%eax
119 movzbl %cl,%esi
120 xlat %es:(%ebx)
121 xlat
122 xlatb
123 1: fstp %st(0)
124 loop 1b
125 divb %cl
126 divw %cx
127 divl %ecx
128 div %cl
129 div %cx
130 div %ecx
131 div %cl,%al
132 div %cx,%ax
133 div %ecx,%eax
134 mov %si,%ds
135 movl %si,%ds # warning here
136 pushl %ds
137 push %ds
138 mov 0,%al
139 mov 0x10000,%ax
140 mov %eax,%ebx
141 pushf
142 pushfl
143 pushfw
144 popf
145 popfl
146 popfw
147 mov %esi,(,%ebx,1)
148 andb $~0x80,foo
150 #check 16-bit code auto address prefix
151 .code16gcc
152 leal -256(%ebp),%edx
153 mov %al,-129(%ebp)
154 mov %ah,-128(%ebp)
155 leal -1760(%ebp),%ebx
156 movl %eax,140(%esp)
158 .extern xxx
159 jmp 1b
160 jmp xxx
161 jmp *xxx
162 jmp xxx(,1)
163 jmp *%edi
164 jmp %edi
165 jmp *(%edi)
166 jmp (%edi)
167 ljmp *xxx(%edi)
168 ljmp xxx(%edi)
169 ljmp *xxx
170 ljmp xxx(,1)
171 ljmp $0x1234,$xxx
173 call 1b
174 call xxx
175 call *xxx
176 call xxx(,1)
177 call *%edi
178 call %edi
179 call *(%edi)
180 call (%edi)
181 lcall *xxx(%edi)
182 lcall xxx(%edi)
183 lcall *xxx
184 lcall xxx(,1)
185 lcall $0x1234,$xxx
187 .code16
188 jmp 1b
189 jmp xxx
190 jmp *xxx
191 jmp xxx(,1)
192 jmp *%di
193 jmp %di
194 jmp *(%di)
195 jmp (%di)
196 ljmp *xxx(%di)
197 ljmp xxx(%di)
198 ljmp *xxx
199 ljmp xxx(,1)
200 ljmp $0x1234,$xxx
202 call 1b
203 call xxx
204 call *xxx
205 call xxx(,1)
206 call *%di
207 call %di
208 call *(%di)
209 call (%di)
210 lcall *xxx(%di)
211 lcall xxx(%di)
212 lcall *xxx
213 lcall xxx(,1)
214 lcall $0x1234,$xxx
216 .code32
217 jmp 1b
218 jmp xxx
219 jmp *xxx
220 jmp xxx(,1)
221 jmp *%edi
222 jmp %edi
223 jmp *(%edi)
224 jmp (%edi)
225 ljmp *xxx(,%edi,4)
226 ljmp xxx(,%edi,4)
227 ljmp *xxx
228 ljmp xxx(,1)
229 ljmp $0x1234,$xxx
231 call 1b
232 call xxx
233 call *xxx
234 call xxx(,1)
235 call *%edi
236 call %edi
237 call *(%edi)
238 call (%edi)
239 lcall *xxx(,%edi,4)
240 lcall xxx(,%edi,4)
241 lcall *xxx
242 lcall xxx(,1)
243 lcall $0x1234,$xxx
245 # Force a good alignment.
246 .p2align 4,0