여기에 질문해도 돼는지 모르겠네요 ^^
도저히 방법을 몰라 질문합니다..
c 프로그램을 어셈으로 변경해야하는데.. 한부분이 막혀서.
int string_legnth(char *s)
{
int len;
len=0;
while(*s != ' '){
len++;
s++;
}
return len;
}
여기서 s++; 이부분을 어떻게 해야할지?
segment .text
global string_length
string_length:
push ebp
mov
ebp,esp
sub esp,4
mov DWORD [ebp-4],0
mov ecx,[ebp+8]
lea ebx,[ebp-4]
;; while(*s != ' ');
.L3:
;; mov eax,[ebp+8]
mov eax,[ecx]
cmp
eax,0
jne .L5
jmp .L4
;; len++;
;; s+
+;
.L5:
inc ebx
inc eax
mov
[ecx],eax
jmp .L3
;; return len;
.L4:
mov eax,eb
x
mov eax,eax
leave
ret
while문 부분
을 도저히 어떻게 해야 할지 모르겠습니다..
조언을 부탁드립니다..--^^