I want to remove the last char of a string that the user inputs because its a carriage return, here is what I use but NASM gives me and error, what am I doing wrong?


mov data, 0

...

buffer:
max db 20
count db 0
data db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Posted on 2007-12-31 03:02:18 by ExtremeCoder
its ok I have it now


mov al, 0
mov bh,
mov bl, 0
mov , al
Posted on 2007-12-31 03:25:59 by ExtremeCoder

its ok I have it now


mov al, 0
mov bh,
mov bl, 0
mov , al



Not sure if that did work, but it shouldn't.

Here is something that will work, foregoing optimization.


movzx bl,BYTE ;Copies to BL, zeros-out BH, so that BX becomes the offset
add bx,data ;Offset + Base = Pointer
mov BYTE,0 ;Convert Carriage Return into Zero

Posted on 2007-12-31 13:15:27 by SpooK
thank you, appreciate it, but my version did work....
Posted on 2007-12-31 13:31:42 by ExtremeCoder