diff options
Diffstat (limited to 'src/cmd/8a/lex.c')
| -rw-r--r-- | src/cmd/8a/lex.c | 72 |
1 files changed, 24 insertions, 48 deletions
diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c index 474f965b35..f2ccc3361a 100644 --- a/src/cmd/8a/lex.c +++ b/src/cmd/8a/lex.c @@ -880,15 +880,14 @@ void zname(char *n, int t, int s) { - Bputc(&obuf, ANAME); /* as(2) */ - Bputc(&obuf, ANAME>>8); - Bputc(&obuf, t); /* type */ - Bputc(&obuf, s); /* sym */ + BPUTLE2(&obuf, ANAME); /* as(2) */ + BPUTC(&obuf, t); /* type */ + BPUTC(&obuf, s); /* sym */ while(*n) { - Bputc(&obuf, *n); + BPUTC(&obuf, *n); n++; } - Bputc(&obuf, 0); + BPUTC(&obuf, 0); } void @@ -923,52 +922,38 @@ zaddr(Gen *a, int s) case D_NONE: break; } - Bputc(&obuf, t); + BPUTC(&obuf, t); if(t & T_INDEX) { /* implies index, scale */ - Bputc(&obuf, a->index); - Bputc(&obuf, a->scale); + BPUTC(&obuf, a->index); + BPUTC(&obuf, a->scale); } if(t & T_OFFSET) { /* implies offset */ l = a->offset; - Bputc(&obuf, l); - Bputc(&obuf, l>>8); - Bputc(&obuf, l>>16); - Bputc(&obuf, l>>24); + BPUTLE4(&obuf, l); } if(t & T_OFFSET2) { l = a->offset2; - Bputc(&obuf, l); - Bputc(&obuf, l>>8); - Bputc(&obuf, l>>16); - Bputc(&obuf, l>>24); + BPUTLE4(&obuf, l); } if(t & T_SYM) /* implies sym */ - Bputc(&obuf, s); + BPUTC(&obuf, s); if(t & T_FCONST) { ieeedtod(&e, a->dval); - l = e.l; - Bputc(&obuf, l); - Bputc(&obuf, l>>8); - Bputc(&obuf, l>>16); - Bputc(&obuf, l>>24); - l = e.h; - Bputc(&obuf, l); - Bputc(&obuf, l>>8); - Bputc(&obuf, l>>16); - Bputc(&obuf, l>>24); + BPUTLE4(&obuf, e.l); + BPUTLE4(&obuf, e.h); return; } if(t & T_SCONST) { n = a->sval; for(i=0; i<NSNAME; i++) { - Bputc(&obuf, *n); + BPUTC(&obuf, *n); n++; } return; } if(t & T_TYPE) - Bputc(&obuf, a->type); + BPUTC(&obuf, a->type); } void @@ -1027,12 +1012,8 @@ jackpot: goto jackpot; break; } - Bputc(&obuf, a); - Bputc(&obuf, a>>8); - Bputc(&obuf, stmtline); - Bputc(&obuf, stmtline>>8); - Bputc(&obuf, stmtline>>16); - Bputc(&obuf, stmtline>>24); + BPUTLE2(&obuf, a); + BPUTLE4(&obuf, stmtline); zaddr(&g2->from, sf); zaddr(&g2->to, st); @@ -1107,13 +1088,12 @@ outhist(void) q = 0; } if(n) { - Bputc(&obuf, ANAME); - Bputc(&obuf, ANAME>>8); - Bputc(&obuf, D_FILE); /* type */ - Bputc(&obuf, 1); /* sym */ - Bputc(&obuf, '<'); + BPUTLE2(&obuf, ANAME); + BPUTC(&obuf, D_FILE); /* type */ + BPUTC(&obuf, 1); /* sym */ + BPUTC(&obuf, '<'); Bwrite(&obuf, p, n); - Bputc(&obuf, 0); + BPUTC(&obuf, 0); } p = q; if(p == 0 && op) { @@ -1123,12 +1103,8 @@ outhist(void) } g.offset = h->offset; - Bputc(&obuf, AHISTORY); - Bputc(&obuf, AHISTORY>>8); - Bputc(&obuf, h->line); - Bputc(&obuf, h->line>>8); - Bputc(&obuf, h->line>>16); - Bputc(&obuf, h->line>>24); + BPUTLE2(&obuf, AHISTORY); + BPUTLE4(&obuf, h->line); zaddr(&nullgen, 0); zaddr(&g, 0); |
