diff lwasm/insn_rtor.c @ 367:c6d2a1f54e0c

Change processor target variations to pragmas. Add "pragma 6809" and "pragma 6309" which select the processor target rather than a global flag. The command line switches set or reset the pragma appropriately. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 15 Jun 2015 21:21:58 -0600
parents 3a5f718b24c1
children 8764142b3192
line wrap: on
line diff
--- a/lwasm/insn_rtor.c	Tue Jun 02 20:58:14 2015 -0600
+++ b/lwasm/insn_rtor.c	Mon Jun 15 21:21:58 2015 -0600
@@ -34,7 +34,7 @@
 	// D,X,Y,U,S,PC,W,V
 	// A,B,CC,DP,0,0,E,F
 
-	r0 = lwasm_lookupreg2((as -> target == TARGET_6309) ? regs : regs9, p);
+	r0 = lwasm_lookupreg2(!CURPRAGMA(l, PRAGMA_6809) ? regs : regs9, p);
 	if (r0 < 0 || *(*p)++ != ',')
 	{
 		lwasm_register_error(as, l, "Bad operand");
@@ -42,7 +42,7 @@
 	}
 	else
 	{
-		r1 = lwasm_lookupreg2((as -> target == TARGET_6309) ? regs : regs9, p);
+		r1 = lwasm_lookupreg2(!CURPRAGMA(l, PRAGMA_6809) ? regs : regs9, p);
 		if (r1 < 0)
 		{
 			lwasm_register_error(as, l, "Bad operand");