8 fmtinstall('A', Aconv);
9 fmtinstall('B', Bconv);
10 fmtinstall('P', Pconv);
11 fmtinstall('S', Sconv);
12 fmtinstall('D', Dconv);
13 fmtinstall('R', Rconv);
22 bits = va_arg(fp->args, Bits);
25 bits.b[i/32] &= ~(1L << (i%32));
27 fmtprint(fp, "$%ld ", var[i].offset);
29 fmtprint(fp, "%s ", var[i].sym->name);
40 p = va_arg(fp->args, Prog*);
42 snprint(str, sizeof(str), " %A %D/%d,%D",
43 p->as, &p->from, p->from.scale, &p->to);
44 else if(p->as == ATEXT)
45 snprint(str, sizeof(str), " %A %D,%d,%D",
46 p->as, &p->from, p->from.scale, &p->to);
48 snprint(str, sizeof(str), " %A %D,%D",
49 p->as, &p->from, &p->to);
50 return fmtstrcpy(fp, str);
58 i = va_arg(fp->args, int);
59 return fmtstrcpy(fp, anames[i]);
69 a = va_arg(fp->args, Adr*);
73 snprint(str, sizeof(str), "%ld(%R)", a->offset, i-D_INDIR);
75 snprint(str, sizeof(str), "(%R)", i-D_INDIR);
82 snprint(str, sizeof(str), "$%ld,%R", a->offset, i);
84 snprint(str, sizeof(str), "%R", i);
92 snprint(str, sizeof(str), "%ld(PC)", a->offset-pc);
96 snprint(str, sizeof(str), "%s+%ld(SB)", a->sym->name, a->offset);
100 snprint(str, sizeof(str), "%s<>+%ld(SB)", a->sym->name, a->offset);
104 snprint(str, sizeof(str), "%s+%ld(SP)", a->sym->name, a->offset);
109 snprint(str, sizeof(str), "%s+%ld(FP)", a->sym->name, a->offset);
111 snprint(str, sizeof(str), "%ld(FP)", a->offset);
115 snprint(str, sizeof(str), "$%ld", a->offset);
119 snprint(str, sizeof(str), "$(%.17e)", a->dval);
123 snprint(str, sizeof(str), "$\"%S\"", a->sval);
129 snprint(str, sizeof(str), "$%D", a);
135 if(a->index != D_NONE)
136 return fmtprint(fp, "%s(%R*%d)", str, (int)a->index, (int)a->scale);
138 return fmtstrcpy(fp, str);
219 r = va_arg(fp->args, int);
220 if(r >= D_AL && r <= D_NONE)
221 snprint(str, sizeof(str), "%s", regstr[r-D_AL]);
223 snprint(str, sizeof(str), "gok(%d)", r);
225 return fmtstrcpy(fp, str);
232 char str[30], *p, *a;
234 a = va_arg(fp->args, char*);
236 for(i=0; i<sizeof(double); i++) {
238 if(c >= 'a' && c <= 'z' ||
239 c >= 'A' && c <= 'Z' ||
240 c >= '0' && c <= '9') {
247 if(c < 040 || c >= 0177)
248 break; /* not portable */
266 *p++ = ((c>>3) & 7) + '0';
267 *p++ = (c & 7) + '0';
270 return fmtstrcpy(fp, str);