diff lwasm/insn_rel.c @ 376:35d4213e6657

Add cycle counting to listing Add option to include instruction cycle counts to the listing. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:47:30 -0600
parents 8764142b3192
children 67373a053c49
line wrap: on
line diff
--- a/lwasm/insn_rel.c	Mon Jul 13 20:35:16 2015 -0600
+++ b/lwasm/insn_rel.c	Mon Jul 13 20:47:30 2015 -0600
@@ -232,14 +232,17 @@
 			lwasm_register_error(as, l, E_BYTE_OVERFLOW);
 			return;
 		}
-	
 
 		lwasm_emitop(l, instab[l -> insn].ops[2]);
 		lwasm_emit(l, offs);
+
+		l -> cycle_adj = 2;
 	}
 	else
 	{
 		lwasm_emitop(l, instab[l -> insn].ops[3]);
 		lwasm_emitexpr(l, e, 2);
+
+		l->cycle_adj = 4;
 	}
 }