#include <stdio.h>
#include <setjmp.h>
#include <string.h>
-#include <alloc.h>
+
#include "asm.h"
/*)Module aslex.c
* char endline()
* char get()
* VOID getid(id,c)
- * int getline()
+ * int as_getline()
* int getmap()
* char getnb()
* VOID getst()
VOID
getid(id, c)
-register c;
+register int c;
char *id;
{
register char *p;
VOID
getst(id, c)
-register c;
+register int c;
char *id;
{
register char *p;
do {
if (p < &id[NCPS])
*p++ = c;
- } while (ctype[c=get()] & ~(SPACE|ILL));
+ } while (ctype[c=get()] & (0xFF - (SPACE|ILL)));
unget(c);
while (p < &id[NCPS])
*p++ = 0;
char
getnb()
{
- register c;
+ register int c;
while ((c=get()) == ' ' || c == '\t')
;
char
get()
{
- register c;
+ register int c;
if ((c = *ip) != 0)
++ip;
int
getmap(d)
{
- register c, n, v;
+ register int c, n, v;
if ((c=get()) == '\0')
qerr();
return (c);
}
-/*)Function int getline()
+/*)Function int as_getline()
*
- * The function getline() reads a line of assembler-source text
+ * The function as_getline() reads a line of assembler-source text
* from an assembly source text file or an include file.
* Lines of text are processed from assembler-source files until
* all files have been read. If an include file is opened then
* include file) until the end of the include file is found.
* The input text line is copied into the global string ib[]
* and converted to a NULL terminated string. The function
- * getline() returns a (1) after succesfully reading a line
+ * as_getline() returns a (1) after succesfully reading a line
* or a (0) if all files have been read.
*
* local variables:
*/
int
-getline()
+as_getline()
{
-register i;
+register int i;
loop: if (incfil >= 0) {
if (fgets(ib, sizeof ib, ifp[incfil]) == NULL) {
i = strlen(ib) - 1;
if (ib[i] == '\n')
ib[i] = 0;
+ if (i >= 1 && ib[i-1] == '\r')
+ ib[i-1] = 0;
return (1);
}
int
more()
{
- register c;
+ register int c;
c = getnb();
unget(c);
char
endline()
{
- register c;
+ register int c;
c = getnb();
return( (c == '\0' || c == ';') ? 0 : c );