000
21.11.2002, 20:33
thinktank
|
Hi,
Braucht man dazu ein neues Tut ? Irgendwie gibts bei mir einen Exception Error, wenn ich durch eine Wand durchfliege oder einfach im Spectator-Menü rumklicke. Beim Debugging geht er immer zum strcmp ASM-Code. Ausserdem sagt er immer der Error wäre an der Speicherstelle 0x0. Kennt jemand den Fehler ? Woran kanns liegen ?
[edit]
;*** ;strcmp - compare two strings, returning less than, equal to, or greater than ; ;Purpose: ; Compares two string, determining their lexical order. Unsigned ; comparison is used. ; ; Algorithm: ; int strcmp ( src , dst ) ; unsigned char *src; ; unsigned char *dst; ; { ; int ret = 0 ; ; ; while( ! (ret = *src - *dst) && *dst) ; ++src, ++dst; ; ; if ( ret < 0 ) ; ret = -1 ; ; else if ( ret > 0 ) ; ret = 1 ; ; ; return( ret ); ; } ; ;Entry: ; const char * src - string for left-hand side of comparison ; const char * dst - string for right-hand side of comparison ; ;Exit: ; AX < 0, 0, or >0, indicating whether the first string is ; Less than, Equal to, or Greater than the second string. ; ;Uses: ; CX, DX ; ;Exceptions: ; ;*******************************************************************************
CODESEG
public strcmp strcmp proc
.FPO ( 0, 2, 0, 0, 0, 0 )
mov edx,[esp + 4] ; edx = src mov ecx,[esp + 8] ; ecx = dst
test edx,3 jnz short dopartial
align 4 dodwords: mov eax,[edx] ; <- HIER IST DIE EXCEPTION
cmp al,[ecx] jne short donene or al,al jz short doneeq cmp ah,[ecx + 1] jne short donene or ah,ah jz short doneeq
shr eax,16
cmp al,[ecx + 2] jne short donene or al,al jz short doneeq cmp ah,[ecx + 3] jne short donene add ecx,4 add edx,4 or ah,ah jnz short dodwords ;....
[/edit]
--
Dieser Beitrag wurde am 21.11.2002 um 21:09 von thinktank bearbeitet.
|
|
Profil || Suche
|