--- cci/usr/src/bin/as/asjxxx.c 2019/07/28 12:24:19 1.1 +++ cci/usr/src/bin/as/asjxxx.c 2019/07/28 12:27:32 1.1.1.2 @@ -196,6 +196,53 @@ jalign(xp, sp) } } +djalign(xp, sp) + register struct exp *xp; + register struct symtab *sp; +{ + register int mask; + + if ( ( (xp->e_xtype & XTYPE) != XABS) + || (xp->e_xvalue < 0) + || (xp->e_xvalue > 16) + ) { + yyerror("Illegal `align' argument"); + return; + } + if (xp->e_xvalue > 2){ + if (passno == 1){ + yywarning(".align %d is NOT preserved by the loader", + xp->e_xvalue); + yywarning(".align %d converted to .align 2", + xp->e_xvalue); + } + xp->e_xvalue = 2; + } + flushfield(NBPW/4); + mask = (1 << xp->e_xvalue) - 1; + if (passno == 1) { + sp->s_tag = JXALIGN; + sp->s_jxfear = (1 << xp->e_xvalue) - 1; + sp->s_type = dotp->e_xtype; + sp->s_index = dotp-usedot; + while (dotp->e_xvalue & mask) + dotp->e_xvalue ++; + sp->s_value = dotp->e_xvalue; + njxxx++; + } else { + while (dotp->e_xvalue & mask) + { + Outb(0); + if (liston) + { + *layoutpos++ = '0'; + *layoutpos++ = '0'; + } + } + } +} + + /* * Pass 1.5, resolve jxxx instructions and .align in .text */