summaryrefslogtreecommitdiff
path: root/as
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1999-12-17 19:06:32 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:43:38 +0200
commit3401185106fb312c6a7bba3d9e90d44b6df0043b (patch)
tree63bace6fae9b547cc0c939c6803185cc3ad8aa0e /as
parent3d4957c86ff239b24b43933924ec72a3fd288518 (diff)
downloaddev86-3401185106fb312c6a7bba3d9e90d44b6df0043b.tar.gz
Import Dev86src-0.15.0.tar.gzv0.15.0
Diffstat (limited to 'as')
-rw-r--r--as/TODO4
-rw-r--r--as/as.doc2
-rw-r--r--as/express.c16
-rw-r--r--as/mops.c13
-rw-r--r--as/pops.c13
5 files changed, 34 insertions, 14 deletions
diff --git a/as/TODO b/as/TODO
index c7ff1e1..4cf413d 100644
--- a/as/TODO
+++ b/as/TODO
@@ -1,4 +1,3 @@
-
Update 6809/const.h.
Produce bsd symbol tables.
@@ -9,3 +8,6 @@ Decide how to choose between 8-bit and 32-bit branches. 16-bit branches in
32-bit mode are unusable because top 16 bits of PC are messed up.
Buffer for printing of listing.
+
+Need to make assembler remember the code it generated in the penultimate
+pass and regenerate code of exactly the same length in the last pass.
diff --git a/as/as.doc b/as/as.doc
index 99273ef..cb6a649 100644
--- a/as/as.doc
+++ b/as/as.doc
@@ -31,7 +31,7 @@ cc1 output and Minix's make does the wrong thing with .s files left around.
However, all assembler code not written by compilers should assemble with
them turned off.
-The -b flag now produces a 'raw' binary file with no header, if there's no
+The -b flag produces a 'raw' binary file with no header, if there's no
-s flag the file starts at location 0. The -s generates an ASCII symbol
table, if a binary file doesn't start at location zero the first two items
are the start and end addresses of the binary file.
diff --git a/as/express.c b/as/express.c
index 023e2dd..65923b5 100644
--- a/as/express.c
+++ b/as/express.c
@@ -42,7 +42,10 @@ error_pt errnum;
PRIVATE void expundefined()
{
- lastexp.data = FORBIT | UNDBIT;
+ if( last_pass == 1 )
+ lastexp.data = FORBIT | UNDBIT;
+ else
+ lastexp.data = UNDBIT;
}
PUBLIC void nonimpexpres()
@@ -278,13 +281,18 @@ PUBLIC void factor()
{
if (!(symptr->type & (LABIT | VARBIT)))
{
- symptr->data |= FORBIT;
+ if( last_pass == 1 )
+ symptr->data |= FORBIT;
lastexp.sym = symptr;
}
if (pass != last_pass)
{
- lastexp.data = symptr->data &
- (FORBIT | RELBIT | UNDBIT | SEGM);
+ if( last_pass == 1 )
+ lastexp.data = symptr->data &
+ (FORBIT | RELBIT | UNDBIT | SEGM);
+ else
+ lastexp.data = symptr->data &
+ (RELBIT | UNDBIT | SEGM);
/* possible flags for pass 1 */
lastexp.offset = symptr->value_reg_or_op.value;
}
diff --git a/as/mops.c b/as/mops.c
index dd00f3a..2ccf0c7 100644
--- a/as/mops.c
+++ b/as/mops.c
@@ -853,8 +853,9 @@ register struct ea_s *eap;
}
}
}
- if (!(symptr->type & (LABIT | MACBIT | MNREGBIT | VARBIT)))
- symptr->data |= FORBIT; /* show seen in advance */
+ if( last_pass == 1 )
+ if (!(symptr->type & (LABIT | MACBIT | MNREGBIT | VARBIT)))
+ symptr->data |= FORBIT; /* show seen in advance */
}
if ((eap->base = regchk()) != NOREG)
{
@@ -1216,7 +1217,7 @@ PUBLIC void mcall()
if (lastexp.data & IMPBIT)
{
error(NONIMPREQ);
- lastexp.data = FORBIT | UNDBIT;
+ lastexp.data = FORBIT | UNDBIT;
}
mshort2();
}
@@ -2905,8 +2906,10 @@ PRIVATE reg_pt regchk()
return regno;
}
}
- else if (!(symptr->type & (LABIT | MACBIT | VARBIT)))
- symptr->data |= FORBIT; /* show seen in advance */
+ else
+ if( last_pass == 1 )
+ if (!(symptr->type & (LABIT | MACBIT | VARBIT)))
+ symptr->data |= FORBIT; /* show seen in advance */
}
return NOREG;
}
diff --git a/as/pops.c b/as/pops.c
index 64e2268..70efaf5 100644
--- a/as/pops.c
+++ b/as/pops.c
@@ -145,7 +145,10 @@ PRIVATE void docomm()
labptr->type |= COMMBIT;
if (lcommflag)
labptr->type |= REDBIT; /* kludge - COMMBIT | REDBIT => SA */
- labptr->data = (lcdata & SEGM) | (FORBIT | IMPBIT | RELBIT);
+ if( last_pass == 1 )
+ labptr->data = (lcdata & SEGM) | (FORBIT | IMPBIT | RELBIT);
+ else
+ labptr->data = (lcdata & SEGM) | (IMPBIT | RELBIT);
showlabel();
}
}
@@ -531,8 +534,10 @@ PUBLIC void pcomm1()
/* Like import. */
if (label->type & (EXPBIT | LABIT))
error(ALREADY);
- else
+ else if( last_pass == 1 )
label->data = lcdata | (FORBIT | IMPBIT | RELBIT);
+ else
+ label->data = lcdata | (IMPBIT | RELBIT);
getsym();
getcomma();
if (label->type & (EXPBIT | LABIT))
@@ -819,9 +824,11 @@ PUBLIC void pimport()
if (symptr->type & (COMMBIT | EXPBIT | LABIT))
/* IMPORT is null if label (to be) declared */
error(ALREADY);
- else
+ else if( last_pass == 1 )
/* get current segment from lcdata, no need to mask rest */
symptr->data = lcdata | (FORBIT | IMPBIT | RELBIT);
+ else
+ symptr->data = lcdata | (IMPBIT | RELBIT);
}
getsym();
if (sym != COMMA)