8 fmtinstall('A', Aconv);
9 fmtinstall('P', Pconv);
10 fmtinstall('S', Sconv);
11 fmtinstall('N', Nconv);
12 fmtinstall('D', Dconv);
13 fmtinstall('B', Bconv);
19 char str[STRINGSZ], ss[STRINGSZ], *s;
23 memset(str, 0, sizeof str);
24 bits = va_arg(fp->args, Bits);
28 strncat(str, " ", sizeof str - 1);
30 snprint(ss, sizeof ss, "$%ld", var[i].offset);
34 strncat(str, s, sizeof str - 1);
35 bits.b[i/32] &= ~(1L << (i%32));
37 return fmtstrcpy(fp, str);
47 p = va_arg(fp->args, Prog*);
50 snprint(str, sizeof str, " %A %D/%d,%D", a, &p->from, p->reg, &p->to);
53 snprint(str, sizeof str, " %A %D,%d,%D", a, &p->from, p->reg, &p->to);
56 snprint(str, sizeof str, " %A %D,%D", a, &p->from, &p->to);
58 if(p->from.type != D_FREG)
59 snprint(str, sizeof str, " %A %D,R%d,%D", a, &p->from, p->reg, &p->to);
61 snprint(str, sizeof str, " %A %D,F%d,%D", a, &p->from, p->reg, &p->to);
62 return fmtstrcpy(fp, str);
71 a = va_arg(fp->args, int);
73 if(a >= AXXX && a <= AEND)
75 return fmtstrcpy(fp, s);
84 a = va_arg(fp->args, Adr*);
88 snprint(str, sizeof str, "GOK-type(%d)", a->type);
93 if(a->name != D_NONE || a->reg != NREG || a->sym != S)
94 snprint(str, sizeof str, "%N(R%d)(NONE)", a, a->reg);
99 snprint(str, sizeof str, "$%N(R%d)", a, a->reg);
101 snprint(str, sizeof str, "$%N", a);
106 snprint(str, sizeof str, "%N(R%d)", a, a->reg);
108 snprint(str, sizeof str, "%N", a);
112 snprint(str, sizeof str, "R%d", a->reg);
113 if(a->name != D_NONE || a->sym != S)
114 snprint(str, sizeof str, "%N(R%d)(REG)", a, a->reg);
118 snprint(str, sizeof str, "F%d", a->reg);
119 if(a->name != D_NONE || a->sym != S)
120 snprint(str, sizeof str, "%N(F%d)(REG)", a, a->reg);
124 snprint(str, sizeof str, "C%d", a->reg);
125 if(a->name != D_NONE || a->sym != S)
126 snprint(str, sizeof str, "%N(C%d)(REG)", a, a->reg);
130 snprint(str, sizeof str, "%ld(PC)", a->offset-pc);
134 snprint(str, sizeof str, "$%.17e", a->dval);
138 snprint(str, sizeof str, "$\"%S\"", a->sval);
141 return fmtstrcpy(fp, str);
148 char str[STRINGSZ], *p, *a;
150 a = va_arg(fp->args, char*);
152 for(i=0; i<NSNAME; i++) {
154 if(c >= 'a' && c <= 'z' ||
155 c >= 'A' && c <= 'Z' ||
156 c >= '0' && c <= '9' ||
157 c == ' ' || c == '%') {
184 *p++ = ((c>>3) & 7) + '0';
185 *p++ = (c & 7) + '0';
188 return fmtstrcpy(fp, str);
198 a = va_arg(fp->args, Adr*);
201 snprint(str, sizeof str, "%ld", a->offset);
206 snprint(str, sizeof str, "GOK-name(%d)", a->name);
210 snprint(str, sizeof str, "%s+%ld(SB)", s->name, a->offset);
214 snprint(str, sizeof str, "%s<>+%ld(SB)", s->name, a->offset);
218 snprint(str, sizeof str, "%s-%ld(SP)", s->name, -a->offset);
222 snprint(str, sizeof str, "%s+%ld(FP)", s->name, a->offset);
226 return fmtstrcpy(fp, str);