7 fmtinstall('A', Aconv);
8 fmtinstall('P', Pconv);
9 fmtinstall('S', Sconv);
10 fmtinstall('N', Nconv);
11 fmtinstall('B', Bconv);
12 fmtinstall('D', Dconv);
18 char str[STRINGSZ], ss[STRINGSZ], *s;
22 memset(str, 0, sizeof str);
23 bits = va_arg(fp->args, Bits);
27 strncat(str, " ", sizeof str - 1);
29 snprint(ss, sizeof ss, "$%ld", var[i].offset);
33 strncat(str, s, sizeof str - 1);
34 bits.b[i/32] &= ~(1L << (i%32));
36 return fmtstrcpy(fp, str);
46 p = va_arg(fp->args, Prog*);
49 snprint(str, sizeof str, " %A %D/%d,%D", a, &p->from, p->reg, &p->to);
52 snprint(str, sizeof str, " %A %D,%d,%D", a, &p->from, p->reg, &p->to);
55 snprint(str, sizeof str, " %A %D,%D", a, &p->from, &p->to);
57 if(p->from.type != D_FREG)
58 snprint(str, sizeof str, " %A %D,R%d,%D", a, &p->from, p->reg, &p->to);
60 snprint(str, sizeof str, " %A %D,F%d,%D", a, &p->from, p->reg, &p->to);
61 return fmtstrcpy(fp, str);
70 a = va_arg(fp->args, int);
72 if(a >= AXXX && a < ALAST)
74 return fmtstrcpy(fp, s);
83 a = va_arg(fp->args, Adr*);
87 snprint(str, sizeof str, "GOK-type(%d)", a->type);
92 if(a->name != D_NONE || a->reg != NREG || a->sym != S)
93 snprint(str, sizeof str, "%N(R%d)(NONE)", a, a->reg);
98 snprint(str, sizeof str, "$%N(R%d)", a, a->reg);
100 snprint(str, sizeof str, "$%N", a);
105 snprint(str, sizeof str, "%N(R%d)", a, a->reg);
107 snprint(str, sizeof str, "%N", a);
111 snprint(str, sizeof str, "R%d", a->reg);
112 if(a->name != D_NONE || a->sym != S)
113 snprint(str, sizeof str, "%N(R%d)(REG)", a, a->reg);
117 snprint(str, sizeof str, "F%d", a->reg);
118 if(a->name != D_NONE || a->sym != S)
119 snprint(str, sizeof str, "%N(R%d)(REG)", a, a->reg);
123 snprint(str, sizeof str, "FCR%d", a->reg);
124 if(a->name != D_NONE || a->sym != S)
125 snprint(str, sizeof str, "%N(R%d)(REG)", a, a->reg);
129 snprint(str, sizeof str, "LO");
130 if(a->name != D_NONE || a->sym != S)
131 snprint(str, sizeof str, "%N(LO)(REG)", a);
135 snprint(str, sizeof str, "HI");
136 if(a->name != D_NONE || a->sym != S)
137 snprint(str, sizeof str, "%N(HI)(REG)", a);
141 snprint(str, sizeof str, "%ld(PC)", a->offset-pc);
145 snprint(str, sizeof str, "$%.17e", a->dval);
149 snprint(str, sizeof str, "$\"%S\"", a->sval);
152 return fmtstrcpy(fp, str);
159 char str[STRINGSZ], *p, *a;
161 a = va_arg(fp->args, char*);
163 for(i=0; i<NSNAME; i++) {
165 if(c >= 'a' && c <= 'z' ||
166 c >= 'A' && c <= 'Z' ||
167 c >= '0' && c <= '9' ||
168 c == ' ' || c == '%') {
195 *p++ = ((c>>3) & 7) + '0';
196 *p++ = (c & 7) + '0';
199 return fmtstrcpy(fp, str);
209 a = va_arg(fp->args, Adr*);
212 snprint(str, sizeof str, "%ld", a->offset);
217 snprint(str, sizeof str, "GOK-name(%d)", a->name);
221 snprint(str, sizeof str, "%ld", a->offset);
225 snprint(str, sizeof str, "%s+%ld(SB)", s->name, a->offset);
229 snprint(str, sizeof str, "%s<>+%ld(SB)", s->name, a->offset);
233 snprint(str, sizeof str, "%s-%ld(SP)", s->name, -a->offset);
237 snprint(str, sizeof str, "%s+%ld(FP)", s->name, a->offset);
241 return fmtstrcpy(fp, str);