I am reading Jeff Duntenmam Assembly book for Linux and i am trying to understand the code below
Read:
mov eax,3 ; Specify sys_read call
mov ebx,0 ; Specify File Descriptor 0: Standard Input
mov ecx,buff ; Pass offset of the buffer to read to
mov edx,bufflen ; Pass number of bytes to read at one pass
int 80h ; Call sys_read to fill the buffer
mov ebp,eax ; Save # of bytes read from file for later
cmp eax, 0 ;If eax=0, sys_read reached EOF on stdin
je Done
To use the read from the system call table uses registers eax till edx. From the system call table read is 3 and goes into register eax i am reading the buffer from standard input (0) which goes into register ebx Where i would like the buffer to be stored is Buff which goes in register ecx and how larger this buffer is in edx.
Then the author does
mov ebp,eax
i am not understanding how this lets him save the actual number of bytes entered into the buffer though? fyi i am a noob when it comes to assembly. Please don't make your answers too complicated.