commit 307e57033e2b0dfde133c57ac5e0291e4d6c25d4
parent 9d32ef80ba084bba1a97f81f5b2859388716ab7b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 20 May 2018 08:15:21 +0100
Revert "[as] Allow left to right or right to left parsing"
This reverts commit 3a967c42aea6b064d29b12d499413a1470c44959.
Diffstat:
7 files changed, 4 insertions(+), 36 deletions(-)
diff --git a/as/ins.c b/as/ins.c
@@ -247,14 +247,3 @@ include(Op *op, Node **args)
{
addinput(args[0]->sym->name.buf);
}
-
-void
-att(Op *op, Node **args)
-{
- Symbol *sym = args[0]->sym;
- extern int left2right;
-
- if ((sym->flags & FABS) == 0)
- error("align expression is not an absolute expression");
- left2right = sym->value;
-}
diff --git a/as/main.c b/as/main.c
@@ -105,7 +105,6 @@ int
main(int argc, char *argv[])
{
char **p;
- extern int left2right;
outfile = "a.out";
@@ -113,12 +112,6 @@ main(int argc, char *argv[])
case 'o':
outfile = EARGF(usage());
break;
- case 'l':
- left2right = 1;
- break;
- case 'r':
- left2right = 0;
- break;
default:
usage();
} ARGEND
diff --git a/as/parser.c b/as/parser.c
@@ -300,24 +300,14 @@ Node **
getargs(char *s)
{
Node **ap;
- extern int left2right;
- static Node *args[NARGS+1];
+ static Node *args[NARGS];
if (!s)
return NULL;
- if (!left2right) {
- ap = args;
- do {
- if ((*ap = operand(&s)) == NULL)
- return args;
- } while (++ap < &args[NARGS]);
- } else {
- ap = &args[NARGS];
- do {
- if ((*--ap = operand(&s)) == NULL)
- return ap+1;
- } while (ap > args+1);
+ for (ap = args; ap < &args[NARGS-1]; ++ap) {
+ if ((*ap = operand(&s)) == NULL)
+ return args;
}
error("too many arguments in one instruction");
}
diff --git a/as/target/x80/x80.dat b/as/target/x80/x80.dat
@@ -33,7 +33,6 @@
.STRING string+ 0 none string Z80,R800,GB80
.ASCII string+ 0 none ascii Z80,R800,GB80
.ALIGN imm16+ 0 none align Z80,R800,GB80
-.ATT imm8 0 none att Z80,R800,GB80
.END none 0 none end Z80,R800,GB80
.INCLUDE string 0 none include Z80,R800,GB80
diff --git a/as/target/x80/z80.c b/as/target/x80/z80.c
@@ -8,7 +8,6 @@ static char sccsid[] = "@(#) ./as/target/x80/z80.c";
TUINT maxaddr = 0xFFFFFFFF;
int endian = LITTLE_ENDIAN;
-int left2right = 0;
void
iarch(void)
diff --git a/as/target/x86/amd64.c b/as/target/x86/amd64.c
@@ -5,7 +5,6 @@ static char sccsid[] = "@(#) ./as/target/x86/amd64.c";
TUINT maxaddr = 0xFFFFFFFFFFFFFFFF;
int endian = LITTLE_ENDIAN;
-int left2right = 0;
void
iarch(void)
diff --git a/as/target/x86/i386.c b/as/target/x86/i386.c
@@ -6,7 +6,6 @@ static char sccsid[] = "@(#) ./as/target/x86/i386.c";
TUINT maxaddr = 0xFFFFFFFF;
int endian = LITTLE_ENDIAN;
-int left2right = 0;
void
iarch(void)