Linux syscall to read stdin reads enter several times?

Programming, for all ages and all languages.
Post Reply
User avatar
eino
Member
Member
Posts: 49
Joined: Fri Sep 16, 2011 10:00 am
Location: Finland

Linux syscall to read stdin reads enter several times?

Post 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
I'm Eino Tuominen from Finland, a web software dev learning low level stuff and reading / trying out kernel dev
Anickyan
Posts: 1
Joined: Fri Jun 21, 2013 5:21 am

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

Post 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.
Post Reply