diff lwasm/lwasm.h @ 377:67373a053c49

Add ?rts target for branch instructions Add a ?rts target for branch instructions, which brances to the nearest RTS or inverts the branch logic to branch around a generated RTS. Activated by a pragma "qrts". Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:50:02 -0600
parents 35d4213e6657
children d791d47afc48
line wrap: on
line diff
--- a/lwasm/lwasm.h	Mon Jul 13 20:47:30 2015 -0600
+++ b/lwasm/lwasm.h	Mon Jul 13 20:50:02 2015 -0600
@@ -97,7 +97,8 @@
 	PRAGMA_C					= 1 << 16,	// enable cycle counts
 	PRAGMA_CD					= 1 << 17,	// enable detailed cycle count
 	PRAGMA_CT					= 1 << 18,	// enable cycle count running total
-	PRAGMA_CC					= 1 << 19	// clear cycle count running total
+	PRAGMA_CC					= 1 << 19,	// clear cycle count running total
+	PRAGMA_QRTS					= 1 << 20	// enable BRA ?RTS support
 };
 
 enum
@@ -272,6 +273,7 @@
 	int pb;								// pass forward post byte
 	int lint;							// pass forward integer
 	int lint2;							// another pass forward integer
+	int conditional_return;				// for ?RTS handling (1 if RTS follows)
 	asmstate_t *as;						// assembler state data ptr
 	int pragmas;						// pragmas in effect for the line
 	int context;						// the symbol context number