conversion to new assembler syntax
authorceriel <none@none>
Fri, 16 Jan 1987 17:17:12 +0000 (17:17 +0000)
committerceriel <none@none>
Fri, 16 Jan 1987 17:17:12 +0000 (17:17 +0000)
mach/ns/ncg/mach.c
mach/ns/ncg/mach.h

index 0d33f34..965feca 100644 (file)
@@ -27,7 +27,7 @@ con_mult(sz)
 {
        if (sz != 4)
                fatal("bad icon/ucon size");
-       fprintf(codefile,".long\t%s\n",str);
+       fprintf(codefile,".data4\t%s\n",str);
 }
 
 #ifdef REGVARS
@@ -75,7 +75,7 @@ f_regsave(){
                fprintf(codefile,"%c%s", c, regadm[i].ra_str);
                c = ',';
        }
-       fprintf(codefile, "], %d\n", lbytes);
+       fprintf(codefile, "], %ld\n", lbytes);
        for (i=0;i<n_regvars;i++)
                if (regadm[i].ra_off>=0)
                        fprintf(codefile, "movd %ld(fp), %s",
@@ -129,17 +129,17 @@ mes(type) word type ; {
 prolog(nlocals) full nlocals; {
 
 #ifndef REGVARS
-       fprintf(codefile, "enter[], %d\n",nlocals);
+       fprintf(codefile, "enter[], %ld\n",nlocals);
 #else
        lbytes = nlocals;
 #endif
 }
 
 char *segname[] = {
-       ".text",
-       ".data",
-       ".data",
-       ".bss"
+       ".sect .text",
+       ".sect .data",
+       ".sect .rom",
+       ".sect .bss"
 };
 
 con_float() {
index 91ce7f7..225c9dc 100644 (file)
@@ -6,19 +6,22 @@
 #define newilb(x)       fprintf(codefile,"%s:\n",x)
 #define newdlb(x)       fprintf(codefile,"%s:\n",x)
 #define dlbdlb(x,y)     fprintf(codefile,"%s = %s\n",x,y)
-#define newlbss(l,x)    fprintf(codefile,"%s:.space\t%d\n",l,x);
+#define newlbss(l,x)    fprintf(codefile,"%s:.space\t%ld\n",l,x);
 
-#define cst_fmt         "%d"
-#define off_fmt         "%d"
+#define cst_fmt         "%ld"
+#define off_fmt         "%ld"
 #define ilb_fmt         "I%03x%x"
 #define dlb_fmt         "_%d"
 #define hol_fmt         "hol%d"
 
-#define hol_off         "%d+hol%d"
+#define hol_off         "%ld+hol%d"
 
-#define con_cst(x)      fprintf(codefile,".long\t%d\n",x)
-#define con_ilb(x)      fprintf(codefile,".long\t%s\n",x)
-#define con_dlb(x)      fprintf(codefile,".long\t%s\n",x)
+#define con_cst(x)      fprintf(codefile,".data4\t%ld\n",x)
+#define con_ilb(x)      fprintf(codefile,".data4\t%s\n",x)
+#define con_dlb(x)      fprintf(codefile,".data4\t%s\n",x)
+
+#define fmt_id(fr,to)  sprintf(to, "_%s", fr)
+
+#define modhead                ".sect .text; .sect .rom; .sect .data; .sect .bss\n"
 
-#define id_first        '_'
 #define BSS_INIT        0