ATOI (III) 1/15/73 ATOI (III)
NAME atoi -- ascii to integer
SYNOPSIS jsr r5,atoi; subr
DESCRIPTION atoi will convert an ascii stream to a binary
number returned in r1.
The subroutine subr (supplied by the caller) is
called on r5 for each character of the ascii
stream. subr should return the character in r0.
The first character not used in the conversion is
left in r0.
The numbers recognized are: an optional minus
sign followed by a string of digits.
The subroutine subr must not disturb any regis-
ters.
FILES kept in /lib/liba.a
SEE ALSO --
DIAGNOSTICS There are none; the routine charges on regardless
of consequences; see BUGS.
BUGS It pays no attention to overflow - you get what-
ever the machine instructions mul and div happen
to leave in the low order half - in fact, the
carry bit should be set and isn't.
The routine should accept initial "+" and initial
blanks.