comparison mc-nop-386.c @ 12:f928bd330351

*** empty log message ***
author kono
date Sat, 15 Jan 2000 00:01:14 +0900
parents e2c2c0fe0785
children a8a812dace23
comparison
equal deleted inserted replaced
11:595a24e0b90e 12:f928bd330351
1308 } 1308 }
1309 1309
1310 void 1310 void
1311 code_leave(char *name) 1311 code_leave(char *name)
1312 { 1312 {
1313 local_table();
1314 printf("_%d:\n",labelno); 1313 printf("_%d:\n",labelno);
1315 printf("\t.size\t%s,_%d-%s\n",name,labelno,name); 1314 printf("\t.size\t%s,_%d-%s\n",name,labelno,name);
1315 local_table();
1316 labelno++; 1316 labelno++;
1317 } 1317 }
1318 1318
1319 void 1319 void
1320 enter(char *name) 1320 enter(char *name)
1365 printf("\tpopl %%edx\n"); 1365 printf("\tpopl %%edx\n");
1366 printf("\tpopl %%ecx\n"); 1366 printf("\tpopl %%ecx\n");
1367 printf("\tpopl %%ebx\n"); 1367 printf("\tpopl %%ebx\n");
1368 printf("\tleave\n"); 1368 printf("\tleave\n");
1369 printf("\tret\n"); 1369 printf("\tret\n");
1370 local_table();
1371 printf("_%d:\n",labelno); 1370 printf("_%d:\n",labelno);
1372 printf("\t.size\t%s,_%d-%s\n",name,labelno,name); 1371 printf("\t.size\t%s,_%d-%s\n",name,labelno,name);
1372 local_table();
1373 labelno++; 1373 labelno++;
1374 } 1374 }
1375 1375
1376 1376
1377 void 1377 void
1475 1475
1476 void 1476 void
1477 global_table(void) 1477 global_table(void)
1478 { 1478 {
1479 NMTBL *n; 1479 NMTBL *n;
1480 int init;
1481 init=0;
1480 for(n=ntable;n < &ntable[GSYMS];n++) { 1482 for(n=ntable;n < &ntable[GSYMS];n++) {
1481 if (n->sc == GVAR && n->dsp != -1) { 1483 if (n->sc == GVAR && n->dsp != -1) {
1482 /* n->dsp = -1 means initialized global */ 1484 /* n->dsp = -1 means initialized global */
1485 if (init==0) {
1486 data_mode(0);
1487 init=1;
1488 }
1483 printf(".comm %s,%d\n",n->nm,size(n->ty)); 1489 printf(".comm %s,%d\n",n->nm,size(n->ty));
1484 } 1490 }
1485 } 1491 }
1486 } 1492 }
1487 1493
1488 void 1494 void
1489 local_table(void) 1495 local_table(void)
1490 { 1496 {
1491 NMTBL *n; 1497 NMTBL *n;
1498 int init;
1499 init=0;
1492 /* static local variables */ 1500 /* static local variables */
1493 for(n=ntable+GSYMS;n < &ntable[GSYMS+LSYMS];n++) { 1501 for(n=ntable+GSYMS;n < &ntable[GSYMS+LSYMS];n++) {
1494 if (n->sc == GVAR) { 1502 if (n->sc == GVAR) {
1503 if (init==0) {
1504 data_mode(0);
1505 init=1;
1506 }
1495 printf(".lcomm %s,%d\n",n->nm,size(n->ty)); 1507 printf(".lcomm %s,%d\n",n->nm,size(n->ty));
1496 } 1508 }
1497 } 1509 }
1498 } 1510 }
1499 1511