diff options
author | Robert de Bath <rdebath@poboxes.com> | 1999-12-17 19:06:32 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:43:38 +0200 |
commit | 3401185106fb312c6a7bba3d9e90d44b6df0043b (patch) | |
tree | 63bace6fae9b547cc0c939c6803185cc3ad8aa0e /as | |
parent | 3d4957c86ff239b24b43933924ec72a3fd288518 (diff) | |
download | dev86-3401185106fb312c6a7bba3d9e90d44b6df0043b.tar.gz |
Import Dev86src-0.15.0.tar.gzv0.15.0
Diffstat (limited to 'as')
-rw-r--r-- | as/TODO | 4 | ||||
-rw-r--r-- | as/as.doc | 2 | ||||
-rw-r--r-- | as/express.c | 16 | ||||
-rw-r--r-- | as/mops.c | 13 | ||||
-rw-r--r-- | as/pops.c | 13 |
5 files changed, 34 insertions, 14 deletions
@@ -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. @@ -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; } @@ -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; } @@ -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) |