Are you required to use inline assembly for this program? It's so simple in C, why do it the hard way??? printf("what is %s and where is %s", argv[1], argv[1]);
In any event, you need to use a loop to copy the characters, or you can set up the call to rep movsb.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
rep movsb is explained here. If you are going to write inline assembly then you have to know assembly language itself.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
you need a loop. In the loop, move one character into the al register then compare al with whatever character you want. The following code isn't compretly correct but will give you an idea of what needs to be done
mov cx,length of string
loop_top:
mov al,es:[si]; copy one character into al
inc si;
cmp al,'D' ; check if the character is the letter 'D'
je loop_end ; go if it's the letter I want
loop loop_top ; back to top of loop
loop_end:
;; do something here
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343