Subversion Repositories Kolibri OS

Rev

Rev 1342 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1342 Rev 2287
1
; flat assembler core
1
; flat assembler core
2
; Copyright (c) 1999-2009, Tomasz Grysztar.
2
; Copyright (c) 1999-2011, Tomasz Grysztar.
3
; All rights reserved.
3
; All rights reserved.
4
 
4
 
5
simple_instruction_except64:
5
simple_instruction_except64:
6
	cmp	[code_type],64
6
	cmp	[code_type],64
7
	je	illegal_instruction
7
	je	illegal_instruction
8
simple_instruction:
8
simple_instruction:
9
	stos	byte [edi]
9
	stos	byte [edi]
10
	jmp	instruction_assembled
10
	jmp	instruction_assembled
11
simple_instruction_only64:
11
simple_instruction_only64:
12
	cmp	[code_type],64
12
	cmp	[code_type],64
13
	jne	illegal_instruction
13
	jne	illegal_instruction
14
	jmp	simple_instruction
14
	jmp	simple_instruction
15
simple_instruction_16bit_except64:
15
simple_instruction_16bit_except64:
16
	cmp	[code_type],64
16
	cmp	[code_type],64
17
	je	illegal_instruction
17
	je	illegal_instruction
18
simple_instruction_16bit:
18
simple_instruction_16bit:
19
	cmp	[code_type],16
19
	cmp	[code_type],16
20
	jne	size_prefix
20
	jne	size_prefix
21
	stos	byte [edi]
21
	stos	byte [edi]
22
	jmp	instruction_assembled
22
	jmp	instruction_assembled
23
      size_prefix:
23
      size_prefix:
24
	mov	ah,al
24
	mov	ah,al
25
	mov	al,66h
25
	mov	al,66h
26
	stos	word [edi]
26
	stos	word [edi]
27
	jmp	instruction_assembled
27
	jmp	instruction_assembled
28
simple_instruction_32bit_except64:
28
simple_instruction_32bit_except64:
29
	cmp	[code_type],64
29
	cmp	[code_type],64
30
	je	illegal_instruction
30
	je	illegal_instruction
31
simple_instruction_32bit:
31
simple_instruction_32bit:
32
	cmp	[code_type],16
32
	cmp	[code_type],16
33
	je	size_prefix
33
	je	size_prefix
34
	stos	byte [edi]
34
	stos	byte [edi]
35
	jmp	instruction_assembled
35
	jmp	instruction_assembled
36
simple_instruction_64bit:
36
iret_instruction:
-
 
37
	cmp	[code_type],64
-
 
38
	jne	simple_instruction
-
 
39
simple_instruction_64bit:
37
	cmp	[code_type],64
40
	cmp	[code_type],64
38
	jne	illegal_instruction
41
	jne	illegal_instruction
39
	mov	ah,al
42
	mov	ah,al
40
	mov	al,48h
43
	mov	al,48h
41
	stos	word [edi]
44
	stos	word [edi]
42
	jmp	instruction_assembled
45
	jmp	instruction_assembled
43
simple_extended_instruction_64bit:
46
simple_extended_instruction_64bit:
44
	cmp	[code_type],64
47
	cmp	[code_type],64
45
	jne	illegal_instruction
48
	jne	illegal_instruction
46
	mov	byte [edi],48h
49
	mov	byte [edi],48h
47
	inc	edi
50
	inc	edi
48
simple_extended_instruction:
51
simple_extended_instruction:
49
	mov	ah,al
52
	mov	ah,al
50
	mov	al,0Fh
53
	mov	al,0Fh
51
	stos	word [edi]
54
	stos	word [edi]
52
	jmp	instruction_assembled
55
	jmp	instruction_assembled
53
prefix_instruction:
56
prefix_instruction:
54
	stos	byte [edi]
57
	stos	byte [edi]
55
	or	[prefixed_instruction],-1
58
	or	[prefixed_instruction],-1
56
	jmp	continue_line
59
	jmp	continue_line
57
segment_prefix:
60
segment_prefix:
58
	mov	ah,al
61
	mov	ah,al
59
	shr	ah,4
62
	shr	ah,4
60
	cmp	ah,6
63
	cmp	ah,6
61
	jne	illegal_instruction
64
	jne	illegal_instruction
62
	and	al,1111b
65
	and	al,1111b
63
	mov	[segment_register],al
66
	mov	[segment_register],al
64
	call	store_segment_prefix
67
	call	store_segment_prefix
65
	or	[prefixed_instruction],-1
68
	or	[prefixed_instruction],-1
66
	jmp	continue_line
69
	jmp	continue_line
67
int_instruction:
70
int_instruction:
68
	lods	byte [esi]
71
	lods	byte [esi]
69
	call	get_size_operator
72
	call	get_size_operator
70
	cmp	ah,1
73
	cmp	ah,1
71
	ja	invalid_operand_size
74
	ja	invalid_operand_size
72
	cmp	al,'('
75
	cmp	al,'('
73
	jne	invalid_operand
76
	jne	invalid_operand
74
	call	get_byte_value
77
	call	get_byte_value
75
	mov	ah,al
78
	cmp	[next_pass_needed],0
-
 
79
	jne	int_imm_ok
-
 
80
	test	eax,eax
-
 
81
	js	value_out_of_range
-
 
82
      int_imm_ok:
-
 
83
	mov	ah,al
76
	mov	al,0CDh
84
	mov	al,0CDh
77
	stos	word [edi]
85
	stos	word [edi]
78
	jmp	instruction_assembled
86
	jmp	instruction_assembled
79
iret_instruction:
87
aa_instruction:
80
	cmp	[code_type],64
-
 
81
	jne	simple_instruction
-
 
82
	call	operand_64bit
-
 
83
	jmp	simple_instruction
-
 
84
aa_instruction:
-
 
85
	cmp	[code_type],64
88
	cmp	[code_type],64
86
	je	illegal_instruction
89
	je	illegal_instruction
87
	push	eax
90
	push	eax
88
	mov	bl,10
91
	mov	bl,10
89
	cmp	byte [esi],'('
92
	cmp	byte [esi],'('
90
	jne	aa_store
93
	jne	aa_store
91
	inc	esi
94
	inc	esi
92
	xor	al,al
95
	xor	al,al
93
	xchg	al,[operand_size]
96
	xchg	al,[operand_size]
94
	cmp	al,1
97
	cmp	al,1
95
	ja	invalid_operand_size
98
	ja	invalid_operand_size
96
	call	get_byte_value
99
	call	get_byte_value
97
	mov	bl,al
100
	mov	bl,al
98
      aa_store:
101
      aa_store:
99
	cmp	[operand_size],0
102
	cmp	[operand_size],0
100
	jne	invalid_operand
103
	jne	invalid_operand
101
	pop	eax
104
	pop	eax
102
	mov	ah,bl
105
	mov	ah,bl
103
	stos	word [edi]
106
	stos	word [edi]
104
	jmp	instruction_assembled
107
	jmp	instruction_assembled
105
 
108
 
106
basic_instruction:
109
basic_instruction:
107
	mov	[base_code],al
110
	mov	[base_code],al
108
	lods	byte [esi]
111
	lods	byte [esi]
109
	call	get_size_operator
112
	call	get_size_operator
110
	cmp	al,10h
113
	cmp	al,10h
111
	je	basic_reg
114
	je	basic_reg
112
	cmp	al,'['
115
	cmp	al,'['
113
	jne	invalid_operand
116
	jne	invalid_operand
114
      basic_mem:
117
      basic_mem:
115
	call	get_address
118
	call	get_address
116
	push	edx ebx ecx
119
	push	edx ebx ecx
117
	lods	byte [esi]
120
	lods	byte [esi]
118
	cmp	al,','
121
	cmp	al,','
119
	jne	invalid_operand
122
	jne	invalid_operand
120
	lods	byte [esi]
123
	lods	byte [esi]
121
	call	get_size_operator
124
	call	get_size_operator
122
	cmp	al,'('
125
	cmp	al,'('
123
	je	basic_mem_imm
126
	je	basic_mem_imm
124
	cmp	al,10h
127
	cmp	al,10h
125
	jne	invalid_operand
128
	jne	invalid_operand
126
      basic_mem_reg:
129
      basic_mem_reg:
127
	lods	byte [esi]
130
	lods	byte [esi]
128
	call	convert_register
131
	call	convert_register
129
	mov	[postbyte_register],al
132
	mov	[postbyte_register],al
130
	pop	ecx ebx edx
133
	pop	ecx ebx edx
131
	mov	al,ah
134
	mov	al,ah
132
	cmp	al,1
135
	cmp	al,1
133
	je	instruction_ready
136
	je	instruction_ready
134
	call	operand_autodetect
137
	call	operand_autodetect
135
	inc	[base_code]
138
	inc	[base_code]
136
      instruction_ready:
139
      instruction_ready:
137
	call	store_instruction
140
	call	store_instruction
138
	jmp	instruction_assembled
141
	jmp	instruction_assembled
139
      basic_mem_imm:
142
      basic_mem_imm:
140
	mov	al,[operand_size]
143
	mov	al,[operand_size]
141
	cmp	al,1
144
	cmp	al,1
142
	jb	basic_mem_imm_nosize
145
	jb	basic_mem_imm_nosize
143
	je	basic_mem_imm_8bit
146
	je	basic_mem_imm_8bit
144
	cmp	al,2
147
	cmp	al,2
145
	je	basic_mem_imm_16bit
148
	je	basic_mem_imm_16bit
146
	cmp	al,4
149
	cmp	al,4
147
	je	basic_mem_imm_32bit
150
	je	basic_mem_imm_32bit
148
	cmp	al,8
151
	cmp	al,8
149
	jne	invalid_operand_size
152
	jne	invalid_operand_size
150
      basic_mem_imm_64bit:
153
      basic_mem_imm_64bit:
151
	cmp	[size_declared],0
154
	cmp	[size_declared],0
152
	jne	long_immediate_not_encodable
155
	jne	long_immediate_not_encodable
153
	call	operand_64bit
156
	call	operand_64bit
154
	call	get_simm32
157
	call	get_simm32
155
	cmp	[value_type],4
158
	cmp	[value_type],4
156
	jae	long_immediate_not_encodable
159
	jae	long_immediate_not_encodable
157
	jmp	basic_mem_imm_32bit_ok
160
	jmp	basic_mem_imm_32bit_ok
158
      basic_mem_imm_nosize:
161
      basic_mem_imm_nosize:
159
	cmp	[error_line],0
162
	cmp	[error_line],0
160
	jne	basic_mem_imm_8bit
163
	jne	basic_mem_imm_8bit
161
	mov	eax,[current_line]
164
	mov	eax,[current_line]
162
	mov	[error_line],eax
165
	mov	[error_line],eax
163
	mov	[error],operand_size_not_specified
166
	mov	[error],operand_size_not_specified
164
      basic_mem_imm_8bit:
167
      basic_mem_imm_8bit:
165
	call	get_byte_value
168
	call	get_byte_value
166
	mov	byte [value],al
169
	mov	byte [value],al
167
	mov	al,[base_code]
170
	mov	al,[base_code]
168
	shr	al,3
171
	shr	al,3
169
	mov	[postbyte_register],al
172
	mov	[postbyte_register],al
170
	pop	ecx ebx edx
173
	pop	ecx ebx edx
171
	mov	[base_code],80h
174
	mov	[base_code],80h
172
	call	store_instruction_with_imm8
175
	call	store_instruction_with_imm8
173
	jmp	instruction_assembled
176
	jmp	instruction_assembled
174
      basic_mem_imm_16bit:
177
      basic_mem_imm_16bit:
175
	call	operand_16bit
178
	call	operand_16bit
176
	call	get_word_value
179
	call	get_word_value
177
	mov	word [value],ax
180
	mov	word [value],ax
178
	mov	al,[base_code]
181
	mov	al,[base_code]
179
	shr	al,3
182
	shr	al,3
180
	mov	[postbyte_register],al
183
	mov	[postbyte_register],al
181
	pop	ecx ebx edx
184
	pop	ecx ebx edx
182
	cmp	[value_type],0
185
	cmp	[value_type],0
183
	jne	basic_mem_imm_16bit_store
186
	jne	basic_mem_imm_16bit_store
184
	cmp	[size_declared],0
187
	cmp	[size_declared],0
185
	jne	basic_mem_imm_16bit_store
188
	jne	basic_mem_imm_16bit_store
186
	cmp	word [value],80h
189
	cmp	word [value],80h
187
	jb	basic_mem_simm_8bit
190
	jb	basic_mem_simm_8bit
188
	cmp	word [value],-80h
191
	cmp	word [value],-80h
189
	jae	basic_mem_simm_8bit
192
	jae	basic_mem_simm_8bit
190
      basic_mem_imm_16bit_store:
193
      basic_mem_imm_16bit_store:
191
	mov	[base_code],81h
194
	mov	[base_code],81h
192
	call	store_instruction_with_imm16
195
	call	store_instruction_with_imm16
193
	jmp	instruction_assembled
196
	jmp	instruction_assembled
194
      basic_mem_simm_8bit:
197
      basic_mem_simm_8bit:
195
	mov	[base_code],83h
198
	mov	[base_code],83h
196
	call	store_instruction_with_imm8
199
	call	store_instruction_with_imm8
197
	jmp	instruction_assembled
200
	jmp	instruction_assembled
198
      basic_mem_imm_32bit:
201
      basic_mem_imm_32bit:
199
	call	operand_32bit
202
	call	operand_32bit
200
	call	get_dword_value
203
	call	get_dword_value
201
      basic_mem_imm_32bit_ok:
204
      basic_mem_imm_32bit_ok:
202
	mov	dword [value],eax
205
	mov	dword [value],eax
203
	mov	al,[base_code]
206
	mov	al,[base_code]
204
	shr	al,3
207
	shr	al,3
205
	mov	[postbyte_register],al
208
	mov	[postbyte_register],al
206
	pop	ecx ebx edx
209
	pop	ecx ebx edx
207
	cmp	[value_type],0
210
	cmp	[value_type],0
208
	jne	basic_mem_imm_32bit_store
211
	jne	basic_mem_imm_32bit_store
209
	cmp	[size_declared],0
212
	cmp	[size_declared],0
210
	jne	basic_mem_imm_32bit_store
213
	jne	basic_mem_imm_32bit_store
211
	cmp	dword [value],80h
214
	cmp	dword [value],80h
212
	jb	basic_mem_simm_8bit
215
	jb	basic_mem_simm_8bit
213
	cmp	dword [value],-80h
216
	cmp	dword [value],-80h
214
	jae	basic_mem_simm_8bit
217
	jae	basic_mem_simm_8bit
215
      basic_mem_imm_32bit_store:
218
      basic_mem_imm_32bit_store:
216
	mov	[base_code],81h
219
	mov	[base_code],81h
217
	call	store_instruction_with_imm32
220
	call	store_instruction_with_imm32
218
	jmp	instruction_assembled
221
	jmp	instruction_assembled
219
      get_simm32:
222
      get_simm32:
220
	call	get_qword_value
223
	call	get_qword_value
221
	mov	ecx,edx
224
	mov	ecx,edx
222
	cdq
225
	cdq
223
	cmp	ecx,edx
226
	cmp	ecx,edx
224
	jne	value_out_of_range
227
	jne	value_out_of_range
225
	cmp	[value_type],4
228
	cmp	[value_type],4
226
	jne	get_simm32_ok
229
	jne	get_simm32_ok
227
	mov	[value_type],2
230
	mov	[value_type],2
228
      get_simm32_ok:
231
      get_simm32_ok:
229
	ret
232
	ret
230
      basic_reg:
233
      basic_reg:
231
	lods	byte [esi]
234
	lods	byte [esi]
232
	call	convert_register
235
	call	convert_register
233
	mov	[postbyte_register],al
236
	mov	[postbyte_register],al
234
	lods	byte [esi]
237
	lods	byte [esi]
235
	cmp	al,','
238
	cmp	al,','
236
	jne	invalid_operand
239
	jne	invalid_operand
237
	lods	byte [esi]
240
	lods	byte [esi]
238
	call	get_size_operator
241
	call	get_size_operator
239
	cmp	al,10h
242
	cmp	al,10h
240
	je	basic_reg_reg
243
	je	basic_reg_reg
241
	cmp	al,'('
244
	cmp	al,'('
242
	je	basic_reg_imm
245
	je	basic_reg_imm
243
	cmp	al,'['
246
	cmp	al,'['
244
	jne	invalid_operand
247
	jne	invalid_operand
245
      basic_reg_mem:
248
      basic_reg_mem:
246
	call	get_address
249
	call	get_address
247
	mov	al,[operand_size]
250
	mov	al,[operand_size]
248
	cmp	al,1
251
	cmp	al,1
249
	je	basic_reg_mem_8bit
252
	je	basic_reg_mem_8bit
250
	call	operand_autodetect
253
	call	operand_autodetect
251
	add	[base_code],3
254
	add	[base_code],3
252
	jmp	instruction_ready
255
	jmp	instruction_ready
253
      basic_reg_mem_8bit:
256
      basic_reg_mem_8bit:
254
	add	[base_code],2
257
	add	[base_code],2
255
	jmp	instruction_ready
258
	jmp	instruction_ready
256
      basic_reg_reg:
259
      basic_reg_reg:
257
	lods	byte [esi]
260
	lods	byte [esi]
258
	call	convert_register
261
	call	convert_register
259
	mov	bl,[postbyte_register]
262
	mov	bl,[postbyte_register]
260
	mov	[postbyte_register],al
263
	mov	[postbyte_register],al
261
	mov	al,ah
264
	mov	al,ah
262
	cmp	al,1
265
	cmp	al,1
263
	je	nomem_instruction_ready
266
	je	nomem_instruction_ready
264
	call	operand_autodetect
267
	call	operand_autodetect
265
	inc	[base_code]
268
	inc	[base_code]
266
      nomem_instruction_ready:
269
      nomem_instruction_ready:
267
	call	store_nomem_instruction
270
	call	store_nomem_instruction
268
	jmp	instruction_assembled
271
	jmp	instruction_assembled
269
      basic_reg_imm:
272
      basic_reg_imm:
270
	mov	al,[operand_size]
273
	mov	al,[operand_size]
271
	cmp	al,1
274
	cmp	al,1
272
	je	basic_reg_imm_8bit
275
	je	basic_reg_imm_8bit
273
	cmp	al,2
276
	cmp	al,2
274
	je	basic_reg_imm_16bit
277
	je	basic_reg_imm_16bit
275
	cmp	al,4
278
	cmp	al,4
276
	je	basic_reg_imm_32bit
279
	je	basic_reg_imm_32bit
277
	cmp	al,8
280
	cmp	al,8
278
	jne	invalid_operand_size
281
	jne	invalid_operand_size
279
      basic_reg_imm_64bit:
282
      basic_reg_imm_64bit:
280
	cmp	[size_declared],0
283
	cmp	[size_declared],0
281
	jne	long_immediate_not_encodable
284
	jne	long_immediate_not_encodable
282
	call	operand_64bit
285
	call	operand_64bit
283
	call	get_simm32
286
	call	get_simm32
284
	cmp	[value_type],4
287
	cmp	[value_type],4
285
	jae	long_immediate_not_encodable
288
	jae	long_immediate_not_encodable
286
	jmp	basic_reg_imm_32bit_ok
289
	jmp	basic_reg_imm_32bit_ok
287
      basic_reg_imm_8bit:
290
      basic_reg_imm_8bit:
288
	call	get_byte_value
291
	call	get_byte_value
289
	mov	dl,al
292
	mov	dl,al
290
	mov	bl,[base_code]
293
	mov	bl,[base_code]
291
	shr	bl,3
294
	shr	bl,3
292
	xchg	bl,[postbyte_register]
295
	xchg	bl,[postbyte_register]
293
	or	bl,bl
296
	or	bl,bl
294
	jz	basic_al_imm
297
	jz	basic_al_imm
295
	mov	[base_code],80h
298
	mov	[base_code],80h
296
	call	store_nomem_instruction
299
	call	store_nomem_instruction
297
	mov	al,dl
300
	mov	al,dl
298
	stos	byte [edi]
301
	stos	byte [edi]
299
	jmp	instruction_assembled
302
	jmp	instruction_assembled
300
      basic_al_imm:
303
      basic_al_imm:
301
	mov	al,[base_code]
304
	mov	al,[base_code]
302
	add	al,4
305
	add	al,4
303
	stos	byte [edi]
306
	stos	byte [edi]
304
	mov	al,dl
307
	mov	al,dl
305
	stos	byte [edi]
308
	stos	byte [edi]
306
	jmp	instruction_assembled
309
	jmp	instruction_assembled
307
      basic_reg_imm_16bit:
310
      basic_reg_imm_16bit:
308
	call	operand_16bit
311
	call	operand_16bit
309
	call	get_word_value
312
	call	get_word_value
310
	mov	dx,ax
313
	mov	dx,ax
311
	mov	bl,[base_code]
314
	mov	bl,[base_code]
312
	shr	bl,3
315
	shr	bl,3
313
	xchg	bl,[postbyte_register]
316
	xchg	bl,[postbyte_register]
314
	cmp	[value_type],0
317
	cmp	[value_type],0
315
	jne	basic_reg_imm_16bit_store
318
	jne	basic_reg_imm_16bit_store
316
	cmp	[size_declared],0
319
	cmp	[size_declared],0
317
	jne	basic_reg_imm_16bit_store
320
	jne	basic_reg_imm_16bit_store
318
	cmp	dx,80h
321
	cmp	dx,80h
319
	jb	basic_reg_simm_8bit
322
	jb	basic_reg_simm_8bit
320
	cmp	dx,-80h
323
	cmp	dx,-80h
321
	jae	basic_reg_simm_8bit
324
	jae	basic_reg_simm_8bit
322
      basic_reg_imm_16bit_store:
325
      basic_reg_imm_16bit_store:
323
	or	bl,bl
326
	or	bl,bl
324
	jz	basic_ax_imm
327
	jz	basic_ax_imm
325
	mov	[base_code],81h
328
	mov	[base_code],81h
326
	call	store_nomem_instruction
329
	call	store_nomem_instruction
327
      basic_store_imm_16bit:
330
      basic_store_imm_16bit:
328
	mov	ax,dx
331
	mov	ax,dx
329
	call	mark_relocation
332
	call	mark_relocation
330
	stos	word [edi]
333
	stos	word [edi]
331
	jmp	instruction_assembled
334
	jmp	instruction_assembled
332
      basic_reg_simm_8bit:
335
      basic_reg_simm_8bit:
333
	mov	[base_code],83h
336
	mov	[base_code],83h
334
	call	store_nomem_instruction
337
	call	store_nomem_instruction
335
	mov	al,dl
338
	mov	al,dl
336
	stos	byte [edi]
339
	stos	byte [edi]
337
	jmp	instruction_assembled
340
	jmp	instruction_assembled
338
      basic_ax_imm:
341
      basic_ax_imm:
339
	add	[base_code],5
342
	add	[base_code],5
340
	call	store_instruction_code
343
	call	store_instruction_code
341
	jmp	basic_store_imm_16bit
344
	jmp	basic_store_imm_16bit
342
      basic_reg_imm_32bit:
345
      basic_reg_imm_32bit:
343
	call	operand_32bit
346
	call	operand_32bit
344
	call	get_dword_value
347
	call	get_dword_value
345
      basic_reg_imm_32bit_ok:
348
      basic_reg_imm_32bit_ok:
346
	mov	edx,eax
349
	mov	edx,eax
347
	mov	bl,[base_code]
350
	mov	bl,[base_code]
348
	shr	bl,3
351
	shr	bl,3
349
	xchg	bl,[postbyte_register]
352
	xchg	bl,[postbyte_register]
350
	cmp	[value_type],0
353
	cmp	[value_type],0
351
	jne	basic_reg_imm_32bit_store
354
	jne	basic_reg_imm_32bit_store
352
	cmp	[size_declared],0
355
	cmp	[size_declared],0
353
	jne	basic_reg_imm_32bit_store
356
	jne	basic_reg_imm_32bit_store
354
	cmp	edx,80h
357
	cmp	edx,80h
355
	jb	basic_reg_simm_8bit
358
	jb	basic_reg_simm_8bit
356
	cmp	edx,-80h
359
	cmp	edx,-80h
357
	jae	basic_reg_simm_8bit
360
	jae	basic_reg_simm_8bit
358
      basic_reg_imm_32bit_store:
361
      basic_reg_imm_32bit_store:
359
	or	bl,bl
362
	or	bl,bl
360
	jz	basic_eax_imm
363
	jz	basic_eax_imm
361
	mov	[base_code],81h
364
	mov	[base_code],81h
362
	call	store_nomem_instruction
365
	call	store_nomem_instruction
363
      basic_store_imm_32bit:
366
      basic_store_imm_32bit:
364
	mov	eax,edx
367
	mov	eax,edx
365
	call	mark_relocation
368
	call	mark_relocation
366
	stos	dword [edi]
369
	stos	dword [edi]
367
	jmp	instruction_assembled
370
	jmp	instruction_assembled
368
      basic_eax_imm:
371
      basic_eax_imm:
369
	add	[base_code],5
372
	add	[base_code],5
370
	call	store_instruction_code
373
	call	store_instruction_code
371
	jmp	basic_store_imm_32bit
374
	jmp	basic_store_imm_32bit
372
single_operand_instruction:
375
single_operand_instruction:
373
	mov	[base_code],0F6h
376
	mov	[base_code],0F6h
374
	mov	[postbyte_register],al
377
	mov	[postbyte_register],al
375
	lods	byte [esi]
378
	lods	byte [esi]
376
	call	get_size_operator
379
	call	get_size_operator
377
	cmp	al,10h
380
	cmp	al,10h
378
	je	single_reg
381
	je	single_reg
379
	cmp	al,'['
382
	cmp	al,'['
380
	jne	invalid_operand
383
	jne	invalid_operand
381
      single_mem:
384
      single_mem:
382
	call	get_address
385
	call	get_address
383
	mov	al,[operand_size]
386
	mov	al,[operand_size]
384
	cmp	al,1
387
	cmp	al,1
385
	je	single_mem_8bit
388
	je	single_mem_8bit
386
	jb	single_mem_nosize
389
	jb	single_mem_nosize
387
	call	operand_autodetect
390
	call	operand_autodetect
388
	inc	[base_code]
391
	inc	[base_code]
389
	jmp	instruction_ready
392
	jmp	instruction_ready
390
      single_mem_nosize:
393
      single_mem_nosize:
391
	cmp	[error_line],0
394
	cmp	[error_line],0
392
	jne	single_mem_8bit
395
	jne	single_mem_8bit
393
	mov	eax,[current_line]
396
	mov	eax,[current_line]
394
	mov	[error_line],eax
397
	mov	[error_line],eax
395
	mov	[error],operand_size_not_specified
398
	mov	[error],operand_size_not_specified
396
      single_mem_8bit:
399
      single_mem_8bit:
397
	jmp	instruction_ready
400
	jmp	instruction_ready
398
      single_reg:
401
      single_reg:
399
	lods	byte [esi]
402
	lods	byte [esi]
400
	call	convert_register
403
	call	convert_register
401
	mov	bl,al
404
	mov	bl,al
402
	mov	al,ah
405
	mov	al,ah
403
	cmp	al,1
406
	cmp	al,1
404
	je	single_reg_8bit
407
	je	single_reg_8bit
405
	call	operand_autodetect
408
	call	operand_autodetect
406
	inc	[base_code]
409
	inc	[base_code]
407
      single_reg_8bit:
410
      single_reg_8bit:
408
	jmp	nomem_instruction_ready
411
	jmp	nomem_instruction_ready
409
mov_instruction:
412
mov_instruction:
410
	mov	[base_code],88h
413
	mov	[base_code],88h
411
	lods	byte [esi]
414
	lods	byte [esi]
412
	call	get_size_operator
415
	call	get_size_operator
413
	cmp	al,10h
416
	cmp	al,10h
414
	je	mov_reg
417
	je	mov_reg
415
	cmp	al,'['
418
	cmp	al,'['
416
	jne	invalid_operand
419
	jne	invalid_operand
417
      mov_mem:
420
      mov_mem:
418
	call	get_address
421
	call	get_address
419
	push	edx ebx ecx
422
	push	edx ebx ecx
420
	lods	byte [esi]
423
	lods	byte [esi]
421
	cmp	al,','
424
	cmp	al,','
422
	jne	invalid_operand
425
	jne	invalid_operand
423
	lods	byte [esi]
426
	lods	byte [esi]
424
	call	get_size_operator
427
	call	get_size_operator
425
	cmp	al,'('
428
	cmp	al,'('
426
	je	mov_mem_imm
429
	je	mov_mem_imm
427
	cmp	al,10h
430
	cmp	al,10h
428
	jne	invalid_operand
431
	jne	invalid_operand
429
      mov_mem_reg:
432
      mov_mem_reg:
430
	lods	byte [esi]
433
	lods	byte [esi]
431
	cmp	al,60h
434
	cmp	al,60h
432
	jb	mov_mem_general_reg
435
	jb	mov_mem_general_reg
433
	cmp	al,70h
436
	cmp	al,70h
434
	jb	mov_mem_sreg
437
	jb	mov_mem_sreg
435
      mov_mem_general_reg:
438
      mov_mem_general_reg:
436
	call	convert_register
439
	call	convert_register
437
	mov	[postbyte_register],al
440
	mov	[postbyte_register],al
438
	pop	ecx ebx edx
441
	pop	ecx ebx edx
439
	cmp	ah,1
442
	cmp	ah,1
440
	je	mov_mem_reg_8bit
443
	je	mov_mem_reg_8bit
441
	mov	al,ah
444
	mov	al,ah
442
	call	operand_autodetect
445
	call	operand_autodetect
443
	mov	al,[postbyte_register]
446
	mov	al,[postbyte_register]
444
	or	al,bl
447
	or	al,bl
445
	or	al,bh
448
	or	al,bh
446
	jz	mov_mem_ax
449
	jz	mov_mem_ax
447
	inc	[base_code]
450
	inc	[base_code]
448
	jmp	instruction_ready
451
	jmp	instruction_ready
449
      mov_mem_reg_8bit:
452
      mov_mem_reg_8bit:
450
	or	al,bl
453
	or	al,bl
451
	or	al,bh
454
	or	al,bh
452
	jnz	instruction_ready
455
	jnz	instruction_ready
453
      mov_mem_al:
456
      mov_mem_al:
454
	test	ch,22h
457
	test	ch,22h
455
	jnz	mov_mem_address16_al
458
	jnz	mov_mem_address16_al
456
	test	ch,44h
459
	test	ch,44h
457
	jnz	mov_mem_address32_al
460
	jnz	mov_mem_address32_al
458
	test	ch,88h
461
	test	ch,88h
459
	jnz	mov_mem_address64_al
462
	jnz	mov_mem_address64_al
460
	or	ch,ch
463
	or	ch,ch
461
	jnz	invalid_address_size
464
	jnz	invalid_address_size
462
	cmp	[code_type],64
465
	cmp	[code_type],64
463
	je	mov_mem_address64_al
466
	je	mov_mem_address64_al
464
	cmp	[code_type],32
467
	cmp	[code_type],32
465
	je	mov_mem_address32_al
468
	je	mov_mem_address32_al
466
	cmp	edx,10000h
469
	cmp	edx,10000h
467
	jb	mov_mem_address16_al
470
	jb	mov_mem_address16_al
468
      mov_mem_address32_al:
471
      mov_mem_address32_al:
469
	call	store_segment_prefix_if_necessary
472
	call	store_segment_prefix_if_necessary
470
	call	address_32bit_prefix
473
	call	address_32bit_prefix
471
	mov	[base_code],0A2h
474
	mov	[base_code],0A2h
472
      store_mov_address32:
475
      store_mov_address32:
473
	call	store_instruction_code
476
	call	store_instruction_code
474
	call	store_address_32bit_value
477
	call	store_address_32bit_value
475
	jmp	instruction_assembled
478
	jmp	instruction_assembled
476
      mov_mem_address16_al:
479
      mov_mem_address16_al:
477
	call	store_segment_prefix_if_necessary
480
	call	store_segment_prefix_if_necessary
478
	call	address_16bit_prefix
481
	call	address_16bit_prefix
479
	mov	[base_code],0A2h
482
	mov	[base_code],0A2h
480
      store_mov_address16:
483
      store_mov_address16:
481
	cmp	[code_type],64
484
	cmp	[code_type],64
482
	je	invalid_address
485
	je	invalid_address
483
	call	store_instruction_code
486
	call	store_instruction_code
484
	mov	eax,edx
487
	mov	eax,edx
485
	stos	word [edi]
488
	stos	word [edi]
486
	cmp	edx,10000h
489
	cmp	edx,10000h
487
	jge	value_out_of_range
490
	jge	value_out_of_range
488
	jmp	instruction_assembled
491
	jmp	instruction_assembled
489
      mov_mem_address64_al:
492
      mov_mem_address64_al:
490
	call	store_segment_prefix_if_necessary
493
	call	store_segment_prefix_if_necessary
491
	mov	[base_code],0A2h
494
	mov	[base_code],0A2h
492
      store_mov_address64:
495
      store_mov_address64:
493
	call	store_instruction_code
496
	call	store_instruction_code
494
	call	store_address_64bit_value
497
	call	store_address_64bit_value
495
	jmp	instruction_assembled
498
	jmp	instruction_assembled
496
      mov_mem_ax:
499
      mov_mem_ax:
497
	test	ch,22h
500
	test	ch,22h
498
	jnz	mov_mem_address16_ax
501
	jnz	mov_mem_address16_ax
499
	test	ch,44h
502
	test	ch,44h
500
	jnz	mov_mem_address32_ax
503
	jnz	mov_mem_address32_ax
501
	test	ch,88h
504
	test	ch,88h
502
	jnz	mov_mem_address64_ax
505
	jnz	mov_mem_address64_ax
503
	or	ch,ch
506
	or	ch,ch
504
	jnz	invalid_address_size
507
	jnz	invalid_address_size
505
	cmp	[code_type],64
508
	cmp	[code_type],64
506
	je	mov_mem_address64_ax
509
	je	mov_mem_address64_ax
507
	cmp	[code_type],32
510
	cmp	[code_type],32
508
	je	mov_mem_address32_ax
511
	je	mov_mem_address32_ax
509
	cmp	edx,10000h
512
	cmp	edx,10000h
510
	jb	mov_mem_address16_ax
513
	jb	mov_mem_address16_ax
511
      mov_mem_address32_ax:
514
      mov_mem_address32_ax:
512
	call	store_segment_prefix_if_necessary
515
	call	store_segment_prefix_if_necessary
513
	call	address_32bit_prefix
516
	call	address_32bit_prefix
514
	mov	[base_code],0A3h
517
	mov	[base_code],0A3h
515
	jmp	store_mov_address32
518
	jmp	store_mov_address32
516
      mov_mem_address16_ax:
519
      mov_mem_address16_ax:
517
	call	store_segment_prefix_if_necessary
520
	call	store_segment_prefix_if_necessary
518
	call	address_16bit_prefix
521
	call	address_16bit_prefix
519
	mov	[base_code],0A3h
522
	mov	[base_code],0A3h
520
	jmp	store_mov_address16
523
	jmp	store_mov_address16
521
      mov_mem_address64_ax:
524
      mov_mem_address64_ax:
522
	call	store_segment_prefix_if_necessary
525
	call	store_segment_prefix_if_necessary
523
	mov	[base_code],0A3h
526
	mov	[base_code],0A3h
524
	jmp	store_mov_address64
527
	jmp	store_mov_address64
525
      mov_mem_sreg:
528
      mov_mem_sreg:
526
	sub	al,61h
529
	sub	al,61h
527
	mov	[postbyte_register],al
530
	mov	[postbyte_register],al
528
	pop	ecx ebx edx
531
	pop	ecx ebx edx
529
	mov	ah,[operand_size]
532
	mov	ah,[operand_size]
530
	or	ah,ah
533
	or	ah,ah
531
	jz	mov_mem_sreg_store
534
	jz	mov_mem_sreg_store
532
	cmp	ah,2
535
	cmp	ah,2
533
	jne	invalid_operand_size
536
	jne	invalid_operand_size
534
      mov_mem_sreg_store:
537
      mov_mem_sreg_store:
535
	mov	[base_code],8Ch
538
	mov	[base_code],8Ch
536
	jmp	instruction_ready
539
	jmp	instruction_ready
537
      mov_mem_imm:
540
      mov_mem_imm:
538
	mov	al,[operand_size]
541
	mov	al,[operand_size]
539
	cmp	al,1
542
	cmp	al,1
540
	jb	mov_mem_imm_nosize
543
	jb	mov_mem_imm_nosize
541
	je	mov_mem_imm_8bit
544
	je	mov_mem_imm_8bit
542
	cmp	al,2
545
	cmp	al,2
543
	je	mov_mem_imm_16bit
546
	je	mov_mem_imm_16bit
544
	cmp	al,4
547
	cmp	al,4
545
	je	mov_mem_imm_32bit
548
	je	mov_mem_imm_32bit
546
	cmp	al,8
549
	cmp	al,8
547
	jne	invalid_operand_size
550
	jne	invalid_operand_size
548
      mov_mem_imm_64bit:
551
      mov_mem_imm_64bit:
549
	cmp	[size_declared],0
552
	cmp	[size_declared],0
550
	jne	long_immediate_not_encodable
553
	jne	long_immediate_not_encodable
551
	call	operand_64bit
554
	call	operand_64bit
552
	call	get_simm32
555
	call	get_simm32
553
	cmp	[value_type],4
556
	cmp	[value_type],4
554
	jae	long_immediate_not_encodable
557
	jae	long_immediate_not_encodable
555
	jmp	mov_mem_imm_32bit_store
558
	jmp	mov_mem_imm_32bit_store
556
      mov_mem_imm_8bit:
559
      mov_mem_imm_8bit:
557
	call	get_byte_value
560
	call	get_byte_value
558
	mov	byte [value],al
561
	mov	byte [value],al
559
	mov	[postbyte_register],0
562
	mov	[postbyte_register],0
560
	mov	[base_code],0C6h
563
	mov	[base_code],0C6h
561
	pop	ecx ebx edx
564
	pop	ecx ebx edx
562
	call	store_instruction_with_imm8
565
	call	store_instruction_with_imm8
563
	jmp	instruction_assembled
566
	jmp	instruction_assembled
564
      mov_mem_imm_16bit:
567
      mov_mem_imm_16bit:
565
	call	operand_16bit
568
	call	operand_16bit
566
	call	get_word_value
569
	call	get_word_value
567
	mov	word [value],ax
570
	mov	word [value],ax
568
	mov	[postbyte_register],0
571
	mov	[postbyte_register],0
569
	mov	[base_code],0C7h
572
	mov	[base_code],0C7h
570
	pop	ecx ebx edx
573
	pop	ecx ebx edx
571
	call	store_instruction_with_imm16
574
	call	store_instruction_with_imm16
572
	jmp	instruction_assembled
575
	jmp	instruction_assembled
573
      mov_mem_imm_nosize:
576
      mov_mem_imm_nosize:
574
	cmp	[error_line],0
577
	cmp	[error_line],0
575
	jne	mov_mem_imm_32bit
578
	jne	mov_mem_imm_32bit
576
	mov	eax,[current_line]
579
	mov	eax,[current_line]
577
	mov	[error_line],eax
580
	mov	[error_line],eax
578
	mov	[error],operand_size_not_specified
581
	mov	[error],operand_size_not_specified
579
      mov_mem_imm_32bit:
582
      mov_mem_imm_32bit:
580
	call	operand_32bit
583
	call	operand_32bit
581
	call	get_dword_value
584
	call	get_dword_value
582
      mov_mem_imm_32bit_store:
585
      mov_mem_imm_32bit_store:
583
	mov	dword [value],eax
586
	mov	dword [value],eax
584
	mov	[postbyte_register],0
587
	mov	[postbyte_register],0
585
	mov	[base_code],0C7h
588
	mov	[base_code],0C7h
586
	pop	ecx ebx edx
589
	pop	ecx ebx edx
587
	call	store_instruction_with_imm32
590
	call	store_instruction_with_imm32
588
	jmp	instruction_assembled
591
	jmp	instruction_assembled
589
      mov_reg:
592
      mov_reg:
590
	lods	byte [esi]
593
	lods	byte [esi]
591
	mov	ah,al
594
	mov	ah,al
592
	sub	ah,10h
595
	sub	ah,10h
593
	and	ah,al
596
	and	ah,al
594
	test	ah,0F0h
597
	test	ah,0F0h
595
	jnz	mov_sreg
598
	jnz	mov_sreg
596
	call	convert_register
599
	call	convert_register
597
	mov	[postbyte_register],al
600
	mov	[postbyte_register],al
598
	lods	byte [esi]
601
	lods	byte [esi]
599
	cmp	al,','
602
	cmp	al,','
600
	jne	invalid_operand
603
	jne	invalid_operand
601
	lods	byte [esi]
604
	lods	byte [esi]
602
	call	get_size_operator
605
	call	get_size_operator
603
	cmp	al,'['
606
	cmp	al,'['
604
	je	mov_reg_mem
607
	je	mov_reg_mem
605
	cmp	al,'('
608
	cmp	al,'('
606
	je	mov_reg_imm
609
	je	mov_reg_imm
607
	cmp	al,10h
610
	cmp	al,10h
608
	jne	invalid_operand
611
	jne	invalid_operand
609
      mov_reg_reg:
612
      mov_reg_reg:
610
	lods	byte [esi]
613
	lods	byte [esi]
611
	mov	ah,al
614
	mov	ah,al
612
	sub	ah,10h
615
	sub	ah,10h
613
	and	ah,al
616
	and	ah,al
614
	test	ah,0F0h
617
	test	ah,0F0h
615
	jnz	mov_reg_sreg
618
	jnz	mov_reg_sreg
616
	call	convert_register
619
	call	convert_register
617
	mov	bl,[postbyte_register]
620
	mov	bl,[postbyte_register]
618
	mov	[postbyte_register],al
621
	mov	[postbyte_register],al
619
	mov	al,ah
622
	mov	al,ah
620
	cmp	al,1
623
	cmp	al,1
621
	je	mov_reg_reg_8bit
624
	je	mov_reg_reg_8bit
622
	call	operand_autodetect
625
	call	operand_autodetect
623
	inc	[base_code]
626
	inc	[base_code]
624
      mov_reg_reg_8bit:
627
      mov_reg_reg_8bit:
625
	jmp	nomem_instruction_ready
628
	jmp	nomem_instruction_ready
626
      mov_reg_sreg:
629
      mov_reg_sreg:
627
	mov	bl,[postbyte_register]
630
	mov	bl,[postbyte_register]
628
	mov	ah,al
631
	mov	ah,al
629
	and	al,1111b
632
	and	al,1111b
630
	mov	[postbyte_register],al
633
	mov	[postbyte_register],al
631
	shr	ah,4
634
	shr	ah,4
632
	cmp	ah,5
635
	cmp	ah,5
633
	je	mov_reg_creg
636
	je	mov_reg_creg
634
	cmp	ah,7
637
	cmp	ah,7
635
	je	mov_reg_dreg
638
	je	mov_reg_dreg
636
	ja	mov_reg_treg
639
	ja	mov_reg_treg
637
	dec	[postbyte_register]
640
	dec	[postbyte_register]
638
	cmp	[operand_size],8
641
	cmp	[operand_size],8
639
	je	mov_reg_sreg64
642
	je	mov_reg_sreg64
640
	cmp	[operand_size],4
643
	cmp	[operand_size],4
641
	je	mov_reg_sreg32
644
	je	mov_reg_sreg32
642
	cmp	[operand_size],2
645
	cmp	[operand_size],2
643
	jne	invalid_operand_size
646
	jne	invalid_operand_size
644
	call	operand_16bit
647
	call	operand_16bit
645
	jmp	mov_reg_sreg_store
648
	jmp	mov_reg_sreg_store
646
      mov_reg_sreg64:
649
      mov_reg_sreg64:
647
	call	operand_64bit
650
	call	operand_64bit
648
	jmp	mov_reg_sreg_store
651
	jmp	mov_reg_sreg_store
649
      mov_reg_sreg32:
652
      mov_reg_sreg32:
650
	call	operand_32bit
653
	call	operand_32bit
651
      mov_reg_sreg_store:
654
      mov_reg_sreg_store:
652
	mov	[base_code],8Ch
655
	mov	[base_code],8Ch
653
	jmp	nomem_instruction_ready
656
	jmp	nomem_instruction_ready
654
      mov_reg_treg:
657
      mov_reg_treg:
655
	cmp	ah,9
658
	cmp	ah,9
656
	jne	invalid_operand
659
	jne	invalid_operand
657
	mov	[extended_code],24h
660
	mov	[extended_code],24h
658
	jmp	mov_reg_xrx
661
	jmp	mov_reg_xrx
659
      mov_reg_dreg:
662
      mov_reg_dreg:
660
	mov	[extended_code],21h
663
	mov	[extended_code],21h
661
	jmp	mov_reg_xrx
664
	jmp	mov_reg_xrx
662
      mov_reg_creg:
665
      mov_reg_creg:
663
	mov	[extended_code],20h
666
	mov	[extended_code],20h
664
      mov_reg_xrx:
667
      mov_reg_xrx:
665
	mov	[base_code],0Fh
668
	mov	[base_code],0Fh
666
	cmp	[code_type],64
669
	cmp	[code_type],64
667
	je	mov_reg_xrx_64bit
670
	je	mov_reg_xrx_64bit
668
	cmp	[operand_size],4
671
	cmp	[operand_size],4
669
	jne	invalid_operand_size
672
	jne	invalid_operand_size
670
	cmp	[postbyte_register],8
673
	cmp	[postbyte_register],8
671
	jne	mov_reg_xrx_store
674
	jne	mov_reg_xrx_store
672
	cmp	[extended_code],20h
675
	cmp	[extended_code],20h
673
	jne	mov_reg_xrx_store
676
	jne	mov_reg_xrx_store
674
	mov	al,0F0h
677
	mov	al,0F0h
675
	stos	byte [edi]
678
	stos	byte [edi]
676
	mov	[postbyte_register],0
679
	mov	[postbyte_register],0
677
      mov_reg_xrx_store:
680
      mov_reg_xrx_store:
678
	jmp	nomem_instruction_ready
681
	jmp	nomem_instruction_ready
679
      mov_reg_xrx_64bit:
682
      mov_reg_xrx_64bit:
680
	cmp	[operand_size],8
683
	cmp	[operand_size],8
681
	jne	invalid_operand_size
684
	jne	invalid_operand_size
682
	jmp	nomem_instruction_ready
685
	jmp	nomem_instruction_ready
683
      mov_reg_mem:
686
      mov_reg_mem:
684
	call	get_address
687
	call	get_address
685
	mov	al,[operand_size]
688
	mov	al,[operand_size]
686
	cmp	al,1
689
	cmp	al,1
687
	je	mov_reg_mem_8bit
690
	je	mov_reg_mem_8bit
688
	call	operand_autodetect
691
	call	operand_autodetect
689
	mov	al,[postbyte_register]
692
	mov	al,[postbyte_register]
690
	or	al,bl
693
	or	al,bl
691
	or	al,bh
694
	or	al,bh
692
	jz	mov_ax_mem
695
	jz	mov_ax_mem
693
	add	[base_code],3
696
	add	[base_code],3
694
	jmp	instruction_ready
697
	jmp	instruction_ready
695
      mov_reg_mem_8bit:
698
      mov_reg_mem_8bit:
696
	mov	al,[postbyte_register]
699
	mov	al,[postbyte_register]
697
	or	al,bl
700
	or	al,bl
698
	or	al,bh
701
	or	al,bh
699
	jz	mov_al_mem
702
	jz	mov_al_mem
700
	add	[base_code],2
703
	add	[base_code],2
701
	jmp	instruction_ready
704
	jmp	instruction_ready
702
      mov_al_mem:
705
      mov_al_mem:
703
	test	ch,22h
706
	test	ch,22h
704
	jnz	mov_al_mem_address16
707
	jnz	mov_al_mem_address16
705
	test	ch,44h
708
	test	ch,44h
706
	jnz	mov_al_mem_address32
709
	jnz	mov_al_mem_address32
707
	test	ch,88h
710
	test	ch,88h
708
	jnz	mov_al_mem_address64
711
	jnz	mov_al_mem_address64
709
	or	ch,ch
712
	or	ch,ch
710
	jnz	invalid_address_size
713
	jnz	invalid_address_size
711
	cmp	[code_type],64
714
	cmp	[code_type],64
712
	je	mov_al_mem_address64
715
	je	mov_al_mem_address64
713
	cmp	[code_type],32
716
	cmp	[code_type],32
714
	je	mov_al_mem_address32
717
	je	mov_al_mem_address32
715
	cmp	edx,10000h
718
	cmp	edx,10000h
716
	jb	mov_al_mem_address16
719
	jb	mov_al_mem_address16
717
      mov_al_mem_address32:
720
      mov_al_mem_address32:
718
	call	store_segment_prefix_if_necessary
721
	call	store_segment_prefix_if_necessary
719
	call	address_32bit_prefix
722
	call	address_32bit_prefix
720
	mov	[base_code],0A0h
723
	mov	[base_code],0A0h
721
	jmp	store_mov_address32
724
	jmp	store_mov_address32
722
      mov_al_mem_address16:
725
      mov_al_mem_address16:
723
	call	store_segment_prefix_if_necessary
726
	call	store_segment_prefix_if_necessary
724
	call	address_16bit_prefix
727
	call	address_16bit_prefix
725
	mov	[base_code],0A0h
728
	mov	[base_code],0A0h
726
	jmp	store_mov_address16
729
	jmp	store_mov_address16
727
      mov_al_mem_address64:
730
      mov_al_mem_address64:
728
	call	store_segment_prefix_if_necessary
731
	call	store_segment_prefix_if_necessary
729
	mov	[base_code],0A0h
732
	mov	[base_code],0A0h
730
	jmp	store_mov_address64
733
	jmp	store_mov_address64
731
      mov_ax_mem:
734
      mov_ax_mem:
732
	test	ch,22h
735
	test	ch,22h
733
	jnz	mov_ax_mem_address16
736
	jnz	mov_ax_mem_address16
734
	test	ch,44h
737
	test	ch,44h
735
	jnz	mov_ax_mem_address32
738
	jnz	mov_ax_mem_address32
736
	test	ch,88h
739
	test	ch,88h
737
	jnz	mov_ax_mem_address64
740
	jnz	mov_ax_mem_address64
738
	or	ch,ch
741
	or	ch,ch
739
	jnz	invalid_address_size
742
	jnz	invalid_address_size
740
	cmp	[code_type],64
743
	cmp	[code_type],64
741
	je	mov_ax_mem_address64
744
	je	mov_ax_mem_address64
742
	cmp	[code_type],32
745
	cmp	[code_type],32
743
	je	mov_ax_mem_address32
746
	je	mov_ax_mem_address32
744
	cmp	edx,10000h
747
	cmp	edx,10000h
745
	jb	mov_ax_mem_address16
748
	jb	mov_ax_mem_address16
746
      mov_ax_mem_address32:
749
      mov_ax_mem_address32:
747
	call	store_segment_prefix_if_necessary
750
	call	store_segment_prefix_if_necessary
748
	call	address_32bit_prefix
751
	call	address_32bit_prefix
749
	mov	[base_code],0A1h
752
	mov	[base_code],0A1h
750
	jmp	store_mov_address32
753
	jmp	store_mov_address32
751
      mov_ax_mem_address16:
754
      mov_ax_mem_address16:
752
	call	store_segment_prefix_if_necessary
755
	call	store_segment_prefix_if_necessary
753
	call	address_16bit_prefix
756
	call	address_16bit_prefix
754
	mov	[base_code],0A1h
757
	mov	[base_code],0A1h
755
	jmp	store_mov_address16
758
	jmp	store_mov_address16
756
      mov_ax_mem_address64:
759
      mov_ax_mem_address64:
757
	call	store_segment_prefix_if_necessary
760
	call	store_segment_prefix_if_necessary
758
	mov	[base_code],0A1h
761
	mov	[base_code],0A1h
759
	jmp	store_mov_address64
762
	jmp	store_mov_address64
760
      mov_reg_imm:
763
      mov_reg_imm:
761
	mov	al,[operand_size]
764
	mov	al,[operand_size]
762
	cmp	al,1
765
	cmp	al,1
763
	je	mov_reg_imm_8bit
766
	je	mov_reg_imm_8bit
764
	cmp	al,2
767
	cmp	al,2
765
	je	mov_reg_imm_16bit
768
	je	mov_reg_imm_16bit
766
	cmp	al,4
769
	cmp	al,4
767
	je	mov_reg_imm_32bit
770
	je	mov_reg_imm_32bit
768
	cmp	al,8
771
	cmp	al,8
769
	jne	invalid_operand_size
772
	jne	invalid_operand_size
770
      mov_reg_imm_64bit:
773
      mov_reg_imm_64bit:
771
	call	operand_64bit
774
	call	operand_64bit
772
	call	get_qword_value
775
	call	get_qword_value
773
	mov	ecx,edx
776
	mov	ecx,edx
774
	cmp	[size_declared],0
777
	cmp	[size_declared],0
775
	jne	mov_reg_imm_64bit_store
778
	jne	mov_reg_imm_64bit_store
776
	cmp	[value_type],4
779
	cmp	[value_type],4
777
	jae	mov_reg_imm_64bit_store
780
	jae	mov_reg_imm_64bit_store
778
	cdq
781
	cdq
779
	cmp	ecx,edx
782
	cmp	ecx,edx
780
	je	mov_reg_64bit_imm_32bit
783
	je	mov_reg_64bit_imm_32bit
781
      mov_reg_imm_64bit_store:
784
      mov_reg_imm_64bit_store:
782
	push	eax ecx
785
	push	eax ecx
783
	mov	al,0B8h
786
	mov	al,0B8h
784
	call	store_mov_reg_imm_code
787
	call	store_mov_reg_imm_code
785
	pop	edx eax
788
	pop	edx eax
786
	call	mark_relocation
789
	call	mark_relocation
787
	stos	dword [edi]
790
	stos	dword [edi]
788
	mov	eax,edx
791
	mov	eax,edx
789
	stos	dword [edi]
792
	stos	dword [edi]
790
	jmp	instruction_assembled
793
	jmp	instruction_assembled
791
      mov_reg_imm_8bit:
794
      mov_reg_imm_8bit:
792
	call	get_byte_value
795
	call	get_byte_value
793
	mov	dl,al
796
	mov	dl,al
794
	mov	al,0B0h
797
	mov	al,0B0h
795
	call	store_mov_reg_imm_code
798
	call	store_mov_reg_imm_code
796
	mov	al,dl
799
	mov	al,dl
797
	stos	byte [edi]
800
	stos	byte [edi]
798
	jmp	instruction_assembled
801
	jmp	instruction_assembled
799
      mov_reg_imm_16bit:
802
      mov_reg_imm_16bit:
800
	call	get_word_value
803
	call	get_word_value
801
	mov	dx,ax
804
	mov	dx,ax
802
	call	operand_16bit
805
	call	operand_16bit
803
	mov	al,0B8h
806
	mov	al,0B8h
804
	call	store_mov_reg_imm_code
807
	call	store_mov_reg_imm_code
805
	mov	ax,dx
808
	mov	ax,dx
806
	call	mark_relocation
809
	call	mark_relocation
807
	stos	word [edi]
810
	stos	word [edi]
808
	jmp	instruction_assembled
811
	jmp	instruction_assembled
809
      mov_reg_imm_32bit:
812
      mov_reg_imm_32bit:
810
	call	operand_32bit
813
	call	operand_32bit
811
	call	get_dword_value
814
	call	get_dword_value
812
	mov	edx,eax
815
	mov	edx,eax
813
	mov	al,0B8h
816
	mov	al,0B8h
814
	call	store_mov_reg_imm_code
817
	call	store_mov_reg_imm_code
815
      mov_store_imm_32bit:
818
      mov_store_imm_32bit:
816
	mov	eax,edx
819
	mov	eax,edx
817
	call	mark_relocation
820
	call	mark_relocation
818
	stos	dword [edi]
821
	stos	dword [edi]
819
	jmp	instruction_assembled
822
	jmp	instruction_assembled
820
      store_mov_reg_imm_code:
823
      store_mov_reg_imm_code:
821
	mov	ah,[postbyte_register]
824
	mov	ah,[postbyte_register]
822
	test	ah,1000b
825
	test	ah,1000b
823
	jz	mov_reg_imm_prefix_ok
826
	jz	mov_reg_imm_prefix_ok
824
	or	[rex_prefix],41h
827
	or	[rex_prefix],41h
825
      mov_reg_imm_prefix_ok:
828
      mov_reg_imm_prefix_ok:
826
	and	ah,111b
829
	and	ah,111b
827
	add	al,ah
830
	add	al,ah
828
	mov	[base_code],al
831
	mov	[base_code],al
829
	call	store_instruction_code
832
	call	store_instruction_code
830
	ret
833
	ret
831
      mov_reg_64bit_imm_32bit:
834
      mov_reg_64bit_imm_32bit:
832
	mov	edx,eax
835
	mov	edx,eax
833
	mov	bl,[postbyte_register]
836
	mov	bl,[postbyte_register]
834
	mov	[postbyte_register],0
837
	mov	[postbyte_register],0
835
	mov	[base_code],0C7h
838
	mov	[base_code],0C7h
836
	call	store_nomem_instruction
839
	call	store_nomem_instruction
837
	jmp	mov_store_imm_32bit
840
	jmp	mov_store_imm_32bit
838
      mov_sreg:
841
      mov_sreg:
839
	mov	ah,al
842
	mov	ah,al
840
	and	al,1111b
843
	and	al,1111b
841
	mov	[postbyte_register],al
844
	mov	[postbyte_register],al
842
	shr	ah,4
845
	shr	ah,4
843
	cmp	ah,5
846
	cmp	ah,5
844
	je	mov_creg
847
	je	mov_creg
845
	cmp	ah,7
848
	cmp	ah,7
846
	je	mov_dreg
849
	je	mov_dreg
847
	ja	mov_treg
850
	ja	mov_treg
848
	cmp	al,2
851
	cmp	al,2
849
	je	illegal_instruction
852
	je	illegal_instruction
850
	dec	[postbyte_register]
853
	dec	[postbyte_register]
851
	lods	byte [esi]
854
	lods	byte [esi]
852
	cmp	al,','
855
	cmp	al,','
853
	jne	invalid_operand
856
	jne	invalid_operand
854
	lods	byte [esi]
857
	lods	byte [esi]
855
	call	get_size_operator
858
	call	get_size_operator
856
	cmp	al,'['
859
	cmp	al,'['
857
	je	mov_sreg_mem
860
	je	mov_sreg_mem
858
	cmp	al,10h
861
	cmp	al,10h
859
	jne	invalid_operand
862
	jne	invalid_operand
860
      mov_sreg_reg:
863
      mov_sreg_reg:
861
	lods	byte [esi]
864
	lods	byte [esi]
862
	call	convert_register
865
	call	convert_register
863
	or	ah,ah
866
	or	ah,ah
864
	jz	mov_sreg_reg_size_ok
867
	jz	mov_sreg_reg_size_ok
865
	cmp	ah,2
868
	cmp	ah,2
866
	jne	invalid_operand_size
869
	jne	invalid_operand_size
867
	mov	bl,al
870
	mov	bl,al
868
      mov_sreg_reg_size_ok:
871
      mov_sreg_reg_size_ok:
869
	mov	[base_code],8Eh
872
	mov	[base_code],8Eh
870
	jmp	nomem_instruction_ready
873
	jmp	nomem_instruction_ready
871
      mov_sreg_mem:
874
      mov_sreg_mem:
872
	call	get_address
875
	call	get_address
873
	mov	al,[operand_size]
876
	mov	al,[operand_size]
874
	or	al,al
877
	or	al,al
875
	jz	mov_sreg_mem_size_ok
878
	jz	mov_sreg_mem_size_ok
876
	cmp	al,2
879
	cmp	al,2
877
	jne	invalid_operand_size
880
	jne	invalid_operand_size
878
      mov_sreg_mem_size_ok:
881
      mov_sreg_mem_size_ok:
879
	mov	[base_code],8Eh
882
	mov	[base_code],8Eh
880
	jmp	instruction_ready
883
	jmp	instruction_ready
881
      mov_treg:
884
      mov_treg:
882
	cmp	ah,9
885
	cmp	ah,9
883
	jne	invalid_operand
886
	jne	invalid_operand
884
	mov	[extended_code],26h
887
	mov	[extended_code],26h
885
	jmp	mov_xrx
888
	jmp	mov_xrx
886
      mov_dreg:
889
      mov_dreg:
887
	mov	[extended_code],23h
890
	mov	[extended_code],23h
888
	jmp	mov_xrx
891
	jmp	mov_xrx
889
      mov_creg:
892
      mov_creg:
890
	mov	[extended_code],22h
893
	mov	[extended_code],22h
891
      mov_xrx:
894
      mov_xrx:
892
	mov	[base_code],0Fh
895
	mov	[base_code],0Fh
893
	lods	byte [esi]
896
	lods	byte [esi]
894
	cmp	al,','
897
	cmp	al,','
895
	jne	invalid_operand
898
	jne	invalid_operand
896
	lods	byte [esi]
899
	lods	byte [esi]
897
	cmp	al,10h
900
	cmp	al,10h
898
	jne	invalid_operand
901
	jne	invalid_operand
899
	lods	byte [esi]
902
	lods	byte [esi]
900
	call	convert_register
903
	call	convert_register
901
	mov	bl,al
904
	mov	bl,al
902
	cmp	[code_type],64
905
	cmp	[code_type],64
903
	je	mov_xrx_64bit
906
	je	mov_xrx_64bit
904
	cmp	ah,4
907
	cmp	ah,4
905
	jne	invalid_operand_size
908
	jne	invalid_operand_size
906
	cmp	[postbyte_register],8
909
	cmp	[postbyte_register],8
907
	jne	mov_xrx_store
910
	jne	mov_xrx_store
908
	cmp	[extended_code],22h
911
	cmp	[extended_code],22h
909
	jne	mov_xrx_store
912
	jne	mov_xrx_store
910
	mov	al,0F0h
913
	mov	al,0F0h
911
	stos	byte [edi]
914
	stos	byte [edi]
912
	mov	[postbyte_register],0
915
	mov	[postbyte_register],0
913
      mov_xrx_store:
916
      mov_xrx_store:
914
	jmp	nomem_instruction_ready
917
	jmp	nomem_instruction_ready
915
      mov_xrx_64bit:
918
      mov_xrx_64bit:
916
	cmp	ah,8
919
	cmp	ah,8
917
	je	mov_xrx_store
920
	je	mov_xrx_store
918
	jmp	invalid_operand_size
921
	jmp	invalid_operand_size
919
cmov_instruction:
922
cmov_instruction:
920
	mov	[base_code],0Fh
923
	mov	[base_code],0Fh
921
	mov	[extended_code],al
924
	mov	[extended_code],al
922
	lods	byte [esi]
925
	lods	byte [esi]
923
	call	get_size_operator
926
	call	get_size_operator
924
	cmp	al,10h
927
	cmp	al,10h
925
	jne	invalid_operand
928
	jne	invalid_operand
926
	lods	byte [esi]
929
	lods	byte [esi]
927
	call	convert_register
930
	call	convert_register
928
	mov	[postbyte_register],al
931
	mov	[postbyte_register],al
929
	lods	byte [esi]
932
	lods	byte [esi]
930
	cmp	al,','
933
	cmp	al,','
931
	jne	invalid_operand
934
	jne	invalid_operand
932
	lods	byte [esi]
935
	lods	byte [esi]
933
	call	get_size_operator
936
	call	get_size_operator
934
	cmp	al,'['
937
	cmp	al,'['
935
	je	cmov_reg_mem
938
	je	cmov_reg_mem
936
	cmp	al,10h
939
	cmp	al,10h
937
	jne	invalid_operand
940
	jne	invalid_operand
938
      cmov_reg_reg:
941
      cmov_reg_reg:
939
	lods	byte [esi]
942
	lods	byte [esi]
940
	call	convert_register
943
	call	convert_register
941
	mov	bl,al
944
	mov	bl,al
942
	mov	al,ah
945
	mov	al,ah
943
	call	operand_autodetect
946
	call	operand_autodetect
944
	jmp	nomem_instruction_ready
947
	jmp	nomem_instruction_ready
945
      cmov_reg_mem:
948
      cmov_reg_mem:
946
	call	get_address
949
	call	get_address
947
	mov	al,[operand_size]
950
	mov	al,[operand_size]
948
	call	operand_autodetect
951
	call	operand_autodetect
949
	jmp	instruction_ready
952
	jmp	instruction_ready
950
test_instruction:
953
test_instruction:
951
	mov	[base_code],84h
954
	mov	[base_code],84h
952
	lods	byte [esi]
955
	lods	byte [esi]
953
	call	get_size_operator
956
	call	get_size_operator
954
	cmp	al,10h
957
	cmp	al,10h
955
	je	test_reg
958
	je	test_reg
956
	cmp	al,'['
959
	cmp	al,'['
957
	jne	invalid_operand
960
	jne	invalid_operand
958
      test_mem:
961
      test_mem:
959
	call	get_address
962
	call	get_address
960
	push	edx ebx ecx
963
	push	edx ebx ecx
961
	lods	byte [esi]
964
	lods	byte [esi]
962
	cmp	al,','
965
	cmp	al,','
963
	jne	invalid_operand
966
	jne	invalid_operand
964
	lods	byte [esi]
967
	lods	byte [esi]
965
	call	get_size_operator
968
	call	get_size_operator
966
	cmp	al,'('
969
	cmp	al,'('
967
	je	test_mem_imm
970
	je	test_mem_imm
968
	cmp	al,10h
971
	cmp	al,10h
969
	jne	invalid_operand
972
	jne	invalid_operand
970
      test_mem_reg:
973
      test_mem_reg:
971
	lods	byte [esi]
974
	lods	byte [esi]
972
	call	convert_register
975
	call	convert_register
973
	mov	[postbyte_register],al
976
	mov	[postbyte_register],al
974
	pop	ecx ebx edx
977
	pop	ecx ebx edx
975
	mov	al,ah
978
	mov	al,ah
976
	cmp	al,1
979
	cmp	al,1
977
	je	test_mem_reg_8bit
980
	je	test_mem_reg_8bit
978
	call	operand_autodetect
981
	call	operand_autodetect
979
	inc	[base_code]
982
	inc	[base_code]
980
      test_mem_reg_8bit:
983
      test_mem_reg_8bit:
981
	jmp	instruction_ready
984
	jmp	instruction_ready
982
      test_mem_imm:
985
      test_mem_imm:
983
	mov	al,[operand_size]
986
	mov	al,[operand_size]
984
	cmp	al,1
987
	cmp	al,1
985
	jb	test_mem_imm_nosize
988
	jb	test_mem_imm_nosize
986
	je	test_mem_imm_8bit
989
	je	test_mem_imm_8bit
987
	cmp	al,2
990
	cmp	al,2
988
	je	test_mem_imm_16bit
991
	je	test_mem_imm_16bit
989
	cmp	al,4
992
	cmp	al,4
990
	je	test_mem_imm_32bit
993
	je	test_mem_imm_32bit
991
	cmp	al,8
994
	cmp	al,8
992
	jne	invalid_operand_size
995
	jne	invalid_operand_size
993
      test_mem_imm_64bit:
996
      test_mem_imm_64bit:
994
	cmp	[size_declared],0
997
	cmp	[size_declared],0
995
	jne	long_immediate_not_encodable
998
	jne	long_immediate_not_encodable
996
	call	operand_64bit
999
	call	operand_64bit
997
	call	get_simm32
1000
	call	get_simm32
998
	cmp	[value_type],4
1001
	cmp	[value_type],4
999
	jae	long_immediate_not_encodable
1002
	jae	long_immediate_not_encodable
1000
	jmp	test_mem_imm_32bit_store
1003
	jmp	test_mem_imm_32bit_store
1001
      test_mem_imm_8bit:
1004
      test_mem_imm_8bit:
1002
	call	get_byte_value
1005
	call	get_byte_value
1003
	mov	byte [value],al
1006
	mov	byte [value],al
1004
	mov	[postbyte_register],0
1007
	mov	[postbyte_register],0
1005
	mov	[base_code],0F6h
1008
	mov	[base_code],0F6h
1006
	pop	ecx ebx edx
1009
	pop	ecx ebx edx
1007
	call	store_instruction_with_imm8
1010
	call	store_instruction_with_imm8
1008
	jmp	instruction_assembled
1011
	jmp	instruction_assembled
1009
      test_mem_imm_16bit:
1012
      test_mem_imm_16bit:
1010
	call	operand_16bit
1013
	call	operand_16bit
1011
	call	get_word_value
1014
	call	get_word_value
1012
	mov	word [value],ax
1015
	mov	word [value],ax
1013
	mov	[postbyte_register],0
1016
	mov	[postbyte_register],0
1014
	mov	[base_code],0F7h
1017
	mov	[base_code],0F7h
1015
	pop	ecx ebx edx
1018
	pop	ecx ebx edx
1016
	call	store_instruction_with_imm16
1019
	call	store_instruction_with_imm16
1017
	jmp	instruction_assembled
1020
	jmp	instruction_assembled
1018
      test_mem_imm_nosize:
1021
      test_mem_imm_nosize:
1019
	cmp	[error_line],0
1022
	cmp	[error_line],0
1020
	jne	test_mem_imm_32bit
1023
	jne	test_mem_imm_32bit
1021
	mov	eax,[current_line]
1024
	mov	eax,[current_line]
1022
	mov	[error_line],eax
1025
	mov	[error_line],eax
1023
	mov	[error],operand_size_not_specified
1026
	mov	[error],operand_size_not_specified
1024
      test_mem_imm_32bit:
1027
      test_mem_imm_32bit:
1025
	call	operand_32bit
1028
	call	operand_32bit
1026
	call	get_dword_value
1029
	call	get_dword_value
1027
      test_mem_imm_32bit_store:
1030
      test_mem_imm_32bit_store:
1028
	mov	dword [value],eax
1031
	mov	dword [value],eax
1029
	mov	[postbyte_register],0
1032
	mov	[postbyte_register],0
1030
	mov	[base_code],0F7h
1033
	mov	[base_code],0F7h
1031
	pop	ecx ebx edx
1034
	pop	ecx ebx edx
1032
	call	store_instruction_with_imm32
1035
	call	store_instruction_with_imm32
1033
	jmp	instruction_assembled
1036
	jmp	instruction_assembled
1034
      test_reg:
1037
      test_reg:
1035
	lods	byte [esi]
1038
	lods	byte [esi]
1036
	call	convert_register
1039
	call	convert_register
1037
	mov	[postbyte_register],al
1040
	mov	[postbyte_register],al
1038
	lods	byte [esi]
1041
	lods	byte [esi]
1039
	cmp	al,','
1042
	cmp	al,','
1040
	jne	invalid_operand
1043
	jne	invalid_operand
1041
	lods	byte [esi]
1044
	lods	byte [esi]
1042
	call	get_size_operator
1045
	call	get_size_operator
1043
	cmp	al,'['
1046
	cmp	al,'['
1044
	je	test_reg_mem
1047
	je	test_reg_mem
1045
	cmp	al,'('
1048
	cmp	al,'('
1046
	je	test_reg_imm
1049
	je	test_reg_imm
1047
	cmp	al,10h
1050
	cmp	al,10h
1048
	jne	invalid_operand
1051
	jne	invalid_operand
1049
      test_reg_reg:
1052
      test_reg_reg:
1050
	lods	byte [esi]
1053
	lods	byte [esi]
1051
	call	convert_register
1054
	call	convert_register
1052
	mov	bl,[postbyte_register]
1055
	mov	bl,[postbyte_register]
1053
	mov	[postbyte_register],al
1056
	mov	[postbyte_register],al
1054
	mov	al,ah
1057
	mov	al,ah
1055
	cmp	al,1
1058
	cmp	al,1
1056
	je	test_reg_reg_8bit
1059
	je	test_reg_reg_8bit
1057
	call	operand_autodetect
1060
	call	operand_autodetect
1058
	inc	[base_code]
1061
	inc	[base_code]
1059
      test_reg_reg_8bit:
1062
      test_reg_reg_8bit:
1060
	jmp	nomem_instruction_ready
1063
	jmp	nomem_instruction_ready
1061
      test_reg_imm:
1064
      test_reg_imm:
1062
	mov	al,[operand_size]
1065
	mov	al,[operand_size]
1063
	cmp	al,1
1066
	cmp	al,1
1064
	je	test_reg_imm_8bit
1067
	je	test_reg_imm_8bit
1065
	cmp	al,2
1068
	cmp	al,2
1066
	je	test_reg_imm_16bit
1069
	je	test_reg_imm_16bit
1067
	cmp	al,4
1070
	cmp	al,4
1068
	je	test_reg_imm_32bit
1071
	je	test_reg_imm_32bit
1069
	cmp	al,8
1072
	cmp	al,8
1070
	jne	invalid_operand_size
1073
	jne	invalid_operand_size
1071
      test_reg_imm_64bit:
1074
      test_reg_imm_64bit:
1072
	cmp	[size_declared],0
1075
	cmp	[size_declared],0
1073
	jne	long_immediate_not_encodable
1076
	jne	long_immediate_not_encodable
1074
	call	operand_64bit
1077
	call	operand_64bit
1075
	call	get_simm32
1078
	call	get_simm32
1076
	cmp	[value_type],4
1079
	cmp	[value_type],4
1077
	jae	long_immediate_not_encodable
1080
	jae	long_immediate_not_encodable
1078
	jmp	test_reg_imm_32bit_store
1081
	jmp	test_reg_imm_32bit_store
1079
      test_reg_imm_8bit:
1082
      test_reg_imm_8bit:
1080
	call	get_byte_value
1083
	call	get_byte_value
1081
	mov	dl,al
1084
	mov	dl,al
1082
	mov	bl,[postbyte_register]
1085
	mov	bl,[postbyte_register]
1083
	mov	[postbyte_register],0
1086
	mov	[postbyte_register],0
1084
	mov	[base_code],0F6h
1087
	mov	[base_code],0F6h
1085
	or	bl,bl
1088
	or	bl,bl
1086
	jz	test_al_imm
1089
	jz	test_al_imm
1087
	call	store_nomem_instruction
1090
	call	store_nomem_instruction
1088
	mov	al,dl
1091
	mov	al,dl
1089
	stos	byte [edi]
1092
	stos	byte [edi]
1090
	jmp	instruction_assembled
1093
	jmp	instruction_assembled
1091
      test_al_imm:
1094
      test_al_imm:
1092
	mov	[base_code],0A8h
1095
	mov	[base_code],0A8h
1093
	call	store_instruction_code
1096
	call	store_instruction_code
1094
	mov	al,dl
1097
	mov	al,dl
1095
	stos	byte [edi]
1098
	stos	byte [edi]
1096
	jmp	instruction_assembled
1099
	jmp	instruction_assembled
1097
      test_reg_imm_16bit:
1100
      test_reg_imm_16bit:
1098
	call	operand_16bit
1101
	call	operand_16bit
1099
	call	get_word_value
1102
	call	get_word_value
1100
	mov	dx,ax
1103
	mov	dx,ax
1101
	mov	bl,[postbyte_register]
1104
	mov	bl,[postbyte_register]
1102
	mov	[postbyte_register],0
1105
	mov	[postbyte_register],0
1103
	mov	[base_code],0F7h
1106
	mov	[base_code],0F7h
1104
	or	bl,bl
1107
	or	bl,bl
1105
	jz	test_ax_imm
1108
	jz	test_ax_imm
1106
	call	store_nomem_instruction
1109
	call	store_nomem_instruction
1107
	mov	ax,dx
1110
	mov	ax,dx
1108
	call	mark_relocation
1111
	call	mark_relocation
1109
	stos	word [edi]
1112
	stos	word [edi]
1110
	jmp	instruction_assembled
1113
	jmp	instruction_assembled
1111
      test_ax_imm:
1114
      test_ax_imm:
1112
	mov	[base_code],0A9h
1115
	mov	[base_code],0A9h
1113
	call	store_instruction_code
1116
	call	store_instruction_code
1114
	mov	ax,dx
1117
	mov	ax,dx
1115
	stos	word [edi]
1118
	stos	word [edi]
1116
	jmp	instruction_assembled
1119
	jmp	instruction_assembled
1117
      test_reg_imm_32bit:
1120
      test_reg_imm_32bit:
1118
	call	operand_32bit
1121
	call	operand_32bit
1119
	call	get_dword_value
1122
	call	get_dword_value
1120
      test_reg_imm_32bit_store:
1123
      test_reg_imm_32bit_store:
1121
	mov	edx,eax
1124
	mov	edx,eax
1122
	mov	bl,[postbyte_register]
1125
	mov	bl,[postbyte_register]
1123
	mov	[postbyte_register],0
1126
	mov	[postbyte_register],0
1124
	mov	[base_code],0F7h
1127
	mov	[base_code],0F7h
1125
	or	bl,bl
1128
	or	bl,bl
1126
	jz	test_eax_imm
1129
	jz	test_eax_imm
1127
	call	store_nomem_instruction
1130
	call	store_nomem_instruction
1128
	mov	eax,edx
1131
	mov	eax,edx
1129
	call	mark_relocation
1132
	call	mark_relocation
1130
	stos	dword [edi]
1133
	stos	dword [edi]
1131
	jmp	instruction_assembled
1134
	jmp	instruction_assembled
1132
      test_eax_imm:
1135
      test_eax_imm:
1133
	mov	[base_code],0A9h
1136
	mov	[base_code],0A9h
1134
	call	store_instruction_code
1137
	call	store_instruction_code
1135
	mov	eax,edx
1138
	mov	eax,edx
1136
	stos	dword [edi]
1139
	stos	dword [edi]
1137
	jmp	instruction_assembled
1140
	jmp	instruction_assembled
1138
      test_reg_mem:
1141
      test_reg_mem:
1139
	call	get_address
1142
	call	get_address
1140
	mov	al,[operand_size]
1143
	mov	al,[operand_size]
1141
	cmp	al,1
1144
	cmp	al,1
1142
	je	test_reg_mem_8bit
1145
	je	test_reg_mem_8bit
1143
	call	operand_autodetect
1146
	call	operand_autodetect
1144
	inc	[base_code]
1147
	inc	[base_code]
1145
      test_reg_mem_8bit:
1148
      test_reg_mem_8bit:
1146
	jmp	instruction_ready
1149
	jmp	instruction_ready
1147
xchg_instruction:
1150
xchg_instruction:
1148
	mov	[base_code],86h
1151
	mov	[base_code],86h
1149
	lods	byte [esi]
1152
	lods	byte [esi]
1150
	call	get_size_operator
1153
	call	get_size_operator
1151
	cmp	al,10h
1154
	cmp	al,10h
1152
	je	xchg_reg
1155
	je	xchg_reg
1153
	cmp	al,'['
1156
	cmp	al,'['
1154
	jne	invalid_operand
1157
	jne	invalid_operand
1155
      xchg_mem:
1158
      xchg_mem:
1156
	call	get_address
1159
	call	get_address
1157
	push	edx ebx ecx
1160
	push	edx ebx ecx
1158
	lods	byte [esi]
1161
	lods	byte [esi]
1159
	cmp	al,','
1162
	cmp	al,','
1160
	jne	invalid_operand
1163
	jne	invalid_operand
1161
	lods	byte [esi]
1164
	lods	byte [esi]
1162
	call	get_size_operator
1165
	call	get_size_operator
1163
	cmp	al,10h
1166
	cmp	al,10h
1164
	je	test_mem_reg
1167
	je	test_mem_reg
1165
	jmp	invalid_operand
1168
	jmp	invalid_operand
1166
      xchg_reg:
1169
      xchg_reg:
1167
	lods	byte [esi]
1170
	lods	byte [esi]
1168
	call	convert_register
1171
	call	convert_register
1169
	mov	[postbyte_register],al
1172
	mov	[postbyte_register],al
1170
	lods	byte [esi]
1173
	lods	byte [esi]
1171
	cmp	al,','
1174
	cmp	al,','
1172
	jne	invalid_operand
1175
	jne	invalid_operand
1173
	lods	byte [esi]
1176
	lods	byte [esi]
1174
	call	get_size_operator
1177
	call	get_size_operator
1175
	cmp	al,'['
1178
	cmp	al,'['
1176
	je	test_reg_mem
1179
	je	test_reg_mem
1177
	cmp	al,10h
1180
	cmp	al,10h
1178
	jne	invalid_operand
1181
	jne	invalid_operand
1179
      xchg_reg_reg:
1182
      xchg_reg_reg:
1180
	lods	byte [esi]
1183
	lods	byte [esi]
1181
	call	convert_register
1184
	call	convert_register
1182
	mov	bl,al
1185
	mov	bl,al
1183
	mov	al,ah
1186
	mov	al,ah
1184
	cmp	al,1
1187
	cmp	al,1
1185
	je	xchg_reg_reg_8bit
1188
	je	xchg_reg_reg_8bit
1186
	call	operand_autodetect
1189
	call	operand_autodetect
1187
	cmp	[postbyte_register],0
1190
	cmp	[postbyte_register],0
1188
	je	xchg_ax_reg
1191
	je	xchg_ax_reg
1189
	or	bl,bl
1192
	or	bl,bl
1190
	jnz	xchg_reg_reg_store
1193
	jnz	xchg_reg_reg_store
1191
	mov	bl,[postbyte_register]
1194
	mov	bl,[postbyte_register]
1192
      xchg_ax_reg:
1195
      xchg_ax_reg:
1193
	cmp	[code_type],64
1196
	cmp	[code_type],64
1194
	jne	xchg_ax_reg_ok
1197
	jne	xchg_ax_reg_ok
1195
	cmp	ah,4
1198
	cmp	ah,4
1196
	jne	xchg_ax_reg_ok
1199
	jne	xchg_ax_reg_ok
1197
	or	bl,bl
1200
	or	bl,bl
1198
	jz	xchg_reg_reg_store
1201
	jz	xchg_reg_reg_store
1199
      xchg_ax_reg_ok:
1202
      xchg_ax_reg_ok:
1200
	test	bl,1000b
1203
	test	bl,1000b
1201
	jz	xchg_ax_reg_store
1204
	jz	xchg_ax_reg_store
1202
	or	[rex_prefix],41h
1205
	or	[rex_prefix],41h
1203
	and	bl,111b
1206
	and	bl,111b
1204
      xchg_ax_reg_store:
1207
      xchg_ax_reg_store:
1205
	add	bl,90h
1208
	add	bl,90h
1206
	mov	[base_code],bl
1209
	mov	[base_code],bl
1207
	call	store_instruction_code
1210
	call	store_instruction_code
1208
	jmp	instruction_assembled
1211
	jmp	instruction_assembled
1209
      xchg_reg_reg_store:
1212
      xchg_reg_reg_store:
1210
	inc	[base_code]
1213
	inc	[base_code]
1211
      xchg_reg_reg_8bit:
1214
      xchg_reg_reg_8bit:
1212
	jmp	nomem_instruction_ready
1215
	jmp	nomem_instruction_ready
1213
push_instruction:
1216
push_instruction:
1214
	mov	[push_size],al
1217
	mov	[push_size],al
1215
      push_next:
1218
      push_next:
1216
	lods	byte [esi]
1219
	lods	byte [esi]
1217
	call	get_size_operator
1220
	call	get_size_operator
1218
	cmp	al,10h
1221
	cmp	al,10h
1219
	je	push_reg
1222
	je	push_reg
1220
	cmp	al,'('
1223
	cmp	al,'('
1221
	je	push_imm
1224
	je	push_imm
1222
	cmp	al,'['
1225
	cmp	al,'['
1223
	jne	invalid_operand
1226
	jne	invalid_operand
1224
      push_mem:
1227
      push_mem:
1225
	call	get_address
1228
	call	get_address
1226
	mov	al,[operand_size]
1229
	mov	al,[operand_size]
1227
	mov	ah,[push_size]
1230
	mov	ah,[push_size]
1228
	cmp	al,2
1231
	cmp	al,2
1229
	je	push_mem_16bit
1232
	je	push_mem_16bit
1230
	cmp	al,4
1233
	cmp	al,4
1231
	je	push_mem_32bit
1234
	je	push_mem_32bit
1232
	cmp	al,8
1235
	cmp	al,8
1233
	je	push_mem_64bit
1236
	je	push_mem_64bit
1234
	or	al,al
1237
	or	al,al
1235
	jnz	invalid_operand_size
1238
	jnz	invalid_operand_size
1236
	cmp	ah,2
1239
	cmp	ah,2
1237
	je	push_mem_16bit
1240
	je	push_mem_16bit
1238
	cmp	ah,4
1241
	cmp	ah,4
1239
	je	push_mem_32bit
1242
	je	push_mem_32bit
1240
	cmp	ah,8
1243
	cmp	ah,8
1241
	je	push_mem_64bit
1244
	je	push_mem_64bit
1242
	cmp	[error_line],0
1245
	cmp	[error_line],0
1243
	jne	push_mem_store
1246
	jne	push_mem_store
1244
	mov	eax,[current_line]
1247
	mov	eax,[current_line]
1245
	mov	[error_line],eax
1248
	mov	[error_line],eax
1246
	mov	[error],operand_size_not_specified
1249
	mov	[error],operand_size_not_specified
1247
	jmp	push_mem_store
1250
	jmp	push_mem_store
1248
      push_mem_16bit:
1251
      push_mem_16bit:
1249
	test	ah,not 2
1252
	test	ah,not 2
1250
	jnz	invalid_operand_size
1253
	jnz	invalid_operand_size
1251
	call	operand_16bit
1254
	call	operand_16bit
1252
	jmp	push_mem_store
1255
	jmp	push_mem_store
1253
      push_mem_32bit:
1256
      push_mem_32bit:
1254
	test	ah,not 4
1257
	test	ah,not 4
1255
	jnz	invalid_operand_size
1258
	jnz	invalid_operand_size
1256
	cmp	[code_type],64
1259
	cmp	[code_type],64
1257
	je	illegal_instruction
1260
	je	illegal_instruction
1258
	call	operand_32bit
1261
	call	operand_32bit
1259
	jmp	push_mem_store
1262
	jmp	push_mem_store
1260
      push_mem_64bit:
1263
      push_mem_64bit:
1261
	test	ah,not 8
1264
	test	ah,not 8
1262
	jnz	invalid_operand_size
1265
	jnz	invalid_operand_size
1263
	cmp	[code_type],64
1266
	cmp	[code_type],64
1264
	jne	illegal_instruction
1267
	jne	illegal_instruction
1265
      push_mem_store:
1268
      push_mem_store:
1266
	mov	[base_code],0FFh
1269
	mov	[base_code],0FFh
1267
	mov	[postbyte_register],110b
1270
	mov	[postbyte_register],110b
1268
	call	store_instruction
1271
	call	store_instruction
1269
	jmp	push_done
1272
	jmp	push_done
1270
      push_reg:
1273
      push_reg:
1271
	lods	byte [esi]
1274
	lods	byte [esi]
1272
	mov	ah,al
1275
	mov	ah,al
1273
	sub	ah,10h
1276
	sub	ah,10h
1274
	and	ah,al
1277
	and	ah,al
1275
	test	ah,0F0h
1278
	test	ah,0F0h
1276
	jnz	push_sreg
1279
	jnz	push_sreg
1277
	call	convert_register
1280
	call	convert_register
1278
	test	al,1000b
1281
	test	al,1000b
1279
	jz	push_reg_ok
1282
	jz	push_reg_ok
1280
	or	[rex_prefix],41h
1283
	or	[rex_prefix],41h
1281
	and	al,111b
1284
	and	al,111b
1282
      push_reg_ok:
1285
      push_reg_ok:
1283
	add	al,50h
1286
	add	al,50h
1284
	mov	[base_code],al
1287
	mov	[base_code],al
1285
	mov	al,ah
1288
	mov	al,ah
1286
	mov	ah,[push_size]
1289
	mov	ah,[push_size]
1287
	cmp	al,2
1290
	cmp	al,2
1288
	je	push_reg_16bit
1291
	je	push_reg_16bit
1289
	cmp	al,4
1292
	cmp	al,4
1290
	je	push_reg_32bit
1293
	je	push_reg_32bit
1291
	cmp	al,8
1294
	cmp	al,8
1292
	jne	invalid_operand_size
1295
	jne	invalid_operand_size
1293
      push_reg_64bit:
1296
      push_reg_64bit:
1294
	test	ah,not 8
1297
	test	ah,not 8
1295
	jnz	invalid_operand_size
1298
	jnz	invalid_operand_size
1296
	cmp	[code_type],64
1299
	cmp	[code_type],64
1297
	jne	illegal_instruction
1300
	jne	illegal_instruction
1298
	jmp	push_reg_store
1301
	jmp	push_reg_store
1299
      push_reg_32bit:
1302
      push_reg_32bit:
1300
	test	ah,not 4
1303
	test	ah,not 4
1301
	jnz	invalid_operand_size
1304
	jnz	invalid_operand_size
1302
	cmp	[code_type],64
1305
	cmp	[code_type],64
1303
	je	illegal_instruction
1306
	je	illegal_instruction
1304
	call	operand_32bit
1307
	call	operand_32bit
1305
	jmp	push_reg_store
1308
	jmp	push_reg_store
1306
      push_reg_16bit:
1309
      push_reg_16bit:
1307
	test	ah,not 2
1310
	test	ah,not 2
1308
	jnz	invalid_operand_size
1311
	jnz	invalid_operand_size
1309
	call	operand_16bit
1312
	call	operand_16bit
1310
      push_reg_store:
1313
      push_reg_store:
1311
	call	store_instruction_code
1314
	call	store_instruction_code
1312
	jmp	push_done
1315
	jmp	push_done
1313
      push_sreg:
1316
      push_sreg:
1314
	mov	bl,al
1317
	mov	bl,al
1315
	mov	dl,[operand_size]
1318
	mov	dl,[operand_size]
1316
	mov	dh,[push_size]
1319
	mov	dh,[push_size]
1317
	cmp	dl,2
1320
	cmp	dl,2
1318
	je	push_sreg16
1321
	je	push_sreg16
1319
	cmp	dl,4
1322
	cmp	dl,4
1320
	je	push_sreg32
1323
	je	push_sreg32
1321
	cmp	dl,8
1324
	cmp	dl,8
1322
	je	push_sreg64
1325
	je	push_sreg64
1323
	or	dl,dl
1326
	or	dl,dl
1324
	jnz	invalid_operand_size
1327
	jnz	invalid_operand_size
1325
	cmp	dh,2
1328
	cmp	dh,2
1326
	je	push_sreg16
1329
	je	push_sreg16
1327
	cmp	dh,4
1330
	cmp	dh,4
1328
	je	push_sreg32
1331
	je	push_sreg32
1329
	cmp	dh,8
1332
	cmp	dh,8
1330
	je	push_sreg64
1333
	je	push_sreg64
1331
	jmp	push_sreg_store
1334
	jmp	push_sreg_store
1332
      push_sreg16:
1335
      push_sreg16:
1333
	test	dh,not 2
1336
	test	dh,not 2
1334
	jnz	invalid_operand_size
1337
	jnz	invalid_operand_size
1335
	call	operand_16bit
1338
	call	operand_16bit
1336
	jmp	push_sreg_store
1339
	jmp	push_sreg_store
1337
      push_sreg32:
1340
      push_sreg32:
1338
	test	dh,not 4
1341
	test	dh,not 4
1339
	jnz	invalid_operand_size
1342
	jnz	invalid_operand_size
1340
	cmp	[code_type],64
1343
	cmp	[code_type],64
1341
	je	illegal_instruction
1344
	je	illegal_instruction
1342
	call	operand_32bit
1345
	call	operand_32bit
1343
	jmp	push_sreg_store
1346
	jmp	push_sreg_store
1344
      push_sreg64:
1347
      push_sreg64:
1345
	test	dh,not 8
1348
	test	dh,not 8
1346
	jnz	invalid_operand_size
1349
	jnz	invalid_operand_size
1347
	cmp	[code_type],64
1350
	cmp	[code_type],64
1348
	jne	illegal_instruction
1351
	jne	illegal_instruction
1349
      push_sreg_store:
1352
      push_sreg_store:
1350
	mov	al,bl
1353
	mov	al,bl
1351
	cmp	al,70h
1354
	cmp	al,70h
1352
	jae	invalid_operand
1355
	jae	invalid_operand
1353
	sub	al,61h
1356
	sub	al,61h
1354
	jc	invalid_operand
1357
	jc	invalid_operand
1355
	cmp	al,4
1358
	cmp	al,4
1356
	jae	push_sreg_386
1359
	jae	push_sreg_386
1357
	shl	al,3
1360
	shl	al,3
1358
	add	al,6
1361
	add	al,6
1359
	mov	[base_code],al
1362
	mov	[base_code],al
1360
	cmp	[code_type],64
1363
	cmp	[code_type],64
1361
	je	illegal_instruction
1364
	je	illegal_instruction
1362
	jmp	push_reg_store
1365
	jmp	push_reg_store
1363
      push_sreg_386:
1366
      push_sreg_386:
1364
	sub	al,4
1367
	sub	al,4
1365
	shl	al,3
1368
	shl	al,3
1366
	add	al,0A0h
1369
	add	al,0A0h
1367
	mov	[extended_code],al
1370
	mov	[extended_code],al
1368
	mov	[base_code],0Fh
1371
	mov	[base_code],0Fh
1369
	jmp	push_reg_store
1372
	jmp	push_reg_store
1370
      push_imm:
1373
      push_imm:
1371
	mov	al,[operand_size]
1374
	mov	al,[operand_size]
1372
	mov	ah,[push_size]
1375
	mov	ah,[push_size]
1373
	or	al,al
1376
	or	al,al
1374
	je	push_imm_size_ok
1377
	je	push_imm_size_ok
1375
	or	ah,ah
1378
	or	ah,ah
1376
	je	push_imm_size_ok
1379
	je	push_imm_size_ok
1377
	cmp	al,ah
1380
	cmp	al,ah
1378
	jne	invalid_operand_size
1381
	jne	invalid_operand_size
1379
      push_imm_size_ok:
1382
      push_imm_size_ok:
1380
	cmp	al,2
1383
	cmp	al,2
1381
	je	push_imm_16bit
1384
	je	push_imm_16bit
1382
	cmp	al,4
1385
	cmp	al,4
1383
	je	push_imm_32bit
1386
	je	push_imm_32bit
1384
	cmp	al,8
1387
	cmp	al,8
1385
	je	push_imm_64bit
1388
	je	push_imm_64bit
1386
	cmp	ah,2
1389
	cmp	ah,2
1387
	je	push_imm_optimized_16bit
1390
	je	push_imm_optimized_16bit
1388
	cmp	ah,4
1391
	cmp	ah,4
1389
	je	push_imm_optimized_32bit
1392
	je	push_imm_optimized_32bit
1390
	cmp	ah,8
1393
	cmp	ah,8
1391
	je	push_imm_optimized_64bit
1394
	je	push_imm_optimized_64bit
1392
	or	al,al
1395
	or	al,al
1393
	jnz	invalid_operand_size
1396
	jnz	invalid_operand_size
1394
	cmp	[code_type],16
1397
	cmp	[code_type],16
1395
	je	push_imm_optimized_16bit
1398
	je	push_imm_optimized_16bit
1396
	cmp	[code_type],32
1399
	cmp	[code_type],32
1397
	je	push_imm_optimized_32bit
1400
	je	push_imm_optimized_32bit
1398
      push_imm_optimized_64bit:
1401
      push_imm_optimized_64bit:
1399
	cmp	[code_type],64
1402
	cmp	[code_type],64
1400
	jne	illegal_instruction
1403
	jne	illegal_instruction
1401
	call	get_simm32
1404
	call	get_simm32
1402
	mov	edx,eax
1405
	mov	edx,eax
1403
	cmp	[value_type],0
1406
	cmp	[value_type],0
1404
	jne	push_imm_32bit_store
1407
	jne	push_imm_32bit_store
1405
	cmp	eax,-80h
1408
	cmp	eax,-80h
1406
	jl	push_imm_32bit_store
1409
	jl	push_imm_32bit_store
1407
	cmp	eax,80h
1410
	cmp	eax,80h
1408
	jge	push_imm_32bit_store
1411
	jge	push_imm_32bit_store
1409
	jmp	push_imm_8bit
1412
	jmp	push_imm_8bit
1410
      push_imm_optimized_32bit:
1413
      push_imm_optimized_32bit:
1411
	cmp	[code_type],64
1414
	cmp	[code_type],64
1412
	je	illegal_instruction
1415
	je	illegal_instruction
1413
	call	get_dword_value
1416
	call	get_dword_value
1414
	mov	edx,eax
1417
	mov	edx,eax
1415
	call	operand_32bit
1418
	call	operand_32bit
1416
	cmp	[value_type],0
1419
	cmp	[value_type],0
1417
	jne	push_imm_32bit_store
1420
	jne	push_imm_32bit_store
1418
	cmp	eax,-80h
1421
	cmp	eax,-80h
1419
	jl	push_imm_32bit_store
1422
	jl	push_imm_32bit_store
1420
	cmp	eax,80h
1423
	cmp	eax,80h
1421
	jge	push_imm_32bit_store
1424
	jge	push_imm_32bit_store
1422
	jmp	push_imm_8bit
1425
	jmp	push_imm_8bit
1423
      push_imm_optimized_16bit:
1426
      push_imm_optimized_16bit:
1424
	call	get_word_value
1427
	call	get_word_value
1425
	mov	dx,ax
1428
	mov	dx,ax
1426
	call	operand_16bit
1429
	call	operand_16bit
1427
	cmp	[value_type],0
1430
	cmp	[value_type],0
1428
	jne	push_imm_16bit_store
1431
	jne	push_imm_16bit_store
1429
	cmp	ax,-80h
1432
	cmp	ax,-80h
1430
	jl	push_imm_16bit_store
1433
	jl	push_imm_16bit_store
1431
	cmp	ax,80h
1434
	cmp	ax,80h
1432
	jge	push_imm_16bit_store
1435
	jge	push_imm_16bit_store
1433
      push_imm_8bit:
1436
      push_imm_8bit:
1434
	mov	ah,al
1437
	mov	ah,al
1435
	mov	[base_code],6Ah
1438
	mov	[base_code],6Ah
1436
	call	store_instruction_code
1439
	call	store_instruction_code
1437
	mov	al,ah
1440
	mov	al,ah
1438
	stos	byte [edi]
1441
	stos	byte [edi]
1439
	jmp	push_done
1442
	jmp	push_done
1440
      push_imm_16bit:
1443
      push_imm_16bit:
1441
	call	get_word_value
1444
	call	get_word_value
1442
	mov	dx,ax
1445
	mov	dx,ax
1443
	call	operand_16bit
1446
	call	operand_16bit
1444
      push_imm_16bit_store:
1447
      push_imm_16bit_store:
1445
	mov	[base_code],68h
1448
	mov	[base_code],68h
1446
	call	store_instruction_code
1449
	call	store_instruction_code
1447
	mov	ax,dx
1450
	mov	ax,dx
1448
	call	mark_relocation
1451
	call	mark_relocation
1449
	stos	word [edi]
1452
	stos	word [edi]
1450
	jmp	push_done
1453
	jmp	push_done
1451
      push_imm_64bit:
1454
      push_imm_64bit:
1452
	cmp	[code_type],64
1455
	cmp	[code_type],64
1453
	jne	illegal_instruction
1456
	jne	illegal_instruction
1454
	call	get_simm32
1457
	call	get_simm32
1455
	mov	edx,eax
1458
	mov	edx,eax
1456
	jmp	push_imm_32bit_store
1459
	jmp	push_imm_32bit_store
1457
      push_imm_32bit:
1460
      push_imm_32bit:
1458
	cmp	[code_type],64
1461
	cmp	[code_type],64
1459
	je	illegal_instruction
1462
	je	illegal_instruction
1460
	call	get_dword_value
1463
	call	get_dword_value
1461
	mov	edx,eax
1464
	mov	edx,eax
1462
	call	operand_32bit
1465
	call	operand_32bit
1463
      push_imm_32bit_store:
1466
      push_imm_32bit_store:
1464
	mov	[base_code],68h
1467
	mov	[base_code],68h
1465
	call	store_instruction_code
1468
	call	store_instruction_code
1466
	mov	eax,edx
1469
	mov	eax,edx
1467
	call	mark_relocation
1470
	call	mark_relocation
1468
	stos	dword [edi]
1471
	stos	dword [edi]
1469
      push_done:
1472
      push_done:
1470
	lods	byte [esi]
1473
	lods	byte [esi]
1471
	dec	esi
1474
	dec	esi
1472
	cmp	al,0Fh
1475
	cmp	al,0Fh
1473
	je	instruction_assembled
1476
	je	instruction_assembled
1474
	or	al,al
1477
	or	al,al
1475
	jz	instruction_assembled
1478
	jz	instruction_assembled
1476
	mov	[operand_size],0
1479
	mov	[operand_size],0
1477
	mov	[size_override],0
1480
	mov	[size_override],0
1478
	mov	[operand_prefix],0
1481
	mov	[operand_prefix],0
1479
	mov	[rex_prefix],0
1482
	mov	[rex_prefix],0
1480
	jmp	push_next
1483
	jmp	push_next
1481
pop_instruction:
1484
pop_instruction:
1482
	mov	[push_size],al
1485
	mov	[push_size],al
1483
      pop_next:
1486
      pop_next:
1484
	lods	byte [esi]
1487
	lods	byte [esi]
1485
	call	get_size_operator
1488
	call	get_size_operator
1486
	cmp	al,10h
1489
	cmp	al,10h
1487
	je	pop_reg
1490
	je	pop_reg
1488
	cmp	al,'['
1491
	cmp	al,'['
1489
	jne	invalid_operand
1492
	jne	invalid_operand
1490
      pop_mem:
1493
      pop_mem:
1491
	call	get_address
1494
	call	get_address
1492
	mov	al,[operand_size]
1495
	mov	al,[operand_size]
1493
	mov	ah,[push_size]
1496
	mov	ah,[push_size]
1494
	cmp	al,2
1497
	cmp	al,2
1495
	je	pop_mem_16bit
1498
	je	pop_mem_16bit
1496
	cmp	al,4
1499
	cmp	al,4
1497
	je	pop_mem_32bit
1500
	je	pop_mem_32bit
1498
	cmp	al,8
1501
	cmp	al,8
1499
	je	pop_mem_64bit
1502
	je	pop_mem_64bit
1500
	or	al,al
1503
	or	al,al
1501
	jnz	invalid_operand_size
1504
	jnz	invalid_operand_size
1502
	cmp	ah,2
1505
	cmp	ah,2
1503
	je	pop_mem_16bit
1506
	je	pop_mem_16bit
1504
	cmp	ah,4
1507
	cmp	ah,4
1505
	je	pop_mem_32bit
1508
	je	pop_mem_32bit
1506
	cmp	ah,8
1509
	cmp	ah,8
1507
	je	pop_mem_64bit
1510
	je	pop_mem_64bit
1508
	cmp	[error_line],0
1511
	cmp	[error_line],0
1509
	jne	pop_mem_store
1512
	jne	pop_mem_store
1510
	mov	eax,[current_line]
1513
	mov	eax,[current_line]
1511
	mov	[error_line],eax
1514
	mov	[error_line],eax
1512
	mov	[error],operand_size_not_specified
1515
	mov	[error],operand_size_not_specified
1513
	jmp	pop_mem_store
1516
	jmp	pop_mem_store
1514
      pop_mem_16bit:
1517
      pop_mem_16bit:
1515
	test	ah,not 2
1518
	test	ah,not 2
1516
	jnz	invalid_operand_size
1519
	jnz	invalid_operand_size
1517
	call	operand_16bit
1520
	call	operand_16bit
1518
	jmp	pop_mem_store
1521
	jmp	pop_mem_store
1519
      pop_mem_32bit:
1522
      pop_mem_32bit:
1520
	test	ah,not 4
1523
	test	ah,not 4
1521
	jnz	invalid_operand_size
1524
	jnz	invalid_operand_size
1522
	cmp	[code_type],64
1525
	cmp	[code_type],64
1523
	je	illegal_instruction
1526
	je	illegal_instruction
1524
	call	operand_32bit
1527
	call	operand_32bit
1525
	jmp	pop_mem_store
1528
	jmp	pop_mem_store
1526
      pop_mem_64bit:
1529
      pop_mem_64bit:
1527
	test	ah,not 8
1530
	test	ah,not 8
1528
	jnz	invalid_operand_size
1531
	jnz	invalid_operand_size
1529
	cmp	[code_type],64
1532
	cmp	[code_type],64
1530
	jne	illegal_instruction
1533
	jne	illegal_instruction
1531
      pop_mem_store:
1534
      pop_mem_store:
1532
	mov	[base_code],08Fh
1535
	mov	[base_code],08Fh
1533
	mov	[postbyte_register],0
1536
	mov	[postbyte_register],0
1534
	call	store_instruction
1537
	call	store_instruction
1535
	jmp	pop_done
1538
	jmp	pop_done
1536
      pop_reg:
1539
      pop_reg:
1537
	lods	byte [esi]
1540
	lods	byte [esi]
1538
	mov	ah,al
1541
	mov	ah,al
1539
	sub	ah,10h
1542
	sub	ah,10h
1540
	and	ah,al
1543
	and	ah,al
1541
	test	ah,0F0h
1544
	test	ah,0F0h
1542
	jnz	pop_sreg
1545
	jnz	pop_sreg
1543
	call	convert_register
1546
	call	convert_register
1544
	test	al,1000b
1547
	test	al,1000b
1545
	jz	pop_reg_ok
1548
	jz	pop_reg_ok
1546
	or	[rex_prefix],41h
1549
	or	[rex_prefix],41h
1547
	and	al,111b
1550
	and	al,111b
1548
      pop_reg_ok:
1551
      pop_reg_ok:
1549
	add	al,58h
1552
	add	al,58h
1550
	mov	[base_code],al
1553
	mov	[base_code],al
1551
	mov	al,ah
1554
	mov	al,ah
1552
	mov	ah,[push_size]
1555
	mov	ah,[push_size]
1553
	cmp	al,2
1556
	cmp	al,2
1554
	je	pop_reg_16bit
1557
	je	pop_reg_16bit
1555
	cmp	al,4
1558
	cmp	al,4
1556
	je	pop_reg_32bit
1559
	je	pop_reg_32bit
1557
	cmp	al,8
1560
	cmp	al,8
1558
	je	pop_reg_64bit
1561
	je	pop_reg_64bit
1559
	jmp	invalid_operand_size
1562
	jmp	invalid_operand_size
1560
      pop_reg_64bit:
1563
      pop_reg_64bit:
1561
	test	ah,not 8
1564
	test	ah,not 8
1562
	jnz	invalid_operand_size
1565
	jnz	invalid_operand_size
1563
	cmp	[code_type],64
1566
	cmp	[code_type],64
1564
	jne	illegal_instruction
1567
	jne	illegal_instruction
1565
	jmp	pop_reg_store
1568
	jmp	pop_reg_store
1566
      pop_reg_32bit:
1569
      pop_reg_32bit:
1567
	test	ah,not 4
1570
	test	ah,not 4
1568
	jnz	invalid_operand_size
1571
	jnz	invalid_operand_size
1569
	cmp	[code_type],64
1572
	cmp	[code_type],64
1570
	je	illegal_instruction
1573
	je	illegal_instruction
1571
	call	operand_32bit
1574
	call	operand_32bit
1572
	jmp	pop_reg_store
1575
	jmp	pop_reg_store
1573
      pop_reg_16bit:
1576
      pop_reg_16bit:
1574
	test	ah,not 2
1577
	test	ah,not 2
1575
	jnz	invalid_operand_size
1578
	jnz	invalid_operand_size
1576
	call	operand_16bit
1579
	call	operand_16bit
1577
      pop_reg_store:
1580
      pop_reg_store:
1578
	call	store_instruction_code
1581
	call	store_instruction_code
1579
      pop_done:
1582
      pop_done:
1580
	lods	byte [esi]
1583
	lods	byte [esi]
1581
	dec	esi
1584
	dec	esi
1582
	cmp	al,0Fh
1585
	cmp	al,0Fh
1583
	je	instruction_assembled
1586
	je	instruction_assembled
1584
	or	al,al
1587
	or	al,al
1585
	jz	instruction_assembled
1588
	jz	instruction_assembled
1586
	mov	[operand_size],0
1589
	mov	[operand_size],0
1587
	mov	[size_override],0
1590
	mov	[size_override],0
1588
	mov	[operand_prefix],0
1591
	mov	[operand_prefix],0
1589
	mov	[rex_prefix],0
1592
	mov	[rex_prefix],0
1590
	jmp	pop_next
1593
	jmp	pop_next
1591
      pop_sreg:
1594
      pop_sreg:
1592
	mov	dl,[operand_size]
1595
	mov	dl,[operand_size]
1593
	mov	dh,[push_size]
1596
	mov	dh,[push_size]
1594
	cmp	al,62h
1597
	cmp	al,62h
1595
	je	pop_cs
1598
	je	pop_cs
1596
	mov	bl,al
1599
	mov	bl,al
1597
	cmp	dl,2
1600
	cmp	dl,2
1598
	je	pop_sreg16
1601
	je	pop_sreg16
1599
	cmp	dl,4
1602
	cmp	dl,4
1600
	je	pop_sreg32
1603
	je	pop_sreg32
1601
	cmp	dl,8
1604
	cmp	dl,8
1602
	je	pop_sreg64
1605
	je	pop_sreg64
1603
	or	dl,dl
1606
	or	dl,dl
1604
	jnz	invalid_operand_size
1607
	jnz	invalid_operand_size
1605
	cmp	dh,2
1608
	cmp	dh,2
1606
	je	pop_sreg16
1609
	je	pop_sreg16
1607
	cmp	dh,4
1610
	cmp	dh,4
1608
	je	pop_sreg32
1611
	je	pop_sreg32
1609
	cmp	dh,8
1612
	cmp	dh,8
1610
	je	pop_sreg64
1613
	je	pop_sreg64
1611
	jmp	pop_sreg_store
1614
	jmp	pop_sreg_store
1612
      pop_sreg16:
1615
      pop_sreg16:
1613
	test	dh,not 2
1616
	test	dh,not 2
1614
	jnz	invalid_operand_size
1617
	jnz	invalid_operand_size
1615
	call	operand_16bit
1618
	call	operand_16bit
1616
	jmp	pop_sreg_store
1619
	jmp	pop_sreg_store
1617
      pop_sreg32:
1620
      pop_sreg32:
1618
	test	dh,not 4
1621
	test	dh,not 4
1619
	jnz	invalid_operand_size
1622
	jnz	invalid_operand_size
1620
	cmp	[code_type],64
1623
	cmp	[code_type],64
1621
	je	illegal_instruction
1624
	je	illegal_instruction
1622
	call	operand_32bit
1625
	call	operand_32bit
1623
	jmp	pop_sreg_store
1626
	jmp	pop_sreg_store
1624
      pop_sreg64:
1627
      pop_sreg64:
1625
	test	dh,not 8
1628
	test	dh,not 8
1626
	jnz	invalid_operand_size
1629
	jnz	invalid_operand_size
1627
	cmp	[code_type],64
1630
	cmp	[code_type],64
1628
	jne	illegal_instruction
1631
	jne	illegal_instruction
1629
      pop_sreg_store:
1632
      pop_sreg_store:
1630
	mov	al,bl
1633
	mov	al,bl
1631
	cmp	al,70h
1634
	cmp	al,70h
1632
	jae	invalid_operand
1635
	jae	invalid_operand
1633
	sub	al,61h
1636
	sub	al,61h
1634
	jc	invalid_operand
1637
	jc	invalid_operand
1635
	cmp	al,4
1638
	cmp	al,4
1636
	jae	pop_sreg_386
1639
	jae	pop_sreg_386
1637
	shl	al,3
1640
	shl	al,3
1638
	add	al,7
1641
	add	al,7
1639
	mov	[base_code],al
1642
	mov	[base_code],al
1640
	cmp	[code_type],64
1643
	cmp	[code_type],64
1641
	je	illegal_instruction
1644
	je	illegal_instruction
1642
	jmp	pop_reg_store
1645
	jmp	pop_reg_store
1643
      pop_cs:
1646
      pop_cs:
1644
	cmp	[code_type],16
1647
	cmp	[code_type],16
1645
	jne	illegal_instruction
1648
	jne	illegal_instruction
1646
	cmp	dl,2
1649
	cmp	dl,2
1647
	je	pop_cs_store
1650
	je	pop_cs_store
1648
	or	dl,dl
1651
	or	dl,dl
1649
	jnz	invalid_operand_size
1652
	jnz	invalid_operand_size
1650
	cmp	dh,2
1653
	cmp	dh,2
1651
	je	pop_cs_store
1654
	je	pop_cs_store
1652
	or	dh,dh
1655
	or	dh,dh
1653
	jnz	illegal_instruction
1656
	jnz	illegal_instruction
1654
      pop_cs_store:
1657
      pop_cs_store:
1655
	test	dh,not 2
1658
	test	dh,not 2
1656
	jnz	invalid_operand_size
1659
	jnz	invalid_operand_size
1657
	mov	al,0Fh
1660
	mov	al,0Fh
1658
	stos	byte [edi]
1661
	stos	byte [edi]
1659
	jmp	pop_done
1662
	jmp	pop_done
1660
      pop_sreg_386:
1663
      pop_sreg_386:
1661
	sub	al,4
1664
	sub	al,4
1662
	shl	al,3
1665
	shl	al,3
1663
	add	al,0A1h
1666
	add	al,0A1h
1664
	mov	[extended_code],al
1667
	mov	[extended_code],al
1665
	mov	[base_code],0Fh
1668
	mov	[base_code],0Fh
1666
	jmp	pop_reg_store
1669
	jmp	pop_reg_store
1667
inc_instruction:
1670
inc_instruction:
1668
	mov	[base_code],al
1671
	mov	[base_code],al
1669
	lods	byte [esi]
1672
	lods	byte [esi]
1670
	call	get_size_operator
1673
	call	get_size_operator
1671
	cmp	al,10h
1674
	cmp	al,10h
1672
	je	inc_reg
1675
	je	inc_reg
1673
	cmp	al,'['
1676
	cmp	al,'['
1674
	je	inc_mem
1677
	je	inc_mem
1675
	jne	invalid_operand
1678
	jne	invalid_operand
1676
      inc_mem:
1679
      inc_mem:
1677
	call	get_address
1680
	call	get_address
1678
	mov	al,[operand_size]
1681
	mov	al,[operand_size]
1679
	cmp	al,1
1682
	cmp	al,1
1680
	je	inc_mem_8bit
1683
	je	inc_mem_8bit
1681
	jb	inc_mem_nosize
1684
	jb	inc_mem_nosize
1682
	call	operand_autodetect
1685
	call	operand_autodetect
1683
	mov	al,0FFh
1686
	mov	al,0FFh
1684
	xchg	al,[base_code]
1687
	xchg	al,[base_code]
1685
	mov	[postbyte_register],al
1688
	mov	[postbyte_register],al
1686
	jmp	instruction_ready
1689
	jmp	instruction_ready
1687
      inc_mem_nosize:
1690
      inc_mem_nosize:
1688
	cmp	[error_line],0
1691
	cmp	[error_line],0
1689
	jne	inc_mem_8bit
1692
	jne	inc_mem_8bit
1690
	mov	eax,[current_line]
1693
	mov	eax,[current_line]
1691
	mov	[error_line],eax
1694
	mov	[error_line],eax
1692
	mov	[error],operand_size_not_specified
1695
	mov	[error],operand_size_not_specified
1693
      inc_mem_8bit:
1696
      inc_mem_8bit:
1694
	mov	al,0FEh
1697
	mov	al,0FEh
1695
	xchg	al,[base_code]
1698
	xchg	al,[base_code]
1696
	mov	[postbyte_register],al
1699
	mov	[postbyte_register],al
1697
	jmp	instruction_ready
1700
	jmp	instruction_ready
1698
      inc_reg:
1701
      inc_reg:
1699
	lods	byte [esi]
1702
	lods	byte [esi]
1700
	call	convert_register
1703
	call	convert_register
1701
	mov	bl,al
1704
	mov	bl,al
1702
	mov	al,0FEh
1705
	mov	al,0FEh
1703
	xchg	al,[base_code]
1706
	xchg	al,[base_code]
1704
	mov	[postbyte_register],al
1707
	mov	[postbyte_register],al
1705
	mov	al,ah
1708
	mov	al,ah
1706
	cmp	al,1
1709
	cmp	al,1
1707
	je	inc_reg_8bit
1710
	je	inc_reg_8bit
1708
	call	operand_autodetect
1711
	call	operand_autodetect
1709
	cmp	[code_type],64
1712
	cmp	[code_type],64
1710
	je	inc_reg_long_form
1713
	je	inc_reg_long_form
1711
	mov	al,[postbyte_register]
1714
	mov	al,[postbyte_register]
1712
	shl	al,3
1715
	shl	al,3
1713
	add	al,bl
1716
	add	al,bl
1714
	add	al,40h
1717
	add	al,40h
1715
	mov	[base_code],al
1718
	mov	[base_code],al
1716
	call	store_instruction_code
1719
	call	store_instruction_code
1717
	jmp	instruction_assembled
1720
	jmp	instruction_assembled
1718
      inc_reg_long_form:
1721
      inc_reg_long_form:
1719
	inc	[base_code]
1722
	inc	[base_code]
1720
      inc_reg_8bit:
1723
      inc_reg_8bit:
1721
	jmp	nomem_instruction_ready
1724
	jmp	nomem_instruction_ready
1722
set_instruction:
1725
set_instruction:
1723
	mov	[base_code],0Fh
1726
	mov	[base_code],0Fh
1724
	mov	[extended_code],al
1727
	mov	[extended_code],al
1725
	lods	byte [esi]
1728
	lods	byte [esi]
1726
	call	get_size_operator
1729
	call	get_size_operator
1727
	cmp	al,10h
1730
	cmp	al,10h
1728
	je	set_reg
1731
	je	set_reg
1729
	cmp	al,'['
1732
	cmp	al,'['
1730
	jne	invalid_operand
1733
	jne	invalid_operand
1731
      set_mem:
1734
      set_mem:
1732
	call	get_address
1735
	call	get_address
1733
	cmp	[operand_size],1
1736
	cmp	[operand_size],1
1734
	ja	invalid_operand_size
1737
	ja	invalid_operand_size
1735
	mov	[postbyte_register],0
1738
	mov	[postbyte_register],0
1736
	jmp	instruction_ready
1739
	jmp	instruction_ready
1737
      set_reg:
1740
      set_reg:
1738
	lods	byte [esi]
1741
	lods	byte [esi]
1739
	call	convert_register
1742
	call	convert_register
1740
	cmp	ah,1
1743
	cmp	ah,1
1741
	jne	invalid_operand_size
1744
	jne	invalid_operand_size
1742
	mov	bl,al
1745
	mov	bl,al
1743
	mov	[postbyte_register],0
1746
	mov	[postbyte_register],0
1744
	jmp	nomem_instruction_ready
1747
	jmp	nomem_instruction_ready
1745
arpl_instruction:
1748
arpl_instruction:
1746
	cmp	[code_type],64
1749
	cmp	[code_type],64
1747
	je	illegal_instruction
1750
	je	illegal_instruction
1748
	mov	[base_code],63h
1751
	mov	[base_code],63h
1749
	lods	byte [esi]
1752
	lods	byte [esi]
1750
	call	get_size_operator
1753
	call	get_size_operator
1751
	cmp	al,10h
1754
	cmp	al,10h
1752
	je	arpl_reg
1755
	je	arpl_reg
1753
	cmp	al,'['
1756
	cmp	al,'['
1754
	jne	invalid_operand
1757
	jne	invalid_operand
1755
	call	get_address
1758
	call	get_address
1756
	lods	byte [esi]
1759
	lods	byte [esi]
1757
	cmp	al,','
1760
	cmp	al,','
1758
	jne	invalid_operand
1761
	jne	invalid_operand
1759
	lods	byte [esi]
1762
	lods	byte [esi]
1760
	cmp	al,10h
1763
	cmp	al,10h
1761
	jne	invalid_operand
1764
	jne	invalid_operand
1762
	lods	byte [esi]
1765
	lods	byte [esi]
1763
	call	convert_register
1766
	call	convert_register
1764
	mov	[postbyte_register],al
1767
	mov	[postbyte_register],al
1765
	cmp	ah,2
1768
	cmp	ah,2
1766
	jne	invalid_operand_size
1769
	jne	invalid_operand_size
1767
	jmp	instruction_ready
1770
	jmp	instruction_ready
1768
      arpl_reg:
1771
      arpl_reg:
1769
	lods	byte [esi]
1772
	lods	byte [esi]
1770
	call	convert_register
1773
	call	convert_register
1771
	cmp	ah,2
1774
	cmp	ah,2
1772
	jne	invalid_operand_size
1775
	jne	invalid_operand_size
1773
	mov	bl,al
1776
	mov	bl,al
1774
	lods	byte [esi]
1777
	lods	byte [esi]
1775
	cmp	al,','
1778
	cmp	al,','
1776
	jne	invalid_operand
1779
	jne	invalid_operand
1777
	lods	byte [esi]
1780
	lods	byte [esi]
1778
	cmp	al,10h
1781
	cmp	al,10h
1779
	jne	invalid_operand
1782
	jne	invalid_operand
1780
	lods	byte [esi]
1783
	lods	byte [esi]
1781
	call	convert_register
1784
	call	convert_register
1782
	mov	[postbyte_register],al
1785
	mov	[postbyte_register],al
1783
	jmp	nomem_instruction_ready
1786
	jmp	nomem_instruction_ready
1784
bound_instruction:
1787
bound_instruction:
1785
	cmp	[code_type],64
1788
	cmp	[code_type],64
1786
	je	illegal_instruction
1789
	je	illegal_instruction
1787
	lods	byte [esi]
1790
	lods	byte [esi]
1788
	call	get_size_operator
1791
	call	get_size_operator
1789
	cmp	al,10h
1792
	cmp	al,10h
1790
	jne	invalid_operand
1793
	jne	invalid_operand
1791
	lods	byte [esi]
1794
	lods	byte [esi]
1792
	call	convert_register
1795
	call	convert_register
1793
	mov	[postbyte_register],al
1796
	mov	[postbyte_register],al
1794
	lods	byte [esi]
1797
	lods	byte [esi]
1795
	cmp	al,','
1798
	cmp	al,','
1796
	jne	invalid_operand
1799
	jne	invalid_operand
1797
	lods	byte [esi]
1800
	lods	byte [esi]
1798
	call	get_size_operator
1801
	call	get_size_operator
1799
	cmp	al,'['
1802
	cmp	al,'['
1800
	jne	invalid_operand
1803
	jne	invalid_operand
1801
	call	get_address
1804
	call	get_address
1802
	mov	al,[operand_size]
1805
	mov	al,[operand_size]
1803
	cmp	al,2
1806
	cmp	al,2
1804
	je	bound_store
1807
	je	bound_store
1805
	cmp	al,4
1808
	cmp	al,4
1806
	jne	invalid_operand_size
1809
	jne	invalid_operand_size
1807
      bound_store:
1810
      bound_store:
1808
	call	operand_autodetect
1811
	call	operand_autodetect
1809
	mov	[base_code],62h
1812
	mov	[base_code],62h
1810
	jmp	instruction_ready
1813
	jmp	instruction_ready
1811
enter_instruction:
1814
enter_instruction:
1812
	lods	byte [esi]
1815
	lods	byte [esi]
1813
	call	get_size_operator
1816
	call	get_size_operator
1814
	cmp	ah,2
1817
	cmp	ah,2
1815
	je	enter_imm16_size_ok
1818
	je	enter_imm16_size_ok
1816
	or	ah,ah
1819
	or	ah,ah
1817
	jnz	invalid_operand_size
1820
	jnz	invalid_operand_size
1818
      enter_imm16_size_ok:
1821
      enter_imm16_size_ok:
1819
	cmp	al,'('
1822
	cmp	al,'('
1820
	jne	invalid_operand
1823
	jne	invalid_operand
1821
	call	get_word_value
1824
	call	get_word_value
1822
	cmp	[next_pass_needed],0
1825
	cmp	[next_pass_needed],0
1823
	jne	enter_imm16_ok
1826
	jne	enter_imm16_ok
1824
	cmp	[value_type],0
1827
	cmp	[value_type],0
1825
	jne	invalid_use_of_symbol
1828
	jne	invalid_use_of_symbol
1826
      enter_imm16_ok:
1829
	test	eax,eax
-
 
1830
	js	value_out_of_range
-
 
1831
      enter_imm16_ok:
1827
	push	eax
1832
	push	eax
1828
	mov	[operand_size],0
1833
	mov	[operand_size],0
1829
	lods	byte [esi]
1834
	lods	byte [esi]
1830
	cmp	al,','
1835
	cmp	al,','
1831
	jne	invalid_operand
1836
	jne	invalid_operand
1832
	lods	byte [esi]
1837
	lods	byte [esi]
1833
	call	get_size_operator
1838
	call	get_size_operator
1834
	cmp	ah,1
1839
	cmp	ah,1
1835
	je	enter_imm8_size_ok
1840
	je	enter_imm8_size_ok
1836
	or	ah,ah
1841
	or	ah,ah
1837
	jnz	invalid_operand_size
1842
	jnz	invalid_operand_size
1838
      enter_imm8_size_ok:
1843
      enter_imm8_size_ok:
1839
	cmp	al,'('
1844
	cmp	al,'('
1840
	jne	invalid_operand
1845
	jne	invalid_operand
1841
	call	get_byte_value
1846
	call	get_byte_value
1842
	mov	dl,al
1847
	cmp	[next_pass_needed],0
-
 
1848
	jne	enter_imm8_ok
-
 
1849
	test	eax,eax
-
 
1850
	js	value_out_of_range
-
 
1851
      enter_imm8_ok:
-
 
1852
	mov	dl,al
1843
	pop	ebx
1853
	pop	ebx
1844
	mov	al,0C8h
1854
	mov	al,0C8h
1845
	stos	byte [edi]
1855
	stos	byte [edi]
1846
	mov	ax,bx
1856
	mov	ax,bx
1847
	stos	word [edi]
1857
	stos	word [edi]
1848
	mov	al,dl
1858
	mov	al,dl
1849
	stos	byte [edi]
1859
	stos	byte [edi]
1850
	jmp	instruction_assembled
1860
	jmp	instruction_assembled
1851
ret_instruction_only64:
1861
ret_instruction_only64:
1852
	cmp	[code_type],64
1862
	cmp	[code_type],64
1853
	jne	illegal_instruction
1863
	jne	illegal_instruction
1854
	jmp	ret_instruction
1864
	jmp	ret_instruction
1855
ret_instruction_32bit_except64:
1865
ret_instruction_32bit_except64:
1856
	cmp	[code_type],64
1866
	cmp	[code_type],64
1857
	je	illegal_instruction
1867
	je	illegal_instruction
1858
ret_instruction_32bit:
1868
ret_instruction_32bit:
1859
	call	operand_32bit
1869
	call	operand_32bit
1860
	jmp	ret_instruction
1870
	jmp	ret_instruction
1861
ret_instruction_16bit:
1871
ret_instruction_16bit:
1862
	call	operand_16bit
1872
	call	operand_16bit
1863
	jmp	ret_instruction
1873
	jmp	ret_instruction
1864
retf_instruction:
1874
retf_instruction:
1865
	cmp	[code_type],64
1875
	cmp	[code_type],64
1866
	jne	ret_instruction
1876
	jne	ret_instruction
1867
ret_instruction_64bit:
1877
ret_instruction_64bit:
1868
	call	operand_64bit
1878
	call	operand_64bit
1869
ret_instruction:
1879
ret_instruction:
1870
	mov	[base_code],al
1880
	mov	[base_code],al
1871
	lods	byte [esi]
1881
	lods	byte [esi]
1872
	dec	esi
1882
	dec	esi
1873
	or	al,al
1883
	or	al,al
1874
	jz	simple_ret
1884
	jz	simple_ret
1875
	cmp	al,0Fh
1885
	cmp	al,0Fh
1876
	je	simple_ret
1886
	je	simple_ret
1877
	lods	byte [esi]
1887
	lods	byte [esi]
1878
	call	get_size_operator
1888
	call	get_size_operator
1879
	or	ah,ah
1889
	or	ah,ah
1880
	jz	ret_imm
1890
	jz	ret_imm
1881
	cmp	ah,2
1891
	cmp	ah,2
1882
	je	ret_imm
1892
	je	ret_imm
1883
	jmp	invalid_operand_size
1893
	jmp	invalid_operand_size
1884
      ret_imm:
1894
      ret_imm:
1885
	cmp	al,'('
1895
	cmp	al,'('
1886
	jne	invalid_operand
1896
	jne	invalid_operand
1887
	call	get_word_value
1897
	call	get_word_value
1888
	cmp	[next_pass_needed],0
1898
	cmp	[next_pass_needed],0
1889
	jne	ret_imm_ok
1899
	jne	ret_imm_ok
1890
	cmp	[value_type],0
1900
	cmp	[value_type],0
1891
	jne	invalid_use_of_symbol
1901
	jne	invalid_use_of_symbol
1892
      ret_imm_ok:
1902
	test	eax,eax
-
 
1903
	js	value_out_of_range
-
 
1904
      ret_imm_ok:
1893
	cmp	[size_declared],0
1905
	cmp	[size_declared],0
1894
	jne	ret_imm_store
1906
	jne	ret_imm_store
1895
	or	ax,ax
1907
	or	ax,ax
1896
	jz	simple_ret
1908
	jz	simple_ret
1897
      ret_imm_store:
1909
      ret_imm_store:
1898
	mov	dx,ax
1910
	mov	dx,ax
1899
	call	store_instruction_code
1911
	call	store_instruction_code
1900
	mov	ax,dx
1912
	mov	ax,dx
1901
	stos	word [edi]
1913
	stos	word [edi]
1902
	jmp	instruction_assembled
1914
	jmp	instruction_assembled
1903
      simple_ret:
1915
      simple_ret:
1904
	inc	[base_code]
1916
	inc	[base_code]
1905
	call	store_instruction_code
1917
	call	store_instruction_code
1906
	jmp	instruction_assembled
1918
	jmp	instruction_assembled
1907
lea_instruction:
1919
lea_instruction:
1908
	mov	[base_code],8Dh
1920
	mov	[base_code],8Dh
1909
	lods	byte [esi]
1921
	lods	byte [esi]
1910
	call	get_size_operator
1922
	call	get_size_operator
1911
	cmp	al,10h
1923
	cmp	al,10h
1912
	jne	invalid_operand
1924
	jne	invalid_operand
1913
	lods	byte [esi]
1925
	lods	byte [esi]
1914
	call	convert_register
1926
	call	convert_register
1915
	mov	[postbyte_register],al
1927
	mov	[postbyte_register],al
1916
	lods	byte [esi]
1928
	lods	byte [esi]
1917
	cmp	al,','
1929
	cmp	al,','
1918
	jne	invalid_operand
1930
	jne	invalid_operand
1919
	xor	al,al
1931
	xor	al,al
1920
	xchg	al,[operand_size]
1932
	xchg	al,[operand_size]
1921
	push	eax
1933
	push	eax
1922
	lods	byte [esi]
1934
	lods	byte [esi]
1923
	call	get_size_operator
1935
	call	get_size_operator
1924
	cmp	al,'['
1936
	cmp	al,'['
1925
	jne	invalid_operand
1937
	jne	invalid_operand
1926
	mov	[size_override],-1
1938
	mov	[size_override],-1
1927
	call	get_address
1939
	call	get_address
1928
	pop	eax
1940
	pop	eax
1929
	mov	[operand_size],al
1941
	mov	[operand_size],al
1930
	call	operand_autodetect
1942
	call	operand_autodetect
1931
	jmp	instruction_ready
1943
	jmp	instruction_ready
1932
ls_instruction:
1944
ls_instruction:
1933
	or	al,al
1945
	or	al,al
1934
	jz	les_instruction
1946
	jz	les_instruction
1935
	cmp	al,3
1947
	cmp	al,3
1936
	jz	lds_instruction
1948
	jz	lds_instruction
1937
	add	al,0B0h
1949
	add	al,0B0h
1938
	mov	[extended_code],al
1950
	mov	[extended_code],al
1939
	mov	[base_code],0Fh
1951
	mov	[base_code],0Fh
1940
	jmp	ls_code_ok
1952
	jmp	ls_code_ok
1941
      les_instruction:
1953
      les_instruction:
1942
	mov	[base_code],0C4h
1954
	mov	[base_code],0C4h
1943
	jmp	ls_short_code
1955
	jmp	ls_short_code
1944
      lds_instruction:
1956
      lds_instruction:
1945
	mov	[base_code],0C5h
1957
	mov	[base_code],0C5h
1946
      ls_short_code:
1958
      ls_short_code:
1947
	cmp	[code_type],64
1959
	cmp	[code_type],64
1948
	je	illegal_instruction
1960
	je	illegal_instruction
1949
      ls_code_ok:
1961
      ls_code_ok:
1950
	lods	byte [esi]
1962
	lods	byte [esi]
1951
	call	get_size_operator
1963
	call	get_size_operator
1952
	cmp	al,10h
1964
	cmp	al,10h
1953
	jne	invalid_operand
1965
	jne	invalid_operand
1954
	lods	byte [esi]
1966
	lods	byte [esi]
1955
	call	convert_register
1967
	call	convert_register
1956
	mov	[postbyte_register],al
1968
	mov	[postbyte_register],al
1957
	lods	byte [esi]
1969
	lods	byte [esi]
1958
	cmp	al,','
1970
	cmp	al,','
1959
	jne	invalid_operand
1971
	jne	invalid_operand
1960
	add	[operand_size],2
1972
	add	[operand_size],2
1961
	lods	byte [esi]
1973
	lods	byte [esi]
1962
	call	get_size_operator
1974
	call	get_size_operator
1963
	cmp	al,'['
1975
	cmp	al,'['
1964
	jne	invalid_operand
1976
	jne	invalid_operand
1965
	call	get_address
1977
	call	get_address
1966
	mov	al,[operand_size]
1978
	mov	al,[operand_size]
1967
	cmp	al,4
1979
	cmp	al,4
1968
	je	ls_16bit
1980
	je	ls_16bit
1969
	cmp	al,6
1981
	cmp	al,6
1970
	je	ls_32bit
1982
	je	ls_32bit
1971
	cmp	al,10
1983
	cmp	al,10
1972
	je	ls_64bit
1984
	je	ls_64bit
1973
	jmp	invalid_operand_size
1985
	jmp	invalid_operand_size
1974
      ls_16bit:
1986
      ls_16bit:
1975
	call	operand_16bit
1987
	call	operand_16bit
1976
	jmp	instruction_ready
1988
	jmp	instruction_ready
1977
      ls_32bit:
1989
      ls_32bit:
1978
	call	operand_32bit
1990
	call	operand_32bit
1979
	jmp	instruction_ready
1991
	jmp	instruction_ready
1980
      ls_64bit:
1992
      ls_64bit:
1981
	call	operand_64bit
1993
	call	operand_64bit
1982
	jmp	instruction_ready
1994
	jmp	instruction_ready
1983
sh_instruction:
1995
sh_instruction:
1984
	mov	[postbyte_register],al
1996
	mov	[postbyte_register],al
1985
	lods	byte [esi]
1997
	lods	byte [esi]
1986
	call	get_size_operator
1998
	call	get_size_operator
1987
	cmp	al,10h
1999
	cmp	al,10h
1988
	je	sh_reg
2000
	je	sh_reg
1989
	cmp	al,'['
2001
	cmp	al,'['
1990
	jne	invalid_operand
2002
	jne	invalid_operand
1991
      sh_mem:
2003
      sh_mem:
1992
	call	get_address
2004
	call	get_address
1993
	push	edx ebx ecx
2005
	push	edx ebx ecx
1994
	mov	al,[operand_size]
2006
	mov	al,[operand_size]
1995
	push	eax
2007
	push	eax
1996
	mov	[operand_size],0
2008
	mov	[operand_size],0
1997
	lods	byte [esi]
2009
	lods	byte [esi]
1998
	cmp	al,','
2010
	cmp	al,','
1999
	jne	invalid_operand
2011
	jne	invalid_operand
2000
	lods	byte [esi]
2012
	lods	byte [esi]
2001
	call	get_size_operator
2013
	call	get_size_operator
2002
	cmp	al,'('
2014
	cmp	al,'('
2003
	je	sh_mem_imm
2015
	je	sh_mem_imm
2004
	cmp	al,10h
2016
	cmp	al,10h
2005
	jne	invalid_operand
2017
	jne	invalid_operand
2006
      sh_mem_reg:
2018
      sh_mem_reg:
2007
	lods	byte [esi]
2019
	lods	byte [esi]
2008
	cmp	al,11h
2020
	cmp	al,11h
2009
	jne	invalid_operand
2021
	jne	invalid_operand
2010
	pop	eax ecx ebx edx
2022
	pop	eax ecx ebx edx
2011
	cmp	al,1
2023
	cmp	al,1
2012
	je	sh_mem_cl_8bit
2024
	je	sh_mem_cl_8bit
2013
	jb	sh_mem_cl_nosize
2025
	jb	sh_mem_cl_nosize
2014
	call	operand_autodetect
2026
	call	operand_autodetect
2015
	mov	[base_code],0D3h
2027
	mov	[base_code],0D3h
2016
	jmp	instruction_ready
2028
	jmp	instruction_ready
2017
      sh_mem_cl_nosize:
2029
      sh_mem_cl_nosize:
2018
	cmp	[error_line],0
2030
	cmp	[error_line],0
2019
	jne	sh_mem_cl_8bit
2031
	jne	sh_mem_cl_8bit
2020
	mov	eax,[current_line]
2032
	mov	eax,[current_line]
2021
	mov	[error_line],eax
2033
	mov	[error_line],eax
2022
	mov	[error],operand_size_not_specified
2034
	mov	[error],operand_size_not_specified
2023
      sh_mem_cl_8bit:
2035
      sh_mem_cl_8bit:
2024
	mov	[base_code],0D2h
2036
	mov	[base_code],0D2h
2025
	jmp	instruction_ready
2037
	jmp	instruction_ready
2026
      sh_mem_imm:
2038
      sh_mem_imm:
2027
	mov	al,[operand_size]
2039
	mov	al,[operand_size]
2028
	or	al,al
2040
	or	al,al
2029
	jz	sh_mem_imm_size_ok
2041
	jz	sh_mem_imm_size_ok
2030
	cmp	al,1
2042
	cmp	al,1
2031
	jne	invalid_operand_size
2043
	jne	invalid_operand_size
2032
      sh_mem_imm_size_ok:
2044
      sh_mem_imm_size_ok:
2033
	call	get_byte_value
2045
	call	get_byte_value
2034
	mov	byte [value],al
2046
	mov	byte [value],al
2035
	pop	eax ecx ebx edx
2047
	pop	eax ecx ebx edx
2036
	cmp	al,1
2048
	cmp	al,1
2037
	je	sh_mem_imm_8bit
2049
	je	sh_mem_imm_8bit
2038
	jb	sh_mem_imm_nosize
2050
	jb	sh_mem_imm_nosize
2039
	call	operand_autodetect
2051
	call	operand_autodetect
2040
	cmp	byte [value],1
2052
	cmp	byte [value],1
2041
	je	sh_mem_1
2053
	je	sh_mem_1
2042
	mov	[base_code],0C1h
2054
	mov	[base_code],0C1h
2043
	call	store_instruction_with_imm8
2055
	call	store_instruction_with_imm8
2044
	jmp	instruction_assembled
2056
	jmp	instruction_assembled
2045
      sh_mem_1:
2057
      sh_mem_1:
2046
	mov	[base_code],0D1h
2058
	mov	[base_code],0D1h
2047
	jmp	instruction_ready
2059
	jmp	instruction_ready
2048
      sh_mem_imm_nosize:
2060
      sh_mem_imm_nosize:
2049
	cmp	[error_line],0
2061
	cmp	[error_line],0
2050
	jne	sh_mem_imm_8bit
2062
	jne	sh_mem_imm_8bit
2051
	mov	eax,[current_line]
2063
	mov	eax,[current_line]
2052
	mov	[error_line],eax
2064
	mov	[error_line],eax
2053
	mov	[error],operand_size_not_specified
2065
	mov	[error],operand_size_not_specified
2054
      sh_mem_imm_8bit:
2066
      sh_mem_imm_8bit:
2055
	cmp	byte [value],1
2067
	cmp	byte [value],1
2056
	je	sh_mem_1_8bit
2068
	je	sh_mem_1_8bit
2057
	mov	[base_code],0C0h
2069
	mov	[base_code],0C0h
2058
	call	store_instruction_with_imm8
2070
	call	store_instruction_with_imm8
2059
	jmp	instruction_assembled
2071
	jmp	instruction_assembled
2060
      sh_mem_1_8bit:
2072
      sh_mem_1_8bit:
2061
	mov	[base_code],0D0h
2073
	mov	[base_code],0D0h
2062
	jmp	instruction_ready
2074
	jmp	instruction_ready
2063
      sh_reg:
2075
      sh_reg:
2064
	lods	byte [esi]
2076
	lods	byte [esi]
2065
	call	convert_register
2077
	call	convert_register
2066
	mov	bx,ax
2078
	mov	bx,ax
2067
	mov	[operand_size],0
2079
	mov	[operand_size],0
2068
	lods	byte [esi]
2080
	lods	byte [esi]
2069
	cmp	al,','
2081
	cmp	al,','
2070
	jne	invalid_operand
2082
	jne	invalid_operand
2071
	lods	byte [esi]
2083
	lods	byte [esi]
2072
	call	get_size_operator
2084
	call	get_size_operator
2073
	cmp	al,'('
2085
	cmp	al,'('
2074
	je	sh_reg_imm
2086
	je	sh_reg_imm
2075
	cmp	al,10h
2087
	cmp	al,10h
2076
	jne	invalid_operand
2088
	jne	invalid_operand
2077
      sh_reg_reg:
2089
      sh_reg_reg:
2078
	lods	byte [esi]
2090
	lods	byte [esi]
2079
	cmp	al,11h
2091
	cmp	al,11h
2080
	jne	invalid_operand
2092
	jne	invalid_operand
2081
	mov	al,bh
2093
	mov	al,bh
2082
	cmp	al,1
2094
	cmp	al,1
2083
	je	sh_reg_cl_8bit
2095
	je	sh_reg_cl_8bit
2084
	call	operand_autodetect
2096
	call	operand_autodetect
2085
	mov	[base_code],0D3h
2097
	mov	[base_code],0D3h
2086
	jmp	nomem_instruction_ready
2098
	jmp	nomem_instruction_ready
2087
      sh_reg_cl_8bit:
2099
      sh_reg_cl_8bit:
2088
	mov	[base_code],0D2h
2100
	mov	[base_code],0D2h
2089
	jmp	nomem_instruction_ready
2101
	jmp	nomem_instruction_ready
2090
      sh_reg_imm:
2102
      sh_reg_imm:
2091
	mov	al,[operand_size]
2103
	mov	al,[operand_size]
2092
	or	al,al
2104
	or	al,al
2093
	jz	sh_reg_imm_size_ok
2105
	jz	sh_reg_imm_size_ok
2094
	cmp	al,1
2106
	cmp	al,1
2095
	jne	invalid_operand_size
2107
	jne	invalid_operand_size
2096
      sh_reg_imm_size_ok:
2108
      sh_reg_imm_size_ok:
2097
	push	ebx
2109
	push	ebx
2098
	call	get_byte_value
2110
	call	get_byte_value
2099
	mov	dl,al
2111
	mov	dl,al
2100
	pop	ebx
2112
	pop	ebx
2101
	mov	al,bh
2113
	mov	al,bh
2102
	cmp	al,1
2114
	cmp	al,1
2103
	je	sh_reg_imm_8bit
2115
	je	sh_reg_imm_8bit
2104
	call	operand_autodetect
2116
	call	operand_autodetect
2105
	cmp	dl,1
2117
	cmp	dl,1
2106
	je	sh_reg_1
2118
	je	sh_reg_1
2107
	mov	[base_code],0C1h
2119
	mov	[base_code],0C1h
2108
	call	store_nomem_instruction
2120
	call	store_nomem_instruction
2109
	mov	al,dl
2121
	mov	al,dl
2110
	stos	byte [edi]
2122
	stos	byte [edi]
2111
	jmp	instruction_assembled
2123
	jmp	instruction_assembled
2112
      sh_reg_1:
2124
      sh_reg_1:
2113
	mov	[base_code],0D1h
2125
	mov	[base_code],0D1h
2114
	jmp	nomem_instruction_ready
2126
	jmp	nomem_instruction_ready
2115
      sh_reg_imm_8bit:
2127
      sh_reg_imm_8bit:
2116
	cmp	dl,1
2128
	cmp	dl,1
2117
	je	sh_reg_1_8bit
2129
	je	sh_reg_1_8bit
2118
	mov	[base_code],0C0h
2130
	mov	[base_code],0C0h
2119
	call	store_nomem_instruction
2131
	call	store_nomem_instruction
2120
	mov	al,dl
2132
	mov	al,dl
2121
	stos	byte [edi]
2133
	stos	byte [edi]
2122
	jmp	instruction_assembled
2134
	jmp	instruction_assembled
2123
      sh_reg_1_8bit:
2135
      sh_reg_1_8bit:
2124
	mov	[base_code],0D0h
2136
	mov	[base_code],0D0h
2125
	jmp	nomem_instruction_ready
2137
	jmp	nomem_instruction_ready
2126
shd_instruction:
2138
shd_instruction:
2127
	mov	[base_code],0Fh
2139
	mov	[base_code],0Fh
2128
	mov	[extended_code],al
2140
	mov	[extended_code],al
2129
	lods	byte [esi]
2141
	lods	byte [esi]
2130
	call	get_size_operator
2142
	call	get_size_operator
2131
	cmp	al,10h
2143
	cmp	al,10h
2132
	je	shd_reg
2144
	je	shd_reg
2133
	cmp	al,'['
2145
	cmp	al,'['
2134
	jne	invalid_operand
2146
	jne	invalid_operand
2135
      shd_mem:
2147
      shd_mem:
2136
	call	get_address
2148
	call	get_address
2137
	push	edx ebx ecx
2149
	push	edx ebx ecx
2138
	lods	byte [esi]
2150
	lods	byte [esi]
2139
	cmp	al,','
2151
	cmp	al,','
2140
	jne	invalid_operand
2152
	jne	invalid_operand
2141
	lods	byte [esi]
2153
	lods	byte [esi]
2142
	call	get_size_operator
2154
	call	get_size_operator
2143
	cmp	al,10h
2155
	cmp	al,10h
2144
	jne	invalid_operand
2156
	jne	invalid_operand
2145
	lods	byte [esi]
2157
	lods	byte [esi]
2146
	call	convert_register
2158
	call	convert_register
2147
	mov	[postbyte_register],al
2159
	mov	[postbyte_register],al
2148
	lods	byte [esi]
2160
	lods	byte [esi]
2149
	cmp	al,','
2161
	cmp	al,','
2150
	jne	invalid_operand
2162
	jne	invalid_operand
2151
	mov	al,ah
2163
	mov	al,ah
2152
	mov	[operand_size],0
2164
	mov	[operand_size],0
2153
	push	eax
2165
	push	eax
2154
	lods	byte [esi]
2166
	lods	byte [esi]
2155
	call	get_size_operator
2167
	call	get_size_operator
2156
	cmp	al,'('
2168
	cmp	al,'('
2157
	je	shd_mem_reg_imm
2169
	je	shd_mem_reg_imm
2158
	cmp	al,10h
2170
	cmp	al,10h
2159
	jne	invalid_operand
2171
	jne	invalid_operand
2160
	lods	byte [esi]
2172
	lods	byte [esi]
2161
	cmp	al,11h
2173
	cmp	al,11h
2162
	jne	invalid_operand
2174
	jne	invalid_operand
2163
	pop	eax ecx ebx edx
2175
	pop	eax ecx ebx edx
2164
	call	operand_autodetect
2176
	call	operand_autodetect
2165
	inc	[extended_code]
2177
	inc	[extended_code]
2166
	jmp	instruction_ready
2178
	jmp	instruction_ready
2167
      shd_mem_reg_imm:
2179
      shd_mem_reg_imm:
2168
	mov	al,[operand_size]
2180
	mov	al,[operand_size]
2169
	or	al,al
2181
	or	al,al
2170
	jz	shd_mem_reg_imm_size_ok
2182
	jz	shd_mem_reg_imm_size_ok
2171
	cmp	al,1
2183
	cmp	al,1
2172
	jne	invalid_operand_size
2184
	jne	invalid_operand_size
2173
      shd_mem_reg_imm_size_ok:
2185
      shd_mem_reg_imm_size_ok:
2174
	call	get_byte_value
2186
	call	get_byte_value
2175
	mov	byte [value],al
2187
	mov	byte [value],al
2176
	pop	eax ecx ebx edx
2188
	pop	eax ecx ebx edx
2177
	call	operand_autodetect
2189
	call	operand_autodetect
2178
	call	store_instruction_with_imm8
2190
	call	store_instruction_with_imm8
2179
	jmp	instruction_assembled
2191
	jmp	instruction_assembled
2180
      shd_reg:
2192
      shd_reg:
2181
	lods	byte [esi]
2193
	lods	byte [esi]
2182
	call	convert_register
2194
	call	convert_register
2183
	mov	[postbyte_register],al
2195
	mov	[postbyte_register],al
2184
	lods	byte [esi]
2196
	lods	byte [esi]
2185
	cmp	al,','
2197
	cmp	al,','
2186
	jne	invalid_operand
2198
	jne	invalid_operand
2187
	lods	byte [esi]
2199
	lods	byte [esi]
2188
	call	get_size_operator
2200
	call	get_size_operator
2189
	cmp	al,10h
2201
	cmp	al,10h
2190
	jne	invalid_operand
2202
	jne	invalid_operand
2191
	lods	byte [esi]
2203
	lods	byte [esi]
2192
	call	convert_register
2204
	call	convert_register
2193
	mov	bl,[postbyte_register]
2205
	mov	bl,[postbyte_register]
2194
	mov	[postbyte_register],al
2206
	mov	[postbyte_register],al
2195
	mov	al,ah
2207
	mov	al,ah
2196
	push	eax ebx
2208
	push	eax ebx
2197
	lods	byte [esi]
2209
	lods	byte [esi]
2198
	cmp	al,','
2210
	cmp	al,','
2199
	jne	invalid_operand
2211
	jne	invalid_operand
2200
	mov	[operand_size],0
2212
	mov	[operand_size],0
2201
	lods	byte [esi]
2213
	lods	byte [esi]
2202
	call	get_size_operator
2214
	call	get_size_operator
2203
	cmp	al,'('
2215
	cmp	al,'('
2204
	je	shd_reg_reg_imm
2216
	je	shd_reg_reg_imm
2205
	cmp	al,10h
2217
	cmp	al,10h
2206
	jne	invalid_operand
2218
	jne	invalid_operand
2207
	lods	byte [esi]
2219
	lods	byte [esi]
2208
	cmp	al,11h
2220
	cmp	al,11h
2209
	jne	invalid_operand
2221
	jne	invalid_operand
2210
	pop	ebx eax
2222
	pop	ebx eax
2211
	call	operand_autodetect
2223
	call	operand_autodetect
2212
	inc	[extended_code]
2224
	inc	[extended_code]
2213
	jmp	nomem_instruction_ready
2225
	jmp	nomem_instruction_ready
2214
      shd_reg_reg_imm:
2226
      shd_reg_reg_imm:
2215
	mov	al,[operand_size]
2227
	mov	al,[operand_size]
2216
	or	al,al
2228
	or	al,al
2217
	jz	shd_reg_reg_imm_size_ok
2229
	jz	shd_reg_reg_imm_size_ok
2218
	cmp	al,1
2230
	cmp	al,1
2219
	jne	invalid_operand_size
2231
	jne	invalid_operand_size
2220
      shd_reg_reg_imm_size_ok:
2232
      shd_reg_reg_imm_size_ok:
2221
	call	get_byte_value
2233
	call	get_byte_value
2222
	mov	dl,al
2234
	mov	dl,al
2223
	pop	ebx eax
2235
	pop	ebx eax
2224
	call	operand_autodetect
2236
	call	operand_autodetect
2225
	call	store_nomem_instruction
2237
	call	store_nomem_instruction
2226
	mov	al,dl
2238
	mov	al,dl
2227
	stos	byte [edi]
2239
	stos	byte [edi]
2228
	jmp	instruction_assembled
2240
	jmp	instruction_assembled
2229
movx_instruction:
2241
movx_instruction:
2230
	mov	[base_code],0Fh
2242
	mov	[base_code],0Fh
2231
	mov	[extended_code],al
2243
	mov	[extended_code],al
2232
	lods	byte [esi]
2244
	lods	byte [esi]
2233
	call	get_size_operator
2245
	call	get_size_operator
2234
	cmp	al,10h
2246
	cmp	al,10h
2235
	jne	invalid_operand
2247
	jne	invalid_operand
2236
	lods	byte [esi]
2248
	lods	byte [esi]
2237
	call	convert_register
2249
	call	convert_register
2238
	mov	[postbyte_register],al
2250
	mov	[postbyte_register],al
2239
	mov	al,ah
2251
	mov	al,ah
2240
	push	eax
2252
	push	eax
2241
	lods	byte [esi]
2253
	lods	byte [esi]
2242
	cmp	al,','
2254
	cmp	al,','
2243
	jne	invalid_operand
2255
	jne	invalid_operand
2244
	mov	[operand_size],0
2256
	mov	[operand_size],0
2245
	lods	byte [esi]
2257
	lods	byte [esi]
2246
	call	get_size_operator
2258
	call	get_size_operator
2247
	cmp	al,10h
2259
	cmp	al,10h
2248
	je	movx_reg
2260
	je	movx_reg
2249
	cmp	al,'['
2261
	cmp	al,'['
2250
	jne	invalid_operand
2262
	jne	invalid_operand
2251
	call	get_address
2263
	call	get_address
2252
	pop	eax
2264
	pop	eax
2253
	mov	ah,[operand_size]
2265
	mov	ah,[operand_size]
2254
	or	ah,ah
2266
	or	ah,ah
2255
	jz	movx_unknown_size
2267
	jz	movx_unknown_size
2256
	cmp	ah,al
2268
	cmp	ah,al
2257
	jae	invalid_operand_size
2269
	jae	invalid_operand_size
2258
	cmp	ah,1
2270
	cmp	ah,1
2259
	je	movx_mem_store
2271
	je	movx_mem_store
2260
	cmp	ah,2
2272
	cmp	ah,2
2261
	jne	invalid_operand_size
2273
	jne	invalid_operand_size
2262
	inc	[extended_code]
2274
	inc	[extended_code]
2263
      movx_mem_store:
2275
      movx_mem_store:
2264
	call	operand_autodetect
2276
	call	operand_autodetect
2265
	jmp	instruction_ready
2277
	jmp	instruction_ready
2266
      movx_unknown_size:
2278
      movx_unknown_size:
2267
	cmp	[error_line],0
2279
	cmp	[error_line],0
2268
	jne	movx_mem_store
2280
	jne	movx_mem_store
2269
	mov	eax,[current_line]
2281
	mov	eax,[current_line]
2270
	mov	[error_line],eax
2282
	mov	[error_line],eax
2271
	mov	[error],operand_size_not_specified
2283
	mov	[error],operand_size_not_specified
2272
	jmp	movx_mem_store
2284
	jmp	movx_mem_store
2273
      movx_reg:
2285
      movx_reg:
2274
	lods	byte [esi]
2286
	lods	byte [esi]
2275
	call	convert_register
2287
	call	convert_register
2276
	pop	ebx
2288
	pop	ebx
2277
	xchg	bl,al
2289
	xchg	bl,al
2278
	cmp	ah,al
2290
	cmp	ah,al
2279
	jae	invalid_operand_size
2291
	jae	invalid_operand_size
2280
	cmp	ah,1
2292
	cmp	ah,1
2281
	je	movx_reg_8bit
2293
	je	movx_reg_8bit
2282
	cmp	ah,2
2294
	cmp	ah,2
2283
	je	movx_reg_16bit
2295
	je	movx_reg_16bit
2284
	jmp	invalid_operand_size
2296
	jmp	invalid_operand_size
2285
      movx_reg_8bit:
2297
      movx_reg_8bit:
2286
	call	operand_autodetect
2298
	call	operand_autodetect
2287
	jmp	nomem_instruction_ready
2299
	jmp	nomem_instruction_ready
2288
      movx_reg_16bit:
2300
      movx_reg_16bit:
2289
	call	operand_autodetect
2301
	call	operand_autodetect
2290
	inc	[extended_code]
2302
	inc	[extended_code]
2291
	jmp	nomem_instruction_ready
2303
	jmp	nomem_instruction_ready
2292
movsxd_instruction:
2304
movsxd_instruction:
2293
	mov	[base_code],al
2305
	mov	[base_code],al
2294
	lods	byte [esi]
2306
	lods	byte [esi]
2295
	call	get_size_operator
2307
	call	get_size_operator
2296
	cmp	al,10h
2308
	cmp	al,10h
2297
	jne	invalid_operand
2309
	jne	invalid_operand
2298
	lods	byte [esi]
2310
	lods	byte [esi]
2299
	call	convert_register
2311
	call	convert_register
2300
	mov	[postbyte_register],al
2312
	mov	[postbyte_register],al
2301
	cmp	ah,8
2313
	cmp	ah,8
2302
	jne	invalid_operand_size
2314
	jne	invalid_operand_size
2303
	lods	byte [esi]
2315
	lods	byte [esi]
2304
	cmp	al,','
2316
	cmp	al,','
2305
	jne	invalid_operand
2317
	jne	invalid_operand
2306
	mov	[operand_size],0
2318
	mov	[operand_size],0
2307
	lods	byte [esi]
2319
	lods	byte [esi]
2308
	call	get_size_operator
2320
	call	get_size_operator
2309
	cmp	al,10h
2321
	cmp	al,10h
2310
	je	movsxd_reg
2322
	je	movsxd_reg
2311
	cmp	al,'['
2323
	cmp	al,'['
2312
	jne	invalid_operand
2324
	jne	invalid_operand
2313
	call	get_address
2325
	call	get_address
2314
	cmp	[operand_size],4
2326
	cmp	[operand_size],4
2315
	je	movsxd_mem_store
2327
	je	movsxd_mem_store
2316
	cmp	[operand_size],0
2328
	cmp	[operand_size],0
2317
	jne	invalid_operand_size
2329
	jne	invalid_operand_size
2318
      movsxd_mem_store:
2330
      movsxd_mem_store:
2319
	call	operand_64bit
2331
	call	operand_64bit
2320
	jmp	instruction_ready
2332
	jmp	instruction_ready
2321
      movsxd_reg:
2333
      movsxd_reg:
2322
	lods	byte [esi]
2334
	lods	byte [esi]
2323
	call	convert_register
2335
	call	convert_register
2324
	cmp	ah,4
2336
	cmp	ah,4
2325
	jne	invalid_operand_size
2337
	jne	invalid_operand_size
2326
	mov	bl,al
2338
	mov	bl,al
2327
	call	operand_64bit
2339
	call	operand_64bit
2328
	jmp	nomem_instruction_ready
2340
	jmp	nomem_instruction_ready
2329
bt_instruction:
2341
bt_instruction:
2330
	mov	[postbyte_register],al
2342
	mov	[postbyte_register],al
2331
	shl	al,3
2343
	shl	al,3
2332
	add	al,83h
2344
	add	al,83h
2333
	mov	[extended_code],al
2345
	mov	[extended_code],al
2334
	mov	[base_code],0Fh
2346
	mov	[base_code],0Fh
2335
	lods	byte [esi]
2347
	lods	byte [esi]
2336
	call	get_size_operator
2348
	call	get_size_operator
2337
	cmp	al,10h
2349
	cmp	al,10h
2338
	je	bt_reg
2350
	je	bt_reg
2339
	cmp	al,'['
2351
	cmp	al,'['
2340
	jne	invalid_operand
2352
	jne	invalid_operand
2341
	call	get_address
2353
	call	get_address
2342
	push	eax ebx ecx
2354
	push	eax ebx ecx
2343
	lods	byte [esi]
2355
	lods	byte [esi]
2344
	cmp	al,','
2356
	cmp	al,','
2345
	jne	invalid_operand
2357
	jne	invalid_operand
2346
	cmp	byte [esi],'('
2358
	cmp	byte [esi],'('
2347
	je	bt_mem_imm
2359
	je	bt_mem_imm
2348
	cmp	byte [esi],11h
2360
	cmp	byte [esi],11h
2349
	jne	bt_mem_reg
2361
	jne	bt_mem_reg
2350
	cmp	byte [esi+2],'('
2362
	cmp	byte [esi+2],'('
2351
	je	bt_mem_imm
2363
	je	bt_mem_imm
2352
      bt_mem_reg:
2364
      bt_mem_reg:
2353
	lods	byte [esi]
2365
	lods	byte [esi]
2354
	call	get_size_operator
2366
	call	get_size_operator
2355
	cmp	al,10h
2367
	cmp	al,10h
2356
	jne	invalid_operand
2368
	jne	invalid_operand
2357
	lods	byte [esi]
2369
	lods	byte [esi]
2358
	call	convert_register
2370
	call	convert_register
2359
	mov	[postbyte_register],al
2371
	mov	[postbyte_register],al
2360
	pop	ecx ebx edx
2372
	pop	ecx ebx edx
2361
	mov	al,ah
2373
	mov	al,ah
2362
	call	operand_autodetect
2374
	call	operand_autodetect
2363
	jmp	instruction_ready
2375
	jmp	instruction_ready
2364
      bt_mem_imm:
2376
      bt_mem_imm:
2365
	xor	al,al
2377
	xor	al,al
2366
	xchg	al,[operand_size]
2378
	xchg	al,[operand_size]
2367
	push	eax
2379
	push	eax
2368
	lods	byte [esi]
2380
	lods	byte [esi]
2369
	call	get_size_operator
2381
	call	get_size_operator
2370
	cmp	al,'('
2382
	cmp	al,'('
2371
	jne	invalid_operand
2383
	jne	invalid_operand
2372
	mov	al,[operand_size]
2384
	mov	al,[operand_size]
2373
	or	al,al
2385
	or	al,al
2374
	jz	bt_mem_imm_size_ok
2386
	jz	bt_mem_imm_size_ok
2375
	cmp	al,1
2387
	cmp	al,1
2376
	jne	invalid_operand_size
2388
	jne	invalid_operand_size
2377
      bt_mem_imm_size_ok:
2389
      bt_mem_imm_size_ok:
2378
	call	get_byte_value
2390
	call	get_byte_value
2379
	mov	byte [value],al
2391
	mov	byte [value],al
2380
	pop	eax
2392
	pop	eax
2381
	or	al,al
2393
	or	al,al
2382
	jz	bt_mem_imm_nosize
2394
	jz	bt_mem_imm_nosize
2383
	call	operand_autodetect
2395
	call	operand_autodetect
2384
      bt_mem_imm_store:
2396
      bt_mem_imm_store:
2385
	pop	ecx ebx edx
2397
	pop	ecx ebx edx
2386
	mov	[extended_code],0BAh
2398
	mov	[extended_code],0BAh
2387
	call	store_instruction_with_imm8
2399
	call	store_instruction_with_imm8
2388
	jmp	instruction_assembled
2400
	jmp	instruction_assembled
2389
      bt_mem_imm_nosize:
2401
      bt_mem_imm_nosize:
2390
	cmp	[error_line],0
2402
	cmp	[error_line],0
2391
	jne	bt_mem_imm_store
2403
	jne	bt_mem_imm_store
2392
	mov	eax,[current_line]
2404
	mov	eax,[current_line]
2393
	mov	[error_line],eax
2405
	mov	[error_line],eax
2394
	mov	[error],operand_size_not_specified
2406
	mov	[error],operand_size_not_specified
2395
	jmp	bt_mem_imm_store
2407
	jmp	bt_mem_imm_store
2396
      bt_reg:
2408
      bt_reg:
2397
	lods	byte [esi]
2409
	lods	byte [esi]
2398
	call	convert_register
2410
	call	convert_register
2399
	mov	bl,al
2411
	mov	bl,al
2400
	lods	byte [esi]
2412
	lods	byte [esi]
2401
	cmp	al,','
2413
	cmp	al,','
2402
	jne	invalid_operand
2414
	jne	invalid_operand
2403
	cmp	byte [esi],'('
2415
	cmp	byte [esi],'('
2404
	je	bt_reg_imm
2416
	je	bt_reg_imm
2405
	cmp	byte [esi],11h
2417
	cmp	byte [esi],11h
2406
	jne	bt_reg_reg
2418
	jne	bt_reg_reg
2407
	cmp	byte [esi+2],'('
2419
	cmp	byte [esi+2],'('
2408
	je	bt_reg_imm
2420
	je	bt_reg_imm
2409
      bt_reg_reg:
2421
      bt_reg_reg:
2410
	lods	byte [esi]
2422
	lods	byte [esi]
2411
	call	get_size_operator
2423
	call	get_size_operator
2412
	cmp	al,10h
2424
	cmp	al,10h
2413
	jne	invalid_operand
2425
	jne	invalid_operand
2414
	lods	byte [esi]
2426
	lods	byte [esi]
2415
	call	convert_register
2427
	call	convert_register
2416
	mov	[postbyte_register],al
2428
	mov	[postbyte_register],al
2417
	mov	al,ah
2429
	mov	al,ah
2418
	call	operand_autodetect
2430
	call	operand_autodetect
2419
	jmp	nomem_instruction_ready
2431
	jmp	nomem_instruction_ready
2420
      bt_reg_imm:
2432
      bt_reg_imm:
2421
	xor	al,al
2433
	xor	al,al
2422
	xchg	al,[operand_size]
2434
	xchg	al,[operand_size]
2423
	push	eax ebx
2435
	push	eax ebx
2424
	lods	byte [esi]
2436
	lods	byte [esi]
2425
	call	get_size_operator
2437
	call	get_size_operator
2426
	cmp	al,'('
2438
	cmp	al,'('
2427
	jne	invalid_operand
2439
	jne	invalid_operand
2428
	mov	al,[operand_size]
2440
	mov	al,[operand_size]
2429
	or	al,al
2441
	or	al,al
2430
	jz	bt_reg_imm_size_ok
2442
	jz	bt_reg_imm_size_ok
2431
	cmp	al,1
2443
	cmp	al,1
2432
	jne	invalid_operand_size
2444
	jne	invalid_operand_size
2433
      bt_reg_imm_size_ok:
2445
      bt_reg_imm_size_ok:
2434
	call	get_byte_value
2446
	call	get_byte_value
2435
	mov	byte [value],al
2447
	mov	byte [value],al
2436
	pop	ebx eax
2448
	pop	ebx eax
2437
	call	operand_autodetect
2449
	call	operand_autodetect
2438
      bt_reg_imm_store:
2450
      bt_reg_imm_store:
2439
	mov	[extended_code],0BAh
2451
	mov	[extended_code],0BAh
2440
	call	store_nomem_instruction
2452
	call	store_nomem_instruction
2441
	mov	al,byte [value]
2453
	mov	al,byte [value]
2442
	stos	byte [edi]
2454
	stos	byte [edi]
2443
	jmp	instruction_assembled
2455
	jmp	instruction_assembled
2444
bs_instruction:
2456
bs_instruction:
2445
	mov	[extended_code],al
2457
	mov	[extended_code],al
2446
	mov	[base_code],0Fh
2458
	mov	[base_code],0Fh
2447
	lods	byte [esi]
2459
	lods	byte [esi]
2448
	call	get_size_operator
2460
	call	get_size_operator
2449
	cmp	al,10h
2461
	cmp	al,10h
2450
	jne	invalid_operand
2462
	jne	invalid_operand
2451
	lods	byte [esi]
2463
	lods	byte [esi]
2452
	call	convert_register
2464
	call	convert_register
2453
	mov	[postbyte_register],al
2465
	mov	[postbyte_register],al
2454
	lods	byte [esi]
2466
	lods	byte [esi]
2455
	cmp	al,','
2467
	cmp	al,','
2456
	jne	invalid_operand
2468
	jne	invalid_operand
2457
	lods	byte [esi]
2469
	lods	byte [esi]
2458
	call	get_size_operator
2470
	call	get_size_operator
2459
	cmp	al,10h
2471
	cmp	al,10h
2460
	je	bs_reg_reg
2472
	je	bs_reg_reg
2461
	cmp	al,'['
2473
	cmp	al,'['
2462
	jne	invalid_argument
2474
	jne	invalid_argument
2463
	call	get_address
2475
	call	get_address
2464
	mov	al,[operand_size]
2476
	mov	al,[operand_size]
2465
	call	operand_autodetect
2477
	call	operand_autodetect
2466
	jmp	instruction_ready
2478
	jmp	instruction_ready
2467
      bs_reg_reg:
2479
      bs_reg_reg:
2468
	lods	byte [esi]
2480
	lods	byte [esi]
2469
	call	convert_register
2481
	call	convert_register
2470
	mov	bl,al
2482
	mov	bl,al
2471
	mov	al,ah
2483
	mov	al,ah
2472
	call	operand_autodetect
2484
	call	operand_autodetect
2473
	jmp	nomem_instruction_ready
2485
	jmp	nomem_instruction_ready
2474
imul_instruction:
2486
imul_instruction:
2475
	mov	[base_code],0F6h
2487
	mov	[base_code],0F6h
2476
	mov	[postbyte_register],5
2488
	mov	[postbyte_register],5
2477
	lods	byte [esi]
2489
	lods	byte [esi]
2478
	call	get_size_operator
2490
	call	get_size_operator
2479
	cmp	al,10h
2491
	cmp	al,10h
2480
	je	imul_reg
2492
	je	imul_reg
2481
	cmp	al,'['
2493
	cmp	al,'['
2482
	jne	invalid_operand
2494
	jne	invalid_operand
2483
      imul_mem:
2495
      imul_mem:
2484
	call	get_address
2496
	call	get_address
2485
	mov	al,[operand_size]
2497
	mov	al,[operand_size]
2486
	cmp	al,1
2498
	cmp	al,1
2487
	je	imul_mem_8bit
2499
	je	imul_mem_8bit
2488
	jb	imul_mem_nosize
2500
	jb	imul_mem_nosize
2489
	call	operand_autodetect
2501
	call	operand_autodetect
2490
	inc	[base_code]
2502
	inc	[base_code]
2491
	jmp	instruction_ready
2503
	jmp	instruction_ready
2492
      imul_mem_nosize:
2504
      imul_mem_nosize:
2493
	cmp	[error_line],0
2505
	cmp	[error_line],0
2494
	jne	imul_mem_8bit
2506
	jne	imul_mem_8bit
2495
	mov	eax,[current_line]
2507
	mov	eax,[current_line]
2496
	mov	[error_line],eax
2508
	mov	[error_line],eax
2497
	mov	[error],operand_size_not_specified
2509
	mov	[error],operand_size_not_specified
2498
      imul_mem_8bit:
2510
      imul_mem_8bit:
2499
	jmp	instruction_ready
2511
	jmp	instruction_ready
2500
      imul_reg:
2512
      imul_reg:
2501
	lods	byte [esi]
2513
	lods	byte [esi]
2502
	call	convert_register
2514
	call	convert_register
2503
	cmp	byte [esi],','
2515
	cmp	byte [esi],','
2504
	je	imul_reg_
2516
	je	imul_reg_
2505
	mov	bl,al
2517
	mov	bl,al
2506
	mov	al,ah
2518
	mov	al,ah
2507
	cmp	al,1
2519
	cmp	al,1
2508
	je	imul_reg_8bit
2520
	je	imul_reg_8bit
2509
	call	operand_autodetect
2521
	call	operand_autodetect
2510
	inc	[base_code]
2522
	inc	[base_code]
2511
      imul_reg_8bit:
2523
      imul_reg_8bit:
2512
	jmp	nomem_instruction_ready
2524
	jmp	nomem_instruction_ready
2513
      imul_reg_:
2525
      imul_reg_:
2514
	mov	[postbyte_register],al
2526
	mov	[postbyte_register],al
2515
	inc	esi
2527
	inc	esi
2516
	cmp	byte [esi],'('
2528
	cmp	byte [esi],'('
2517
	je	imul_reg_imm
2529
	je	imul_reg_imm
2518
	cmp	byte [esi],11h
2530
	cmp	byte [esi],11h
2519
	jne	imul_reg_noimm
2531
	jne	imul_reg_noimm
2520
	cmp	byte [esi+2],'('
2532
	cmp	byte [esi+2],'('
2521
	je	imul_reg_imm
2533
	je	imul_reg_imm
2522
      imul_reg_noimm:
2534
      imul_reg_noimm:
2523
	lods	byte [esi]
2535
	lods	byte [esi]
2524
	call	get_size_operator
2536
	call	get_size_operator
2525
	cmp	al,10h
2537
	cmp	al,10h
2526
	je	imul_reg_reg
2538
	je	imul_reg_reg
2527
	cmp	al,'['
2539
	cmp	al,'['
2528
	jne	invalid_operand
2540
	jne	invalid_operand
2529
      imul_reg_mem:
2541
      imul_reg_mem:
2530
	call	get_address
2542
	call	get_address
2531
	push	edx ebx ecx
2543
	push	edx ebx ecx
2532
	cmp	byte [esi],','
2544
	cmp	byte [esi],','
2533
	je	imul_reg_mem_imm
2545
	je	imul_reg_mem_imm
2534
	mov	al,[operand_size]
2546
	mov	al,[operand_size]
2535
	call	operand_autodetect
2547
	call	operand_autodetect
2536
	pop	ecx ebx edx
2548
	pop	ecx ebx edx
2537
	mov	[base_code],0Fh
2549
	mov	[base_code],0Fh
2538
	mov	[extended_code],0AFh
2550
	mov	[extended_code],0AFh
2539
	jmp	instruction_ready
2551
	jmp	instruction_ready
2540
      imul_reg_mem_imm:
2552
      imul_reg_mem_imm:
2541
	inc	esi
2553
	inc	esi
2542
	lods	byte [esi]
2554
	lods	byte [esi]
2543
	call	get_size_operator
2555
	call	get_size_operator
2544
	cmp	al,'('
2556
	cmp	al,'('
2545
	jne	invalid_operand
2557
	jne	invalid_operand
2546
	mov	al,[operand_size]
2558
	mov	al,[operand_size]
2547
	cmp	al,2
2559
	cmp	al,2
2548
	je	imul_reg_mem_imm_16bit
2560
	je	imul_reg_mem_imm_16bit
2549
	cmp	al,4
2561
	cmp	al,4
2550
	je	imul_reg_mem_imm_32bit
2562
	je	imul_reg_mem_imm_32bit
2551
	cmp	al,8
2563
	cmp	al,8
2552
	jne	invalid_operand_size
2564
	jne	invalid_operand_size
2553
      imul_reg_mem_imm_64bit:
2565
      imul_reg_mem_imm_64bit:
2554
	cmp	[size_declared],0
2566
	cmp	[size_declared],0
2555
	jne	long_immediate_not_encodable
2567
	jne	long_immediate_not_encodable
2556
	call	operand_64bit
2568
	call	operand_64bit
2557
	call	get_simm32
2569
	call	get_simm32
2558
	cmp	[value_type],4
2570
	cmp	[value_type],4
2559
	jae	long_immediate_not_encodable
2571
	jae	long_immediate_not_encodable
2560
	jmp	imul_reg_mem_imm_32bit_ok
2572
	jmp	imul_reg_mem_imm_32bit_ok
2561
      imul_reg_mem_imm_16bit:
2573
      imul_reg_mem_imm_16bit:
2562
	call	operand_16bit
2574
	call	operand_16bit
2563
	call	get_word_value
2575
	call	get_word_value
2564
	mov	word [value],ax
2576
	mov	word [value],ax
2565
	cmp	[value_type],0
2577
	cmp	[value_type],0
2566
	jne	imul_reg_mem_imm_16bit_store
2578
	jne	imul_reg_mem_imm_16bit_store
2567
	cmp	[size_declared],0
2579
	cmp	[size_declared],0
2568
	jne	imul_reg_mem_imm_16bit_store
2580
	jne	imul_reg_mem_imm_16bit_store
2569
	cmp	ax,-80h
2581
	cmp	ax,-80h
2570
	jl	imul_reg_mem_imm_16bit_store
2582
	jl	imul_reg_mem_imm_16bit_store
2571
	cmp	ax,80h
2583
	cmp	ax,80h
2572
	jl	imul_reg_mem_imm_8bit_store
2584
	jl	imul_reg_mem_imm_8bit_store
2573
      imul_reg_mem_imm_16bit_store:
2585
      imul_reg_mem_imm_16bit_store:
2574
	pop	ecx ebx edx
2586
	pop	ecx ebx edx
2575
	mov	[base_code],69h
2587
	mov	[base_code],69h
2576
	call	store_instruction_with_imm16
2588
	call	store_instruction_with_imm16
2577
	jmp	instruction_assembled
2589
	jmp	instruction_assembled
2578
      imul_reg_mem_imm_32bit:
2590
      imul_reg_mem_imm_32bit:
2579
	call	operand_32bit
2591
	call	operand_32bit
2580
	call	get_dword_value
2592
	call	get_dword_value
2581
      imul_reg_mem_imm_32bit_ok:
2593
      imul_reg_mem_imm_32bit_ok:
2582
	mov	dword [value],eax
2594
	mov	dword [value],eax
2583
	cmp	[value_type],0
2595
	cmp	[value_type],0
2584
	jne	imul_reg_mem_imm_32bit_store
2596
	jne	imul_reg_mem_imm_32bit_store
2585
	cmp	[size_declared],0
2597
	cmp	[size_declared],0
2586
	jne	imul_reg_mem_imm_32bit_store
2598
	jne	imul_reg_mem_imm_32bit_store
2587
	cmp	eax,-80h
2599
	cmp	eax,-80h
2588
	jl	imul_reg_mem_imm_32bit_store
2600
	jl	imul_reg_mem_imm_32bit_store
2589
	cmp	eax,80h
2601
	cmp	eax,80h
2590
	jl	imul_reg_mem_imm_8bit_store
2602
	jl	imul_reg_mem_imm_8bit_store
2591
      imul_reg_mem_imm_32bit_store:
2603
      imul_reg_mem_imm_32bit_store:
2592
	pop	ecx ebx edx
2604
	pop	ecx ebx edx
2593
	mov	[base_code],69h
2605
	mov	[base_code],69h
2594
	call	store_instruction_with_imm32
2606
	call	store_instruction_with_imm32
2595
	jmp	instruction_assembled
2607
	jmp	instruction_assembled
2596
      imul_reg_mem_imm_8bit_store:
2608
      imul_reg_mem_imm_8bit_store:
2597
	pop	ecx ebx edx
2609
	pop	ecx ebx edx
2598
	mov	[base_code],6Bh
2610
	mov	[base_code],6Bh
2599
	call	store_instruction_with_imm8
2611
	call	store_instruction_with_imm8
2600
	jmp	instruction_assembled
2612
	jmp	instruction_assembled
2601
      imul_reg_imm:
2613
      imul_reg_imm:
2602
	mov	bl,[postbyte_register]
2614
	mov	bl,[postbyte_register]
2603
	dec	esi
2615
	dec	esi
2604
	jmp	imul_reg_reg_imm
2616
	jmp	imul_reg_reg_imm
2605
      imul_reg_reg:
2617
      imul_reg_reg:
2606
	lods	byte [esi]
2618
	lods	byte [esi]
2607
	call	convert_register
2619
	call	convert_register
2608
	mov	bl,al
2620
	mov	bl,al
2609
	cmp	byte [esi],','
2621
	cmp	byte [esi],','
2610
	je	imul_reg_reg_imm
2622
	je	imul_reg_reg_imm
2611
	mov	al,ah
2623
	mov	al,ah
2612
	call	operand_autodetect
2624
	call	operand_autodetect
2613
	mov	[base_code],0Fh
2625
	mov	[base_code],0Fh
2614
	mov	[extended_code],0AFh
2626
	mov	[extended_code],0AFh
2615
	jmp	nomem_instruction_ready
2627
	jmp	nomem_instruction_ready
2616
      imul_reg_reg_imm:
2628
      imul_reg_reg_imm:
2617
	inc	esi
2629
	inc	esi
2618
	lods	byte [esi]
2630
	lods	byte [esi]
2619
	call	get_size_operator
2631
	call	get_size_operator
2620
	cmp	al,'('
2632
	cmp	al,'('
2621
	jne	invalid_operand
2633
	jne	invalid_operand
2622
	mov	al,[operand_size]
2634
	mov	al,[operand_size]
2623
	cmp	al,2
2635
	cmp	al,2
2624
	je	imul_reg_reg_imm_16bit
2636
	je	imul_reg_reg_imm_16bit
2625
	cmp	al,4
2637
	cmp	al,4
2626
	je	imul_reg_reg_imm_32bit
2638
	je	imul_reg_reg_imm_32bit
2627
	cmp	al,8
2639
	cmp	al,8
2628
	jne	invalid_operand_size
2640
	jne	invalid_operand_size
2629
      imul_reg_reg_imm_64bit:
2641
      imul_reg_reg_imm_64bit:
2630
	cmp	[size_declared],0
2642
	cmp	[size_declared],0
2631
	jne	long_immediate_not_encodable
2643
	jne	long_immediate_not_encodable
2632
	call	operand_64bit
2644
	call	operand_64bit
2633
	push	ebx
2645
	push	ebx
2634
	call	get_simm32
2646
	call	get_simm32
2635
	cmp	[value_type],4
2647
	cmp	[value_type],4
2636
	jae	long_immediate_not_encodable
2648
	jae	long_immediate_not_encodable
2637
	jmp	imul_reg_reg_imm_32bit_ok
2649
	jmp	imul_reg_reg_imm_32bit_ok
2638
      imul_reg_reg_imm_16bit:
2650
      imul_reg_reg_imm_16bit:
2639
	call	operand_16bit
2651
	call	operand_16bit
2640
	push	ebx
2652
	push	ebx
2641
	call	get_word_value
2653
	call	get_word_value
2642
	pop	ebx
2654
	pop	ebx
2643
	mov	dx,ax
2655
	mov	dx,ax
2644
	cmp	[value_type],0
2656
	cmp	[value_type],0
2645
	jne	imul_reg_reg_imm_16bit_store
2657
	jne	imul_reg_reg_imm_16bit_store
2646
	cmp	[size_declared],0
2658
	cmp	[size_declared],0
2647
	jne	imul_reg_reg_imm_16bit_store
2659
	jne	imul_reg_reg_imm_16bit_store
2648
	cmp	ax,-80h
2660
	cmp	ax,-80h
2649
	jl	imul_reg_reg_imm_16bit_store
2661
	jl	imul_reg_reg_imm_16bit_store
2650
	cmp	ax,80h
2662
	cmp	ax,80h
2651
	jl	imul_reg_reg_imm_8bit_store
2663
	jl	imul_reg_reg_imm_8bit_store
2652
      imul_reg_reg_imm_16bit_store:
2664
      imul_reg_reg_imm_16bit_store:
2653
	mov	[base_code],69h
2665
	mov	[base_code],69h
2654
	call	store_nomem_instruction
2666
	call	store_nomem_instruction
2655
	mov	ax,dx
2667
	mov	ax,dx
2656
	call	mark_relocation
2668
	call	mark_relocation
2657
	stos	word [edi]
2669
	stos	word [edi]
2658
	jmp	instruction_assembled
2670
	jmp	instruction_assembled
2659
      imul_reg_reg_imm_32bit:
2671
      imul_reg_reg_imm_32bit:
2660
	call	operand_32bit
2672
	call	operand_32bit
2661
	push	ebx
2673
	push	ebx
2662
	call	get_dword_value
2674
	call	get_dword_value
2663
      imul_reg_reg_imm_32bit_ok:
2675
      imul_reg_reg_imm_32bit_ok:
2664
	pop	ebx
2676
	pop	ebx
2665
	mov	edx,eax
2677
	mov	edx,eax
2666
	cmp	[value_type],0
2678
	cmp	[value_type],0
2667
	jne	imul_reg_reg_imm_32bit_store
2679
	jne	imul_reg_reg_imm_32bit_store
2668
	cmp	[size_declared],0
2680
	cmp	[size_declared],0
2669
	jne	imul_reg_reg_imm_32bit_store
2681
	jne	imul_reg_reg_imm_32bit_store
2670
	cmp	eax,-80h
2682
	cmp	eax,-80h
2671
	jl	imul_reg_reg_imm_32bit_store
2683
	jl	imul_reg_reg_imm_32bit_store
2672
	cmp	eax,80h
2684
	cmp	eax,80h
2673
	jl	imul_reg_reg_imm_8bit_store
2685
	jl	imul_reg_reg_imm_8bit_store
2674
      imul_reg_reg_imm_32bit_store:
2686
      imul_reg_reg_imm_32bit_store:
2675
	mov	[base_code],69h
2687
	mov	[base_code],69h
2676
	call	store_nomem_instruction
2688
	call	store_nomem_instruction
2677
	mov	eax,edx
2689
	mov	eax,edx
2678
	call	mark_relocation
2690
	call	mark_relocation
2679
	stos	dword [edi]
2691
	stos	dword [edi]
2680
	jmp	instruction_assembled
2692
	jmp	instruction_assembled
2681
      imul_reg_reg_imm_8bit_store:
2693
      imul_reg_reg_imm_8bit_store:
2682
	mov	[base_code],6Bh
2694
	mov	[base_code],6Bh
2683
	call	store_nomem_instruction
2695
	call	store_nomem_instruction
2684
	mov	al,dl
2696
	mov	al,dl
2685
	stos	byte [edi]
2697
	stos	byte [edi]
2686
	jmp	instruction_assembled
2698
	jmp	instruction_assembled
2687
in_instruction:
2699
in_instruction:
2688
	lods	byte [esi]
2700
	lods	byte [esi]
2689
	call	get_size_operator
2701
	call	get_size_operator
2690
	cmp	al,10h
2702
	cmp	al,10h
2691
	jne	invalid_operand
2703
	jne	invalid_operand
2692
	lods	byte [esi]
2704
	lods	byte [esi]
2693
	call	convert_register
2705
	call	convert_register
2694
	or	al,al
2706
	or	al,al
2695
	jnz	invalid_operand
2707
	jnz	invalid_operand
2696
	lods	byte [esi]
2708
	lods	byte [esi]
2697
	cmp	al,','
2709
	cmp	al,','
2698
	jne	invalid_operand
2710
	jne	invalid_operand
2699
	mov	al,ah
2711
	mov	al,ah
2700
	push	eax
2712
	push	eax
2701
	mov	[operand_size],0
2713
	mov	[operand_size],0
2702
	lods	byte [esi]
2714
	lods	byte [esi]
2703
	call	get_size_operator
2715
	call	get_size_operator
2704
	cmp	al,'('
2716
	cmp	al,'('
2705
	je	in_imm
2717
	je	in_imm
2706
	cmp	al,10h
2718
	cmp	al,10h
2707
	je	in_reg
2719
	je	in_reg
2708
	jmp	invalid_operand
2720
	jmp	invalid_operand
2709
      in_reg:
2721
      in_reg:
2710
	lods	byte [esi]
2722
	lods	byte [esi]
2711
	cmp	al,22h
2723
	cmp	al,22h
2712
	jne	invalid_operand
2724
	jne	invalid_operand
2713
	pop	eax
2725
	pop	eax
2714
	cmp	al,1
2726
	cmp	al,1
2715
	je	in_al_dx
2727
	je	in_al_dx
2716
	cmp	al,2
2728
	cmp	al,2
2717
	je	in_ax_dx
2729
	je	in_ax_dx
2718
	cmp	al,4
2730
	cmp	al,4
2719
	jne	invalid_operand_size
2731
	jne	invalid_operand_size
2720
      in_ax_dx:
2732
      in_ax_dx:
2721
	call	operand_autodetect
2733
	call	operand_autodetect
2722
	mov	[base_code],0EDh
2734
	mov	[base_code],0EDh
2723
	call	store_instruction_code
2735
	call	store_instruction_code
2724
	jmp	instruction_assembled
2736
	jmp	instruction_assembled
2725
      in_al_dx:
2737
      in_al_dx:
2726
	mov	al,0ECh
2738
	mov	al,0ECh
2727
	stos	byte [edi]
2739
	stos	byte [edi]
2728
	jmp	instruction_assembled
2740
	jmp	instruction_assembled
2729
      in_imm:
2741
      in_imm:
2730
	mov	al,[operand_size]
2742
	mov	al,[operand_size]
2731
	or	al,al
2743
	or	al,al
2732
	jz	in_imm_size_ok
2744
	jz	in_imm_size_ok
2733
	cmp	al,1
2745
	cmp	al,1
2734
	jne	invalid_operand_size
2746
	jne	invalid_operand_size
2735
      in_imm_size_ok:
2747
      in_imm_size_ok:
2736
	call	get_byte_value
2748
	call	get_byte_value
2737
	mov	dl,al
2749
	mov	dl,al
2738
	pop	eax
2750
	pop	eax
2739
	cmp	al,1
2751
	cmp	al,1
2740
	je	in_al_imm
2752
	je	in_al_imm
2741
	cmp	al,2
2753
	cmp	al,2
2742
	je	in_ax_imm
2754
	je	in_ax_imm
2743
	cmp	al,4
2755
	cmp	al,4
2744
	jne	invalid_operand_size
2756
	jne	invalid_operand_size
2745
      in_ax_imm:
2757
      in_ax_imm:
2746
	call	operand_autodetect
2758
	call	operand_autodetect
2747
	mov	[base_code],0E5h
2759
	mov	[base_code],0E5h
2748
	call	store_instruction_code
2760
	call	store_instruction_code
2749
	mov	al,dl
2761
	mov	al,dl
2750
	stos	byte [edi]
2762
	stos	byte [edi]
2751
	jmp	instruction_assembled
2763
	jmp	instruction_assembled
2752
      in_al_imm:
2764
      in_al_imm:
2753
	mov	al,0E4h
2765
	mov	al,0E4h
2754
	stos	byte [edi]
2766
	stos	byte [edi]
2755
	mov	al,dl
2767
	mov	al,dl
2756
	stos	byte [edi]
2768
	stos	byte [edi]
2757
	jmp	instruction_assembled
2769
	jmp	instruction_assembled
2758
out_instruction:
2770
out_instruction:
2759
	lods	byte [esi]
2771
	lods	byte [esi]
2760
	call	get_size_operator
2772
	call	get_size_operator
2761
	cmp	al,'('
2773
	cmp	al,'('
2762
	je	out_imm
2774
	je	out_imm
2763
	cmp	al,10h
2775
	cmp	al,10h
2764
	jne	invalid_operand
2776
	jne	invalid_operand
2765
	lods	byte [esi]
2777
	lods	byte [esi]
2766
	cmp	al,22h
2778
	cmp	al,22h
2767
	jne	invalid_operand
2779
	jne	invalid_operand
2768
	lods	byte [esi]
2780
	lods	byte [esi]
2769
	cmp	al,','
2781
	cmp	al,','
2770
	jne	invalid_operand
2782
	jne	invalid_operand
2771
	mov	[operand_size],0
2783
	mov	[operand_size],0
2772
	lods	byte [esi]
2784
	lods	byte [esi]
2773
	call	get_size_operator
2785
	call	get_size_operator
2774
	cmp	al,10h
2786
	cmp	al,10h
2775
	jne	invalid_operand
2787
	jne	invalid_operand
2776
	lods	byte [esi]
2788
	lods	byte [esi]
2777
	call	convert_register
2789
	call	convert_register
2778
	or	al,al
2790
	or	al,al
2779
	jnz	invalid_operand
2791
	jnz	invalid_operand
2780
	mov	al,ah
2792
	mov	al,ah
2781
	cmp	al,1
2793
	cmp	al,1
2782
	je	out_dx_al
2794
	je	out_dx_al
2783
	cmp	al,2
2795
	cmp	al,2
2784
	je	out_dx_ax
2796
	je	out_dx_ax
2785
	cmp	al,4
2797
	cmp	al,4
2786
	jne	invalid_operand_size
2798
	jne	invalid_operand_size
2787
      out_dx_ax:
2799
      out_dx_ax:
2788
	call	operand_autodetect
2800
	call	operand_autodetect
2789
	mov	[base_code],0EFh
2801
	mov	[base_code],0EFh
2790
	call	store_instruction_code
2802
	call	store_instruction_code
2791
	jmp	instruction_assembled
2803
	jmp	instruction_assembled
2792
      out_dx_al:
2804
      out_dx_al:
2793
	mov	al,0EEh
2805
	mov	al,0EEh
2794
	stos	byte [edi]
2806
	stos	byte [edi]
2795
	jmp	instruction_assembled
2807
	jmp	instruction_assembled
2796
      out_imm:
2808
      out_imm:
2797
	mov	al,[operand_size]
2809
	mov	al,[operand_size]
2798
	or	al,al
2810
	or	al,al
2799
	jz	out_imm_size_ok
2811
	jz	out_imm_size_ok
2800
	cmp	al,1
2812
	cmp	al,1
2801
	jne	invalid_operand_size
2813
	jne	invalid_operand_size
2802
      out_imm_size_ok:
2814
      out_imm_size_ok:
2803
	call	get_byte_value
2815
	call	get_byte_value
2804
	mov	dl,al
2816
	mov	dl,al
2805
	lods	byte [esi]
2817
	lods	byte [esi]
2806
	cmp	al,','
2818
	cmp	al,','
2807
	jne	invalid_operand
2819
	jne	invalid_operand
2808
	mov	[operand_size],0
2820
	mov	[operand_size],0
2809
	lods	byte [esi]
2821
	lods	byte [esi]
2810
	call	get_size_operator
2822
	call	get_size_operator
2811
	cmp	al,10h
2823
	cmp	al,10h
2812
	jne	invalid_operand
2824
	jne	invalid_operand
2813
	lods	byte [esi]
2825
	lods	byte [esi]
2814
	call	convert_register
2826
	call	convert_register
2815
	or	al,al
2827
	or	al,al
2816
	jnz	invalid_operand
2828
	jnz	invalid_operand
2817
	mov	al,ah
2829
	mov	al,ah
2818
	cmp	al,1
2830
	cmp	al,1
2819
	je	out_imm_al
2831
	je	out_imm_al
2820
	cmp	al,2
2832
	cmp	al,2
2821
	je	out_imm_ax
2833
	je	out_imm_ax
2822
	cmp	al,4
2834
	cmp	al,4
2823
	jne	invalid_operand_size
2835
	jne	invalid_operand_size
2824
      out_imm_ax:
2836
      out_imm_ax:
2825
	call	operand_autodetect
2837
	call	operand_autodetect
2826
	mov	[base_code],0E7h
2838
	mov	[base_code],0E7h
2827
	call	store_instruction_code
2839
	call	store_instruction_code
2828
	mov	al,dl
2840
	mov	al,dl
2829
	stos	byte [edi]
2841
	stos	byte [edi]
2830
	jmp	instruction_assembled
2842
	jmp	instruction_assembled
2831
      out_imm_al:
2843
      out_imm_al:
2832
	mov	al,0E6h
2844
	mov	al,0E6h
2833
	stos	byte [edi]
2845
	stos	byte [edi]
2834
	mov	al,dl
2846
	mov	al,dl
2835
	stos	byte [edi]
2847
	stos	byte [edi]
2836
	jmp	instruction_assembled
2848
	jmp	instruction_assembled
2837
 
2849
 
2838
call_instruction:
2850
call_instruction:
2839
	mov	[postbyte_register],10b
2851
	mov	[postbyte_register],10b
2840
	mov	[base_code],0E8h
2852
	mov	[base_code],0E8h
2841
	mov	[extended_code],9Ah
2853
	mov	[extended_code],9Ah
2842
	jmp	process_jmp
2854
	jmp	process_jmp
2843
jmp_instruction:
2855
jmp_instruction:
2844
	mov	[postbyte_register],100b
2856
	mov	[postbyte_register],100b
2845
	mov	[base_code],0E9h
2857
	mov	[base_code],0E9h
2846
	mov	[extended_code],0EAh
2858
	mov	[extended_code],0EAh
2847
      process_jmp:
2859
      process_jmp:
2848
	lods	byte [esi]
2860
	lods	byte [esi]
2849
	call	get_jump_operator
2861
	call	get_jump_operator
2850
	call	get_size_operator
2862
	call	get_size_operator
2851
	cmp	al,'('
2863
	cmp	al,'('
2852
	je	jmp_imm
2864
	je	jmp_imm
2853
	mov	[base_code],0FFh
2865
	mov	[base_code],0FFh
2854
	cmp	al,10h
2866
	cmp	al,10h
2855
	je	jmp_reg
2867
	je	jmp_reg
2856
	cmp	al,'['
2868
	cmp	al,'['
2857
	jne	invalid_operand
2869
	jne	invalid_operand
2858
      jmp_mem:
2870
      jmp_mem:
2859
	cmp	[jump_type],1
2871
	cmp	[jump_type],1
2860
	je	illegal_instruction
2872
	je	illegal_instruction
2861
	call	get_address
2873
	call	get_address
2862
	mov	edx,eax
2874
	mov	edx,eax
2863
	mov	al,[operand_size]
2875
	mov	al,[operand_size]
2864
	or	al,al
2876
	or	al,al
2865
	jz	jmp_mem_size_not_specified
2877
	jz	jmp_mem_size_not_specified
2866
	cmp	al,2
2878
	cmp	al,2
2867
	je	jmp_mem_16bit
2879
	je	jmp_mem_16bit
2868
	cmp	al,4
2880
	cmp	al,4
2869
	je	jmp_mem_32bit
2881
	je	jmp_mem_32bit
2870
	cmp	al,6
2882
	cmp	al,6
2871
	je	jmp_mem_48bit
2883
	je	jmp_mem_48bit
2872
	cmp	al,8
2884
	cmp	al,8
2873
	je	jmp_mem_64bit
2885
	je	jmp_mem_64bit
2874
	cmp	al,10
2886
	cmp	al,10
2875
	je	jmp_mem_80bit
2887
	je	jmp_mem_80bit
2876
	jmp	invalid_operand_size
2888
	jmp	invalid_operand_size
2877
      jmp_mem_size_not_specified:
2889
      jmp_mem_size_not_specified:
2878
	cmp	[jump_type],3
2890
	cmp	[jump_type],3
2879
	je	jmp_mem_far
2891
	je	jmp_mem_far
2880
	cmp	[jump_type],2
2892
	cmp	[jump_type],2
2881
	je	jmp_mem_near
2893
	je	jmp_mem_near
2882
	cmp	[error_line],0
2894
	cmp	[error_line],0
2883
	jne	jmp_mem_near
2895
	jne	jmp_mem_near
2884
	mov	eax,[current_line]
2896
	mov	eax,[current_line]
2885
	mov	[error_line],eax
2897
	mov	[error_line],eax
2886
	mov	[error],operand_size_not_specified
2898
	mov	[error],operand_size_not_specified
2887
      jmp_mem_near:
2899
      jmp_mem_near:
2888
	cmp	[code_type],16
2900
	cmp	[code_type],16
2889
	je	jmp_mem_16bit
2901
	je	jmp_mem_16bit
2890
	cmp	[code_type],32
2902
	cmp	[code_type],32
2891
	je	jmp_mem_near_32bit
2903
	je	jmp_mem_near_32bit
2892
      jmp_mem_64bit:
2904
      jmp_mem_64bit:
2893
	cmp	[jump_type],3
2905
	cmp	[jump_type],3
2894
	je	invalid_operand_size
2906
	je	invalid_operand_size
2895
	cmp	[code_type],64
2907
	cmp	[code_type],64
2896
	jne	illegal_instruction
2908
	jne	illegal_instruction
2897
	jmp	instruction_ready
2909
	jmp	instruction_ready
2898
      jmp_mem_far:
2910
      jmp_mem_far:
2899
	cmp	[code_type],16
2911
	cmp	[code_type],16
2900
	je	jmp_mem_far_32bit
2912
	je	jmp_mem_far_32bit
2901
      jmp_mem_48bit:
2913
      jmp_mem_48bit:
2902
	call	operand_32bit
2914
	call	operand_32bit
2903
      jmp_mem_far_store:
2915
      jmp_mem_far_store:
2904
	cmp	[jump_type],2
2916
	cmp	[jump_type],2
2905
	je	invalid_operand_size
2917
	je	invalid_operand_size
2906
	inc	[postbyte_register]
2918
	inc	[postbyte_register]
2907
	jmp	instruction_ready
2919
	jmp	instruction_ready
2908
      jmp_mem_80bit:
2920
      jmp_mem_80bit:
2909
	call	operand_64bit
2921
	call	operand_64bit
2910
	jmp	jmp_mem_far_store
2922
	jmp	jmp_mem_far_store
2911
      jmp_mem_far_32bit:
2923
      jmp_mem_far_32bit:
2912
	call	operand_16bit
2924
	call	operand_16bit
2913
	jmp	jmp_mem_far_store
2925
	jmp	jmp_mem_far_store
2914
      jmp_mem_32bit:
2926
      jmp_mem_32bit:
2915
	cmp	[jump_type],3
2927
	cmp	[jump_type],3
2916
	je	jmp_mem_far_32bit
2928
	je	jmp_mem_far_32bit
2917
	cmp	[jump_type],2
2929
	cmp	[jump_type],2
2918
	je	jmp_mem_near_32bit
2930
	je	jmp_mem_near_32bit
2919
	cmp	[code_type],16
2931
	cmp	[code_type],16
2920
	je	jmp_mem_far_32bit
2932
	je	jmp_mem_far_32bit
2921
      jmp_mem_near_32bit:
2933
      jmp_mem_near_32bit:
2922
	cmp	[code_type],64
2934
	cmp	[code_type],64
2923
	je	illegal_instruction
2935
	je	illegal_instruction
2924
	call	operand_32bit
2936
	call	operand_32bit
2925
	jmp	instruction_ready
2937
	jmp	instruction_ready
2926
      jmp_mem_16bit:
2938
      jmp_mem_16bit:
2927
	cmp	[jump_type],3
2939
	cmp	[jump_type],3
2928
	je	invalid_operand_size
2940
	je	invalid_operand_size
2929
	call	operand_16bit
2941
	call	operand_16bit
2930
	jmp	instruction_ready
2942
	jmp	instruction_ready
2931
      jmp_reg:
2943
      jmp_reg:
2932
	test	[jump_type],1
2944
	test	[jump_type],1
2933
	jnz	invalid_operand
2945
	jnz	invalid_operand
2934
	lods	byte [esi]
2946
	lods	byte [esi]
2935
	call	convert_register
2947
	call	convert_register
2936
	mov	bl,al
2948
	mov	bl,al
2937
	mov	al,ah
2949
	mov	al,ah
2938
	cmp	al,2
2950
	cmp	al,2
2939
	je	jmp_reg_16bit
2951
	je	jmp_reg_16bit
2940
	cmp	al,4
2952
	cmp	al,4
2941
	je	jmp_reg_32bit
2953
	je	jmp_reg_32bit
2942
	cmp	al,8
2954
	cmp	al,8
2943
	jne	invalid_operand_size
2955
	jne	invalid_operand_size
2944
      jmp_reg_64bit:
2956
      jmp_reg_64bit:
2945
	cmp	[code_type],64
2957
	cmp	[code_type],64
2946
	jne	illegal_instruction
2958
	jne	illegal_instruction
2947
	jmp	nomem_instruction_ready
2959
	jmp	nomem_instruction_ready
2948
      jmp_reg_32bit:
2960
      jmp_reg_32bit:
2949
	cmp	[code_type],64
2961
	cmp	[code_type],64
2950
	je	illegal_instruction
2962
	je	illegal_instruction
2951
	call	operand_32bit
2963
	call	operand_32bit
2952
	jmp	nomem_instruction_ready
2964
	jmp	nomem_instruction_ready
2953
      jmp_reg_16bit:
2965
      jmp_reg_16bit:
2954
	call	operand_16bit
2966
	call	operand_16bit
2955
	jmp	nomem_instruction_ready
2967
	jmp	nomem_instruction_ready
2956
      jmp_imm:
2968
      jmp_imm:
2957
	cmp	byte [esi],'.'
2969
	cmp	byte [esi],'.'
2958
	je	invalid_value
2970
	je	invalid_value
2959
	mov	ebx,esi
2971
	mov	ebx,esi
2960
	dec	esi
2972
	dec	esi
2961
	call	skip_symbol
2973
	call	skip_symbol
2962
	xchg	esi,ebx
2974
	xchg	esi,ebx
2963
	cmp	byte [ebx],':'
2975
	cmp	byte [ebx],':'
2964
	je	jmp_far
2976
	je	jmp_far
2965
	cmp	[jump_type],3
2977
	cmp	[jump_type],3
2966
	je	invalid_operand
2978
	je	invalid_operand
2967
      jmp_near:
2979
      jmp_near:
2968
	mov	al,[operand_size]
2980
	mov	al,[operand_size]
2969
	cmp	al,2
2981
	cmp	al,2
2970
	je	jmp_imm_16bit
2982
	je	jmp_imm_16bit
2971
	cmp	al,4
2983
	cmp	al,4
2972
	je	jmp_imm_32bit
2984
	je	jmp_imm_32bit
2973
	cmp	al,8
2985
	cmp	al,8
2974
	je	jmp_imm_64bit
2986
	je	jmp_imm_64bit
2975
	or	al,al
2987
	or	al,al
2976
	jnz	invalid_operand_size
2988
	jnz	invalid_operand_size
2977
	cmp	[code_type],16
2989
	cmp	[code_type],16
2978
	je	jmp_imm_16bit
2990
	je	jmp_imm_16bit
2979
	cmp	[code_type],64
2991
	cmp	[code_type],64
2980
	je	jmp_imm_64bit
2992
	je	jmp_imm_64bit
2981
      jmp_imm_32bit:
2993
      jmp_imm_32bit:
2982
	cmp	[code_type],64
2994
	cmp	[code_type],64
2983
	je	invalid_operand_size
2995
	je	invalid_operand_size
2984
	call	get_address_dword_value
2996
	call	get_address_dword_value
2985
	cmp	[code_type],16
2997
	cmp	[code_type],16
2986
	jne	jmp_imm_32bit_prefix_ok
2998
	jne	jmp_imm_32bit_prefix_ok
2987
	mov	byte [edi],66h
2999
	mov	byte [edi],66h
2988
	inc	edi
3000
	inc	edi
2989
      jmp_imm_32bit_prefix_ok:
3001
      jmp_imm_32bit_prefix_ok:
2990
	call	calculate_jump_offset
3002
	call	calculate_jump_offset
2991
	cdq
3003
	cdq
2992
	call	check_for_short_jump
3004
	call	check_for_short_jump
2993
	jc	jmp_short
3005
	jc	jmp_short
2994
      jmp_imm_32bit_store:
3006
      jmp_imm_32bit_store:
2995
	mov	edx,eax
3007
	mov	edx,eax
2996
	sub	edx,3
3008
	sub	edx,3
2997
	mov	al,[base_code]
3009
	mov	al,[base_code]
2998
	stos	byte [edi]
3010
	stos	byte [edi]
2999
	mov	eax,edx
3011
	mov	eax,edx
3000
	call	mark_relocation
3012
	call	mark_relocation
3001
	stos	dword [edi]
3013
	stos	dword [edi]
3002
	jmp	instruction_assembled
3014
	jmp	instruction_assembled
3003
      jmp_imm_64bit:
3015
      jmp_imm_64bit:
3004
	cmp	[code_type],64
3016
	cmp	[code_type],64
3005
	jne	invalid_operand_size
3017
	jne	invalid_operand_size
3006
	call	get_address_qword_value
3018
	call	get_address_qword_value
3007
	call	calculate_jump_offset
3019
	call	calculate_jump_offset
3008
	mov	ecx,edx
3020
	mov	ecx,edx
3009
	cdq
3021
	cdq
3010
	cmp	edx,ecx
3022
	cmp	edx,ecx
3011
	jne	value_out_of_range
3023
	jne	value_out_of_range
3012
	call	check_for_short_jump
3024
	call	check_for_short_jump
3013
	jnc	jmp_imm_32bit_store
3025
	jnc	jmp_imm_32bit_store
3014
      jmp_short:
3026
      jmp_short:
3015
	mov	ah,al
3027
	mov	ah,al
3016
	mov	al,0EBh
3028
	mov	al,0EBh
3017
	stos	word [edi]
3029
	stos	word [edi]
3018
	jmp	instruction_assembled
3030
	jmp	instruction_assembled
3019
      jmp_imm_16bit:
3031
      jmp_imm_16bit:
3020
	call	get_address_word_value
3032
	call	get_address_word_value
3021
	cmp	[code_type],16
3033
	cmp	[code_type],16
3022
	je	jmp_imm_16bit_prefix_ok
3034
	je	jmp_imm_16bit_prefix_ok
3023
	mov	byte [edi],66h
3035
	mov	byte [edi],66h
3024
	inc	edi
3036
	inc	edi
3025
      jmp_imm_16bit_prefix_ok:
3037
      jmp_imm_16bit_prefix_ok:
3026
	call	calculate_jump_offset
3038
	call	calculate_jump_offset
3027
	cwde
3039
	cwde
3028
	cdq
3040
	cdq
3029
	call	check_for_short_jump
3041
	call	check_for_short_jump
3030
	jc	jmp_short
3042
	jc	jmp_short
3031
	cmp	[value_type],0
3043
	cmp	[value_type],0
3032
	jne	invalid_use_of_symbol
3044
	jne	invalid_use_of_symbol
3033
	mov	edx,eax
3045
	mov	edx,eax
3034
	dec	edx
3046
	dec	edx
3035
	mov	al,[base_code]
3047
	mov	al,[base_code]
3036
	stos	byte [edi]
3048
	stos	byte [edi]
3037
	mov	eax,edx
3049
	mov	eax,edx
3038
	stos	word [edi]
3050
	stos	word [edi]
3039
	jmp	instruction_assembled
3051
	jmp	instruction_assembled
3040
      calculate_jump_offset:
3052
      calculate_jump_offset:
3041
	add	edi,2
3053
	add	edi,2
3042
	call	calculate_relative_offset
3054
	call	calculate_relative_offset
3043
	sub	edi,2
3055
	sub	edi,2
3044
	ret
3056
	ret
3045
      check_for_short_jump:
3057
      check_for_short_jump:
3046
	cmp	[jump_type],1
3058
	cmp	[jump_type],1
3047
	je	forced_short
3059
	je	forced_short
3048
	ja	no_short_jump
3060
	ja	no_short_jump
3049
	cmp	[base_code],0E8h
3061
	cmp	[base_code],0E8h
3050
	je	no_short_jump
3062
	je	no_short_jump
3051
	cmp	[value_type],0
3063
	cmp	[value_type],0
3052
	jne	no_short_jump
3064
	jne	no_short_jump
3053
	cmp	eax,80h
3065
	cmp	eax,80h
3054
	jb	short_jump
3066
	jb	short_jump
3055
	cmp	eax,-80h
3067
	cmp	eax,-80h
3056
	jae	short_jump
3068
	jae	short_jump
3057
      no_short_jump:
3069
      no_short_jump:
3058
	clc
3070
	clc
3059
	ret
3071
	ret
3060
      forced_short:
3072
      forced_short:
3061
	cmp	[base_code],0E8h
3073
	cmp	[base_code],0E8h
3062
	je	illegal_instruction
3074
	je	illegal_instruction
3063
	cmp	[next_pass_needed],0
3075
	cmp	[next_pass_needed],0
3064
	jne	jmp_short_value_type_ok
3076
	jne	jmp_short_value_type_ok
3065
	cmp	[value_type],0
3077
	cmp	[value_type],0
3066
	jne	invalid_use_of_symbol
3078
	jne	invalid_use_of_symbol
3067
      jmp_short_value_type_ok:
3079
      jmp_short_value_type_ok:
3068
	cmp	eax,-80h
3080
	cmp	eax,-80h
3069
	jae	short_jump
3081
	jae	short_jump
3070
	cmp	eax,80h
3082
	cmp	eax,80h
3071
	jae	jump_out_of_range
3083
	jae	jump_out_of_range
3072
      short_jump:
3084
      short_jump:
3073
	stc
3085
	stc
3074
	ret
3086
	ret
3075
      jump_out_of_range:
3087
      jump_out_of_range:
3076
	cmp	[error_line],0
3088
	cmp	[error_line],0
3077
	jne	instruction_assembled
3089
	jne	instruction_assembled
3078
	mov	eax,[current_line]
3090
	mov	eax,[current_line]
3079
	mov	[error_line],eax
3091
	mov	[error_line],eax
3080
	mov	[error],relative_jump_out_of_range
3092
	mov	[error],relative_jump_out_of_range
3081
	jmp	instruction_assembled
3093
	jmp	instruction_assembled
3082
      jmp_far:
3094
      jmp_far:
3083
	cmp	[jump_type],2
3095
	cmp	[jump_type],2
3084
	je	invalid_operand
3096
	je	invalid_operand
3085
	cmp	[code_type],64
3097
	cmp	[code_type],64
3086
	je	illegal_instruction
3098
	je	illegal_instruction
3087
	mov	al,[extended_code]
3099
	mov	al,[extended_code]
3088
	mov	[base_code],al
3100
	mov	[base_code],al
3089
	call	get_word_value
3101
	call	get_word_value
3090
	push	eax
3102
	push	eax
3091
	inc	esi
3103
	inc	esi
3092
	lods	byte [esi]
3104
	lods	byte [esi]
3093
	cmp	al,'('
3105
	cmp	al,'('
3094
	jne	invalid_operand
3106
	jne	invalid_operand
3095
	mov	al,[value_type]
3107
	mov	al,[value_type]
3096
	push	eax [symbol_identifier]
3108
	push	eax [symbol_identifier]
3097
	cmp	byte [esi],'.'
3109
	cmp	byte [esi],'.'
3098
	je	invalid_value
3110
	je	invalid_value
3099
	mov	al,[operand_size]
3111
	mov	al,[operand_size]
3100
	cmp	al,4
3112
	cmp	al,4
3101
	je	jmp_far_16bit
3113
	je	jmp_far_16bit
3102
	cmp	al,6
3114
	cmp	al,6
3103
	je	jmp_far_32bit
3115
	je	jmp_far_32bit
3104
	or	al,al
3116
	or	al,al
3105
	jnz	invalid_operand_size
3117
	jnz	invalid_operand_size
3106
	cmp	[code_type],16
3118
	cmp	[code_type],16
3107
	jne	jmp_far_32bit
3119
	jne	jmp_far_32bit
3108
      jmp_far_16bit:
3120
      jmp_far_16bit:
3109
	call	get_word_value
3121
	call	get_word_value
3110
	mov	ebx,eax
3122
	mov	ebx,eax
3111
	call	operand_16bit
3123
	call	operand_16bit
3112
	call	store_instruction_code
3124
	call	store_instruction_code
3113
	mov	ax,bx
3125
	mov	ax,bx
3114
	call	mark_relocation
3126
	call	mark_relocation
3115
	stos	word [edi]
3127
	stos	word [edi]
3116
      jmp_far_segment:
3128
      jmp_far_segment:
3117
	pop	[symbol_identifier] eax
3129
	pop	[symbol_identifier] eax
3118
	mov	[value_type],al
3130
	mov	[value_type],al
3119
	pop	eax
3131
	pop	eax
3120
	call	mark_relocation
3132
	call	mark_relocation
3121
	stos	word [edi]
3133
	stos	word [edi]
3122
	jmp	instruction_assembled
3134
	jmp	instruction_assembled
3123
      jmp_far_32bit:
3135
      jmp_far_32bit:
3124
	call	get_dword_value
3136
	call	get_dword_value
3125
	mov	ebx,eax
3137
	mov	ebx,eax
3126
	call	operand_32bit
3138
	call	operand_32bit
3127
	call	store_instruction_code
3139
	call	store_instruction_code
3128
	mov	eax,ebx
3140
	mov	eax,ebx
3129
	call	mark_relocation
3141
	call	mark_relocation
3130
	stos	dword [edi]
3142
	stos	dword [edi]
3131
	jmp	jmp_far_segment
3143
	jmp	jmp_far_segment
3132
conditional_jump:
3144
conditional_jump:
3133
	mov	[base_code],al
3145
	mov	[base_code],al
3134
	lods	byte [esi]
3146
	lods	byte [esi]
3135
	call	get_jump_operator
3147
	call	get_jump_operator
3136
	cmp	[jump_type],3
3148
	cmp	[jump_type],3
3137
	je	invalid_operand
3149
	je	invalid_operand
3138
	call	get_size_operator
3150
	call	get_size_operator
3139
	cmp	al,'('
3151
	cmp	al,'('
3140
	jne	invalid_operand
3152
	jne	invalid_operand
3141
	cmp	byte [esi],'.'
3153
	cmp	byte [esi],'.'
3142
	je	invalid_value
3154
	je	invalid_value
3143
	mov	al,[operand_size]
3155
	mov	al,[operand_size]
3144
	cmp	al,2
3156
	cmp	al,2
3145
	je	conditional_jump_16bit
3157
	je	conditional_jump_16bit
3146
	cmp	al,4
3158
	cmp	al,4
3147
	je	conditional_jump_32bit
3159
	je	conditional_jump_32bit
3148
	cmp	al,8
3160
	cmp	al,8
3149
	je	conditional_jump_64bit
3161
	je	conditional_jump_64bit
3150
	or	al,al
3162
	or	al,al
3151
	jnz	invalid_operand_size
3163
	jnz	invalid_operand_size
3152
	cmp	[code_type],16
3164
	cmp	[code_type],16
3153
	je	conditional_jump_16bit
3165
	je	conditional_jump_16bit
3154
	cmp	[code_type],64
3166
	cmp	[code_type],64
3155
	je	conditional_jump_64bit
3167
	je	conditional_jump_64bit
3156
      conditional_jump_32bit:
3168
      conditional_jump_32bit:
3157
	cmp	[code_type],64
3169
	cmp	[code_type],64
3158
	je	invalid_operand_size
3170
	je	invalid_operand_size
3159
	call	get_address_dword_value
3171
	call	get_address_dword_value
3160
	cmp	[code_type],16
3172
	cmp	[code_type],16
3161
	jne	conditional_jump_32bit_prefix_ok
3173
	jne	conditional_jump_32bit_prefix_ok
3162
	mov	byte [edi],66h
3174
	mov	byte [edi],66h
3163
	inc	edi
3175
	inc	edi
3164
      conditional_jump_32bit_prefix_ok:
3176
      conditional_jump_32bit_prefix_ok:
3165
	call	calculate_jump_offset
3177
	call	calculate_jump_offset
3166
	cdq
3178
	cdq
3167
	call	check_for_short_jump
3179
	call	check_for_short_jump
3168
	jc	conditional_jump_short
3180
	jc	conditional_jump_short
3169
      conditional_jump_32bit_store:
3181
      conditional_jump_32bit_store:
3170
	mov	edx,eax
3182
	mov	edx,eax
3171
	sub	edx,4
3183
	sub	edx,4
3172
	mov	ah,[base_code]
3184
	jno	conditional_jump_32bit_range_ok
-
 
3185
	cmp	[code_type],64
-
 
3186
	je	relative_jump_out_of_range
-
 
3187
      conditional_jump_32bit_range_ok:
-
 
3188
	mov	ah,[base_code]
3173
	add	ah,10h
3189
	add	ah,10h
3174
	mov	al,0Fh
3190
	mov	al,0Fh
3175
	stos	word [edi]
3191
	stos	word [edi]
3176
	mov	eax,edx
3192
	mov	eax,edx
3177
	call	mark_relocation
3193
	call	mark_relocation
3178
	stos	dword [edi]
3194
	stos	dword [edi]
3179
	jmp	instruction_assembled
3195
	jmp	instruction_assembled
3180
      conditional_jump_64bit:
3196
      conditional_jump_64bit:
3181
	cmp	[code_type],64
3197
	cmp	[code_type],64
3182
	jne	invalid_operand_size
3198
	jne	invalid_operand_size
3183
	call	get_address_qword_value
3199
	call	get_address_qword_value
3184
	call	calculate_jump_offset
3200
	call	calculate_jump_offset
3185
	mov	ecx,edx
3201
	mov	ecx,edx
3186
	cdq
3202
	cdq
3187
	cmp	edx,ecx
3203
	cmp	edx,ecx
3188
	jne	value_out_of_range
3204
	jne	value_out_of_range
3189
	call	check_for_short_jump
3205
	call	check_for_short_jump
3190
	jnc	conditional_jump_32bit_store
3206
	jnc	conditional_jump_32bit_store
3191
      conditional_jump_short:
3207
      conditional_jump_short:
3192
	mov	ah,al
3208
	mov	ah,al
3193
	mov	al,[base_code]
3209
	mov	al,[base_code]
3194
	stos	word [edi]
3210
	stos	word [edi]
3195
	jmp	instruction_assembled
3211
	jmp	instruction_assembled
3196
      conditional_jump_16bit:
3212
      conditional_jump_16bit:
3197
	call	get_address_word_value
3213
	call	get_address_word_value
3198
	cmp	[code_type],16
3214
	cmp	[code_type],16
3199
	je	conditional_jump_16bit_prefix_ok
3215
	je	conditional_jump_16bit_prefix_ok
3200
	mov	byte [edi],66h
3216
	mov	byte [edi],66h
3201
	inc	edi
3217
	inc	edi
3202
      conditional_jump_16bit_prefix_ok:
3218
      conditional_jump_16bit_prefix_ok:
3203
	call	calculate_jump_offset
3219
	call	calculate_jump_offset
3204
	cwde
3220
	cwde
3205
	cdq
3221
	cdq
3206
	call	check_for_short_jump
3222
	call	check_for_short_jump
3207
	jc	conditional_jump_short
3223
	jc	conditional_jump_short
3208
	cmp	[value_type],0
3224
	cmp	[value_type],0
3209
	jne	invalid_use_of_symbol
3225
	jne	invalid_use_of_symbol
3210
	mov	edx,eax
3226
	mov	edx,eax
3211
	sub	edx,2
3227
	sub	dx,2
3212
	mov	ah,[base_code]
3228
	mov	ah,[base_code]
3213
	add	ah,10h
3229
	add	ah,10h
3214
	mov	al,0Fh
3230
	mov	al,0Fh
3215
	stos	word [edi]
3231
	stos	word [edi]
3216
	mov	eax,edx
3232
	mov	eax,edx
3217
	stos	word [edi]
3233
	stos	word [edi]
3218
	jmp	instruction_assembled
3234
	jmp	instruction_assembled
3219
loop_instruction_16bit:
3235
loop_instruction_16bit:
3220
	cmp	[code_type],64
3236
	cmp	[code_type],64
3221
	je	illegal_instruction
3237
	je	illegal_instruction
3222
	cmp	[code_type],16
3238
	cmp	[code_type],16
3223
	je	loop_instruction
3239
	je	loop_instruction
3224
	mov	[operand_prefix],67h
3240
	mov	[operand_prefix],67h
3225
	jmp	loop_instruction
3241
	jmp	loop_instruction
3226
loop_instruction_32bit:
3242
loop_instruction_32bit:
3227
	cmp	[code_type],32
3243
	cmp	[code_type],32
3228
	je	loop_instruction
3244
	je	loop_instruction
3229
	mov	[operand_prefix],67h
3245
	mov	[operand_prefix],67h
3230
      jmp     loop_instruction
3246
      jmp     loop_instruction
3231
loop_instruction_64bit:
3247
loop_instruction_64bit:
3232
	cmp	[code_type],64
3248
	cmp	[code_type],64
3233
	jne	illegal_instruction
3249
	jne	illegal_instruction
3234
loop_instruction:
3250
loop_instruction:
3235
	mov	[base_code],al
3251
	mov	[base_code],al
3236
	lods	byte [esi]
3252
	lods	byte [esi]
3237
	call	get_jump_operator
3253
	call	get_jump_operator
3238
	cmp	[jump_type],1
3254
	cmp	[jump_type],1
3239
	ja	invalid_operand
3255
	ja	invalid_operand
3240
	call	get_size_operator
3256
	call	get_size_operator
3241
	cmp	al,'('
3257
	cmp	al,'('
3242
	jne	invalid_operand
3258
	jne	invalid_operand
3243
	cmp	byte [esi],'.'
3259
	cmp	byte [esi],'.'
3244
	je	invalid_value
3260
	je	invalid_value
3245
	mov	al,[operand_size]
3261
	mov	al,[operand_size]
3246
	cmp	al,2
3262
	cmp	al,2
3247
	je	loop_jump_16bit
3263
	je	loop_jump_16bit
3248
	cmp	al,4
3264
	cmp	al,4
3249
	je	loop_jump_32bit
3265
	je	loop_jump_32bit
3250
	cmp	al,8
3266
	cmp	al,8
3251
	je	loop_jump_64bit
3267
	je	loop_jump_64bit
3252
	or	al,al
3268
	or	al,al
3253
	jnz	invalid_operand_size
3269
	jnz	invalid_operand_size
3254
	cmp	[code_type],16
3270
	cmp	[code_type],16
3255
	je	loop_jump_16bit
3271
	je	loop_jump_16bit
3256
	cmp	[code_type],64
3272
	cmp	[code_type],64
3257
	je	loop_jump_64bit
3273
	je	loop_jump_64bit
3258
      loop_jump_32bit:
3274
      loop_jump_32bit:
3259
	cmp	[code_type],64
3275
	cmp	[code_type],64
3260
	je	invalid_operand_size
3276
	je	invalid_operand_size
3261
	call	get_address_dword_value
3277
	call	get_address_dword_value
3262
	cmp	[code_type],16
3278
	cmp	[code_type],16
3263
	jne	loop_jump_32bit_prefix_ok
3279
	jne	loop_jump_32bit_prefix_ok
3264
	mov	byte [edi],66h
3280
	mov	byte [edi],66h
3265
	inc	edi
3281
	inc	edi
3266
      loop_jump_32bit_prefix_ok:
3282
      loop_jump_32bit_prefix_ok:
3267
	call	loop_counter_size
3283
	call	loop_counter_size
3268
	call	calculate_jump_offset
3284
	call	calculate_jump_offset
3269
	cdq
3285
	cdq
3270
      make_loop_jump:
3286
      make_loop_jump:
3271
	call	check_for_short_jump
3287
	call	check_for_short_jump
3272
	jc	conditional_jump_short
3288
	jc	conditional_jump_short
3273
	jmp	jump_out_of_range
3289
	scas	word [edi]
-
 
3290
	jmp	jump_out_of_range
3274
      loop_counter_size:
3291
      loop_counter_size:
3275
	cmp	[operand_prefix],0
3292
	cmp	[operand_prefix],0
3276
	je	loop_counter_size_ok
3293
	je	loop_counter_size_ok
3277
	push	eax
3294
	push	eax
3278
	mov	al,[operand_prefix]
3295
	mov	al,[operand_prefix]
3279
	stos	byte [edi]
3296
	stos	byte [edi]
3280
	pop	eax
3297
	pop	eax
3281
      loop_counter_size_ok:
3298
      loop_counter_size_ok:
3282
	ret
3299
	ret
3283
      loop_jump_64bit:
3300
      loop_jump_64bit:
3284
	cmp	[code_type],64
3301
	cmp	[code_type],64
3285
	jne	invalid_operand_size
3302
	jne	invalid_operand_size
3286
	call	get_address_qword_value
3303
	call	get_address_qword_value
3287
	call	loop_counter_size
3304
	call	loop_counter_size
3288
	call	calculate_jump_offset
3305
	call	calculate_jump_offset
3289
	mov	ecx,edx
3306
	mov	ecx,edx
3290
	cdq
3307
	cdq
3291
	cmp	edx,ecx
3308
	cmp	edx,ecx
3292
	jne	value_out_of_range
3309
	jne	value_out_of_range
3293
	jmp	make_loop_jump
3310
	jmp	make_loop_jump
3294
      loop_jump_16bit:
3311
      loop_jump_16bit:
3295
	call	get_address_word_value
3312
	call	get_address_word_value
3296
	cmp	[code_type],16
3313
	cmp	[code_type],16
3297
	je	loop_jump_16bit_prefix_ok
3314
	je	loop_jump_16bit_prefix_ok
3298
	mov	byte [edi],66h
3315
	mov	byte [edi],66h
3299
	inc	edi
3316
	inc	edi
3300
      loop_jump_16bit_prefix_ok:
3317
      loop_jump_16bit_prefix_ok:
3301
	call	loop_counter_size
3318
	call	loop_counter_size
3302
	call	calculate_jump_offset
3319
	call	calculate_jump_offset
3303
	cwde
3320
	cwde
3304
	cdq
3321
	cdq
3305
	jmp	make_loop_jump
3322
	jmp	make_loop_jump
3306
 
3323
 
3307
movs_instruction:
3324
movs_instruction:
3308
	lods	byte [esi]
3325
	lods	byte [esi]
3309
	call	get_size_operator
3326
	call	get_size_operator
3310
	cmp	al,'['
3327
	cmp	al,'['
3311
	jne	invalid_operand
3328
	jne	invalid_operand
3312
	call	get_address
3329
	call	get_address
3313
	or	eax,eax
3330
	or	eax,eax
3314
	jnz	invalid_address
3331
	jnz	invalid_address
3315
	or	bl,ch
3332
	or	bl,ch
3316
	jnz	invalid_address
3333
	jnz	invalid_address
3317
	cmp	[segment_register],1
3334
	cmp	[segment_register],1
3318
	ja	invalid_address
3335
	ja	invalid_address
3319
	push	ebx
3336
	push	ebx
3320
	lods	byte [esi]
3337
	lods	byte [esi]
3321
	cmp	al,','
3338
	cmp	al,','
3322
	jne	invalid_operand
3339
	jne	invalid_operand
3323
	lods	byte [esi]
3340
	lods	byte [esi]
3324
	call	get_size_operator
3341
	call	get_size_operator
3325
	cmp	al,'['
3342
	cmp	al,'['
3326
	jne	invalid_operand
3343
	jne	invalid_operand
3327
	call	get_address
3344
	call	get_address
3328
	pop	edx
3345
	pop	edx
3329
	or	eax,eax
3346
	or	eax,eax
3330
	jnz	invalid_address
3347
	jnz	invalid_address
3331
	or	bl,ch
3348
	or	bl,ch
3332
	jnz	invalid_address
3349
	jnz	invalid_address
3333
	mov	al,dh
3350
	mov	al,dh
3334
	mov	ah,bh
3351
	mov	ah,bh
3335
	shr	al,4
3352
	shr	al,4
3336
	shr	ah,4
3353
	shr	ah,4
3337
	cmp	al,ah
3354
	cmp	al,ah
3338
	jne	address_sizes_do_not_agree
3355
	jne	address_sizes_do_not_agree
3339
	and	bh,111b
3356
	and	bh,111b
3340
	and	dh,111b
3357
	and	dh,111b
3341
	cmp	bh,6
3358
	cmp	bh,6
3342
	jne	invalid_address
3359
	jne	invalid_address
3343
	cmp	dh,7
3360
	cmp	dh,7
3344
	jne	invalid_address
3361
	jne	invalid_address
3345
	cmp	al,2
3362
	cmp	al,2
3346
	je	movs_address_16bit
3363
	je	movs_address_16bit
3347
	cmp	al,4
3364
	cmp	al,4
3348
	je	movs_address_32bit
3365
	je	movs_address_32bit
3349
	cmp	[code_type],64
3366
	cmp	[code_type],64
3350
	jne	invalid_address_size
3367
	jne	invalid_address_size
3351
	jmp	movs_store
3368
	jmp	movs_store
3352
      movs_address_32bit:
3369
      movs_address_32bit:
3353
	call	address_32bit_prefix
3370
	call	address_32bit_prefix
3354
	jmp	movs_store
3371
	jmp	movs_store
3355
      movs_address_16bit:
3372
      movs_address_16bit:
3356
	cmp	[code_type],64
3373
	cmp	[code_type],64
3357
	je	invalid_address_size
3374
	je	invalid_address_size
3358
	call	address_16bit_prefix
3375
	call	address_16bit_prefix
3359
      movs_store:
3376
      movs_store:
3360
	cmp	[segment_register],4
3377
	cmp	[segment_register],4
3361
	je	movs_segment_ok
3378
	je	movs_segment_ok
3362
	call	store_segment_prefix
3379
	call	store_segment_prefix
3363
      movs_segment_ok:
3380
      movs_segment_ok:
3364
	mov	al,0A4h
3381
	mov	al,0A4h
3365
      movs_check_size:
3382
      movs_check_size:
3366
	mov	bl,[operand_size]
3383
	mov	bl,[operand_size]
3367
	cmp	bl,1
3384
	cmp	bl,1
3368
	je	simple_instruction
3385
	je	simple_instruction
3369
	inc	al
3386
	inc	al
3370
	cmp	bl,2
3387
	cmp	bl,2
3371
	je	simple_instruction_16bit
3388
	je	simple_instruction_16bit
3372
	cmp	bl,4
3389
	cmp	bl,4
3373
	je	simple_instruction_32bit
3390
	je	simple_instruction_32bit
3374
	cmp	bl,8
3391
	cmp	bl,8
3375
	je	simple_instruction_64bit
3392
	je	simple_instruction_64bit
3376
	or	bl,bl
3393
	or	bl,bl
3377
	jnz	invalid_operand_size
3394
	jnz	invalid_operand_size
3378
	cmp	[error_line],0
3395
	cmp	[error_line],0
3379
	jne	simple_instruction
3396
	jne	simple_instruction
3380
	mov	ebx,[current_line]
3397
	mov	ebx,[current_line]
3381
	mov	[error_line],ebx
3398
	mov	[error_line],ebx
3382
	mov	[error],operand_size_not_specified
3399
	mov	[error],operand_size_not_specified
3383
	jmp	simple_instruction
3400
	jmp	simple_instruction
3384
lods_instruction:
3401
lods_instruction:
3385
	lods	byte [esi]
3402
	lods	byte [esi]
3386
	call	get_size_operator
3403
	call	get_size_operator
3387
	cmp	al,'['
3404
	cmp	al,'['
3388
	jne	invalid_operand
3405
	jne	invalid_operand
3389
	call	get_address
3406
	call	get_address
3390
	or	eax,eax
3407
	or	eax,eax
3391
	jnz	invalid_address
3408
	jnz	invalid_address
3392
	or	bl,ch
3409
	or	bl,ch
3393
	jnz	invalid_address
3410
	jnz	invalid_address
3394
	cmp	bh,26h
3411
	cmp	bh,26h
3395
	je	lods_address_16bit
3412
	je	lods_address_16bit
3396
	cmp	bh,46h
3413
	cmp	bh,46h
3397
	je	lods_address_32bit
3414
	je	lods_address_32bit
3398
	cmp	bh,86h
3415
	cmp	bh,86h
3399
	jne	invalid_address
3416
	jne	invalid_address
3400
	cmp	[code_type],64
3417
	cmp	[code_type],64
3401
	jne	invalid_address_size
3418
	jne	invalid_address_size
3402
	jmp	lods_store
3419
	jmp	lods_store
3403
      lods_address_32bit:
3420
      lods_address_32bit:
3404
	call	address_32bit_prefix
3421
	call	address_32bit_prefix
3405
	jmp	lods_store
3422
	jmp	lods_store
3406
      lods_address_16bit:
3423
      lods_address_16bit:
3407
	cmp	[code_type],64
3424
	cmp	[code_type],64
3408
	je	invalid_address_size
3425
	je	invalid_address_size
3409
	call	address_16bit_prefix
3426
	call	address_16bit_prefix
3410
      lods_store:
3427
      lods_store:
3411
	cmp	[segment_register],4
3428
	cmp	[segment_register],4
3412
	je	lods_segment_ok
3429
	je	lods_segment_ok
3413
	call	store_segment_prefix
3430
	call	store_segment_prefix
3414
      lods_segment_ok:
3431
      lods_segment_ok:
3415
	mov	al,0ACh
3432
	mov	al,0ACh
3416
	jmp	movs_check_size
3433
	jmp	movs_check_size
3417
stos_instruction:
3434
stos_instruction:
3418
	mov	[base_code],al
3435
	mov	[base_code],al
3419
	lods	byte [esi]
3436
	lods	byte [esi]
3420
	call	get_size_operator
3437
	call	get_size_operator
3421
	cmp	al,'['
3438
	cmp	al,'['
3422
	jne	invalid_operand
3439
	jne	invalid_operand
3423
	call	get_address
3440
	call	get_address
3424
	or	eax,eax
3441
	or	eax,eax
3425
	jnz	invalid_address
3442
	jnz	invalid_address
3426
	or	bl,ch
3443
	or	bl,ch
3427
	jnz	invalid_address
3444
	jnz	invalid_address
3428
	cmp	bh,27h
3445
	cmp	bh,27h
3429
	je	stos_address_16bit
3446
	je	stos_address_16bit
3430
	cmp	bh,47h
3447
	cmp	bh,47h
3431
	je	stos_address_32bit
3448
	je	stos_address_32bit
3432
	cmp	bh,87h
3449
	cmp	bh,87h
3433
	jne	invalid_address
3450
	jne	invalid_address
3434
	cmp	[code_type],64
3451
	cmp	[code_type],64
3435
	jne	invalid_address_size
3452
	jne	invalid_address_size
3436
	jmp	stos_store
3453
	jmp	stos_store
3437
      stos_address_32bit:
3454
      stos_address_32bit:
3438
	call	address_32bit_prefix
3455
	call	address_32bit_prefix
3439
	jmp	stos_store
3456
	jmp	stos_store
3440
      stos_address_16bit:
3457
      stos_address_16bit:
3441
	cmp	[code_type],64
3458
	cmp	[code_type],64
3442
	je	invalid_address_size
3459
	je	invalid_address_size
3443
	call	address_16bit_prefix
3460
	call	address_16bit_prefix
3444
      stos_store:
3461
      stos_store:
3445
	cmp	[segment_register],1
3462
	cmp	[segment_register],1
3446
	ja	invalid_address
3463
	ja	invalid_address
3447
	mov	al,[base_code]
3464
	mov	al,[base_code]
3448
	jmp	movs_check_size
3465
	jmp	movs_check_size
3449
cmps_instruction:
3466
cmps_instruction:
3450
	lods	byte [esi]
3467
	lods	byte [esi]
3451
	call	get_size_operator
3468
	call	get_size_operator
3452
	cmp	al,'['
3469
	cmp	al,'['
3453
	jne	invalid_operand
3470
	jne	invalid_operand
3454
	call	get_address
3471
	call	get_address
3455
	or	eax,eax
3472
	or	eax,eax
3456
	jnz	invalid_address
3473
	jnz	invalid_address
3457
	or	bl,ch
3474
	or	bl,ch
3458
	jnz	invalid_address
3475
	jnz	invalid_address
3459
	mov	al,[segment_register]
3476
	mov	al,[segment_register]
3460
	push	eax ebx
3477
	push	eax ebx
3461
	lods	byte [esi]
3478
	lods	byte [esi]
3462
	cmp	al,','
3479
	cmp	al,','
3463
	jne	invalid_operand
3480
	jne	invalid_operand
3464
	lods	byte [esi]
3481
	lods	byte [esi]
3465
	call	get_size_operator
3482
	call	get_size_operator
3466
	cmp	al,'['
3483
	cmp	al,'['
3467
	jne	invalid_operand
3484
	jne	invalid_operand
3468
	call	get_address
3485
	call	get_address
3469
	or	eax,eax
3486
	or	eax,eax
3470
	jnz	invalid_address
3487
	jnz	invalid_address
3471
	or	bl,ch
3488
	or	bl,ch
3472
	jnz	invalid_address
3489
	jnz	invalid_address
3473
	pop	edx eax
3490
	pop	edx eax
3474
	cmp	[segment_register],1
3491
	cmp	[segment_register],1
3475
	ja	invalid_address
3492
	ja	invalid_address
3476
	mov	[segment_register],al
3493
	mov	[segment_register],al
3477
	mov	al,dh
3494
	mov	al,dh
3478
	mov	ah,bh
3495
	mov	ah,bh
3479
	shr	al,4
3496
	shr	al,4
3480
	shr	ah,4
3497
	shr	ah,4
3481
	cmp	al,ah
3498
	cmp	al,ah
3482
	jne	address_sizes_do_not_agree
3499
	jne	address_sizes_do_not_agree
3483
	and	bh,111b
3500
	and	bh,111b
3484
	and	dh,111b
3501
	and	dh,111b
3485
	cmp	bh,7
3502
	cmp	bh,7
3486
	jne	invalid_address
3503
	jne	invalid_address
3487
	cmp	dh,6
3504
	cmp	dh,6
3488
	jne	invalid_address
3505
	jne	invalid_address
3489
	cmp	al,2
3506
	cmp	al,2
3490
	je	cmps_address_16bit
3507
	je	cmps_address_16bit
3491
	cmp	al,4
3508
	cmp	al,4
3492
	je	cmps_address_32bit
3509
	je	cmps_address_32bit
3493
	cmp	[code_type],64
3510
	cmp	[code_type],64
3494
	jne	invalid_address_size
3511
	jne	invalid_address_size
3495
	jmp	cmps_store
3512
	jmp	cmps_store
3496
      cmps_address_32bit:
3513
      cmps_address_32bit:
3497
	call	address_32bit_prefix
3514
	call	address_32bit_prefix
3498
	jmp	cmps_store
3515
	jmp	cmps_store
3499
      cmps_address_16bit:
3516
      cmps_address_16bit:
3500
	cmp	[code_type],64
3517
	cmp	[code_type],64
3501
	je	invalid_address_size
3518
	je	invalid_address_size
3502
	call	address_16bit_prefix
3519
	call	address_16bit_prefix
3503
      cmps_store:
3520
      cmps_store:
3504
	cmp	[segment_register],4
3521
	cmp	[segment_register],4
3505
	je	cmps_segment_ok
3522
	je	cmps_segment_ok
3506
	call	store_segment_prefix
3523
	call	store_segment_prefix
3507
      cmps_segment_ok:
3524
      cmps_segment_ok:
3508
	mov	al,0A6h
3525
	mov	al,0A6h
3509
	jmp	movs_check_size
3526
	jmp	movs_check_size
3510
ins_instruction:
3527
ins_instruction:
3511
	lods	byte [esi]
3528
	lods	byte [esi]
3512
	call	get_size_operator
3529
	call	get_size_operator
3513
	cmp	al,'['
3530
	cmp	al,'['
3514
	jne	invalid_operand
3531
	jne	invalid_operand
3515
	call	get_address
3532
	call	get_address
3516
	or	eax,eax
3533
	or	eax,eax
3517
	jnz	invalid_address
3534
	jnz	invalid_address
3518
	or	bl,ch
3535
	or	bl,ch
3519
	jnz	invalid_address
3536
	jnz	invalid_address
3520
	cmp	bh,27h
3537
	cmp	bh,27h
3521
	je	ins_address_16bit
3538
	je	ins_address_16bit
3522
	cmp	bh,47h
3539
	cmp	bh,47h
3523
	je	ins_address_32bit
3540
	je	ins_address_32bit
3524
	cmp	bh,87h
3541
	cmp	bh,87h
3525
	jne	invalid_address
3542
	jne	invalid_address
3526
	cmp	[code_type],64
3543
	cmp	[code_type],64
3527
	jne	invalid_address_size
3544
	jne	invalid_address_size
3528
	jmp	ins_store
3545
	jmp	ins_store
3529
      ins_address_32bit:
3546
      ins_address_32bit:
3530
	call	address_32bit_prefix
3547
	call	address_32bit_prefix
3531
	jmp	ins_store
3548
	jmp	ins_store
3532
      ins_address_16bit:
3549
      ins_address_16bit:
3533
	cmp	[code_type],64
3550
	cmp	[code_type],64
3534
	je	invalid_address_size
3551
	je	invalid_address_size
3535
	call	address_16bit_prefix
3552
	call	address_16bit_prefix
3536
      ins_store:
3553
      ins_store:
3537
	cmp	[segment_register],1
3554
	cmp	[segment_register],1
3538
	ja	invalid_address
3555
	ja	invalid_address
3539
	lods	byte [esi]
3556
	lods	byte [esi]
3540
	cmp	al,','
3557
	cmp	al,','
3541
	jne	invalid_operand
3558
	jne	invalid_operand
3542
	lods	byte [esi]
3559
	lods	byte [esi]
3543
	cmp	al,10h
3560
	cmp	al,10h
3544
	jne	invalid_operand
3561
	jne	invalid_operand
3545
	lods	byte [esi]
3562
	lods	byte [esi]
3546
	cmp	al,22h
3563
	cmp	al,22h
3547
	jne	invalid_operand
3564
	jne	invalid_operand
3548
	mov	al,6Ch
3565
	mov	al,6Ch
3549
      ins_check_size:
3566
      ins_check_size:
3550
	cmp	[operand_size],8
3567
	cmp	[operand_size],8
3551
	jne	movs_check_size
3568
	jne	movs_check_size
3552
	jmp	invalid_operand_size
3569
	jmp	invalid_operand_size
3553
outs_instruction:
3570
outs_instruction:
3554
	lods	byte [esi]
3571
	lods	byte [esi]
3555
	cmp	al,10h
3572
	cmp	al,10h
3556
	jne	invalid_operand
3573
	jne	invalid_operand
3557
	lods	byte [esi]
3574
	lods	byte [esi]
3558
	cmp	al,22h
3575
	cmp	al,22h
3559
	jne	invalid_operand
3576
	jne	invalid_operand
3560
	lods	byte [esi]
3577
	lods	byte [esi]
3561
	cmp	al,','
3578
	cmp	al,','
3562
	jne	invalid_operand
3579
	jne	invalid_operand
3563
	lods	byte [esi]
3580
	lods	byte [esi]
3564
	call	get_size_operator
3581
	call	get_size_operator
3565
	cmp	al,'['
3582
	cmp	al,'['
3566
	jne	invalid_operand
3583
	jne	invalid_operand
3567
	call	get_address
3584
	call	get_address
3568
	or	eax,eax
3585
	or	eax,eax
3569
	jnz	invalid_address
3586
	jnz	invalid_address
3570
	or	bl,ch
3587
	or	bl,ch
3571
	jnz	invalid_address
3588
	jnz	invalid_address
3572
	cmp	bh,26h
3589
	cmp	bh,26h
3573
	je	outs_address_16bit
3590
	je	outs_address_16bit
3574
	cmp	bh,46h
3591
	cmp	bh,46h
3575
	je	outs_address_32bit
3592
	je	outs_address_32bit
3576
	cmp	bh,86h
3593
	cmp	bh,86h
3577
	jne	invalid_address
3594
	jne	invalid_address
3578
	cmp	[code_type],64
3595
	cmp	[code_type],64
3579
	jne	invalid_address_size
3596
	jne	invalid_address_size
3580
	jmp	outs_store
3597
	jmp	outs_store
3581
      outs_address_32bit:
3598
      outs_address_32bit:
3582
	call	address_32bit_prefix
3599
	call	address_32bit_prefix
3583
	jmp	outs_store
3600
	jmp	outs_store
3584
      outs_address_16bit:
3601
      outs_address_16bit:
3585
	cmp	[code_type],64
3602
	cmp	[code_type],64
3586
	je	invalid_address_size
3603
	je	invalid_address_size
3587
	call	address_16bit_prefix
3604
	call	address_16bit_prefix
3588
      outs_store:
3605
      outs_store:
3589
	cmp	[segment_register],4
3606
	cmp	[segment_register],4
3590
	je	outs_segment_ok
3607
	je	outs_segment_ok
3591
	call	store_segment_prefix
3608
	call	store_segment_prefix
3592
      outs_segment_ok:
3609
      outs_segment_ok:
3593
	mov	al,6Eh
3610
	mov	al,6Eh
3594
	jmp	ins_check_size
3611
	jmp	ins_check_size
3595
xlat_instruction:
3612
xlat_instruction:
3596
	lods	byte [esi]
3613
	lods	byte [esi]
3597
	call	get_size_operator
3614
	call	get_size_operator
3598
	cmp	al,'['
3615
	cmp	al,'['
3599
	jne	invalid_operand
3616
	jne	invalid_operand
3600
	call	get_address
3617
	call	get_address
3601
	or	eax,eax
3618
	or	eax,eax
3602
	jnz	invalid_address
3619
	jnz	invalid_address
3603
	or	bl,ch
3620
	or	bl,ch
3604
	jnz	invalid_address
3621
	jnz	invalid_address
3605
	cmp	bh,23h
3622
	cmp	bh,23h
3606
	je	xlat_address_16bit
3623
	je	xlat_address_16bit
3607
	cmp	bh,43h
3624
	cmp	bh,43h
3608
	je	xlat_address_32bit
3625
	je	xlat_address_32bit
3609
	cmp	bh,83h
3626
	cmp	bh,83h
3610
	jne	invalid_address
3627
	jne	invalid_address
3611
	cmp	[code_type],64
3628
	cmp	[code_type],64
3612
	jne	invalid_address_size
3629
	jne	invalid_address_size
3613
	jmp	xlat_store
3630
	jmp	xlat_store
3614
      xlat_address_32bit:
3631
      xlat_address_32bit:
3615
	call	address_32bit_prefix
3632
	call	address_32bit_prefix
3616
	jmp	xlat_store
3633
	jmp	xlat_store
3617
      xlat_address_16bit:
3634
      xlat_address_16bit:
3618
	cmp	[code_type],64
3635
	cmp	[code_type],64
3619
	je	invalid_address_size
3636
	je	invalid_address_size
3620
	call	address_16bit_prefix
3637
	call	address_16bit_prefix
3621
      xlat_store:
3638
      xlat_store:
3622
	call	store_segment_prefix_if_necessary
3639
	call	store_segment_prefix_if_necessary
3623
	mov	al,0D7h
3640
	mov	al,0D7h
3624
	cmp	[operand_size],1
3641
	cmp	[operand_size],1
3625
	jbe	simple_instruction
3642
	jbe	simple_instruction
3626
	jmp	invalid_operand_size
3643
	jmp	invalid_operand_size
3627
 
3644
 
3628
pm_word_instruction:
3645
pm_word_instruction:
3629
	mov	ah,al
3646
	mov	ah,al
3630
	shr	ah,4
3647
	shr	ah,4
3631
	and	al,111b
3648
	and	al,111b
3632
	mov	[base_code],0Fh
3649
	mov	[base_code],0Fh
3633
	mov	[extended_code],ah
3650
	mov	[extended_code],ah
3634
	mov	[postbyte_register],al
3651
	mov	[postbyte_register],al
3635
	lods	byte [esi]
3652
	lods	byte [esi]
3636
	call	get_size_operator
3653
	call	get_size_operator
3637
	cmp	al,10h
3654
	cmp	al,10h
3638
	je	pm_reg
3655
	je	pm_reg
3639
      pm_mem:
3656
      pm_mem:
3640
	cmp	al,'['
3657
	cmp	al,'['
3641
	jne	invalid_operand
3658
	jne	invalid_operand
3642
	call	get_address
3659
	call	get_address
3643
	mov	al,[operand_size]
3660
	mov	al,[operand_size]
3644
	cmp	al,2
3661
	cmp	al,2
3645
	je	pm_mem_store
3662
	je	pm_mem_store
3646
	or	al,al
3663
	or	al,al
3647
	jnz	invalid_operand_size
3664
	jnz	invalid_operand_size
3648
      pm_mem_store:
3665
      pm_mem_store:
3649
	jmp	instruction_ready
3666
	jmp	instruction_ready
3650
      pm_reg:
3667
      pm_reg:
3651
	lods	byte [esi]
3668
	lods	byte [esi]
3652
	call	convert_register
3669
	call	convert_register
3653
	mov	bl,al
3670
	mov	bl,al
3654
	cmp	ah,2
3671
	cmp	ah,2
3655
	jne	invalid_operand_size
3672
	jne	invalid_operand_size
3656
	jmp	nomem_instruction_ready
3673
	jmp	nomem_instruction_ready
3657
pm_store_word_instruction:
3674
pm_store_word_instruction:
3658
	mov	ah,al
3675
	mov	ah,al
3659
	shr	ah,4
3676
	shr	ah,4
3660
	and	al,111b
3677
	and	al,111b
3661
	mov	[base_code],0Fh
3678
	mov	[base_code],0Fh
3662
	mov	[extended_code],ah
3679
	mov	[extended_code],ah
3663
	mov	[postbyte_register],al
3680
	mov	[postbyte_register],al
3664
	lods	byte [esi]
3681
	lods	byte [esi]
3665
	call	get_size_operator
3682
	call	get_size_operator
3666
	cmp	al,10h
3683
	cmp	al,10h
3667
	jne	pm_mem
3684
	jne	pm_mem
3668
	lods	byte [esi]
3685
	lods	byte [esi]
3669
	call	convert_register
3686
	call	convert_register
3670
	mov	bl,al
3687
	mov	bl,al
3671
	mov	al,ah
3688
	mov	al,ah
3672
	call	operand_autodetect
3689
	call	operand_autodetect
3673
	jmp	nomem_instruction_ready
3690
	jmp	nomem_instruction_ready
3674
lgdt_instruction:
3691
lgdt_instruction:
3675
	mov	[base_code],0Fh
3692
	mov	[base_code],0Fh
3676
	mov	[extended_code],1
3693
	mov	[extended_code],1
3677
	mov	[postbyte_register],al
3694
	mov	[postbyte_register],al
3678
	lods	byte [esi]
3695
	lods	byte [esi]
3679
	call	get_size_operator
3696
	call	get_size_operator
3680
	cmp	al,'['
3697
	cmp	al,'['
3681
	jne	invalid_operand
3698
	jne	invalid_operand
3682
	call	get_address
3699
	call	get_address
3683
	mov	al,[operand_size]
3700
	mov	al,[operand_size]
3684
	cmp	al,6
3701
	cmp	al,6
3685
	je	lgdt_mem_48bit
3702
	je	lgdt_mem_48bit
3686
	cmp	al,10
3703
	cmp	al,10
3687
	je	lgdt_mem_80bit
3704
	je	lgdt_mem_80bit
3688
	or	al,al
3705
	or	al,al
3689
	jnz	invalid_operand_size
3706
	jnz	invalid_operand_size
3690
	jmp	lgdt_mem_store
3707
	jmp	lgdt_mem_store
3691
      lgdt_mem_80bit:
3708
      lgdt_mem_80bit:
3692
	cmp	[code_type],64
3709
	cmp	[code_type],64
3693
	jne	illegal_instruction
3710
	jne	illegal_instruction
3694
	jmp	lgdt_mem_store
3711
	jmp	lgdt_mem_store
3695
      lgdt_mem_48bit:
3712
      lgdt_mem_48bit:
3696
	cmp	[code_type],64
3713
	cmp	[code_type],64
3697
	je	illegal_instruction
3714
	je	illegal_instruction
3698
	cmp	[postbyte_register],2
3715
	cmp	[postbyte_register],2
3699
	jb	lgdt_mem_store
3716
	jb	lgdt_mem_store
3700
	call	operand_32bit
3717
	call	operand_32bit
3701
      lgdt_mem_store:
3718
      lgdt_mem_store:
3702
	jmp	instruction_ready
3719
	jmp	instruction_ready
3703
lar_instruction:
3720
lar_instruction:
3704
	mov	[extended_code],al
3721
	mov	[extended_code],al
3705
	mov	[base_code],0Fh
3722
	mov	[base_code],0Fh
3706
	lods	byte [esi]
3723
	lods	byte [esi]
3707
	call	get_size_operator
3724
	call	get_size_operator
3708
	cmp	al,10h
3725
	cmp	al,10h
3709
	jne	invalid_operand
3726
	jne	invalid_operand
3710
	lods	byte [esi]
3727
	lods	byte [esi]
3711
	call	convert_register
3728
	call	convert_register
3712
	mov	[postbyte_register],al
3729
	mov	[postbyte_register],al
3713
	lods	byte [esi]
3730
	lods	byte [esi]
3714
	cmp	al,','
3731
	cmp	al,','
3715
	jne	invalid_operand
3732
	jne	invalid_operand
3716
	xor	al,al
3733
	xor	al,al
3717
	xchg	al,[operand_size]
3734
	xchg	al,[operand_size]
3718
	call	operand_autodetect
3735
	call	operand_autodetect
3719
	lods	byte [esi]
3736
	lods	byte [esi]
3720
	call	get_size_operator
3737
	call	get_size_operator
3721
	cmp	al,10h
3738
	cmp	al,10h
3722
	je	lar_reg_reg
3739
	je	lar_reg_reg
3723
	cmp	al,'['
3740
	cmp	al,'['
3724
	jne	invalid_operand
3741
	jne	invalid_operand
3725
	call	get_address
3742
	call	get_address
3726
	mov	al,[operand_size]
3743
	mov	al,[operand_size]
3727
	or	al,al
3744
	or	al,al
3728
	jz	lar_reg_mem
3745
	jz	lar_reg_mem
3729
	cmp	al,2
3746
	cmp	al,2
3730
	jne	invalid_operand_size
3747
	jne	invalid_operand_size
3731
      lar_reg_mem:
3748
      lar_reg_mem:
3732
	jmp	instruction_ready
3749
	jmp	instruction_ready
3733
      lar_reg_reg:
3750
      lar_reg_reg:
3734
	lods	byte [esi]
3751
	lods	byte [esi]
3735
	call	convert_register
3752
	call	convert_register
3736
	cmp	ah,2
3753
	cmp	ah,2
3737
	jne	invalid_operand_size
3754
	jne	invalid_operand_size
3738
	mov	bl,al
3755
	mov	bl,al
3739
	jmp	nomem_instruction_ready
3756
	jmp	nomem_instruction_ready
3740
invlpg_instruction:
3757
invlpg_instruction:
3741
	mov	[base_code],0Fh
3758
	mov	[base_code],0Fh
3742
	mov	[extended_code],1
3759
	mov	[extended_code],1
3743
	mov	[postbyte_register],7
3760
	mov	[postbyte_register],7
3744
	lods	byte [esi]
3761
	lods	byte [esi]
3745
	call	get_size_operator
3762
	call	get_size_operator
3746
	cmp	al,'['
3763
	cmp	al,'['
3747
	jne	invalid_operand
3764
	jne	invalid_operand
3748
	call	get_address
3765
	call	get_address
3749
	jmp	instruction_ready
3766
	jmp	instruction_ready
3750
swapgs_instruction:
3767
swapgs_instruction:
3751
	mov	[base_code],0Fh
3768
	cmp	[code_type],64
-
 
3769
	jne	illegal_instruction
-
 
3770
rdtscp_instruction:
-
 
3771
	mov	[base_code],0Fh
3752
	mov	[extended_code],1
3772
	mov	[extended_code],1
3753
	mov	[postbyte_register],7
3773
	mov	[postbyte_register],7
3754
	mov	bl,al
3774
	mov	bl,al
3755
	jmp	nomem_instruction_ready
3775
	jmp	nomem_instruction_ready
3756
 
3776
 
3757
basic_486_instruction:
3777
basic_486_instruction:
3758
	mov	[base_code],0Fh
3778
	mov	[base_code],0Fh
3759
	mov	[extended_code],al
3779
	mov	[extended_code],al
3760
	lods	byte [esi]
3780
	lods	byte [esi]
3761
	call	get_size_operator
3781
	call	get_size_operator
3762
	cmp	al,10h
3782
	cmp	al,10h
3763
	je	basic_486_reg
3783
	je	basic_486_reg
3764
	cmp	al,'['
3784
	cmp	al,'['
3765
	jne	invalid_operand
3785
	jne	invalid_operand
3766
	call	get_address
3786
	call	get_address
3767
	push	edx ebx ecx
3787
	push	edx ebx ecx
3768
	lods	byte [esi]
3788
	lods	byte [esi]
3769
	cmp	al,','
3789
	cmp	al,','
3770
	jne	invalid_operand
3790
	jne	invalid_operand
3771
	lods	byte [esi]
3791
	lods	byte [esi]
3772
	call	get_size_operator
3792
	call	get_size_operator
3773
	cmp	al,10h
3793
	cmp	al,10h
3774
	jne	invalid_operand
3794
	jne	invalid_operand
3775
	lods	byte [esi]
3795
	lods	byte [esi]
3776
	call	convert_register
3796
	call	convert_register
3777
	mov	[postbyte_register],al
3797
	mov	[postbyte_register],al
3778
	pop	ecx ebx edx
3798
	pop	ecx ebx edx
3779
	mov	al,ah
3799
	mov	al,ah
3780
	cmp	al,1
3800
	cmp	al,1
3781
	je	basic_486_mem_reg_8bit
3801
	je	basic_486_mem_reg_8bit
3782
	call	operand_autodetect
3802
	call	operand_autodetect
3783
	inc	[extended_code]
3803
	inc	[extended_code]
3784
      basic_486_mem_reg_8bit:
3804
      basic_486_mem_reg_8bit:
3785
	jmp	instruction_ready
3805
	jmp	instruction_ready
3786
      basic_486_reg:
3806
      basic_486_reg:
3787
	lods	byte [esi]
3807
	lods	byte [esi]
3788
	call	convert_register
3808
	call	convert_register
3789
	mov	[postbyte_register],al
3809
	mov	[postbyte_register],al
3790
	lods	byte [esi]
3810
	lods	byte [esi]
3791
	cmp	al,','
3811
	cmp	al,','
3792
	jne	invalid_operand
3812
	jne	invalid_operand
3793
	lods	byte [esi]
3813
	lods	byte [esi]
3794
	call	get_size_operator
3814
	call	get_size_operator
3795
	cmp	al,10h
3815
	cmp	al,10h
3796
	jne	invalid_operand
3816
	jne	invalid_operand
3797
	lods	byte [esi]
3817
	lods	byte [esi]
3798
	call	convert_register
3818
	call	convert_register
3799
	mov	bl,[postbyte_register]
3819
	mov	bl,[postbyte_register]
3800
	mov	[postbyte_register],al
3820
	mov	[postbyte_register],al
3801
	mov	al,ah
3821
	mov	al,ah
3802
	cmp	al,1
3822
	cmp	al,1
3803
	je	basic_486_reg_reg_8bit
3823
	je	basic_486_reg_reg_8bit
3804
	call	operand_autodetect
3824
	call	operand_autodetect
3805
	inc	[extended_code]
3825
	inc	[extended_code]
3806
      basic_486_reg_reg_8bit:
3826
      basic_486_reg_reg_8bit:
3807
	jmp	nomem_instruction_ready
3827
	jmp	nomem_instruction_ready
3808
bswap_instruction:
3828
bswap_instruction:
3809
	lods	byte [esi]
3829
	lods	byte [esi]
3810
	call	get_size_operator
3830
	call	get_size_operator
3811
	cmp	al,10h
3831
	cmp	al,10h
3812
	jne	invalid_operand
3832
	jne	invalid_operand
3813
	lods	byte [esi]
3833
	lods	byte [esi]
3814
	call	convert_register
3834
	call	convert_register
3815
	test	al,1000b
3835
	test	al,1000b
3816
	jz	bswap_reg_code_ok
3836
	jz	bswap_reg_code_ok
3817
	or	[rex_prefix],41h
3837
	or	[rex_prefix],41h
3818
	and	al,111b
3838
	and	al,111b
3819
      bswap_reg_code_ok:
3839
      bswap_reg_code_ok:
3820
	add	al,0C8h
3840
	add	al,0C8h
3821
	mov	[extended_code],al
3841
	mov	[extended_code],al
3822
	mov	[base_code],0Fh
3842
	mov	[base_code],0Fh
3823
	cmp	ah,8
3843
	cmp	ah,8
3824
	je	bswap_reg64
3844
	je	bswap_reg64
3825
	cmp	ah,4
3845
	cmp	ah,4
3826
	jne	invalid_operand_size
3846
	jne	invalid_operand_size
3827
	call	operand_32bit
3847
	call	operand_32bit
3828
	call	store_instruction_code
3848
	call	store_instruction_code
3829
	jmp	instruction_assembled
3849
	jmp	instruction_assembled
3830
      bswap_reg64:
3850
      bswap_reg64:
3831
	call	operand_64bit
3851
	call	operand_64bit
3832
	call	store_instruction_code
3852
	call	store_instruction_code
3833
	jmp	instruction_assembled
3853
	jmp	instruction_assembled
3834
cmpxchgx_instruction:
3854
cmpxchgx_instruction:
3835
	mov	[base_code],0Fh
3855
	mov	[base_code],0Fh
3836
	mov	[extended_code],0C7h
3856
	mov	[extended_code],0C7h
3837
	mov	[postbyte_register],al
3857
	mov	[postbyte_register],al
3838
	lods	byte [esi]
3858
	lods	byte [esi]
3839
	call	get_size_operator
3859
	call	get_size_operator
3840
	cmp	al,'['
3860
	cmp	al,'['
3841
	jne	invalid_operand
3861
	jne	invalid_operand
3842
	call	get_address
3862
	call	get_address
3843
	mov	ah,1
3863
	mov	ah,1
3844
	xchg	[postbyte_register],ah
3864
	xchg	[postbyte_register],ah
3845
	mov	al,[operand_size]
3865
	mov	al,[operand_size]
3846
	or	al,al
3866
	or	al,al
3847
	jz	cmpxchgx_size_ok
3867
	jz	cmpxchgx_size_ok
3848
	cmp	al,ah
3868
	cmp	al,ah
3849
	jne	invalid_operand_size
3869
	jne	invalid_operand_size
3850
      cmpxchgx_size_ok:
3870
      cmpxchgx_size_ok:
3851
	cmp	ah,16
3871
	cmp	ah,16
3852
	jne	cmpxchgx_store
3872
	jne	cmpxchgx_store
3853
	call	operand_64bit
3873
	call	operand_64bit
3854
      cmpxchgx_store:
3874
      cmpxchgx_store:
3855
	jmp	instruction_ready
3875
	jmp	instruction_ready
3856
nop_instruction:
3876
nop_instruction:
3857
	mov	ah,[esi]
3877
	mov	ah,[esi]
3858
	cmp	ah,10h
3878
	cmp	ah,10h
3859
	je	extended_nop
3879
	je	extended_nop
3860
	cmp	ah,11h
3880
	cmp	ah,11h
3861
	je	extended_nop
3881
	je	extended_nop
3862
	cmp	ah,'['
3882
	cmp	ah,'['
3863
	je	extended_nop
3883
	je	extended_nop
3864
	stos	byte [edi]
3884
	stos	byte [edi]
3865
	jmp	instruction_assembled
3885
	jmp	instruction_assembled
3866
      extended_nop:
3886
      extended_nop:
3867
	mov	[base_code],0Fh
3887
	mov	[base_code],0Fh
3868
	mov	[extended_code],1Fh
3888
	mov	[extended_code],1Fh
3869
	mov	[postbyte_register],0
3889
	mov	[postbyte_register],0
3870
	lods	byte [esi]
3890
	lods	byte [esi]
3871
	call	get_size_operator
3891
	call	get_size_operator
3872
	cmp	al,10h
3892
	cmp	al,10h
3873
	je	extended_nop_reg
3893
	je	extended_nop_reg
3874
	cmp	al,'['
3894
	cmp	al,'['
3875
	jne	invalid_operand
3895
	jne	invalid_operand
3876
	call	get_address
3896
	call	get_address
3877
	mov	al,[operand_size]
3897
	mov	al,[operand_size]
3878
	or	al,al
3898
	or	al,al
3879
	jz	extended_nop_store
3899
	jz	extended_nop_store
3880
	call	operand_autodetect
3900
	call	operand_autodetect
3881
      extended_nop_store:
3901
      extended_nop_store:
3882
	jmp	instruction_ready
3902
	jmp	instruction_ready
3883
      extended_nop_reg:
3903
      extended_nop_reg:
3884
	lods	byte [esi]
3904
	lods	byte [esi]
3885
	call	convert_register
3905
	call	convert_register
3886
	mov	bl,al
3906
	mov	bl,al
3887
	mov	al,ah
3907
	mov	al,ah
3888
	call	operand_autodetect
3908
	call	operand_autodetect
3889
	jmp	nomem_instruction_ready
3909
	jmp	nomem_instruction_ready
3890
 
3910
 
3891
basic_fpu_instruction:
3911
basic_fpu_instruction:
3892
	mov	[postbyte_register],al
3912
	mov	[postbyte_register],al
3893
	mov	[base_code],0D8h
3913
	mov	[base_code],0D8h
3894
	lods	byte [esi]
3914
	lods	byte [esi]
3895
	call	get_size_operator
3915
	call	get_size_operator
3896
	cmp	al,10h
3916
	cmp	al,10h
3897
	je	basic_fpu_streg
3917
	je	basic_fpu_streg
3898
	cmp	al,'['
3918
	cmp	al,'['
3899
	je	basic_fpu_mem
3919
	je	basic_fpu_mem
3900
	dec	esi
3920
	dec	esi
3901
	mov	ah,[postbyte_register]
3921
	mov	ah,[postbyte_register]
3902
	cmp	ah,2
3922
	cmp	ah,2
3903
	jb	invalid_operand
3923
	jb	invalid_operand
3904
	cmp	ah,3
3924
	cmp	ah,3
3905
	ja	invalid_operand
3925
	ja	invalid_operand
3906
	mov	bl,1
3926
	mov	bl,1
3907
	jmp	nomem_instruction_ready
3927
	jmp	nomem_instruction_ready
3908
      basic_fpu_mem:
3928
      basic_fpu_mem:
3909
	call	get_address
3929
	call	get_address
3910
	mov	al,[operand_size]
3930
	mov	al,[operand_size]
3911
	cmp	al,4
3931
	cmp	al,4
3912
	je	basic_fpu_mem_32bit
3932
	je	basic_fpu_mem_32bit
3913
	cmp	al,8
3933
	cmp	al,8
3914
	je	basic_fpu_mem_64bit
3934
	je	basic_fpu_mem_64bit
3915
	or	al,al
3935
	or	al,al
3916
	jnz	invalid_operand_size
3936
	jnz	invalid_operand_size
3917
	cmp	[error_line],0
3937
	cmp	[error_line],0
3918
	jne	basic_fpu_mem_32bit
3938
	jne	basic_fpu_mem_32bit
3919
	mov	eax,[current_line]
3939
	mov	eax,[current_line]
3920
	mov	[error_line],eax
3940
	mov	[error_line],eax
3921
	mov	[error],operand_size_not_specified
3941
	mov	[error],operand_size_not_specified
3922
      basic_fpu_mem_32bit:
3942
      basic_fpu_mem_32bit:
3923
	jmp	instruction_ready
3943
	jmp	instruction_ready
3924
      basic_fpu_mem_64bit:
3944
      basic_fpu_mem_64bit:
3925
	mov	[base_code],0DCh
3945
	mov	[base_code],0DCh
3926
	jmp	instruction_ready
3946
	jmp	instruction_ready
3927
      basic_fpu_streg:
3947
      basic_fpu_streg:
3928
	lods	byte [esi]
3948
	lods	byte [esi]
3929
	call	convert_fpu_register
3949
	call	convert_fpu_register
3930
	mov	bl,al
3950
	mov	bl,al
3931
	mov	ah,[postbyte_register]
3951
	mov	ah,[postbyte_register]
3932
	cmp	ah,2
3952
	cmp	ah,2
3933
	je	basic_fpu_single_streg
3953
	je	basic_fpu_single_streg
3934
	cmp	ah,3
3954
	cmp	ah,3
3935
	je	basic_fpu_single_streg
3955
	je	basic_fpu_single_streg
3936
	or	al,al
3956
	or	al,al
3937
	jz	basic_fpu_st0
3957
	jz	basic_fpu_st0
3938
	test	ah,110b
3958
	test	ah,110b
3939
	jz	basic_fpu_streg_st0
3959
	jz	basic_fpu_streg_st0
3940
	xor	[postbyte_register],1
3960
	xor	[postbyte_register],1
3941
      basic_fpu_streg_st0:
3961
      basic_fpu_streg_st0:
3942
	lods	byte [esi]
3962
	lods	byte [esi]
3943
	cmp	al,','
3963
	cmp	al,','
3944
	jne	invalid_operand
3964
	jne	invalid_operand
3945
	lods	byte [esi]
3965
	lods	byte [esi]
3946
	call	get_size_operator
3966
	call	get_size_operator
3947
	cmp	al,10h
3967
	cmp	al,10h
3948
	jne	invalid_operand
3968
	jne	invalid_operand
3949
	lods	byte [esi]
3969
	lods	byte [esi]
3950
	call	convert_fpu_register
3970
	call	convert_fpu_register
3951
	or	al,al
3971
	or	al,al
3952
	jnz	invalid_operand
3972
	jnz	invalid_operand
3953
	mov	[base_code],0DCh
3973
	mov	[base_code],0DCh
3954
	jmp	nomem_instruction_ready
3974
	jmp	nomem_instruction_ready
3955
      basic_fpu_st0:
3975
      basic_fpu_st0:
3956
	lods	byte [esi]
3976
	lods	byte [esi]
3957
	cmp	al,','
3977
	cmp	al,','
3958
	jne	invalid_operand
3978
	jne	invalid_operand
3959
	lods	byte [esi]
3979
	lods	byte [esi]
3960
	call	get_size_operator
3980
	call	get_size_operator
3961
	cmp	al,10h
3981
	cmp	al,10h
3962
	jne	invalid_operand
3982
	jne	invalid_operand
3963
	lods	byte [esi]
3983
	lods	byte [esi]
3964
	call	convert_fpu_register
3984
	call	convert_fpu_register
3965
	mov	bl,al
3985
	mov	bl,al
3966
      basic_fpu_single_streg:
3986
      basic_fpu_single_streg:
3967
	mov	[base_code],0D8h
3987
	mov	[base_code],0D8h
3968
	jmp	nomem_instruction_ready
3988
	jmp	nomem_instruction_ready
3969
simple_fpu_instruction:
3989
simple_fpu_instruction:
3970
	mov	ah,al
3990
	mov	ah,al
3971
	or	ah,11000000b
3991
	or	ah,11000000b
3972
	mov	al,0D9h
3992
	mov	al,0D9h
3973
	stos	word [edi]
3993
	stos	word [edi]
3974
	jmp	instruction_assembled
3994
	jmp	instruction_assembled
3975
fi_instruction:
3995
fi_instruction:
3976
	mov	[postbyte_register],al
3996
	mov	[postbyte_register],al
3977
	lods	byte [esi]
3997
	lods	byte [esi]
3978
	call	get_size_operator
3998
	call	get_size_operator
3979
	cmp	al,'['
3999
	cmp	al,'['
3980
	jne	invalid_operand
4000
	jne	invalid_operand
3981
	call	get_address
4001
	call	get_address
3982
	mov	al,[operand_size]
4002
	mov	al,[operand_size]
3983
	cmp	al,2
4003
	cmp	al,2
3984
	je	fi_mem_16bit
4004
	je	fi_mem_16bit
3985
	cmp	al,4
4005
	cmp	al,4
3986
	je	fi_mem_32bit
4006
	je	fi_mem_32bit
3987
	or	al,al
4007
	or	al,al
3988
	jnz	invalid_operand_size
4008
	jnz	invalid_operand_size
3989
	cmp	[error_line],0
4009
	cmp	[error_line],0
3990
	jne	fi_mem_32bit
4010
	jne	fi_mem_32bit
3991
	mov	eax,[current_line]
4011
	mov	eax,[current_line]
3992
	mov	[error_line],eax
4012
	mov	[error_line],eax
3993
	mov	[error],operand_size_not_specified
4013
	mov	[error],operand_size_not_specified
3994
      fi_mem_32bit:
4014
      fi_mem_32bit:
3995
	mov	[base_code],0DAh
4015
	mov	[base_code],0DAh
3996
	jmp	instruction_ready
4016
	jmp	instruction_ready
3997
      fi_mem_16bit:
4017
      fi_mem_16bit:
3998
	mov	[base_code],0DEh
4018
	mov	[base_code],0DEh
3999
	jmp	instruction_ready
4019
	jmp	instruction_ready
4000
fld_instruction:
4020
fld_instruction:
4001
	mov	[postbyte_register],al
4021
	mov	[postbyte_register],al
4002
	lods	byte [esi]
4022
	lods	byte [esi]
4003
	call	get_size_operator
4023
	call	get_size_operator
4004
	cmp	al,10h
4024
	cmp	al,10h
4005
	je	fld_streg
4025
	je	fld_streg
4006
	cmp	al,'['
4026
	cmp	al,'['
4007
	jne	invalid_operand
4027
	jne	invalid_operand
4008
	call	get_address
4028
	call	get_address
4009
	mov	al,[operand_size]
4029
	mov	al,[operand_size]
4010
	cmp	al,4
4030
	cmp	al,4
4011
	je	fld_mem_32bit
4031
	je	fld_mem_32bit
4012
	cmp	al,8
4032
	cmp	al,8
4013
	je	fld_mem_64bit
4033
	je	fld_mem_64bit
4014
	cmp	al,10
4034
	cmp	al,10
4015
	je	fld_mem_80bit
4035
	je	fld_mem_80bit
4016
	or	al,al
4036
	or	al,al
4017
	jnz	invalid_operand_size
4037
	jnz	invalid_operand_size
4018
	cmp	[error_line],0
4038
	cmp	[error_line],0
4019
	jne	fld_mem_32bit
4039
	jne	fld_mem_32bit
4020
	mov	eax,[current_line]
4040
	mov	eax,[current_line]
4021
	mov	[error_line],eax
4041
	mov	[error_line],eax
4022
	mov	[error],operand_size_not_specified
4042
	mov	[error],operand_size_not_specified
4023
      fld_mem_32bit:
4043
      fld_mem_32bit:
4024
	mov	[base_code],0D9h
4044
	mov	[base_code],0D9h
4025
	jmp	instruction_ready
4045
	jmp	instruction_ready
4026
      fld_mem_64bit:
4046
      fld_mem_64bit:
4027
	mov	[base_code],0DDh
4047
	mov	[base_code],0DDh
4028
	jmp	instruction_ready
4048
	jmp	instruction_ready
4029
      fld_mem_80bit:
4049
      fld_mem_80bit:
4030
	mov	al,[postbyte_register]
4050
	mov	al,[postbyte_register]
4031
	cmp	al,0
4051
	cmp	al,0
4032
	je	fld_mem_80bit_store
4052
	je	fld_mem_80bit_store
4033
	dec	[postbyte_register]
4053
	dec	[postbyte_register]
4034
	cmp	al,3
4054
	cmp	al,3
4035
	je	fld_mem_80bit_store
4055
	je	fld_mem_80bit_store
4036
	jmp	invalid_operand_size
4056
	jmp	invalid_operand_size
4037
      fld_mem_80bit_store:
4057
      fld_mem_80bit_store:
4038
	add	[postbyte_register],5
4058
	add	[postbyte_register],5
4039
	mov	[base_code],0DBh
4059
	mov	[base_code],0DBh
4040
	jmp	instruction_ready
4060
	jmp	instruction_ready
4041
      fld_streg:
4061
      fld_streg:
4042
	lods	byte [esi]
4062
	lods	byte [esi]
4043
	call	convert_fpu_register
4063
	call	convert_fpu_register
4044
	mov	bl,al
4064
	mov	bl,al
4045
	cmp	[postbyte_register],2
4065
	cmp	[postbyte_register],2
4046
	jae	fst_streg
4066
	jae	fst_streg
4047
	mov	[base_code],0D9h
4067
	mov	[base_code],0D9h
4048
	jmp	nomem_instruction_ready
4068
	jmp	nomem_instruction_ready
4049
      fst_streg:
4069
      fst_streg:
4050
	mov	[base_code],0DDh
4070
	mov	[base_code],0DDh
4051
	jmp	nomem_instruction_ready
4071
	jmp	nomem_instruction_ready
4052
fild_instruction:
4072
fild_instruction:
4053
	mov	[postbyte_register],al
4073
	mov	[postbyte_register],al
4054
	lods	byte [esi]
4074
	lods	byte [esi]
4055
	call	get_size_operator
4075
	call	get_size_operator
4056
	cmp	al,'['
4076
	cmp	al,'['
4057
	jne	invalid_operand
4077
	jne	invalid_operand
4058
	call	get_address
4078
	call	get_address
4059
	mov	al,[operand_size]
4079
	mov	al,[operand_size]
4060
	cmp	al,2
4080
	cmp	al,2
4061
	je	fild_mem_16bit
4081
	je	fild_mem_16bit
4062
	cmp	al,4
4082
	cmp	al,4
4063
	je	fild_mem_32bit
4083
	je	fild_mem_32bit
4064
	cmp	al,8
4084
	cmp	al,8
4065
	je	fild_mem_64bit
4085
	je	fild_mem_64bit
4066
	or	al,al
4086
	or	al,al
4067
	jnz	invalid_operand_size
4087
	jnz	invalid_operand_size
4068
	cmp	[error_line],0
4088
	cmp	[error_line],0
4069
	jne	fild_mem_32bit
4089
	jne	fild_mem_32bit
4070
	mov	eax,[current_line]
4090
	mov	eax,[current_line]
4071
	mov	[error_line],eax
4091
	mov	[error_line],eax
4072
	mov	[error],operand_size_not_specified
4092
	mov	[error],operand_size_not_specified
4073
      fild_mem_32bit:
4093
      fild_mem_32bit:
4074
	mov	[base_code],0DBh
4094
	mov	[base_code],0DBh
4075
	jmp	instruction_ready
4095
	jmp	instruction_ready
4076
      fild_mem_16bit:
4096
      fild_mem_16bit:
4077
	mov	[base_code],0DFh
4097
	mov	[base_code],0DFh
4078
	jmp	instruction_ready
4098
	jmp	instruction_ready
4079
      fild_mem_64bit:
4099
      fild_mem_64bit:
4080
	mov	al,[postbyte_register]
4100
	mov	al,[postbyte_register]
4081
	cmp	al,1
4101
	cmp	al,1
4082
	je	fisttp_64bit_store
4102
	je	fisttp_64bit_store
4083
	jb	fild_mem_64bit_store
4103
	jb	fild_mem_64bit_store
4084
	dec	[postbyte_register]
4104
	dec	[postbyte_register]
4085
	cmp	al,3
4105
	cmp	al,3
4086
	je	fild_mem_64bit_store
4106
	je	fild_mem_64bit_store
4087
	jmp	invalid_operand_size
4107
	jmp	invalid_operand_size
4088
      fild_mem_64bit_store:
4108
      fild_mem_64bit_store:
4089
	add	[postbyte_register],5
4109
	add	[postbyte_register],5
4090
	mov	[base_code],0DFh
4110
	mov	[base_code],0DFh
4091
	jmp	instruction_ready
4111
	jmp	instruction_ready
4092
      fisttp_64bit_store:
4112
      fisttp_64bit_store:
4093
	mov	[base_code],0DDh
4113
	mov	[base_code],0DDh
4094
	jmp	instruction_ready
4114
	jmp	instruction_ready
4095
fbld_instruction:
4115
fbld_instruction:
4096
	mov	[postbyte_register],al
4116
	mov	[postbyte_register],al
4097
	lods	byte [esi]
4117
	lods	byte [esi]
4098
	call	get_size_operator
4118
	call	get_size_operator
4099
	cmp	al,'['
4119
	cmp	al,'['
4100
	jne	invalid_operand
4120
	jne	invalid_operand
4101
	call	get_address
4121
	call	get_address
4102
	mov	al,[operand_size]
4122
	mov	al,[operand_size]
4103
	or	al,al
4123
	or	al,al
4104
	jz	fbld_mem_80bit
4124
	jz	fbld_mem_80bit
4105
	cmp	al,10
4125
	cmp	al,10
4106
	je	fbld_mem_80bit
4126
	je	fbld_mem_80bit
4107
	jmp	invalid_operand_size
4127
	jmp	invalid_operand_size
4108
      fbld_mem_80bit:
4128
      fbld_mem_80bit:
4109
	mov	[base_code],0DFh
4129
	mov	[base_code],0DFh
4110
	jmp	instruction_ready
4130
	jmp	instruction_ready
4111
faddp_instruction:
4131
faddp_instruction:
4112
	mov	[postbyte_register],al
4132
	mov	[postbyte_register],al
4113
	mov	[base_code],0DEh
4133
	mov	[base_code],0DEh
4114
	mov	edx,esi
4134
	mov	edx,esi
4115
	lods	byte [esi]
4135
	lods	byte [esi]
4116
	call	get_size_operator
4136
	call	get_size_operator
4117
	cmp	al,10h
4137
	cmp	al,10h
4118
	je	faddp_streg
4138
	je	faddp_streg
4119
	mov	esi,edx
4139
	mov	esi,edx
4120
	mov	bl,1
4140
	mov	bl,1
4121
	jmp	nomem_instruction_ready
4141
	jmp	nomem_instruction_ready
4122
      faddp_streg:
4142
      faddp_streg:
4123
	lods	byte [esi]
4143
	lods	byte [esi]
4124
	call	convert_fpu_register
4144
	call	convert_fpu_register
4125
	mov	bl,al
4145
	mov	bl,al
4126
	lods	byte [esi]
4146
	lods	byte [esi]
4127
	cmp	al,','
4147
	cmp	al,','
4128
	jne	invalid_operand
4148
	jne	invalid_operand
4129
	lods	byte [esi]
4149
	lods	byte [esi]
4130
	call	get_size_operator
4150
	call	get_size_operator
4131
	cmp	al,10h
4151
	cmp	al,10h
4132
	jne	invalid_operand
4152
	jne	invalid_operand
4133
	lods	byte [esi]
4153
	lods	byte [esi]
4134
	call	convert_fpu_register
4154
	call	convert_fpu_register
4135
	or	al,al
4155
	or	al,al
4136
	jnz	invalid_operand
4156
	jnz	invalid_operand
4137
	jmp	nomem_instruction_ready
4157
	jmp	nomem_instruction_ready
4138
fcompp_instruction:
4158
fcompp_instruction:
4139
	mov	ax,0D9DEh
4159
	mov	ax,0D9DEh
4140
	stos	word [edi]
4160
	stos	word [edi]
4141
	jmp	instruction_assembled
4161
	jmp	instruction_assembled
4142
fucompp_instruction:
4162
fucompp_instruction:
4143
	mov	ax,0E9DAh
4163
	mov	ax,0E9DAh
4144
	stos	word [edi]
4164
	stos	word [edi]
4145
	jmp	instruction_assembled
4165
	jmp	instruction_assembled
4146
fxch_instruction:
4166
fxch_instruction:
4147
	mov	dx,01D9h
4167
	mov	dx,01D9h
4148
	jmp	fpu_single_operand
4168
	jmp	fpu_single_operand
4149
ffreep_instruction:
4169
ffreep_instruction:
4150
	mov	dx,00DFh
4170
	mov	dx,00DFh
4151
	jmp	fpu_single_operand
4171
	jmp	fpu_single_operand
4152
ffree_instruction:
4172
ffree_instruction:
4153
	mov	dl,0DDh
4173
	mov	dl,0DDh
4154
	mov	dh,al
4174
	mov	dh,al
4155
      fpu_single_operand:
4175
      fpu_single_operand:
4156
	mov	ebx,esi
4176
	mov	ebx,esi
4157
	lods	byte [esi]
4177
	lods	byte [esi]
4158
	call	get_size_operator
4178
	call	get_size_operator
4159
	cmp	al,10h
4179
	cmp	al,10h
4160
	je	fpu_streg
4180
	je	fpu_streg
4161
	or	dh,dh
4181
	or	dh,dh
4162
	jz	invalid_operand
4182
	jz	invalid_operand
4163
	mov	esi,ebx
4183
	mov	esi,ebx
4164
	shl	dh,3
4184
	shl	dh,3
4165
	or	dh,11000001b
4185
	or	dh,11000001b
4166
	mov	ax,dx
4186
	mov	ax,dx
4167
	stos	word [edi]
4187
	stos	word [edi]
4168
	jmp	instruction_assembled
4188
	jmp	instruction_assembled
4169
      fpu_streg:
4189
      fpu_streg:
4170
	lods	byte [esi]
4190
	lods	byte [esi]
4171
	call	convert_fpu_register
4191
	call	convert_fpu_register
4172
	shl	dh,3
4192
	shl	dh,3
4173
	or	dh,al
4193
	or	dh,al
4174
	or	dh,11000000b
4194
	or	dh,11000000b
4175
	mov	ax,dx
4195
	mov	ax,dx
4176
	stos	word [edi]
4196
	stos	word [edi]
4177
	jmp	instruction_assembled
4197
	jmp	instruction_assembled
4178
 
4198
 
4179
fstenv_instruction:
4199
fstenv_instruction:
4180
	mov	byte [edi],9Bh
4200
	mov	byte [edi],9Bh
4181
	inc	edi
4201
	inc	edi
4182
fldenv_instruction:
4202
fldenv_instruction:
4183
	mov	[base_code],0D9h
4203
	mov	[base_code],0D9h
4184
	jmp	fpu_mem
4204
	jmp	fpu_mem
4185
fstenv_instruction_16bit:
4205
fstenv_instruction_16bit:
4186
	mov	byte [edi],9Bh
4206
	mov	byte [edi],9Bh
4187
	inc	edi
4207
	inc	edi
4188
fldenv_instruction_16bit:
4208
fldenv_instruction_16bit:
4189
	call	operand_16bit
4209
	call	operand_16bit
4190
	jmp	fldenv_instruction
4210
	jmp	fldenv_instruction
4191
fstenv_instruction_32bit:
4211
fstenv_instruction_32bit:
4192
	mov	byte [edi],9Bh
4212
	mov	byte [edi],9Bh
4193
	inc	edi
4213
	inc	edi
4194
fldenv_instruction_32bit:
4214
fldenv_instruction_32bit:
4195
	call	operand_32bit
4215
	call	operand_32bit
4196
	jmp	fldenv_instruction
4216
	jmp	fldenv_instruction
4197
fsave_instruction_32bit:
4217
fsave_instruction_32bit:
4198
	mov	byte [edi],9Bh
4218
	mov	byte [edi],9Bh
4199
	inc	edi
4219
	inc	edi
4200
fnsave_instruction_32bit:
4220
fnsave_instruction_32bit:
4201
	call	operand_32bit
4221
	call	operand_32bit
4202
	jmp	fnsave_instruction
4222
	jmp	fnsave_instruction
4203
fsave_instruction_16bit:
4223
fsave_instruction_16bit:
4204
	mov	byte [edi],9Bh
4224
	mov	byte [edi],9Bh
4205
	inc	edi
4225
	inc	edi
4206
fnsave_instruction_16bit:
4226
fnsave_instruction_16bit:
4207
	call	operand_16bit
4227
	call	operand_16bit
4208
	jmp	fnsave_instruction
4228
	jmp	fnsave_instruction
4209
fsave_instruction:
4229
fsave_instruction:
4210
	mov	byte [edi],9Bh
4230
	mov	byte [edi],9Bh
4211
	inc	edi
4231
	inc	edi
4212
fnsave_instruction:
4232
fnsave_instruction:
4213
	mov	[base_code],0DDh
4233
	mov	[base_code],0DDh
4214
      fpu_mem:
4234
      fpu_mem:
4215
	mov	[postbyte_register],al
4235
	mov	[postbyte_register],al
4216
	lods	byte [esi]
4236
	lods	byte [esi]
4217
	call	get_size_operator
4237
	call	get_size_operator
4218
	cmp	al,'['
4238
	cmp	al,'['
4219
	jne	invalid_operand
4239
	jne	invalid_operand
4220
	call	get_address
4240
	call	get_address
4221
	cmp	[operand_size],0
4241
	cmp	[operand_size],0
4222
	jne	invalid_operand_size
4242
	jne	invalid_operand_size
4223
	jmp	instruction_ready
4243
	jmp	instruction_ready
4224
fstcw_instruction:
4244
fstcw_instruction:
4225
	mov	byte [edi],9Bh
4245
	mov	byte [edi],9Bh
4226
	inc	edi
4246
	inc	edi
4227
fldcw_instruction:
4247
fldcw_instruction:
4228
	mov	[postbyte_register],al
4248
	mov	[postbyte_register],al
4229
	mov	[base_code],0D9h
4249
	mov	[base_code],0D9h
4230
	lods	byte [esi]
4250
	lods	byte [esi]
4231
	call	get_size_operator
4251
	call	get_size_operator
4232
	cmp	al,'['
4252
	cmp	al,'['
4233
	jne	invalid_operand
4253
	jne	invalid_operand
4234
	call	get_address
4254
	call	get_address
4235
	mov	al,[operand_size]
4255
	mov	al,[operand_size]
4236
	or	al,al
4256
	or	al,al
4237
	jz	fldcw_mem_16bit
4257
	jz	fldcw_mem_16bit
4238
	cmp	al,2
4258
	cmp	al,2
4239
	je	fldcw_mem_16bit
4259
	je	fldcw_mem_16bit
4240
	jmp	invalid_operand_size
4260
	jmp	invalid_operand_size
4241
      fldcw_mem_16bit:
4261
      fldcw_mem_16bit:
4242
	jmp	instruction_ready
4262
	jmp	instruction_ready
4243
fstsw_instruction:
4263
fstsw_instruction:
4244
	mov	al,9Bh
4264
	mov	al,9Bh
4245
	stos	byte [edi]
4265
	stos	byte [edi]
4246
fnstsw_instruction:
4266
fnstsw_instruction:
4247
	mov	[base_code],0DDh
4267
	mov	[base_code],0DDh
4248
	mov	[postbyte_register],7
4268
	mov	[postbyte_register],7
4249
	lods	byte [esi]
4269
	lods	byte [esi]
4250
	call	get_size_operator
4270
	call	get_size_operator
4251
	cmp	al,10h
4271
	cmp	al,10h
4252
	je	fstsw_reg
4272
	je	fstsw_reg
4253
	cmp	al,'['
4273
	cmp	al,'['
4254
	jne	invalid_operand
4274
	jne	invalid_operand
4255
	call	get_address
4275
	call	get_address
4256
	mov	al,[operand_size]
4276
	mov	al,[operand_size]
4257
	or	al,al
4277
	or	al,al
4258
	jz	fstsw_mem_16bit
4278
	jz	fstsw_mem_16bit
4259
	cmp	al,2
4279
	cmp	al,2
4260
	je	fstsw_mem_16bit
4280
	je	fstsw_mem_16bit
4261
	jmp	invalid_operand_size
4281
	jmp	invalid_operand_size
4262
      fstsw_mem_16bit:
4282
      fstsw_mem_16bit:
4263
	jmp	instruction_ready
4283
	jmp	instruction_ready
4264
      fstsw_reg:
4284
      fstsw_reg:
4265
	lods	byte [esi]
4285
	lods	byte [esi]
4266
	call	convert_register
4286
	call	convert_register
4267
	cmp	ax,0200h
4287
	cmp	ax,0200h
4268
	jne	invalid_operand
4288
	jne	invalid_operand
4269
	mov	ax,0E0DFh
4289
	mov	ax,0E0DFh
4270
	stos	word [edi]
4290
	stos	word [edi]
4271
	jmp	instruction_assembled
4291
	jmp	instruction_assembled
4272
finit_instruction:
4292
finit_instruction:
4273
	mov	byte [edi],9Bh
4293
	mov	byte [edi],9Bh
4274
	inc	edi
4294
	inc	edi
4275
fninit_instruction:
4295
fninit_instruction:
4276
	mov	ah,al
4296
	mov	ah,al
4277
	mov	al,0DBh
4297
	mov	al,0DBh
4278
	stos	word [edi]
4298
	stos	word [edi]
4279
	jmp	instruction_assembled
4299
	jmp	instruction_assembled
4280
fcmov_instruction:
4300
fcmov_instruction:
4281
	mov	dh,0DAh
4301
	mov	dh,0DAh
4282
	jmp	fcomi_streg
4302
	jmp	fcomi_streg
4283
fcomi_instruction:
4303
fcomi_instruction:
4284
	mov	dh,0DBh
4304
	mov	dh,0DBh
4285
	jmp	fcomi_streg
4305
	jmp	fcomi_streg
4286
fcomip_instruction:
4306
fcomip_instruction:
4287
	mov	dh,0DFh
4307
	mov	dh,0DFh
4288
      fcomi_streg:
4308
      fcomi_streg:
4289
	mov	dl,al
4309
	mov	dl,al
4290
	lods	byte [esi]
4310
	lods	byte [esi]
4291
	call	get_size_operator
4311
	call	get_size_operator
4292
	cmp	al,10h
4312
	cmp	al,10h
4293
	jne	invalid_operand
4313
	jne	invalid_operand
4294
	lods	byte [esi]
4314
	lods	byte [esi]
4295
	call	convert_fpu_register
4315
	call	convert_fpu_register
4296
	mov	ah,al
4316
	mov	ah,al
4297
	cmp	byte [esi],','
4317
	cmp	byte [esi],','
4298
	je	fcomi_st0_streg
4318
	je	fcomi_st0_streg
4299
	add	ah,dl
4319
	add	ah,dl
4300
	mov	al,dh
4320
	mov	al,dh
4301
	stos	word [edi]
4321
	stos	word [edi]
4302
	jmp	instruction_assembled
4322
	jmp	instruction_assembled
4303
      fcomi_st0_streg:
4323
      fcomi_st0_streg:
4304
	or	ah,ah
4324
	or	ah,ah
4305
	jnz	invalid_operand
4325
	jnz	invalid_operand
4306
	inc	esi
4326
	inc	esi
4307
	lods	byte [esi]
4327
	lods	byte [esi]
4308
	call	get_size_operator
4328
	call	get_size_operator
4309
	cmp	al,10h
4329
	cmp	al,10h
4310
	jne	invalid_operand
4330
	jne	invalid_operand
4311
	lods	byte [esi]
4331
	lods	byte [esi]
4312
	call	convert_fpu_register
4332
	call	convert_fpu_register
4313
	mov	ah,al
4333
	mov	ah,al
4314
	add	ah,dl
4334
	add	ah,dl
4315
	mov	al,dh
4335
	mov	al,dh
4316
	stos	word [edi]
4336
	stos	word [edi]
4317
	jmp	instruction_assembled
4337
	jmp	instruction_assembled
4318
 
4338
 
4319
basic_mmx_instruction:
4339
basic_mmx_instruction:
4320
	mov	[base_code],0Fh
4340
	mov	[base_code],0Fh
4321
	mov	[extended_code],al
4341
	mov	[extended_code],al
4322
      mmx_instruction:
4342
      mmx_instruction:
4323
	lods	byte [esi]
4343
	lods	byte [esi]
4324
	call	get_size_operator
4344
	call	get_size_operator
4325
	cmp	al,10h
4345
	cmp	al,10h
4326
	jne	invalid_operand
4346
	jne	invalid_operand
4327
	lods	byte [esi]
4347
	lods	byte [esi]
4328
	call	convert_mmx_register
4348
	call	convert_mmx_register
4329
	call	make_mmx_prefix
4349
	call	make_mmx_prefix
4330
	mov	[postbyte_register],al
4350
	mov	[postbyte_register],al
4331
	lods	byte [esi]
4351
	lods	byte [esi]
4332
	cmp	al,','
4352
	cmp	al,','
4333
	jne	invalid_operand
4353
	jne	invalid_operand
4334
	lods	byte [esi]
4354
	lods	byte [esi]
4335
	call	get_size_operator
4355
	call	get_size_operator
4336
	cmp	al,10h
4356
	cmp	al,10h
4337
	je	mmx_mmreg_mmreg
4357
	je	mmx_mmreg_mmreg
4338
	cmp	al,'['
4358
	cmp	al,'['
4339
	jne	invalid_operand
4359
	jne	invalid_operand
4340
      mmx_mmreg_mem:
4360
      mmx_mmreg_mem:
4341
	call	get_address
4361
	call	get_address
4342
	jmp	instruction_ready
4362
	jmp	instruction_ready
4343
      mmx_mmreg_mmreg:
4363
      mmx_mmreg_mmreg:
4344
	lods	byte [esi]
4364
	lods	byte [esi]
4345
	call	convert_mmx_register
4365
	call	convert_mmx_register
4346
	mov	bl,al
4366
	mov	bl,al
4347
	jmp	nomem_instruction_ready
4367
	jmp	nomem_instruction_ready
4348
mmx_ps_instruction:
4368
mmx_bit_shift_instruction:
4349
	mov	[base_code],0Fh
4369
	mov	[base_code],0Fh
4350
	mov	[extended_code],al
4370
	mov	[extended_code],al
4351
	lods	byte [esi]
4371
	lods	byte [esi]
4352
	call	get_size_operator
4372
	call	get_size_operator
4353
	cmp	al,10h
4373
	cmp	al,10h
4354
	jne	invalid_operand
4374
	jne	invalid_operand
4355
	lods	byte [esi]
4375
	lods	byte [esi]
4356
	call	convert_mmx_register
4376
	call	convert_mmx_register
4357
	call	make_mmx_prefix
4377
	call	make_mmx_prefix
4358
	mov	[postbyte_register],al
4378
	mov	[postbyte_register],al
4359
	lods	byte [esi]
4379
	lods	byte [esi]
4360
	cmp	al,','
4380
	cmp	al,','
4361
	jne	invalid_operand
4381
	jne	invalid_operand
4362
	mov	[operand_size],0
4382
	mov	[operand_size],0
4363
	lods	byte [esi]
4383
	lods	byte [esi]
4364
	call	get_size_operator
4384
	call	get_size_operator
4365
	cmp	al,10h
4385
	cmp	al,10h
4366
	je	mmx_mmreg_mmreg
4386
	je	mmx_mmreg_mmreg
4367
	cmp	al,'('
4387
	cmp	al,'('
4368
	je	mmx_ps_mmreg_imm8
4388
	je	mmx_ps_mmreg_imm8
4369
	cmp	al,'['
4389
	cmp	al,'['
4370
	je	mmx_mmreg_mem
4390
	je	mmx_mmreg_mem
4371
	jmp	invalid_operand
4391
	jmp	invalid_operand
4372
      mmx_ps_mmreg_imm8:
4392
      mmx_ps_mmreg_imm8:
4373
	call	get_byte_value
4393
	call	get_byte_value
4374
	mov	byte [value],al
4394
	mov	byte [value],al
4375
	test	[operand_size],not 1
4395
	test	[operand_size],not 1
4376
	jnz	invalid_value
4396
	jnz	invalid_value
4377
	mov	bl,[extended_code]
4397
	mov	bl,[extended_code]
4378
	mov	al,bl
4398
	mov	al,bl
4379
	shr	bl,4
4399
	shr	bl,4
4380
	and	al,1111b
4400
	and	al,1111b
4381
	add	al,70h
4401
	add	al,70h
4382
	mov	[extended_code],al
4402
	mov	[extended_code],al
4383
	sub	bl,0Ch
4403
	sub	bl,0Ch
4384
	shl	bl,1
4404
	shl	bl,1
4385
	xchg	bl,[postbyte_register]
4405
	xchg	bl,[postbyte_register]
4386
	call	store_nomem_instruction
4406
	call	store_nomem_instruction
4387
	mov	al,byte [value]
4407
	mov	al,byte [value]
4388
	stos	byte [edi]
4408
	stos	byte [edi]
4389
	jmp	instruction_assembled
4409
	jmp	instruction_assembled
4390
pmovmskb_instruction:
4410
pmovmskb_instruction:
4391
	mov	[base_code],0Fh
4411
	mov	[base_code],0Fh
4392
	mov	[extended_code],al
4412
	mov	[extended_code],al
4393
	lods	byte [esi]
4413
	lods	byte [esi]
4394
	call	get_size_operator
4414
	call	get_size_operator
4395
	cmp	al,10h
4415
	cmp	al,10h
4396
	jne	invalid_operand
4416
	jne	invalid_operand
4397
	lods	byte [esi]
4417
	lods	byte [esi]
4398
	call	convert_register
4418
	call	convert_register
4399
	cmp	ah,4
4419
	cmp	ah,4
4400
	je	pmovmskb_reg_size_ok
4420
	je	pmovmskb_reg_size_ok
4401
	cmp	[code_type],64
4421
	cmp	[code_type],64
4402
	jne	invalid_operand_size
4422
	jne	invalid_operand_size
4403
	cmp	ah,8
4423
	cmp	ah,8
4404
	jnz	invalid_operand_size
4424
	jnz	invalid_operand_size
4405
      pmovmskb_reg_size_ok:
4425
      pmovmskb_reg_size_ok:
4406
	mov	[postbyte_register],al
4426
	mov	[postbyte_register],al
4407
	mov	[operand_size],0
4427
	mov	[operand_size],0
4408
	lods	byte [esi]
4428
	lods	byte [esi]
4409
	cmp	al,','
4429
	cmp	al,','
4410
	jne	invalid_operand
4430
	jne	invalid_operand
4411
	lods	byte [esi]
4431
	lods	byte [esi]
4412
	call	get_size_operator
4432
	call	get_size_operator
4413
	cmp	al,10h
4433
	cmp	al,10h
4414
	jne	invalid_operand
4434
	jne	invalid_operand
4415
	lods	byte [esi]
4435
	lods	byte [esi]
4416
	call	convert_mmx_register
4436
	call	convert_mmx_register
4417
	mov	bl,al
4437
	mov	bl,al
4418
	call	make_mmx_prefix
4438
	call	make_mmx_prefix
4419
	cmp	[extended_code],0C5h
4439
	cmp	[extended_code],0C5h
4420
	je	mmx_nomem_imm8
4440
	je	mmx_nomem_imm8
4421
	jmp	nomem_instruction_ready
4441
	jmp	nomem_instruction_ready
4422
      mmx_imm8:
4442
      mmx_imm8:
4423
	push	ebx ecx edx
4443
	push	ebx ecx edx
4424
	mov	[operand_size],0
4444
	xor	cl,cl
-
 
4445
	xchg	cl,[operand_size]
4425
	lods	byte [esi]
4446
	lods	byte [esi]
4426
	cmp	al,','
4447
	cmp	al,','
4427
	jne	invalid_operand
4448
	jne	invalid_operand
4428
	lods	byte [esi]
4449
	lods	byte [esi]
4429
	call	get_size_operator
4450
	call	get_size_operator
4430
	test	ah,not 1
4451
	test	ah,not 1
4431
	jnz	invalid_operand_size
4452
	jnz	invalid_operand_size
4432
	cmp	al,'('
4453
	mov	[operand_size],cl
-
 
4454
	cmp	al,'('
4433
	jne	invalid_operand
4455
	jne	invalid_operand
4434
	call	get_byte_value
4456
	call	get_byte_value
4435
	mov	byte [value],al
4457
	mov	byte [value],al
4436
	pop	edx ecx ebx
4458
	pop	edx ecx ebx
4437
	call	store_instruction_with_imm8
4459
	call	store_instruction_with_imm8
4438
	jmp	instruction_assembled
4460
	jmp	instruction_assembled
4439
      mmx_nomem_imm8:
4461
      mmx_nomem_imm8:
4440
	call	store_nomem_instruction
4462
	call	store_nomem_instruction
4441
	call	append_imm8
4463
	call	append_imm8
4442
	jmp	instruction_assembled
4464
	jmp	instruction_assembled
4443
      append_imm8:
4465
      append_imm8:
4444
	mov	[operand_size],0
4466
	mov	[operand_size],0
4445
	lods	byte [esi]
4467
	lods	byte [esi]
4446
	cmp	al,','
4468
	cmp	al,','
4447
	jne	invalid_operand
4469
	jne	invalid_operand
4448
	lods	byte [esi]
4470
	lods	byte [esi]
4449
	call	get_size_operator
4471
	call	get_size_operator
4450
	test	ah,not 1
4472
	test	ah,not 1
4451
	jnz	invalid_operand_size
4473
	jnz	invalid_operand_size
4452
	cmp	al,'('
4474
	cmp	al,'('
4453
	jne	invalid_operand
4475
	jne	invalid_operand
4454
	call	get_byte_value
4476
	call	get_byte_value
4455
	stosb
4477
	stosb
4456
	ret
4478
	ret
4457
pinsrw_instruction:
4479
pinsrw_instruction:
4458
	mov	[extended_code],al
4480
	mov	[extended_code],al
4459
	mov	[base_code],0Fh
4481
	mov	[base_code],0Fh
4460
	lods	byte [esi]
4482
	lods	byte [esi]
4461
	call	get_size_operator
4483
	call	get_size_operator
4462
	cmp	al,10h
4484
	cmp	al,10h
4463
	jne	invalid_operand
4485
	jne	invalid_operand
4464
	lods	byte [esi]
4486
	lods	byte [esi]
4465
	call	convert_mmx_register
4487
	call	convert_mmx_register
4466
	call	make_mmx_prefix
4488
	call	make_mmx_prefix
4467
	mov	[postbyte_register],al
4489
	mov	[postbyte_register],al
4468
	mov	[operand_size],0
4490
	mov	[operand_size],0
4469
	lods	byte [esi]
4491
	lods	byte [esi]
4470
	cmp	al,','
4492
	cmp	al,','
4471
	jne	invalid_operand
4493
	jne	invalid_operand
4472
	lods	byte [esi]
4494
	lods	byte [esi]
4473
	call	get_size_operator
4495
	call	get_size_operator
4474
	cmp	al,10h
4496
	cmp	al,10h
4475
	je	pinsrw_mmreg_reg
4497
	je	pinsrw_mmreg_reg
4476
	cmp	al,'['
4498
	cmp	al,'['
4477
	jne	invalid_operand
4499
	jne	invalid_operand
4478
	call	get_address
4500
	call	get_address
4479
	cmp	[operand_size],0
4501
	cmp	[operand_size],0
4480
	je	mmx_imm8
4502
	je	mmx_imm8
4481
	cmp	[operand_size],2
4503
	cmp	[operand_size],2
4482
	jne	invalid_operand_size
4504
	jne	invalid_operand_size
4483
	jmp	mmx_imm8
4505
	jmp	mmx_imm8
4484
      pinsrw_mmreg_reg:
4506
      pinsrw_mmreg_reg:
4485
	lods	byte [esi]
4507
	lods	byte [esi]
4486
	call	convert_register
4508
	call	convert_register
4487
	cmp	ah,4
4509
	cmp	ah,4
4488
	jne	invalid_operand_size
4510
	jne	invalid_operand_size
4489
	mov	bl,al
4511
	mov	bl,al
4490
	jmp	mmx_nomem_imm8
4512
	jmp	mmx_nomem_imm8
4491
pshufw_instruction:
4513
pshufw_instruction:
4492
	mov	[mmx_size],8
4514
	mov	[mmx_size],8
4493
	mov	[opcode_prefix],al
4515
	mov	[opcode_prefix],al
4494
	jmp	pshuf_instruction
4516
	jmp	pshuf_instruction
4495
pshufd_instruction:
4517
pshufd_instruction:
4496
	mov	[mmx_size],16
4518
	mov	[mmx_size],16
4497
	mov	[opcode_prefix],al
4519
	mov	[opcode_prefix],al
4498
      pshuf_instruction:
4520
      pshuf_instruction:
4499
	mov	[base_code],0Fh
4521
	mov	[base_code],0Fh
4500
	mov	[extended_code],70h
4522
	mov	[extended_code],70h
4501
	lods	byte [esi]
4523
	lods	byte [esi]
4502
	call	get_size_operator
4524
	call	get_size_operator
4503
	cmp	al,10h
4525
	cmp	al,10h
4504
	jne	invalid_operand
4526
	jne	invalid_operand
4505
	lods	byte [esi]
4527
	lods	byte [esi]
4506
	call	convert_mmx_register
4528
	call	convert_mmx_register
4507
	cmp	ah,[mmx_size]
4529
	cmp	ah,[mmx_size]
4508
	jne	invalid_operand_size
4530
	jne	invalid_operand_size
4509
	mov	[postbyte_register],al
4531
	mov	[postbyte_register],al
4510
	lods	byte [esi]
4532
	lods	byte [esi]
4511
	cmp	al,','
4533
	cmp	al,','
4512
	jne	invalid_operand
4534
	jne	invalid_operand
4513
	lods	byte [esi]
4535
	lods	byte [esi]
4514
	call	get_size_operator
4536
	call	get_size_operator
4515
	cmp	al,10h
4537
	cmp	al,10h
4516
	je	pshuf_mmreg_mmreg
4538
	je	pshuf_mmreg_mmreg
4517
	cmp	al,'['
4539
	cmp	al,'['
4518
	jne	invalid_operand
4540
	jne	invalid_operand
4519
	call	get_address
4541
	call	get_address
4520
	jmp	mmx_imm8
4542
	jmp	mmx_imm8
4521
      pshuf_mmreg_mmreg:
4543
      pshuf_mmreg_mmreg:
4522
	lods	byte [esi]
4544
	lods	byte [esi]
4523
	call	convert_mmx_register
4545
	call	convert_mmx_register
4524
	mov	bl,al
4546
	mov	bl,al
4525
	jmp	mmx_nomem_imm8
4547
	jmp	mmx_nomem_imm8
4526
movd_instruction:
4548
movd_instruction:
4527
	mov	[base_code],0Fh
4549
	mov	[base_code],0Fh
4528
	mov	[extended_code],7Eh
4550
	mov	[extended_code],7Eh
4529
	lods	byte [esi]
4551
	lods	byte [esi]
4530
	call	get_size_operator
4552
	call	get_size_operator
4531
	cmp	al,10h
4553
	cmp	al,10h
4532
	je	movd_reg
4554
	je	movd_reg
4533
	cmp	al,'['
4555
	cmp	al,'['
4534
	jne	invalid_operand
4556
	jne	invalid_operand
4535
	call	get_address
4557
	call	get_address
4536
	test	[operand_size],not 4
4558
	test	[operand_size],not 4
4537
	jnz	invalid_operand_size
4559
	jnz	invalid_operand_size
4538
	mov	[operand_size],0
4560
	mov	[operand_size],0
4539
	lods	byte [esi]
4561
	lods	byte [esi]
4540
	cmp	al,','
4562
	cmp	al,','
4541
	jne	invalid_operand
4563
	jne	invalid_operand
4542
	lods	byte [esi]
4564
	lods	byte [esi]
4543
	call	get_size_operator
4565
	call	get_size_operator
4544
	cmp	al,10h
4566
	cmp	al,10h
4545
	jne	invalid_operand
4567
	jne	invalid_operand
4546
	lods	byte [esi]
4568
	lods	byte [esi]
4547
	call	convert_mmx_register
4569
	call	convert_mmx_register
4548
	call	make_mmx_prefix
4570
	call	make_mmx_prefix
4549
	mov	[postbyte_register],al
4571
	mov	[postbyte_register],al
4550
	jmp	instruction_ready
4572
	jmp	instruction_ready
4551
      movd_reg:
4573
      movd_reg:
4552
	lods	byte [esi]
4574
	lods	byte [esi]
4553
	cmp	al,0B0h
4575
	cmp	al,0B0h
4554
	jae	movd_mmreg
4576
	jae	movd_mmreg
4555
	call	convert_register
4577
	call	convert_register
4556
	cmp	ah,4
4578
	cmp	ah,4
4557
	jne	invalid_operand_size
4579
	jne	invalid_operand_size
4558
	mov	[operand_size],0
4580
	mov	[operand_size],0
4559
	mov	bl,al
4581
	mov	bl,al
4560
	lods	byte [esi]
4582
	lods	byte [esi]
4561
	cmp	al,','
4583
	cmp	al,','
4562
	jne	invalid_operand
4584
	jne	invalid_operand
4563
	lods	byte [esi]
4585
	lods	byte [esi]
4564
	call	get_size_operator
4586
	call	get_size_operator
4565
	cmp	al,10h
4587
	cmp	al,10h
4566
	jne	invalid_operand
4588
	jne	invalid_operand
4567
	lods	byte [esi]
4589
	lods	byte [esi]
4568
	call	convert_mmx_register
4590
	call	convert_mmx_register
4569
	mov	[postbyte_register],al
4591
	mov	[postbyte_register],al
4570
	call	make_mmx_prefix
4592
	call	make_mmx_prefix
4571
	jmp	nomem_instruction_ready
4593
	jmp	nomem_instruction_ready
4572
      movd_mmreg:
4594
      movd_mmreg:
4573
	mov	[extended_code],6Eh
4595
	mov	[extended_code],6Eh
4574
	call	convert_mmx_register
4596
	call	convert_mmx_register
4575
	call	make_mmx_prefix
4597
	call	make_mmx_prefix
4576
	mov	[postbyte_register],al
4598
	mov	[postbyte_register],al
4577
	mov	[operand_size],0
4599
	mov	[operand_size],0
4578
	lods	byte [esi]
4600
	lods	byte [esi]
4579
	cmp	al,','
4601
	cmp	al,','
4580
	jne	invalid_operand
4602
	jne	invalid_operand
4581
	lods	byte [esi]
4603
	lods	byte [esi]
4582
	call	get_size_operator
4604
	call	get_size_operator
4583
	cmp	al,10h
4605
	cmp	al,10h
4584
	je	movd_mmreg_reg
4606
	je	movd_mmreg_reg
4585
	cmp	al,'['
4607
	cmp	al,'['
4586
	jne	invalid_operand
4608
	jne	invalid_operand
4587
	call	get_address
4609
	call	get_address
4588
	test	[operand_size],not 4
4610
	test	[operand_size],not 4
4589
	jnz	invalid_operand_size
4611
	jnz	invalid_operand_size
4590
	jmp	instruction_ready
4612
	jmp	instruction_ready
4591
      movd_mmreg_reg:
4613
      movd_mmreg_reg:
4592
	lods	byte [esi]
4614
	lods	byte [esi]
4593
	call	convert_register
4615
	call	convert_register
4594
	cmp	ah,4
4616
	cmp	ah,4
4595
	jne	invalid_operand_size
4617
	jne	invalid_operand_size
4596
	mov	bl,al
4618
	mov	bl,al
4597
	jmp	nomem_instruction_ready
4619
	jmp	nomem_instruction_ready
4598
      make_mmx_prefix:
4620
      make_mmx_prefix:
4599
	cmp	[operand_size],16
4621
	cmp	[vex_required],0
-
 
4622
	jne	mmx_prefix_for_vex
-
 
4623
	cmp	[operand_size],16
4600
	jne	no_mmx_prefix
4624
	jne	no_mmx_prefix
4601
	mov	[operand_prefix],66h
4625
	mov	[operand_prefix],66h
4602
      no_mmx_prefix:
4626
      no_mmx_prefix:
4603
	ret
4627
	ret
4604
movq_instruction:
4628
      mmx_prefix_for_vex:
-
 
4629
	cmp	[operand_size],16
-
 
4630
	jne	invalid_operand
-
 
4631
	mov	[opcode_prefix],66h
-
 
4632
	ret
-
 
4633
movq_instruction:
4605
	mov	[base_code],0Fh
4634
	mov	[base_code],0Fh
4606
	lods	byte [esi]
4635
	lods	byte [esi]
4607
	call	get_size_operator
4636
	call	get_size_operator
4608
	cmp	al,10h
4637
	cmp	al,10h
4609
	je	movq_reg
4638
	je	movq_reg
4610
	cmp	al,'['
4639
	cmp	al,'['
4611
	jne	invalid_operand
4640
	jne	invalid_operand
4612
	call	get_address
4641
	call	get_address
4613
	test	[operand_size],not 8
4642
	test	[operand_size],not 8
4614
	jnz	invalid_operand_size
4643
	jnz	invalid_operand_size
4615
	mov	[operand_size],0
4644
	mov	[operand_size],0
4616
	lods	byte [esi]
4645
	lods	byte [esi]
4617
	cmp	al,','
4646
	cmp	al,','
4618
	jne	invalid_operand
4647
	jne	invalid_operand
4619
	lods	byte [esi]
4648
	lods	byte [esi]
4620
	cmp	al,10h
4649
	cmp	al,10h
4621
	jne	invalid_operand
4650
	jne	invalid_operand
4622
	lods	byte [esi]
4651
	lods	byte [esi]
4623
	call	convert_mmx_register
4652
	call	convert_mmx_register
4624
	mov	[postbyte_register],al
4653
	mov	[postbyte_register],al
4625
	cmp	ah,16
4654
	cmp	ah,16
4626
	je	movq_mem_xmmreg
4655
	je	movq_mem_xmmreg
4627
	mov	[extended_code],7Fh
4656
	mov	[extended_code],7Fh
4628
	jmp	instruction_ready
4657
	jmp	instruction_ready
4629
     movq_mem_xmmreg:
4658
     movq_mem_xmmreg:
4630
	mov	[extended_code],0D6h
4659
	mov	[extended_code],0D6h
4631
	mov	[opcode_prefix],66h
4660
	mov	[opcode_prefix],66h
4632
	jmp	instruction_ready
4661
	jmp	instruction_ready
4633
     movq_reg:
4662
     movq_reg:
4634
	lods	byte [esi]
4663
	lods	byte [esi]
4635
	cmp	al,0B0h
4664
	cmp	al,0B0h
4636
	jae	movq_mmreg
4665
	jae	movq_mmreg
4637
	call	convert_register
4666
	call	convert_register
4638
	cmp	ah,8
4667
	cmp	ah,8
4639
	jne	invalid_operand_size
4668
	jne	invalid_operand_size
4640
	mov	bl,al
4669
	mov	bl,al
4641
	lods	byte [esi]
4670
	lods	byte [esi]
4642
	cmp	al,','
4671
	cmp	al,','
4643
	jne	invalid_operand
4672
	jne	invalid_operand
4644
	lods	byte [esi]
4673
	lods	byte [esi]
4645
	call	get_size_operator
4674
	call	get_size_operator
4646
	cmp	al,10h
4675
	cmp	al,10h
4647
	jne	invalid_operand
4676
	jne	invalid_operand
4648
	mov	[operand_size],0
4677
	mov	[operand_size],0
4649
	lods	byte [esi]
4678
	lods	byte [esi]
4650
	call	convert_mmx_register
4679
	call	convert_mmx_register
4651
	mov	[postbyte_register],al
4680
	mov	[postbyte_register],al
4652
	call	make_mmx_prefix
4681
	call	make_mmx_prefix
4653
	mov	[extended_code],7Eh
4682
	mov	[extended_code],7Eh
4654
	call	operand_64bit
4683
	call	operand_64bit
4655
	jmp	nomem_instruction_ready
4684
	jmp	nomem_instruction_ready
4656
     movq_mmreg:
4685
     movq_mmreg:
4657
	call	convert_mmx_register
4686
	call	convert_mmx_register
4658
	mov	[postbyte_register],al
4687
	mov	[postbyte_register],al
4659
	mov	[extended_code],6Fh
4688
	mov	[extended_code],6Fh
4660
	mov	[mmx_size],ah
4689
	mov	[mmx_size],ah
4661
	cmp	ah,16
4690
	cmp	ah,16
4662
	jne	movq_mmreg_
4691
	jne	movq_mmreg_
4663
	mov	[extended_code],7Eh
4692
	mov	[extended_code],7Eh
4664
	mov	[opcode_prefix],0F3h
4693
	mov	[opcode_prefix],0F3h
4665
      movq_mmreg_:
4694
      movq_mmreg_:
4666
	lods	byte [esi]
4695
	lods	byte [esi]
4667
	cmp	al,','
4696
	cmp	al,','
4668
	jne	invalid_operand
4697
	jne	invalid_operand
4669
	mov	[operand_size],0
4698
	mov	[operand_size],0
4670
	lods	byte [esi]
4699
	lods	byte [esi]
4671
	call	get_size_operator
4700
	call	get_size_operator
4672
	cmp	al,10h
4701
	cmp	al,10h
4673
	je	movq_mmreg_reg
4702
	je	movq_mmreg_reg
4674
	call	get_address
4703
	call	get_address
4675
	test	[operand_size],not 8
4704
	test	[operand_size],not 8
4676
	jnz	invalid_operand_size
4705
	jnz	invalid_operand_size
4677
	jmp	instruction_ready
4706
	jmp	instruction_ready
4678
      movq_mmreg_reg:
4707
      movq_mmreg_reg:
4679
	lods	byte [esi]
4708
	lods	byte [esi]
4680
	cmp	al,0B0h
4709
	cmp	al,0B0h
4681
	jae	movq_mmreg_mmreg
4710
	jae	movq_mmreg_mmreg
4682
	mov	[operand_size],0
4711
	mov	[operand_size],0
4683
	call	convert_register
4712
	call	convert_register
4684
	cmp	ah,8
4713
	cmp	ah,8
4685
	jne	invalid_operand_size
4714
	jne	invalid_operand_size
4686
	mov	[extended_code],6Eh
4715
	mov	[extended_code],6Eh
4687
	mov	[opcode_prefix],0
4716
	mov	[opcode_prefix],0
4688
	mov	bl,al
4717
	mov	bl,al
4689
	cmp	[mmx_size],16
4718
	cmp	[mmx_size],16
4690
	jne	movq_mmreg_reg_store
4719
	jne	movq_mmreg_reg_store
4691
	mov	[opcode_prefix],66h
4720
	mov	[opcode_prefix],66h
4692
      movq_mmreg_reg_store:
4721
      movq_mmreg_reg_store:
4693
	call	operand_64bit
4722
	call	operand_64bit
4694
	jmp	nomem_instruction_ready
4723
	jmp	nomem_instruction_ready
4695
      movq_mmreg_mmreg:
4724
      movq_mmreg_mmreg:
4696
	call	convert_mmx_register
4725
	call	convert_mmx_register
4697
	cmp	ah,[mmx_size]
4726
	cmp	ah,[mmx_size]
4698
	jne	invalid_operand_size
4727
	jne	invalid_operand_size
4699
	mov	bl,al
4728
	mov	bl,al
4700
	jmp	nomem_instruction_ready
4729
	jmp	nomem_instruction_ready
4701
movdq_instruction:
4730
movdq_instruction:
4702
	mov	[opcode_prefix],al
4731
	mov	[opcode_prefix],al
4703
	mov	[base_code],0Fh
4732
	mov	[base_code],0Fh
4704
	mov	[extended_code],6Fh
4733
	mov	[extended_code],6Fh
4705
	lods	byte [esi]
4734
	lods	byte [esi]
4706
	call	get_size_operator
4735
	call	get_size_operator
4707
	cmp	al,10h
4736
	cmp	al,10h
4708
	je	movdq_mmreg
4737
	je	movdq_mmreg
4709
	cmp	al,'['
4738
	cmp	al,'['
4710
	jne	invalid_operand
4739
	jne	invalid_operand
4711
	call	get_address
4740
	call	get_address
4712
	lods	byte [esi]
4741
	lods	byte [esi]
4713
	cmp	al,','
4742
	cmp	al,','
4714
	jne	invalid_operand
4743
	jne	invalid_operand
4715
	lods	byte [esi]
4744
	lods	byte [esi]
4716
	call	get_size_operator
4745
	call	get_size_operator
4717
	cmp	al,10h
4746
	cmp	al,10h
4718
	jne	invalid_operand
4747
	jne	invalid_operand
4719
	lods	byte [esi]
4748
	lods	byte [esi]
4720
	call	convert_mmx_register
4749
	call	convert_xmm_register
4721
	cmp	ah,16
4750
	mov	[postbyte_register],al
4722
	jne	invalid_operand_size
-
 
4723
	mov	[postbyte_register],al
-
 
4724
	mov	[extended_code],7Fh
4751
	mov	[extended_code],7Fh
4725
	jmp	instruction_ready
4752
	jmp	instruction_ready
4726
      movdq_mmreg:
4753
      movdq_mmreg:
4727
	lods	byte [esi]
4754
	lods	byte [esi]
4728
	call	convert_mmx_register
4755
	call	convert_xmm_register
4729
	cmp	ah,16
4756
	mov	[postbyte_register],al
4730
	jne	invalid_operand_size
-
 
4731
	mov	[postbyte_register],al
-
 
4732
	lods	byte [esi]
4757
	lods	byte [esi]
4733
	cmp	al,','
4758
	cmp	al,','
4734
	jne	invalid_operand
4759
	jne	invalid_operand
4735
	lods	byte [esi]
4760
	lods	byte [esi]
4736
	call	get_size_operator
4761
	call	get_size_operator
4737
	cmp	al,10h
4762
	cmp	al,10h
4738
	je	movdq_mmreg_mmreg
4763
	je	movdq_mmreg_mmreg
4739
	cmp	al,'['
4764
	cmp	al,'['
4740
	jne	invalid_operand
4765
	jne	invalid_operand
4741
	call	get_address
4766
	call	get_address
4742
	jmp	instruction_ready
4767
	jmp	instruction_ready
4743
      movdq_mmreg_mmreg:
4768
      movdq_mmreg_mmreg:
4744
	lods	byte [esi]
4769
	lods	byte [esi]
4745
	call	convert_mmx_register
4770
	call	convert_xmm_register
4746
	cmp	ah,16
4771
	mov	bl,al
4747
	jne	invalid_operand_size
-
 
4748
	mov	bl,al
-
 
4749
	jmp	nomem_instruction_ready
4772
	jmp	nomem_instruction_ready
4750
lddqu_instruction:
4773
lddqu_instruction:
4751
	lods	byte [esi]
4774
	lods	byte [esi]
4752
	call	get_size_operator
4775
	call	get_size_operator
4753
	cmp	al,10h
4776
	cmp	al,10h
4754
	jne	invalid_operand
4777
	jne	invalid_operand
4755
	lods	byte [esi]
4778
	lods	byte [esi]
4756
	call	convert_mmx_register
4779
	call	convert_xmm_register
4757
	cmp	ah,16
4780
	push	eax
4758
	jne	invalid_operand_size
-
 
4759
	push	eax
-
 
4760
	lods	byte [esi]
4781
	lods	byte [esi]
4761
	cmp	al,','
4782
	cmp	al,','
4762
	jne	invalid_operand
4783
	jne	invalid_operand
4763
	lods	byte [esi]
4784
	lods	byte [esi]
4764
	call	get_size_operator
4785
	call	get_size_operator
4765
	cmp	al,'['
4786
	cmp	al,'['
4766
	jne	invalid_operand
4787
	jne	invalid_operand
4767
	call	get_address
4788
	call	get_address
4768
	pop	eax
4789
	pop	eax
4769
	mov	[postbyte_register],al
4790
	mov	[postbyte_register],al
4770
	mov	[opcode_prefix],0F2h
4791
	mov	[opcode_prefix],0F2h
4771
	mov	[base_code],0Fh
4792
	mov	[base_code],0Fh
4772
	mov	[extended_code],0F0h
4793
	mov	[extended_code],0F0h
4773
	jmp	instruction_ready
4794
	jmp	instruction_ready
4774
movq2dq_instruction:
4795
 
-
 
4796
movdq2q_instruction:
-
 
4797
	mov	[opcode_prefix],0F2h
-
 
4798
	mov	[mmx_size],8
-
 
4799
	jmp	movq2dq_
-
 
4800
movq2dq_instruction:
4775
	lods	byte [esi]
4801
	mov	[opcode_prefix],0F3h
4776
	call	get_size_operator
-
 
4777
	cmp	al,10h
-
 
4778
	jne	invalid_operand
-
 
4779
	lods	byte [esi]
-
 
4780
	call	convert_mmx_register
-
 
4781
	cmp	ah,16
-
 
4782
	jne	invalid_operand_size
-
 
4783
	mov	[postbyte_register],al
-
 
4784
	mov	[operand_size],0
-
 
4785
	lods	byte [esi]
-
 
4786
	cmp	al,','
-
 
4787
	jne	invalid_operand
-
 
4788
	lods	byte [esi]
-
 
4789
	call	get_size_operator
-
 
4790
	cmp	al,10h
-
 
4791
	jne	invalid_operand
-
 
4792
	lods	byte [esi]
-
 
4793
	call	convert_mmx_register
-
 
4794
	cmp	ah,8
-
 
4795
	jne	invalid_operand_size
-
 
4796
	mov	bl,al
-
 
4797
	mov	[opcode_prefix],0F3h
-
 
4798
	mov	[base_code],0Fh
4802
	mov	[mmx_size],16
4799
	mov	[extended_code],0D6h
4803
      movq2dq_:
4800
	jmp	nomem_instruction_ready
-
 
4801
movdq2q_instruction:
-
 
4802
	lods	byte [esi]
4804
	lods	byte [esi]
4803
	call	get_size_operator
4805
	call	get_size_operator
4804
	cmp	al,10h
4806
	cmp	al,10h
4805
	jne	invalid_operand
4807
	jne	invalid_operand
4806
	lods	byte [esi]
4808
	lods	byte [esi]
4807
	call	convert_mmx_register
4809
	call	convert_mmx_register
4808
	cmp	ah,8
4810
	cmp	ah,[mmx_size]
4809
	jne	invalid_operand_size
4811
	jne	invalid_operand_size
4810
	mov	[postbyte_register],al
4812
	mov	[postbyte_register],al
4811
	mov	[operand_size],0
4813
	mov	[operand_size],0
4812
	lods	byte [esi]
4814
	lods	byte [esi]
4813
	cmp	al,','
4815
	cmp	al,','
4814
	jne	invalid_operand
4816
	jne	invalid_operand
4815
	lods	byte [esi]
4817
	lods	byte [esi]
4816
	call	get_size_operator
4818
	call	get_size_operator
4817
	cmp	al,10h
4819
	cmp	al,10h
4818
	jne	invalid_operand
4820
	jne	invalid_operand
4819
	lods	byte [esi]
4821
	lods	byte [esi]
4820
	call	convert_mmx_register
4822
	call	convert_mmx_register
4821
	cmp	ah,16
4823
	xor	[mmx_size],8+16
-
 
4824
	cmp	ah,[mmx_size]
4822
	jne	invalid_operand_size
4825
	jne	invalid_operand_size
4823
	mov	bl,al
4826
	mov	bl,al
4824
	mov	[opcode_prefix],0F2h
4827
	mov	[base_code],0Fh
4825
	mov	[base_code],0Fh
-
 
4826
	mov	[extended_code],0D6h
4828
	mov	[extended_code],0D6h
4827
	jmp	nomem_instruction_ready
4829
	jmp	nomem_instruction_ready
4828
 
4830
 
4829
sse_ps_instruction_imm8:
4831
sse_ps_instruction_imm8:
4830
	mov	[immediate_size],1
4832
	mov	[immediate_size],1
4831
sse_ps_instruction:
4833
sse_ps_instruction:
4832
	mov	[mmx_size],16
4834
	mov	[mmx_size],16
4833
	jmp	sse_instruction
4835
	jmp	sse_instruction
4834
sse_pd_instruction_imm8:
4836
sse_pd_instruction_imm8:
4835
	mov	[immediate_size],1
4837
	mov	[immediate_size],1
4836
sse_pd_instruction:
4838
sse_pd_instruction:
4837
	mov	[mmx_size],16
4839
	mov	[mmx_size],16
4838
	mov	[opcode_prefix],66h
4840
	mov	[opcode_prefix],66h
4839
	jmp	sse_instruction
4841
	jmp	sse_instruction
4840
sse_ss_instruction:
4842
sse_ss_instruction:
4841
	mov	[mmx_size],4
4843
	mov	[mmx_size],4
4842
	mov	[opcode_prefix],0F3h
4844
	mov	[opcode_prefix],0F3h
4843
	jmp	sse_instruction
4845
	jmp	sse_instruction
4844
sse_sd_instruction:
4846
sse_sd_instruction:
4845
	mov	[mmx_size],8
4847
	mov	[mmx_size],8
4846
	mov	[opcode_prefix],0F2h
4848
	mov	[opcode_prefix],0F2h
4847
	jmp	sse_instruction
4849
	jmp	sse_instruction
4848
comiss_instruction:
4850
cmp_pd_instruction:
-
 
4851
	mov	[opcode_prefix],66h
-
 
4852
cmp_ps_instruction:
-
 
4853
	mov	[mmx_size],16
-
 
4854
	mov	byte [value],al
-
 
4855
	mov	al,0C2h
-
 
4856
	jmp	sse_instruction
-
 
4857
cmp_ss_instruction:
-
 
4858
	mov	[mmx_size],4
-
 
4859
	mov	[opcode_prefix],0F3h
-
 
4860
	jmp	cmp_sx_instruction
-
 
4861
cmpsd_instruction:
-
 
4862
	mov	al,0A7h
-
 
4863
	mov	ah,[esi]
-
 
4864
	or	ah,ah
-
 
4865
	jz	simple_instruction_32bit
-
 
4866
	cmp	ah,0Fh
-
 
4867
	je	simple_instruction_32bit
-
 
4868
	mov	al,-1
-
 
4869
cmp_sd_instruction:
-
 
4870
	mov	[mmx_size],8
-
 
4871
	mov	[opcode_prefix],0F2h
-
 
4872
      cmp_sx_instruction:
-
 
4873
	mov	byte [value],al
-
 
4874
	mov	al,0C2h
-
 
4875
	jmp	sse_instruction
-
 
4876
comiss_instruction:
4849
	mov	[mmx_size],4
4877
	mov	[mmx_size],4
4850
	jmp	sse_instruction
4878
	jmp	sse_instruction
4851
comisd_instruction:
4879
comisd_instruction:
4852
	mov	[mmx_size],8
4880
	mov	[mmx_size],8
4853
	mov	[opcode_prefix],66h
4881
	mov	[opcode_prefix],66h
4854
	jmp	sse_instruction
4882
	jmp	sse_instruction
4855
cvtps2pd_instruction:
4883
cvtdq2pd_instruction:
-
 
4884
	mov	[opcode_prefix],0F3h
-
 
4885
cvtps2pd_instruction:
4856
	mov	[mmx_size],8
4886
	mov	[mmx_size],8
4857
	jmp	sse_instruction
4887
	jmp	sse_instruction
4858
cvtpd2dq_instruction:
4888
cvtpd2dq_instruction:
4859
	mov	[mmx_size],16
4889
	mov	[mmx_size],16
4860
	mov	[opcode_prefix],0F2h
4890
	mov	[opcode_prefix],0F2h
4861
	jmp	sse_instruction
4891
	jmp	sse_instruction
4862
cvtdq2pd_instruction:
4892
movshdup_instruction:
4863
	mov	[mmx_size],16
4893
	mov	[mmx_size],16
4864
	mov	[opcode_prefix],0F3h
4894
	mov	[opcode_prefix],0F3h
4865
sse_instruction:
4895
sse_instruction:
4866
	mov	[base_code],0Fh
4896
	mov	[base_code],0Fh
4867
	mov	[extended_code],al
4897
	mov	[extended_code],al
4868
	lods	byte [esi]
4898
	lods	byte [esi]
4869
	call	get_size_operator
4899
	call	get_size_operator
4870
	cmp	al,10h
4900
	cmp	al,10h
4871
	jne	invalid_operand
4901
	jne	invalid_operand
4872
      sse_xmmreg:
4902
      sse_xmmreg:
4873
	lods	byte [esi]
4903
	lods	byte [esi]
4874
	call	convert_mmx_register
4904
	call	convert_xmm_register
4875
	cmp	ah,16
4905
      sse_reg:
4876
	jne	invalid_operand_size
-
 
4877
      sse_reg:
-
 
4878
	mov	[postbyte_register],al
4906
	mov	[postbyte_register],al
4879
	mov	[operand_size],0
4907
	mov	[operand_size],0
4880
	lods	byte [esi]
4908
	lods	byte [esi]
4881
	cmp	al,','
4909
	cmp	al,','
4882
	jne	invalid_operand
4910
	jne	invalid_operand
4883
	lods	byte [esi]
4911
	lods	byte [esi]
4884
	call	get_size_operator
4912
	call	get_size_operator
4885
	cmp	al,10h
4913
	cmp	al,10h
4886
	je	sse_xmmreg_xmmreg
4914
	je	sse_xmmreg_xmmreg
4887
      sse_reg_mem:
4915
      sse_reg_mem:
4888
	cmp	al,'['
4916
	cmp	al,'['
4889
	jne	invalid_operand
4917
	jne	invalid_operand
4890
	call	get_address
4918
	call	get_address
4891
	cmp	[operand_size],0
4919
	cmp	[operand_size],0
4892
	je	sse_mem_size_ok
4920
	je	sse_mem_size_ok
4893
	mov	al,[mmx_size]
4921
	mov	al,[mmx_size]
4894
	cmp	[operand_size],al
4922
	cmp	[operand_size],al
4895
	jne	invalid_operand_size
4923
	jne	invalid_operand_size
4896
      sse_mem_size_ok:
4924
      sse_mem_size_ok:
4897
	cmp	[immediate_size],1
4925
	mov	al,[extended_code]
-
 
4926
	mov	ah,[supplemental_code]
-
 
4927
	cmp	al,0C2h
-
 
4928
	je	sse_cmp_mem_ok
-
 
4929
	cmp	ax,443Ah
-
 
4930
	je	sse_cmp_mem_ok
-
 
4931
	cmp	[immediate_size],1
4898
	je	mmx_imm8
4932
	je	mmx_imm8
4899
	cmp	[immediate_size],-1
4933
	cmp	[immediate_size],-1
4900
	jne	sse_ok
4934
	jne	sse_ok
4901
	call	take_additional_xmm0
4935
	call	take_additional_xmm0
4902
	mov	[immediate_size],0
4936
	mov	[immediate_size],0
4903
      sse_ok:
4937
      sse_ok:
4904
	jmp	instruction_ready
4938
	jmp	instruction_ready
4905
      sse_xmmreg_xmmreg:
4939
      sse_cmp_mem_ok:
-
 
4940
	cmp	byte [value],-1
-
 
4941
	je	mmx_imm8
-
 
4942
	call	store_instruction_with_imm8
-
 
4943
	jmp	instruction_assembled
-
 
4944
      sse_xmmreg_xmmreg:
4906
	cmp	[operand_prefix],66h
4945
	cmp	[operand_prefix],66h
4907
	jne	sse_xmmreg_xmmreg_ok
4946
	jne	sse_xmmreg_xmmreg_ok
4908
	cmp	[extended_code],12h
4947
	cmp	[extended_code],12h
4909
	je	invalid_operand
4948
	je	invalid_operand
4910
	cmp	[extended_code],16h
4949
	cmp	[extended_code],16h
4911
	je	invalid_operand
4950
	je	invalid_operand
4912
      sse_xmmreg_xmmreg_ok:
4951
      sse_xmmreg_xmmreg_ok:
4913
	lods	byte [esi]
4952
	lods	byte [esi]
4914
	call	convert_mmx_register
4953
	call	convert_xmm_register
4915
	cmp	ah,16
4954
	mov	bl,al
4916
	jne	invalid_operand_size
-
 
4917
	mov	bl,al
-
 
4918
	cmp	[immediate_size],1
4955
	mov	al,[extended_code]
-
 
4956
	mov	ah,[supplemental_code]
-
 
4957
	cmp	al,0C2h
-
 
4958
	je	sse_cmp_nomem_ok
-
 
4959
	cmp	ax,443Ah
-
 
4960
	je	sse_cmp_nomem_ok
-
 
4961
	cmp	[immediate_size],1
4919
	je	mmx_nomem_imm8
4962
	je	mmx_nomem_imm8
4920
	cmp	[immediate_size],-1
4963
	cmp	[immediate_size],-1
4921
	jne	sse_nomem_ok
4964
	jne	sse_nomem_ok
4922
	call	take_additional_xmm0
4965
	call	take_additional_xmm0
4923
	mov	[immediate_size],0
4966
	mov	[immediate_size],0
4924
      sse_nomem_ok:
4967
      sse_nomem_ok:
4925
	jmp	nomem_instruction_ready
4968
	jmp	nomem_instruction_ready
4926
      take_additional_xmm0:
4969
      sse_cmp_nomem_ok:
-
 
4970
	cmp	byte [value],-1
-
 
4971
	je	mmx_nomem_imm8
-
 
4972
	call	store_nomem_instruction
-
 
4973
	mov	al,byte [value]
-
 
4974
	stosb
-
 
4975
	jmp	instruction_assembled
-
 
4976
      take_additional_xmm0:
4927
	cmp	byte [esi],','
4977
	cmp	byte [esi],','
4928
	jne	additional_xmm0_ok
4978
	jne	additional_xmm0_ok
4929
	inc	esi
4979
	inc	esi
4930
	lods	byte [esi]
4980
	lods	byte [esi]
4931
	cmp	al,10h
4981
	cmp	al,10h
4932
	jne	invalid_operand
4982
	jne	invalid_operand
4933
	lods	byte [esi]
4983
	lods	byte [esi]
4934
	call	convert_mmx_register
4984
	call	convert_xmm_register
4935
	cmp	ah,16
4985
	test	al,al
4936
	jne	invalid_operand_size
-
 
4937
	test	al,al
-
 
4938
	jnz	invalid_operand
4986
	jnz	invalid_operand
4939
      additional_xmm0_ok:
4987
      additional_xmm0_ok:
4940
	ret
4988
	ret
4941
 
4989
 
4942
ps_dq_instruction:
4990
pslldq_instruction:
4943
	mov	[postbyte_register],al
4991
	mov	[postbyte_register],al
4944
	mov	[opcode_prefix],66h
4992
	mov	[opcode_prefix],66h
4945
	mov	[base_code],0Fh
4993
	mov	[base_code],0Fh
4946
	mov	[extended_code],73h
4994
	mov	[extended_code],73h
4947
	lods	byte [esi]
4995
	lods	byte [esi]
4948
	call	get_size_operator
4996
	call	get_size_operator
4949
	cmp	al,10h
4997
	cmp	al,10h
4950
	jne	invalid_operand
4998
	jne	invalid_operand
4951
	lods	byte [esi]
4999
	lods	byte [esi]
4952
	call	convert_mmx_register
5000
	call	convert_xmm_register
4953
	cmp	ah,16
5001
	mov	bl,al
4954
	jne	invalid_operand_size
-
 
4955
	mov	bl,al
-
 
4956
	jmp	mmx_nomem_imm8
5002
	jmp	mmx_nomem_imm8
4957
movpd_instruction:
5003
movpd_instruction:
4958
	mov	[opcode_prefix],66h
5004
	mov	[opcode_prefix],66h
4959
movps_instruction:
5005
movps_instruction:
4960
	mov	[base_code],0Fh
5006
	mov	[base_code],0Fh
4961
	mov	[extended_code],al
5007
	mov	[extended_code],al
4962
	mov	[mmx_size],16
5008
	mov	[mmx_size],16
4963
	jmp	sse_mov_instruction
5009
	jmp	sse_mov_instruction
4964
movss_instruction:
5010
movss_instruction:
4965
	mov	[mmx_size],4
5011
	mov	[mmx_size],4
4966
	mov	[opcode_prefix],0F3h
5012
	mov	[opcode_prefix],0F3h
4967
	jmp	sse_movs
5013
	jmp	sse_movs
4968
movsd_instruction:
5014
movsd_instruction:
4969
	mov	al,0A5h
5015
	mov	al,0A5h
4970
	mov	ah,[esi]
5016
	mov	ah,[esi]
4971
	or	ah,ah
5017
	or	ah,ah
4972
	jz	simple_instruction_32bit
5018
	jz	simple_instruction_32bit
4973
	cmp	ah,0Fh
5019
	cmp	ah,0Fh
4974
	je	simple_instruction_32bit
5020
	je	simple_instruction_32bit
4975
	mov	[mmx_size],8
5021
	mov	[mmx_size],8
4976
	mov	[opcode_prefix],0F2h
5022
	mov	[opcode_prefix],0F2h
4977
      sse_movs:
5023
      sse_movs:
4978
	mov	[base_code],0Fh
5024
	mov	[base_code],0Fh
4979
	mov	[extended_code],10h
5025
	mov	[extended_code],10h
4980
	jmp	sse_mov_instruction
5026
	jmp	sse_mov_instruction
4981
sse_mov_instruction:
5027
sse_mov_instruction:
4982
	lods	byte [esi]
5028
	lods	byte [esi]
4983
	call	get_size_operator
5029
	call	get_size_operator
4984
	cmp	al,10h
5030
	cmp	al,10h
4985
	je	sse_xmmreg
5031
	je	sse_xmmreg
4986
      sse_mem:
5032
      sse_mem:
4987
	cmp	al,'['
5033
	cmp	al,'['
4988
	jne	invalid_operand
5034
	jne	invalid_operand
4989
	inc	[extended_code]
5035
	inc	[extended_code]
4990
	call	get_address
5036
	call	get_address
4991
	cmp	[operand_size],0
5037
	cmp	[operand_size],0
4992
	je	sse_mem_xmmreg
5038
	je	sse_mem_xmmreg
4993
	mov	al,[mmx_size]
5039
	mov	al,[mmx_size]
4994
	cmp	[operand_size],al
5040
	cmp	[operand_size],al
4995
	jne	invalid_operand_size
5041
	jne	invalid_operand_size
4996
	mov	[operand_size],0
5042
	mov	[operand_size],0
4997
      sse_mem_xmmreg:
5043
      sse_mem_xmmreg:
4998
	lods	byte [esi]
5044
	lods	byte [esi]
4999
	cmp	al,','
5045
	cmp	al,','
5000
	jne	invalid_operand
5046
	jne	invalid_operand
5001
	lods	byte [esi]
5047
	lods	byte [esi]
5002
	call	get_size_operator
5048
	call	get_size_operator
5003
	cmp	al,10h
5049
	cmp	al,10h
5004
	jne	invalid_operand
5050
	jne	invalid_operand
5005
	lods	byte [esi]
5051
	lods	byte [esi]
5006
	call	convert_mmx_register
5052
	call	convert_xmm_register
5007
	cmp	ah,16
5053
	mov	[postbyte_register],al
5008
	jne	invalid_operand_size
-
 
5009
	mov	[postbyte_register],al
-
 
5010
	jmp	instruction_ready
5054
	jmp	instruction_ready
5011
movlpd_instruction:
5055
movlpd_instruction:
5012
	mov	[opcode_prefix],66h
5056
	mov	[opcode_prefix],66h
5013
movlps_instruction:
5057
movlps_instruction:
5014
	mov	[base_code],0Fh
5058
	mov	[base_code],0Fh
5015
	mov	[extended_code],al
5059
	mov	[extended_code],al
5016
	mov	[mmx_size],8
5060
	mov	[mmx_size],8
5017
	lods	byte [esi]
5061
	lods	byte [esi]
5018
	call	get_size_operator
5062
	call	get_size_operator
5019
	cmp	al,10h
5063
	cmp	al,10h
5020
	jne	sse_mem
5064
	jne	sse_mem
5021
	lods	byte [esi]
5065
	lods	byte [esi]
5022
	call	convert_mmx_register
5066
	call	convert_xmm_register
5023
	cmp	ah,16
5067
	mov	[postbyte_register],al
5024
	jne	invalid_operand_size
-
 
5025
	mov	[postbyte_register],al
-
 
5026
	mov	[operand_size],0
5068
	mov	[operand_size],0
5027
	lods	byte [esi]
5069
	lods	byte [esi]
5028
	cmp	al,','
5070
	cmp	al,','
5029
	jne	invalid_operand
5071
	jne	invalid_operand
5030
	lods	byte [esi]
5072
	lods	byte [esi]
5031
	call	get_size_operator
5073
	call	get_size_operator
5032
	jmp	sse_reg_mem
5074
	jmp	sse_reg_mem
5033
movhlps_instruction:
5075
movhlps_instruction:
5034
	mov	[base_code],0Fh
5076
	mov	[base_code],0Fh
5035
	mov	[extended_code],al
5077
	mov	[extended_code],al
5036
	mov	[mmx_size],0
5078
	mov	[mmx_size],0
5037
	lods	byte [esi]
5079
	lods	byte [esi]
5038
	call	get_size_operator
5080
	call	get_size_operator
5039
	cmp	al,10h
5081
	cmp	al,10h
5040
	jne	invalid_operand
5082
	jne	invalid_operand
5041
	lods	byte [esi]
5083
	lods	byte [esi]
5042
	call	convert_mmx_register
5084
	call	convert_xmm_register
5043
	cmp	ah,16
5085
	mov	[postbyte_register],al
5044
	jne	invalid_operand_size
-
 
5045
	mov	[postbyte_register],al
-
 
5046
	lods	byte [esi]
5086
	lods	byte [esi]
5047
	cmp	al,','
5087
	cmp	al,','
5048
	jne	invalid_operand
5088
	jne	invalid_operand
5049
	lods	byte [esi]
5089
	lods	byte [esi]
5050
	call	get_size_operator
5090
	call	get_size_operator
5051
	cmp	al,10h
5091
	cmp	al,10h
5052
	je	sse_xmmreg_xmmreg_ok
5092
	je	sse_xmmreg_xmmreg_ok
5053
	jmp	invalid_operand
5093
	jmp	invalid_operand
5054
maskmovq_instruction:
5094
maskmovq_instruction:
5055
	mov	cl,8
5095
	mov	cl,8
5056
	jmp	maskmov_instruction
5096
	jmp	maskmov_instruction
5057
maskmovdqu_instruction:
5097
maskmovdqu_instruction:
5058
	mov	cl,16
5098
	mov	cl,16
5059
	mov	[opcode_prefix],66h
5099
	mov	[opcode_prefix],66h
5060
      maskmov_instruction:
5100
      maskmov_instruction:
5061
	mov	[base_code],0Fh
5101
	mov	[base_code],0Fh
5062
	mov	[extended_code],0F7h
5102
	mov	[extended_code],0F7h
5063
	lods	byte [esi]
5103
	lods	byte [esi]
5064
	call	get_size_operator
5104
	call	get_size_operator
5065
	cmp	al,10h
5105
	cmp	al,10h
5066
	jne	invalid_operand
5106
	jne	invalid_operand
5067
	lods	byte [esi]
5107
	lods	byte [esi]
5068
	call	convert_mmx_register
5108
	call	convert_mmx_register
5069
	cmp	ah,cl
5109
	cmp	ah,cl
5070
	jne	invalid_operand_size
5110
	jne	invalid_operand_size
5071
	mov	[postbyte_register],al
5111
	mov	[postbyte_register],al
5072
	lods	byte [esi]
5112
	lods	byte [esi]
5073
	cmp	al,','
5113
	cmp	al,','
5074
	jne	invalid_operand
5114
	jne	invalid_operand
5075
	lods	byte [esi]
5115
	lods	byte [esi]
5076
	call	get_size_operator
5116
	call	get_size_operator
5077
	cmp	al,10h
5117
	cmp	al,10h
5078
	jne	invalid_operand
5118
	jne	invalid_operand
5079
	lods	byte [esi]
5119
	lods	byte [esi]
5080
	call	convert_mmx_register
5120
	call	convert_mmx_register
5081
	mov	bl,al
5121
	mov	bl,al
5082
	jmp	nomem_instruction_ready
5122
	jmp	nomem_instruction_ready
5083
movmskpd_instruction:
5123
movmskpd_instruction:
5084
	mov	[opcode_prefix],66h
5124
	mov	[opcode_prefix],66h
5085
movmskps_instruction:
5125
movmskps_instruction:
5086
	mov	[base_code],0Fh
5126
	mov	[base_code],0Fh
5087
	mov	[extended_code],50h
5127
	mov	[extended_code],50h
5088
	lods	byte [esi]
5128
	lods	byte [esi]
5089
	call	get_size_operator
5129
	call	get_size_operator
5090
	cmp	al,10h
5130
	cmp	al,10h
5091
	jne	invalid_operand
5131
	jne	invalid_operand
5092
	lods	byte [esi]
5132
	lods	byte [esi]
5093
	call	convert_register
5133
	call	convert_register
5094
	cmp	ah,4
5134
	mov	[postbyte_register],al
5095
	jne	invalid_operand_size
-
 
5096
	mov	[operand_size],0
-
 
5097
	mov	[postbyte_register],al
-
 
5098
	lods	byte [esi]
5135
	cmp	ah,4
5099
	cmp	al,','
-
 
5100
	jne	invalid_operand
-
 
5101
	lods	byte [esi]
-
 
5102
	call	get_size_operator
-
 
5103
	cmp	al,10h
-
 
5104
	jne	invalid_operand
-
 
5105
	lods	byte [esi]
-
 
5106
	call	convert_mmx_register
-
 
5107
	cmp	ah,16
-
 
5108
	jne	invalid_operand_size
5136
	je	movmskps_reg_ok
5109
	mov	bl,al
-
 
5110
	jmp	nomem_instruction_ready
-
 
5111
cmppd_instruction:
-
 
5112
	mov	[opcode_prefix],66h
-
 
5113
cmpps_instruction:
-
 
5114
	mov	[base_code],0Fh
-
 
5115
	mov	[extended_code],0C2h
-
 
5116
	mov	[mmx_size],16
-
 
5117
	mov	byte [value],-1
-
 
5118
	jmp	sse_cmp_instruction
-
 
5119
cmp_pd_instruction:
-
 
5120
	mov	[opcode_prefix],66h
-
 
5121
cmp_ps_instruction:
-
 
5122
	mov	[base_code],0Fh
-
 
5123
	mov	[extended_code],0C2h
-
 
5124
	mov	[mmx_size],16
-
 
5125
	mov	byte [value],al
-
 
5126
	jmp	sse_cmp_instruction
-
 
5127
cmpss_instruction:
-
 
5128
	mov	[mmx_size],4
-
 
5129
	mov	[opcode_prefix],0F3h
-
 
5130
	jmp	cmpsx_instruction
-
 
5131
cmpsd_instruction:
-
 
5132
	mov	al,0A7h
-
 
5133
	mov	ah,[esi]
-
 
5134
	or	ah,ah
-
 
5135
	jz	simple_instruction_32bit
-
 
5136
	cmp	ah,0Fh
-
 
5137
	je	simple_instruction_32bit
-
 
5138
	mov	[mmx_size],8
-
 
5139
	mov	[opcode_prefix],0F2h
-
 
5140
      cmpsx_instruction:
-
 
5141
	mov	[base_code],0Fh
-
 
5142
	mov	[extended_code],0C2h
-
 
5143
	mov	byte [value],-1
-
 
5144
	jmp	sse_cmp_instruction
-
 
5145
cmp_ss_instruction:
-
 
5146
	mov	[mmx_size],4
-
 
5147
	mov	[opcode_prefix],0F3h
-
 
5148
	jmp	cmp_sx_instruction
-
 
5149
cmp_sd_instruction:
-
 
5150
	mov	[mmx_size],8
-
 
5151
	mov	[opcode_prefix],0F2h
-
 
5152
      cmp_sx_instruction:
-
 
5153
	mov	[base_code],0Fh
-
 
5154
	mov	[extended_code],0C2h
-
 
5155
	mov	byte [value],al
-
 
5156
sse_cmp_instruction:
-
 
5157
	lods	byte [esi]
-
 
5158
	call	get_size_operator
-
 
5159
	cmp	al,10h
-
 
5160
	jne	invalid_operand
-
 
5161
	lods	byte [esi]
5137
	cmp	ah,8
5162
	call	convert_mmx_register
-
 
5163
	cmp	ah,16
-
 
5164
	jne	invalid_operand_size
5138
	jne	invalid_operand_size
5165
	mov	[postbyte_register],al
5139
	cmp	[code_type],64
5166
	lods	byte [esi]
5140
	jne	invalid_operand
5167
	cmp	al,','
-
 
5168
	jne	invalid_operand
-
 
5169
	mov	[operand_size],0
5141
      movmskps_reg_ok:
5170
	lods	byte [esi]
-
 
5171
	call	get_size_operator
-
 
5172
	cmp	al,10h
-
 
5173
	je	sse_cmp_xmmreg_xmmreg
-
 
5174
	cmp	al,'['
-
 
5175
	jne	invalid_operand
-
 
5176
	call	get_address
-
 
5177
	mov	al,[operand_size]
-
 
5178
	or	al,al
-
 
5179
	jz	sse_cmp_size_ok
-
 
5180
	cmp	al,[mmx_size]
-
 
5181
	jne	invalid_operand_size
-
 
5182
      sse_cmp_size_ok:
-
 
5183
	push	ebx ecx edx
5142
	mov	[operand_size],0
5184
	call	get_nextbyte
-
 
5185
	pop	edx ecx ebx
-
 
5186
	call	store_instruction_with_imm8
-
 
5187
	jmp	instruction_assembled
-
 
5188
      sse_cmp_xmmreg_xmmreg:
-
 
5189
	lods	byte [esi]
-
 
5190
	call	convert_mmx_register
-
 
5191
	cmp	ah,16
-
 
5192
	jne	invalid_operand_size
-
 
5193
	mov	bl,al
-
 
5194
	call	store_nomem_instruction
-
 
5195
	call	get_nextbyte
-
 
5196
	mov	al,byte [value]
-
 
5197
	stos	byte [edi]
-
 
5198
	jmp	instruction_assembled
-
 
5199
      get_nextbyte:
-
 
5200
	cmp	byte [value],-1
-
 
5201
	jne	nextbyte_ok
-
 
5202
	mov	[operand_size],0
-
 
5203
	lods	byte [esi]
5143
	lods	byte [esi]
5204
	cmp	al,','
5144
	cmp	al,','
5205
	jne	invalid_operand
5145
	jne	invalid_operand
5206
	lods	byte [esi]
5146
	lods	byte [esi]
5207
	call	get_size_operator
5147
	call	get_size_operator
5208
	test	[operand_size],not 1
5148
	cmp	al,10h
5209
	jnz	invalid_value
-
 
5210
	cmp	al,'('
-
 
5211
	jne	invalid_operand
5149
	je	sse_xmmreg_xmmreg_ok
5212
	call	get_byte_value
5150
	jmp	invalid_operand
5213
	cmp	al,7
-
 
5214
	ja	invalid_value
-
 
5215
	mov	byte [value],al
5151
 
5216
      nextbyte_ok:
-
 
5217
	ret
-
 
5218
cvtpi2pd_instruction:
5152
cvtpi2pd_instruction:
5219
	mov	[opcode_prefix],66h
5153
	mov	[opcode_prefix],66h
5220
cvtpi2ps_instruction:
5154
cvtpi2ps_instruction:
5221
	mov	[base_code],0Fh
5155
	mov	[base_code],0Fh
5222
	mov	[extended_code],al
5156
	mov	[extended_code],al
5223
	lods	byte [esi]
5157
	lods	byte [esi]
5224
	call	get_size_operator
5158
	call	get_size_operator
5225
	cmp	al,10h
5159
	cmp	al,10h
5226
	jne	invalid_operand
5160
	jne	invalid_operand
5227
	lods	byte [esi]
5161
	lods	byte [esi]
5228
	call	convert_mmx_register
5162
	call	convert_xmm_register
5229
	cmp	ah,16
5163
	mov	[postbyte_register],al
5230
	jne	invalid_operand_size
-
 
5231
	mov	[postbyte_register],al
-
 
5232
	mov	[operand_size],0
5164
	mov	[operand_size],0
5233
	lods	byte [esi]
5165
	lods	byte [esi]
5234
	cmp	al,','
5166
	cmp	al,','
5235
	jne	invalid_operand
5167
	jne	invalid_operand
5236
	lods	byte [esi]
5168
	lods	byte [esi]
5237
	call	get_size_operator
5169
	call	get_size_operator
5238
	cmp	al,10h
5170
	cmp	al,10h
5239
	je	cvtpi_xmmreg_xmmreg
5171
	je	cvtpi_xmmreg_xmmreg
5240
	cmp	al,'['
5172
	cmp	al,'['
5241
	jne	invalid_operand
5173
	jne	invalid_operand
5242
	call	get_address
5174
	call	get_address
5243
	cmp	[operand_size],0
5175
	cmp	[operand_size],0
5244
	je	cvtpi_size_ok
5176
	je	cvtpi_size_ok
5245
	cmp	[operand_size],8
5177
	cmp	[operand_size],8
5246
	jne	invalid_operand_size
5178
	jne	invalid_operand_size
5247
      cvtpi_size_ok:
5179
      cvtpi_size_ok:
5248
	jmp	instruction_ready
5180
	jmp	instruction_ready
5249
      cvtpi_xmmreg_xmmreg:
5181
      cvtpi_xmmreg_xmmreg:
5250
	lods	byte [esi]
5182
	lods	byte [esi]
5251
	call	convert_mmx_register
5183
	call	convert_mmx_register
5252
	cmp	ah,8
5184
	cmp	ah,8
5253
	jne	invalid_operand_size
5185
	jne	invalid_operand_size
5254
	mov	bl,al
5186
	mov	bl,al
5255
	jmp	nomem_instruction_ready
5187
	jmp	nomem_instruction_ready
5256
cvtsi2ss_instruction:
5188
cvtsi2ss_instruction:
5257
	mov	[opcode_prefix],0F3h
5189
	mov	[opcode_prefix],0F3h
5258
	jmp	cvtsi_instruction
5190
	jmp	cvtsi_instruction
5259
cvtsi2sd_instruction:
5191
cvtsi2sd_instruction:
5260
	mov	[opcode_prefix],0F2h
5192
	mov	[opcode_prefix],0F2h
5261
      cvtsi_instruction:
5193
      cvtsi_instruction:
5262
	mov	[base_code],0Fh
5194
	mov	[base_code],0Fh
5263
	mov	[extended_code],al
5195
	mov	[extended_code],al
5264
	lods	byte [esi]
5196
	lods	byte [esi]
5265
	call	get_size_operator
5197
	call	get_size_operator
5266
	cmp	al,10h
5198
	cmp	al,10h
5267
	jne	invalid_operand
5199
	jne	invalid_operand
5268
	lods	byte [esi]
5200
	lods	byte [esi]
5269
	call	convert_mmx_register
5201
	call	convert_xmm_register
5270
	cmp	ah,16
5202
	mov	[postbyte_register],al
5271
	jne	invalid_operand_size
-
 
5272
	mov	[postbyte_register],al
-
 
5273
	mov	[operand_size],0
5203
      cvtsi_xmmreg:
-
 
5204
	mov	[operand_size],0
5274
	lods	byte [esi]
5205
	lods	byte [esi]
5275
	cmp	al,','
5206
	cmp	al,','
5276
	jne	invalid_operand
5207
	jne	invalid_operand
5277
	lods	byte [esi]
5208
	lods	byte [esi]
5278
	call	get_size_operator
5209
	call	get_size_operator
5279
	cmp	al,10h
5210
	cmp	al,10h
5280
	je	cvtsi_xmmreg_reg
5211
	je	cvtsi_xmmreg_reg
5281
	cmp	al,'['
5212
	cmp	al,'['
5282
	jne	invalid_operand
5213
	jne	invalid_operand
5283
	call	get_address
5214
	call	get_address
5284
	cmp	[operand_size],0
5215
	cmp	[operand_size],0
5285
	je	cvtsi_size_ok
5216
	je	cvtsi_size_ok
5286
	cmp	[operand_size],4
5217
	cmp	[operand_size],4
5287
	jne	invalid_operand_size
5218
	je	cvtsi_size_ok
-
 
5219
	cmp	[operand_size],8
-
 
5220
	jne	invalid_operand_size
5288
      cvtsi_size_ok:
5221
	call	operand_64bit
-
 
5222
      cvtsi_size_ok:
5289
	jmp	instruction_ready
5223
	jmp	instruction_ready
5290
      cvtsi_xmmreg_reg:
5224
      cvtsi_xmmreg_reg:
5291
	lods	byte [esi]
5225
	lods	byte [esi]
5292
	call	convert_register
5226
	call	convert_register
5293
	cmp	ah,4
5227
	cmp	ah,4
5294
	je	cvtsi_xmmreg_reg_store
5228
	je	cvtsi_xmmreg_reg_store
5295
	cmp	ah,8
5229
	cmp	ah,8
5296
	jne	invalid_operand_size
5230
	jne	invalid_operand_size
5297
	call	operand_64bit
5231
	call	operand_64bit
5298
      cvtsi_xmmreg_reg_store:
5232
      cvtsi_xmmreg_reg_store:
5299
	mov	bl,al
5233
	mov	bl,al
5300
	jmp	nomem_instruction_ready
5234
	jmp	nomem_instruction_ready
5301
cvtps2pi_instruction:
5235
cvtps2pi_instruction:
5302
	mov	[mmx_size],8
5236
	mov	[mmx_size],8
5303
	jmp	cvtpd_instruction
5237
	jmp	cvtpd_instruction
5304
cvtpd2pi_instruction:
5238
cvtpd2pi_instruction:
5305
	mov	[opcode_prefix],66h
5239
	mov	[opcode_prefix],66h
5306
	mov	[mmx_size],16
5240
	mov	[mmx_size],16
5307
      cvtpd_instruction:
5241
      cvtpd_instruction:
5308
	mov	[base_code],0Fh
5242
	mov	[base_code],0Fh
5309
	mov	[extended_code],al
5243
	mov	[extended_code],al
5310
	lods	byte [esi]
5244
	lods	byte [esi]
5311
	call	get_size_operator
5245
	call	get_size_operator
5312
	cmp	al,10h
5246
	cmp	al,10h
5313
	jne	invalid_operand
5247
	jne	invalid_operand
5314
	lods	byte [esi]
5248
	lods	byte [esi]
5315
	call	convert_mmx_register
5249
	call	convert_mmx_register
5316
	cmp	ah,8
5250
	cmp	ah,8
5317
	jne	invalid_operand_size
5251
	jne	invalid_operand_size
5318
	mov	[operand_size],0
5252
	mov	[operand_size],0
5319
	jmp	sse_reg
5253
	jmp	sse_reg
5320
cvtss2si_instruction:
5254
cvtss2si_instruction:
5321
	mov	[opcode_prefix],0F3h
5255
	mov	[opcode_prefix],0F3h
5322
	mov	[mmx_size],4
5256
	mov	[mmx_size],4
5323
	jmp	cvt2si_instruction
5257
	jmp	cvt2si_instruction
5324
cvtsd2si_instruction:
5258
cvtsd2si_instruction:
5325
	mov	[opcode_prefix],0F2h
5259
	mov	[opcode_prefix],0F2h
5326
	mov	[mmx_size],8
5260
	mov	[mmx_size],8
5327
      cvt2si_instruction:
5261
      cvt2si_instruction:
5328
	mov	[extended_code],al
5262
	mov	[extended_code],al
5329
	mov	[base_code],0Fh
5263
	mov	[base_code],0Fh
5330
	lods	byte [esi]
5264
	lods	byte [esi]
5331
	call	get_size_operator
5265
	call	get_size_operator
5332
	cmp	al,10h
5266
	cmp	al,10h
5333
	jne	invalid_operand
5267
	jne	invalid_operand
5334
	lods	byte [esi]
5268
	lods	byte [esi]
5335
	call	convert_register
5269
	call	convert_register
5336
	mov	[operand_size],0
5270
	mov	[operand_size],0
5337
	cmp	ah,4
5271
	cmp	ah,4
5338
	je	sse_reg
5272
	je	sse_reg
5339
	cmp	ah,8
5273
	cmp	ah,8
5340
	jne	invalid_operand_size
5274
	jne	invalid_operand_size
5341
	call	operand_64bit
5275
	call	operand_64bit
5342
	jmp	sse_reg
5276
	jmp	sse_reg
5343
 
5277
 
5344
ssse3_instruction:
5278
ssse3_instruction:
5345
	mov	[base_code],0Fh
5279
	mov	[base_code],0Fh
5346
	mov	[extended_code],38h
5280
	mov	[extended_code],38h
5347
	mov	[supplemental_code],al
5281
	mov	[supplemental_code],al
5348
	jmp	mmx_instruction
5282
	jmp	mmx_instruction
5349
palignr_instruction:
5283
palignr_instruction:
5350
	mov	[base_code],0Fh
5284
	mov	[base_code],0Fh
5351
	mov	[extended_code],3Ah
5285
	mov	[extended_code],3Ah
5352
	mov	[supplemental_code],0Fh
5286
	mov	[supplemental_code],0Fh
5353
	lods	byte [esi]
5287
	lods	byte [esi]
5354
	call	get_size_operator
5288
	call	get_size_operator
5355
	cmp	al,10h
5289
	cmp	al,10h
5356
	jne	invalid_operand
5290
	jne	invalid_operand
5357
	lods	byte [esi]
5291
	lods	byte [esi]
5358
	call	convert_mmx_register
5292
	call	convert_mmx_register
5359
	call	make_mmx_prefix
5293
	call	make_mmx_prefix
5360
	mov	[postbyte_register],al
5294
	mov	[postbyte_register],al
5361
	lods	byte [esi]
5295
	lods	byte [esi]
5362
	cmp	al,','
5296
	cmp	al,','
5363
	jne	invalid_operand
5297
	jne	invalid_operand
5364
	lods	byte [esi]
5298
	lods	byte [esi]
5365
	call	get_size_operator
5299
	call	get_size_operator
5366
	cmp	al,10h
5300
	cmp	al,10h
5367
	je	palignr_mmreg_mmreg
5301
	je	palignr_mmreg_mmreg
5368
	cmp	al,'['
5302
	cmp	al,'['
5369
	jne	invalid_operand
5303
	jne	invalid_operand
5370
	call	get_address
5304
	call	get_address
5371
	jmp	mmx_imm8
5305
	jmp	mmx_imm8
5372
      palignr_mmreg_mmreg:
5306
      palignr_mmreg_mmreg:
5373
	lods	byte [esi]
5307
	lods	byte [esi]
5374
	call	convert_mmx_register
5308
	call	convert_mmx_register
5375
	mov	bl,al
5309
	mov	bl,al
5376
	jmp	mmx_nomem_imm8
5310
	jmp	mmx_nomem_imm8
5377
amd3dnow_instruction:
5311
amd3dnow_instruction:
5378
	mov	[base_code],0Fh
5312
	mov	[base_code],0Fh
5379
	mov	[extended_code],0Fh
5313
	mov	[extended_code],0Fh
5380
	mov	byte [value],al
5314
	mov	byte [value],al
5381
	lods	byte [esi]
5315
	lods	byte [esi]
5382
	call	get_size_operator
5316
	call	get_size_operator
5383
	cmp	al,10h
5317
	cmp	al,10h
5384
	jne	invalid_operand
5318
	jne	invalid_operand
5385
	lods	byte [esi]
5319
	lods	byte [esi]
5386
	call	convert_mmx_register
5320
	call	convert_mmx_register
5387
	cmp	ah,8
5321
	cmp	ah,8
5388
	jne	invalid_operand_size
5322
	jne	invalid_operand_size
5389
	mov	[postbyte_register],al
5323
	mov	[postbyte_register],al
5390
	lods	byte [esi]
5324
	lods	byte [esi]
5391
	cmp	al,','
5325
	cmp	al,','
5392
	jne	invalid_operand
5326
	jne	invalid_operand
5393
	lods	byte [esi]
5327
	lods	byte [esi]
5394
	call	get_size_operator
5328
	call	get_size_operator
5395
	cmp	al,10h
5329
	cmp	al,10h
5396
	je	amd3dnow_mmreg_mmreg
5330
	je	amd3dnow_mmreg_mmreg
5397
	cmp	al,'['
5331
	cmp	al,'['
5398
	jne	invalid_operand
5332
	jne	invalid_operand
5399
	call	get_address
5333
	call	get_address
5400
	call	store_instruction_with_imm8
5334
	call	store_instruction_with_imm8
5401
	jmp	instruction_assembled
5335
	jmp	instruction_assembled
5402
      amd3dnow_mmreg_mmreg:
5336
      amd3dnow_mmreg_mmreg:
5403
	lods	byte [esi]
5337
	lods	byte [esi]
5404
	call	convert_mmx_register
5338
	call	convert_mmx_register
5405
	cmp	ah,8
5339
	cmp	ah,8
5406
	jne	invalid_operand_size
5340
	jne	invalid_operand_size
5407
	mov	bl,al
5341
	mov	bl,al
5408
	call	store_nomem_instruction
5342
	call	store_nomem_instruction
5409
	mov	al,byte [value]
5343
	mov	al,byte [value]
5410
	stos	byte [edi]
5344
	stos	byte [edi]
5411
	jmp	instruction_assembled
5345
	jmp	instruction_assembled
5412
 
5346
 
5413
sse4_instruction_38_xmm0:
5347
sse4_instruction_38_xmm0:
5414
	mov	[immediate_size],-1
5348
	mov	[immediate_size],-1
5415
	jmp	sse4_instruction_38
5349
sse4_instruction_38:
5416
sse4_instruction_38_imm8:
-
 
5417
	mov	[immediate_size],1
-
 
5418
sse4_instruction_38:
-
 
5419
	mov	[mmx_size],16
5350
	mov	[mmx_size],16
5420
	mov	[opcode_prefix],66h
5351
	mov	[opcode_prefix],66h
5421
	mov	[base_code],0Fh
5352
	mov	[supplemental_code],al
5422
	mov	[supplemental_code],al
-
 
5423
	mov	al,38h
5353
	mov	al,38h
5424
	jmp	sse_instruction
5354
	jmp	sse_instruction
5425
sse4_ss_instruction_3a_imm8:
5355
sse4_ss_instruction_3a_imm8:
5426
	mov	[immediate_size],1
5356
	mov	[immediate_size],1
5427
	mov	[mmx_size],4
5357
	mov	[mmx_size],4
5428
	jmp	sse4_instruction_3a_setup
5358
	jmp	sse4_instruction_3a_setup
5429
sse4_sd_instruction_3a_imm8:
5359
sse4_sd_instruction_3a_imm8:
5430
	mov	[immediate_size],1
5360
	mov	[immediate_size],1
5431
	mov	[mmx_size],8
5361
	mov	[mmx_size],8
5432
	jmp	sse4_instruction_3a_setup
5362
	jmp	sse4_instruction_3a_setup
5433
sse4_instruction_3a_imm8:
5363
sse4_instruction_3a_imm8:
5434
	mov	[immediate_size],1
5364
	mov	[immediate_size],1
5435
sse4_instruction_3a:
5365
	mov	[mmx_size],16
5436
	mov	[mmx_size],16
-
 
5437
      sse4_instruction_3a_setup:
5366
      sse4_instruction_3a_setup:
5438
	mov	[opcode_prefix],66h
5367
	mov	[opcode_prefix],66h
5439
	mov	[base_code],0Fh
5368
	mov	[supplemental_code],al
5440
	mov	[supplemental_code],al
-
 
5441
	mov	al,3Ah
5369
	mov	al,3Ah
5442
	jmp	sse_instruction
5370
	jmp	sse_instruction
5443
extractps_instruction:
5371
pclmulqdq_instruction:
-
 
5372
	mov	byte [value],al
-
 
5373
	mov	[mmx_size],16
-
 
5374
	mov	al,44h
-
 
5375
	jmp	sse4_instruction_3a_setup
-
 
5376
extractps_instruction:
5444
	mov	[opcode_prefix],66h
5377
	mov	[opcode_prefix],66h
5445
	mov	[base_code],0Fh
5378
	mov	[base_code],0Fh
5446
	mov	[extended_code],3Ah
5379
	mov	[extended_code],3Ah
5447
	mov	[supplemental_code],17h
5380
	mov	[supplemental_code],17h
5448
	lods	byte [esi]
5381
	lods	byte [esi]
5449
	call	get_size_operator
5382
	call	get_size_operator
5450
	cmp	al,10h
5383
	cmp	al,10h
5451
	je	extractps_reg
5384
	je	extractps_reg
5452
	cmp	al,'['
5385
	cmp	al,'['
5453
	jne	invalid_operand
5386
	jne	invalid_operand
5454
	call	get_address
5387
	call	get_address
5455
	cmp	[operand_size],4
5388
	cmp	[operand_size],4
5456
	je	extractps_size_ok
5389
	je	extractps_size_ok
5457
	cmp	[operand_size],0
5390
	cmp	[operand_size],0
5458
	jne	invalid_operand_size
5391
	jne	invalid_operand_size
5459
      extractps_size_ok:
5392
      extractps_size_ok:
5460
	push	edx ebx ecx
5393
	push	edx ebx ecx
5461
	mov	[operand_size],0
5394
	mov	[operand_size],0
5462
	lods	byte [esi]
5395
	lods	byte [esi]
5463
	cmp	al,','
5396
	cmp	al,','
5464
	jne	invalid_operand
5397
	jne	invalid_operand
5465
	lods	byte [esi]
5398
	lods	byte [esi]
5466
	call	get_size_operator
5399
	call	get_size_operator
5467
	cmp	al,10h
5400
	cmp	al,10h
5468
	jne	invalid_operand
5401
	jne	invalid_operand
5469
	lods	byte [esi]
5402
	lods	byte [esi]
5470
	call	convert_mmx_register
5403
	call	convert_xmm_register
5471
	cmp	ah,16
5404
	mov	[postbyte_register],al
5472
	jne	invalid_operand_size
-
 
5473
	mov	[postbyte_register],al
-
 
5474
	pop	ecx ebx edx
5405
	pop	ecx ebx edx
5475
	jmp	mmx_imm8
5406
	jmp	mmx_imm8
5476
      extractps_reg:
5407
      extractps_reg:
5477
	lods	byte [esi]
5408
	lods	byte [esi]
5478
	call	convert_register
5409
	call	convert_register
5479
	push	eax
5410
	push	eax
5480
	mov	[operand_size],0
5411
	mov	[operand_size],0
5481
	lods	byte [esi]
5412
	lods	byte [esi]
5482
	cmp	al,','
5413
	cmp	al,','
5483
	jne	invalid_operand
5414
	jne	invalid_operand
5484
	lods	byte [esi]
5415
	lods	byte [esi]
5485
	call	get_size_operator
5416
	call	get_size_operator
5486
	cmp	al,10h
5417
	cmp	al,10h
5487
	jne	invalid_operand
5418
	jne	invalid_operand
5488
	lods	byte [esi]
5419
	lods	byte [esi]
5489
	call	convert_mmx_register
5420
	call	convert_xmm_register
5490
	cmp	ah,16
5421
	mov	[postbyte_register],al
5491
	jne	invalid_operand_size
-
 
5492
	mov	[postbyte_register],al
-
 
5493
	pop	ebx
5422
	pop	ebx
5494
	mov	al,bh
5423
	mov	al,bh
5495
	cmp	al,4
5424
	cmp	al,4
5496
	je	mmx_nomem_imm8
5425
	je	mmx_nomem_imm8
5497
	cmp	al,8
5426
	cmp	al,8
5498
	jne	invalid_operand_size
5427
	jne	invalid_operand_size
5499
	call	operand_64bit
5428
	call	operand_64bit
5500
	jmp	mmx_nomem_imm8
5429
	jmp	mmx_nomem_imm8
5501
insertps_instruction:
5430
insertps_instruction:
5502
	mov	[opcode_prefix],66h
5431
	lods	byte [esi]
5503
	mov	[base_code],0Fh
-
 
5504
	mov	[extended_code],3Ah
-
 
5505
	mov	[supplemental_code],21h
-
 
5506
	lods	byte [esi]
-
 
5507
	call	get_size_operator
5432
	call	get_size_operator
5508
	cmp	al,10h
5433
	cmp	al,10h
5509
	jne	invalid_operand
5434
	jne	invalid_operand
5510
	lods	byte [esi]
5435
	lods	byte [esi]
5511
	call	convert_mmx_register
5436
	call	convert_xmm_register
5512
	cmp	ah,16
5437
	mov	[postbyte_register],al
5513
	jne	invalid_operand_size
-
 
5514
	mov	[postbyte_register],al
-
 
5515
	mov	[operand_size],0
5438
      insertps_xmmreg:
-
 
5439
	mov	[opcode_prefix],66h
-
 
5440
	mov	[base_code],0Fh
-
 
5441
	mov	[extended_code],3Ah
-
 
5442
	mov	[supplemental_code],21h
-
 
5443
	mov	[operand_size],0
5516
	lods	byte [esi]
5444
	lods	byte [esi]
5517
	cmp	al,','
5445
	cmp	al,','
5518
	jne	invalid_operand
5446
	jne	invalid_operand
5519
	lods	byte [esi]
5447
	lods	byte [esi]
5520
	call	get_size_operator
5448
	call	get_size_operator
5521
	cmp	al,10h
5449
	cmp	al,10h
5522
	je	insertps_reg
5450
	je	insertps_xmmreg_reg
5523
	cmp	al,'['
5451
	cmp	al,'['
5524
	jne	invalid_operand
5452
	jne	invalid_operand
5525
	call	get_address
5453
	call	get_address
5526
	cmp	[operand_size],4
5454
	cmp	[operand_size],4
5527
	je	insertps_size_ok
5455
	je	insertps_size_ok
5528
	cmp	[operand_size],0
5456
	cmp	[operand_size],0
5529
	jne	invalid_operand_size
5457
	jne	invalid_operand_size
5530
      insertps_size_ok:
5458
      insertps_size_ok:
5531
	jmp	mmx_imm8
5459
	jmp	mmx_imm8
5532
      insertps_reg:
5460
      insertps_xmmreg_reg:
5533
	lods	byte [esi]
5461
	lods	byte [esi]
5534
	call	convert_mmx_register
5462
	call	convert_mmx_register
5535
	mov	bl,al
5463
	mov	bl,al
5536
	jmp	mmx_nomem_imm8
5464
	jmp	mmx_nomem_imm8
5537
pextrq_instruction:
5465
pextrq_instruction:
5538
	mov	[mmx_size],8
5466
	mov	[mmx_size],8
5539
	jmp	pextr_instruction
5467
	jmp	pextr_instruction
5540
pextrd_instruction:
5468
pextrd_instruction:
5541
	mov	[mmx_size],4
5469
	mov	[mmx_size],4
5542
	jmp	pextr_instruction
5470
	jmp	pextr_instruction
5543
pextrw_instruction:
5471
pextrw_instruction:
5544
	mov	[mmx_size],2
5472
	mov	[mmx_size],2
5545
	jmp	pextr_instruction
5473
	jmp	pextr_instruction
5546
pextrb_instruction:
5474
pextrb_instruction:
5547
	mov	[mmx_size],1
5475
	mov	[mmx_size],1
5548
      pextr_instruction:
5476
      pextr_instruction:
5549
	mov	[opcode_prefix],66h
5477
	mov	[opcode_prefix],66h
5550
	mov	[base_code],0Fh
5478
	mov	[base_code],0Fh
5551
	mov	[extended_code],3Ah
5479
	mov	[extended_code],3Ah
5552
	mov	[supplemental_code],al
5480
	mov	[supplemental_code],al
5553
	lods	byte [esi]
5481
	lods	byte [esi]
5554
	call	get_size_operator
5482
	call	get_size_operator
5555
	cmp	al,10h
5483
	cmp	al,10h
5556
	je	pextr_reg
5484
	je	pextr_reg
5557
	cmp	al,'['
5485
	cmp	al,'['
5558
	jne	invalid_operand
5486
	jne	invalid_operand
5559
	call	get_address
5487
	call	get_address
5560
	mov	al,[mmx_size]
5488
	mov	al,[mmx_size]
5561
	cmp	al,[operand_size]
5489
	cmp	al,[operand_size]
5562
	je	pextr_size_ok
5490
	je	pextr_size_ok
5563
	cmp	[operand_size],0
5491
	cmp	[operand_size],0
5564
	jne	invalid_operand_size
5492
	jne	invalid_operand_size
5565
      pextr_size_ok:
5493
      pextr_size_ok:
5566
	push	edx ebx ecx
5494
	cmp	al,8
-
 
5495
	jne	pextr_prefix_ok
-
 
5496
	call	operand_64bit
-
 
5497
      pextr_prefix_ok:
-
 
5498
	push	edx ebx ecx
5567
	mov	[operand_size],0
5499
	mov	[operand_size],0
5568
	lods	byte [esi]
5500
	lods	byte [esi]
5569
	cmp	al,','
5501
	cmp	al,','
5570
	jne	invalid_operand
5502
	jne	invalid_operand
5571
	lods	byte [esi]
5503
	lods	byte [esi]
5572
	call	get_size_operator
5504
	call	get_size_operator
5573
	cmp	al,10h
5505
	cmp	al,10h
5574
	jne	invalid_operand
5506
	jne	invalid_operand
5575
	lods	byte [esi]
5507
	lods	byte [esi]
5576
	call	convert_mmx_register
5508
	call	convert_xmm_register
5577
	cmp	ah,16
5509
	mov	[postbyte_register],al
5578
	jne	invalid_operand_size
-
 
5579
	mov	[postbyte_register],al
-
 
5580
	pop	ecx ebx edx
5510
	pop	ecx ebx edx
5581
	jmp	mmx_imm8
5511
	jmp	mmx_imm8
5582
      pextr_reg:
5512
      pextr_reg:
5583
	lods	byte [esi]
5513
	lods	byte [esi]
5584
	call	convert_register
5514
	call	convert_register
5585
	cmp	[mmx_size],4
5515
	cmp	[mmx_size],4
5586
	ja	pextrq_reg
5516
	ja	pextrq_reg
5587
	cmp	ah,4
5517
	cmp	ah,4
5588
	je	pextr_reg_size_ok
5518
	je	pextr_reg_size_ok
5589
	cmp	[code_type],64
5519
	cmp	[code_type],64
5590
	jne	pextr_invalid_size
5520
	jne	pextr_invalid_size
5591
	cmp	ah,8
5521
	cmp	ah,8
5592
	je	pextr_reg_size_ok
5522
	je	pextr_reg_size_ok
5593
      pextr_invalid_size:
5523
      pextr_invalid_size:
5594
	jmp	invalid_operand_size
5524
	jmp	invalid_operand_size
5595
      pextrq_reg:
5525
      pextrq_reg:
5596
	cmp	ah,8
5526
	cmp	ah,8
5597
	jne	pextr_invalid_size
5527
	jne	pextr_invalid_size
5598
	call	operand_64bit
5528
	call	operand_64bit
5599
      pextr_reg_size_ok:
5529
      pextr_reg_size_ok:
5600
	mov	[operand_size],0
5530
	mov	[operand_size],0
5601
	push	eax
5531
	push	eax
5602
	lods	byte [esi]
5532
	lods	byte [esi]
5603
	cmp	al,','
5533
	cmp	al,','
5604
	jne	invalid_operand
5534
	jne	invalid_operand
5605
	lods	byte [esi]
5535
	lods	byte [esi]
5606
	call	get_size_operator
5536
	call	get_size_operator
5607
	cmp	al,10h
5537
	cmp	al,10h
5608
	jne	invalid_operand
5538
	jne	invalid_operand
5609
	lods	byte [esi]
5539
	lods	byte [esi]
5610
	call	convert_mmx_register
5540
	call	convert_mmx_register
5611
	mov	ebx,eax
5541
	mov	ebx,eax
5612
	pop	eax
5542
	pop	eax
5613
	mov	[postbyte_register],al
5543
	mov	[postbyte_register],al
5614
	mov	al,ah
5544
	mov	al,ah
5615
	cmp	[mmx_size],2
5545
	cmp	[mmx_size],2
5616
	jne	pextr_reg_store
5546
	jne	pextr_reg_store
5617
	mov	[opcode_prefix],0
5547
	mov	[opcode_prefix],0
5618
	mov	[extended_code],0C5h
5548
	mov	[extended_code],0C5h
5619
	call	make_mmx_prefix
5549
	call	make_mmx_prefix
5620
	jmp	mmx_nomem_imm8
5550
	jmp	mmx_nomem_imm8
5621
      pextr_reg_store:
5551
      pextr_reg_store:
5622
	cmp	bh,16
5552
	cmp	bh,16
5623
	jne	invalid_operand_size
5553
	jne	invalid_operand_size
5624
	xchg	bl,[postbyte_register]
5554
	xchg	bl,[postbyte_register]
5625
	call	operand_autodetect
5555
	call	operand_autodetect
5626
	jmp	mmx_nomem_imm8
5556
	jmp	mmx_nomem_imm8
5627
pinsrb_instruction:
5557
pinsrb_instruction:
5628
	mov	[mmx_size],1
5558
	mov	[mmx_size],1
5629
	jmp	pinsr_instruction
5559
	jmp	pinsr_instruction
5630
pinsrd_instruction:
5560
pinsrd_instruction:
5631
	mov	[mmx_size],4
5561
	mov	[mmx_size],4
5632
	jmp	pinsr_instruction
5562
	jmp	pinsr_instruction
5633
pinsrq_instruction:
5563
pinsrq_instruction:
5634
	mov	[mmx_size],8
5564
	mov	[mmx_size],8
5635
	jmp	pinsr_instruction
5565
	call	operand_64bit
5636
      pinsr_instruction:
5566
      pinsr_instruction:
5637
	mov	[opcode_prefix],66h
5567
	mov	[opcode_prefix],66h
5638
	mov	[base_code],0Fh
5568
	mov	[base_code],0Fh
5639
	mov	[extended_code],3Ah
5569
	mov	[extended_code],3Ah
5640
	mov	[supplemental_code],al
5570
	mov	[supplemental_code],al
5641
	lods	byte [esi]
5571
	lods	byte [esi]
5642
	call	get_size_operator
5572
	call	get_size_operator
5643
	cmp	al,10h
5573
	cmp	al,10h
5644
	jne	invalid_operand
5574
	jne	invalid_operand
5645
	lods	byte [esi]
5575
	lods	byte [esi]
5646
	call	convert_mmx_register
5576
	call	convert_xmm_register
5647
	cmp	ah,16
5577
	mov	[postbyte_register],al
5648
	jne	invalid_operand_size
-
 
5649
	mov	[postbyte_register],al
-
 
5650
	mov	[operand_size],0
5578
      pinsr_xmmreg:
-
 
5579
	mov	[operand_size],0
5651
	lods	byte [esi]
5580
	lods	byte [esi]
5652
	cmp	al,','
5581
	cmp	al,','
5653
	jne	invalid_operand
5582
	jne	invalid_operand
5654
	lods	byte [esi]
5583
	lods	byte [esi]
5655
	call	get_size_operator
5584
	call	get_size_operator
5656
	cmp	al,10h
5585
	cmp	al,10h
5657
	je	pinsr_xmmreg_reg
5586
	je	pinsr_xmmreg_reg
5658
	cmp	al,'['
5587
	cmp	al,'['
5659
	jne	invalid_operand
5588
	jne	invalid_operand
5660
	call	get_address
5589
	call	get_address
5661
	cmp	[operand_size],0
5590
	cmp	[operand_size],0
5662
	je	mmx_imm8
5591
	je	mmx_imm8
5663
	mov	al,[mmx_size]
5592
	mov	al,[mmx_size]
5664
	cmp	al,[operand_size]
5593
	cmp	al,[operand_size]
5665
	je	mmx_imm8
5594
	je	mmx_imm8
5666
	jmp	invalid_operand_size
5595
	jmp	invalid_operand_size
5667
      pinsr_xmmreg_reg:
5596
      pinsr_xmmreg_reg:
5668
	lods	byte [esi]
5597
	lods	byte [esi]
5669
	call	convert_register
5598
	call	convert_register
5670
	mov	bl,al
5599
	mov	bl,al
5671
	cmp	[mmx_size],8
5600
	cmp	[mmx_size],8
5672
	je	pinsrq_xmmreg_reg
5601
	je	pinsrq_xmmreg_reg
5673
	cmp	ah,4
5602
	cmp	ah,4
5674
	je	mmx_nomem_imm8
5603
	je	mmx_nomem_imm8
5675
	jmp	invalid_operand_size
5604
	jmp	invalid_operand_size
5676
      pinsrq_xmmreg_reg:
5605
      pinsrq_xmmreg_reg:
5677
	cmp	ah,8
5606
	cmp	ah,8
5678
	je	mmx_nomem_imm8
5607
	je	mmx_nomem_imm8
5679
	jmp	invalid_operand_size
5608
	jmp	invalid_operand_size
5680
pmovsxbw_instruction:
5609
pmovsxbw_instruction:
5681
	mov	[mmx_size],8
5610
	mov	[mmx_size],8
5682
	jmp	pmovsx_instruction
5611
	jmp	pmovsx_instruction
5683
pmovsxbd_instruction:
5612
pmovsxbd_instruction:
5684
	mov	[mmx_size],4
5613
	mov	[mmx_size],4
5685
	jmp	pmovsx_instruction
5614
	jmp	pmovsx_instruction
5686
pmovsxbq_instruction:
5615
pmovsxbq_instruction:
5687
	mov	[mmx_size],2
5616
	mov	[mmx_size],2
5688
	jmp	pmovsx_instruction
5617
	jmp	pmovsx_instruction
5689
pmovsxwd_instruction:
5618
pmovsxwd_instruction:
5690
	mov	[mmx_size],8
5619
	mov	[mmx_size],8
5691
	jmp	pmovsx_instruction
5620
	jmp	pmovsx_instruction
5692
pmovsxwq_instruction:
5621
pmovsxwq_instruction:
5693
	mov	[mmx_size],4
5622
	mov	[mmx_size],4
5694
	jmp	pmovsx_instruction
5623
	jmp	pmovsx_instruction
5695
pmovsxdq_instruction:
5624
pmovsxdq_instruction:
5696
	mov	[mmx_size],8
5625
	mov	[mmx_size],8
5697
      pmovsx_instruction:
5626
      pmovsx_instruction:
5698
	mov	[opcode_prefix],66h
5627
	mov	[opcode_prefix],66h
5699
	mov	[base_code],0Fh
5628
	mov	[base_code],0Fh
5700
	mov	[extended_code],38h
5629
	mov	[extended_code],38h
5701
	mov	[supplemental_code],al
5630
	mov	[supplemental_code],al
5702
	lods	byte [esi]
5631
	lods	byte [esi]
5703
	call	get_size_operator
5632
	call	get_size_operator
5704
	cmp	al,10h
5633
	cmp	al,10h
5705
	jne	invalid_operand
5634
	jne	invalid_operand
5706
	lods	byte [esi]
5635
	lods	byte [esi]
5707
	call	convert_mmx_register
5636
	call	convert_xmm_register
5708
	cmp	ah,16
5637
	mov	[postbyte_register],al
5709
	jne	invalid_operand_size
-
 
5710
	mov	[postbyte_register],al
-
 
5711
	lods	byte [esi]
5638
	lods	byte [esi]
5712
	cmp	al,','
5639
	cmp	al,','
5713
	jne	invalid_operand
5640
	jne	invalid_operand
5714
	mov	[operand_size],0
5641
	mov	[operand_size],0
5715
	lods	byte [esi]
5642
	lods	byte [esi]
5716
	call	get_size_operator
5643
	call	get_size_operator
5717
	cmp	al,10h
5644
	cmp	al,10h
5718
	je	pmovsx_xmmreg_reg
5645
	je	pmovsx_xmmreg_reg
5719
	cmp	al,'['
5646
	cmp	al,'['
5720
	jne	invalid_operand
5647
	jne	invalid_operand
5721
	call	get_address
5648
	call	get_address
5722
	cmp	[operand_size],0
5649
	cmp	[operand_size],0
5723
	je	mmx_imm8
5650
	je	mmx_imm8
5724
	mov	al,[mmx_size]
5651
	mov	al,[mmx_size]
5725
	cmp	al,[operand_size]
5652
	cmp	al,[operand_size]
5726
	jne	invalid_operand_size
5653
	jne	invalid_operand_size
5727
	jmp	instruction_ready
5654
	jmp	instruction_ready
5728
      pmovsx_xmmreg_reg:
5655
      pmovsx_xmmreg_reg:
5729
	lods	byte [esi]
5656
	lods	byte [esi]
5730
	call	convert_mmx_register
5657
	call	convert_xmm_register
5731
	cmp	ah,16
5658
	mov	bl,al
5732
	jne	invalid_operand_size
-
 
5733
	mov	bl,al
-
 
5734
	jmp	nomem_instruction_ready
5659
	jmp	nomem_instruction_ready
5735
 
5660
 
-
 
5661
fxsave_instruction_64bit:
-
 
5662
	call	operand_64bit
5736
fxsave_instruction:
5663
fxsave_instruction:
5737
	mov	[extended_code],0AEh
5664
	mov	[extended_code],0AEh
5738
	mov	[base_code],0Fh
5665
	mov	[base_code],0Fh
5739
	mov	[postbyte_register],al
5666
	mov	[postbyte_register],al
5740
	lods	byte [esi]
5667
	lods	byte [esi]
5741
	call	get_size_operator
5668
	call	get_size_operator
5742
	cmp	al,'['
5669
	cmp	al,'['
5743
	jne	invalid_operand
5670
	jne	invalid_operand
5744
	call	get_address
5671
	call	get_address
5745
	mov	ah,[operand_size]
5672
	mov	ah,[operand_size]
5746
	or	ah,ah
5673
	or	ah,ah
5747
	jz	fxsave_size_ok
5674
	jz	fxsave_size_ok
5748
	mov	al,[postbyte_register]
5675
	mov	al,[postbyte_register]
5749
	cmp	al,111b
5676
	cmp	al,111b
5750
	je	clflush_size_check
5677
	je	clflush_size_check
5751
	cmp	al,10b
5678
	cmp	al,10b
5752
	jb	invalid_operand_size
5679
	jb	invalid_operand_size
5753
	cmp	al,11b
5680
	cmp	al,11b
5754
	ja	invalid_operand_size
5681
	ja	invalid_operand_size
5755
	cmp	ah,4
5682
	cmp	ah,4
5756
	jne	invalid_operand_size
5683
	jne	invalid_operand_size
5757
	jmp	fxsave_size_ok
5684
	jmp	fxsave_size_ok
5758
      clflush_size_check:
5685
      clflush_size_check:
5759
	cmp	ah,1
5686
	cmp	ah,1
5760
	jne	invalid_operand_size
5687
	jne	invalid_operand_size
5761
      fxsave_size_ok:
5688
      fxsave_size_ok:
5762
	jmp	instruction_ready
5689
	jmp	instruction_ready
5763
prefetch_instruction:
5690
prefetch_instruction:
5764
	mov	[extended_code],18h
5691
	mov	[extended_code],18h
5765
      prefetch_mem_8bit:
5692
      prefetch_mem_8bit:
5766
	mov	[base_code],0Fh
5693
	mov	[base_code],0Fh
5767
	mov	[postbyte_register],al
5694
	mov	[postbyte_register],al
5768
	lods	byte [esi]
5695
	lods	byte [esi]
5769
	call	get_size_operator
5696
	call	get_size_operator
5770
	cmp	al,'['
5697
	cmp	al,'['
5771
	jne	invalid_operand
5698
	jne	invalid_operand
5772
	or	ah,ah
5699
	or	ah,ah
5773
	jz	prefetch_size_ok
5700
	jz	prefetch_size_ok
5774
	cmp	ah,1
5701
	cmp	ah,1
5775
	jne	invalid_operand_size
5702
	jne	invalid_operand_size
5776
      prefetch_size_ok:
5703
      prefetch_size_ok:
5777
	call	get_address
5704
	call	get_address
5778
	jmp	instruction_ready
5705
	jmp	instruction_ready
5779
amd_prefetch_instruction:
5706
amd_prefetch_instruction:
5780
	mov	[extended_code],0Dh
5707
	mov	[extended_code],0Dh
5781
	jmp	prefetch_mem_8bit
5708
	jmp	prefetch_mem_8bit
5782
fence_instruction:
5709
fence_instruction:
5783
	mov	bl,al
5710
	mov	bl,al
5784
	mov	ax,0AE0Fh
5711
	mov	ax,0AE0Fh
5785
	stos	word [edi]
5712
	stos	word [edi]
5786
	mov	al,bl
5713
	mov	al,bl
5787
	stos	byte [edi]
5714
	stos	byte [edi]
5788
	jmp	instruction_assembled
5715
	jmp	instruction_assembled
5789
pause_instruction:
5716
pause_instruction:
5790
	mov	ax,90F3h
5717
	mov	ax,90F3h
5791
	stos	word [edi]
5718
	stos	word [edi]
5792
	jmp	instruction_assembled
5719
	jmp	instruction_assembled
5793
movntq_instruction:
5720
movntq_instruction:
5794
	mov	[mmx_size],8
5721
	mov	[mmx_size],8
5795
	jmp	movnt_instruction
5722
	jmp	movnt_instruction
5796
movntps_instruction:
5723
movntpd_instruction:
5797
	mov	[mmx_size],16
5724
	mov	[opcode_prefix],66h
5798
	jmp	movnt_instruction
-
 
5799
movntdq_instruction:
-
 
5800
	mov	[opcode_prefix],66h
-
 
5801
	mov	[mmx_size],16
5725
movntps_instruction:
-
 
5726
	mov	[mmx_size],16
5802
      movnt_instruction:
5727
      movnt_instruction:
5803
	mov	[extended_code],al
5728
	mov	[extended_code],al
5804
	mov	[base_code],0Fh
5729
	mov	[base_code],0Fh
5805
	lods	byte [esi]
5730
	lods	byte [esi]
5806
	call	get_size_operator
5731
	call	get_size_operator
5807
	cmp	al,'['
5732
	cmp	al,'['
5808
	jne	invalid_operand
5733
	jne	invalid_operand
5809
	call	get_address
5734
	call	get_address
5810
	lods	byte [esi]
5735
	lods	byte [esi]
5811
	cmp	al,','
5736
	cmp	al,','
5812
	jne	invalid_operand
5737
	jne	invalid_operand
5813
	lods	byte [esi]
5738
	lods	byte [esi]
5814
	call	get_size_operator
5739
	call	get_size_operator
5815
	cmp	al,10h
5740
	cmp	al,10h
5816
	jne	invalid_operand
5741
	jne	invalid_operand
5817
	lods	byte [esi]
5742
	lods	byte [esi]
5818
	call	convert_mmx_register
5743
	call	convert_mmx_register
5819
	cmp	ah,[mmx_size]
5744
	cmp	ah,[mmx_size]
5820
	jne	invalid_operand_size
5745
	jne	invalid_operand_size
5821
	mov	[postbyte_register],al
5746
	mov	[postbyte_register],al
5822
	jmp	instruction_ready
5747
	jmp	instruction_ready
5823
 
5748
 
5824
movntsd_instruction:
5749
movntsd_instruction:
5825
	mov	[opcode_prefix],0F2h
5750
	mov	[opcode_prefix],0F2h
5826
	mov	[mmx_size],8
5751
	mov	[mmx_size],8
5827
	jmp	movnts_instruction
5752
	jmp	movnts_instruction
5828
movntss_instruction:
5753
movntss_instruction:
5829
	mov	[opcode_prefix],0F3h
5754
	mov	[opcode_prefix],0F3h
5830
	mov	[mmx_size],4
5755
	mov	[mmx_size],4
5831
      movnts_instruction:
5756
      movnts_instruction:
5832
	mov	[extended_code],al
5757
	mov	[extended_code],al
5833
	mov	[base_code],0Fh
5758
	mov	[base_code],0Fh
5834
	lods	byte [esi]
5759
	lods	byte [esi]
5835
	call	get_size_operator
5760
	call	get_size_operator
5836
	cmp	al,'['
5761
	cmp	al,'['
5837
	jne	invalid_operand
5762
	jne	invalid_operand
5838
	call	get_address
5763
	call	get_address
5839
	mov	al,[operand_size]
5764
	mov	al,[operand_size]
5840
	cmp	al,[mmx_size]
5765
	cmp	al,[mmx_size]
5841
	je	movnts_size_ok
5766
	je	movnts_size_ok
5842
	test	al,al
5767
	test	al,al
5843
	jnz	invalid_operand_size
5768
	jnz	invalid_operand_size
5844
      movnts_size_ok:
5769
      movnts_size_ok:
5845
	lods	byte [esi]
5770
	lods	byte [esi]
5846
	cmp	al,','
5771
	cmp	al,','
5847
	jne	invalid_operand
5772
	jne	invalid_operand
5848
	mov	[operand_size],0
5773
	mov	[operand_size],0
5849
	lods	byte [esi]
5774
	lods	byte [esi]
5850
	call	get_size_operator
5775
	call	get_size_operator
5851
	cmp	al,10h
5776
	cmp	al,10h
5852
	jne	invalid_operand
5777
	jne	invalid_operand
5853
	lods	byte [esi]
5778
	lods	byte [esi]
5854
	call	convert_mmx_register
5779
	call	convert_xmm_register
5855
	cmp	ah,16
5780
	mov	[postbyte_register],al
5856
	jne	invalid_operand_size
-
 
5857
	mov	[postbyte_register],al
-
 
5858
	jmp	instruction_ready
5781
	jmp	instruction_ready
5859
 
5782
 
5860
movnti_instruction:
5783
movnti_instruction:
5861
	mov	[base_code],0Fh
5784
	mov	[base_code],0Fh
5862
	mov	[extended_code],al
5785
	mov	[extended_code],al
5863
	lods	byte [esi]
5786
	lods	byte [esi]
5864
	call	get_size_operator
5787
	call	get_size_operator
5865
	cmp	al,'['
5788
	cmp	al,'['
5866
	jne	invalid_operand
5789
	jne	invalid_operand
5867
	call	get_address
5790
	call	get_address
5868
	lods	byte [esi]
5791
	lods	byte [esi]
5869
	cmp	al,','
5792
	cmp	al,','
5870
	jne	invalid_operand
5793
	jne	invalid_operand
5871
	lods	byte [esi]
5794
	lods	byte [esi]
5872
	call	get_size_operator
5795
	call	get_size_operator
5873
	cmp	al,10h
5796
	cmp	al,10h
5874
	jne	invalid_operand
5797
	jne	invalid_operand
5875
	lods	byte [esi]
5798
	lods	byte [esi]
5876
	call	convert_register
5799
	call	convert_register
5877
	cmp	ah,4
5800
	cmp	ah,4
5878
	je	movnti_store
5801
	je	movnti_store
5879
	cmp	ah,8
5802
	cmp	ah,8
5880
	jne	invalid_operand_size
5803
	jne	invalid_operand_size
5881
	call	operand_64bit
5804
	call	operand_64bit
5882
      movnti_store:
5805
      movnti_store:
5883
	mov	[postbyte_register],al
5806
	mov	[postbyte_register],al
5884
	jmp	instruction_ready
5807
	jmp	instruction_ready
5885
monitor_instruction:
5808
monitor_instruction:
5886
	mov	[postbyte_register],al
5809
	mov	[postbyte_register],al
5887
	cmp	byte [esi],0
5810
	cmp	byte [esi],0
5888
	je	monitor_instruction_store
5811
	je	monitor_instruction_store
5889
	cmp	byte [esi],0Fh
5812
	cmp	byte [esi],0Fh
5890
	je	monitor_instruction_store
5813
	je	monitor_instruction_store
5891
	lods	byte [esi]
5814
	lods	byte [esi]
5892
	call	get_size_operator
5815
	call	get_size_operator
5893
	cmp	al,10h
5816
	cmp	al,10h
5894
	jne	invalid_operand
5817
	jne	invalid_operand
5895
	lods	byte [esi]
5818
	lods	byte [esi]
5896
	call	convert_register
5819
	call	convert_register
5897
	cmp	ax,0400h
5820
	cmp	ax,0400h
5898
	jne	invalid_operand
5821
	jne	invalid_operand
5899
	lods	byte [esi]
5822
	lods	byte [esi]
5900
	cmp	al,','
5823
	cmp	al,','
5901
	jne	invalid_operand
5824
	jne	invalid_operand
5902
	lods	byte [esi]
5825
	lods	byte [esi]
5903
	call	get_size_operator
5826
	call	get_size_operator
5904
	cmp	al,10h
5827
	cmp	al,10h
5905
	jne	invalid_operand
5828
	jne	invalid_operand
5906
	lods	byte [esi]
5829
	lods	byte [esi]
5907
	call	convert_register
5830
	call	convert_register
5908
	cmp	ax,0401h
5831
	cmp	ax,0401h
5909
	jne	invalid_operand
5832
	jne	invalid_operand
5910
	cmp	[postbyte_register],0C8h
5833
	cmp	[postbyte_register],0C8h
5911
	jne	monitor_instruction_store
5834
	jne	monitor_instruction_store
5912
	lods	byte [esi]
5835
	lods	byte [esi]
5913
	cmp	al,','
5836
	cmp	al,','
5914
	jne	invalid_operand
5837
	jne	invalid_operand
5915
	lods	byte [esi]
5838
	lods	byte [esi]
5916
	call	get_size_operator
5839
	call	get_size_operator
5917
	cmp	al,10h
5840
	cmp	al,10h
5918
	jne	invalid_operand
5841
	jne	invalid_operand
5919
	lods	byte [esi]
5842
	lods	byte [esi]
5920
	call	convert_register
5843
	call	convert_register
5921
	cmp	ax,0402h
5844
	cmp	ax,0402h
5922
	jne	invalid_operand
5845
	jne	invalid_operand
5923
      monitor_instruction_store:
5846
      monitor_instruction_store:
5924
	mov	ax,010Fh
5847
	mov	ax,010Fh
5925
	stos	word [edi]
5848
	stos	word [edi]
5926
	mov	al,[postbyte_register]
5849
	mov	al,[postbyte_register]
5927
	stos	byte [edi]
5850
	stos	byte [edi]
5928
	jmp	instruction_assembled
5851
	jmp	instruction_assembled
5929
movntdqa_instruction:
5852
movntdqa_instruction:
5930
	mov	[opcode_prefix],66h
5853
	mov	[opcode_prefix],66h
5931
	mov	[base_code],0Fh
5854
	mov	[base_code],0Fh
5932
	mov	[extended_code],38h
5855
	mov	[extended_code],38h
5933
	mov	[supplemental_code],2Ah
5856
	mov	[supplemental_code],2Ah
5934
	lods	byte [esi]
5857
	lods	byte [esi]
5935
	call	get_size_operator
5858
	call	get_size_operator
5936
	cmp	al,10h
5859
	cmp	al,10h
5937
	jne	invalid_operand
5860
	jne	invalid_operand
5938
	lods	byte [esi]
5861
	lods	byte [esi]
5939
	call	convert_mmx_register
5862
	call	convert_xmm_register
5940
	cmp	ah,16
5863
	mov	[postbyte_register],al
5941
	jne	invalid_operand_size
-
 
5942
	mov	[postbyte_register],al
-
 
5943
	lods	byte [esi]
5864
	lods	byte [esi]
5944
	cmp	al,','
5865
	cmp	al,','
5945
	jne	invalid_operand
5866
	jne	invalid_operand
5946
	lods	byte [esi]
5867
	lods	byte [esi]
5947
	call	get_size_operator
5868
	call	get_size_operator
5948
	cmp	al,'['
5869
	cmp	al,'['
5949
	jne	invalid_operand
5870
	jne	invalid_operand
5950
	call	get_address
5871
	call	get_address
5951
	jmp	instruction_ready
5872
	jmp	instruction_ready
5952
 
5873
 
5953
extrq_instruction:
5874
extrq_instruction:
5954
	mov	[opcode_prefix],66h
5875
	mov	[opcode_prefix],66h
5955
	mov	[base_code],0Fh
5876
	mov	[base_code],0Fh
5956
	mov	[extended_code],78h
5877
	mov	[extended_code],78h
5957
	lods	byte [esi]
5878
	lods	byte [esi]
5958
	call	get_size_operator
5879
	call	get_size_operator
5959
	cmp	al,10h
5880
	cmp	al,10h
5960
	jne	invalid_operand
5881
	jne	invalid_operand
5961
	lods	byte [esi]
5882
	lods	byte [esi]
5962
	call	convert_mmx_register
5883
	call	convert_xmm_register
5963
	cmp	ah,16
5884
	mov	[postbyte_register],al
5964
	jne	invalid_operand_size
-
 
5965
	mov	[postbyte_register],al
-
 
5966
	mov	[operand_size],0
5885
	mov	[operand_size],0
5967
	lods	byte [esi]
5886
	lods	byte [esi]
5968
	cmp	al,','
5887
	cmp	al,','
5969
	jne	invalid_operand
5888
	jne	invalid_operand
5970
	lods	byte [esi]
5889
	lods	byte [esi]
5971
	call	get_size_operator
5890
	call	get_size_operator
5972
	cmp	al,10h
5891
	cmp	al,10h
5973
	je	extrq_xmmreg_xmmreg
5892
	je	extrq_xmmreg_xmmreg
5974
	test	ah,not 1
5893
	test	ah,not 1
5975
	jnz	invalid_operand_size
5894
	jnz	invalid_operand_size
5976
	cmp	al,'('
5895
	cmp	al,'('
5977
	jne	invalid_operand
5896
	jne	invalid_operand
5978
	xor	bl,bl
5897
	xor	bl,bl
5979
	xchg	bl,[postbyte_register]
5898
	xchg	bl,[postbyte_register]
5980
	call	store_nomem_instruction
5899
	call	store_nomem_instruction
5981
	call	get_byte_value
5900
	call	get_byte_value
5982
	stosb
5901
	stosb
5983
	call	append_imm8
5902
	call	append_imm8
5984
	jmp	instruction_assembled
5903
	jmp	instruction_assembled
5985
      extrq_xmmreg_xmmreg:
5904
      extrq_xmmreg_xmmreg:
5986
	inc	[extended_code]
5905
	inc	[extended_code]
5987
	lods	byte [esi]
5906
	lods	byte [esi]
5988
	call	convert_mmx_register
5907
	call	convert_xmm_register
5989
	cmp	ah,16
5908
	mov	bl,al
5990
	jne	invalid_operand_size
-
 
5991
	mov	bl,al
-
 
5992
	jmp	nomem_instruction_ready
5909
	jmp	nomem_instruction_ready
5993
insertq_instruction:
5910
insertq_instruction:
5994
	mov	[opcode_prefix],0F2h
5911
	mov	[opcode_prefix],0F2h
5995
	mov	[base_code],0Fh
5912
	mov	[base_code],0Fh
5996
	mov	[extended_code],78h
5913
	mov	[extended_code],78h
5997
	lods	byte [esi]
5914
	lods	byte [esi]
5998
	call	get_size_operator
5915
	call	get_size_operator
5999
	cmp	al,10h
5916
	cmp	al,10h
6000
	jne	invalid_operand
5917
	jne	invalid_operand
6001
	lods	byte [esi]
5918
	lods	byte [esi]
6002
	call	convert_mmx_register
5919
	call	convert_xmm_register
6003
	cmp	ah,16
5920
	mov	[postbyte_register],al
6004
	jne	invalid_operand_size
-
 
6005
	mov	[postbyte_register],al
-
 
6006
	mov	[operand_size],0
5921
	mov	[operand_size],0
6007
	lods	byte [esi]
5922
	lods	byte [esi]
6008
	cmp	al,','
5923
	cmp	al,','
6009
	jne	invalid_operand
5924
	jne	invalid_operand
6010
	lods	byte [esi]
5925
	lods	byte [esi]
6011
	call	get_size_operator
5926
	call	get_size_operator
6012
	cmp	al,10h
5927
	cmp	al,10h
6013
	jne	invalid_operand
5928
	jne	invalid_operand
6014
	lods	byte [esi]
5929
	lods	byte [esi]
6015
	call	convert_mmx_register
5930
	call	convert_xmm_register
6016
	cmp	ah,16
5931
	mov	bl,al
6017
	jne	invalid_operand_size
-
 
6018
	mov	bl,al
-
 
6019
	cmp	byte [esi],','
5932
	cmp	byte [esi],','
6020
	je	insertq_with_imm
5933
	je	insertq_with_imm
6021
	inc	[extended_code]
5934
	inc	[extended_code]
6022
	jmp	nomem_instruction_ready
5935
	jmp	nomem_instruction_ready
6023
      insertq_with_imm:
5936
      insertq_with_imm:
6024
	call	store_nomem_instruction
5937
	call	store_nomem_instruction
6025
	call	append_imm8
5938
	call	append_imm8
6026
	call	append_imm8
5939
	call	append_imm8
6027
	jmp	instruction_assembled
5940
	jmp	instruction_assembled
6028
 
5941
 
6029
crc32_instruction:
5942
crc32_instruction:
6030
	mov	[opcode_prefix],0F2h
5943
	mov	[opcode_prefix],0F2h
6031
	mov	[base_code],0Fh
5944
	mov	[base_code],0Fh
6032
	mov	[extended_code],38h
5945
	mov	[extended_code],38h
6033
	mov	[supplemental_code],0F0h
5946
	mov	[supplemental_code],0F0h
6034
	lods	byte [esi]
5947
	lods	byte [esi]
6035
	call	get_size_operator
5948
	call	get_size_operator
6036
	cmp	al,10h
5949
	cmp	al,10h
6037
	jne	invalid_operand
5950
	jne	invalid_operand
6038
	lods	byte [esi]
5951
	lods	byte [esi]
6039
	call	convert_register
5952
	call	convert_register
6040
	mov	[postbyte_register],al
5953
	mov	[postbyte_register],al
6041
	cmp	ah,8
5954
	cmp	ah,8
6042
	je	crc32_reg64
5955
	je	crc32_reg64
6043
	cmp	ah,4
5956
	cmp	ah,4
6044
	jne	invalid_operand
5957
	jne	invalid_operand
6045
	lods	byte [esi]
5958
	lods	byte [esi]
6046
	cmp	al,','
5959
	cmp	al,','
6047
	jne	invalid_operand
5960
	jne	invalid_operand
6048
	mov	[operand_size],0
5961
	mov	[operand_size],0
6049
	lods	byte [esi]
5962
	lods	byte [esi]
6050
	call	get_size_operator
5963
	call	get_size_operator
6051
	cmp	al,10h
5964
	cmp	al,10h
6052
	je	crc32_reg32_reg
5965
	je	crc32_reg32_reg
6053
	cmp	al,'['
5966
	cmp	al,'['
6054
	jne	invalid_operand
5967
	jne	invalid_operand
6055
	call	get_address
5968
	call	get_address
6056
	mov	al,[operand_size]
5969
	mov	al,[operand_size]
6057
	test	al,al
5970
	test	al,al
6058
	jz	crc32_unknown_size
5971
	jz	crc32_unknown_size
6059
	cmp	al,1
5972
	cmp	al,1
6060
	je	crc32_reg32_mem_store
5973
	je	crc32_reg32_mem_store
6061
	cmp	al,4
5974
	cmp	al,4
6062
	ja	invalid_operand_size
5975
	ja	invalid_operand_size
6063
	inc	[supplemental_code]
5976
	inc	[supplemental_code]
6064
	call	operand_autodetect
5977
	call	operand_autodetect
6065
      crc32_reg32_mem_store:
5978
      crc32_reg32_mem_store:
6066
	jmp	instruction_ready
5979
	jmp	instruction_ready
6067
      crc32_unknown_size:
5980
      crc32_unknown_size:
6068
	cmp	[error_line],0
5981
	cmp	[error_line],0
6069
	jne	crc32_reg32_mem_store
5982
	jne	crc32_reg32_mem_store
6070
	mov	eax,[current_line]
5983
	mov	eax,[current_line]
6071
	mov	[error_line],eax
5984
	mov	[error_line],eax
6072
	mov	[error],operand_size_not_specified
5985
	mov	[error],operand_size_not_specified
6073
	jmp	crc32_reg32_mem_store
5986
	jmp	crc32_reg32_mem_store
6074
      crc32_reg32_reg:
5987
      crc32_reg32_reg:
6075
	lods	byte [esi]
5988
	lods	byte [esi]
6076
	call	convert_register
5989
	call	convert_register
6077
	mov	bl,al
5990
	mov	bl,al
6078
	mov	al,ah
5991
	mov	al,ah
6079
	cmp	al,1
5992
	cmp	al,1
6080
	je	crc32_reg32_reg_store
5993
	je	crc32_reg32_reg_store
6081
	cmp	al,4
5994
	cmp	al,4
6082
	ja	invalid_operand_size
5995
	ja	invalid_operand_size
6083
	inc	[supplemental_code]
5996
	inc	[supplemental_code]
6084
	call	operand_autodetect
5997
	call	operand_autodetect
6085
      crc32_reg32_reg_store:
5998
      crc32_reg32_reg_store:
6086
	jmp	nomem_instruction_ready
5999
	jmp	nomem_instruction_ready
6087
      crc32_reg64:
6000
      crc32_reg64:
6088
	lods	byte [esi]
6001
	lods	byte [esi]
6089
	cmp	al,','
6002
	cmp	al,','
6090
	jne	invalid_operand
6003
	jne	invalid_operand
6091
	mov	[operand_size],0
6004
	mov	[operand_size],0
6092
	call	operand_64bit
6005
	call	operand_64bit
6093
	lods	byte [esi]
6006
	lods	byte [esi]
6094
	call	get_size_operator
6007
	call	get_size_operator
6095
	cmp	al,10h
6008
	cmp	al,10h
6096
	je	crc32_reg64_reg
6009
	je	crc32_reg64_reg
6097
	cmp	al,'['
6010
	cmp	al,'['
6098
	jne	invalid_operand
6011
	jne	invalid_operand
6099
	call	get_address
6012
	call	get_address
6100
	mov	ah,[operand_size]
6013
	mov	ah,[operand_size]
6101
	mov	al,8
6014
	mov	al,8
6102
	test	ah,ah
6015
	test	ah,ah
6103
	jz	crc32_unknown_size
6016
	jz	crc32_unknown_size
6104
	cmp	ah,1
6017
	cmp	ah,1
6105
	je	crc32_reg32_mem_store
6018
	je	crc32_reg32_mem_store
6106
	cmp	ah,al
6019
	cmp	ah,al
6107
	jne	invalid_operand_size
6020
	jne	invalid_operand_size
6108
	inc	[supplemental_code]
6021
	inc	[supplemental_code]
6109
	jmp	crc32_reg32_mem_store
6022
	jmp	crc32_reg32_mem_store
6110
      crc32_reg64_reg:
6023
      crc32_reg64_reg:
6111
	lods	byte [esi]
6024
	lods	byte [esi]
6112
	call	convert_register
6025
	call	convert_register
6113
	mov	bl,al
6026
	mov	bl,al
6114
	mov	al,8
6027
	mov	al,8
6115
	cmp	ah,1
6028
	cmp	ah,1
6116
	je	crc32_reg32_reg_store
6029
	je	crc32_reg32_reg_store
6117
	cmp	ah,al
6030
	cmp	ah,al
6118
	jne	invalid_operand_size
6031
	jne	invalid_operand_size
6119
	inc	[supplemental_code]
6032
	inc	[supplemental_code]
6120
	jmp	crc32_reg32_reg_store
6033
	jmp	crc32_reg32_reg_store
6121
popcnt_instruction:
6034
popcnt_instruction:
6122
	mov	[opcode_prefix],0F3h
6035
	mov	[opcode_prefix],0F3h
6123
	jmp	bs_instruction
6036
	jmp	bs_instruction
6124
movbe_instruction:
6037
movbe_instruction:
6125
	mov	[supplemental_code],al
6038
	mov	[supplemental_code],al
6126
	mov	[extended_code],38h
6039
	mov	[extended_code],38h
6127
	mov	[base_code],0Fh
6040
	mov	[base_code],0Fh
6128
	lods	byte [esi]
6041
	lods	byte [esi]
6129
	call	get_size_operator
6042
	call	get_size_operator
6130
	cmp	al,'['
6043
	cmp	al,'['
6131
	je	movbe_mem
6044
	je	movbe_mem
6132
	cmp	al,10h
6045
	cmp	al,10h
6133
	jne	invalid_operand
6046
	jne	invalid_operand
6134
	lods	byte [esi]
6047
	lods	byte [esi]
6135
	call	convert_register
6048
	call	convert_register
6136
	mov	[postbyte_register],al
6049
	mov	[postbyte_register],al
6137
	lods	byte [esi]
6050
	lods	byte [esi]
6138
	cmp	al,','
6051
	cmp	al,','
6139
	jne	invalid_operand
6052
	jne	invalid_operand
6140
	lods	byte [esi]
6053
	lods	byte [esi]
6141
	call	get_size_operator
6054
	call	get_size_operator
6142
;       cmp     al,10h
6055
	cmp	al,'['
6143
;       je      movbe_reg_reg
-
 
6144
	cmp	al,'['
-
 
6145
	jne	invalid_argument
6056
	jne	invalid_argument
6146
	call	get_address
6057
	call	get_address
6147
	mov	al,[operand_size]
6058
	mov	al,[operand_size]
6148
	call	operand_autodetect
6059
	call	operand_autodetect
6149
	jmp	instruction_ready
6060
	jmp	instruction_ready
6150
;      movbe_reg_reg:
6061
      movbe_mem:
6151
;       lods    byte [esi]
-
 
6152
;       call    convert_register
-
 
6153
;       mov     bl,al
-
 
6154
;       mov     al,ah
-
 
6155
;       call    operand_autodetect
-
 
6156
;       jmp     nomem_instruction_ready
-
 
6157
      movbe_mem:
-
 
6158
	inc	[supplemental_code]
6062
	inc	[supplemental_code]
6159
	call	get_address
6063
	call	get_address
6160
	push	edx ebx ecx
6064
	push	edx ebx ecx
6161
	lods	byte [esi]
6065
	lods	byte [esi]
6162
	cmp	al,','
6066
	cmp	al,','
6163
	jne	invalid_operand
6067
	jne	invalid_operand
6164
	lods	byte [esi]
6068
	lods	byte [esi]
6165
	call	get_size_operator
6069
	call	get_size_operator
6166
	cmp	al,10h
6070
	cmp	al,10h
6167
	jne	invalid_operand
6071
	jne	invalid_operand
6168
	lods	byte [esi]
6072
	lods	byte [esi]
6169
	call	convert_register
6073
	call	convert_register
6170
	mov	[postbyte_register],al
6074
	mov	[postbyte_register],al
6171
	pop	ecx ebx edx
6075
	pop	ecx ebx edx
6172
	mov	al,[operand_size]
6076
	mov	al,[operand_size]
6173
	call	operand_autodetect
6077
	call	operand_autodetect
6174
	jmp	instruction_ready
6078
	jmp	instruction_ready
6175
 
6079
 
6176
simple_vmx_instruction:
6080
simple_vmx_instruction:
6177
	mov	ah,al
6081
	mov	ah,al
6178
	mov	al,0Fh
6082
	mov	al,0Fh
6179
	stos	byte [edi]
6083
	stos	byte [edi]
6180
	mov	al,1
6084
	mov	al,1
6181
	stos	word [edi]
6085
	stos	word [edi]
6182
	jmp	instruction_assembled
6086
	jmp	instruction_assembled
6183
vmclear_instruction:
6087
vmclear_instruction:
6184
	mov	[opcode_prefix],66h
6088
	mov	[opcode_prefix],66h
6185
	jmp	vmx_instruction
6089
	jmp	vmx_instruction
6186
vmxon_instruction:
6090
vmxon_instruction:
6187
	mov	[opcode_prefix],0F3h
6091
	mov	[opcode_prefix],0F3h
6188
vmx_instruction:
6092
vmx_instruction:
6189
	mov	[postbyte_register],al
6093
	mov	[postbyte_register],al
6190
	mov	[extended_code],0C7h
6094
	mov	[extended_code],0C7h
6191
	lods	byte [esi]
6095
	lods	byte [esi]
6192
	call	get_size_operator
6096
	call	get_size_operator
6193
	cmp	al,'['
6097
	cmp	al,'['
6194
	jne	invalid_operand
6098
	jne	invalid_operand
6195
	call	get_address
6099
	call	get_address
6196
	mov	al,[operand_size]
6100
	mov	al,[operand_size]
6197
	or	al,al
6101
	or	al,al
6198
	jz	vmx_size_ok
6102
	jz	vmx_size_ok
6199
	cmp	al,8
6103
	cmp	al,8
6200
	jne	invalid_operand_size
6104
	jne	invalid_operand_size
6201
      vmx_size_ok:
6105
      vmx_size_ok:
6202
	mov	[base_code],0Fh
6106
	mov	[base_code],0Fh
6203
	jmp	instruction_ready
6107
	jmp	instruction_ready
6204
vmread_instruction:
6108
vmread_instruction:
6205
	mov	[extended_code],78h
6109
	mov	[extended_code],78h
6206
	lods	byte [esi]
6110
	lods	byte [esi]
6207
	call	get_size_operator
6111
	call	get_size_operator
6208
	cmp	al,10h
6112
	cmp	al,10h
6209
	je	vmread_nomem
6113
	je	vmread_nomem
6210
	cmp	al,'['
6114
	cmp	al,'['
6211
	jne	invalid_operand
6115
	jne	invalid_operand
6212
	call	get_address
6116
	call	get_address
6213
	lods	byte [esi]
6117
	lods	byte [esi]
6214
	cmp	al,','
6118
	cmp	al,','
6215
	jne	invalid_operand
6119
	jne	invalid_operand
6216
	lods	byte [esi]
6120
	lods	byte [esi]
6217
	call	get_size_operator
6121
	call	get_size_operator
6218
	cmp	al,10h
6122
	cmp	al,10h
6219
	jne	invalid_operand
6123
	jne	invalid_operand
6220
	lods	byte [esi]
6124
	lods	byte [esi]
6221
	call	convert_register
6125
	call	convert_register
6222
	mov	[postbyte_register],al
6126
	mov	[postbyte_register],al
6223
	call	vmread_check_size
6127
	call	vmread_check_size
6224
	jmp	vmx_size_ok
6128
	jmp	vmx_size_ok
6225
      vmread_nomem:
6129
      vmread_nomem:
6226
	lods	byte [esi]
6130
	lods	byte [esi]
6227
	call	convert_register
6131
	call	convert_register
6228
	push	eax
6132
	push	eax
6229
	call	vmread_check_size
6133
	call	vmread_check_size
6230
	lods	byte [esi]
6134
	lods	byte [esi]
6231
	cmp	al,','
6135
	cmp	al,','
6232
	jne	invalid_operand
6136
	jne	invalid_operand
6233
	lods	byte [esi]
6137
	lods	byte [esi]
6234
	call	get_size_operator
6138
	call	get_size_operator
6235
	cmp	al,10h
6139
	cmp	al,10h
6236
	jne	invalid_operand
6140
	jne	invalid_operand
6237
	lods	byte [esi]
6141
	lods	byte [esi]
6238
	call	convert_register
6142
	call	convert_register
6239
	mov	[postbyte_register],al
6143
	mov	[postbyte_register],al
6240
	call	vmread_check_size
6144
	call	vmread_check_size
6241
	pop	ebx
6145
	pop	ebx
6242
	mov	[base_code],0Fh
6146
	mov	[base_code],0Fh
6243
	jmp	nomem_instruction_ready
6147
	jmp	nomem_instruction_ready
6244
      vmread_check_size:
6148
      vmread_check_size:
6245
	cmp	[code_type],64
6149
	cmp	[code_type],64
6246
	je	vmread_long
6150
	je	vmread_long
6247
	cmp	[operand_size],4
6151
	cmp	[operand_size],4
6248
	jne	invalid_operand_size
6152
	jne	invalid_operand_size
6249
	ret
6153
	ret
6250
      vmread_long:
6154
      vmread_long:
6251
	cmp	[operand_size],8
6155
	cmp	[operand_size],8
6252
	jne	invalid_operand_size
6156
	jne	invalid_operand_size
6253
	ret
6157
	ret
6254
vmwrite_instruction:
6158
vmwrite_instruction:
6255
	mov	[extended_code],79h
6159
	mov	[extended_code],79h
6256
	lods	byte [esi]
6160
	lods	byte [esi]
6257
	call	get_size_operator
6161
	call	get_size_operator
6258
	cmp	al,10h
6162
	cmp	al,10h
6259
	jne	invalid_operand
6163
	jne	invalid_operand
6260
	lods	byte [esi]
6164
	lods	byte [esi]
6261
	call	convert_register
6165
	call	convert_register
6262
	mov	[postbyte_register],al
6166
	mov	[postbyte_register],al
6263
	lods	byte [esi]
6167
	lods	byte [esi]
6264
	cmp	al,','
6168
	cmp	al,','
6265
	jne	invalid_operand
6169
	jne	invalid_operand
6266
	lods	byte [esi]
6170
	lods	byte [esi]
6267
	call	get_size_operator
6171
	call	get_size_operator
6268
	cmp	al,10h
6172
	cmp	al,10h
6269
	je	vmwrite_nomem
6173
	je	vmwrite_nomem
6270
	cmp	al,'['
6174
	cmp	al,'['
6271
	jne	invalid_operand
6175
	jne	invalid_operand
6272
	call	get_address
6176
	call	get_address
6273
	call	vmread_check_size
6177
	call	vmread_check_size
6274
	jmp	vmx_size_ok
6178
	jmp	vmx_size_ok
6275
      vmwrite_nomem:
6179
      vmwrite_nomem:
6276
	lods	byte [esi]
6180
	lods	byte [esi]
6277
	call	convert_register
6181
	call	convert_register
6278
	mov	bl,al
6182
	mov	bl,al
6279
	mov	[base_code],0Fh
6183
	mov	[base_code],0Fh
6280
	jmp	nomem_instruction_ready
6184
	jmp	nomem_instruction_ready
6281
vmx_inv_instruction:
6185
vmx_inv_instruction:
6282
	mov	[opcode_prefix],66h
6186
	mov	[opcode_prefix],66h
6283
	mov	[extended_code],38h
6187
	mov	[extended_code],38h
6284
	mov	[supplemental_code],al
6188
	mov	[supplemental_code],al
6285
	lods	byte [esi]
6189
	lods	byte [esi]
6286
	call	get_size_operator
6190
	call	get_size_operator
6287
	cmp	al,10h
6191
	cmp	al,10h
6288
	jne	invalid_operand
6192
	jne	invalid_operand
6289
	lods	byte [esi]
6193
	lods	byte [esi]
6290
	call	convert_register
6194
	call	convert_register
6291
	mov	[postbyte_register],al
6195
	mov	[postbyte_register],al
6292
	call	vmread_check_size
6196
	call	vmread_check_size
6293
	mov	[operand_size],0
6197
	mov	[operand_size],0
6294
	lods	byte [esi]
6198
	lods	byte [esi]
6295
	cmp	al,','
6199
	cmp	al,','
6296
	jne	invalid_operand
6200
	jne	invalid_operand
6297
	lods	byte [esi]
6201
	lods	byte [esi]
6298
	call	get_size_operator
6202
	call	get_size_operator
6299
	cmp	al,'['
6203
	cmp	al,'['
6300
	jne	invalid_operand
6204
	jne	invalid_operand
6301
	call	get_address
6205
	call	get_address
6302
	mov	al,[operand_size]
6206
	mov	al,[operand_size]
6303
	or	al,al
6207
	or	al,al
6304
	jz	vmx_size_ok
6208
	jz	vmx_size_ok
6305
	cmp	al,16
6209
	cmp	al,16
6306
	jne	invalid_operand_size
6210
	jne	invalid_operand_size
6307
	jmp	vmx_size_ok
6211
	jmp	vmx_size_ok
6308
simple_svm_instruction:
6212
simple_svm_instruction:
6309
	push	eax
6213
	push	eax
6310
	mov	[base_code],0Fh
6214
	mov	[base_code],0Fh
6311
	mov	[extended_code],1
6215
	mov	[extended_code],1
6312
	lods	byte [esi]
6216
	lods	byte [esi]
6313
	call	get_size_operator
6217
	call	get_size_operator
6314
	cmp	al,10h
6218
	cmp	al,10h
6315
	jne	invalid_operand
6219
	jne	invalid_operand
6316
	lods	byte [esi]
6220
	lods	byte [esi]
6317
	call	convert_register
6221
	call	convert_register
6318
	or	al,al
6222
	or	al,al
6319
	jnz	invalid_operand
6223
	jnz	invalid_operand
6320
      simple_svm_detect_size:
6224
      simple_svm_detect_size:
6321
	cmp	ah,2
6225
	cmp	ah,2
6322
	je	simple_svm_16bit
6226
	je	simple_svm_16bit
6323
	cmp	ah,4
6227
	cmp	ah,4
6324
	je	simple_svm_32bit
6228
	je	simple_svm_32bit
6325
	cmp	[code_type],64
6229
	cmp	[code_type],64
6326
	jne	invalid_operand_size
6230
	jne	invalid_operand_size
6327
	jmp	simple_svm_store
6231
	jmp	simple_svm_store
6328
      simple_svm_16bit:
6232
      simple_svm_16bit:
6329
	cmp	[code_type],16
6233
	cmp	[code_type],16
6330
	je	simple_svm_store
6234
	je	simple_svm_store
6331
	cmp	[code_type],64
6235
	cmp	[code_type],64
6332
	je	invalid_operand_size
6236
	je	invalid_operand_size
6333
	jmp	prefixed_svm_store
6237
	jmp	prefixed_svm_store
6334
      simple_svm_32bit:
6238
      simple_svm_32bit:
6335
	cmp	[code_type],32
6239
	cmp	[code_type],32
6336
	je	simple_svm_store
6240
	je	simple_svm_store
6337
      prefixed_svm_store:
6241
      prefixed_svm_store:
6338
	mov	al,67h
6242
	mov	al,67h
6339
	stos	byte [edi]
6243
	stos	byte [edi]
6340
      simple_svm_store:
6244
      simple_svm_store:
6341
	call	store_instruction_code
6245
	call	store_instruction_code
6342
	pop	eax
6246
	pop	eax
6343
	stos	byte [edi]
6247
	stos	byte [edi]
6344
	jmp	instruction_assembled
6248
	jmp	instruction_assembled
6345
skinit_instruction:
6249
skinit_instruction:
6346
	lods	byte [esi]
6250
	lods	byte [esi]
6347
	call	get_size_operator
6251
	call	get_size_operator
6348
	cmp	al,10h
6252
	cmp	al,10h
6349
	jne	invalid_operand
6253
	jne	invalid_operand
6350
	lods	byte [esi]
6254
	lods	byte [esi]
6351
	call	convert_register
6255
	call	convert_register
6352
	cmp	ax,0400h
6256
	cmp	ax,0400h
6353
	jne	invalid_operand
6257
	jne	invalid_operand
6354
	mov	al,0DEh
6258
	mov	al,0DEh
6355
	jmp	simple_vmx_instruction
6259
	jmp	simple_vmx_instruction
6356
invlpga_instruction:
6260
invlpga_instruction:
6357
	push	eax
6261
	push	eax
6358
	mov	[base_code],0Fh
6262
	mov	[base_code],0Fh
6359
	mov	[extended_code],1
6263
	mov	[extended_code],1
6360
	lods	byte [esi]
6264
	lods	byte [esi]
6361
	call	get_size_operator
6265
	call	get_size_operator
6362
	cmp	al,10h
6266
	cmp	al,10h
6363
	jne	invalid_operand
6267
	jne	invalid_operand
6364
	lods	byte [esi]
6268
	lods	byte [esi]
6365
	call	convert_register
6269
	call	convert_register
6366
	or	al,al
6270
	or	al,al
6367
	jnz	invalid_operand
6271
	jnz	invalid_operand
6368
	mov	bl,ah
6272
	mov	bl,ah
6369
	mov	[operand_size],0
6273
	mov	[operand_size],0
6370
	lods	byte [esi]
6274
	lods	byte [esi]
6371
	cmp	al,','
6275
	cmp	al,','
6372
	jne	invalid_operand
6276
	jne	invalid_operand
6373
	lods	byte [esi]
6277
	lods	byte [esi]
6374
	call	get_size_operator
6278
	call	get_size_operator
6375
	cmp	al,10h
6279
	cmp	al,10h
6376
	jne	invalid_operand
6280
	jne	invalid_operand
6377
	lods	byte [esi]
6281
	lods	byte [esi]
6378
	call	convert_register
6282
	call	convert_register
6379
	cmp	ax,0401h
6283
	cmp	ax,0401h
6380
	jne	invalid_operand
6284
	jne	invalid_operand
6381
	mov	ah,bl
6285
	mov	ah,bl
6382
	jmp	simple_svm_detect_size
6286
	jmp	simple_svm_detect_size
6383
 
6287
 
-
 
6288
rdrand_instruction:
-
 
6289
	mov	[base_code],0Fh
-
 
6290
	mov	[extended_code],0C7h
-
 
6291
	mov	[postbyte_register],al
-
 
6292
	lods	byte [esi]
-
 
6293
	call	get_size_operator
-
 
6294
	cmp	al,10h
-
 
6295
	jne	invalid_operand
-
 
6296
	lods	byte [esi]
-
 
6297
	call	convert_register
-
 
6298
	mov	bl,al
-
 
6299
	mov	al,ah
-
 
6300
	call	operand_autodetect
-
 
6301
	jmp	nomem_instruction_ready
-
 
6302
rdfsbase_instruction:
-
 
6303
	mov	[opcode_prefix],0F3h
-
 
6304
	mov	[base_code],0Fh
-
 
6305
	mov	[extended_code],0AEh
-
 
6306
	mov	[postbyte_register],al
-
 
6307
	lods	byte [esi]
-
 
6308
	call	get_size_operator
-
 
6309
	cmp	al,10h
-
 
6310
	jne	invalid_operand
-
 
6311
	lods	byte [esi]
-
 
6312
	call	convert_register
-
 
6313
	mov	bl,al
-
 
6314
	mov	al,ah
-
 
6315
	cmp	ah,2
-
 
6316
	je	invalid_operand_size
-
 
6317
	call	operand_autodetect
-
 
6318
	jmp	nomem_instruction_ready
-
 
6319
 
6384
convert_register:
6320
convert_register:
6385
	mov	ah,al
6321
	mov	ah,al
6386
	shr	ah,4
6322
	shr	ah,4
6387
	and	al,0Fh
6323
	and	al,0Fh
6388
	cmp	ah,8
6324
	cmp	ah,8
6389
	je	match_register_size
6325
	je	match_register_size
6390
	cmp	ah,4
6326
	cmp	ah,4
6391
	ja	invalid_operand
6327
	ja	invalid_operand
6392
	cmp	ah,1
6328
	cmp	ah,1
6393
	ja	match_register_size
6329
	ja	match_register_size
6394
	cmp	al,4
6330
	cmp	al,4
6395
	jb	match_register_size
6331
	jb	match_register_size
6396
	or	ah,ah
6332
	or	ah,ah
6397
	jz	high_byte_register
6333
	jz	high_byte_register
6398
	or	[rex_prefix],40h
6334
	or	[rex_prefix],40h
6399
      match_register_size:
6335
      match_register_size:
6400
	cmp	ah,[operand_size]
6336
	cmp	ah,[operand_size]
6401
	je	register_size_ok
6337
	je	register_size_ok
6402
	cmp	[operand_size],0
6338
	cmp	[operand_size],0
6403
	jne	operand_sizes_do_not_match
6339
	jne	operand_sizes_do_not_match
6404
	mov	[operand_size],ah
6340
	mov	[operand_size],ah
6405
      register_size_ok:
6341
      register_size_ok:
6406
	ret
6342
	ret
6407
      high_byte_register:
6343
      high_byte_register:
6408
	mov	ah,1
6344
	mov	ah,1
6409
	or	[rex_prefix],80h
6345
	or	[rex_prefix],80h
6410
	jmp	match_register_size
6346
	jmp	match_register_size
6411
convert_fpu_register:
6347
convert_fpu_register:
6412
	mov	ah,al
6348
	mov	ah,al
6413
	shr	ah,4
6349
	shr	ah,4
6414
	and	al,111b
6350
	and	al,111b
6415
	cmp	ah,10
6351
	cmp	ah,10
6416
	jne	invalid_operand
6352
	jne	invalid_operand
6417
	jmp	match_register_size
6353
	jmp	match_register_size
6418
convert_mmx_register:
6354
convert_mmx_register:
6419
	mov	ah,al
6355
	mov	ah,al
6420
	shr	ah,4
6356
	shr	ah,4
6421
	cmp	ah,0Ch
6357
	cmp	ah,0Ch
6422
	je	xmm_register
6358
	je	xmm_register
6423
	ja	invalid_operand
6359
	ja	invalid_operand
6424
	and	al,111b
6360
	and	al,111b
6425
	cmp	ah,0Bh
6361
	cmp	ah,0Bh
6426
	jne	invalid_operand
6362
	jne	invalid_operand
6427
	mov	ah,8
6363
	mov	ah,8
6428
	jmp	match_register_size
6364
	cmp	[vex_required],0
-
 
6365
	jne	invalid_operand
-
 
6366
	jmp	match_register_size
6429
      xmm_register:
6367
      xmm_register:
6430
	and	al,0Fh
6368
	and	al,0Fh
6431
	mov	ah,16
6369
	mov	ah,16
6432
	cmp	al,8
6370
	cmp	al,8
6433
	jb	match_register_size
6371
	jb	match_register_size
6434
	cmp	[code_type],64
6372
	cmp	[code_type],64
6435
	jne	invalid_operand
6373
	jne	invalid_operand
6436
	jmp	match_register_size
6374
	jmp	match_register_size
6437
get_size_operator:
6375
convert_xmm_register:
-
 
6376
	mov	ah,al
-
 
6377
	shr	ah,4
-
 
6378
	cmp	ah,0Ch
-
 
6379
	je	xmm_register
-
 
6380
	jmp	invalid_operand
-
 
6381
get_size_operator:
6438
	xor	ah,ah
6382
	xor	ah,ah
6439
	cmp	al,11h
6383
	cmp	al,11h
6440
	jne	no_size_operator
6384
	jne	no_size_operator
6441
	mov	[size_declared],1
6385
	mov	[size_declared],1
6442
	lods	word [esi]
6386
	lods	word [esi]
6443
	xchg	al,ah
6387
	xchg	al,ah
6444
	mov	[size_override],1
6388
	mov	[size_override],1
6445
	cmp	ah,[operand_size]
6389
	cmp	ah,[operand_size]
6446
	je	size_operator_ok
6390
	je	size_operator_ok
6447
	cmp	[operand_size],0
6391
	cmp	[operand_size],0
6448
	jne	operand_sizes_do_not_match
6392
	jne	operand_sizes_do_not_match
6449
	mov	[operand_size],ah
6393
	mov	[operand_size],ah
6450
      size_operator_ok:
6394
      size_operator_ok:
6451
	ret
6395
	ret
6452
      no_size_operator:
6396
      no_size_operator:
6453
	mov	[size_declared],0
6397
	mov	[size_declared],0
6454
	cmp	al,'['
6398
	cmp	al,'['
6455
	jne	size_operator_ok
6399
	jne	size_operator_ok
6456
	mov	[size_override],0
6400
	mov	[size_override],0
6457
	ret
6401
	ret
6458
get_jump_operator:
6402
get_jump_operator:
6459
	mov	[jump_type],0
6403
	mov	[jump_type],0
6460
	cmp	al,12h
6404
	cmp	al,12h
6461
	jne	jump_operator_ok
6405
	jne	jump_operator_ok
6462
	lods	word [esi]
6406
	lods	word [esi]
6463
	mov	[jump_type],al
6407
	mov	[jump_type],al
6464
	mov	al,ah
6408
	mov	al,ah
6465
      jump_operator_ok:
6409
      jump_operator_ok:
6466
	ret
6410
	ret
6467
get_address:
6411
get_address:
6468
	mov	[segment_register],0
6412
	mov	[segment_register],0
6469
	mov	[address_size],0
6413
	mov	[address_size],0
6470
	mov	al,[code_type]
6414
	mov	al,[code_type]
6471
	shr	al,3
6415
	shr	al,3
6472
	mov	[value_size],al
6416
	mov	[value_size],al
6473
	mov	al,[esi]
6417
	mov	al,[esi]
6474
	and	al,11110000b
6418
	and	al,11110000b
6475
	cmp	al,60h
6419
	cmp	al,60h
6476
	jne	get_size_prefix
6420
	jne	get_size_prefix
6477
	lods	byte [esi]
6421
	lods	byte [esi]
6478
	sub	al,60h
6422
	sub	al,60h
6479
	mov	[segment_register],al
6423
	mov	[segment_register],al
6480
	mov	al,[esi]
6424
	mov	al,[esi]
6481
	and	al,11110000b
6425
	and	al,11110000b
6482
      get_size_prefix:
6426
      get_size_prefix:
6483
	cmp	al,70h
6427
	cmp	al,70h
6484
	jne	address_size_prefix_ok
6428
	jne	address_size_prefix_ok
6485
	lods	byte [esi]
6429
	lods	byte [esi]
6486
	sub	al,70h
6430
	sub	al,70h
6487
	cmp	al,2
6431
	cmp	al,2
6488
	jb	invalid_address_size
6432
	jb	invalid_address_size
6489
	cmp	al,8
6433
	cmp	al,8
6490
	ja	invalid_address_size
6434
	ja	invalid_address_size
6491
	mov	[address_size],al
6435
	mov	[address_size],al
6492
	mov	[value_size],al
6436
	mov	[value_size],al
6493
      address_size_prefix_ok:
6437
      address_size_prefix_ok:
6494
	call	calculate_address
6438
	call	calculate_address
6495
	cmp	byte [esi-1],']'
6439
	cmp	byte [esi-1],']'
6496
	jne	invalid_address
6440
	jne	invalid_address
6497
	mov	[address_high],edx
6441
	mov	[address_high],edx
6498
	mov	edx,eax
6442
	mov	edx,eax
6499
	cmp	[code_type],64
6443
	cmp	[code_type],64
6500
	jne	address_ok
6444
	jne	address_ok
6501
	or	bx,bx
6445
	or	bx,bx
6502
	jnz	address_ok
6446
	jnz	address_ok
6503
	test	ch,0Fh
6447
	test	ch,0Fh
6504
	jnz	address_ok
6448
	jnz	address_ok
6505
      calculate_relative_address:
6449
      calculate_relative_address:
6506
	mov	edx,[address_symbol]
6450
	mov	edx,[address_symbol]
6507
	mov	[symbol_identifier],edx
6451
	mov	[symbol_identifier],edx
6508
	mov	edx,[address_high]
6452
	mov	edx,[address_high]
6509
	call	calculate_relative_offset
6453
	call	calculate_relative_offset
6510
	mov	[address_high],edx
6454
	mov	[address_high],edx
6511
	cdq
6455
	cdq
6512
	cmp	edx,[address_high]
6456
	cmp	edx,[address_high]
6513
	je	address_high_ok
6457
	je	address_high_ok
6514
	cmp	[error_line],0
6458
	cmp	[error_line],0
6515
	jne	address_high_ok
6459
	jne	address_high_ok
6516
	mov	ebx,[current_line]
6460
	mov	ebx,[current_line]
6517
	mov	[error_line],ebx
6461
	mov	[error_line],ebx
6518
	mov	[error],value_out_of_range
6462
	mov	[error],value_out_of_range
6519
      address_high_ok:
6463
      address_high_ok:
6520
	mov	edx,eax
6464
	mov	edx,eax
6521
	ror	ecx,16
6465
	ror	ecx,16
6522
	mov	cl,[value_type]
6466
	mov	cl,[value_type]
6523
	rol	ecx,16
6467
	rol	ecx,16
6524
	mov	bx,0FF00h
6468
	mov	bx,0FF00h
6525
      address_ok:
6469
      address_ok:
6526
	ret
6470
	ret
6527
operand_16bit:
6471
operand_16bit:
6528
	cmp	[code_type],16
6472
	cmp	[code_type],16
6529
	je	size_prefix_ok
6473
	je	size_prefix_ok
6530
	mov	[operand_prefix],66h
6474
	mov	[operand_prefix],66h
6531
	ret
6475
	ret
6532
operand_32bit:
6476
operand_32bit:
6533
	cmp	[code_type],16
6477
	cmp	[code_type],16
6534
	jne	size_prefix_ok
6478
	jne	size_prefix_ok
6535
	mov	[operand_prefix],66h
6479
	mov	[operand_prefix],66h
6536
      size_prefix_ok:
6480
      size_prefix_ok:
6537
	ret
6481
	ret
6538
operand_64bit:
6482
operand_64bit:
6539
	cmp	[code_type],64
6483
	cmp	[code_type],64
6540
	jne	illegal_instruction
6484
	jne	illegal_instruction
6541
	or	[rex_prefix],48h
6485
	or	[rex_prefix],48h
6542
	ret
6486
	ret
6543
operand_autodetect:
6487
operand_autodetect:
6544
	cmp	al,2
6488
	cmp	al,2
6545
	je	operand_16bit
6489
	je	operand_16bit
6546
	cmp	al,4
6490
	cmp	al,4
6547
	je	operand_32bit
6491
	je	operand_32bit
6548
	cmp	al,8
6492
	cmp	al,8
6549
	je	operand_64bit
6493
	je	operand_64bit
6550
	jmp	invalid_operand_size
6494
	jmp	invalid_operand_size
6551
store_segment_prefix_if_necessary:
6495
store_segment_prefix_if_necessary:
6552
	mov	al,[segment_register]
6496
	mov	al,[segment_register]
6553
	or	al,al
6497
	or	al,al
6554
	jz	segment_prefix_ok
6498
	jz	segment_prefix_ok
6555
	cmp	al,3
6499
	cmp	al,4
6556
	je	ss_prefix
-
 
6557
	cmp	al,4
-
 
6558
	ja	segment_prefix_386
6500
	ja	segment_prefix_386
6559
	jb	segment_prefix_86
6501
	cmp	[code_type],64
-
 
6502
	je	segment_prefix_ok
-
 
6503
	cmp	al,3
-
 
6504
	je	ss_prefix
-
 
6505
	jb	segment_prefix_86
6560
	cmp	bl,25h
6506
	cmp	bl,25h
6561
	je	segment_prefix_86
6507
	je	segment_prefix_86
6562
	cmp	bh,25h
6508
	cmp	bh,25h
6563
	je	segment_prefix_86
6509
	je	segment_prefix_86
6564
	cmp	bh,45h
6510
	cmp	bh,45h
6565
	je	segment_prefix_86
6511
	je	segment_prefix_86
6566
	cmp	bh,44h
6512
	cmp	bh,44h
6567
	je	segment_prefix_86
6513
	je	segment_prefix_86
6568
	ret
6514
	ret
6569
      ss_prefix:
6515
      ss_prefix:
6570
	cmp	bl,25h
6516
	cmp	bl,25h
6571
	je	segment_prefix_ok
6517
	je	segment_prefix_ok
6572
	cmp	bh,25h
6518
	cmp	bh,25h
6573
	je	segment_prefix_ok
6519
	je	segment_prefix_ok
6574
	cmp	bh,45h
6520
	cmp	bh,45h
6575
	je	segment_prefix_ok
6521
	je	segment_prefix_ok
6576
	cmp	bh,44h
6522
	cmp	bh,44h
6577
	je	segment_prefix_ok
6523
	je	segment_prefix_ok
6578
	jmp	segment_prefix_86
6524
	jmp	segment_prefix_86
6579
store_segment_prefix:
6525
store_segment_prefix:
6580
	mov	al,[segment_register]
6526
	mov	al,[segment_register]
6581
	or	al,al
6527
	or	al,al
6582
	jz	segment_prefix_ok
6528
	jz	segment_prefix_ok
6583
	cmp	al,5
6529
	cmp	al,5
6584
	jae	segment_prefix_386
6530
	jae	segment_prefix_386
6585
      segment_prefix_86:
6531
      segment_prefix_86:
6586
	dec	al
6532
	dec	al
6587
	shl	al,3
6533
	shl	al,3
6588
	add	al,26h
6534
	add	al,26h
6589
	stos	byte [edi]
6535
	stos	byte [edi]
6590
	jmp	segment_prefix_ok
6536
	jmp	segment_prefix_ok
6591
      segment_prefix_386:
6537
      segment_prefix_386:
6592
	add	al,64h-5
6538
	add	al,64h-5
6593
	stos	byte [edi]
6539
	stos	byte [edi]
6594
      segment_prefix_ok:
6540
      segment_prefix_ok:
6595
	ret
6541
	ret
6596
store_instruction_code:
6542
store_instruction_code:
6597
	mov	al,[operand_prefix]
6543
	cmp	[vex_required],0
-
 
6544
	jne	store_vex_instruction_code
-
 
6545
	mov	al,[operand_prefix]
6598
	or	al,al
6546
	or	al,al
6599
	jz	operand_prefix_ok
6547
	jz	operand_prefix_ok
6600
	stos	byte [edi]
6548
	stos	byte [edi]
6601
      operand_prefix_ok:
6549
      operand_prefix_ok:
6602
	mov	al,[opcode_prefix]
6550
	mov	al,[opcode_prefix]
6603
	or	al,al
6551
	or	al,al
6604
	jz	opcode_prefix_ok
6552
	jz	opcode_prefix_ok
6605
	stos	byte [edi]
6553
	stos	byte [edi]
6606
      opcode_prefix_ok:
6554
      opcode_prefix_ok:
6607
	mov	al,[rex_prefix]
6555
	mov	al,[rex_prefix]
6608
	test	al,40h
6556
	test	al,40h
6609
	jz	rex_prefix_ok
6557
	jz	rex_prefix_ok
6610
	cmp	[code_type],64
6558
	cmp	[code_type],64
6611
	jne	invalid_operand
6559
	jne	invalid_operand
6612
	test	al,0B0h
6560
	test	al,0B0h
6613
	jnz	prefix_conflict
6561
	jnz	prefix_conflict
6614
	stos	byte [edi]
6562
	stos	byte [edi]
6615
      rex_prefix_ok:
6563
      rex_prefix_ok:
6616
	mov	al,[base_code]
6564
	mov	al,[base_code]
6617
	stos	byte [edi]
6565
	stos	byte [edi]
6618
	cmp	al,0Fh
6566
	cmp	al,0Fh
6619
	jne	instruction_code_ok
6567
	jne	instruction_code_ok
6620
      store_extended_code:
6568
      store_extended_code:
6621
	mov	al,[extended_code]
6569
	mov	al,[extended_code]
6622
	stos	byte [edi]
6570
	stos	byte [edi]
6623
	cmp	al,38h
6571
	cmp	al,38h
6624
	je	store_supplemental_code
6572
	je	store_supplemental_code
6625
	cmp	al,3Ah
6573
	cmp	al,3Ah
6626
	je	store_supplemental_code
6574
	je	store_supplemental_code
6627
      instruction_code_ok:
6575
      instruction_code_ok:
6628
	ret
6576
	ret
6629
      store_supplemental_code:
6577
      store_supplemental_code:
6630
	mov	al,[supplemental_code]
6578
	mov	al,[supplemental_code]
6631
	stos	byte [edi]
6579
	stos	byte [edi]
6632
	ret
6580
	ret
6633
store_nomem_instruction:
6581
store_nomem_instruction:
6634
	test	[postbyte_register],1000b
6582
	test	[postbyte_register],1000b
6635
	jz	nomem_reg_code_ok
6583
	jz	nomem_reg_code_ok
6636
	or	[rex_prefix],44h
6584
	or	[rex_prefix],44h
6637
	and	[postbyte_register],111b
6585
	and	[postbyte_register],111b
6638
      nomem_reg_code_ok:
6586
      nomem_reg_code_ok:
6639
	test	bl,1000b
6587
	test	bl,1000b
6640
	jz	nomem_rm_code_ok
6588
	jz	nomem_rm_code_ok
6641
	or	[rex_prefix],41h
6589
	or	[rex_prefix],41h
6642
	and	bl,111b
6590
	and	bl,111b
6643
      nomem_rm_code_ok:
6591
      nomem_rm_code_ok:
6644
	call	store_instruction_code
6592
	call	store_instruction_code
6645
	mov	al,[postbyte_register]
6593
	mov	al,[postbyte_register]
6646
	shl	al,3
6594
	shl	al,3
6647
	or	al,bl
6595
	or	al,bl
6648
	or	al,11000000b
6596
	or	al,11000000b
6649
	stos	byte [edi]
6597
	stos	byte [edi]
6650
	ret
6598
	ret
6651
store_instruction:
6599
store_instruction:
6652
	mov	[current_offset],edi
6600
	mov	[current_offset],edi
6653
	test	[postbyte_register],1000b
6601
	test	[postbyte_register],1000b
6654
	jz	reg_code_ok
6602
	jz	reg_code_ok
6655
	or	[rex_prefix],44h
6603
	or	[rex_prefix],44h
6656
	and	[postbyte_register],111b
6604
	and	[postbyte_register],111b
6657
      reg_code_ok:
6605
      reg_code_ok:
6658
	call	store_segment_prefix_if_necessary
6606
	cmp	[code_type],64
-
 
6607
	jne	address_value_ok
-
 
6608
	xor	eax,eax
-
 
6609
	bt	edx,31
-
 
6610
	sbb	eax,[address_high]
-
 
6611
	jz	address_value_ok
-
 
6612
	cmp	[address_high],0
-
 
6613
	jne	address_value_out_of_range
-
 
6614
	test	ch,44h
-
 
6615
	jnz	address_value_ok
-
 
6616
	test	bx,8080h
-
 
6617
	jz	address_value_ok
-
 
6618
      address_value_out_of_range:
-
 
6619
	cmp	[error_line],0
-
 
6620
	jne	address_value_ok
-
 
6621
	mov	edx,[current_line]
-
 
6622
	mov	[error_line],edx
-
 
6623
	mov	[error],value_out_of_range
-
 
6624
      address_value_ok:
-
 
6625
	call	store_segment_prefix_if_necessary
6659
	or	bx,bx
6626
	or	bx,bx
6660
	jz	address_immediate
6627
	jz	address_immediate
6661
	cmp	bx,0F800h
6628
	cmp	bx,0F800h
6662
	je	address_rip_based
6629
	je	address_rip_based
6663
	cmp	bx,0F400h
6630
	cmp	bx,0F400h
6664
	je	address_eip_based
6631
	je	address_eip_based
6665
	cmp	bx,0FF00h
6632
	cmp	bx,0FF00h
6666
	je	address_relative
6633
	je	address_relative
6667
	mov	al,bl
6634
	mov	al,bl
6668
	or	al,bh
6635
	or	al,bh
6669
	and	al,11110000b
6636
	and	al,11110000b
6670
	cmp	al,80h
6637
	cmp	al,80h
6671
	je	postbyte_64bit
6638
	je	postbyte_64bit
6672
	cmp	al,40h
6639
	cmp	al,40h
6673
	je	postbyte_32bit
6640
	je	postbyte_32bit
6674
	cmp	al,20h
6641
	cmp	al,20h
6675
	jne	invalid_address
6642
	jne	invalid_address
6676
	cmp	[code_type],64
6643
	cmp	[code_type],64
6677
	je	invalid_address_size
6644
	je	invalid_address_size
6678
	call	address_16bit_prefix
6645
	call	address_16bit_prefix
6679
	call	store_instruction_code
6646
	call	store_instruction_code
6680
	cmp	bl,bh
6647
	cmp	bl,bh
6681
	jbe	determine_16bit_address
6648
	jbe	determine_16bit_address
6682
	xchg	bl,bh
6649
	xchg	bl,bh
6683
      determine_16bit_address:
6650
      determine_16bit_address:
6684
	cmp	bx,2600h
6651
	cmp	bx,2600h
6685
	je	address_si
6652
	je	address_si
6686
	cmp	bx,2700h
6653
	cmp	bx,2700h
6687
	je	address_di
6654
	je	address_di
6688
	cmp	bx,2300h
6655
	cmp	bx,2300h
6689
	je	address_bx
6656
	je	address_bx
6690
	cmp	bx,2500h
6657
	cmp	bx,2500h
6691
	je	address_bp
6658
	je	address_bp
6692
	cmp	bx,2625h
6659
	cmp	bx,2625h
6693
	je	address_bp_si
6660
	je	address_bp_si
6694
	cmp	bx,2725h
6661
	cmp	bx,2725h
6695
	je	address_bp_di
6662
	je	address_bp_di
6696
	cmp	bx,2723h
6663
	cmp	bx,2723h
6697
	je	address_bx_di
6664
	je	address_bx_di
6698
	cmp	bx,2623h
6665
	cmp	bx,2623h
6699
	jne	invalid_address
6666
	jne	invalid_address
6700
      address_bx_si:
6667
      address_bx_si:
6701
	xor	al,al
6668
	xor	al,al
6702
	jmp	postbyte_16bit
6669
	jmp	postbyte_16bit
6703
      address_bx_di:
6670
      address_bx_di:
6704
	mov	al,1
6671
	mov	al,1
6705
	jmp	postbyte_16bit
6672
	jmp	postbyte_16bit
6706
      address_bp_si:
6673
      address_bp_si:
6707
	mov	al,10b
6674
	mov	al,10b
6708
	jmp	postbyte_16bit
6675
	jmp	postbyte_16bit
6709
      address_bp_di:
6676
      address_bp_di:
6710
	mov	al,11b
6677
	mov	al,11b
6711
	jmp	postbyte_16bit
6678
	jmp	postbyte_16bit
6712
      address_si:
6679
      address_si:
6713
	mov	al,100b
6680
	mov	al,100b
6714
	jmp	postbyte_16bit
6681
	jmp	postbyte_16bit
6715
      address_di:
6682
      address_di:
6716
	mov	al,101b
6683
	mov	al,101b
6717
	jmp	postbyte_16bit
6684
	jmp	postbyte_16bit
6718
      address_bx:
6685
      address_bx:
6719
	mov	al,111b
6686
	mov	al,111b
6720
	jmp	postbyte_16bit
6687
	jmp	postbyte_16bit
6721
      address_bp:
6688
      address_bp:
6722
	mov	al,110b
6689
	mov	al,110b
6723
      postbyte_16bit:
6690
      postbyte_16bit:
6724
	test	ch,22h
6691
	test	ch,22h
6725
	jnz	address_16bit_value
6692
	jnz	address_16bit_value
6726
	or	ch,ch
6693
	or	ch,ch
6727
	jnz	address_sizes_do_not_agree
6694
	jnz	address_sizes_do_not_agree
6728
	cmp	edx,10000h
6695
	cmp	edx,10000h
6729
	jge	value_out_of_range
6696
	jge	value_out_of_range
6730
	cmp	edx,-8000h
6697
	cmp	edx,-8000h
6731
	jl	value_out_of_range
6698
	jl	value_out_of_range
6732
	or	dx,dx
6699
	or	dx,dx
6733
	jz	address
6700
	jz	address
6734
	cmp	dx,80h
6701
	cmp	dx,80h
6735
	jb	address_8bit_value
6702
	jb	address_8bit_value
6736
	cmp	dx,-80h
6703
	cmp	dx,-80h
6737
	jae	address_8bit_value
6704
	jae	address_8bit_value
6738
      address_16bit_value:
6705
      address_16bit_value:
6739
	or	al,10000000b
6706
	or	al,10000000b
6740
	mov	cl,[postbyte_register]
6707
	mov	cl,[postbyte_register]
6741
	shl	cl,3
6708
	shl	cl,3
6742
	or	al,cl
6709
	or	al,cl
6743
	stos	byte [edi]
6710
	stos	byte [edi]
6744
	mov	eax,edx
6711
	mov	eax,edx
6745
	stos	word [edi]
6712
	stos	word [edi]
6746
	ret
6713
	ret
6747
      address_8bit_value:
6714
      address_8bit_value:
6748
	or	al,01000000b
6715
	or	al,01000000b
6749
	mov	cl,[postbyte_register]
6716
	mov	cl,[postbyte_register]
6750
	shl	cl,3
6717
	shl	cl,3
6751
	or	al,cl
6718
	or	al,cl
6752
	stos	byte [edi]
6719
	stos	byte [edi]
6753
	mov	al,dl
6720
	mov	al,dl
6754
	stos	byte [edi]
6721
	stos	byte [edi]
6755
	cmp	dx,80h
6722
	cmp	dx,80h
6756
	jge	value_out_of_range
6723
	jge	value_out_of_range
6757
	cmp	dx,-80h
6724
	cmp	dx,-80h
6758
	jl	value_out_of_range
6725
	jl	value_out_of_range
6759
	ret
6726
	ret
6760
      address:
6727
      address:
6761
	cmp	al,110b
6728
	cmp	al,110b
6762
	je	address_8bit_value
6729
	je	address_8bit_value
6763
	mov	cl,[postbyte_register]
6730
	mov	cl,[postbyte_register]
6764
	shl	cl,3
6731
	shl	cl,3
6765
	or	al,cl
6732
	or	al,cl
6766
	stos	byte [edi]
6733
	stos	byte [edi]
6767
	ret
6734
	ret
6768
      postbyte_32bit:
6735
      postbyte_32bit:
6769
	call	address_32bit_prefix
6736
	call	address_32bit_prefix
6770
	jmp	address_prefix_ok
6737
	jmp	address_prefix_ok
6771
      postbyte_64bit:
6738
      postbyte_64bit:
6772
	cmp	[code_type],64
6739
	cmp	[code_type],64
6773
	jne	invalid_address_size
6740
	jne	invalid_address_size
6774
      address_prefix_ok:
6741
      address_prefix_ok:
6775
	cmp	bl,44h
6742
	cmp	bl,44h
6776
	je	swap_base_with_index
6743
	je	invalid_address
6777
	cmp	bl,84h
-
 
6778
	jne	base_register_ok
-
 
6779
      swap_base_with_index:
-
 
6780
	cmp	cl,1
-
 
6781
	jne	invalid_address
-
 
6782
	xchg	bl,bh
-
 
6783
	cmp	bl,44h
-
 
6784
	je	invalid_address
-
 
6785
	cmp	bl,84h
6744
	cmp	bl,84h
6786
	je	invalid_address
6745
	je	invalid_address
6787
      base_register_ok:
6746
	test	bh,1000b
6788
	test	bh,1000b
-
 
6789
	jz	base_code_ok
6747
	jz	base_code_ok
6790
	or	[rex_prefix],41h
6748
	or	[rex_prefix],41h
6791
      base_code_ok:
6749
      base_code_ok:
6792
	test	bl,1000b
6750
	test	bl,1000b
6793
	jz	index_code_ok
6751
	jz	index_code_ok
6794
	or	[rex_prefix],42h
6752
	or	[rex_prefix],42h
6795
      index_code_ok:
6753
      index_code_ok:
6796
	call	store_instruction_code
6754
	call	store_instruction_code
6797
	or	cl,cl
6755
	or	cl,cl
6798
	jz	only_base_register
6756
	jz	only_base_register
6799
      base_and_index:
6757
      base_and_index:
6800
	mov	al,100b
6758
	mov	al,100b
6801
	xor	ah,ah
6759
	xor	ah,ah
6802
	cmp	cl,1
6760
	cmp	cl,1
6803
	je	scale_ok
6761
	je	scale_ok
6804
	cmp	cl,2
6762
	cmp	cl,2
6805
	je	scale_1
6763
	je	scale_1
6806
	cmp	cl,4
6764
	cmp	cl,4
6807
	je	scale_2
6765
	je	scale_2
6808
	or	ah,11000000b
6766
	or	ah,11000000b
6809
	jmp	scale_ok
6767
	jmp	scale_ok
6810
      scale_2:
6768
      scale_2:
6811
	or	ah,10000000b
6769
	or	ah,10000000b
6812
	jmp	scale_ok
6770
	jmp	scale_ok
6813
      scale_1:
6771
      scale_1:
6814
	or	ah,01000000b
6772
	or	ah,01000000b
6815
      scale_ok:
6773
      scale_ok:
6816
	or	bh,bh
6774
	or	bh,bh
6817
	jz	only_index_register
6775
	jz	only_index_register
6818
	and	bl,111b
6776
	and	bl,111b
6819
	shl	bl,3
6777
	shl	bl,3
6820
	or	ah,bl
6778
	or	ah,bl
6821
	and	bh,111b
6779
	and	bh,111b
6822
	or	ah,bh
6780
	or	ah,bh
6823
	test	ch,44h
6781
	test	ch,44h
6824
	jnz	sib_address_32bit_value
6782
	jnz	sib_address_32bit_value
6825
	test	ch,88h
6783
	test	ch,88h
6826
	jnz	sib_address_32bit_value
6784
	jnz	sib_address_32bit_value
6827
	or	ch,ch
6785
	or	ch,ch
6828
	jnz	address_sizes_do_not_agree
6786
	jnz	address_sizes_do_not_agree
6829
	cmp	bh,5
6787
	cmp	bh,5
6830
	je	address_value
6788
	je	address_value
6831
	or	edx,edx
6789
	or	edx,edx
6832
	jz	sib_address
6790
	jz	sib_address
6833
      address_value:
6791
      address_value:
6834
	cmp	edx,80h
6792
	cmp	edx,80h
6835
	jb	sib_address_8bit_value
6793
	jb	sib_address_8bit_value
6836
	cmp	edx,-80h
6794
	cmp	edx,-80h
6837
	jae	sib_address_8bit_value
6795
	jae	sib_address_8bit_value
6838
      sib_address_32bit_value:
6796
      sib_address_32bit_value:
6839
	or	al,10000000b
6797
	or	al,10000000b
6840
	mov	cl,[postbyte_register]
6798
	mov	cl,[postbyte_register]
6841
	shl	cl,3
6799
	shl	cl,3
6842
	or	al,cl
6800
	or	al,cl
6843
	stos	word [edi]
6801
	stos	word [edi]
6844
      address_32bit_value:
6802
	jmp	store_address_32bit_value
6845
	cmp	[code_type],64
-
 
6846
	jne	store_address_32bit_value
-
 
6847
	mov	eax,edx
-
 
6848
	cdq
-
 
6849
	cmp	edx,[address_high]
-
 
6850
	je	address_32bit_value_ok
-
 
6851
	cmp	[error_line],0
-
 
6852
	jne	address_32bit_value_ok
-
 
6853
	mov	edx,[current_line]
-
 
6854
	mov	[error_line],edx
-
 
6855
	mov	[error],value_out_of_range
-
 
6856
      address_32bit_value_ok:
-
 
6857
	mov	edx,eax
-
 
6858
	jmp	store_address_32bit_value
-
 
6859
      sib_address_8bit_value:
6803
      sib_address_8bit_value:
6860
	or	al,01000000b
6804
	or	al,01000000b
6861
	mov	cl,[postbyte_register]
6805
	mov	cl,[postbyte_register]
6862
	shl	cl,3
6806
	shl	cl,3
6863
	or	al,cl
6807
	or	al,cl
6864
	stos	word [edi]
6808
	stos	word [edi]
6865
	mov	al,dl
6809
	mov	al,dl
6866
	stos	byte [edi]
6810
	stos	byte [edi]
6867
	cmp	edx,80h
6811
	cmp	edx,80h
6868
	jge	value_out_of_range
6812
	jge	value_out_of_range
6869
	cmp	edx,-80h
6813
	cmp	edx,-80h
6870
	jl	value_out_of_range
6814
	jl	value_out_of_range
6871
	ret
6815
	ret
6872
      sib_address:
6816
      sib_address:
6873
	mov	cl,[postbyte_register]
6817
	mov	cl,[postbyte_register]
6874
	shl	cl,3
6818
	shl	cl,3
6875
	or	al,cl
6819
	or	al,cl
6876
	stos	word [edi]
6820
	stos	word [edi]
6877
	ret
6821
	ret
6878
      only_index_register:
6822
      only_index_register:
6879
	or	ah,101b
6823
	or	ah,101b
6880
	and	bl,111b
6824
	and	bl,111b
6881
	shl	bl,3
6825
	shl	bl,3
6882
	or	ah,bl
6826
	or	ah,bl
6883
	mov	cl,[postbyte_register]
6827
	mov	cl,[postbyte_register]
6884
	shl	cl,3
6828
	shl	cl,3
6885
	or	al,cl
6829
	or	al,cl
6886
	stos	word [edi]
6830
	stos	word [edi]
6887
	test	ch,44h
6831
	test	ch,44h
6888
	jnz	address_32bit_value
6832
	jnz	store_address_32bit_value
6889
	test	ch,88h
6833
	test	ch,88h
6890
	jnz	address_32bit_value
6834
	jnz	store_address_32bit_value
6891
	or	ch,ch
6835
	or	ch,ch
6892
	jnz	invalid_address_size
6836
	jnz	invalid_address_size
6893
	jmp	address_32bit_value
6837
	jmp	store_address_32bit_value
6894
      zero_index_register:
6838
      zero_index_register:
6895
	mov	bl,4
6839
	mov	bl,4
6896
	mov	cl,1
6840
	mov	cl,1
6897
	jmp	base_and_index
6841
	jmp	base_and_index
6898
      only_base_register:
6842
      only_base_register:
6899
	mov	al,bh
6843
	mov	al,bh
6900
	and	al,111b
6844
	and	al,111b
6901
	cmp	al,4
6845
	cmp	al,4
6902
	je	zero_index_register
6846
	je	zero_index_register
6903
	test	ch,44h
6847
	test	ch,44h
6904
	jnz	simple_address_32bit_value
6848
	jnz	simple_address_32bit_value
6905
	test	ch,88h
6849
	test	ch,88h
6906
	jnz	simple_address_32bit_value
6850
	jnz	simple_address_32bit_value
6907
	or	ch,ch
6851
	or	ch,ch
6908
	jnz	address_sizes_do_not_agree
6852
	jnz	address_sizes_do_not_agree
6909
	or	edx,edx
6853
	or	edx,edx
6910
	jz	simple_address
6854
	jz	simple_address
6911
	cmp	edx,80h
6855
	cmp	edx,80h
6912
	jb	simple_address_8bit_value
6856
	jb	simple_address_8bit_value
6913
	cmp	edx,-80h
6857
	cmp	edx,-80h
6914
	jae	simple_address_8bit_value
6858
	jae	simple_address_8bit_value
6915
      simple_address_32bit_value:
6859
      simple_address_32bit_value:
6916
	or	al,10000000b
6860
	or	al,10000000b
6917
	mov	cl,[postbyte_register]
6861
	mov	cl,[postbyte_register]
6918
	shl	cl,3
6862
	shl	cl,3
6919
	or	al,cl
6863
	or	al,cl
6920
	stos	byte [edi]
6864
	stos	byte [edi]
6921
	jmp	address_32bit_value
6865
	jmp	store_address_32bit_value
6922
      simple_address_8bit_value:
6866
      simple_address_8bit_value:
6923
	or	al,01000000b
6867
	or	al,01000000b
6924
	mov	cl,[postbyte_register]
6868
	mov	cl,[postbyte_register]
6925
	shl	cl,3
6869
	shl	cl,3
6926
	or	al,cl
6870
	or	al,cl
6927
	stos	byte [edi]
6871
	stos	byte [edi]
6928
	mov	al,dl
6872
	mov	al,dl
6929
	stos	byte [edi]
6873
	stos	byte [edi]
6930
	cmp	edx,80h
6874
	cmp	edx,80h
6931
	jge	value_out_of_range
6875
	jge	value_out_of_range
6932
	cmp	edx,-80h
6876
	cmp	edx,-80h
6933
	jl	value_out_of_range
6877
	jl	value_out_of_range
6934
	ret
6878
	ret
6935
      simple_address:
6879
      simple_address:
6936
	cmp	al,5
6880
	cmp	al,5
6937
	je	simple_address_8bit_value
6881
	je	simple_address_8bit_value
6938
	mov	cl,[postbyte_register]
6882
	mov	cl,[postbyte_register]
6939
	shl	cl,3
6883
	shl	cl,3
6940
	or	al,cl
6884
	or	al,cl
6941
	stos	byte [edi]
6885
	stos	byte [edi]
6942
	ret
6886
	ret
6943
      address_immediate:
6887
      address_immediate:
6944
	cmp	[code_type],64
6888
	cmp	[code_type],64
6945
	je	address_immediate_sib
6889
	je	address_immediate_sib
6946
	test	ch,44h
6890
	test	ch,44h
6947
	jnz	address_immediate_32bit
6891
	jnz	address_immediate_32bit
6948
	test	ch,22h
6892
	test	ch,22h
6949
	jnz	address_immediate_16bit
6893
	jnz	address_immediate_16bit
6950
	or	ch,ch
6894
	or	ch,ch
6951
	jnz	invalid_address_size
6895
	jnz	invalid_address_size
6952
	cmp	[code_type],16
6896
	cmp	[code_type],16
6953
	je	addressing_16bit
6897
	je	addressing_16bit
6954
      address_immediate_32bit:
6898
      address_immediate_32bit:
6955
	call	address_32bit_prefix
6899
	call	address_32bit_prefix
6956
	call	store_instruction_code
6900
	call	store_instruction_code
6957
      store_immediate_address:
6901
      store_immediate_address:
6958
	mov	al,101b
6902
	mov	al,101b
6959
	mov	cl,[postbyte_register]
6903
	mov	cl,[postbyte_register]
6960
	shl	cl,3
6904
	shl	cl,3
6961
	or	al,cl
6905
	or	al,cl
6962
	stos	byte [edi]
6906
	stos	byte [edi]
6963
      store_address_32bit_value:
6907
      store_address_32bit_value:
6964
	test	ch,0F0h
6908
	test	ch,0F0h
6965
	jz	address_32bit_relocation_ok
6909
	jz	address_32bit_relocation_ok
6966
	mov	eax,ecx
6910
	mov	eax,ecx
6967
	shr	eax,16
6911
	shr	eax,16
6968
	cmp	al,4
6912
	cmp	al,4
6969
	jne	address_32bit_relocation
6913
	jne	address_32bit_relocation
6970
	mov	al,2
6914
	mov	al,2
6971
      address_32bit_relocation:
6915
      address_32bit_relocation:
6972
	xchg	[value_type],al
6916
	xchg	[value_type],al
6973
	mov	ebx,[address_symbol]
6917
	mov	ebx,[address_symbol]
6974
	xchg	ebx,[symbol_identifier]
6918
	xchg	ebx,[symbol_identifier]
6975
	call	mark_relocation
6919
	call	mark_relocation
6976
	mov	[value_type],al
6920
	mov	[value_type],al
6977
	mov	[symbol_identifier],ebx
6921
	mov	[symbol_identifier],ebx
6978
      address_32bit_relocation_ok:
6922
      address_32bit_relocation_ok:
6979
	mov	eax,edx
6923
	mov	eax,edx
6980
	stos	dword [edi]
6924
	stos	dword [edi]
6981
	ret
6925
	ret
6982
      store_address_64bit_value:
6926
      store_address_64bit_value:
6983
	test	ch,0F0h
6927
	test	ch,0F0h
6984
	jz	address_64bit_relocation_ok
6928
	jz	address_64bit_relocation_ok
6985
	mov	eax,ecx
6929
	mov	eax,ecx
6986
	shr	eax,16
6930
	shr	eax,16
6987
	xchg	[value_type],al
6931
	xchg	[value_type],al
6988
	mov	ebx,[address_symbol]
6932
	mov	ebx,[address_symbol]
6989
	xchg	ebx,[symbol_identifier]
6933
	xchg	ebx,[symbol_identifier]
6990
	call	mark_relocation
6934
	call	mark_relocation
6991
	mov	[value_type],al
6935
	mov	[value_type],al
6992
	mov	[symbol_identifier],ebx
6936
	mov	[symbol_identifier],ebx
6993
      address_64bit_relocation_ok:
6937
      address_64bit_relocation_ok:
6994
	mov	eax,edx
6938
	mov	eax,edx
6995
	stos	dword [edi]
6939
	stos	dword [edi]
6996
	mov	eax,[address_high]
6940
	mov	eax,[address_high]
6997
	stos	dword [edi]
6941
	stos	dword [edi]
6998
	ret
6942
	ret
6999
      address_immediate_sib:
6943
      address_immediate_sib:
7000
	test	ch,44h
6944
	test	ch,44h
7001
	jnz	address_immediate_sib_32bit
6945
	jnz	address_immediate_sib_32bit
7002
	test	ch,not 88h
6946
	test	ch,not 88h
7003
	jnz	invalid_address_size
6947
	jnz	invalid_address_size
7004
	xor	eax,eax
6948
      address_immediate_sib_store:
7005
	bt	edx,31
-
 
7006
	sbb	eax,0
-
 
7007
	cmp	eax,[address_high]
-
 
7008
	jne	value_out_of_range
-
 
7009
      address_immediate_sib_store:
-
 
7010
	call	store_instruction_code
6949
	call	store_instruction_code
7011
	mov	al,100b
6950
	mov	al,100b
7012
	mov	ah,100101b
6951
	mov	ah,100101b
7013
	mov	cl,[postbyte_register]
6952
	mov	cl,[postbyte_register]
7014
	shl	cl,3
6953
	shl	cl,3
7015
	or	al,cl
6954
	or	al,cl
7016
	stos	word [edi]
6955
	stos	word [edi]
7017
	jmp	store_address_32bit_value
6956
	jmp	store_address_32bit_value
7018
      address_immediate_sib_32bit:
6957
      address_immediate_sib_32bit:
7019
	test	ecx,0FF0000h
6958
	test	ecx,0FF0000h
7020
	jnz	address_immediate_sib_nosignextend
6959
	jnz	address_immediate_sib_nosignextend
7021
	test	edx,80000000h
6960
	test	edx,80000000h
7022
	jz	address_immediate_sib_store
6961
	jz	address_immediate_sib_store
7023
      address_immediate_sib_nosignextend:
6962
      address_immediate_sib_nosignextend:
7024
	call	address_32bit_prefix
6963
	call	address_32bit_prefix
7025
	jmp	address_immediate_sib_store
6964
	jmp	address_immediate_sib_store
7026
      address_eip_based:
6965
      address_eip_based:
7027
	mov	al,67h
6966
	mov	al,67h
7028
	stos	byte [edi]
6967
	stos	byte [edi]
7029
      address_rip_based:
6968
      address_rip_based:
7030
	cmp	[code_type],64
6969
	cmp	[code_type],64
7031
	jne	invalid_address
6970
	jne	invalid_address
7032
	call	store_instruction_code
6971
	call	store_instruction_code
7033
	jmp	store_immediate_address
6972
	jmp	store_immediate_address
7034
      address_relative:
6973
      address_relative:
7035
	call	store_instruction_code
6974
	call	store_instruction_code
7036
	movzx	eax,[immediate_size]
6975
	movzx	eax,[immediate_size]
7037
	add	eax,edi
6976
	add	eax,edi
7038
	sub	eax,[current_offset]
6977
	sub	eax,[current_offset]
7039
	add	eax,5
6978
	add	eax,5
7040
	sub	edx,eax
6979
	sub	edx,eax
7041
	jo	value_out_of_range
6980
	jo	value_out_of_range
7042
	mov	al,101b
6981
	mov	al,101b
7043
	mov	cl,[postbyte_register]
6982
	mov	cl,[postbyte_register]
7044
	shl	cl,3
6983
	shl	cl,3
7045
	or	al,cl
6984
	or	al,cl
7046
	stos	byte [edi]
6985
	stos	byte [edi]
7047
	shr	ecx,16
6986
	shr	ecx,16
7048
	xchg	[value_type],cl
6987
	xchg	[value_type],cl
7049
	mov	ebx,[address_symbol]
6988
	mov	ebx,[address_symbol]
7050
	xchg	ebx,[symbol_identifier]
6989
	xchg	ebx,[symbol_identifier]
7051
	mov	eax,edx
6990
	mov	eax,edx
7052
	call	mark_relocation
6991
	call	mark_relocation
7053
	mov	[value_type],cl
6992
	mov	[value_type],cl
7054
	mov	[symbol_identifier],ebx
6993
	mov	[symbol_identifier],ebx
7055
	stos	dword [edi]
6994
	stos	dword [edi]
7056
	ret
6995
	ret
7057
      addressing_16bit:
6996
      addressing_16bit:
7058
	cmp	edx,10000h
6997
	cmp	edx,10000h
7059
	jge	address_immediate_32bit
6998
	jge	address_immediate_32bit
7060
	cmp	edx,-8000h
6999
	cmp	edx,-8000h
7061
	jl	address_immediate_32bit
7000
	jl	address_immediate_32bit
7062
	movzx	edx,dx
7001
	movzx	edx,dx
7063
      address_immediate_16bit:
7002
      address_immediate_16bit:
7064
	call	address_16bit_prefix
7003
	call	address_16bit_prefix
7065
	call	store_instruction_code
7004
	call	store_instruction_code
7066
	mov	al,110b
7005
	mov	al,110b
7067
	mov	cl,[postbyte_register]
7006
	mov	cl,[postbyte_register]
7068
	shl	cl,3
7007
	shl	cl,3
7069
	or	al,cl
7008
	or	al,cl
7070
	stos	byte [edi]
7009
	stos	byte [edi]
7071
	mov	eax,edx
7010
	mov	eax,edx
7072
	stos	word [edi]
7011
	stos	word [edi]
7073
	cmp	edx,10000h
7012
	cmp	edx,10000h
7074
	jge	value_out_of_range
7013
	jge	value_out_of_range
7075
	cmp	edx,-8000h
7014
	cmp	edx,-8000h
7076
	jl	value_out_of_range
7015
	jl	value_out_of_range
7077
	ret
7016
	ret
7078
      address_16bit_prefix:
7017
      address_16bit_prefix:
7079
	cmp	[code_type],16
7018
	cmp	[code_type],16
7080
	je	instruction_prefix_ok
7019
	je	instruction_prefix_ok
7081
	mov	al,67h
7020
	mov	al,67h
7082
	stos	byte [edi]
7021
	stos	byte [edi]
7083
	ret
7022
	ret
7084
      address_32bit_prefix:
7023
      address_32bit_prefix:
7085
	cmp	[code_type],32
7024
	cmp	[code_type],32
7086
	je	instruction_prefix_ok
7025
	je	instruction_prefix_ok
7087
	mov	al,67h
7026
	mov	al,67h
7088
	stos	byte [edi]
7027
	stos	byte [edi]
7089
      instruction_prefix_ok:
7028
      instruction_prefix_ok:
7090
	ret
7029
	ret
7091
store_instruction_with_imm8:
7030
store_instruction_with_imm8:
7092
	mov	[immediate_size],1
7031
	mov	[immediate_size],1
7093
	call	store_instruction
7032
	call	store_instruction
7094
	mov	al,byte [value]
7033
	mov	al,byte [value]
7095
	stos	byte [edi]
7034
	stos	byte [edi]
7096
	ret
7035
	ret
7097
store_instruction_with_imm16:
7036
store_instruction_with_imm16:
7098
	mov	[immediate_size],2
7037
	mov	[immediate_size],2
7099
	call	store_instruction
7038
	call	store_instruction
7100
	mov	ax,word [value]
7039
	mov	ax,word [value]
7101
	call	mark_relocation
7040
	call	mark_relocation
7102
	stos	word [edi]
7041
	stos	word [edi]
7103
	ret
7042
	ret
7104
store_instruction_with_imm32:
7043
store_instruction_with_imm32:
7105
	mov	[immediate_size],4
7044
	mov	[immediate_size],4
7106
	call	store_instruction
7045
	call	store_instruction
7107
	mov	eax,dword [value]
7046
	mov	eax,dword [value]
7108
	call	mark_relocation
7047
	call	mark_relocation
7109
	stos	dword [edi]
7048
	stos	dword [edi]
7110
	ret
7049
	ret