0
문자열이 있는데 그 길이를 찾으려고합니다. 나는 rw32-2017을 사용하고있다. repe scasb
을 사용하여 문자열을 검사하려고했으나 ZF가 전혀 변경되지 않습니다. 문자열의 길이를 쉽게 찾을 수 있습니까? 내 프로그램은 다음과 같습니다문자열 길이를 찾는 방법
%include "rw32-2017.inc"
section .data
; write your data here
string1 db "how long is this string",0
section .text
main:
mov ebp, esp
; write your code here
mov esi,string1
mov eax,0
mov ecx,50 ;max lenght of string is 50
mov ebx,ecx
cld
repe scasb
sub ebx, ecx
mov eax,ebx
call WriteUInt8
ret