Subversion Repositories Kolibri OS

Rev

Rev 551 | Rev 998 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 551 Rev 809
Line 1028... Line 1028...
1028
	call	draw_title
1028
	call	draw_title
1029
	call	draw_registers
1029
	call	draw_registers
1030
	call	draw_dump
1030
	call	draw_dump
1031
	call	draw_disasm
1031
	call	draw_disasm
1032
; end redraw
1032
; end redraw
-
 
1033
	push	12
1033
	mov	al, 12
1034
	pop	eax
1034
	push	2
1035
	push	2
1035
	pop	ebx
1036
	pop	ebx
1036
	mcall
1037
	mcall
1037
	ret
1038
	ret
Line 3304... Line 3305...
3304
	call	disasm_get_byte
3305
	call	disasm_get_byte
3305
	jmp	dword [disasm_table_1 + eax*4]
3306
	jmp	dword [disasm_table_1 + eax*4]
Line 3306... Line 3307...
3306
 
3307
 
3307
cop0:
3308
cop0:
3308
clock:
-
 
3309
crepnz:
-
 
3310
crep:
3309
clock:
3311
csegcs:
3310
csegcs:
3312
csegds:
3311
csegds:
3313
cseges:
3312
cseges:
3314
csegss:
3313
csegss:
Line 3354... Line 3353...
3354
	db	0xAF,5,0,'scas'
3353
	db	0xAF,5,0,'scas'
3355
	db	0xC3,3,'ret'
3354
	db	0xC3,3,'ret'
3356
	db	0xC9,5,'leave'
3355
	db	0xC9,5,'leave'
3357
	db	0xCC,4,'int3'
3356
	db	0xCC,4,'int3'
3358
	db	0xF0,4,'lock'
3357
	db	0xF0,4,'lock'
3359
	db	0xF2,5,'repnz'
-
 
3360
	db	0xF3,6,'rep(z)'
-
 
3361
	db	0xF5,3,'cmc'
3358
	db	0xF5,3,'cmc'
3362
	db	0xF8,3,'clc'
3359
	db	0xF8,3,'clc'
3363
	db	0xF9,3,'stc'
3360
	db	0xF9,3,'stc'
3364
	db	0xFA,3,'cli'
3361
	db	0xFA,3,'cli'
3365
	db	0xFB,3,'sti'
3362
	db	0xFB,3,'sti'
3366
	db	0xFC,3,'cld'
3363
	db	0xFC,3,'cld'
3367
	db	0xFD,3,'std'
3364
	db	0xFD,3,'std'
3368
cmd2:
3365
cmd2:
3369
	db	0x05,7,'syscall'
3366
	db	0x05,7,'syscall'
-
 
3367
	db	0x06,4,'clts'
3370
	db	0x31,5,'rdtsc'
3368
	db	0x31,5,'rdtsc'
3371
	db	0x34,8,'sysenter'
3369
	db	0x34,8,'sysenter'
3372
	db	0xA2,5,'cpuid'
3370
	db	0xA2,5,'cpuid'
3373
	db	0x77,4,'emms'
3371
	db	0x77,4,'emms'
3374
endg
3372
endg
3375
	jmp	@f
3373
	jmp	@f
3376
csysenter:
-
 
3377
csyscall:
-
 
3378
ccpuid:
3374
ccpuid:
3379
crdtsc:
3375
crdtsc:
3380
cemms:
3376
cemms:
-
 
3377
cop0_F:
3381
	mov	esi, cmd2
3378
	mov	esi, cmd2
3382
@@:
3379
@@:
3383
	cmp	al, [esi]
3380
	cmp	al, [esi]
3384
	jz	.found
3381
	jz	.found
3385
	inc	esi
3382
	inc	esi
Line 3416... Line 3413...
3416
	jmp	disasm_loop1
3413
	jmp	disasm_loop1
3417
c66:
3414
c66:
3418
	or	ch, 1
3415
	or	ch, 1
3419
	jmp	disasm_loop1
3416
	jmp	disasm_loop1
Line 3420... Line -...
3420
 
-
 
3421
center:
-
 
3422
caam:
3417
 
3423
cxlat:
-
 
3424
ccmpxchg:
-
 
3425
cbsf:
-
 
3426
cbsr:
-
 
3427
ccmpxchg8b:
3418
cxlat:
3428
cunk:
3419
cunk:
3429
cerr:
3420
cerr:
3430
	mov	eax, '???'
3421
	mov	eax, '???'
3431
	stosd
3422
	stosd
Line 3434... Line 3425...
3434
 
3425
 
3435
cF:
3426
cF:
3436
	call	disasm_get_byte
3427
	call	disasm_get_byte
Line -... Line 3428...
-
 
3428
	jmp	dword [disasm_table_2 + eax*4]
-
 
3429
 
-
 
3430
crep:
-
 
3431
	push	[disasm_cur_pos]
-
 
3432
	call	disasm_get_byte
-
 
3433
	cmp	al, 0x0F
-
 
3434
	jz	.sse
-
 
3435
	mov	dl, al
-
 
3436
	mov	eax, 'rep '
-
 
3437
	stosd
-
 
3438
	mov	al, dl
-
 
3439
@@:
-
 
3440
	and	eax, not 1
-
 
3441
	cmp	al, 0x66
-
 
3442
	jnz	@f
-
 
3443
	call	disasm_get_byte
-
 
3444
	mov	dl, al
-
 
3445
	jmp	@b
-
 
3446
@@:
-
 
3447
	cmp	al, 0xA6
-
 
3448
	jz	.repz
-
 
3449
	cmp	al, 0xAE
-
 
3450
	jz	.repz
-
 
3451
	cmp	al, 0xA4
-
 
3452
	jz	.prefix
-
 
3453
	cmp	al, 0xAA
-
 
3454
	jz	.prefix
-
 
3455
	cmp	al, 0xAC
-
 
3456
	jz	.prefix
-
 
3457
	cmp	al, 0x6C
-
 
3458
	jz	.prefix
-
 
3459
	cmp	al, 0x6E
-
 
3460
	jz	.prefix
-
 
3461
.noprefix:
-
 
3462
	pop	[disasm_cur_pos]
-
 
3463
	and	byte [edi-1], 0
-
 
3464
	ret
-
 
3465
.repz:
-
 
3466
	mov	byte [edi-1], 'z'
-
 
3467
	mov	al, ' '
-
 
3468
	stosb
-
 
3469
.prefix:
-
 
3470
	pop	[disasm_cur_pos]
-
 
3471
	jmp	disasm_loop1
-
 
3472
.sse:
-
 
3473
	pop	eax
-
 
3474
	call	disasm_get_byte
-
 
3475
iglobal
-
 
3476
rep_sse_cmds:
-
 
3477
	db	0x58,3,'add'
-
 
3478
	db	0xC2,3,'cmp'
-
 
3479
	db	0,0
-
 
3480
endg
-
 
3481
	mov	esi, rep_sse_cmds+1
-
 
3482
@@:
-
 
3483
	movzx	edx, byte [esi]
-
 
3484
	cmp	al, [esi-1]
-
 
3485
	jz	@f
-
 
3486
	lea	esi, [esi+edx+2]
-
 
3487
	cmp	byte [esi], 0
-
 
3488
	jnz	@b
-
 
3489
	sub	[disasm_cur_pos], 2
-
 
3490
	mov	eax, 'rep'
-
 
3491
	stosd
-
 
3492
	ret
-
 
3493
@@:
-
 
3494
	push	ecx
-
 
3495
	mov	ecx, edx
-
 
3496
	inc	esi
-
 
3497
	rep	movsb
-
 
3498
	pop	ecx
-
 
3499
	mov	al, 's'
-
 
3500
	stosb
-
 
3501
	jmp	rep_sse_final
-
 
3502
 
-
 
3503
crepnz:
-
 
3504
	call	disasm_get_byte
-
 
3505
	cmp	al, 0x0F
-
 
3506
	jz	.sse
-
 
3507
	mov	dl, al
-
 
3508
	mov	eax, 'repn'
-
 
3509
	stosd
-
 
3510
	mov	al, 'z'
-
 
3511
	stosb
-
 
3512
	mov	al, ' '
-
 
3513
	stosb
-
 
3514
	movzx	eax, dl
-
 
3515
	cmp	al, 0x6C
-
 
3516
	jb	crep.noprefix
-
 
3517
	cmp	al, 0x6F
-
 
3518
	jbe	.prefix
-
 
3519
	cmp	al, 0xA4
-
 
3520
	jb	crep.noprefix
-
 
3521
	cmp	al, 0xA7
-
 
3522
	jbe	.prefix
-
 
3523
	cmp	al, 0xAA
-
 
3524
	jb	crep.noprefix
-
 
3525
	cmp	al, 0xAF
-
 
3526
	ja	crep.noprefix
-
 
3527
.prefix:
-
 
3528
	jmp	cop0
-
 
3529
.sse:
-
 
3530
	call	disasm_get_byte
-
 
3531
	mov	esi, rep_sse_cmds+1
-
 
3532
@@:
-
 
3533
	movzx	edx, byte [esi]
-
 
3534
	cmp	al, [esi-1]
-
 
3535
	jz	.found0
-
 
3536
	lea	esi, [esi+edx+2]
-
 
3537
	cmp	byte [esi], 0
-
 
3538
	jnz	@b
-
 
3539
	mov	esi, sse_cmds2+1
-
 
3540
@@:
-
 
3541
	movzx	edx, byte [esi]
-
 
3542
	cmp	al, [esi-1]
-
 
3543
	jz	.found1
-
 
3544
	lea	esi, [esi+edx+2]
-
 
3545
	cmp	byte [esi], 0
-
 
3546
	jnz	@b
-
 
3547
	sub	[disasm_cur_pos], 2
-
 
3548
	mov	eax, 'repn'
-
 
3549
	stosd
-
 
3550
	mov	al, 'z'
-
 
3551
	stosb
-
 
3552
	and	byte [edi], 0
-
 
3553
	ret
-
 
3554
.found0:
-
 
3555
	push	ecx
-
 
3556
	mov	ecx, edx
-
 
3557
	inc	esi
-
 
3558
	rep	movsb
-
 
3559
	pop	ecx
-
 
3560
	mov	al, 's'
-
 
3561
	stosb
-
 
3562
	mov	al, 'd'
-
 
3563
	jmp	rep_sse_final
-
 
3564
.found1:
-
 
3565
	push	ecx
-
 
3566
	mov	ecx, edx
-
 
3567
	inc	esi
-
 
3568
	rep	movsb
-
 
3569
	pop	ecx
-
 
3570
	mov	al, 'p'
-
 
3571
	stosb
-
 
3572
	mov	al, 's'
-
 
3573
rep_sse_final:
-
 
3574
	stosb
-
 
3575
	push	ecx
-
 
3576
	push	5
-
 
3577
	pop	ecx
-
 
3578
	sub	ecx, edx
-
 
3579
	adc	ecx, 1
-
 
3580
	mov	al, ' '
-
 
3581
	rep	stosb
-
 
3582
	pop	ecx
-
 
3583
	or	ch, 1
3437
	jmp	dword [disasm_table_2 + eax*4]
3584
	jmp	disasm_mmx1
3438
 
3585
 
3439
macro disasm_set_modew
3586
macro disasm_set_modew
3440
{
3587
{
3441
	test	al, 1
3588
	test	al, 1
Line 3836... Line 3983...
3836
	stosd
3983
	stosd
3837
	mov	eax, '    '
3984
	mov	eax, '    '
3838
	stosd
3985
	stosd
3839
	call	disasm_get_byte
3986
	call	disasm_get_byte
3840
	movsx	eax, al
3987
	movsx	eax, al
-
 
3988
@@:
3841
	call	disasm_write_num
3989
	call	disasm_write_num
3842
	and	byte [edi], 0
3990
	and	byte [edi], 0
3843
	ret
3991
	ret
Line -... Line 3992...
-
 
3992
 
-
 
3993
center:
-
 
3994
	mov	eax, 'ente'
-
 
3995
	stosd
-
 
3996
	mov	eax, 'r   '
-
 
3997
	stosd
-
 
3998
	xor	eax, eax
-
 
3999
	call	disasm_get_word
-
 
4000
	call	disasm_write_num
-
 
4001
	mov	al, ','
-
 
4002
	stosb
-
 
4003
	mov	al, ' '
-
 
4004
	stosb
-
 
4005
	xor	eax, eax
-
 
4006
	call	disasm_get_byte
-
 
4007
	jmp	@b
3844
 
4008
 
3845
cinc1:
4009
cinc1:
3846
; inc reg32
4010
; inc reg32
3847
cdec1:
4011
cdec1:
3848
; dec reg32
4012
; dec reg32
Line 3982... Line 4146...
3982
	call	disasm_readrmop
4146
	call	disasm_readrmop
3983
	mov	ax, ', '
4147
	mov	ax, ', '
3984
	stosw
4148
	stosw
3985
	jmp	disasm_i8u
4149
	jmp	disasm_i8u
Line -... Line 4150...
-
 
4150
 
-
 
4151
caam:
-
 
4152
	mov	eax, 'aam '
-
 
4153
	jmp	@f
-
 
4154
caad:
-
 
4155
	mov	eax, 'aad '
-
 
4156
@@:
-
 
4157
	stosd
-
 
4158
	mov	eax, '    '
-
 
4159
	stosd
-
 
4160
	xor	eax, eax
-
 
4161
	call	disasm_get_byte
-
 
4162
	cmp	al, 10
-
 
4163
	jz	@f
-
 
4164
	call	disasm_write_num
-
 
4165
@@:
-
 
4166
	and	byte [edi], 0
Line 3986... Line 4167...
3986
 
4167
	ret
3987
 
4168
 
3988
cmov3:
4169
cmov3:
3989
; A0: mov al,[ofs32]
4170
; A0: mov al,[ofs32]
Line 4115... Line 4296...
4115
.x:
4296
.x:
4116
	call	disasm_write_num
4297
	call	disasm_write_num
4117
	and	byte [edi], 0
4298
	and	byte [edi], 0
4118
	ret
4299
	ret
Line -... Line 4300...
-
 
4300
 
-
 
4301
carpl:
-
 
4302
	xor	edx, edx
-
 
4303
	or	ch, 0C1h
-
 
4304
	mov	eax, 'arpl'
-
 
4305
	jmp	cop22.d2
-
 
4306
 
-
 
4307
ccmpxchg:
-
 
4308
	xor	edx, edx
-
 
4309
	disasm_set_modew
-
 
4310
	or	ch, 40h
-
 
4311
	mov	eax, 'cmpx'
-
 
4312
	stosd
-
 
4313
	mov	eax, 'chg '
-
 
4314
	jmp	cop22.d1
-
 
4315
 
-
 
4316
cbsf:
-
 
4317
cbsr:
-
 
4318
	or	ch, 80h
4119
 
4319
 
4120
cop22:
4320
cop22:
4121
	disasm_set_modew
4321
	disasm_set_modew
4122
	or	ch, 40h
4322
	or	ch, 40h
4123
	mov	edx, eax
4323
	mov	edx, eax
4124
	mov	esi, 'lea '
4324
	mov	esi, 'lea '
4125
	cmp	al, 8Dh
4325
	cmp	al, 8Dh
4126
	jz	@f
4326
	jz	@f
4127
	mov	esi, 'imul'
4327
	mov	esi, 'imul'
4128
	cmp	al, 0xAF
4328
	cmp	al, 0xAF
-
 
4329
	jz	@f
-
 
4330
	mov	esi, 'bsf '
-
 
4331
	cmp	al, 0BCh
-
 
4332
	jz	@f
-
 
4333
	mov	esi, 'bsr '
-
 
4334
	cmp	al, 0BDh
4129
	jz	@f
4335
	jz	@f
4130
	mov	esi, 'mov '
4336
	mov	esi, 'mov '
4131
	cmp	al, 88h
4337
	cmp	al, 88h
4132
	jae	@f
4338
	jae	@f
4133
	mov	esi, 'xchg'
4339
	mov	esi, 'xchg'
Line 4139... Line 4345...
4139
	shr	al, 3
4345
	shr	al, 3
4140
	and	eax, 7
4346
	and	eax, 7
4141
	mov	esi, [disasm_op2cmds+eax*4]
4347
	mov	esi, [disasm_op2cmds+eax*4]
4142
@@:
4348
@@:
4143
	xchg	eax, esi
4349
	xchg	eax, esi
-
 
4350
.d2:
4144
	stosd
4351
	stosd
4145
	mov	eax, '    '
4352
	mov	eax, '    '
-
 
4353
.d1:
4146
	stosd
4354
	stosd
4147
	call	disasm_get_byte
4355
	call	disasm_get_byte
4148
	dec	[disasm_cur_pos]
4356
	dec	[disasm_cur_pos]
4149
	shr	al, 3
4357
	shr	al, 3
4150
	and	eax, 7
4358
	and	eax, 7
Line 4152... Line 4360...
4152
	jz	@f
4360
	jz	@f
4153
	cmp	dl, 0x86
4361
	cmp	dl, 0x86
4154
	jz	@f
4362
	jz	@f
4155
	cmp	dl, 0x87
4363
	cmp	dl, 0x87
4156
	jz	@f
4364
	jz	@f
-
 
4365
	cmp	dl, 0xBC
-
 
4366
	jz	@f
-
 
4367
	cmp	dl, 0xBD
-
 
4368
	jz	@f
4157
	test	dl, 2
4369
	test	dl, 2
4158
	jz	.d0
4370
	jz	.d0
4159
@@:
4371
@@:
4160
	call	disasm_write_reg
4372
	call	disasm_write_reg
4161
	mov	ax, ', '
4373
	mov	ax, ', '
Line 4171... Line 4383...
4171
	pop	eax
4383
	pop	eax
4172
	call	disasm_write_reg
4384
	call	disasm_write_reg
4173
	and	byte [edi], 0
4385
	and	byte [edi], 0
4174
	ret
4386
	ret
Line -... Line 4387...
-
 
4387
 
-
 
4388
cbound:
-
 
4389
	mov	edx, eax
-
 
4390
	mov	eax, 'boun'
-
 
4391
	stosd
-
 
4392
	mov	eax, 'd   '
-
 
4393
	or	ch, 0xC0
-
 
4394
	jmp	cop22.d1
4175
 
4395
 
4176
cop23:
4396
cop23:
4177
	disasm_set_modew
4397
	disasm_set_modew
4178
	xchg	eax, edx
4398
	xchg	eax, edx
4179
	call	disasm_get_byte
4399
	call	disasm_get_byte
Line 4330... Line 4550...
4330
@@:
4550
@@:
4331
	xchg	eax, edx
4551
	xchg	eax, edx
4332
	stosd
4552
	stosd
4333
	mov	eax, '    '
4553
	mov	eax, '    '
4334
	stosd
4554
	stosd
-
 
4555
	test	ch, 1
-
 
4556
	jnz	@f
4335
	call	disasm_get_dword
4557
	call	disasm_get_dword
4336
	jmp	disasm_rva
4558
	jmp	disasm_rva
-
 
4559
@@:
-
 
4560
	call	disasm_get_word
-
 
4561
	add	eax, [disasm_cur_pos]
-
 
4562
	and	eax, 0xFFFF
-
 
4563
	call	disasm_write_num
-
 
4564
	and	byte [edi], 0
-
 
4565
	ret
-
 
4566
 
-
 
4567
ccallf:
-
 
4568
	mov	eax, 'call'
-
 
4569
	stosd
-
 
4570
	mov	eax, '    '
-
 
4571
	stosd
-
 
4572
	mov	al, 'd'
-
 
4573
	test	ch, 1
-
 
4574
	jnz	@f
-
 
4575
	mov	al, 'p'
-
 
4576
@@:
-
 
4577
	stosb
-
 
4578
	mov	eax, 'word'
-
 
4579
	stosd
-
 
4580
	mov	al, ' '
-
 
4581
	stosb
-
 
4582
	test	ch, 1
-
 
4583
	jnz	.1
-
 
4584
	call	disasm_get_dword
-
 
4585
	jmp	.2
-
 
4586
.1:
-
 
4587
	xor	eax, eax
-
 
4588
	call	disasm_get_word
-
 
4589
.2:
-
 
4590
	push	eax
-
 
4591
	xor	eax, eax
-
 
4592
	call	disasm_get_word
-
 
4593
	call	disasm_write_num
-
 
4594
	mov	al, ':'
-
 
4595
	stosb
-
 
4596
	pop	eax
-
 
4597
	call	disasm_write_num
-
 
4598
	and	byte [edi], 0
-
 
4599
	ret
Line 4337... Line 4600...
4337
 
4600
 
4338
iglobal
4601
iglobal
4339
op11codes	dd	'test',0,'not ','neg ','mul ','imul','div ','idiv'
4602
op11codes	dd	'test',0,'not ','neg ','mul ','imul','div ','idiv'
4340
op12codes	dd	'inc ','dec ','call',0,'jmp ',0,'push',0
4603
op12codes	dd	'inc ','dec ','call',0,'jmp ',0,'push',0
4341
endg
4604
endg
4342
cop1:
4605
cop1:
4343
	disasm_set_modew
4606
	disasm_set_modew
4344
	xchg	eax, edx
4607
	xchg	eax, edx
-
 
4608
	call	disasm_get_byte
4345
	call	disasm_get_byte
4609
	movzx	esi, al
4346
	dec	[disasm_cur_pos]
4610
	dec	[disasm_cur_pos]
4347
	shr	al, 3
4611
	shr	al, 3
4348
	and	eax, 7
4612
	and	eax, 7
4349
	cmp	dl, 0xFE
4613
	cmp	dl, 0xFE
4350
	jnz	@f
4614
	jnz	@f
-
 
4615
	cmp	al, 1
-
 
4616
	jbe	@f
-
 
4617
.0:
4351
	cmp	al, 1
4618
	inc	[disasm_cur_pos]
4352
	ja	cunk
4619
	jmp	cunk
4353
@@:
4620
@@:
4354
	and	edx, 8
4621
	and	edx, 8
-
 
4622
	add	eax, edx
-
 
4623
	cmp	al, 11
-
 
4624
	jz	.callfar
-
 
4625
	cmp	al, 13
4355
	add	eax, edx
4626
	jz	.jmpfar
4356
	mov	eax, [op11codes+eax*4]
4627
	mov	eax, [op11codes+eax*4]
4357
	test	eax, eax
4628
	test	eax, eax
4358
	jz	cunk
4629
	jz	.0
4359
	cmp	eax, 'test'
4630
	cmp	eax, 'test'
4360
	jz	ctest
4631
	jz	ctest
-
 
4632
.2:
-
 
4633
	stosd
-
 
4634
	mov	eax, '    '
-
 
4635
	stosd
-
 
4636
	call	disasm_readrmop
-
 
4637
	and	byte [edi], 0
-
 
4638
	ret
-
 
4639
.callfar:
-
 
4640
	mov	eax, 'call'
-
 
4641
.1:
-
 
4642
	cmp	esi, 0xC0
4361
@@:
4643
	jae	.0
4362
	stosd
4644
	stosd
4363
	mov	eax, '    '
4645
	mov	eax, '    '
-
 
4646
	stosd
-
 
4647
	mov	eax, 'far '
-
 
4648
	stosd
-
 
4649
	mov	al, 'd'
-
 
4650
	test	ch, 1
-
 
4651
	jnz	@f
-
 
4652
	mov	al, 'p'
-
 
4653
@@:
-
 
4654
	stosb
4364
	stosd
4655
	or	ch, 1
4365
	call	disasm_readrmop
4656
	call	disasm_readrmop
4366
	and	byte [edi], 0
4657
	and	byte [edi], 0
-
 
4658
	ret
-
 
4659
.jmpfar:
-
 
4660
	mov	eax, 'jmp '
Line 4367... Line 4661...
4367
	ret
4661
	jmp	.1
4368
 
4662
 
4369
cpop2:
4663
cpop2:
4370
	or	ch, 80h
4664
	or	ch, 80h
4371
	call	disasm_get_byte
4665
	call	disasm_get_byte
4372
	dec	[disasm_cur_pos]
4666
	dec	[disasm_cur_pos]
4373
	test	al, 00111000b
4667
	test	al, 00111000b
4374
	jnz	cunk
4668
	jnz	cunk
Line 4375... Line 4669...
4375
	mov	eax, 'pop '
4669
	mov	eax, 'pop '
4376
	jmp	@b
4670
	jmp	cop1.2
4377
 
4671
 
4378
cloopnz:
4672
cloopnz:
Line 4502... Line 4796...
4502
	mov	eax, 'cbw '
4796
	mov	eax, 'cbw '
4503
	test	ch, 1
4797
	test	ch, 1
4504
	jnz	@f
4798
	jnz	@f
4505
	mov	eax, 'cwde'
4799
	mov	eax, 'cwde'
4506
@@:	stosd
4800
@@:	stosd
4507
	and	byte [edi+1], 0
4801
	and	byte [edi], 0
4508
	ret
4802
	ret
4509
ccwd:
4803
ccwd:
4510
	mov	eax, 'cwd '
4804
	mov	eax, 'cwd '
4511
	test	ch, 1
4805
	test	ch, 1
4512
	jnz	@b
4806
	jnz	@b
4513
	mov	eax, 'cdq '
4807
	mov	eax, 'cdq '
4514
	jmp	@b
4808
	jmp	@b
Line -... Line 4809...
-
 
4809
 
-
 
4810
ccmpxchg8b:
-
 
4811
	call	disasm_get_byte
-
 
4812
	cmp	al, 0xC0
-
 
4813
	jae	cerr
-
 
4814
	shr	al, 3
-
 
4815
	and	al, 7
-
 
4816
	cmp	al, 1
-
 
4817
	jnz	cerr
-
 
4818
	dec	[disasm_cur_pos]
-
 
4819
	mov	eax, 'cmpx'
-
 
4820
	stosd
-
 
4821
	mov	eax, 'chg8'
-
 
4822
	stosd
-
 
4823
	mov	al, 'b'
-
 
4824
	stosb
-
 
4825
	mov	al, ' '
-
 
4826
	stosb
-
 
4827
	or	ch, 40h
-
 
4828
	call	disasm_readrmop
-
 
4829
	and	byte [edi], 0
-
 
4830
	ret
4515
 
4831
 
4516
iglobal
4832
iglobal
4517
fpuD8	dd	'add ','mul ','com ','comp','sub ','subr','div ','divr'
4833
fpuD8	dd	'add ','mul ','com ','comp','sub ','subr','div ','divr'
Line 4518... Line 4834...
4518
endg
4834
endg
Line 5050... Line 5366...
5050
	and	eax, 7
5366
	and	eax, 7
5051
	call	disasm_write_mmreg
5367
	call	disasm_write_mmreg
5052
	mov	ax, ', '
5368
	mov	ax, ', '
5053
	stosw
5369
	stosw
5054
	call	disasm_readrmop
5370
	call	disasm_readrmop
-
 
5371
	cmp	word [disasm_string], 'cm'
-
 
5372
	jz	.cmp
5055
	and	byte [edi], 0
5373
	and	byte [edi], 0
5056
	ret
5374
	ret
-
 
5375
.cmp:
-
 
5376
	call	disasm_get_byte
-
 
5377
	and	eax, 7
-
 
5378
	mov	dx, 'eq'
-
 
5379
	dec	eax
-
 
5380
	js	@f
-
 
5381
	mov	dx, 'lt'
-
 
5382
	jz	@f
-
 
5383
	mov	dh, 'e'
-
 
5384
	dec	eax
-
 
5385
	jnz	.no2
-
 
5386
@@:
-
 
5387
	xchg	dx, word [disasm_string+3]
-
 
5388
	mov	word [disasm_string+5], dx
-
 
5389
	and	byte [edi], 0
-
 
5390
	ret
-
 
5391
.no2:
-
 
5392
	dec	eax
-
 
5393
	jnz	@f
-
 
5394
	add	edi, 2
-
 
5395
	push	edi
-
 
5396
	lea	esi, [edi-3]
-
 
5397
	lea	ecx, [esi-(disasm_string+8)+2]
-
 
5398
	std
-
 
5399
	rep	movsb
-
 
5400
	cld
-
 
5401
	mov	cx, word [esi-3]
-
 
5402
	mov	dword [esi-3], 'unor'
-
 
5403
	mov	byte [esi+1], 'd'
-
 
5404
	mov	word [esi+2], cx
-
 
5405
	pop	edi
-
 
5406
	and	byte [edi+1], 0
-
 
5407
	ret
-
 
5408
@@:
-
 
5409
	mov	edx, 'neq'
-
 
5410
	dec	eax
-
 
5411
	jz	@f
-
 
5412
	mov	edx, 'nlt'
-
 
5413
	dec	eax
-
 
5414
	jz	@f
-
 
5415
	mov	edx, 'nle'
-
 
5416
	dec	eax
-
 
5417
	jz	@f
-
 
5418
	mov	edx, 'ord'
-
 
5419
@@:
-
 
5420
	push	edi
-
 
5421
	lea	esi, [edi-1]
-
 
5422
	lea	ecx, [esi-(disasm_string+8)+2]
-
 
5423
	std
-
 
5424
	rep	movsb
-
 
5425
	cld
-
 
5426
	mov	cx, word [esi-3]
-
 
5427
	mov	dword [esi-3], edx
-
 
5428
	mov	word [esi], cx
-
 
5429
	pop	edi
-
 
5430
	and	byte [edi+1], 0
-
 
5431
	ret
Line 5057... Line 5432...
5057
 
5432
 
5058
cpsrlw:
5433
cpsrlw:
5059
	mov	eax, 'psrl'
5434
	mov	eax, 'psrl'
5060
	jmp	@f
5435
	jmp	@f
Line 5090... Line 5465...
5090
	stosd
5465
	stosd
5091
	mov	eax, 'q   '
5466
	mov	eax, 'q   '
5092
	stosd
5467
	stosd
5093
	jmp	disasm_mmx1
5468
	jmp	disasm_mmx1
Line -... Line 5469...
-
 
5469
 
-
 
5470
csse1:
-
 
5471
iglobal
-
 
5472
sse_cmds1:
-
 
5473
	db	0x2F,4,'comi'
-
 
5474
	db	0x54,3,'and'
-
 
5475
	db	0x55,4,'andn'
-
 
5476
	db	0x58,3,'add'
-
 
5477
	db	0xC2,3,'cmp'
-
 
5478
endg
-
 
5479
	mov	esi, sse_cmds1+1
-
 
5480
.1:
-
 
5481
@@:
-
 
5482
	movzx	edx, byte [esi]
-
 
5483
	cmp	al, [esi-1]
-
 
5484
	jz	@f
-
 
5485
	lea	esi, [esi+edx+2]
-
 
5486
	jmp	@b
-
 
5487
@@:
-
 
5488
	push	ecx
-
 
5489
	mov	ecx, edx
-
 
5490
	inc	esi
-
 
5491
	rep	movsb
-
 
5492
	pop	ecx
-
 
5493
	mov	al, 's'
-
 
5494
	cmp	byte [edi-1], 'i'
-
 
5495
	jz	@f
-
 
5496
	mov	al, 'p'
-
 
5497
@@:
-
 
5498
	stosb
-
 
5499
	mov	al, 'd'
-
 
5500
	test	ch, 1
-
 
5501
	jnz	@f
-
 
5502
	mov	al, 's'
-
 
5503
@@:
-
 
5504
	stosb
-
 
5505
	push	ecx
-
 
5506
	push	5
-
 
5507
	pop	ecx
-
 
5508
	sub	ecx, edx
-
 
5509
	adc	ecx, 1
-
 
5510
	mov	al, ' '
-
 
5511
	rep	stosb
-
 
5512
	pop	ecx
-
 
5513
	or	ch, 1		; force XMM reg
-
 
5514
	jmp	disasm_mmx1
-
 
5515
 
-
 
5516
csse2:
-
 
5517
iglobal
-
 
5518
sse_cmds2:
-
 
5519
	db	0xD0,6,'addsub'
-
 
5520
	db	0,0
-
 
5521
endg
-
 
5522
	test	ch, 1
-
 
5523
	jz	cerr
-
 
5524
	mov	esi, sse_cmds2+1
-
 
5525
	jmp	csse1.1
5094
 
5526
 
5095
cpshift:
5527
cpshift:
5096
	mov	dl, al
5528
	mov	dl, al
5097
	mov	ax, 'ps'
5529
	mov	ax, 'ps'
5098
	stosw
5530
	stosw
Line 5147... Line 5579...
5147
	call	disasm_get_byte
5579
	call	disasm_get_byte
5148
	call	disasm_write_num
5580
	call	disasm_write_num
5149
	and	byte [edi], 0
5581
	and	byte [edi], 0
5150
	ret
5582
	ret
Line -... Line 5583...
-
 
5583
 
-
 
5584
iglobal
-
 
5585
grp15c1	dq	'fxsave  ','fxrstor ','ldmxcsr ','stmxcsr ',0,0,0,'clflush '
-
 
5586
endg
-
 
5587
cgrp15:
-
 
5588
	call	disasm_get_byte
-
 
5589
	cmp	al, 0xC0
-
 
5590
	jae	cunk
-
 
5591
	shr	al, 3
-
 
5592
	and	eax, 7
-
 
5593
	mov	edx, eax
-
 
5594
	mov	eax, dword [grp15c1+eax*8]
-
 
5595
	test	eax, eax
-
 
5596
	jz	cerr
-
 
5597
	dec	[disasm_cur_pos]
-
 
5598
	stosd
-
 
5599
	mov	eax, dword [grp15c1+4+edx*8]
-
 
5600
	stosd
-
 
5601
	or	ch, 40h
-
 
5602
	call	disasm_readrmop
-
 
5603
	and	byte [edi], 0
-
 
5604
	ret
5151
 
5605
 
5152
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5606
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5153
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5607
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 5154... Line 5608...
5154
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5608
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5155
 
5609
 
5156
caption_str db 'Kolibri Debugger',0
5610
caption_str db 'Kolibri Debugger',0
5157
caption_len = $ - caption_str
5611
caption_len = $ - caption_str
5158
begin_str db	'Kolibri Debugger, version 0.3',10
5612
begin_str db	'Kolibri Debugger, version 0.31',10
5159
	db	'Hint: type "help" for help, "quit" for quit'
5613
	db	'Hint: type "help" for help, "quit" for quit'
Line 5160... Line 5614...
5160
newline	db	10,0
5614
newline	db	10,0
Line 5473... Line 5927...
5473
	dd	cop22, cop22, cop22, cop22, cop21, cop21, csegds,cop0
5927
	dd	cop22, cop22, cop22, cop22, cop21, cop21, csegds,cop0
5474
	dd	cinc1, cinc1, cinc1, cinc1, cinc1, cinc1, cinc1, cinc1		; 4x
5928
	dd	cinc1, cinc1, cinc1, cinc1, cinc1, cinc1, cinc1, cinc1		; 4x
5475
	dd	cdec1, cdec1, cdec1, cdec1, cdec1, cdec1, cdec1, cdec1
5929
	dd	cdec1, cdec1, cdec1, cdec1, cdec1, cdec1, cdec1, cdec1
5476
	dd	cpush1,cpush1,cpush1,cpush1,cpush1,cpush1,cpush1,cpush1		; 5x
5930
	dd	cpush1,cpush1,cpush1,cpush1,cpush1,cpush1,cpush1,cpush1		; 5x
5477
	dd	cpop1, cpop1, cpop1, cpop1, cpop1, cpop1, cpop1, cpop1
5931
	dd	cpop1, cpop1, cpop1, cpop1, cpop1, cpop1, cpop1, cpop1
5478
	dd	cop0,  cop0,  cunk,  cunk,  csegfs,cseggs,c66,   c67		; 6x
5932
	dd	cop0,  cop0,  cbound,carpl, csegfs,cseggs,c66,   c67		; 6x
5479
	dd	cpush21,cimul1,cpush22,cimul1,cunk,cunk,  cunk,  cunk
5933
	dd	cpush21,cimul1,cpush22,cimul1,cunk,cunk,  cunk,  cunk
5480
	dd	cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1		; 7x
5934
	dd	cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1		; 7x
5481
	dd	cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1
5935
	dd	cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1, cjcc1
5482
	dd	cop23, cop23, cop23, cop23, cop22, cop22, cop22, cop22		; 8x
5936
	dd	cop23, cop23, cop23, cop23, cop22, cop22, cop22, cop22		; 8x
5483
	dd	cop22, cop22, cop22, cop22, cunk,  cop22, cunk,  cpop2
5937
	dd	cop22, cop22, cop22, cop22, cunk,  cop22, cunk,  cpop2
5484
	dd	cop0,  cxchg1,cxchg1,cxchg1,cxchg1,cxchg1,cxchg1,cxchg1		; 9x
5938
	dd	cop0,  cxchg1,cxchg1,cxchg1,cxchg1,cxchg1,cxchg1,cxchg1		; 9x
5485
	dd	ccbw,  ccwd,  cunk,  cop0,  cop0,  cop0,  cop0,  cop0
5939
	dd	ccbw,  ccwd,  ccallf,cop0,  cop0,  cop0,  cop0,  cop0
5486
	dd	cmov3, cmov3, cmov3, cmov3, cop0,  cop0,  cop0,  cop0		; Ax
5940
	dd	cmov3, cmov3, cmov3, cmov3, cop0,  cop0,  cop0,  cop0		; Ax
5487
	dd	cop21, cop21, cop0,  cop0,  cop0,  cop0,  cop0,  cop0
5941
	dd	cop21, cop21, cop0,  cop0,  cop0,  cop0,  cop0,  cop0
5488
	dd	cmov11,cmov11,cmov11,cmov11,cmov11,cmov11,cmov11,cmov11		; Bx
5942
	dd	cmov11,cmov11,cmov11,cmov11,cmov11,cmov11,cmov11,cmov11		; Bx
5489
	dd	cmov12,cmov12,cmov12,cmov12,cmov12,cmov12,cmov12,cmov12
5943
	dd	cmov12,cmov12,cmov12,cmov12,cmov12,cmov12,cmov12,cmov12
5490
	dd	cshift1,cshift1,cret2,cop0, cunk,  cunk,  cmov2, cmov2		; Cx
5944
	dd	cshift1,cshift1,cret2,cop0, cunk,  cunk,  cmov2, cmov2		; Cx
5491
	dd	center,cop0,  cunk,  cunk,  cop0,  cint,  cunk,  cunk
5945
	dd	center,cop0,  cunk,  cunk,  cop0,  cint,  cunk,  cunk
5492
	dd	cshift2,cshift2,cshift3,cshift3,caam,cunk,cunk,  cxlat		; Dx
5946
	dd	cshift2,cshift2,cshift3,cshift3,caam,caad,cunk,  cxlat		; Dx
5493
	dd	cD8,   cD9,   cDA,   cDB,   cDC,   cDD,   cDE,   cDF
5947
	dd	cD8,   cD9,   cDA,   cDB,   cDC,   cDD,   cDE,   cDF
5494
	dd	cloopnz,cloopz,cloop,cjcxz, cunk,  cunk,  cunk,  cunk		; Ex
5948
	dd	cloopnz,cloopz,cloop,cjcxz, cunk,  cunk,  cunk,  cunk		; Ex
5495
	dd	ccall1,cjmp1, cunk,  cjmp2, cunk,  cunk,  cunk,  cunk
5949
	dd	ccall1,cjmp1, cunk,  cjmp2, cunk,  cunk,  cunk,  cunk
5496
	dd	clock, cunk,  crepnz,crep,  cunk,  cop0,  cop1,  cop1		; Fx
5950
	dd	clock, cunk,  crepnz,crep,  cunk,  cop0,  cop1,  cop1		; Fx
5497
	dd	cop0,  cop0,  cop0,  cop0,  cop0,  cop0,  cop1,  cop1
5951
	dd	cop0,  cop0,  cop0,  cop0,  cop0,  cop0,  cop1,  cop1
Line 5498... Line 5952...
5498
 
5952
 
5499
disasm_table_2:
5953
disasm_table_2:
5500
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  csyscall,cunk,cunk		; 0x
5954
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cop0_F,cop0_F,cunk		; 0x
5501
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5955
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5502
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk		; 1x
5956
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk		; 1x
5503
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5957
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5504
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk		; 2x
5958
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk		; 2x
5505
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5959
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  csse1
5506
	dd	cunk,  crdtsc,cunk,  cunk,  csysenter,cunk,cunk, cunk		; 3x
5960
	dd	cunk,  crdtsc,cunk,  cunk,  cop0_F,cunk,  cunk,  cunk		; 3x
5507
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5961
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5508
	dd	cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc		; 4x
5962
	dd	cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc		; 4x
5509
	dd	cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc
5963
	dd	cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc,cmovcc
5510
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk		; 5x
5964
	dd	cunk,  cunk,  cunk,  cunk,  csse1, csse1, cunk,  cunk		; 5x
5511
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5965
	dd	csse1, cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk
5512
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn		; 6x
5966
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn		; 6x
5513
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cunk,  cunk,  cmovd1,cmovq1
5967
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cunk,  cunk,  cmovd1,cmovq1
5514
	dd	cunk,  cpshift,cpshift,cpshift,cpcmn,cpcmn,cpcmn,cemms		; 7x
5968
	dd	cunk,  cpshift,cpshift,cpshift,cpcmn,cpcmn,cpcmn,cemms		; 7x
5515
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cmovd2,cmovq2
5969
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cmovd2,cmovq2
5516
	dd	cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2		; 8x
5970
	dd	cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2		; 8x
5517
	dd	cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2
5971
	dd	cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2, cjcc2
5518
	dd	csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc		; 9x
5972
	dd	csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc		; 9x
5519
	dd	csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc
5973
	dd	csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc,csetcc
5520
	dd	cunk,  cunk,  ccpuid,cbtx2, cshld, cshld, cunk,  cunk		; Ax
5974
	dd	cunk,  cunk,  ccpuid,cbtx2, cshld, cshld, cunk,  cunk		; Ax
5521
	dd	cunk,  cunk,  cunk,  cbtx2, cshrd, cshrd, cunk,  cop22
5975
	dd	cunk,  cunk,  cunk,  cbtx2, cshrd, cshrd, cgrp15,cop22
5522
	dd	ccmpxchg,ccmpxchg,cunk,cbtx2,cunk, cunk,  cmovzx,cmovzx		; Bx
5976
	dd	ccmpxchg,ccmpxchg,cunk,cbtx2,cunk, cunk,  cmovzx,cmovzx		; Bx
5523
	dd	cunk,  cunk,  cbtx1, cbtx2, cbsf,  cbsr,  cmovsx,cmovsx
5977
	dd	cunk,  cunk,  cbtx1, cbtx2, cbsf,  cbsr,  cmovsx,cmovsx
5524
	dd	cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  cunk,  ccmpxchg8b	; Cx
5978
	dd	cunk,  cunk,  csse1, cunk,  cunk,  cunk,  cunk,  ccmpxchg8b	; Cx
5525
	dd	cbswap,cbswap,cbswap,cbswap,cbswap,cbswap,cbswap,cbswap
5979
	dd	cbswap,cbswap,cbswap,cbswap,cbswap,cbswap,cbswap,cbswap
5526
	dd	cunk,  cpsrlw,cpsrlw,cpsrlq,cpcmn, cpcmn, cunk,  cunk		; Dx
5980
	dd	csse2, cpsrlw,cpsrlw,cpsrlq,cpcmn, cpcmn, cunk,  cunk		; Dx
5527
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn
5981
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn
5528
	dd	cpcmn, cpsraw,cpsrad,cpcmn, cpcmn, cpcmn, cunk,  cunk		; Ex
5982
	dd	cpcmn, cpsraw,cpsrad,cpcmn, cpcmn, cpcmn, cunk,  cunk		; Ex
5529
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn
5983
	dd	cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn, cpcmn
5530
	dd	cunk,  cpsllw,cpslld,cpsllq,cpcmn, cpcmn, cpcmn, cunk		; Fx
5984
	dd	cunk,  cpsllw,cpslld,cpsllq,cpcmn, cpcmn, cpcmn, cunk		; Fx