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