LEFT | RIGHT |
(no file at all) | |
1 // Inferno utils/8l/span.c | 1 // Inferno utils/8l/span.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/span.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/span.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 switch(a->index) { | 278 switch(a->index) { |
279 case D_EXTERN: | 279 case D_EXTERN: |
280 case D_STATIC: | 280 case D_STATIC: |
281 return Yi32; | 281 return Yi32; |
282 case D_AUTO: | 282 case D_AUTO: |
283 case D_PARAM: | 283 case D_PARAM: |
284 return Yiauto; | 284 return Yiauto; |
285 } | 285 } |
286 return Yxxx; | 286 return Yxxx; |
287 } | 287 } |
| 288 //if(a->type == D_INDIR+D_ADDR) |
| 289 // print("*Ycol\n"); |
288 return Ycol; | 290 return Ycol; |
289 } | 291 } |
290 return Ym; | 292 return Ym; |
291 } | 293 } |
292 switch(a->type) | 294 switch(a->type) |
293 { | 295 { |
294 case D_AL: | 296 case D_AL: |
295 return Yal; | 297 return Yal; |
296 | 298 |
297 case D_AX: | 299 case D_AX: |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 case Zjmpcon: | 1136 case Zjmpcon: |
1135 if(t[2] == Zcallcon) | 1137 if(t[2] == Zcallcon) |
1136 *andptr++ = op; | 1138 *andptr++ = op; |
1137 else | 1139 else |
1138 *andptr++ = o->op[z+1]; | 1140 *andptr++ = o->op[z+1]; |
1139 r = addrel(cursym); | 1141 r = addrel(cursym); |
1140 r->off = p->pc + andptr - and; | 1142 r->off = p->pc + andptr - and; |
1141 r->type = D_PCREL; | 1143 r->type = D_PCREL; |
1142 r->siz = 4; | 1144 r->siz = 4; |
1143 r->add = p->to.offset; | 1145 r->add = p->to.offset; |
| 1146 put4(0); |
| 1147 break; |
| 1148 ········ |
| 1149 case Zcallind: |
| 1150 *andptr++ = op; |
| 1151 *andptr++ = o->op[z+1]; |
| 1152 r = addrel(cursym); |
| 1153 r->off = p->pc + andptr - and; |
| 1154 r->type = D_ADDR; |
| 1155 r->siz = 4; |
| 1156 r->add = p->to.offset; |
| 1157 r->sym = p->to.sym; |
1144 put4(0); | 1158 put4(0); |
1145 break; | 1159 break; |
1146 | 1160 |
1147 case Zbyte: | 1161 case Zbyte: |
1148 v = vaddr(&p->from, &rel); | 1162 v = vaddr(&p->from, &rel); |
1149 if(rel.siz != 0) { | 1163 if(rel.siz != 0) { |
1150 rel.siz = op; | 1164 rel.siz = op; |
1151 r = addrel(cursym); | 1165 r = addrel(cursym); |
1152 *r = rel; | 1166 *r = rel; |
1153 r->off = p->pc + andptr - and; | 1167 r->off = p->pc + andptr - and; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 void | 1329 void |
1316 asmins(Prog *p) | 1330 asmins(Prog *p) |
1317 { | 1331 { |
1318 andptr = and; | 1332 andptr = and; |
1319 doasm(p); | 1333 doasm(p); |
1320 if(andptr > and+sizeof and) { | 1334 if(andptr > and+sizeof and) { |
1321 print("and[] is too short - %ld byte instruction\n", andptr - an
d); | 1335 print("and[] is too short - %ld byte instruction\n", andptr - an
d); |
1322 errorexit(); | 1336 errorexit(); |
1323 } | 1337 } |
1324 } | 1338 } |
LEFT | RIGHT |