Gets

VAX11

 

Gets

 

Description:    Read line from the keyboard to a buffer. The function stop getting
                        input when it reaches NUL(0), CR(0x0D) or LF(0x0A). The ending
                        character is replaced with NUL(0).

Gets:               In stack: Buffer's address .

Returns:         In R0: buffer's address for success, -1 on EOF or 0 if the string
                        contains ctrl+D (0x04) only.

                        In buffer: user's string, ended with ASCII 0

 

Example:

 

.text

 

main: .word 0

 

      pushal buffer

      calls $1, .gets         # Get a line

 

      pushl $0

      calls $1, .exit

 

 

.data

buffer: .space 80