* as/link/lkar.h: sgetl and sputl are independent of endianness
[fw/sdcc] / as / xa51 / xa_main.c
index 50c1d44d0c758c99251f831bb3c574694a5cf778..345ca7e4ec44498a524c0ff0e3430715f88149c7 100644 (file)
@@ -286,15 +286,15 @@ void print_symbol_table()
     fprintf(sym_fp, " Line %d\n", p->line_def);
 #else
     if (p->issfr) {
-      fprintf (sym_fp, "%-5s", "SFR");
+      fprintf (sym_fp, "%-7s", "SFR");
     } else if (p->isbit && !p->area) {
-      fprintf (sym_fp, "%-5s", "SBIT");
+      fprintf (sym_fp, "%-7s", "SBIT");
     } else if (p->mode=='=') {
-      fprintf (sym_fp,"ABS");
+      fprintf (sym_fp,"ABS    ");
     } else if (!p->isdef) {
-      fprintf (sym_fp,"EXTRN");
+      fprintf (sym_fp,"EXTRN  ");
     } else {
-      fprintf (sym_fp, "%-5s", areaToString(p->area));
+      fprintf (sym_fp, "%-7s", areaToString(p->area));
     }
     fprintf (sym_fp, " 0x%04x (%5d)", p->value, p->value);
     fprintf (sym_fp, " %s", p->isdef ? "D" : "-");
@@ -384,6 +384,17 @@ struct symbol *is_ref(char *thename) {
   return NULL;
 }
 
+int is_abs(char *thename) {
+  struct symbol *p;
+  p = sym_list;
+  while (p != NULL) {
+    if (strcasecmp(thename, p->name)==0) 
+      return p->mode == '=';
+    p = p->next;
+  }
+  return 0;
+}
+
 /* this routine is used to dump a group of bytes to the output */
 /* it is responsible for generating the list file and sending */
 /* the bytes one at a time to the object code generator */
@@ -473,14 +484,16 @@ void out(int *byte_list, int num) {
 
 void pad_with_nop()
 {
-       static int nops[] = {NOP_OPCODE, NOP_OPCODE, NOP_OPCODE, NOP_OPCODE};
-       int num;
-
-       last_line_text[0] = '\0';
-
-       for(num=0; (MEM_POS + num) % BRANCH_SPACING; num++) ;
-       if (p3) out(nops, num);
-       MEM_POS += num;
+  static int nops[] = {NOP_OPCODE, NOP_OPCODE, NOP_OPCODE, NOP_OPCODE};
+  int num;
+  
+  last_line_text[0] = '\0';
+  
+  for(num=0; (MEM_POS + num) % BRANCH_SPACING; num++) {
+    sprintf (last_line_text, "\tnop\t; word allignment");
+  }
+  if (p3) out(nops, num);
+  MEM_POS += num;
 }
 
 /* print branch out of bounds error */
@@ -533,9 +546,8 @@ void relPrelude() {
   }
   for (p=sym_list; p; p=p->next) {
     if (p->isdef) {
-      // skip temp labels, sfr and sbit
-      if (p->name[strlen(p->name)-1]!='$' &&
-         p->area) {
+      // skip temp labels
+      if (p->name[strlen(p->name)-1]!='$') {
        globals++;
       }
     }