; ; PROC NAME : CHECKSTRING ; ; NASM CODE Generated by rqAsmToBin on 11-06-2002 at 13:41:54 ; bits 32 ; %define ptrString [ebp+08] %define stringLen [ebp+12] %define ptrReturnedString [ebp+16] ; segment .text start: enter 0, 0 ; ; End Of RqAsm Automated Header ; User's Code Begins Here ; push esi push edi push ecx push edx ; mov esi, ptrString mov edi, ptrReturnedString mov ecx, stringLen mov edx, 0 ; Returned String Char Counter dec esi inc ecx ; .LoopCheckNextChar: inc esi dec ecx jz .EndOfCheck ; finished mov al, [esi] cmp al, 33 jc .LoopCheckNextChar ; rejected below 33d, 33d not rejected cmp al, 128 jnc .LoopCheckNextChar ; rejected over 127d, 127d not rejected cmp al, 97 ; 97d : FROM 'a' to 'A' jc .CharOk cmp al, 123 ; 122d : TO 'z' to 'Z' jnc .CharOk sub al, 32 ; to uppercase 97='a' > 65='A' .CharOk: mov [edi], al inc edx inc edi jmp .LoopCheckNextChar ; .EndOfCheck: mov eax, edx ; returned value = returned string length ; pop edx pop ecx pop edi pop esi ; ; End of User's Code ; Automated RqAsm Footer leave ret 16 ; ; End of NASM Code
|