diff lwasm/list.c @ 387:a741d2e4869f

Various bugfixes; fixed lwobjdump to display symbols with unprintable characters more sensibly; start of a (nonfunctional for now) testing framework
author lost@l-w.ca
date Wed, 14 Jul 2010 20:15:23 -0600
parents 38b50ce6967a
children fbb7bfed8076
line wrap: on
line diff
--- a/lwasm/list.c	Sun May 16 13:03:17 2010 -0600
+++ b/lwasm/list.c	Wed Jul 14 20:15:23 2010 -0600
@@ -59,7 +59,13 @@
 		}
 		else
 		{
-			fprintf(of, "%04X ", lw_expr_intval(cl -> addr));
+			lw_expr_t te;
+			te = lw_expr_copy(cl -> addr);
+			as -> exportcheck = 1;
+			lwasm_reduce_expr(as, te);
+			as -> exportcheck = 0;
+			fprintf(of, "%04X ", lw_expr_intval(te) & 0xffff);
+			lw_expr_destroy(te);
 			for (i = 0; i < cl -> outputl && i < 8; i++)
 			{
 				fprintf(of, "%02X", cl -> output[i]);
@@ -84,6 +90,8 @@
 				}
 				fprintf(of, "%02X", cl -> output[i]);
 			}
+			if (i % 8)
+				fprintf(of, "\n");
 		}
 	}
 }