Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem

2 views
Skip to first unread message

Dave

unread,
Aug 21, 2003, 5:06:07 PM8/21/03
to
Implement the following 'for' statement using 32-bit Intel assembly
instructions:

char string[] = "this is a string";
char *cptr;

for( cptr = string; *cptr; cptr++ )
if( *cptr == 'a' )
break;

why doesnt this work:

cld
lea si, string

forloop:
lodsb

cmp al, 0
jz end
cmp al, 'a'
je end

jmp forloop

end:


claudibus

unread,
Sep 14, 2003, 7:37:29 PM9/14/03
to
"Dave" <ke...@hotmail.com> wrote:

please
#define work

some random thoughts:

- is that a code snippet or the whole code?
- check ds register
- quoting homework text:
>32-bit Intel assembly instructions

Claudio

0 new messages