Subversion Repositories Kolibri OS

Rev

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

Rev 2033 Rev 2278
Line 1... Line 1...
1
;************************************************************************
1
;--------------------------------------------------------------------
2
; v.016 30.07.2011
2
; v.016 30.07.2011
3
; Start with open file path
3
; Start with open file path
4
; Show working file path
4
; Show working file path
5
; Some optimization
5
; Some optimization
6
;
6
;
7
; Marat Zakiyanov aka Mario79, aka Mario
7
; Marat Zakiyanov aka Mario79, aka Mario
8
;************************************************************************
8
;--------------------------------------------------------------------
9
; v.015 08.03.2010
9
; v.015 08.03.2010
10
; Support for OpenDialog - Open and Save
10
; Support for OpenDialog - Open and Save
11
; Some optimization
11
; Some optimization
12
;
12
;
13
; Marat Zakiyanov aka Mario79, aka Mario
13
; Marat Zakiyanov aka Mario79, aka Mario
14
;************************************************************************
14
;--------------------------------------------------------------------
15
; v.014 05.02.2010
15
; v.014 05.02.2010
16
; 
16
; 
17
; PageUp, PageDown      - áâà ­¨æ  ¢¢¥àå/¢­¨§
17
; PageUp, PageDown      - áâà ­¨æ  ¢¢¥àå/¢­¨§
18
; Ctrl+UP, Ctrl+Down    - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
18
; Ctrl+UP, Ctrl+Down    - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
19
; Home,End              - ¢ ­ ç «®/ª®­¥æ áâப¨
19
; Home,End              - ¢ ­ ç «®/ª®­¥æ áâப¨
Line 43... Line 43...
43
; Mario79, Mario - Marat Zakiyanov / Œ à â ‡ ª¨ï­®¢
43
; Mario79, Mario - Marat Zakiyanov / Œ à â ‡ ª¨ï­®¢
44
; Diamondz - Evgeny Grechnikov / …¢£¥­¨© ƒà¥ç­¨ª®¢ ¨ ¤à.
44
; Diamondz - Evgeny Grechnikov / …¢£¥­¨© ƒà¥ç­¨ª®¢ ¨ ¤à.
45
;
45
;
46
; staper@inbox.ru
46
; staper@inbox.ru
47
; babalbes@yandex.ru
47
; babalbes@yandex.ru
48
 
-
 
-
 
48
;--------------------------------------------------------------------
49
use32
49
use32
50
	org	0x0
50
	org	0x0
51
	db	'MENUET01'
51
	db	'MENUET01'
52
	dd	0x1
52
	dd	0x1
53
	dd	START	;program start
53
	dd	START	;program start
54
	dd	I_END	;program image	size
54
	dd	I_END	;program image	size
55
	dd	(D_END+0x600) and not 3	;required amount of memory
55
	dd	(D_END+0x600) and not 3	;required amount of memory
56
	dd	(D_END+0x600) and not 3	;stack
56
	dd	(D_END+0x600) and not 3	;stack
57
	dd	fname_buf
57
	dd	fname_buf
58
	dd	cur_dir_path
58
	dd	cur_dir_path
59
 
-
 
-
 
59
;--------------------------------------------------------------------
60
_title	equ 'HeEd 0.16', 0
60
_title	equ 'HeEd 0.16', 0
Line 61... Line 61...
61
 
61
 
62
include	'lang.inc'
62
include	'lang.inc'
63
include '../../../config.inc'		;for nightbuild
63
include '../../../config.inc'		;for nightbuild
64
include '../../../macros.inc'
64
include '../../../macros.inc'
65
include	'../../libraries/box_lib/trunk/box_lib.mac'
65
include	'../../libraries/box_lib/trunk/box_lib.mac'
Line 66... Line 66...
66
include	'../../libraries/box_lib/load_lib.mac'
66
include	'../../libraries/box_lib/load_lib.mac'
67
 
-
 
-
 
67
 
68
@use_library
68
@use_library
Line 69... Line 69...
69
 
69
;--------------------------------------------------------------------
70
times	16	dd	0
70
times	16	dd	0
71
 
71
 
Line 76... Line 76...
76
text_color	equ	0xaaaaaa
76
text_color	equ	0xaaaaaa
Line 77... Line 77...
77
 
77
 
78
panel_clr1	equ	0xe9e9e2
78
panel_clr1	equ	0xe9e9e2
79
panel_clr2	equ	0x8b8b89
79
panel_clr2	equ	0x8b8b89
80
panel_clr3	equ	0x777777;eaeae3
-
 
81
 
-
 
-
 
80
panel_clr3	equ	0x777777;eaeae3
82
 
81
;--------------------------------------------------------------------
83
palitra:
82
palitra:
84
.1	dd	frgrd_color,bkgrd_color	;梥⠭¥¢ë¤¥«¥­­®£® ᨬ¢®« 
83
.1	dd	frgrd_color,bkgrd_color	;梥⠭¥¢ë¤¥«¥­­®£® ᨬ¢®« 
85
.2	dd	frgrd_color,text_color	;«¥¢ë©,¯à ¢ë© á⮫¡æë,ç áâì ­¨¦­¥© áâப¨
84
.2	dd	frgrd_color,text_color	;«¥¢ë©,¯à ¢ë© á⮫¡æë,ç áâì ­¨¦­¥© áâப¨
86
.3	dd	kursred_color,frgrd_color	;ªãàá®à 
85
.3	dd	kursred_color,frgrd_color	;ªãàá®à 
87
.4	dd	kurstxt_color,bkgrd_color	;ªãàá®à  ¢ ⥪á⮢®© ®¡« áâ¨
86
.4	dd	kurstxt_color,bkgrd_color	;ªãàá®à  ¢ ⥪á⮢®© ®¡« áâ¨
88
.5	dd	panel_clr1,not	text_color	;­¨¦­ïï ¯ ­¥«ì
-
 
-
 
87
.5	dd	panel_clr1,not	text_color	;­¨¦­ïï ¯ ­¥«ì
89
 
88
;--------------------------------------------------------------------
90
FIRST_HEX equ 0*65536+24
89
FIRST_HEX equ 0*65536+24
91
scroll_width_size equ 15
-
 
-
 
90
scroll_width_size equ 15
92
 
91
;--------------------------------------------------------------------
93
struct	f70
92
struct	f70
94
	func_n	rd 1
93
	func_n	rd 1
95
	param1	rd 1
94
	param1	rd 1
96
	param2	rd 1
95
	param2	rd 1
97
	param3	rd 1
96
	param3	rd 1
98
	param4	rd 1
97
	param4	rd 1
99
	rezerv	rb 1
98
	rezerv	rb 1
100
	name	rd 1
99
	name	rd 1
101
ends
-
 
-
 
100
ends
102
 
101
;--------------------------------------------------------------------
103
START:
102
START:
Line 104... Line 103...
104
	mcall	68,11
103
	mcall	68,11
105
 
104
 
Line 156... Line 155...
156
@@:
155
@@:
157
	cmp	byte [esi],0
156
	cmp	byte [esi],0
158
	je	@f
157
	je	@f
159
	inc	esi
158
	inc	esi
160
	jmp	@b
159
	jmp	@b
-
 
160
;-------------------------------------
161
@@:
161
@@:
162
	sub	esi,cur_dir_path
162
	sub	esi,cur_dir_path
163
	mov	[edit1.pos],esi
163
	mov	[edit1.pos],esi
164
	mov	[edit1.size],esi
164
	mov	[edit1.size],esi
Line 277... Line 277...
277
	jbe	input_from_keyboard	;A-F
277
	jbe	input_from_keyboard	;A-F
278
	cmp	ah,81
278
	cmp	ah,81
279
	jne	@f
279
	jne	@f
280
	call	Ctrl_DOWN
280
	call	Ctrl_DOWN
281
	jmp	red
281
	jmp	red
-
 
282
;--------------------------------------
282
@@:
283
@@:
283
	cmp	ah,82
284
	cmp	ah,82
284
	jne	@f
285
	jne	@f
285
	call	Ctrl_UP
286
	call	Ctrl_UP
286
	jmp	red
287
	jmp	red
-
 
288
;--------------------------------------
287
@@:
289
@@:
288
	cmp	ah,84
290
	cmp	ah,84
289
	jne	@f
291
	jne	@f
290
	call	Ctrl_HOME
292
	call	Ctrl_HOME
291
	jmp	red
293
	jmp	red
-
 
294
;--------------------------------------
292
@@:
295
@@:
293
	cmp	ah,85
296
	cmp	ah,85
294
	je	Ctrl_END
297
	je	Ctrl_END
295
	cmp	ah,96
298
	cmp	ah,96
296
	je	change_codepage	;⨫줠, cp866 - cp1251
299
	je	change_codepage	;⨫줠, cp866 - cp1251
Line 300... Line 303...
300
	jbe	input_from_keyboard ;a-f
303
	jbe	input_from_keyboard ;a-f
301
	cmp	ah,126
304
	cmp	ah,126
302
	jne	@f
305
	jne	@f
303
	xor	ah,ah
306
	xor	ah,ah
304
	jmp	change_codepage	;Shift+~, koi8-r
307
	jmp	change_codepage	;Shift+~, koi8-r
-
 
308
;--------------------------------------
305
@@:
309
@@:
306
	cmp	ah,110
310
	cmp	ah,110
307
	je	invert_byte ;n
311
	je	invert_byte ;n
308
	cmp	ah,176
312
	cmp	ah,176
309
	jne	@f
313
	jne	@f
310
	call	LEFT
314
	call	LEFT
311
	jmp	red
315
	jmp	red
-
 
316
;--------------------------------------
312
@@:
317
@@:
313
	cmp	ah,177
318
	cmp	ah,177
314
	jne	@f
319
	jne	@f
315
	call	DOWN
320
	call	DOWN
316
	jmp	red
321
	jmp	red
-
 
322
;--------------------------------------
317
@@:
323
@@:
318
	cmp	ah,178
324
	cmp	ah,178
319
	je	UP
325
	je	UP
320
	cmp	ah,179
326
	cmp	ah,179
321
	je	RIGHT
327
	je	RIGHT
322
	cmp	ah,180
328
	cmp	ah,180
323
	jne	@f
329
	jne	@f
324
	call	HOME
330
	call	HOME
325
	jmp	red
331
	jmp	red
-
 
332
;--------------------------------------
326
@@:
333
@@:
327
	cmp	ah,181
334
	cmp	ah,181
328
	je	END_
335
	je	END_
329
	cmp	ah,182
336
	cmp	ah,182
330
	je	DEL
337
	je	DEL
Line 333... Line 340...
333
	cmp	ah,184
340
	cmp	ah,184
334
	je	PGUP
341
	je	PGUP
335
	cmp	ah,185
342
	cmp	ah,185
336
	je	Insert
343
	je	Insert
337
	jmp	still
344
	jmp	still
-
 
345
;--------------------------------------
338
.syst:
346
.syst:
339
	cmp	ah,72
347
	cmp	ah,72
340
	cmp	ah,75
348
	cmp	ah,75
341
	cmp	ah,77
349
	cmp	ah,77
342
	cmp	ah,80
350
	cmp	ah,80
343
	jmp	still
351
	jmp	still
344
 
-
 
-
 
352
;--------------------------------------------------------------------
345
button:
353
button:
346
	mcall	17
354
	mcall	17
347
	dec	ah
355
	dec	ah
348
	jnz	still
356
	jnz	still
Line 349... Line 357...
349
 
357
 
350
	jmp	close_prog
-
 
-
 
358
	jmp	close_prog
351
 
359
;--------------------------------------------------------------------
352
align	4
360
align	4
353
mouse:
361
mouse:
354
	mcall	18,7
362
	mcall	18,7
355
	cmp	[active_process],eax
363
	cmp	[active_process],eax
Line 364... Line 372...
364
	shl	ecx,2
372
	shl	ecx,2
365
.1:
373
.1:
366
	call	Ctrl_DOWN
374
	call	Ctrl_DOWN
367
	loop	.1
375
	loop	.1
368
	jmp	red
376
	jmp	red
-
 
377
;--------------------------------------
369
@@:
378
@@:
370
	xor	ecx,ecx
379
	xor	ecx,ecx
371
	sub	cx,ax
380
	sub	cx,ax
372
	shl	cx,2
381
	shl	cx,2
373
.2:
382
.2:
374
	call	Ctrl_UP
383
	call	Ctrl_UP
375
	loop	.2
384
	loop	.2
376
	jmp	red
385
	jmp	red
377
 
-
 
-
 
386
;--------------------------------------------------------------------
378
.menu_bar_1:
387
.menu_bar_1:
379
	call	.set_mouse_flag
388
	call	.set_mouse_flag
380
@@:
389
@@:
381
	push	dword menu_data_1	;mouse event for Menu 1
390
	push	dword menu_data_1	;mouse event for Menu 1
382
	call	[menu_bar_mouse]
391
	call	[menu_bar_mouse]
383
	cmp	[menu_data_1.click],dword 1
392
	cmp	[menu_data_1.click],dword 1
384
	jne	.menu_bar_2
393
	jne	.menu_bar_2
385
	cmp	[menu_data_1.cursor_out],dword 0
394
	cmp	[menu_data_1.cursor_out],dword 0
386
	jne	.analyse_out_menu_1
395
	jne	.analyse_out_menu_1
387
	jmp	.menu_bar_1
396
	jmp	.menu_bar_1
-
 
397
;--------------------------------------------------------------------
388
.menu_bar_2:
398
.menu_bar_2:
389
	push	dword menu_data_2
399
	push	dword menu_data_2
390
	call	[menu_bar_mouse]
400
	call	[menu_bar_mouse]
391
	cmp	[menu_data_2.click],dword 1
401
	cmp	[menu_data_2.click],dword 1
392
	jne	.menu_bar_3
402
	jne	.menu_bar_3
393
	cmp	[menu_data_2.cursor_out],dword 0
403
	cmp	[menu_data_2.cursor_out],dword 0
394
	jne	.analyse_out_menu_2
404
	jne	.analyse_out_menu_2
395
	jmp	.menu_bar_1
405
	jmp	.menu_bar_1
-
 
406
;--------------------------------------------------------------------
396
.menu_bar_3:
407
.menu_bar_3:
397
	push	dword menu_data_3
408
	push	dword menu_data_3
398
	call	[menu_bar_mouse]
409
	call	[menu_bar_mouse]
399
	cmp	[menu_data_3.click],dword 1
410
	cmp	[menu_data_3.click],dword 1
400
	jne	.scroll_bar
411
	jne	.scroll_bar
401
	cmp	[menu_data_3.cursor_out],dword 0
412
	cmp	[menu_data_3.cursor_out],dword 0
402
	jne	.analyse_out_menu_3
413
	jne	.analyse_out_menu_3
403
	jmp	.menu_bar_1
414
	jmp	.menu_bar_1
404
 
-
 
-
 
415
;--------------------------------------------------------------------
405
.set_mouse_flag:
416
.set_mouse_flag:
406
	xor	eax,eax
417
	xor	eax,eax
407
	inc	eax
418
	inc	eax
408
	mov	[menu_data_1.get_mouse_flag],eax
419
	mov	[menu_data_1.get_mouse_flag],eax
409
	mov	[menu_data_2.get_mouse_flag],eax
420
	mov	[menu_data_2.get_mouse_flag],eax
410
	mov	[menu_data_3.get_mouse_flag],eax
421
	mov	[menu_data_3.get_mouse_flag],eax
411
	ret
422
	ret
412
 
-
 
-
 
423
;--------------------------------------------------------------------
413
.analyse_out_menu_1:
424
.analyse_out_menu_1:
414
	cmp	[menu_data_1.cursor_out],dword 1
425
	cmp	[menu_data_1.cursor_out],dword 1
415
	je	open_dialog
426
	je	open_dialog
416
	cmp	[menu_data_1.cursor_out],dword 2
427
	cmp	[menu_data_1.cursor_out],dword 2
417
	je	open_dialog_save	;save_file
428
	je	open_dialog_save	;save_file
418
	cmp	[menu_data_1.cursor_out],dword 3
429
	cmp	[menu_data_1.cursor_out],dword 3
419
	je	close_prog
430
	je	close_prog
420
	jmp	still
431
	jmp	still
421
 
-
 
-
 
432
;--------------------------------------------------------------------
422
.analyse_out_menu_2:
433
.analyse_out_menu_2:
423
	cmp	[menu_data_2.cursor_out],dword 1
434
	cmp	[menu_data_2.cursor_out],dword 1
424
	jne	@f
435
	jne	@f
425
	add	[bytes_per_line],4
436
	add	[bytes_per_line],4
426
	jmp	redraw_all
437
	jmp	redraw_all
-
 
438
;--------------------------------------
427
@@:
439
@@:
428
	cmp	[menu_data_2.cursor_out],dword 2
440
	cmp	[menu_data_2.cursor_out],dword 2
429
	jne	@f
441
	jne	@f
430
	add	[bytes_per_line],8
442
	add	[bytes_per_line],8
431
	jmp	redraw_all
443
	jmp	redraw_all
-
 
444
;--------------------------------------
432
@@:
445
@@:
433
	cmp	[menu_data_2.cursor_out],dword 3
446
	cmp	[menu_data_2.cursor_out],dword 3
434
	jne	@f
447
	jne	@f
435
	cmp	[bytes_per_line],4
448
	cmp	[bytes_per_line],4
436
	je	still
449
	je	still
437
	sub	[bytes_per_line],4
450
	sub	[bytes_per_line],4
438
	jmp	redraw_all
451
	jmp	redraw_all
-
 
452
;--------------------------------------
439
@@:
453
@@:
440
	cmp	[menu_data_2.cursor_out],dword 4
454
	cmp	[menu_data_2.cursor_out],dword 4
441
	jne	still
455
	jne	still
442
	cmp	[bytes_per_line],8
456
	cmp	[bytes_per_line],8
443
	jbe	still
457
	jbe	still
444
	sub	[bytes_per_line],8
458
	sub	[bytes_per_line],8
445
	jmp	redraw_all
459
	jmp	redraw_all
446
 
-
 
-
 
460
;--------------------------------------------------------------------
447
.analyse_out_menu_3:	;analyse result of Menu 2
461
.analyse_out_menu_3:	;analyse result of Menu 2
448
	cmp	[menu_data_3.cursor_out],dword 1
462
	cmp	[menu_data_3.cursor_out],dword 1
449
	jne	still
463
	jne	still
450
	call	create_help_window
464
	call	create_help_window
451
	jmp	still
465
	jmp	still
452
 
-
 
-
 
466
;--------------------------------------------------------------------
453
.scroll_bar:
467
.scroll_bar:
454
;	mcall	37,2
468
;	mcall	37,2
455
;	test	eax,eax
469
;	test	eax,eax
456
;	jnz	@f
470
;	jnz	@f
457
;	btr	[flags],5
471
;	btr	[flags],5
Line 464... Line 478...
464
	test	eax,eax
478
	test	eax,eax
465
	jnz	@f
479
	jnz	@f
466
	btr	[flags],5
480
	btr	[flags],5
467
	btr	[flags],7
481
	btr	[flags],7
468
	jmp	still
482
	jmp	still
-
 
483
;--------------------------------------
469
@@:
484
@@:
470
	bt	[flags],5
485
	bt	[flags],5
471
	jc	@f
486
	jc	@f
472
	bt	[flags],7
487
	bt	[flags],7
473
	jc	.horizontal_0
488
	jc	.horizontal_0
Line 520... Line 535...
520
	cmp	ecx,[file_size]
535
	cmp	ecx,[file_size]
521
	jle	@f
536
	jle	@f
522
	sub	ecx,esi;[bytes_per_line]
537
	sub	ecx,esi;[bytes_per_line]
523
	sub	eax,esi;[bytes_per_line]
538
	sub	eax,esi;[bytes_per_line]
524
	jmp	@b
539
	jmp	@b
-
 
540
;--------------------------------------
525
@@:
541
@@:
526
	mov	[begin_offset],eax
542
	mov	[begin_offset],eax
527
	bts	[flags],5
543
	bts	[flags],5
Line 528... Line 544...
528
 
544
 
529
	mov	eax,scroll_bar_data_vertical.redraw
545
	mov	eax,scroll_bar_data_vertical.redraw
530
	xor	ebx,ebx
546
	xor	ebx,ebx
531
;	cmp	[eax],ebx
547
;	cmp	[eax],ebx
532
;	je	@f
548
;	je	@f
533
	mov	[eax],ebx
549
	mov	[eax],ebx
-
 
550
	jmp	red
534
	jmp	red
551
;--------------------------------------------------------------------
535
;@@:
552
;@@:
536
;	cmp	[scroll_bar_data_vertical.delta2],0
553
;	cmp	[scroll_bar_data_vertical.delta2],0
537
;	jne	still
554
;	jne	still
538
.horizontal:
555
.horizontal:
Line 601... Line 618...
601
	mov	[eax],ebx
618
	mov	[eax],ebx
602
;	call	draw_window
619
;	call	draw_window
603
	call	main_area
620
	call	main_area
604
	bts	[flags],7
621
	bts	[flags],7
605
	jmp	still
622
	jmp	still
-
 
623
;--------------------------------------------------------------------
606
.other:
624
.other:
607
;	cmp	[scroll_bar_data_vertical.delta2],0
625
;	cmp	[scroll_bar_data_vertical.delta2],0
608
;	jne	still
626
;	jne	still
609
;	cmp	[scroll_bar_data_horizontal.delta2],0
627
;	cmp	[scroll_bar_data_horizontal.delta2],0
610
;	jne	still
628
;	jne	still
611
	jmp	still
629
	jmp	still
612
 
-
 
613
 
-
 
614
 
-
 
615
;------------------------------------------------
630
;--------------------------------------------------------------------
616
 
-
 
617
;------------------------------------------------
-
 
618
 
-
 
619
 
-
 
620
align	4
631
align	4
621
ready_screen_buffer:
632
ready_screen_buffer:
622
	mov	[.fl],0
633
	mov	[.fl],0
623
	mov	esi,[screen_table]
634
	mov	esi,[screen_table]
624
	add	esi,4
635
	add	esi,4
Line 764... Line 775...
764
	pop	edi
775
	pop	edi
765
	mov	edx,[bytes_per_line]
776
	mov	edx,[bytes_per_line]
766
	dec	[.number_strings]
777
	dec	[.number_strings]
767
	jnz	.next_string
778
	jnz	.next_string
768
	ret
779
	ret
769
 
-
 
-
 
780
;---------------------------------------------------------------------
770
.fl	db 0
781
.fl	db 0
771
.fl_buf	dd 0
782
.fl_buf	dd 0
772
.to_null:
783
.to_null:
773
	dec	[.fl]
784
	dec	[.fl]
774
	mov	[.fl_buf],edi
785
	mov	[.fl_buf],edi
775
	jmp	.pre_next_byte0
786
	jmp	.pre_next_byte0
776
 
-
 
-
 
787
;--------------------------------------------------------------------
777
.pre_next_string:
788
.pre_next_string:
778
	mov	word [esi],0x2020
789
	mov	word [esi],0x2020
779
	add	esi,2
790
	add	esi,2
780
	mov	eax,0x20302030
791
	mov	eax,0x20302030
781
	mov	dword [esi],eax
792
	mov	dword [esi],eax
Line 861... Line 872...
861
	loop	@b
872
	loop	@b
862
	mov	edx,[bytes_per_line]
873
	mov	edx,[bytes_per_line]
863
	dec	[.number_strings]
874
	dec	[.number_strings]
864
	jnz	.pre_next_string
875
	jnz	.pre_next_string
865
	ret
876
	ret
866
 
-
 
-
 
877
;---------------------------------------------------------------------
867
;ª®à४⭮ ®¡à ¡ â뢠¥¬ 䨭 «ì­ãî áâபã ä ©« , ¤«¨­  ª®â®à®© ¢ à¨ â¨¢­ 
878
;ª®à४⭮ ®¡à ¡ â뢠¥¬ 䨭 «ì­ãî áâபã ä ©« , ¤«¨­  ª®â®à®© ¢ à¨ â¨¢­ 
868
.last_ascii:
879
.last_ascii:
869
	mov	ebx,[.fl_buf]
880
	mov	ebx,[.fl_buf]
870
	sub	ebx,[.temp]
881
	sub	ebx,[.temp]
871
	sub	ecx,ebx
882
	sub	ecx,ebx
Line 888... Line 899...
888
	add	[.string_size],2
899
	add	[.string_size],2
889
	dec	ebx
900
	dec	ebx
890
	jnz	@b
901
	jnz	@b
891
	inc	ecx
902
	inc	ecx
892
	jmp	.1
903
	jmp	.1
893
 
-
 
-
 
904
;--------------------------------------------------------------------
894
.string_size	dd 16
905
.string_size	dd 16
895
.number_strings	dw 0
906
.number_strings	dw 0
896
.length_to_end	dd 0
907
.length_to_end	dd 0
897
.temp		dd 0
908
.temp		dd 0
898
.offset		dd 0
909
.offset		dd 0
899
.cursor		dd 0
910
.cursor		dd 0
900
.cursor_temp	dd 0
911
.cursor_temp	dd 0
901
.shblock_beg	dd 0
912
.shblock_beg	dd 0
902
.shblock_end	dd 0
913
.shblock_end	dd 0
903
 
-
 
904
 
-
 
-
 
914
;--------------------------------------------------------------------
905
align	4
915
align	4
906
main_area:
916
main_area:
907
	mov	ecx,[number_strings]
917
	mov	ecx,[number_strings]
908
	mov	[.number_strings],cx
918
	mov	[.number_strings],cx
909
	push	[len_str_scr]
919
	push	[len_str_scr]
Line 1006... Line 1016...
1006
 
1016
 
1007
	dec	[.len_str_scr]
1017
	dec	[.len_str_scr]
1008
	jz	.loop_str
1018
	jz	.loop_str
1009
	dec	[.string_size]
1019
	dec	[.string_size]
1010
	jnz	.out
1020
	jnz	.out
1011
	jz	.next_string
-
 
-
 
1021
	jz	.next_string	; WTF?
1012
 
1022
;--------------------------------------------------------------------
1013
.string_size	dd 0
1023
.string_size	dd 0
1014
.number_strings	dw 0
1024
.number_strings	dw 0
1015
.len_str_scr	dd 0
-
 
-
 
1025
.len_str_scr	dd 0
1016
 
1026
;--------------------------------------------------------------------
1017
@@:
1027
@@:
1018
	pushad
1028
	pushad
1019
	mov	ecx,edx
1029
	mov	ecx,edx
1020
	shl	ecx,16
1030
	shl	ecx,16
Line 1029... Line 1039...
1029
	mov	cx,16
1039
	mov	cx,16
1030
	mcall	13,,,frgrd_color
1040
	mcall	13,,,frgrd_color
1031
.ls1:
1041
.ls1:
1032
	popad
1042
	popad
1033
	jmp	@f
1043
	jmp	@f
-
 
1044
;--------------------------------------------------------------------
1034
.loop_str:
1045
.loop_str:
1035
	bt	[flags],6
1046
	bt	[flags],6
1036
	jc	@b
1047
	jc	@b
1037
@@:
1048
@@:
1038
	dec	[.string_size]
1049
	dec	[.string_size]
1039
	jz	.next_string
1050
	jz	.next_string
1040
	add	edi,2
1051
	add	edi,2
1041
	add	edx,8*65536
1052
	add	edx,8*65536
1042
	jmp	@b
1053
	jmp	@b
1043
 
-
 
-
 
1054
;--------------------------------------
1044
@@:;®ç¨á⪠ ä®­®¢ë¬ 梥⮬ ­¥§ ªà è¥­­ëå ®¡« á⥩
1055
@@:;®ç¨á⪠ ä®­®¢ë¬ 梥⮬ ­¥§ ªà è¥­­ëå ®¡« á⥩
1045
	pushad
1056
	pushad
1046
	ror	edx,16
1057
	ror	edx,16
1047
	mov	dx,16
1058
	mov	dx,16
1048
	mov	ecx,edx
1059
	mov	ecx,edx
1049
	mov	edx,frgrd_color
1060
	mov	edx,frgrd_color
1050
	movzx	ebx,[scroll_bar_data_vertical.start_x]
1061
	movzx	ebx,[scroll_bar_data_vertical.start_x]
-
 
1062
	
-
 
1063
	mov	ax,[scroll_bar_data_vertical.size_x]
-
 
1064
	test	ax,ax
-
 
1065
	jnz	.no_inc_ebx
-
 
1066
	inc	ebx
-
 
1067
.no_inc_ebx:
1051
	sub	ecx,2*65536
1068
	sub	ecx,2*65536
1052
	mov	cx,2
1069
	mov	cx,2
1053
	mcall	13
1070
	mcall	13
1054
	popad
1071
	popad
Line 1063... Line 1080...
1063
	mov	ax,[scroll_bar_data_vertical.start_x]
1080
	mov	ax,[scroll_bar_data_vertical.start_x]
1064
	sub	ax,bx
1081
	sub	ax,bx
1065
	shl	ebx,16
1082
	shl	ebx,16
1066
	mov	bx,ax
1083
	mov	bx,ax
1067
	mov	cx,16
1084
	mov	cx,16
-
 
1085
	
-
 
1086
	mov	ax,[scroll_bar_data_vertical.size_x]
-
 
1087
	test	ax,ax
-
 
1088
	jnz	.no_inc_ebx_2
-
 
1089
	inc	ebx
-
 
1090
.no_inc_ebx_2:
1068
	mcall	13,,,frgrd_color
1091
	mcall	13,,,frgrd_color
1069
.10:
1092
.10:
1070
	popad
1093
	popad
1071
	jmp	@f
1094
	jmp	@f
-
 
1095
;--------------------------------------------------------------------
1072
.next_string:
1096
.next_string:
1073
	bt	[flags],6
1097
	bt	[flags],6
1074
	jc	@b
1098
	jc	@b
1075
@@:
1099
@@:
1076
	push	[len_str_scr]
1100
	push	[len_str_scr]
Line 1089... Line 1113...
1089
	add	edx,18
1113
	add	edx,18
1090
	dec	[.number_strings]
1114
	dec	[.number_strings]
1091
	jnz	.out
1115
	jnz	.out
1092
	btr	[flags],6
1116
	btr	[flags],6
1093
	jmp	end_draw
1117
	jmp	end_draw
1094
 
-
 
1095
 
-
 
-
 
1118
;--------------------------------------------------------------------
1096
align	4
1119
align	4
1097
show_current_offset:
1120
show_current_offset:
1098
	pushad
1121
	pushad
1099
	push	edx	;¢ë¢®¤ ⥪ã饣® ᬥ饭¨ï ¢ ä ©«¥
1122
	push	edx	;¢ë¢®¤ ⥪ã饣® ᬥ饭¨ï ¢ ä ©«¥
1100
	mov	edi,palitra.5
1123
	mov	edi,palitra.5
Line 1163... Line 1186...
1163
	shr	ebx,8
1186
	shr	ebx,8
1164
	cmp	byte [edx],100
1187
	cmp	byte [edx],100
1165
	jb	.1
1188
	jb	.1
1166
	mov	ebp,3
1189
	mov	ebp,3
1167
	jmp	@f
1190
	jmp	@f
-
 
1191
;--------------------------------------
1168
.1:
1192
.1:
1169
	mov	ebp,1
1193
	mov	ebp,1
1170
	cmp	byte [edx],10
1194
	cmp	byte [edx],10
1171
	jb	@f
1195
	jb	@f
1172
	mov	ebp,2
1196
	mov	ebp,2
Line 1206... Line 1230...
1206
;	mov	ecx,8
1230
;	mov	ecx,8
1207
;	call	hex_output
1231
;	call	hex_output
1208
	pop	edx
1232
	pop	edx
1209
	popad
1233
	popad
1210
	ret
1234
	ret
1211
 
-
 
1212
 
-
 
-
 
1235
;---------------------------------------------------------------------
1213
align	4
1236
align	4
1214
hex_output:	;¢ë¢®¤ hex áâப¨ ¨§ 8 ᨬ¢®«®¢
1237
hex_output:	;¢ë¢®¤ hex áâப¨ ¨§ 8 ᨬ¢®«®¢
1215
	pushad
1238
	pushad
1216
	mov	edi,(hex8_string)	; ¤à¥á ¡ãä¥à 
1239
	mov	edi,(hex8_string)	; ¤à¥á ¡ãä¥à 
1217
	mov	dword [edi],0x30303030
1240
	mov	dword [edi],0x30303030
Line 1274... Line 1297...
1274
	ja	@f
1297
	ja	@f
1275
	mov	bl,[esi]
1298
	mov	bl,[esi]
1276
	mov	[esi+1],bl
1299
	mov	[esi+1],bl
1277
	dec	esi
1300
	dec	esi
1278
	jmp	@b
1301
	jmp	@b
-
 
1302
;--------------------------------------
1279
@@:
1303
@@:
1280
	call	show_file_size
1304
	call	show_file_size
1281
	mov	ebx,[current_offset]
1305
	mov	ebx,[current_offset]
1282
	add	ebx,[file_buffer]
1306
	add	ebx,[file_buffer]
1283
	mov	byte [ebx],0
1307
	mov	byte [ebx],0
Line 1289... Line 1313...
1289
	mov	ebx,[cursor]
1313
	mov	ebx,[cursor]
1290
	and	bl,1	;­¥ç¥â - । ªâ¨à㥬 áâ à訩 ¯®«ã¡ ©â
1314
	and	bl,1	;­¥ç¥â - । ªâ¨à㥬 áâ à訩 ¯®«ã¡ ©â
1291
	jnz	.hi_half_byte ;çñâ - áâ à訩
1315
	jnz	.hi_half_byte ;çñâ - áâ à訩
1292
	and	dl,0xf0	;®¡­ã«ï¥¬ ¬«. ¯-¡ ©â ®à¨£¨­ «ì­®£® ¡ ©â 
1316
	and	dl,0xf0	;®¡­ã«ï¥¬ ¬«. ¯-¡ ©â ®à¨£¨­ «ì­®£® ¡ ©â 
1293
	jmp	.patch_byte
1317
	jmp	.patch_byte
-
 
1318
;--------------------------------------
1294
.hi_half_byte:	;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ ¯-â ¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
1319
.hi_half_byte:	;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ ¯-â ¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
1295
	shl	ax,4
1320
	shl	ax,4
1296
	and	dl,0x0f	;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
1321
	and	dl,0x0f	;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
1297
.patch_byte:
1322
.patch_byte:
1298
	or	ah,dl
1323
	or	ah,dl
1299
	mov	[ecx],ah
1324
	mov	[ecx],ah
1300
	jmp	RIGHT
1325
	jmp	RIGHT
1301
 
-
 
-
 
1326
;--------------------------------------------------------------------
1302
raspred_mem:
1327
raspred_mem:
1303
	pushad
1328
	pushad
1304
	xor	edx,edx
1329
	xor	edx,edx
1305
	mov	ecx,4096
1330
	mov	ecx,4096
1306
	mov	eax,[file_size]
1331
	mov	eax,[file_size]
Line 1314... Line 1339...
1314
	mov	[prev_f_size_bl],eax
1339
	mov	[prev_f_size_bl],eax
1315
	xor	edx,edx
1340
	xor	edx,edx
1316
	mul	ecx
1341
	mul	ecx
1317
	mov	ecx,eax
1342
	mov	ecx,eax
1318
	jmp	.1
1343
	jmp	.1
-
 
1344
;--------------------------------------
1319
@@:
1345
@@:
1320
	mov	[prev_f_size_bl],eax
1346
	mov	[prev_f_size_bl],eax
1321
	xor	edx,edx
1347
	xor	edx,edx
1322
	mul	ecx
1348
	mul	ecx
1323
	add	ecx,eax
1349
	add	ecx,eax
1324
.1:
1350
.1:
1325
	mcall	68,20,,[file_buffer]
1351
	mcall	68,20,,[file_buffer]
1326
.ret:
1352
.ret:
1327
	popad
1353
	popad
1328
	ret
1354
	ret
1329
;---------------------------------------
1355
;--------------------------------------------------------------------
1330
 
-
 
1331
align	4
1356
align	4
1332
show_file_size:
1357
show_file_size:
1333
	mov	ebx,[file_size]
1358
	mov	ebx,[file_size]
1334
	mov	edx,[low_area];
1359
	mov	edx,[low_area];
1335
	mov	esi,1
1360
	mov	esi,1
Line 1366... Line 1391...
1366
	jnae	@f
1391
	jnae	@f
1367
.@d:
1392
.@d:
1368
	call	end_draw
1393
	call	end_draw
1369
	add	esp,4
1394
	add	esp,4
1370
	jmp	still
1395
	jmp	still
-
 
1396
;--------------------------------------
1371
@@:
1397
@@:
1372
	cmp	dword [threath_buf+66],(24*4)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© ¢ëá®âë
1398
	cmp	dword [threath_buf+66],(24*4)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© ¢ëá®âë
1373
	jae	@f
1399
	jae	@f
1374
	mov	esi,dword [threath_buf+46]
1400
	mov	esi,dword [threath_buf+46]
1375
	sub	esi,dword [threath_buf+66]
1401
	sub	esi,dword [threath_buf+66]
1376
	add	esi,24*4
1402
	add	esi,24*4
1377
	mcall	67,-1,-1,-1,
1403
	mcall	67,-1,-1,-1,
1378
	jmp	.@d
1404
	jmp	.@d
-
 
1405
;--------------------------------------
1379
@@:
1406
@@:
1380
	cmp	dword [threath_buf+62],(26*6)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© è¨à¨­ë
1407
	cmp	dword [threath_buf+62],(26*6)	;¯à®¢¥àª  ¬¨­¨¬ «ì­®© è¨à¨­ë
1381
	jae	@f
1408
	jae	@f
1382
	mov	edx,dword [threath_buf+42]
1409
	mov	edx,dword [threath_buf+42]
1383
	sub	edx,dword [threath_buf+62]
1410
	sub	edx,dword [threath_buf+62]
1384
	add	edx,26*6
1411
	add	edx,26*6
1385
	mcall	67,-1,-1,,-1
1412
	mcall	67,-1,-1,,-1
1386
	jmp	.@d
1413
	jmp	.@d
-
 
1414
;--------------------------------------
1387
@@:
1415
@@:
1388
	mov	eax,[file_size]
1416
	mov	eax,[file_size]
1389
	mov	ebx,[bytes_per_line]
1417
	mov	ebx,[bytes_per_line]
1390
	xor	edx,edx
1418
	xor	edx,edx
1391
	div	ebx
1419
	div	ebx
Line 1429... Line 1457...
1429
	ror	ecx,16
1457
	ror	ecx,16
1430
	mcall	13,,,frgrd_color	;¯®«®á  ᢥàåã
1458
	mcall	13,,,frgrd_color	;¯®«®á  ᢥàåã
Line 1431... Line 1459...
1431
 
1459
 
Line 1432... Line 1460...
1432
	mcall	,,18,panel_clr1	;¢¥àå­ïï ¯ ­¥«ì
1460
	mcall	,,18,panel_clr1	;¢¥àå­ïï ¯ ­¥«ì
1433
 
1461
 
1434
	dec	ebx
1462
;	dec	ebx
1435
	mcall	38,,<18,18>,panel_clr2
1463
	mcall	38,,<18,18>,panel_clr2
1436
	mov	ecx,dword [threath_buf+66]
1464
	mov	ecx,dword [threath_buf+66]
1437
	sub	cx,18
1465
	sub	cx,18
1438
	push	cx
1466
	push	cx
1439
	shl	ecx,16
1467
	shl	ecx,16
1440
	pop	cx
1468
	pop	cx
1441
	mcall	,,,panel_clr3	;­¨¦­ïï ¯ ­¥«ì
1469
	mcall	,,,panel_clr3	;­¨¦­ïï ¯ ­¥«ì
1442
	add	ecx,1*65536
-
 
1443
	mov	cx,18
1470
	add	ecx,1*65536
Line 1444... Line 1471...
1444
;	inc	ebx
1471
	mov	cx,18
1445
	mcall	13,,,panel_clr1
1472
	mcall	13,,,panel_clr1
Line 1476... Line 1503...
1476
	sub	dx,cx
1503
	sub	dx,cx
1477
	shl	ecx,16
1504
	shl	ecx,16
1478
	add	cx,dx
1505
	add	cx,dx
1479
	sub	ecx,1*65536
1506
	sub	ecx,1*65536
1480
	movzx	ebx,	word [scroll_bar_data_vertical.start_x]
1507
	movzx	ebx,	word [scroll_bar_data_vertical.start_x]
-
 
1508
	inc	ebx
1481
	mcall	13,,,frgrd_color
1509
	mcall	13,,,frgrd_color
Line 1482... Line 1510...
1482
 
1510
 
Line 1483... Line 1511...
1483
	pop	eax
1511
	pop	eax
Line 1559... Line 1587...
1559
	jge	@f
1587
	jge	@f
1560
	add	[begin_offset],esi
1588
	add	[begin_offset],esi
1561
	sub	[cursor],ecx
1589
	sub	[cursor],ecx
1562
	sub	ebx,esi
1590
	sub	ebx,esi
1563
	jmp	@b
1591
	jmp	@b
-
 
1592
;--------------------------------------
1564
@@:
1593
@@:
1565
	bts	[flags],6
1594
	bts	[flags],6
1566
	ret
1595
	ret
1567
 
-
 
-
 
1596
;--------------------------------------------------------------------
1568
align	4
1597
align	4
1569
start_draw:
1598
start_draw:
1570
	mcall	12,1
1599
	mcall	12,1
1571
	ret
1600
	ret
1572
 
-
 
-
 
1601
;--------------------------------------------------------------------
1573
end_draw:
1602
end_draw:
1574
	mcall	12,2
1603
	mcall	12,2
1575
	ret
1604
	ret
1576
 
-
 
-
 
1605
;--------------------------------------------------------------------
1577
close_prog:
1606
close_prog:
1578
	mcall	-1
1607
	mcall	-1
1579
;-------------------------------------------------------------------------------
1608
;--------------------------------------------------------------------
1580
change_codepage:	;¬¥­ï¥¬ ¢â®àãî ¯®«®¢¨­ã â ¡«¨æë
1609
change_codepage:	;¬¥­ï¥¬ ¢â®àãî ¯®«®¢¨­ã â ¡«¨æë
1581
	test	ah,ah
1610
	test	ah,ah
1582
	jnz	@f
1611
	jnz	@f
1583
	btc	[flags],4
1612
	btc	[flags],4
1584
	jc	.1
1613
	jc	.1
1585
	push	[codepage_offset]
1614
	push	[codepage_offset]
1586
	pop	[codepage_offset_previous]
1615
	pop	[codepage_offset_previous]
1587
	mov	[codepage_offset],2*128
1616
	mov	[codepage_offset],2*128
1588
	jmp	.end
1617
	jmp	.end
-
 
1618
;--------------------------------------
1589
.1:
1619
.1:
1590
	push	[codepage_offset_previous]
1620
	push	[codepage_offset_previous]
1591
	pop	[codepage_offset]
1621
	pop	[codepage_offset]
1592
	jmp	.end
1622
	jmp	.end
-
 
1623
;--------------------------------------
1593
@@:
1624
@@:
1594
	cmp	[codepage_offset],0
1625
	cmp	[codepage_offset],0
1595
	jne	@f
1626
	jne	@f
1596
	add	[codepage_offset],128
1627
	add	[codepage_offset],128
1597
	jmp	.end
1628
	jmp	.end
-
 
1629
;--------------------------------------
1598
@@:
1630
@@:
1599
	mov	[codepage_offset],0
1631
	mov	[codepage_offset],0
1600
.end:
1632
.end:
1601
	call	show_codepage
1633
	call	show_codepage
1602
	jmp	red
1634
	jmp	red
1603
 
-
 
-
 
1635
;--------------------------------------------------------------------
1604
show_codepage:
1636
show_codepage:
1605
	mov	ebp,6
1637
	mov	ebp,6
1606
	mov	edx,dword [threath_buf+62]
1638
	mov	edx,dword [threath_buf+62]
1607
	sub	edx,73
1639
	sub	edx,73
1608
	shl	edx,16
1640
	shl	edx,16
Line 1632... Line 1664...
1632
	inc	edi
1664
	inc	edi
1633
	dec	dword [esp]
1665
	dec	dword [esp]
1634
	jnz	@b
1666
	jnz	@b
1635
	add	esp,4
1667
	add	esp,4
1636
	ret
1668
	ret
1637
 
-
 
-
 
1669
;--------------------------------------------------------------------
1638
show_insert:	;®â®¡à ¦¥­¨¥ ०¨¬  ¢áâ ¢ª¨/§ ¬¥­ë
1670
show_insert:	;®â®¡à ¦¥­¨¥ ०¨¬  ¢áâ ¢ª¨/§ ¬¥­ë
1639
	mov	ebp,3
1671
	mov	ebp,3
1640
	mov	edx,dword [threath_buf+62]
1672
	mov	edx,dword [threath_buf+62]
1641
	sub	edx,120
1673
	sub	edx,120
1642
	shl	edx,16	; mov edx,428*65536+335
1674
	shl	edx,16	; mov edx,428*65536+335
Line 1674... Line 1706...
1674
        mcall   18, 21
1706
        mcall   18, 21
1675
        xchg    EAX, ECX
1707
        xchg    EAX, ECX
1676
        mcall   18, 3
1708
        mcall   18, 3
1677
	popad
1709
	popad
1678
        ret
1710
        ret
-
 
1711
;---------------------------------------------------------------------
1679
@@:
1712
@@:
1680
	mcall	51,1,.thread,(.threat_stack+16*4)
1713
	mcall	51,1,.thread,(.threat_stack+16*4)
1681
        mov     [help_is_open_already], 1
1714
        mov     [help_is_open_already], 1
1682
        mov     [help_window_pid], EAX
1715
        mov     [help_window_pid], EAX
1683
	popad
1716
	popad
1684
	ret
1717
	ret
-
 
1718
;--------------------------------------------------------------------
1685
.thread:
1719
.thread:
1686
	call	.window
1720
	call	.window
-
 
1721
;--------------------------------------------------------------------
1687
.still:
1722
.still:
1688
	mcall	10
1723
	mcall	10
1689
	dec	al
1724
	dec	al
1690
	jz	.red
1725
	jz	.red
1691
	dec	al
1726
	dec	al
1692
	jz	.key
1727
	jz	.key
1693
	dec	al
1728
	dec	al
1694
	jz	.button
1729
	jz	.button
1695
	jmp	.still
1730
	jmp	.still
-
 
1731
;--------------------------------------------------------------------
1696
        and	[help_is_open_already], 0
1732
        and	[help_is_open_already], 0
1697
	mcall	-1
1733
	mcall	-1
1698
.button:
1734
.button:
1699
	mcall	17,1
1735
	mcall	17,1
1700
	cmp	ah,1
1736
	cmp	ah,1
Line 1709... Line 1745...
1709
	sub	edi,13
1745
	sub	edi,13
1710
	sub	edi,eax
1746
	sub	edi,eax
1711
	jz	.still
1747
	jz	.still
1712
	inc	[cur_help_string]
1748
	inc	[cur_help_string]
1713
	jmp	.red
1749
	jmp	.red
-
 
1750
;--------------------------------------
1714
@@:
1751
@@:
1715
	cmp	ah,3
1752
	cmp	ah,3
1716
	jne	.still
1753
	jne	.still
1717
	cmp	[cur_help_string],0
1754
	cmp	[cur_help_string],0
1718
	je	.still
1755
	je	.still
1719
	dec	[cur_help_string]
1756
	dec	[cur_help_string]
1720
	jmp	.red
1757
	jmp	.red
1721
 
-
 
-
 
1758
;--------------------------------------------------------------------
1722
.key:
1759
.key:
1723
	mcall	2
1760
	mcall	2
1724
	jmp	.still
1761
	jmp	.still
1725
 
-
 
-
 
1762
;--------------------------------------------------------------------
1726
.red:
1763
.red:
1727
	call	.window
1764
	call	.window
1728
	jmp	.still
1765
	jmp	.still
1729
 
-
 
-
 
1766
;--------------------------------------------------------------------
1730
.window:
1767
.window:
1731
	pushad
1768
	pushad
1732
	mcall	12,1
1769
	mcall	12,1
1733
	mcall	0,50*65536+320,0x70*65536+240,0x13000000,,help_but_text
1770
	mcall	0,50*65536+320,0x70*65536+240,0x13000000,,help_but_text
1734
	mcall	8,<130,20>,<6,12>,2,0xaaaaaa
1771
	mcall	8,<130,20>,<6,12>,2,0xaaaaaa
Line 1751... Line 1788...
1751
	dec	edi
1788
	dec	edi
1752
	jnz	@b
1789
	jnz	@b
1753
	mcall	12,2
1790
	mcall	12,2
1754
	popad
1791
	popad
1755
	ret
1792
	ret
1756
 
-
 
-
 
1793
;--------------------------------------------------------------------
1757
.threat_stack:	times	16	dd	0
1794
.threat_stack:	times	16	dd	0
1758
;-------------------------------------------------
1795
;--------------------------------------------------------------------
1759
 
-
 
1760
open_file:
1796
open_file:
1761
	mov	[func_70.func_n],5
1797
	mov	[func_70.func_n],5
1762
	mov	[func_70.param1],0
1798
	mov	[func_70.param1],0
1763
	mov	[func_70.param2],0
1799
	mov	[func_70.param2],0
1764
	mov	[func_70.param3],0
1800
	mov	[func_70.param3],0
Line 1769... Line 1805...
1769
 
1805
 
1770
	test	al,al	;ä ©« ­ ©¤¥­?
1806
	test	al,al	;ä ©« ­ ©¤¥­?
1771
	jz	@f
1807
	jz	@f
1772
	mcall	4,400*65536+31,0x80CC0000,error_open_file_string
1808
	mcall	4,400*65536+31,0x80CC0000,error_open_file_string
-
 
1809
	jmp	open_file
1773
	jmp	open_file
1810
;--------------------------------------------------------------------
1774
@@:
1811
@@:
1775
;	mov	edx,[blocks_counter]
1812
;	mov	edx,[blocks_counter]
1776
;	mov	edi,[blocks_table]
1813
;	mov	edi,[blocks_table]
1777
;	@@:	mov	ecx,[edi]	;¢ë᢮¡®¦¤ ¥¬:
1814
;	@@:	mov	ecx,[edi]	;¢ë᢮¡®¦¤ ¥¬:
Line 1870... Line 1907...
1870
@@:
1907
@@:
1871
	cmp	byte [esi],0
1908
	cmp	byte [esi],0
1872
	je	@f
1909
	je	@f
1873
	movsb
1910
	movsb
1874
	jmp	@b
1911
	jmp	@b
-
 
1912
;--------------------------------------
1875
@@:
1913
@@:
1876
	mov	byte [edi],0
1914
	mov	byte [edi],0
1877
	sub	esi,path
1915
	sub	esi,path
1878
	mov	[edit1.size],esi
1916
	mov	[edit1.size],esi
1879
	mov	[edit1.pos],esi
1917
	mov	[edit1.pos],esi
Line 1942... Line 1980...
1942
	jnc	@f
1980
	jnc	@f
1943
	push	dword Option_boxs2
1981
	push	dword Option_boxs2
1944
	call	[option_box_draw]
1982
	call	[option_box_draw]
1945
@@:
1983
@@:
1946
	jmp	.1
1984
	jmp	.1
1947
 
-
 
-
 
1985
;--------------------------------------------------------------------
1948
.mouse:
1986
.mouse:
1949
	bt	[flags],2
1987
	bt	[flags],2
1950
	jnc	@f
1988
	jnc	@f
1951
	push	dword Option_boxs
1989
	push	dword Option_boxs
1952
	call	[option_box_mouse]
1990
	call	[option_box_mouse]
Line 1955... Line 1993...
1955
	jnc	@f
1993
	jnc	@f
1956
	push	dword Option_boxs2
1994
	push	dword Option_boxs2
1957
	call	[option_box_mouse]
1995
	call	[option_box_mouse]
1958
@@:
1996
@@:
1959
	jmp	.2
1997
	jmp	.2
1960
 
-
 
-
 
1998
;--------------------------------------------------------------------
1961
.keys:
1999
.keys:
1962
	mcall	2
2000
	mcall	2
1963
	cmp	ah,13
2001
	cmp	ah,13
1964
	je	.4
2002
	je	.4
1965
	cmp	ah,27
2003
	cmp	ah,27
Line 1974... Line 2012...
1974
	mov	edx,[option_group1]
2012
	mov	edx,[option_group1]
1975
	cmp	edx,op1
2013
	cmp	edx,op1
1976
	jne	@f
2014
	jne	@f
1977
	mov	edx,op2
2015
	mov	edx,op2
1978
	jmp	.eb1_2
2016
	jmp	.eb1_2
-
 
2017
;--------------------------------------
1979
@@:
2018
@@:
1980
	cmp	edx,op2
2019
	cmp	edx,op2
1981
	jne	@f
2020
	jne	@f
1982
	mov	edx,op3
2021
	mov	edx,op3
1983
	jmp	.eb1_2
2022
	jmp	.eb1_2
-
 
2023
;--------------------------------------
1984
@@:
2024
@@:
1985
	mov	edx,op1
2025
	mov	edx,op1
1986
.eb1_2:
2026
.eb1_2:
1987
	mov	[option_group1],edx
2027
	mov	[option_group1],edx
1988
	pop	edx
2028
	pop	edx
1989
	jmp	.1
2029
	jmp	.1
-
 
2030
;--------------------------------------
1990
.eb1_1:
2031
.eb1_1:
1991
	cmp	ah,48
2032
	cmp	ah,48
1992
	jb	.eb1_3
2033
	jb	.eb1_3
1993
	cmp	ah,57
2034
	cmp	ah,57
1994
	jbe	.eb
2035
	jbe	.eb
Line 2009... Line 2050...
2009
	dec	[edit2.shift+4]
2050
	dec	[edit2.shift+4]
Line 2010... Line 2051...
2010
 
2051
 
2011
	push	dword [ed_box_data+4];	[esp]
2052
	push	dword [ed_box_data+4];	[esp]
2012
	call	[edit_box_draw]
2053
	call	[edit_box_draw]
2013
	jmp	.2
-
 
-
 
2054
	jmp	.2
2014
 
2055
;--------------------------------------
2015
.eb2:
2056
.eb2:
2016
	bt	[flags],3
2057
	bt	[flags],3
2017
	jnc	.eb3
2058
	jnc	.eb3
2018
	cmp	ah,9
2059
	cmp	ah,9
Line 2021... Line 2062...
2021
	mov	edx,[option_group2]
2062
	mov	edx,[option_group2]
2022
	cmp	edx,op11
2063
	cmp	edx,op11
2023
	jne	@f
2064
	jne	@f
2024
	mov	edx,op12
2065
	mov	edx,op12
2025
	jmp	.eb2_1
2066
	jmp	.eb2_1
-
 
2067
;--------------------------------------
2026
@@:
2068
@@:
2027
	mov	edx,op11
2069
	mov	edx,op11
2028
.eb2_1:
2070
.eb2_1:
2029
	mov	[option_group2],edx
2071
	mov	[option_group2],edx
2030
	pop	edx
2072
	pop	edx
2031
	jmp	.1
2073
	jmp	.1
-
 
2074
;--------------------------------------
2032
.eb2_2:
2075
.eb2_2:
2033
	cmp	ah,182
2076
	cmp	ah,182
2034
	je	.eb
2077
	je	.eb
2035
	cmp	ah,8
2078
	cmp	ah,8
2036
	je	.eb
2079
	je	.eb
Line 2053... Line 2096...
2053
	dec	[edit3.shift]
2096
	dec	[edit3.shift]
2054
	dec	[edit3.shift+4]
2097
	dec	[edit3.shift+4]
2055
	push	dword [ed_box_data+4];[esp]
2098
	push	dword [ed_box_data+4];[esp]
2056
	call	[edit_box_draw]
2099
	call	[edit_box_draw]
2057
	jmp	.2
2100
	jmp	.2
-
 
2101
;--------------------------------------
2058
.eb3:
2102
.eb3:
2059
	bt	[flags],9
2103
	bt	[flags],9
2060
	jnc	.eb
2104
	jnc	.eb
2061
	cmp	ah,9
2105
	cmp	ah,9
2062
	je	.eb3_1
2106
	je	.eb3_1
Line 2083... Line 2127...
2083
	jz	@f
2127
	jz	@f
2084
	pop	edx
2128
	pop	edx
2085
	dec	[edit4.shift]
2129
	dec	[edit4.shift]
2086
	dec	[edit4.shift+4]
2130
	dec	[edit4.shift+4]
2087
	jmp	.2
2131
	jmp	.2
-
 
2132
;--------------------------------------
2088
@@:
2133
@@:
2089
	pop	edx
2134
	pop	edx
2090
	dec	[edit5.shift]
2135
	dec	[edit5.shift]
2091
	dec	[edit5.shift+4]
2136
	dec	[edit5.shift+4]
2092
	jmp	.2
2137
	jmp	.2
-
 
2138
;--------------------------------------
2093
.eb3_1:
2139
.eb3_1:
2094
	push	edx
2140
	push	edx
2095
	mov	edx,[edit4.flags]
2141
	mov	edx,[edit4.flags]
2096
	and	edx,2
2142
	and	edx,2
2097
	jz	@f
2143
	jz	@f
2098
	pop	edx
2144
	pop	edx
2099
	mov	[edit5.flags],2
2145
	mov	[edit5.flags],2
2100
	mov	[edit4.flags],0
2146
	mov	[edit4.flags],0
2101
	jmp	.eb3_2
2147
	jmp	.eb3_2
-
 
2148
;--------------------------------------
2102
@@:
2149
@@:
2103
	pop	edx
2150
	pop	edx
2104
	mov	[edit4.flags],2
2151
	mov	[edit4.flags],2
2105
	mov	[edit5.flags],0
2152
	mov	[edit5.flags],0
2106
.eb3_2:
2153
.eb3_2:
2107
	push	dword [ed_box_data+4]
2154
	push	dword [ed_box_data+4]
2108
	call	[edit_box_key]
2155
	call	[edit_box_key]
2109
	push	dword [ed_box_data+8]
2156
	push	dword [ed_box_data+8]
2110
	call	[edit_box_key]
2157
	call	[edit_box_key]
2111
	jmp	.1
2158
	jmp	.1
2112
 
-
 
-
 
2159
;--------------------------------------
2113
.eb:
2160
.eb:
2114
	push	dword [ed_box_data+4];[esp]
2161
	push	dword [ed_box_data+4];[esp]
2115
	call	[edit_box_key]
2162
	call	[edit_box_key]
2116
	jmp	.2
2163
	jmp	.2
2117
 
-
 
-
 
2164
;--------------------------------------------------------------------
2118
.button:
2165
.button:
2119
	mcall	17
2166
	mcall	17
2120
	cmp	ah,1
2167
	cmp	ah,1
2121
	jne	.2
2168
	jne	.2
2122
	jmp	close_prog
2169
	jmp	close_prog
Line 2126... Line 2173...
2126
	add	esp,4
2173
	add	esp,4
2127
	jmp	redraw_all
2174
	jmp	redraw_all
2128
.4:
2175
.4:
2129
	mcall	13,180*65536+220,25*65536+70,frgrd_color
2176
	mcall	13,180*65536+220,25*65536+70,frgrd_color
2130
	ret
2177
	ret
2131
 
-
 
2132
 
-
 
2133
;-------------------------------------------------
-
 
2134
;-------------------------------------------------
-
 
2135
;-------------------------------------------------
2178
;--------------------------------------------------------------------
2136
 
-
 
2137
strtohex:
2179
strtohex:
2138
;enter: edi - pointer to string,ebx - pointer to size of string; exit: eax in hex
2180
;enter: edi - pointer to string,ebx - pointer to size of string; exit: eax in hex
2139
	mov	esi,hex8_string
2181
	mov	esi,hex8_string
2140
@@:
2182
@@:
2141
	mov	ah,[edi+ecx-1]	;®¡à ¡®âª  ¢¢¥¤ñ­­ëå ᨬ¢®«®¢
2183
	mov	ah,[edi+ecx-1]	;®¡à ¡®âª  ¢¢¥¤ñ­­ëå ᨬ¢®«®¢
Line 2198... Line 2240...
2198
	sub	eax,edx
2240
	sub	eax,edx
2199
	shl	eax,1
2241
	shl	eax,1
2200
	inc	eax
2242
	inc	eax
2201
	mov	[cursor],eax
2243
	mov	[cursor],eax
2202
	jmp	.end
2244
	jmp	.end
2203
 
-
 
-
 
2245
;--------------------------------------------------------------------
2204
.back:
2246
.back:
2205
	cmp	eax,[current_offset]	;back
2247
	cmp	eax,[current_offset]	;back
2206
	jg	Ctrl_G
2248
	jg	Ctrl_G
2207
	mov	edi,[screen_table]
2249
	mov	edi,[screen_table]
2208
	mov	edi,[edi]
2250
	mov	edi,[edi]
Line 2219... Line 2261...
2219
	mov	edx,ebx
2261
	mov	edx,ebx
2220
	shl	edx,1
2262
	shl	edx,1
2221
	inc	edx
2263
	inc	edx
2222
	mov	[cursor],edx
2264
	mov	[cursor],edx
2223
	jmp	.end
2265
	jmp	.end
-
 
2266
;--------------------------------------------------------------------
2224
.abs:
2267
.abs:
2225
	mov	esi,[screen_table]
2268
	mov	esi,[screen_table]
2226
	mov	esi,[esi]
2269
	mov	esi,[esi]
2227
	xor	ebx,ebx
2270
	xor	ebx,ebx
2228
.3:
2271
.3:
Line 2237... Line 2280...
2237
	shl	eax,1
2280
	shl	eax,1
2238
	inc	eax
2281
	inc	eax
2239
	mov	[cursor],eax
2282
	mov	[cursor],eax
2240
.end:
2283
.end:
2241
	jmp	red
2284
	jmp	red
2242
 
-
 
-
 
2285
;--------------------------------------------------------------------
2243
Ctrl_B:
2286
Ctrl_B:
2244
	bts	[flags],9
2287
	bts	[flags],9
2245
	mov	dword [ed_box_data],2
2288
	mov	dword [ed_box_data],2
2246
	mov	dword [ed_box_data+4],edit4
2289
	mov	dword [ed_box_data+4],edit4
2247
	mov	dword [ed_box_data+8],edit5
2290
	mov	dword [ed_box_data+8],edit5
Line 2273... Line 2316...
2273
 
2316
 
2274
	cmp	eax,[file_size]
2317
	cmp	eax,[file_size]
2275
	jb	@f
2318
	jb	@f
2276
	pop	eax
2319
	pop	eax
-
 
2320
	jmp	Ctrl_B
2277
	jmp	Ctrl_B
2321
 
2278
@@:
2322
@@:
2279
	pop	[shblock_beg]
2323
	pop	[shblock_beg]
2280
	cmp	eax,[shblock_beg]
2324
	cmp	eax,[shblock_beg]
2281
	jae	@f
2325
	jae	@f
2282
	xchg	eax,[shblock_beg]
2326
	xchg	eax,[shblock_beg]
2283
@@:
2327
@@:
2284
	mov	[shblock_end],eax
2328
	mov	[shblock_end],eax
2285
	bts	[flags],8
2329
	bts	[flags],8
2286
.end:
2330
.end:
2287
	jmp	red
-
 
-
 
2331
	jmp	red
2288
 
2332
;--------------------------------------------------------------------
2289
Ctrl_F:
2333
Ctrl_F:
2290
	bts	[flags],3
2334
	bts	[flags],3
2291
	mov	dword [ed_box_data],1
2335
	mov	dword [ed_box_data],1
2292
	mov	dword [ed_box_data+4],edit3
2336
	mov	dword [ed_box_data+4],edit3
Line 2340... Line 2384...
2340
	jg	.end
2384
	jg	.end
2341
	cmpsb
2385
	cmpsb
2342
	je	.8
2386
	je	.8
2343
	mov	edi,find_string
2387
	mov	edi,find_string
2344
	jmp	.5
2388
	jmp	.5
-
 
2389
;--------------------------------------
2345
.8:
2390
.8:
2346
	loop	@b
2391
	loop	@b
2347
	sub	esi,[file_buffer]
2392
	sub	esi,[file_buffer]
2348
	mov	ecx,[edit3.size]
2393
	mov	ecx,[edit3.size]
2349
	cmp	edx,op11
2394
	cmp	edx,op11
Line 2375... Line 2420...
2375
	pop	dword [eax+4]
2420
	pop	dword [eax+4]
2376
	pop	dword [eax]
2421
	pop	dword [eax]
2377
	btr	[flags],0
2422
	btr	[flags],0
2378
@@:
2423
@@:
2379
	jmp	red
2424
	jmp	red
2380
 
-
 
-
 
2425
;--------------------------------------------------------------------
2381
invert_byte:
2426
invert_byte:
2382
	mov	ebx,[current_offset]
2427
	mov	ebx,[current_offset]
2383
	cmp	ebx,[file_size]
2428
	cmp	ebx,[file_size]
2384
	jae	still
2429
	jae	still
2385
	add	ebx,[file_buffer]
2430
	add	ebx,[file_buffer]
2386
	not	byte [ebx]
2431
	not	byte [ebx]
2387
	jmp	red
2432
	jmp	red
2388
 
-
 
2389
 
-
 
-
 
2433
;--------------------------------------------------------------------
2390
Insert:	;¯¥à¥ª«î祭¨¥	०¨¬ 	¢áâ ¢ª¨/§ ¬¥­ë
2434
Insert:	;¯¥à¥ª«î祭¨¥	०¨¬ 	¢áâ ¢ª¨/§ ¬¥­ë
2391
	btc	[flags],1	;not [insert_mod]
2435
	btc	[flags],1	;not [insert_mod]
2392
	call	show_insert
2436
	call	show_insert
2393
	jmp	red
2437
	jmp	red
2394
 
-
 
2395
 
-
 
-
 
2438
;--------------------------------------------------------------------
2396
DEL:
2439
DEL:
2397
	bt	[flags],1
2440
	bt	[flags],1
2398
	jnc	still
2441
	jnc	still
2399
	mov	edi,[current_offset]
2442
	mov	edi,[current_offset]
2400
	mov	esi,[file_buffer]
2443
	mov	esi,[file_buffer]
Line 2420... Line 2463...
2420
	jmp	@b
2463
	jmp	@b
2421
@@:
2464
@@:
2422
	dec	[file_size]
2465
	dec	[file_size]
2423
	call	show_file_size
2466
	call	show_file_size
2424
	jmp	red
2467
	jmp	red
2425
 
-
 
2426
 
-
 
-
 
2468
;--------------------------------------------------------------------
2427
BackSpace:
2469
BackSpace:
2428
	bt	[flags],1	;cmp [insert_mod],0
2470
	bt	[flags],1	;cmp [insert_mod],0
2429
	jnc	still	;je still
2471
	jnc	still	;je still
2430
	mov	edi,[current_offset]
2472
	mov	edi,[current_offset]
2431
	mov	esi,[file_buffer]
2473
	mov	esi,[file_buffer]
Line 2446... Line 2488...
2446
	jge	@f
2488
	jge	@f
2447
	mov	al,[edi+esi]
2489
	mov	al,[edi+esi]
2448
	mov	[edi+esi-1],al
2490
	mov	[edi+esi-1],al
2449
	inc	edi
2491
	inc	edi
2450
	jmp	@b
2492
	jmp	@b
-
 
2493
;--------------------------------------
2451
@@:
2494
@@:
2452
	dec	[file_size]
2495
	dec	[file_size]
2453
	call	show_file_size
2496
	call	show_file_size
2454
	jmp	red
2497
	jmp	red
2455
 
-
 
2456
 
-
 
-
 
2498
;--------------------------------------------------------------------
2457
Ctrl_UP:
2499
Ctrl_UP:
2458
	cmp	[begin_offset],0
2500
	cmp	[begin_offset],0
2459
	je	@f
2501
	je	@f
2460
	mov	eax,[bytes_per_line]
2502
	mov	eax,[bytes_per_line]
2461
	sub	[begin_offset],eax
2503
	sub	[begin_offset],eax
2462
@@:
2504
@@:
2463
	ret
2505
	ret
2464
 
-
 
2465
 
-
 
-
 
2506
;--------------------------------------------------------------------
2466
Ctrl_DOWN:
2507
Ctrl_DOWN:
2467
	mov	eax,[cursor]
2508
	mov	eax,[cursor]
2468
	dec	eax
2509
	dec	eax
2469
	shr	eax,1
2510
	shr	eax,1
2470
	add	eax,[begin_offset]
2511
	add	eax,[begin_offset]
Line 2473... Line 2514...
2473
	cmp	eax,[file_size]
2514
	cmp	eax,[file_size]
2474
	jge	@f
2515
	jge	@f
2475
	add	[begin_offset],ebx
2516
	add	[begin_offset],ebx
2476
@@:
2517
@@:
2477
	ret
2518
	ret
2478
 
-
 
2479
 
-
 
-
 
2519
;--------------------------------------------------------------------
2480
UP:
2520
UP:
2481
	mov	eax,[current_offset]
2521
	mov	eax,[current_offset]
2482
	cmp	eax,[bytes_per_line]
2522
	cmp	eax,[bytes_per_line]
2483
	jb	still
2523
	jb	still
2484
	mov	eax,[cursor]
2524
	mov	eax,[cursor]
Line 2492... Line 2532...
2492
@@:
2532
@@:
2493
	mov	eax,[bytes_per_line]
2533
	mov	eax,[bytes_per_line]
2494
	shl	ax,1
2534
	shl	ax,1
2495
	sub	[cursor],eax
2535
	sub	[cursor],eax
2496
	jmp	red
2536
	jmp	red
2497
 
-
 
2498
 
-
 
-
 
2537
;--------------------------------------------------------------------
2499
DOWN:	;­ 	áâபã	¢­¨§
2538
DOWN:	;­ 	áâபã	¢­¨§
2500
	mov	eax,[current_offset]
2539
	mov	eax,[current_offset]
2501
	add	eax,[bytes_per_line]
2540
	add	eax,[bytes_per_line]
2502
	bt	[flags],1
2541
	bt	[flags],1
2503
	jnc	@f
2542
	jnc	@f
Line 2519... Line 2558...
2519
	ret
2558
	ret
2520
@@:
2559
@@:
2521
	mov	eax,[bytes_per_line]
2560
	mov	eax,[bytes_per_line]
2522
	add	[begin_offset],eax
2561
	add	[begin_offset],eax
2523
	ret
2562
	ret
2524
 
-
 
2525
 
-
 
-
 
2563
;--------------------------------------------------------------------
2526
LEFT:
2564
LEFT:
2527
	cmp	[cursor],1
2565
	cmp	[cursor],1
2528
	jbe	@f
2566
	jbe	@f
2529
	dec	[cursor]
2567
	dec	[cursor]
2530
	jmp	.end
2568
	jmp	.end
-
 
2569
;--------------------------------------
2531
@@:
2570
@@:
2532
	cmp	[begin_offset],0	;ªãàá®à	­  ¯¥à¢®© áâப¥ ᮠᬥ饭¨¥¬ 0?
2571
	cmp	[begin_offset],0	;ªãàá®à	­  ¯¥à¢®© áâப¥ ᮠᬥ饭¨¥¬ 0?
2533
	jne	@f	;¨­ ç¥ ᬥ頥¬ á ¯à®ªàã⪮© ¢¢¥àå ¢¢¥àå ¨ ¢ ª®­¥æ áâப¨
2572
	jne	@f	;¨­ ç¥ ᬥ頥¬ á ¯à®ªàã⪮© ¢¢¥àå ¢¢¥àå ¨ ¢ ª®­¥æ áâப¨
2534
;	inc	[cursor]
2573
;	inc	[cursor]
2535
	jmp	.end;still	;⮣¤  á⮯
2574
	jmp	.end;still	;⮣¤  á⮯
-
 
2575
;--------------------------------------
2536
@@:
2576
@@:
2537
	mov	eax,[bytes_per_line]
2577
	mov	eax,[bytes_per_line]
2538
	sub	[begin_offset],eax
2578
	sub	[begin_offset],eax
2539
	shl	ax,1
2579
	shl	ax,1
2540
	dec	eax
2580
	dec	eax
2541
	add	[cursor],eax
2581
	add	[cursor],eax
2542
.end:
2582
.end:
2543
	ret
2583
	ret
2544
 
-
 
2545
 
-
 
-
 
2584
;--------------------------------------------------------------------
2546
RIGHT:
2585
RIGHT:
2547
	mov	ecx,[begin_offset]	;¢ëç¨á«ï¥¬ ᬥ饭¨¥ ªãàá®à 
2586
	mov	ecx,[begin_offset]	;¢ëç¨á«ï¥¬ ᬥ饭¨¥ ªãàá®à 
2548
	mov	edx,[cursor]	;¤«ï ¯à®¢¥àª¨ áãé¥á⢮¢ ­¨ï
2587
	mov	edx,[cursor]	;¤«ï ¯à®¢¥àª¨ áãé¥á⢮¢ ­¨ï
2549
	shr	edx,1	;á«¥¤ãî饣® ᨬ¢®« 
2588
	shr	edx,1	;á«¥¤ãî饣® ᨬ¢®« 
2550
	add	ecx,edx
2589
	add	ecx,edx
Line 2561... Line 2600...
2561
	mov	ecx,[begin_offset]
2600
	mov	ecx,[begin_offset]
2562
	cmp	eax,edx	;áà ¢­¥­¨¥ ­  ­¨¦­îî áâபã
2601
	cmp	eax,edx	;áà ¢­¥­¨¥ ­  ­¨¦­îî áâபã
2563
	jbe	@f
2602
	jbe	@f
2564
	inc	[cursor]	;ªãàá®à ¢¯à ¢®
2603
	inc	[cursor]	;ªãàá®à ¢¯à ¢®
2565
	jmp	red
2604
	jmp	red
-
 
2605
;--------------------------------------
2566
@@:
2606
@@:
2567
	mov	ecx,[bytes_per_line]	;ᬥ頥¬áï ­  áâà®çªã ¢­¨§
2607
	mov	ecx,[bytes_per_line]	;ᬥ頥¬áï ­  áâà®çªã ¢­¨§
2568
	add	[begin_offset],ecx	;á ¯à®ªàã⪮©
2608
	add	[begin_offset],ecx	;á ¯à®ªàã⪮©
2569
	shl	cx,1
2609
	shl	cx,1
2570
	dec	cx
2610
	dec	cx
2571
	sub	[cursor],ecx
2611
	sub	[cursor],ecx
2572
	jmp	red
2612
	jmp	red
2573
 
-
 
2574
 
-
 
-
 
2613
;--------------------------------------------------------------------
2575
PGDN:
2614
PGDN:
2576
	mov	edi,[screen_table]
2615
	mov	edi,[screen_table]
2577
	mov	eax,[edi]
2616
	mov	eax,[edi]
2578
	shl	eax,1
2617
	shl	eax,1
2579
	add	eax,[begin_offset]
2618
	add	eax,[begin_offset]
Line 2597... Line 2636...
2597
;	shl	ebx,1
2636
;	shl	ebx,1
2598
;	inc	ebx
2637
;	inc	ebx
2599
;	add	ebx,ecx
2638
;	add	ebx,ecx
2600
;	mov	[cursor],ebx
2639
;	mov	[cursor],ebx
2601
	jmp	red
2640
	jmp	red
2602
 
-
 
2603
 
-
 
-
 
2641
;--------------------------------------------------------------------
2604
PGUP:
2642
PGUP:
2605
	mov	eax,[screen_table]
2643
	mov	eax,[screen_table]
2606
	mov	eax,[eax]
2644
	mov	eax,[eax]
2607
	mov	edx,[begin_offset]
2645
	mov	edx,[begin_offset]
2608
	cmp	eax,edx
2646
	cmp	eax,edx
2609
	jbe	@f
2647
	jbe	@f
2610
	call	Ctrl_HOME
2648
	call	Ctrl_HOME
2611
	jmp	red
2649
	jmp	red
-
 
2650
;--------------------------------------
2612
@@:
2651
@@:
2613
	sub	[begin_offset],eax
2652
	sub	[begin_offset],eax
2614
	jmp	red
2653
	jmp	red
2615
 
-
 
2616
 
-
 
-
 
2654
;--------------------------------------------------------------------
2617
HOME:
2655
HOME:
2618
	mov	eax,[cursor]
2656
	mov	eax,[cursor]
2619
	dec	ax
2657
	dec	ax
2620
	shr	ax,1
2658
	shr	ax,1
2621
	mov	ecx,[bytes_per_line]
2659
	mov	ecx,[bytes_per_line]
Line 2626... Line 2664...
2626
	bt	[cursor],0
2664
	bt	[cursor],0
2627
	jc	@f
2665
	jc	@f
2628
	dec	[cursor]
2666
	dec	[cursor]
2629
@@:
2667
@@:
2630
	ret
2668
	ret
2631
 
-
 
2632
 
-
 
-
 
2669
;--------------------------------------------------------------------
2633
END_:
2670
END_:
2634
	mov	eax,[cursor]
2671
	mov	eax,[cursor]
2635
	dec	ax
2672
	dec	ax
2636
	shr	ax,1
2673
	shr	ax,1
2637
	mov	ecx,[bytes_per_line]
2674
	mov	ecx,[bytes_per_line]
Line 2651... Line 2688...
2651
	test	eax,eax
2688
	test	eax,eax
2652
	jz	red
2689
	jz	red
2653
	dec	eax
2690
	dec	eax
2654
	mov	[cursor],eax
2691
	mov	[cursor],eax
2655
	jmp	red
2692
	jmp	red
2656
 
-
 
2657
 
-
 
-
 
2693
;--------------------------------------------------------------------
2658
Ctrl_HOME:
2694
Ctrl_HOME:
2659
	mov	[begin_offset],0
2695
	mov	[begin_offset],0
2660
	mov	[cursor],1
2696
	mov	[cursor],1
2661
	ret
2697
	ret
2662
 
-
 
2663
 
-
 
-
 
2698
;--------------------------------------------------------------------
2664
Ctrl_END:
2699
Ctrl_END:
2665
	mov	eax,[file_size]
2700
	mov	eax,[file_size]
2666
	mov	ecx,[screen_table]
2701
	mov	ecx,[screen_table]
2667
	mov	ecx,[ecx]
2702
	mov	ecx,[ecx]
2668
	xor	edx,edx
2703
	xor	edx,edx
Line 2685... Line 2720...
2685
@@:
2720
@@:
2686
	dec	edx
2721
	dec	edx
2687
	mov	[begin_offset],eax
2722
	mov	[begin_offset],eax
2688
	mov	[cursor],edx
2723
	mov	[cursor],edx
2689
	jmp	red
2724
	jmp	red
2690
 
-
 
2691
 
-
 
-
 
2725
;--------------------------------------------------------------------
2692
ESC:
2726
ESC:
2693
	btr	[flags],8
2727
	btr	[flags],8
2694
	jmp	red
2728
	jmp	red
2695
 
-
 
-
 
2729
;--------------------------------------------------------------------
2696
copy_to_buf:
2730
copy_to_buf:
2697
	bt	[flags],8
2731
	bt	[flags],8
2698
	jnc	.1
2732
	jnc	.1
2699
	mov	eax,[shblock_end]
2733
	mov	eax,[shblock_end]
2700
	sub	eax,[shblock_beg]
2734
	sub	eax,[shblock_beg]
Line 2711... Line 2745...
2711
	movsb
2745
	movsb
2712
	loop	@b
2746
	loop	@b
2713
	bts	[flags],10
2747
	bts	[flags],10
2714
	xor	eax,eax
2748
	xor	eax,eax
2715
	ret
2749
	ret
-
 
2750
;---------------------------------------------------------------------
2716
.1:
2751
.1:
2717
	or	eax,-1
2752
	or	eax,-1
2718
	ret
2753
	ret
2719
 
-
 
-
 
2754
;--------------------------------------------------------------------
2720
Ctrl_C:
2755
Ctrl_C:
2721
	call	copy_to_buf
2756
	call	copy_to_buf
2722
	jmp	still
2757
	jmp	still
2723
 
-
 
-
 
2758
;--------------------------------------------------------------------
2724
shblock_sz	dd	0
2759
shblock_sz	dd	0
2725
 
-
 
-
 
2760
;--------------------------------------------------------------------
2726
Ctrl_V:
2761
Ctrl_V:
2727
	bt	[flags],10
2762
	bt	[flags],10
2728
	jnc	still
2763
	jnc	still
2729
	bt	[flags],8
2764
	bt	[flags],8
2730
	jnc	.past_kurs
2765
	jnc	.past_kurs
Line 2772... Line 2807...
2772
	mov	eax,[shblock_beg]
2807
	mov	eax,[shblock_beg]
2773
	add	eax,[copy_len]
2808
	add	eax,[copy_len]
2774
	dec	eax
2809
	dec	eax
2775
	mov	[shblock_end],eax
2810
	mov	[shblock_end],eax
2776
	jmp	red
2811
	jmp	red
-
 
2812
;--------------------------------------
2777
.del:
2813
.del:
2778
	dec	ebx
2814
	dec	ebx
2779
	jz	red
2815
	jz	red
2780
	mov	ecx,[file_size]
2816
	mov	ecx,[file_size]
2781
	add	ecx,[file_buffer]
2817
	add	ecx,[file_buffer]
2782
	sub	ecx,edi
2818
	sub	ecx,edi
2783
	mov	esi,edi
2819
	mov	esi,edi
2784
	add	esi,ebx
2820
	add	esi,ebx
2785
	cld
2821
	cld
-
 
2822
@@:
2786
@@:	movsb
2823
	movsb
2787
	loop	@b
2824
	loop	@b
2788
	sub	[file_size],ebx
2825
	sub	[file_size],ebx
2789
	call	raspred_mem
2826
	call	raspred_mem
2790
	mov	eax,[shblock_beg]
2827
	mov	eax,[shblock_beg]
2791
	add	eax,[copy_len]
2828
	add	eax,[copy_len]
2792
	dec	eax
2829
	dec	eax
2793
	mov	[shblock_end],eax
2830
	mov	[shblock_end],eax
2794
	jmp	red
2831
	jmp	red
2795
 
-
 
-
 
2832
;--------------------------------------------------------------------
2796
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬ 
2833
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬ 
2797
.past_kurs:
2834
.past_kurs:
2798
;	bt	[flags],1
2835
;	bt	[flags],1
2799
;	jnc	still
2836
;	jnc	still
2800
;	mov	esi,[file_buffer]
2837
;	mov	esi,[file_buffer]
2801
;	add	esi,[current_offset]
2838
;	add	esi,[current_offset]
2802
;	jmp	red
2839
;	jmp	red
2803
	jmp	still
2840
	jmp	still
2804
 
-
 
-
 
2841
;--------------------------------------------------------------------
2805
Ctrl_X:
2842
Ctrl_X:
2806
	bt	[flags],1
2843
	bt	[flags],1
2807
	jnc	still
2844
	jnc	still
2808
	call	copy_to_buf
2845
	call	copy_to_buf
2809
	test	eax,eax
2846
	test	eax,eax
Line 2847... Line 2884...
2847
	sub	eax,ebx
2884
	sub	eax,ebx
2848
	shl	eax,1
2885
	shl	eax,1
2849
	inc	eax
2886
	inc	eax
2850
	mov	[cursor],eax
2887
	mov	[cursor],eax
2851
	jmp	red
2888
	jmp	red
2852
 
-
 
2853
;---------------------------------------------------------------------
2889
;---------------------------------------------------------------------
2854
open_dialog:
2890
open_dialog:
2855
	mov	[OpenDialog_data.type],0	; Open
2891
	mov	[OpenDialog_data.type],0	; Open
Line 2856... Line 2892...
2856
 
2892
 
Line 2876... Line 2912...
2876
	sub	esi,path
2912
	sub	esi,path
2877
	mov	[edit1.size],esi
2913
	mov	[edit1.size],esi
2878
	mov	[edit1.pos],esi
2914
	mov	[edit1.pos],esi
2879
	jmp	open_file
2915
	jmp	open_file
2880
;---------------------------------------------------------------------
2916
;---------------------------------------------------------------------
2881
 
-
 
2882
;	DATA	AREA
-
 
2883
 
-
 
2884
 
-
 
2885
;---------------------------------------------------------
-
 
2886
;----------------------- DATA AREA------------------------
2917
;----------------------- DATA AREA------------------------
2887
;---------------------------------------------------------
2918
;--------------------------------------------------------------------
2888
align 4
2919
align 4
2889
ProcLib_import:
2920
ProcLib_import:
2890
OpenDialog_Init		dd aOpenDialog_Init
2921
OpenDialog_Init		dd aOpenDialog_Init
2891
OpenDialog_Start	dd aOpenDialog_Start
2922
OpenDialog_Start	dd aOpenDialog_Start
2892
;OpenDialog__Version	dd aOpenDialog_Version
2923
;OpenDialog__Version	dd aOpenDialog_Version
Line 3226... Line 3257...
3226
op_text2:
3257
op_text2:
3227
.11	db 'Hex'
3258
.11	db 'Hex'
3228
.e11:
3259
.e11:
3229
.21	db 'ASCII'
3260
.21	db 'ASCII'
3230
.e21:
3261
.e21:
3231
 
-
 
3232
 
-
 
-
 
3262
;--------------------------------------------------------------------
3233
system_dir_Boxlib			db '/sys/lib/box_lib.obj',0
3263
system_dir_Boxlib			db '/sys/lib/box_lib.obj',0
3234
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
3264
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
Line 3235... Line 3265...
3235
 
3265
 
Line 3288... Line 3318...
3288
;6:	¯®«­ ï	¯¥à¥à¨á®¢ª  ®ª­ 
3318
;6:	¯®«­ ï	¯¥à¥à¨á®¢ª  ®ª­ 
3289
;7:	horizontal_scroll_bar move
3319
;7:	horizontal_scroll_bar move
3290
;8:	1 - ¢ë¤¥«¥­ ¡«®ª
3320
;8:	1 - ¢ë¤¥«¥­ ¡«®ª
3291
;9:	¢ edit_box - ®¡à ¡®âª  Ctrl_B
3321
;9:	¢ edit_box - ®¡à ¡®âª  Ctrl_B
3292
;10:	¢ ¯ ¬ï⨠"¢¨á¨â" ᪮¯¨à®¢ ­­ë© ¡«®ª
3322
;10:	¢ ¯ ¬ï⨠"¢¨á¨â" ᪮¯¨à®¢ ­­ë© ¡«®ª
3293
 
-
 
-
 
3323
;--------------------------------------------------------------------
3294
help_text:
3324
help_text:
3295
if lang eq ru
3325
if lang eq ru
3296
 db 'Ctrl+O              - ®âªàëâì ä ©«                 '
3326
 db 'Ctrl+O              - ®âªàëâì ä ©«                 '
3297
 db 'Ctrl+S              - á®åà ­¨âì                    '
3327
 db 'Ctrl+S              - á®åà ­¨âì                    '
3298
 db 'PageUp, PageDown    - áâà ­¨æ  ¢¢¥àå/¢­¨§          '
3328
 db 'PageUp, PageDown    - áâà ­¨æ  ¢¢¥àå/¢­¨§          '
Line 3336... Line 3366...
3336
 db 'Ctrl+C              - copy area                    '
3366
 db 'Ctrl+C              - copy area                    '
3337
 db 'Ctrl+V              - past into area from buf      '
3367
 db 'Ctrl+V              - past into area from buf      '
3338
 db 'Ctrl+X              - cut area into buffer         '
3368
 db 'Ctrl+X              - cut area into buffer         '
3339
end if
3369
end if
3340
help_end:
3370
help_end:
3341
 
-
 
3342
 
-
 
3343
 
-
 
3344
 
-
 
-
 
3371
;--------------------------------------------------------------------
3345
;align	4096
3372
;align	4096
3346
font_buffer	file 'cp866-8x16'	;ASCII+cp866	(+ð,ñ)
3373
font_buffer	file 'cp866-8x16'	;ASCII+cp866	(+ð,ñ)
3347
cp1251		file 'cp1251-8x16'
3374
cp1251		file 'cp1251-8x16'
3348
koi8_r		file 'koi8-r-8x16'	
3375
koi8_r		file 'koi8-r-8x16'	
Line 3401... Line 3428...
3401
db	0
3428
db	0
Line 3402... Line 3429...
3402
 
3429
 
Line 3403... Line 3430...
3403
start_temp_file_name:	db 'temp.bin',0
3430
start_temp_file_name:	db 'temp.bin',0
3404
 
-
 
3405
;---------------------------------------------------------------------
3431
 
-
 
3432
;---------------------------------------------------------------------
3406
 
3433
I_END:
3407
I_END:
3434
;--------------------------------------------------------------------
3408
file_name:
3435
file_name:
3409
cur_dir_path	rb 4096
3436
cur_dir_path	rb 4096
3410
buf_cmd_lin	rb 0
3437
buf_cmd_lin	rb 0