shithub: scc

Download patch

ref: d9814fd84bcabdda378b83e3d7c97d350e5eb16a
parent: 1ac5e0b7e3590708e5e2adb967bb66160027b44c
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Dec 29 03:44:18 EST 2017

[as] Don't include ^ in the rules regexs

It is better to add it in the awk code instead of having it
in all the rule definitions.

--- a/as/target/gen.awk
+++ b/as/target/gen.awk
@@ -78,7 +78,7 @@
 		a = args[i]
 		found = 0
 		for (j = 1; j <= nregs; j++) {
-			if (match(a, regex[j])) {
+			if (match(a, "^" regex[j])) {
 				out = out value[j]
 				found = 1
 				break
--- a/as/target/x80/rules.dat
+++ b/as/target/x80/rules.dat
@@ -1,37 +1,37 @@
-^imm8	AIMM8
-^imm16	AIMM16
-^imm32	AIMM32
-^imm64	AIMM64
-^imm3	AIMM3
-^rst	ARST
-^\(IY\+n\)	AINDEX_IY
-^\(IX\+n\)	AINDEX_IX
-^ss	AREG_SSCLASS
-^cc	AREG_CCCLASS
-^dd	AREG_DDCLASS
-^qq	AREG_QQCLASS
-^rr	AREG_RRCLASS
-^pp	AREG_PPCLASS
-^p	AREG_PCLASS
-^q	AREG_QCLASS
-^r	AREG_RCLASS
-^R	AREG_R
-^\(DE\)	AINDER_DE
-^\(BC\)	AINDER_BC
-^\(HL\)	AINDER_HL
-^\(SP\)	AINDER_SP
-^\(C\)	AINDER_C
-^SP	AREG_SP
-^HL	AREG_HL
-^DE	AREG_DE
-^IX	AREG_IX
-^IY	AREG_IY
-^AF'	AREG_AF_
-^AF	AREG_AF
-^A	AREG_A
-^F	AREG_F
-^\(n\)	ADIRECT
-^I	AREG_I
-^0	AZERO
-^sym	ASYM
-^string	ASTR
+imm8	AIMM8
+imm16	AIMM16
+imm32	AIMM32
+imm64	AIMM64
+imm3	AIMM3
+rst	ARST
+\(IY\+n\)	AINDEX_IY
+\(IX\+n\)	AINDEX_IX
+ss	AREG_SSCLASS
+cc	AREG_CCCLASS
+dd	AREG_DDCLASS
+qq	AREG_QQCLASS
+rr	AREG_RRCLASS
+pp	AREG_PPCLASS
+p	AREG_PCLASS
+q	AREG_QCLASS
+r	AREG_RCLASS
+R	AREG_R
+\(DE\)	AINDER_DE
+\(BC\)	AINDER_BC
+\(HL\)	AINDER_HL
+\(SP\)	AINDER_SP
+\(C\)	AINDER_C
+SP	AREG_SP
+HL	AREG_HL
+DE	AREG_DE
+IX	AREG_IX
+IY	AREG_IY
+AF'	AREG_AF_
+AF	AREG_AF
+A	AREG_A
+F	AREG_F
+\(n\)	ADIRECT
+I	AREG_I
+0	AZERO
+sym	ASYM
+string	ASTR