changeset 12:f928bd330351

*** empty log message ***
author kono
date Sat, 15 Jan 2000 00:01:14 +0900
parents 595a24e0b90e
children a8a812dace23
files mc-nop-386.c
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mc-nop-386.c	Fri Jan 14 13:12:49 2000 +0900
+++ b/mc-nop-386.c	Sat Jan 15 00:01:14 2000 +0900
@@ -1310,9 +1310,9 @@
 void
 code_leave(char *name)
 {
-    local_table();
     printf("_%d:\n",labelno);
     printf("\t.size\t%s,_%d-%s\n",name,labelno,name);
+    local_table();
     labelno++;
 }
 
@@ -1367,9 +1367,9 @@
     printf("\tpopl %%ebx\n");
     printf("\tleave\n");
     printf("\tret\n");
-    local_table();
     printf("_%d:\n",labelno);
     printf("\t.size\t%s,_%d-%s\n",name,labelno,name);
+    local_table();
     labelno++;
 }
 
@@ -1477,9 +1477,15 @@
 global_table(void)
 {
     NMTBL *n;
+    int init;
+    init=0;
     for(n=ntable;n < &ntable[GSYMS];n++) {
 	if (n->sc == GVAR && n->dsp != -1) {
 	    /* n->dsp = -1 means initialized global */
+	    if (init==0) {
+		data_mode(0);
+		init=1;
+	    }
 	    printf(".comm %s,%d\n",n->nm,size(n->ty));
 	}
     }
@@ -1489,9 +1495,15 @@
 local_table(void)
 {
     NMTBL *n;
+    int init;
+    init=0;
     /* static local variables */
     for(n=ntable+GSYMS;n < &ntable[GSYMS+LSYMS];n++) {
 	if (n->sc == GVAR) {
+	    if (init==0) {
+		data_mode(0);
+		init=1;
+	    }
 	    printf(".lcomm %s,%d\n",n->nm,size(n->ty));
 	}
     }