Subversion Repositories Kolibri OS

Rev

Rev 7579 | Rev 7877 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7579 Rev 7583
Line 720... Line 720...
720
	@@:
720
	@@:
721
		mov byte [edx],0
721
		mov byte [edx],0
722
		inc edx
722
		inc edx
723
	loop @b
723
	loop @b
724
	mov edx,ted_tex
724
	mov edx,ted_tex
725
	mov dword [edx+6],1
725
	mov dword [edx+symbol.next],1
726
	pop edx
726
	pop edx
Line 727... Line 727...
727
 
727
 
728
	.exit:
728
	.exit:
729
	ret
729
	ret
Line 831... Line 831...
831
	mov edx,ted_tex
831
	mov edx,ted_tex
832
	add edx,ebx
832
	add edx,ebx
833
	push ebx
833
	push ebx
834
	@@:
834
	@@:
835
		mov ebx,[edx]
835
		mov ebx,[edx]
836
		mov byte [eax],bl
836
		mov byte[eax],bl
837
		mov dword [eax+2],ecx
837
		mov dword[eax+symbol.perv],ecx
838
		inc dword [eax+2]
838
		inc dword[eax+symbol.perv]
839
		mov dword [eax+6],ecx
839
		mov dword[eax+symbol.next],ecx
840
		add dword [eax+6],3
840
		add dword[eax+symbol.next],3
841
		;mov byte[eax+1],0 ;col=0
841
		;mov byte[eax+1],0 ;col=0
842
		mov dword [eax+10],-1 ;tc=-1
842
		mov dword[eax+symbol.tc],-1
843
		mov dword [eax+14],0 ;td=0
843
		mov dword[eax+symbol.td],0
Line 844... Line 844...
844
 
844
 
845
		cmp ecx,0
845
		cmp ecx,0
846
		je @f
846
		je @f
847
		dec ecx
847
		dec ecx
848
		dec edx
848
		dec edx
849
		sub eax,sizeof.symbol
849
		sub eax,sizeof.symbol
850
		jmp @b
850
		jmp @b
851
	@@:
851
	@@:
852
	pop ebx
-
 
853
	add eax,2
852
	pop ebx
Line 854... Line 853...
854
	mov dword [eax],0 ; first sumbol 'perv=0'
853
	mov dword[eax+symbol.perv],0 ; first sumbol 'perv=0'
855
 
854
 
856
	mov edx,ted_tex ; ­ áâனª¨ ­ ç «ì­®£® á«ã¦¥¡­®£® ᨬ¢®« 
855
	mov edx,ted_tex ; ­ áâனª¨ ­ ç «ì­®£® á«ã¦¥¡­®£® ᨬ¢®« 
857
	; begining sumbol 'perv=0' 'next=2'
856
	; begining sumbol 'perv=0' 'next=2'
Line 858... Line 857...
858
	mov dword [edx+2],0
857
	mov dword[edx+symbol.perv],0
859
	mov dword [edx+6],2
858
	mov dword[edx+symbol.next],2
860
 
859
 
861
	add edx,sizeof.symbol ; ­ áâனª¨ ª®­¥ç­®£® á«ã¦¥¡­®£® ᨬ¢®« 
860
	add edx,sizeof.symbol ; ­ áâனª¨ ª®­¥ç­®£® á«ã¦¥¡­®£® ᨬ¢®« 
862
	mov dword [edx+6],0 ; last sumbol 'next=0'
861
	mov dword[edx+symbol.next],0 ; last sumbol 'next=0'
Line 863... Line 862...
863
	mov dword [edx+2],ebx ; last sumbol 'perv=last'
862
	mov dword[edx+symbol.perv],ebx ; last sumbol 'perv=last'
864
	inc dword [edx+2]
863
	inc dword[edx+symbol.perv]
865
	mov dword [edx+10],0 ; áâ ¢¨¬ ¢à¥¬ï ᮧ¤ ­¨ï à ¢­®¥ 0, çâ® ¡ë ᨬ¢®« ¯à ¢¨«ì­® ®¡à ¡ â뢠«áï ¯à¨ ®âªàë⨨ ä ©«®¢ ¡®«ìè¨å 28 ¡ ©â
864
	mov dword[edx+symbol.tc],0 ; áâ ¢¨¬ ¢à¥¬ï ᮧ¤ ­¨ï à ¢­®¥ 0, çâ® ¡ë ᨬ¢®« ¯à ¢¨«ì­® ®¡à ¡ â뢠«áï ¯à¨ ®âªàë⨨ ä ©«®¢ ¡®«ìè¨å 28 ¡ ©â
866
 
865
 
867
	mov edx,ebx
866
	mov edx,ebx
Line 868... Line 867...
868
	inc edx ;2 = rezerv sumbols
867
	inc edx ;2 = rezerv sumbols
869
	imul edx,sizeof.symbol
868
	imul edx,sizeof.symbol
870
	add edx,ted_tex
869
	add edx,ted_tex
871
	mov dword [edx+6],1 ; last sumbol 'next=1'
870
	mov dword[edx+symbol.next],1 ; last sumbol 'next=1'
872
 
871
 
873
	@@: ;clear memory, need if before was open big file
872
	@@: ;clear memory, need if before was open big file
874
		add edx,sizeof.symbol
873
		add edx,sizeof.symbol
875
		cmp edx,ted_tex_end
874
		cmp edx,ted_tex_end
Line 876... Line 875...
876
		jge @f
875
		jge @f
877
			mov dword[edx+10],0
876
			mov dword[edx+symbol.tc],0
Line 906... Line 905...
906
ted_iterat_perv:
905
ted_iterat_perv:
907
	cmp ted_tim_undo,0
906
	cmp ted_tim_undo,0
908
	je .else
907
	je .else
909
	push ebx
908
	push ebx
910
	@@:
909
	@@:
911
		mov edx,[edx+2]
910
		mov edx,[edx+symbol.perv]
912
		or edx,edx
911
		or edx,edx
913
		jz @f
912
		jz @f
914
		imul edx,sizeof.symbol
913
		imul edx,sizeof.symbol
915
		add edx,ted_tex
914
		add edx,ted_tex
916
		call ted_symbol_not_vis
915
		call ted_symbol_not_vis
Line 923... Line 922...
923
	@@:
922
	@@:
924
	mov edx,ted_tex ;­ ç «® ä ©« 
923
	mov edx,ted_tex ;­ ç «® ä ©« 
925
	pop ebx
924
	pop ebx
926
	ret
925
	ret
927
	.else:
926
	.else:
928
		mov edx,[edx+2]
927
		mov edx,[edx+symbol.perv]
929
		or edx,edx
928
		or edx,edx
930
		jz @f
929
		jz @f
931
		imul edx,sizeof.symbol
930
		imul edx,sizeof.symbol
932
		add edx,ted_tex
931
		add edx,ted_tex
933
		cmp dword [edx+14],0
932
		cmp dword[edx+symbol.td],0
934
		jne .else
933
		jne .else
935
		cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®«  á ª®¤®¬ 10
934
		cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®«  á ª®¤®¬ 10
936
		je .else
935
		je .else
937
	ret
936
	ret
938
	@@:
937
	@@:
Line 949... Line 948...
949
ted_iterat_next:
948
ted_iterat_next:
950
	cmp ted_tim_undo,0
949
	cmp ted_tim_undo,0
951
	je .else
950
	je .else
952
	push ebx
951
	push ebx
953
	@@:
952
	@@:
954
		mov edx,[edx+6]
953
		mov edx,[edx+symbol.next]
955
		cmp edx,1
954
		cmp edx,1
956
		jle @f
955
		jle @f
957
		imul edx,sizeof.symbol
956
		imul edx,sizeof.symbol
958
		add edx,ted_tex
957
		add edx,ted_tex
Line 967... Line 966...
967
	@@:
966
	@@:
968
	mov edx,ted_tex_1 ;ª®­¥æ ä ©« 
967
	mov edx,ted_tex_1 ;ª®­¥æ ä ©« 
969
	pop ebx
968
	pop ebx
970
	ret
969
	ret
971
	.else:
970
	.else:
972
		mov edx,[edx+6]
971
		mov edx,[edx+symbol.next]
973
		cmp edx,1
972
		cmp edx,1
974
		jle @f
973
		jle @f
975
		imul edx,sizeof.symbol
974
		imul edx,sizeof.symbol
976
		add edx,ted_tex
975
		add edx,ted_tex
Line 977... Line 976...
977
 
976
 
978
		cmp dword [edx+14],0
977
		cmp dword[edx+symbol.td],0
979
		jne .else
978
		jne .else
980
		cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®«  á ª®¤®¬ 10
979
		cmp byte[edx],10 ;¯à®¯ã᪠ᨬ¢®«  á ª®¤®¬ 10
981
		je .else
980
		je .else
982
	ret
981
	ret
Line 1053... Line 1052...
1053
align 16
1052
align 16
1054
ted_symbol_not_vis:
1053
ted_symbol_not_vis:
1055
	push eax
1054
	push eax
Line 1056... Line 1055...
1056
 
1055
 
1057
	xor bl,bl
-
 
1058
 
1056
	xor bl,bl
1059
	cmp dword [edx+14],0
1057
	cmp dword[edx+symbol.td],0
1060
	je @f
1058
	je @f
1061
	mov eax,[edx+14] ;eax=tex[i].td
1059
	mov eax,[edx+symbol.td] ;eax=tex[i].td
1062
	add eax,ted_tim_undo
1060
	add eax,ted_tim_undo
1063
	cmp eax,ted_tim_ch
1061
	cmp eax,ted_tim_ch
1064
	jg @f
1062
	jg @f
1065
		mov bl,1
1063
		mov bl,1
1066
		pop eax
1064
		pop eax
1067
		ret
1065
		ret
Line 1068... Line 1066...
1068
	@@:
1066
	@@:
1069
 
1067
 
1070
	mov eax,ted_tim_ch
1068
	mov eax,ted_tim_ch
1071
	sub eax,ted_tim_undo
1069
	sub eax,ted_tim_undo
1072
	cmp [edx+10],eax
1070
	cmp [edx+symbol.tc],eax
1073
	jle @f
1071
	jle @f
Line 1074... Line 1072...
1074
		or bl,1
1072
		or bl,1
Line 1139... Line 1137...
1139
		pop eax
1137
		pop eax
1140
	@@:
1138
	@@:
Line 1141... Line 1139...
1141
 
1139
 
1142
	mov edx,ted_ptr_free_symb
1140
	mov edx,ted_ptr_free_symb
1143
	.beg_cycle: ;for(i=...;i
1141
	.beg_cycle: ;for(i=...;i
1144
		cmp dword [edx+10],0 ;if(!tex[i].tc && !tex[i].td)
1142
		cmp dword[edx+symbol.tc],0 ;if(!tex[i].tc && !tex[i].td)
1145
		jne .u1f
1143
		jne .u1f
1146
		cmp dword [edx+14],0
1144
		cmp dword[edx+symbol.td],0
1147
		jne .u1f
1145
		jne .u1f
1148
			test dword[add_opt],ted_opt_ed_change_time ;if(n_tim) ted_tim_ch++;
1146
			test dword[add_opt],ted_opt_ed_change_time ;if(n_tim) ted_tim_ch++;
1149
			jz .no_tim
1147
			jz .no_tim
1150
				inc ted_tim_ch
1148
				inc ted_tim_ch
Line 1171... Line 1169...
1171
			not ecx
1169
			not ecx
1172
			and [add_opt],ecx ;n_tim=false;
1170
			and [add_opt],ecx ;n_tim=false;
Line 1173... Line 1171...
1173
 
1171
 
1174
			mov cl,byte[esi] ;tex[i].c=ta[ns];
1172
			mov cl,byte[esi] ;tex[i].c=ta[ns];
1175
			mov byte[edx],cl
1173
			mov byte[edx],cl
1176
			m2m dword[edx+10],ted_tim_ch ;tex[i].tc=ted_tim_ch;
1174
			m2m dword[edx+symbol.tc],ted_tim_ch ;tex[i].tc=ted_tim_ch;
Line 1177... Line 1175...
1177
			mov [edx+2],eax ;tex[i].perv=po_t;
1175
			mov [edx+symbol.perv],eax ;tex[i].perv=po_t;
1178
 
1176
 
1179
			mov ecx,eax
1177
			mov ecx,eax
1180
			imul ecx,sizeof.symbol
1178
			imul ecx,sizeof.symbol
1181
			add ecx,ted_tex ; *** ecx = tex[po_t] ***
1179
			add ecx,ted_tex ; *** ecx = tex[po_t] ***
Line 1182... Line 1180...
1182
			add ecx,6   ; *** ecx = tex[po_t].next ***
1180
			add ecx,symbol.next ; *** ecx = tex[po_t].next ***
1183
			m2m dword[edx+6],dword[ecx] ;tex[i].next=tex[po_t].next;
1181
			m2m dword[edx+symbol.next],dword[ecx] ;tex[i].next=tex[po_t].next;
1184
 
1182
 
1185
			call ted_get_text_arr_index ;*** eax = i ***
1183
			call ted_get_text_arr_index ;*** eax = i ***
1186
			mov [ecx],eax ;tex[po_t].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1184
			mov [ecx],eax ;tex[po_t].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1187
			mov ecx,[edx+6] ; *** ecx = tex[i].next ***
1185
			mov ecx,[edx+symbol.next] ; *** ecx = tex[i].next ***
Line 1188... Line 1186...
1188
			imul ecx,sizeof.symbol
1186
			imul ecx,sizeof.symbol
1189
			add ecx,ted_tex ; *** ecx = tex[tex[i].next] ***
1187
			add ecx,ted_tex ; *** ecx = tex[tex[i].next] ***
1190
			mov [ecx+2],eax ;tex[tex[i].next].perv=i;
1188
			mov [ecx+symbol.perv],eax ;tex[tex[i].next].perv=i;
1191
 
1189
 
Line 1266... Line 1264...
1266
align 16
1264
align 16
1267
ted_char_add:
1265
ted_char_add:
1268
	.loop_b:
1266
	.loop_b:
1269
		cmp ecx,ted_tex_end
1267
		cmp ecx,ted_tex_end
1270
		jge .end_f
1268
		jge .end_f
1271
		cmp dword[ecx+10],0
1269
		cmp dword[ecx+symbol.tc],0
1272
		jne @f
1270
		jne @f
1273
			cmp dword[ecx+14],0
1271
			cmp dword[ecx+symbol.td],0
1274
			je .loop_e
1272
			je .loop_e
1275
		@@:
1273
		@@:
1276
		add ecx,sizeof.symbol
1274
		add ecx,sizeof.symbol
1277
		jmp .loop_b
1275
		jmp .loop_b
1278
align 4
1276
align 4
1279
	.loop_e:
1277
	.loop_e:
Line 1280... Line 1278...
1280
 
1278
 
1281
	push eax ebx
1279
	push eax ebx
1282
	mov eax,ted_tim_ch
1280
	mov eax,ted_tim_ch
1283
	mov dword[ecx+10],eax
1281
	mov [ecx+symbol.tc],eax
1284
	mov ax,si
1282
	mov ax,si
Line 1285... Line 1283...
1285
	mov byte[ecx],al
1283
	mov byte[ecx],al
1286
 
1284
 
1287
	call ted_get_text_arr_index ; *** eax=pos ***
1285
	call ted_get_text_arr_index ; *** eax=pos ***
Line 1288... Line 1286...
1288
	mov [ecx+2],eax ;tex[i].perv=pos;
1286
	mov [ecx+symbol.perv],eax ;tex[i].perv=pos;
1289
	m2m dword[ecx+6],dword[edx+6] ;tex[i].next=tex[pos].next;
1287
	m2m dword[ecx+symbol.next],dword[edx+symbol.next] ;tex[i].next=tex[pos].next;
1290
 
1288
 
1291
	push edx
1289
	push edx
Line 1292... Line 1290...
1292
		mov edx,ecx
1290
		mov edx,ecx
1293
		call ted_get_text_arr_index ; *** eax=i ***
1291
		call ted_get_text_arr_index ; *** eax=i ***
1294
	pop edx
1292
	pop edx
1295
 
1293
 
1296
	mov [edx+6],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
1294
	mov [edx+symbol.next],eax ;tex[pos].next=i; // áá뫪¨ ¯¥à¥­ ¯à ¢«ï¥¬
Line 1297... Line 1295...
1297
	mov ebx,[ecx+6]
1295
	mov ebx,[ecx+symbol.next]
1298
	ConvertIndexToPointer ebx
1296
	ConvertIndexToPointer ebx
1299
	mov [ebx+2],eax ;tex[tex[i].next].perv=i; // ...
1297
	mov [ebx+symbol.perv],eax ;tex[tex[i].next].perv=i; // ...
Line 1312... Line 1310...
1312
	mov edi,[edit]
1310
	mov edi,[edit]
1313
	mov esi,[table]
1311
	mov esi,[table]
1314
	mov edx,ted_tex
1312
	mov edx,ted_tex
1315
	.cycle:
1313
	.cycle:
1316
		;¯¥à¥å®¤¨¬ ­  á«¥¤ãî騩 ᨬ¢®«
1314
		;¯¥à¥å®¤¨¬ ­  á«¥¤ãî騩 ᨬ¢®«
1317
		mov edx,[edx+6]
1315
		mov edx,[edx+symbol.next]
1318
		cmp edx,1
1316
		cmp edx,1
1319
		jle .end_text
1317
		jle .end_text
1320
		imul edx,sizeof.symbol
1318
		imul edx,sizeof.symbol
1321
		add edx,ted_tex
1319
		add edx,ted_tex
Line 1378... Line 1376...
1378
		call dword[conv_fun] ;¯à¥®¡à §®¢ ­¨¥ ᨬ¢®« 
1376
		call dword[conv_fun] ;¯à¥®¡à §®¢ ­¨¥ ᨬ¢®« 
1379
		mov esi,eax
1377
		mov esi,eax
1380
		cmp byte[edx],al
1378
		cmp byte[edx],al
1381
		pop eax
1379
		pop eax
1382
		je .no_change
1380
		je .no_change
1383
			m2m dword [edx+14],ted_tim_ch
1381
			m2m dword[edx+symbol.td],ted_tim_ch
1384
			call ted_char_add ;b_pos=ted_char_add(tex[i].c^32,i,false,b_pos);
1382
			call ted_char_add ;b_pos=ted_char_add(tex[i].c^32,i,false,b_pos);
1385
			call ted_get_text_next_pos ;go to added symbol
1383
			call ted_get_text_next_pos ;go to added symbol
1386
			inc dword[conv_cou]
1384
			inc dword[conv_cou]
1387
		.no_change:
1385
		.no_change:
Line 1422... Line 1420...
1422
	je .no_del
1420
	je .no_del
1423
		test ebx,ted_opt_ed_change_time
1421
		test ebx,ted_opt_ed_change_time
1424
		jz @f
1422
		jz @f
1425
			inc ted_tim_ch
1423
			inc ted_tim_ch
1426
		@@:
1424
		@@:
1427
		m2m dword[edx+14], ted_tim_ch
1425
		m2m dword[edx+symbol.td], ted_tim_ch
1428
		mov cl,1
1426
		mov cl,1
1429
	.no_del:
1427
	.no_del:
1430
	mov bl,cl
1428
	mov bl,cl
1431
	ret
1429
	ret
1432
endp
1430
endp
Line 1459... Line 1457...
1459
		@@:
1457
		@@:
1460
		cmp edx,ted_tex
1458
		cmp edx,ted_tex
1461
		je @f
1459
		je @f
1462
		cmp edx,ebx ;if(i==te)break;
1460
		cmp edx,ebx ;if(i==te)break;
1463
		je @f
1461
		je @f
1464
			m2m dword[edx+14],ted_tim_ch
1462
			m2m dword[edx+symbol.td],ted_tim_ch
1465
			mov esi,ted_opt_ed_change_time
1463
			mov esi,ted_opt_ed_change_time
1466
			not esi
1464
			not esi
1467
			and dword[del_opt],esi ;n_tim=false;
1465
			and dword[del_opt],esi ;n_tim=false;
1468
			call ted_iterat_next
1466
			call ted_iterat_next
1469
			jmp @b
1467
			jmp @b
Line 1508... Line 1506...
1508
		call ted_get_text_perv_pos
1506
		call ted_get_text_perv_pos
1509
		mov ebx,edx
1507
		mov ebx,edx
1510
	@@:
1508
	@@:
Line 1511... Line 1509...
1511
 
1509
 
1512
	push esi
1510
	push esi
1513
		mov edx,[eax+2] ; *** edx = tex[p0].perv ***
1511
		mov edx,[eax+symbol.perv] ; *** edx = tex[p0].perv ***
1514
		ConvertIndexToPointer edx
1512
		ConvertIndexToPointer edx
1515
		add edx,6
1513
		add edx,symbol.next
Line 1516... Line 1514...
1516
		mov ecx,[edx] ;tmp = tex[tex[p0].perv].next;
1514
		mov ecx,[edx] ;ecx = tex[tex[p0].perv].next
1517
 
1515
 
1518
		mov esi,[ebx+6] ; *** esi = tex[p1].next ***
1516
		mov esi,[ebx+symbol.next] ; *** esi = tex[p1].next ***
1519
		ConvertIndexToPointer esi
1517
		ConvertIndexToPointer esi
Line 1520... Line 1518...
1520
		add esi,2
1518
		add esi,symbol.perv
1521
		m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv;
1519
		m2m dword[edx],dword[esi] ;tex[tex[p0].perv].next = tex[tex[p1].next].perv
Line 1522... Line 1520...
1522
 
1520
 
1523
		mov [esi],ecx ;tex[tex[p1].next].perv = tmp;
1521
		mov [esi],ecx ;tex[tex[p1].next].perv = ecx
1524
	pop esi
1522
	pop esi
Line 1525... Line 1523...
1525
 
1523
 
1526
	mov ecx,[eax+2] ;tmp = tex[p0].perv;
1524
	mov ecx,[eax+symbol.perv] ;ecx = tex[p0].perv
1527
	m2m dword[eax+2],dword[ebx+6] ;tex[p0].perv = tex[p1].next;
1525
	m2m dword[eax+symbol.perv],dword[ebx+symbol.next] ;tex[p0].perv = tex[p1].next
1528
	mov [ebx+6],ecx ;tex[p1].next = tmp;
1526
	mov [ebx+symbol.next],ecx ;tex[p1].next = ecx
1529
 
1527
 
1530
	mov edx,eax ;i=p0;
1528
	mov edx,eax ;i=p0;
1531
	@@:
1529
	@@:
1532
		mov ecx,[edx+6] ;tmp = tex[i].next;
1530
		mov ecx,[edx+symbol.next] ;ecx = tex[i].next
1533
		m2m dword[edx+6],dword[edx+2] ;tex[i].next = tex[i].perv;
1531
		m2m dword[edx+symbol.next],dword[edx+symbol.perv] ;tex[i].next = tex[i].perv
1534
		mov [edx+2],ecx ;tex[i].perv = tmp;
1532
		mov [edx+symbol.perv],ecx ;tex[i].perv = ecx
1535
		cmp edx,ebx ;if(i==p1)break;
1533
		cmp edx,ebx ;if(i==p1)break;
1536
		je @f
1534
		je @f
1537
; ---
1535
; ---
1538
;cmp edx,ted_tex
1536
;cmp edx,ted_tex
1539
;je @f
1537
;je @f
1540
; ---
1538
; ---
1541
		mov edx,ecx ;i = tmp;
1539
		mov edx,ecx ;i = ecx
Line 1802... Line 1800...
1802
; edi = pointer to tedit struct
1800
; edi = pointer to tedit struct
1803
;output:
1801
;output:
1804
; edx = pointer to 'perv' struct
1802
; edx = pointer to 'perv' struct
1805
align 16
1803
align 16
1806
ted_get_text_perv_pos:
1804
ted_get_text_perv_pos:
1807
	mov edx,[edx+2]
1805
	mov edx,[edx+symbol.perv]
1808
	imul edx,sizeof.symbol
1806
	imul edx,sizeof.symbol
1809
	add edx,ted_tex
1807
	add edx,ted_tex
1810
	ret
1808
	ret
Line 1811... Line 1809...
1811
 
1809
 
1812
;input:
1810
;input:
1813
; edx = pointer to symbol struct
1811
; edx = pointer to symbol struct
1814
;output:
1812
;output:
1815
; edx = pointer to 'next' symbol struct
1813
; edx = pointer to 'next' symbol struct
1816
align 16
1814
align 16
1817
ted_get_text_next_pos:
1815
ted_get_text_next_pos:
1818
	mov edx,[edx+6]
1816
	mov edx,[edx+symbol.next]
1819
	imul edx,sizeof.symbol
1817
	imul edx,sizeof.symbol
1820
	add edx,ted_tex
1818
	add edx,ted_tex
Line 1821... Line 1819...
1821
	ret
1819
	ret
Line 2003... Line 2001...
2003
		jle @f
2001
		jle @f
Line 2004... Line 2002...
2004
 
2002
 
2005
		;if(tex[i].tc>ted_tim_ch){ // ¥á«¨ ᮧ¤ ­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
2003
		;if(tex[i].tc>ted_tim_ch){ // ¥á«¨ ᮧ¤ ­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
2006
		cmp [edx+symbol.tc],eax
2004
		cmp [edx+symbol.tc],eax
2007
		jle .no_u1
2005
		jle .no_u1
2008
			mov dword [edx+symbol.tc],0
2006
			mov dword[edx+symbol.tc],0
Line 2009... Line 2007...
2009
			mov dword [edx+symbol.td],0
2007
			mov dword[edx+symbol.td],0
2010
 
2008
 
2011
			mov ebx,[edx+symbol.perv]
2009
			mov ebx,[edx+symbol.perv]
2012
			imul ebx,sizeof.symbol
2010
			imul ebx,sizeof.symbol
Line 2027... Line 2025...
2027
		.no_u1:
2025
		.no_u1:
Line 2028... Line 2026...
2028
 
2026
 
2029
		;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ¥á«¨ 㤠«¥­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
2027
		;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ¥á«¨ 㤠«¥­¨¥ ᨬ¢®«  ¡ë«® ®â¬¥­¥­®
2030
		cmp [edx+symbol.td],eax
2028
		cmp [edx+symbol.td],eax
2031
		jle .no_u2
2029
		jle .no_u2
2032
			mov dword [edx+symbol.td],0
2030
			mov dword[edx+symbol.td],0
Line 2033... Line 2031...
2033
		.no_u2:
2031
		.no_u2:
2034
 
2032
 
2035
		call ted_get_text_next_pos
2033
		call ted_get_text_next_pos
Line 2867... Line 2865...
2867
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2865
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­  ª®â®àë© ãª §ë¢ ¥â ted_buffer_find
2868
;input:
2866
;input:
2869
; f_opt = ¯ à ¬¥âàë ¯®¨áª :
2867
; f_opt = ¯ à ¬¥âàë ¯®¨áª :
2870
;   (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
2868
;   (0 - ¨áª âì ­¨¦¥ ªãàá®à , 1 - ¨áª âì ¢ëè¥ ªãàá®à , 2 - ¨áª âì ®â ­ ç «  ä ©« )
2871
;   ¥á«¨ ãáâ ­®¢«¥­ 31-© ¡¨â, â® ­¥ ®¡­®¢«ï¥âáï ®ª­®
2869
;   ¥á«¨ ãáâ ­®¢«¥­ 31-© ¡¨â, â® ­¥ ®¡­®¢«ï¥âáï ®ª­®
-
 
2870
;   ¥á«¨ ãáâ ­®¢«¥­ 30-© ¡¨â, â® ¯®¨áª ¨¤¥â ¡¥§ ãç¥â  ॣ¨áâà  á¨¬¢®«®¢
2872
;output:
2871
;output:
2873
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2872
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2874
align 16
2873
align 16
2875
proc ted_but_find uses ebx ecx edx edi esi, edit:dword, f_opt:dword
2874
proc ted_but_find uses ebx ecx edx edi esi, edit:dword, f_opt:dword
-
 
2875
	mov eax,[f_opt]
-
 
2876
	push eax
2876
	push [edit]
2877
	push [edit]
2877
	cmp word[f_opt],2
2878
	cmp al,2
2878
	jne @f
2879
	jne @f
2879
		call _but_find_first
2880
		call _but_find_first
2880
		jmp .end0
2881
		jmp .end0
2881
	@@:
2882
	@@:
2882
	cmp word[f_opt],0
2883
	cmp al,0
2883
	jne @f
2884
	jne @f
2884
		call _but_find_next
2885
		call _but_find_next
2885
		jmp .end0
2886
		jmp .end0
2886
	@@:
2887
	@@:
2887
	cmp word[f_opt],1
2888
	cmp al,1
2888
	jne .end0
2889
	jne @f
2889
		call _but_find_perv
2890
		call _but_find_perv
-
 
2891
		jmp .end0
-
 
2892
	@@:
-
 
2893
	add esp,8
2890
	.end0:
2894
	.end0:
Line 2891... Line 2895...
2891
 
2895
 
2892
	bt dword[f_opt],31
2896
	bt dword[f_opt],31
2893
	jc .end1
2897
	jc .end1
Line 2905... Line 2909...
2905
	ret
2909
	ret
2906
endp
2910
endp
Line 2907... Line 2911...
2907
 
2911
 
2908
;description:
2912
;description:
-
 
2913
; äã­ªæ¨ï ­ å®¤¨â ⥪á⠮⠭ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
-
 
2914
;input:
2909
; äã­ªæ¨ï ­ å®¤¨â ⥪á⠮⠭ ç «  ä ©« , ¨«¨ ®â ª®­æ  ⥪ã饣® ¢ë¤¥«¥­¨ï
2915
; f_opt = ®¯æ¨¨ ¤«ï ¯®¨áª 
2910
;output:
2916
;output:
2911
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2917
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2912
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2918
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2913
align 16
2919
align 16
2914
proc _but_find_first, edit:dword
2920
proc _but_find_first, edit:dword, f_opt:dword
Line 2915... Line 2921...
2915
	mov edi,[edit]
2921
	mov edi,[edit]
2916
 
2922
 
2917
	call ted_is_select
2923
	call ted_is_select
Line 2925... Line 2931...
2925
		jmp .end0
2931
		jmp .end0
2926
	@@:
2932
	@@:
2927
		mov edx,ted_tex
2933
		mov edx,ted_tex
2928
		call ted_iterat_next
2934
		call ted_iterat_next
2929
	.end0:
2935
	.end0:
2930
	mov eax,ted_buffer_find
2936
	mov ebx,ted_buffer_find
2931
	mov bl,byte[eax]
-
 
2932
	@@:
2937
	@@:
-
 
2938
		mov eax,[f_opt]
2933
		call ted_get_find_rezult
2939
		call ted_get_find_rezult
2934
		cmp bh,1
2940
		cmp ah,1
2935
		je @f ; find
2941
		je @f ; find
2936
			call ted_iterat_next
2942
			call ted_iterat_next
2937
			cmp edx,ted_tex_1
2943
			cmp edx,ted_tex_1
2938
			jle @f
2944
			jle @f
2939
			jmp @b
2945
			jmp @b
Line 2942... Line 2948...
2942
	ret
2948
	ret
2943
endp
2949
endp
Line 2944... Line 2950...
2944
 
2950
 
2945
;description:
2951
;description:
-
 
2952
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ¢ëè¥ ªãàá®à 
-
 
2953
;input:
2946
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ¢ëè¥ ªãàá®à 
2954
; f_opt = ®¯æ¨¨ ¤«ï ¯®¨áª 
2947
;output:
2955
;output:
2948
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2956
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2949
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2957
; ebx, ecx, edx, edi, edi - ¯®àâïâáï
2950
align 16
2958
align 16
2951
proc _but_find_perv, edit:dword
2959
proc _but_find_perv, edit:dword, f_opt:dword
-
 
2960
	mov edi,[edit]
2952
	mov edi,[edit]
2961
 
2953
	call ted_is_select
2962
	call ted_is_select
2954
	or al,al
2963
	or al,al
2955
	jz @f
2964
	jz @f
2956
		call ted_sel_normalize
2965
		call ted_sel_normalize
Line 2961... Line 2970...
2961
		call ted_iterat_perv ;¯¥à¥å®¤ ­  1-© ᨬ¢®« ¯¥à¥¤ ¢ë¤¥«¥­¨¥¬
2970
		call ted_iterat_perv ;¯¥à¥å®¤ ­  1-© ᨬ¢®« ¯¥à¥¤ ¢ë¤¥«¥­¨¥¬
2962
		jmp .end0
2971
		jmp .end0
2963
	@@:
2972
	@@:
2964
	call ted_get_pos_by_cursor
2973
	call ted_get_pos_by_cursor
2965
	.end0:
2974
	.end0:
2966
	mov eax,ted_buffer_find
2975
	mov ebx,ted_buffer_find
2967
	mov bl,byte[eax]
-
 
2968
	@@:
2976
	@@:
-
 
2977
		mov eax,[f_opt]
2969
		call ted_get_find_rezult
2978
		call ted_get_find_rezult
2970
		cmp bh,1
2979
		cmp ah,1
2971
		je @f ; find
2980
		je @f ; find
2972
			call ted_iterat_perv
2981
			call ted_iterat_perv
2973
			cmp edx,ted_tex_1
2982
			cmp edx,ted_tex_1
2974
			jle @f
2983
			jle @f
2975
			jmp @b
2984
			jmp @b
Line 2978... Line 2987...
2978
	ret
2987
	ret
2979
endp
2988
endp
Line 2980... Line 2989...
2980
 
2989
 
2981
;description:
2990
;description:
-
 
2991
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­¨¦¥ ªãàá®à 
-
 
2992
;input:
2982
; äã­ªæ¨ï ­ å®¤¨â ⥪áâ ­¨¦¥ ªãàá®à 
2993
; f_opt = ®¯æ¨¨ ¤«ï ¯®¨áª 
2983
;output:
2994
;output:
2984
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2995
; eax = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
2985
; ebx, edx, edi, esi - ¯®àâïâáï
2996
; ebx, ecx, edx, edi, esi - ¯®àâïâáï
2986
align 16
2997
align 16
2987
proc _but_find_next, edit:dword
2998
proc _but_find_next, edit:dword, f_opt:dword
Line 2988... Line 2999...
2988
	mov edi,[edit]
2999
	mov edi,[edit]
2989
 
3000
 
2990
	call ted_get_pos_by_cursor
-
 
2991
	mov eax,ted_buffer_find
3001
	call ted_get_pos_by_cursor
-
 
3002
	mov ebx,ted_buffer_find
2992
	mov bl,byte[eax]
3003
	@@:
2993
	@@:
3004
		mov eax,[f_opt]
2994
		call ted_get_find_rezult
3005
		call ted_get_find_rezult
2995
		cmp bh,1
3006
		cmp ah,1
2996
		je @f ; find
3007
		je @f ; find
2997
			call ted_iterat_next
3008
			call ted_iterat_next
2998
			cmp edx,ted_tex_1
3009
			cmp edx,ted_tex_1
Line 3004... Line 3015...
3004
endp
3015
endp
Line 3005... Line 3016...
3005
 
3016
 
3006
;description:
3017
;description:
3007
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï, ¢ë¤¥«ï¥â ­ ©¤¥­­ë© ⥪áâ
3018
; ¢á¯®¬®£ â¥«ì­ ï äã­ªæ¨ï, ¢ë¤¥«ï¥â ­ ©¤¥­­ë© ⥪áâ
3008
;input:
3019
;input:
3009
; bh = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
3020
; ah = ¡ë« «¨ ­ ©¤¥­ ¨áª®¬ë© ⥪áâ (0 - ­¥â, 1 - ¤ )
3010
; esi = first symbol pointer
3021
; esi = first symbol pointer
3011
align 16
3022
align 16
3012
_but_find_select:
3023
_but_find_select:
3013
	or bh,bh
3024
	or ah,ah
3014
	jz @f
3025
	jz @f
3015
		call ted_get_text_coords
3026
		call ted_get_text_coords
3016
		inc ebx ;move cursor right
3027
		inc ebx ;move cursor right
3017
		mov ted_sel_x1,ebx
3028
		mov ted_sel_x1,ebx
Line 3065... Line 3076...
3065
		inc eax
3076
		inc eax
3066
	.end0:
3077
	.end0:
3067
	ret
3078
	ret
3068
endp
3079
endp
Line -... Line 3080...
-
 
3080
 
-
 
3081
;description:
-
 
3082
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ ebx
-
 
3083
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
-
 
3084
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
3069
 
3085
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
3070
;input:
3086
;input:
3071
; eax - text need find
3087
; eax - options to find
3072
; bl - first symbol to find
3088
; ebx - text need find
3073
; edx - first symbol pointer
3089
; edx - first symbol pointer
3074
; edi - pointer to tedit struct
3090
; edi - pointer to tedit struct
3075
;output:
3091
;output:
3076
; bh - rezult
3092
; ah - rezult
3077
; edx - last text position (if find sucess)
3093
; edx - last text position (if find sucess)
3078
; esi - first symbol pointer
-
 
3079
;description:
-
 
3080
; ”ã­ªæ¨ï ¯à®¢¥àï¥â ᮢ¯ ¤ ¥â «¨ ⥪áâ ¢ ¡ãä¥à¥ eax
-
 
3081
; á ⥪á⮬ । ªâ®à  ¯® 㪠§ â¥«î edx.
-
 
3082
; ‘â ­¤ àâ­ë¥ ä㭪樨 (­ ¯à. strcmp) âãâ ­¥ ¯®¤®©¤ãâ, ¯®â®¬ã çâ®
-
 
3083
; ¢ ¯ ¬ï⨠। ªâ®à  ⥪áâ ᮤ¥à¦¨âáï ­¥ ¢ ¢¨¤¥ ascii áâப.
3094
; esi - first symbol pointer
3084
align 16
3095
align 16
-
 
3096
proc ted_get_find_rezult uses ebx
3085
ted_get_find_rezult:
3097
	mov al,byte[ebx]
3086
push eax
3098
	bt eax,30
3087
	mov bh,1
3099
	jnc @f
3088
	mov esi,edx ;copy edx
3100
		call fb_char_toupper
-
 
3101
	@@:
-
 
3102
	mov ah,1
-
 
3103
	mov esi,edx ;copy edx
-
 
3104
	.cycle0:
3089
	@@:
3105
		mov cl,al
-
 
3106
		mov al,byte[edx]
-
 
3107
		bt eax,30
-
 
3108
		jnc @f
-
 
3109
			call fb_char_toupper
-
 
3110
		@@:
3090
		cmp byte[edx],bl
3111
		cmp al,cl
Line 3091... Line 3112...
3091
		jne .no_text
3112
		jne .no_text
3092
 
3113
 
3093
		inc eax ;*** get next symbol (in find text) ***
3114
		inc ebx ;*** get next symbol (in find text) ***
3094
		mov bl,byte[eax]
3115
		mov al,byte[ebx]
-
 
3116
		or al,al
-
 
3117
		jz .end_f ;end of find text
-
 
3118
		bt eax,30
-
 
3119
		jnc @f
Line 3095... Line 3120...
3095
		or bl,bl
3120
			call fb_char_toupper
3096
		jz @f ;end of find text
3121
		@@:
3097
 
3122
 
3098
		call ted_iterat_next ;*** get next symbol (in editor text) ***
3123
		call ted_iterat_next ;*** get next symbol (in editor text) ***
3099
		cmp edx,ted_tex_1
3124
		cmp edx,ted_tex_1
3100
		jg @b
3125
		jg .cycle0
3101
align 4
3126
align 4
3102
		.no_text:
3127
		.no_text:
3103
	xor bh,bh
-
 
3104
	mov edx,esi ;restore edx
-
 
3105
	@@:
3128
	xor ah,ah
-
 
3129
	mov edx,esi ;restore edx
Line 3106... Line 3130...
3106
pop eax
3130
	.end_f:
3107
	mov bl,byte[eax] ;restore bl
3131
	ret
3108
	ret
3132
endp
3109
 
3133
 
Line 4132... Line 4156...
4132
; ecx = symbol color
4156
; ecx = symbol color
4133
; edx = pointer to 13 symbol
4157
; edx = pointer to 13 symbol
4134
;description:
4158
;description:
4135
; äã­ªæ¨ï ­ã¦­  ¤«ï ®¯â¨¬¨§ æ¨¨ ¢ë¢®¤  ⥪áâ 
4159
; äã­ªæ¨ï ­ã¦­  ¤«ï ®¯â¨¬¨§ æ¨¨ ¢ë¢®¤  ⥪áâ 
4136
align 16
4160
align 16
4137
proc ted_opt_draw_line_right
4161
proc ted_opt_draw_line_right uses eax
4138
	push eax
-
 
4139
	mov eax,edx
4162
	mov eax,edx
4140
	@@:
4163
	@@:
4141
		cmp edx,ted_tex_1
4164
		cmp edx,ted_tex_1
4142
		jle @f
4165
		jle @f
4143
		cmp byte[edx],13
4166
		cmp byte[edx],13
Line 4146... Line 4169...
4146
		call ted_iterat_next
4169
		call ted_iterat_next
4147
		jmp @b
4170
		jmp @b
4148
	@@:
4171
	@@:
4149
	mov edx,eax ;perv sumbol
4172
	mov edx,eax ;perv sumbol
4150
	call ted_get_symb_color
4173
	call ted_get_symb_color
4151
 
-
 
4152
	pop eax
-
 
4153
	ret
4174
	ret
4154
endp
4175
endp
Line 4155... Line 4176...
4155
 
4176
 
4156
align 16
4177
align 16
Line 4373... Line 4394...
4373
 
4394
 
Line 4374... Line 4395...
4374
		mov ted_err_save,al
4395
		mov ted_err_save,al
4375
 
4396
 
4376
		or eax,eax
-
 
4377
		jz .no_msg
-
 
4378
		;cmp eax,6
4397
		or eax,eax
4379
		;je @f
4398
		jz .no_msg
4380
		cmp ax,10
4399
		cmp ax,10
4381
		jl .zifra_0_9
4400
		jl .zifra_0_9
4382
			mov al,'?'
4401
			mov al,'?'