fixed position of signatures when pressing [f1]

update 'asm' syntax file

git-svn-id: svn://kolibrios.org@6087 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2016-01-21 22:22:11 +00:00
parent 8a4f974d14
commit 44e780f476
4 changed files with 1110 additions and 1263 deletions

View File

@@ -1,6 +1,6 @@
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> box_lib.obj
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TextEditor <20><><EFBFBD> Kolibri OS
; 䠩<> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 20.01.2016 IgorA
; 䠩<> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 21.01.2016 IgorA
; <20><> <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><><EFBFBD><E6A5AD><EFBFBD>
;input:
@@ -106,8 +106,7 @@ KEY_F3 equ 0x0000003D
align 4
proc ted_init, edit:dword
push eax ecx edi
proc ted_init uses eax ecx edi, edit:dword
mov edi,dword[edit]
mov ecx,sizeof.symbol
@@ -130,7 +129,6 @@ proc ted_init, edit:dword
mov ted_syntax_file,eax
stdcall ted_init_scroll_bars,edi,3
pop edi ecx eax
ret
endp
@@ -210,12 +208,10 @@ proc ted_init_scroll_bars, edit:dword, opt:dword
endp
align 4
proc ted_delete, edit:dword
push edi
proc ted_delete uses edi, edit:dword
mov edi,dword[edit]
invoke mem.free,ted_tex
invoke mem.free,ted_arr_key_pos ;ted_syntax_file
pop edi
ret
endp
@@ -529,8 +525,7 @@ endp
;output:
; al = 1 - can save
align 4
proc ted_can_save, edit:dword
push ecx edi
proc ted_can_save uses ecx edi, edit:dword
mov edi,dword[edit]
mov ecx,ted_tim_ch
@@ -540,7 +535,6 @@ proc ted_can_save, edit:dword
jne @f
dec al
@@:
pop edi ecx
ret
endp
@@ -549,8 +543,7 @@ endp
;output:
; al = 1 - selected
align 4
proc ted_is_select
push ebx
proc ted_is_select uses ebx
xor al,al
cmp ted_drag_m,1
je @f
@@ -563,15 +556,13 @@ proc ted_is_select
jne @f
xor al,al
@@:
pop ebx
ret
endp
;input:
; edi = pointer to tedit struct
align 4
proc ted_sel_normalize
push ecx esi
proc ted_sel_normalize uses ecx esi
push edi
mov esi,edi
add esi,ted_offs_sel
@@ -606,7 +597,6 @@ proc ted_sel_normalize
jg .swp_f
.end_f:
pop esi ecx
ret
endp
@@ -615,20 +605,18 @@ endp
;description:
; <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
align 4
proc ted_sel_start
push eax ecx
mov eax,ted_scr_h
mov ecx,ted_cur_x
add ecx,dword[eax+sb_offs_position]
mov ted_sel_x0,ecx
mov ted_sel_x1,ecx
proc ted_sel_start uses eax ecx
mov eax,ted_scr_h
mov ecx,ted_cur_x
add ecx,dword[eax+sb_offs_position]
mov ted_sel_x0,ecx
mov ted_sel_x1,ecx
mov eax,ted_scr_w
mov ecx,ted_cur_y
add ecx,dword[eax+sb_offs_position]
mov ted_sel_y0,ecx
mov ted_sel_y1,ecx
pop ecx eax
mov eax,ted_scr_w
mov ecx,ted_cur_y
add ecx,dword[eax+sb_offs_position]
mov ted_sel_y0,ecx
mov ted_sel_y1,ecx
ret
endp
@@ -682,8 +670,7 @@ endp
;input:
; cl_al_mem = 1 - clear all memory
align 4
proc ted_clear, edit:dword, cl_al_mem:dword
push ecx edi
proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword
mov edi,dword[edit]
mov ted_cur_x,0
@@ -727,7 +714,6 @@ proc ted_clear, edit:dword, cl_al_mem:dword
pop edx
.exit:
pop edi ecx
ret
endp
@@ -1055,30 +1041,30 @@ ted_iterat_next_color_tag:
; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo)
align 4
ted_symbol_not_vis:
push eax
push eax
xor bl,bl
xor bl,bl
cmp dword [edx+14],0
je @f
mov eax,[edx+14] ;eax=tex[i].td
add eax,ted_tim_undo
cmp eax,ted_tim_ch
jg @f
mov bl,1
pop eax
ret
@@:
cmp dword [edx+14],0
je @f
mov eax,[edx+14] ;eax=tex[i].td
add eax,ted_tim_undo
cmp eax,ted_tim_ch
jg @f
mov bl,1
pop eax
ret
@@:
mov eax,ted_tim_ch
sub eax,ted_tim_undo
cmp [edx+10],eax
jle @f
or bl,1
@@:
mov eax,ted_tim_ch
sub eax,ted_tim_undo
cmp [edx+10],eax
jle @f
or bl,1
@@:
pop eax
ret
pop eax
ret
;input:
; text:dword - pointer to text string
@@ -1445,9 +1431,7 @@ endp
;description:
; <20><EFBFBD><E3ADAA><EFBFBD><><E3A4A0><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A5AA>
align 4
proc ted_sel_text_del, del_opt:dword
push ebx ecx edx esi
proc ted_sel_text_del uses ebx ecx edx esi, del_opt:dword
call ted_is_select
cmp al,0
je .end_f
@@ -1494,7 +1478,6 @@ proc ted_sel_text_del, del_opt:dword
mov ted_sel_y1,0
@@:
.end_f:
pop esi edx ecx ebx
ret
endp
@@ -1505,56 +1488,56 @@ endp
; edi = pointer to tedit struct
align 4
ted_revers:
cmp eax,ebx
jne @f
ret
@@:
cmp eax,ebx
jne @f
ret
@@:
push ecx edx
push ecx edx
mov edx,ted_tex_1
cmp edx,ebx ;if(p1==1)p1=tex[1].perv;
jne @f
call ted_get_text_perv_pos
mov ebx,edx
@@:
mov edx,ted_tex_1
cmp edx,ebx ;if(p1==1)p1=tex[1].perv;
jne @f
call ted_get_text_perv_pos
mov ebx,edx
@@:
push esi
mov edx,[eax+2] ; *** edx = tex[p0].perv ***
ConvertIndexToPointer edx
add edx,6
mov ecx,[edx] ;tmp = tex[tex[p0].perv].next;
push esi
mov edx,[eax+2] ; *** edx = tex[p0].perv ***
ConvertIndexToPointer edx
add edx,6
mov ecx,[edx] ;tmp = tex[tex[p0].perv].next;
mov esi,[ebx+6] ; *** esi = tex[p1].next ***
ConvertIndexToPointer esi
add esi,2
m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv;
mov esi,[ebx+6] ; *** esi = tex[p1].next ***
ConvertIndexToPointer esi
add esi,2
m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv;
mov [esi],ecx ;tex[tex[p1].next].perv = tmp;
pop esi
mov [esi],ecx ;tex[tex[p1].next].perv = tmp;
pop esi
mov ecx,[eax+2] ;tmp = tex[p0].perv;
m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next;
mov [ebx+6],ecx ;tex[p1].next = tmp;
mov ecx,[eax+2] ;tmp = tex[p0].perv;
m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next;
mov [ebx+6],ecx ;tex[p1].next = tmp;
mov edx,eax ;i=p0;
@@:
mov ecx,[edx+6] ;tmp = tex[i].next;
m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv;
mov [edx+2],ecx ;tex[i].perv = tmp;
cmp edx,ebx ;if(i==p1)break;
je @f
mov edx,eax ;i=p0;
@@:
mov ecx,[edx+6] ;tmp = tex[i].next;
m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv;
mov [edx+2],ecx ;tex[i].perv = tmp;
cmp edx,ebx ;if(i==p1)break;
je @f
; ---
;cmp edx,ted_tex
;je @f
; ---
mov edx,ecx ;i = tmp;
ConvertIndexToPointer edx
jmp @b
@@:
pop edx ecx
call ted_text_colored
ret
mov edx,ecx ;i = tmp;
ConvertIndexToPointer edx
jmp @b
@@:
pop edx ecx
call ted_text_colored
ret
;input:
@@ -1975,22 +1958,22 @@ ted_get_text_coords:
; eax = num lines
align 4
ted_get_num_lines:
push edx
mov eax,1
mov edx,ted_tex
@@:
call ted_iterat_next
cmp edx,ted_tex_1
jle @f
cmp byte [edx],13
jne @b
inc eax
jmp @b
@@:
push edx
mov eax,1
mov edx,ted_tex
@@:
call ted_iterat_next
cmp edx,ted_tex_1
jle @f
cmp byte [edx],13
jne @b
inc eax
jmp @b
@@:
;...
;dec eax
pop edx
ret
pop edx
ret
;input:
@@ -2455,8 +2438,7 @@ endp
; eax = <20><><EFBFBD> <20><EFBFBD><E8A8A1>
; ebx = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD> <20><><EFBFBD><EFBFBD>
align 4
proc ted_open_file, edit:dword, file:dword, f_name:dword ;<3B><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
push ecx edx edi
proc ted_open_file uses ecx edx edi, edit:dword, file:dword, f_name:dword ;<3B><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
mov edi,dword[edit]
; *** <20><EFBFBD><E0AEA2>塞 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><20><> 墠⠥<E5A2A0> <20><><><E3A2A5><EFBFBD><E7A8A2><EFBFBD> ***
@@ -2527,7 +2509,6 @@ proc ted_open_file, edit:dword, file:dword, f_name:dword ;
;if open file
call ted_on_open_file
.ret_f:
pop edi edx ecx
ret
endp
@@ -2564,8 +2545,7 @@ proc ted_but_select_word, edit:dword
endp
align 4
proc ted_but_cut, edit:dword
push edi
proc ted_but_cut uses edi, edit:dword
mov edi,dword[edit]
stdcall ted_but_copy,edi
@@ -2579,7 +2559,6 @@ proc ted_but_cut, edit:dword
je @f
call ted_fun_draw_panel_buttons
@@:
pop edi
ret
endp
@@ -2754,41 +2733,38 @@ proc ted_but_sumb_lover uses edi esi, edit:dword
endp
align 4
proc ted_but_reverse, edit:dword
push eax ebx edi
mov edi,dword[edit]
proc ted_but_reverse uses eax ebx edi, edit:dword
mov edi,dword[edit]
call ted_is_select
cmp al,0
je @f
call ted_sel_normalize
push esi ecx edx
mov esi,ted_seln_x0
mov ecx,ted_seln_y0
call ted_get_pos_by_coords
mov eax,edx
mov esi,ted_seln_x1
cmp esi,0
je .beg_str
dec esi
.beg_str:
mov ecx,ted_seln_y1
call ted_get_pos_by_coords
;call ted_get_text_perv_pos
mov ebx,edx
pop edx ecx esi
;cmp eax,...
;je @f
call ted_revers
@@:
stdcall ted_draw,edi
pop edi ebx eax
ret
call ted_is_select
cmp al,0
je @f
call ted_sel_normalize
push esi ecx edx
mov esi,ted_seln_x0
mov ecx,ted_seln_y0
call ted_get_pos_by_coords
mov eax,edx
mov esi,ted_seln_x1
cmp esi,0
je .beg_str
dec esi
.beg_str:
mov ecx,ted_seln_y1
call ted_get_pos_by_coords
;call ted_get_text_perv_pos
mov ebx,edx
pop edx ecx esi
;cmp eax,...
;je @f
call ted_revers
@@:
stdcall ted_draw,edi
ret
endp
align 4
proc ted_but_undo, edit:dword
push eax edi
proc ted_but_undo uses eax edi, edit:dword
mov edi,dword[edit]
mov eax,ted_tim_undo
@@ -2801,13 +2777,11 @@ proc ted_but_undo, edit:dword
je @f
call ted_fun_draw_panel_buttons
@@:
pop edi eax
ret
endp
align 4
proc ted_but_redo, edit:dword
push edi
proc ted_but_redo uses edi, edit:dword
mov edi,dword[edit]
cmp ted_tim_undo,1
@@ -2819,7 +2793,6 @@ proc ted_but_redo, edit:dword
je @f
call ted_fun_draw_panel_buttons
@@:
pop edi
ret
endp
@@ -3264,18 +3237,16 @@ proc ted_draw, edit:dword
mov dword[esi+sb_offs_all_redraw],0
;---------------------------------------------
;left-bottom square
mov ebx,ted_wnd_l
shl ebx,16
add ebx,ted_rec_l
mov ecx,ted_wnd_t
add ecx,ted_wnd_h
shl ecx,16
mov cx,word[eax+sb_offs_size_y]
inc cx
mov edx,ted_color_wnd_capt ;[sc.work]
mov eax,13
int 0x40
;left-bottom square
mov ebx,ted_wnd_l
shl ebx,16
add ebx,ted_rec_l
mov ecx,ted_wnd_t
add ecx,ted_wnd_h
shl ecx,16
mov cx,word[eax+sb_offs_size_y]
inc cx
mcall 13,,,ted_color_wnd_capt ;[sc.work]
;right-bottom square
mov ebx,ted_wnd_l
@@ -3479,7 +3450,7 @@ proc ted_draw_help_f1
pushad
cmp ted_rec_t,13 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0A2>
jle @f
mov eax,13 ;clear place before draw help
;clear place before draw help
mov ebx,ted_wnd_l
add ebx,ted_rec_l
shl ebx,16
@@ -3489,8 +3460,7 @@ proc ted_draw_help_f1
add ecx,13
shl ecx,16
add ecx,ted_rec_h
mov edx,ted_color_wnd_capt
int 0x40
mcall 13,,,ted_color_wnd_capt
cmp ted_help_id,-1
je @f
@@ -3513,11 +3483,12 @@ proc ted_draw_help_f1
mov ecx,dword[ecx]
or ecx,0xc0000000 ;SetTextStyles
mov esi,edi
mov edi,ted_color_wnd_work
mov eax,4
int 0x40
mcall 4,,,,,ted_color_wnd_work
mov edi,esi
mov esi,edx
call tl_strlen
;*** draw help string ***
mov ecx,ted_color_wnd_bord
or ecx,0x80000000
@@ -3525,8 +3496,11 @@ proc ted_draw_help_f1
cmp edx,0
je @f
add edx,ted_help_text_f1
add ebx,0x500000
int 0x40
inc eax
imul eax,6 ;<3B><><EFBFBD><><E1A8AC><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shl eax,16
add ebx,eax
mcall 4
@@:
popad
ret
@@ -4062,42 +4036,42 @@ ted_wnd_main_click:
mov ebx,ted_el_focus
mov dword[ebx],edi ;<3B><EFBFBD><E2A0A2><><E4AEAA>
push eax
shr eax,16
and eax,0xffff
sub eax,ted_wnd_l
sub eax,ted_rec_l
push eax
shr eax,16
and eax,0xffff
sub eax,ted_wnd_l
sub eax,ted_rec_l
xor edx,edx
mov ecx,ted_rec_w
div cx
;inc eax
mov ebx,ted_scr_h
cmp eax,dword[ebx+sb_offs_cur_area]
jle @f
mov eax,dword[ebx+sb_offs_cur_area]
@@:
;dec eax
mov ted_cur_x,eax
pop eax
xor edx,edx
mov ecx,ted_rec_w
div cx
;inc eax
mov ebx,ted_scr_h
cmp eax,dword[ebx+sb_offs_cur_area]
jle @f
mov eax,dword[ebx+sb_offs_cur_area]
@@:
;dec eax
mov ted_cur_x,eax
pop eax
push eax
and eax,0xffff
sub eax,ted_wnd_t
sub eax,ted_rec_t
push eax
and eax,0xffff
sub eax,ted_wnd_t
sub eax,ted_rec_t
xor edx,edx
mov ecx,ted_rec_h
div cx
inc eax
mov ebx,ted_scr_w
cmp eax,dword[ebx+sb_offs_cur_area]
jle @f
mov eax,dword[ebx+sb_offs_cur_area]
@@:
dec eax
mov ted_cur_y,eax
pop eax
xor edx,edx
mov ecx,ted_rec_h
div cx
inc eax
mov ebx,ted_scr_w
cmp eax,dword[ebx+sb_offs_cur_area]
jle @f
mov eax,dword[ebx+sb_offs_cur_area]
@@:
dec eax
mov ted_cur_y,eax
pop eax
cmp ted_drag_m,0
je @f