>> Delete No. 35179 article
No. [질문]어셈블리어 숙제 하던 중에 ~~

등록 2001-11-17 12:43:00 By localhost     조회 2
이름 강태양    

		 여기에 질문해도 돼는지 모르겠네요 ^^
 도저히 방법을 몰라 질문합니다..
 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문 부분
을 도저히 어떻게 해야 할지 모르겠습니다.. 
 조언을 부탁드립니다..--^^
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved