lodsb and stosb automatically inc edi/esi, so I removed that and the code works. Thanks but now, how about if theyre is more than 1 argument (/msg nick text or /ctcp nick version). Also for my previous post, I am just curious as to how you would put the values into an array after replacing space with null.
Posted on 2003-06-24 17:40:54 by KewLexX


lea esi, source
xor ecx,ecx
dec esi
_scanspace:
inc esi
mov al, [esi]
test al, al
jz _out
cmp al, ' '
jnz _scanspace
mov byte ptr[esi],0
jmp _scanspace
_out:

No need for another buffer ;)
Posted on 2003-06-25 00:10:53 by roticv
Careful how you do this.

Suppose you have a command '/msg <nick> <text>' that sends a private message to <nick>.

If you go replacing every space with a null, then you will also trash the spaces in <text>. When you construct the message that goes to the server, you will have to put those spaces back.

Also take the size of your array into consideration. If the user types "/msg George h e l l o t h e r e g e o r g e ! ! ! ! ! !" then you're going to have a lot of elements in your array, possibly more than the array can hold.

I think instead of blindly replacing every space with a 0 and stuffing the offset into an array, you should process commands on a per-message-basis. First scan the string for the command up to the first space, and then based on how many arguments the command takes, keep scanning.
Posted on 2003-06-25 02:46:10 by iblis
:alright:


lodsb and stosb automatically inc edi/esi, so I removed that and the code works. Thanks but now, how about if theyre is more than 1 argument (/msg nick text or /ctcp nick version). Also for my previous post, I am just curious as to how you would put the values into an array after replacing space with null.




oops, i totally forgot about that :X

also, you should just make a different parser for each command, for /msg ones, just tell it to copy everything from first space to carriage return? (if that's possible?). or just force the user to use privmsg :X
Posted on 2003-06-25 12:00:39 by Drocon
who can share masm source codes of very simple IRC Clients?
Posted on 2004-09-04 10:40:10 by diablo2oo2
There was one on TiTi Asm page
Posted on 2004-09-04 14:52:03 by comrade