Page 1 of 1

Linux syscall to read stdin reads enter several times?

Posted: Sat Jul 27, 2013 7:31 am
by eino
Hi I'm using the syscall 3 to read stdin into a buffer in a loop but somehow after pressing enter several reads happen... So does the enter "stick" while the key is pressed? I'm posting on a mobile device so I don't have asm source here but will post it later if needed. Thanks!


Edit:

Here's the code. It's in a function that I call in a for kind of loop.

Code: Select all

segment .bss
input_string:	resb 32

segment .text
mov eax, 3
mov ebx, 0
mov ecx, 32
mov edx, input_string
int 80h

Re: Linux syscall to read stdin reads enter several times?

Posted: Wed Aug 07, 2013 2:23 am
by Anickyan
First of all, the buffer goes in ECX, and the amount of bytes to read goes in EDX.

Also, if you want to read from stdin, you put 1 in EBX.