diff lwasm/list.c @ 142:697bc543368c

Implement distinction between . and * for OS9 modules
author lost@l-w.ca
date Fri, 19 Aug 2011 23:55:40 -0600
parents 43a3f1068027
children f8b33b3a45ac
line wrap: on
line diff
--- a/lwasm/list.c	Fri Aug 19 20:36:43 2011 -0600
+++ b/lwasm/list.c	Fri Aug 19 23:55:40 2011 -0600
@@ -110,11 +110,11 @@
 				memmove(obytes, cl -> output, cl -> outputl);
 			}
 		}
-		if (cl -> len < 1 && obytelen < 1)
+		if ((cl -> len < 1 && cl -> dlen < 1) && obytelen < 1)
 		{
 			if (cl -> soff >= 0)
 			{
-				fprintf(of, "%04X                  ", cl -> soff & 0xffff);
+				fprintf(of, "%04Xs                 ", cl -> soff & 0xffff);
 			}
 			else if (cl -> dshow >= 0)
 			{
@@ -153,13 +153,16 @@
 		else
 		{
 			lw_expr_t te;
-			te = lw_expr_copy(cl -> addr);
+			if (instab[cl -> insn].flags & lwasm_insn_setdata)
+				te = lw_expr_copy(cl -> daddr);
+			else
+				te = lw_expr_copy(cl -> addr);
 			as -> exportcheck = 1;
 			as -> csect = cl -> csect;
 			lwasm_reduce_expr(as, te);
 			as -> exportcheck = 0;
 //			fprintf(of, "%s\n", lw_expr_print(te));
-			fprintf(of, "%04X ", lw_expr_intval(te) & 0xffff);
+			fprintf(of, "%04X%c", lw_expr_intval(te) & 0xffff, ((cl -> inmod || (cl -> dlen != cl -> len)) && instab[cl -> insn].flags & lwasm_insn_setdata) ? '.' : ' ');
 			lw_expr_destroy(te);
 			for (i = 0; i < obytelen && i < 8; i++)
 			{