Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FindChar_1 PROC
- MOV ESI, OFFSET DataString ; load offset of variable 'DataString' into reg. ESI
- MOV AL, 'J' ; load the code of character 'J' into reg. AH
- Check_End:
- CMP BYTE PTR [ESI], 0FFFFH ; is it the end of a string (special character FF)?
- JE Not_Find ; found end character (guard)
- CMP AH, [ESI] ; compare a char. with 1 char of string 'DataString'
- JE Got_Equal ; character found!
- ADD ESI, 1 ; increment an offset
- JMP Check_End ; search loop
- Got_Equal:
- MOV DL, [ESI] ; load found char into DL
- JMP Done
- Not_Find:
- MOV EAX,0 ; character not found
- RET ; return from procedure
- Done:
- MOV EAX,1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement