diff lwasm/insn_rtor.c @ 230:0df2a39a268c

Added --6809/--6309 switches and some cleanups in error reporting
author lost
date Fri, 12 Jun 2009 03:18:32 +0000
parents bae1e3ecdce1
children
line wrap: on
line diff
--- a/lwasm/insn_rtor.c	Fri Jun 12 01:31:18 2009 +0000
+++ b/lwasm/insn_rtor.c	Fri Jun 12 03:18:32 2009 +0000
@@ -31,13 +31,14 @@
 {
 	int r0, r1;
 	static const char *regs = "D X Y U S PCW V A B CCDP0 0 E F ";
-	
+	static const char *regs9 = "D X Y U S PC    A B CCDP        ";
+		
 	lwasm_emitop(as, l, instab[opnum].ops[0]);
 	// register to register (r0,r1)
 	// registers are in order:
 	// D,X,Y,U,S,PC,W,V
 	// A,B,CC,DP,0,0,E,F
-	r0 = lwasm_lookupreg2(regs, p);
+	r0 = lwasm_lookupreg2((as -> no6309) ? regs9 : regs, p);
 	if (r0 < 0 || *(*p)++ != ',')
 	{
 		register_error(as, l, 1, "Bad operand");
@@ -45,7 +46,7 @@
 	}
 	else
 	{
-		r1 = lwasm_lookupreg2(regs, p);
+		r1 = lwasm_lookupreg2((as -> no6309) ? regs9 : regs, p);
 		if (r1 < 0)
 		{
 			register_error(as, l, 1, "Bad operand");