Subversion Repositories Kolibri OS

Rev

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

Rev 2825 Rev 2839
Line 1... Line 1...
1
//------------------------------------------------------------------------------
1
//------------------------------------------------------------------------------
-
 
2
// strcmp( ESI, EDI)
2
// strlen( EDI)
3
// strlen( EDI)
3
// strcpy( EDI, ESI)
4
// strcpy( EDI, ESI)
4
// strcat( EDI, ESI)
5
// strcat( EDI, ESI)
-
 
6
// strchr( ESI,BL)
-
 
7
// strrchr( ESI,BL)
-
 
8
// strstr( EBX, EDX)
-
 
9
//
5
// IntToStr( ESI)
10
// IntToStr( ESI)
6
// StrToInt()
11
// StrToInt()
7
// strcmp( ESI, EDI)
-
 
8
// find_symbol( ESI,BL)
-
 
9
// upcase( ESI)
12
// upcase( ESI)
10
// lowcase( ESI)
13
// lowcase( ESI)
11
// strstr( EBX, EDX)
-
 
12
//------------------------------------------------------------------------------
14
//------------------------------------------------------------------------------
Line -... Line 15...
-
 
15
 
13
 
16
 
14
inline fastcall unsigned int strlen( EDI)
17
inline fastcall unsigned int strlen( EDI)
15
{
18
{
16
	$xor eax, eax
19
	$xor eax, eax
17
	$mov ecx, -1
20
	$mov ecx, -1
Line 57... Line 60...
57
    rep movsb
60
    rep movsb
58
    mov eax, ebx
61
    mov eax, ebx
59
	}
62
	}
60
}
63
}
Line 61... Line 64...
61
 
64
 
62
char buffer[11]="";
65
char buffer[11];
63
inline fastcall dword IntToStr( ESI)
66
inline fastcall dword IntToStr( ESI)
64
{
67
{
65
     $mov     edi, #buffer
68
     $mov     edi, #buffer
66
     $mov     ecx, 10
69
     $mov     ecx, 10
Line 113... Line 116...
113
		ESI++;
116
		ESI++;
114
		EDI++;
117
		EDI++;
115
	}
118
	}
116
}
119
}
Line 117... Line 120...
117
 
120
 
-
 
121
inline fastcall unsigned int strchr( ESI,BL)
-
 
122
{
-
 
123
	int jj=0;
-
 
124
	do{
-
 
125
		jj++;
-
 
126
		$lodsb
-
 
127
		IF(AL==BL) return jj;
-
 
128
	} while(AL!=0);
-
 
129
}
-
 
130
 
-
 
131
 
118
inline fastcall unsigned int find_symbol( ESI,BL)
132
inline fastcall unsigned int strrchr( ESI,BL)
119
{
133
{
120
	int jj=0, last=-1;
134
	int jj=0, last=-1;
121
	do{
135
	do{
122
		jj++;
136
		jj++;
Line 167... Line 181...
167
    repne scasb
181
    repne scasb
168
    not ecx
182
    not ecx
169
    sub ecx, esi
183
    sub ecx, esi
170
    jbe ls2
184
    jbe ls2
171
    mov edi, ebx
185
    mov edi, ebx
172
    lea ebx, dsdword[ esi-1]
186
    lea ebx, DSDWORD[ esi-1]
173
ls1: mov esi, edx
187
ls1: mov esi, edx
174
    lodsb
188
    lodsb
175
    repne scasb
189
    repne scasb
176
    jne ls2
190
    jne ls2
177
    mov eax, ecx
191
    mov eax, ecx
Line 179... Line 193...
179
    mov ecx, ebx
193
    mov ecx, ebx
180
    repe cmpsb
194
    repe cmpsb
181
    pop edi
195
    pop edi
182
    mov ecx, eax
196
    mov ecx, eax
183
    jne ls1
197
    jne ls1
184
    lea eax, dsdword[ edi-1]
198
    lea eax, DSDWORD[ edi-1]
185
    jmp short ls3
199
    jmp short ls3
186
ls2: xor eax, eax
200
ls2: xor eax, eax
187
ls3:
201
ls3:
188
  }
202
  }
189
}
203
}
190
>
204
>