Extend the i386 gas testsuite to do some tests for intel_syntax. Fix all
[deliverable/binutils-gdb.git] / gas / testsuite / gas / i386 / general.s
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
14
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
23
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
39
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
48
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 in $13, %ax
65 out %al,%dx
66 out %ax,%dx
67 out %eax,%dx
68 out %al,(%dx)
69 out %ax,(%dx)
70 out %eax,(%dx)
71 outb %al,%dx
72 outw %ax,%dx
73 outl %eax,%dx
74 outb %dx
75 outw %dx
76 outl %dx
77 outb $255
78 outw $2
79 outl $4
80 out %ax, $13
81 # These are used in AIX.
82 inw (%dx)
83 outw (%dx)
84
85 movsb
86 cmpsw
87 scasl
88 xlatb
89 movsl %cs:(%esi),%es:(%edi)
90 setae (%ebx)
91 setaeb (%ebx)
92 setae %al
93
94 #these should give warnings
95 orb $1,%ax
96 orb $1,%eax
97 orb $1,%bx
98 orb $1,%ebx
99 fldl %st(1)
100 fstl %st(2)
101 fstpl %st(3)
102 fcoml %st(4)
103 fcompl %st(5)
104 faddp %st(1),%st
105 fmulp %st(2),%st
106 fsubp %st(3),%st
107 fsubrp %st(4),%st
108 fdivp %st(5),%st
109 fdivrp %st(6),%st
110 fadd
111 fsub
112 fmul
113 fdiv
114 fsubr
115 fdivr
116 #these should all be legal
117 btl %edx, 0x123456
118 btl %edx, %eax
119 orb $1,%al
120 orb $1,%bl
121 movl 17,%eax
122 mov 17,%eax
123 inw %dx,%ax
124 inl %dx,%eax
125 inw (%dx),%ax
126 inl (%dx),%eax
127 in (%dx),%al
128 in (%dx),%ax
129 in (%dx),%eax
130 movzbl (%edi,%esi),%edx
131 movzbl 28(%ebp),%eax
132 movzbl %al,%eax
133 movzbl %cl,%esi
134 xlat %es:(%ebx)
135 xlat
136 xlatb
137 1: fstp %st(0)
138 loop 1b
139 divb %cl
140 divw %cx
141 divl %ecx
142 div %cl
143 div %cx
144 div %ecx
145 div %cl,%al
146 div %cx,%ax
147 div %ecx,%eax
148 mov %si,%ds
149 movl %si,%ds # warning here
150 pushl %ds
151 push %ds
152 mov 0,%al
153 mov 0x10000,%ax
154 mov %eax,%ebx
155 pushf
156 pushfl
157 pushfw
158 popf
159 popfl
160 popfw
161 mov %esi,(,%ebx,1)
162 andb $~0x80,foo
163
164 #check 16-bit code auto address prefix
165 .code16gcc
166 leal -256(%ebp),%edx
167 mov %al,-129(%ebp)
168 mov %ah,-128(%ebp)
169 leal -1760(%ebp),%ebx
170 movl %eax,140(%esp)
171
172 .code32
173 jmp 1b
174 jmp xxx
175 jmp *xxx
176 jmp xxx(,1)
177 jmp *%edi
178 jmp %edi
179 jmp *(%edi)
180 jmp (%edi)
181 ljmp *xxx(,%edi,4)
182 ljmp xxx(,%edi,4)
183 ljmp *xxx
184 ljmp xxx(,1)
185 ljmp $0x1234,$xxx
186
187 call 1b
188 call xxx
189 call *xxx
190 call xxx(,1)
191 call *%edi
192 call %edi
193 call *(%edi)
194 call (%edi)
195 lcall *xxx(,%edi,4)
196 lcall xxx(,%edi,4)
197 lcall *xxx
198 lcall xxx(,1)
199 lcall $0x1234,$xxx
200
201 # Force a good alignment.
202 .p2align 4,0
This page took 0.035489 seconds and 5 git commands to generate.