aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-02-17 14:36:28 +0000
committerNick Clifton <nickc@redhat.com>2006-02-17 14:36:28 +0000
commitd70c5fc7c56fa9915f594aca8de15b478f3ab5b0 (patch)
tree47ad1b8f49a0f428e7c1d53f02062e685c5f0ef9 /gas/testsuite
parent0b92ab21c5c6920cc18c05efadd3a52fbd35c825 (diff)
downloadgdb-d70c5fc7c56fa9915f594aca8de15b478f3ab5b0.zip
gdb-d70c5fc7c56fa9915f594aca8de15b478f3ab5b0.tar.gz
gdb-d70c5fc7c56fa9915f594aca8de15b478f3ab5b0.tar.bz2
Add support for the Infineon XC16X.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog51
-rw-r--r--gas/testsuite/gas/v850/v850e1.d2
-rw-r--r--gas/testsuite/gas/xc16x/add.s17
-rw-r--r--gas/testsuite/gas/xc16x/add_test.s92
-rw-r--r--gas/testsuite/gas/xc16x/addb.s11
-rw-r--r--gas/testsuite/gas/xc16x/addc.s11
-rw-r--r--gas/testsuite/gas/xc16x/addcb.s17
-rw-r--r--gas/testsuite/gas/xc16x/and.s14
-rw-r--r--gas/testsuite/gas/xc16x/andb.s10
-rw-r--r--gas/testsuite/gas/xc16x/bfldl.s4
-rw-r--r--gas/testsuite/gas/xc16x/bit.s11
-rw-r--r--gas/testsuite/gas/xc16x/calla.s24
-rw-r--r--gas/testsuite/gas/xc16x/calli.s21
-rw-r--r--gas/testsuite/gas/xc16x/cmp.s9
-rw-r--r--gas/testsuite/gas/xc16x/cmp_test.s45
-rw-r--r--gas/testsuite/gas/xc16x/cmpb.s8
-rw-r--r--gas/testsuite/gas/xc16x/cmpi.s18
-rw-r--r--gas/testsuite/gas/xc16x/cpl.s7
-rw-r--r--gas/testsuite/gas/xc16x/div.s8
-rw-r--r--gas/testsuite/gas/xc16x/jmpa.s23
-rw-r--r--gas/testsuite/gas/xc16x/jmpi.s24
-rw-r--r--gas/testsuite/gas/xc16x/jmpr.s25
-rw-r--r--gas/testsuite/gas/xc16x/mov.s20
-rw-r--r--gas/testsuite/gas/xc16x/mov_test.s85
-rw-r--r--gas/testsuite/gas/xc16x/movb.s26
-rw-r--r--gas/testsuite/gas/xc16x/movbs.s8
-rw-r--r--gas/testsuite/gas/xc16x/movbz.s9
-rw-r--r--gas/testsuite/gas/xc16x/mul.s6
-rw-r--r--gas/testsuite/gas/xc16x/neg.s6
-rw-r--r--gas/testsuite/gas/xc16x/nop.s6
-rw-r--r--gas/testsuite/gas/xc16x/or.s11
-rw-r--r--gas/testsuite/gas/xc16x/orb.s10
-rw-r--r--gas/testsuite/gas/xc16x/prior.s5
-rw-r--r--gas/testsuite/gas/xc16x/pushpop.s5
-rw-r--r--gas/testsuite/gas/xc16x/ret.s9
-rw-r--r--gas/testsuite/gas/xc16x/scxt.s6
-rw-r--r--gas/testsuite/gas/xc16x/shlrol.s14
-rw-r--r--gas/testsuite/gas/xc16x/sub.s19
-rw-r--r--gas/testsuite/gas/xc16x/sub_test.s70
-rw-r--r--gas/testsuite/gas/xc16x/subb.s19
-rw-r--r--gas/testsuite/gas/xc16x/subc.s19
-rw-r--r--gas/testsuite/gas/xc16x/subcb.s20
-rw-r--r--gas/testsuite/gas/xc16x/syscontrol1.s12
-rw-r--r--gas/testsuite/gas/xc16x/syscontrol2.s26
-rw-r--r--gas/testsuite/gas/xc16x/trap.s6
-rw-r--r--gas/testsuite/gas/xc16x/xc16x.exp1317
-rw-r--r--gas/testsuite/gas/xc16x/xor.s10
-rw-r--r--gas/testsuite/gas/xc16x/xorb.s10
48 files changed, 2205 insertions, 1 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 055fd43..2cb93d1 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,54 @@
+2006-02-17 Shrirang Khisti <shrirangk@kpitcummins.com>
+ Anil Paranjape <anilp1@kpitcummins.com>
+ Shilin Shakti <shilins@kpitcummins.com>
+
+ * gas/xc16x: New directory.
+ * gas/xc16x/xc16x.exp: New file
+ * gas/xc16x/add.s: New file
+ * gas/xc16x/add_test.s: New file
+ * gas/xc16x/addb.s: New file
+ * gas/xc16x/addc.s: New file
+ * gas/xc16x/addcb.s: New file
+ * gas/xc16x/and.s: New file
+ * gas/xc16x/andb.s: New file
+ * gas/xc16x/bfldl.s: New file
+ * gas/xc16x/bit.s: New file
+ * gas/xc16x/calla.s: New file
+ * gas/xc16x/calli.s: New file
+ * gas/xc16x/cmp.s: New file
+ * gas/xc16x/cmp_test.s: New file
+ * gas/xc16x/cmpb.s: New file
+ * gas/xc16x/cmpi.s: New file
+ * gas/xc16x/cpl.s: New file
+ * gas/xc16x/div.s: New file
+ * gas/xc16x/jmpa.s: New file
+ * gas/xc16x/jmpi.s: New file
+ * gas/xc16x/jmpr.s: New file
+ * gas/xc16x/mov.s: New file
+ * gas/xc16x/mov_test.s: New file
+ * gas/xc16x/movb.s: New file
+ * gas/xc16x/movbs.s: New file
+ * gas/xc16x/movbz.s: New file
+ * gas/xc16x/mul.s: New file
+ * gas/xc16x/neg.s: New file
+ * gas/xc16x/nop.s: New file
+ * gas/xc16x/or.s: New file
+ * gas/xc16x/orb.s: New file
+ * gas/xc16x/prior.s: New file
+ * gas/xc16x/pushpop.s: New file
+ * gas/xc16x/ret.s: New file
+ * gas/xc16x/scxt.s: New file
+ * gas/xc16x/shlrol.s: New file
+ * gas/xc16x/sub.s: New file
+ * gas/xc16x/sub_test.s: New file
+ * gas/xc16x/subb.s: New file
+ * gas/xc16x/subcb.s: New file
+ * gas/xc16x/syscontrol1.s: New file
+ * gas/xc16x/syscontrol2.s: New file
+ * gas/xc16x/trap.s: New file
+ * gas/xc16x/xor.s: New file
+ * gas/xc16x/xorb.s: New file
+
2006-02-12 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/x86-64-crx-suffix.d: Undo the last change.
diff --git a/gas/testsuite/gas/v850/v850e1.d b/gas/testsuite/gas/v850/v850e1.d
index 9fb689b..3f176d1 100644
--- a/gas/testsuite/gas/v850/v850e1.d
+++ b/gas/testsuite/gas/v850/v850e1.d
@@ -11,7 +11,7 @@ Disassembly of section .text:
0x0+04 e0 1f 40 23 [ ]*bsw sp, gp
0x0+08 05 02 [ ]*callt 5
0x0+0a e8 3f e4 00 [ ]*clr1 r7, r8
-0x0+0e f6 17 14 1b [ ]*cmov nz, -10, r2, sp
+0x0+0e f6 17 14 1b [ ]*cmov nz, 22, r2, sp
0x0+12 e1 17 34 1b [ ]*cmov nz, r1, r2, sp
0x0+16 e0 07 44 01 [ ]*ctret
0x0+1a e0 07 46 01 [ ]*dbret
diff --git a/gas/testsuite/gas/xc16x/add.s b/gas/testsuite/gas/xc16x/add.s
new file mode 100644
index 0000000..bab7c09
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/add.s
@@ -0,0 +1,17 @@
+.text
+xc16x_add:
+add r0,r1
+add r0,[r1]
+add r0,[r1+]
+add r0,#3
+add r0,#1234
+add r0,0xffed
+add 0xffed,r0
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/add_test.s b/gas/testsuite/gas/xc16x/add_test.s
new file mode 100644
index 0000000..7924f50
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/add_test.s
@@ -0,0 +1,92 @@
+.text
+_start:
+ add r0,r1
+ add r0,r2
+ add r0,r3
+ add r0,r4
+ add r0,r5
+ add r0,r6
+ add r0,r7
+ add r0,r8
+ add r0,r9
+ add r0,r10
+ add r0,r11
+ add r0,r12
+ add r0,r13
+ add r0,r14
+ add r0,r15
+
+ add r1,r0
+ add r1,r2
+ add r1,r3
+ add r1,r4
+ add r1,r5
+ add r1,r6
+ add r1,r7
+ add r1,r8
+ add r1,r9
+ add r1,r10
+ add r1,r11
+ add r1,r12
+ add r1,r13
+ add r1,r14
+ add r1,r15
+
+ add r2,r0
+ add r2,r1
+ add r2,r3
+ add r2,r4
+ add r2,r5
+ add r2,r6
+ add r2,r7
+ add r2,r8
+ add r2,r9
+ add r2,r10
+ add r2,r11
+ add r2,r12
+ add r2,r13
+ add r2,r14
+ add r2,r15
+
+ add r3,r0
+ add r3,r1
+ add r3,r2
+ add r3,r4
+ add r3,r5
+ add r3,r6
+ add r3,r7
+ add r3,r8
+ add r3,r9
+ add r3,r10
+ add r3,r11
+ add r3,r12
+ add r3,r13
+ add r3,r14
+ add r3,r15
+
+ add r0,[r1]
+ add r0,[r1+]
+ add r0,#3
+ add r0,#0xffff
+ add r0,0xffff
+ add 0xffff,r0
+
+ addb rl0,rh0
+ addb rl0[r0]
+ addb rl0,#3
+ addb rl0,#0xff
+ addb r0,0xff10
+ addb 0xff10,r0
+
+ addc r0,r1
+ addc r0,[r1]
+ addc r0,#3
+ addc r0,#0xff12
+ addc r0,#0xff12
+ addc r0,0xff12
+ addc 0xff12,r0
+
+ addcb rl0,#3
+ addcb rl0,#0xff
+ addcb r0,0xff10
+ addcb 0xff10,r0 \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/addb.s b/gas/testsuite/gas/xc16x/addb.s
new file mode 100644
index 0000000..7c7dd94
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/addb.s
@@ -0,0 +1,11 @@
+ .section .text
+ .global _fun
+xc16x_add:
+
+ addb rl0,rl1
+ addb rl0,[r1]
+ addb rl0,[r1+]
+ addb rl0,#0x2
+ addb rl0,#0x33
+ addb rl0,0x2387
+ addb 0x2387,rl0
diff --git a/gas/testsuite/gas/xc16x/addc.s b/gas/testsuite/gas/xc16x/addc.s
new file mode 100644
index 0000000..8f33699
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/addc.s
@@ -0,0 +1,11 @@
+ .section .text
+ .global _fun
+xc16x_add:
+
+ addc r0,r1
+ addc r0,[r1]
+ addc r0,[r1+]
+ addc r0,#0x34
+ addc r0,#0x3456
+ addc r0,0x2387
+ addc 0x2387,r0
diff --git a/gas/testsuite/gas/xc16x/addcb.s b/gas/testsuite/gas/xc16x/addcb.s
new file mode 100644
index 0000000..74cfca7
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/addcb.s
@@ -0,0 +1,17 @@
+ .section .text
+ .global _fun
+xc16x_add:
+
+ addcb rl0,rl1
+ addcb rl0,[r1]
+ addcb rl0,[r1+]
+ addcb rl0,#0x02
+ addcb rl0,#0x23
+ addcb 0x2387,rl0
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/and.s b/gas/testsuite/gas/xc16x/and.s
new file mode 100644
index 0000000..14e9c7e
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/and.s
@@ -0,0 +1,14 @@
+.section .text
+.global _fun
+
+xc16x_and:
+
+ and r0,r1
+ and r0,[r1]
+ and r0,[r1+]
+ and r0,#3
+ and r0,#0xfcbe
+ and r0,0x0230
+ and 0x320,r0
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/andb.s b/gas/testsuite/gas/xc16x/andb.s
new file mode 100644
index 0000000..eee0ab8
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/andb.s
@@ -0,0 +1,10 @@
+ .section .text
+ .global _fun
+xc16x_andb:
+ andb rl0,rl1
+ andb rl0,[r1]
+ andb rl0,[r1+]
+ andb rl0,#3
+ andb rl0,#0xbe
+ andb rl0,0x0230
+ andb 0x320,rl0
diff --git a/gas/testsuite/gas/xc16x/bfldl.s b/gas/testsuite/gas/xc16x/bfldl.s
new file mode 100644
index 0000000..7300c4a
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/bfldl.s
@@ -0,0 +1,4 @@
+ .text
+ xc16x_bfldl:
+ BFLDL r0,#0x87,#0x0e
+ BFLDH r0,#0xff,#0x0e
diff --git a/gas/testsuite/gas/xc16x/bit.s b/gas/testsuite/gas/xc16x/bit.s
new file mode 100644
index 0000000..571e79e
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/bit.s
@@ -0,0 +1,11 @@
+.text
+xc16x_bit:
+bclr r0.1
+bset r0.1
+bmov r0.2,r0.1
+bmovn r0.3,r0.2
+band r0.1,r0.4
+bor r0.1,r0.2
+bxor r0.1,r0.2
+bcmp r0.1,r0.2
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/calla.s b/gas/testsuite/gas/xc16x/calla.s
new file mode 100644
index 0000000..3604e9a
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/calla.s
@@ -0,0 +1,24 @@
+.text
+xc16x_calla:
+calla cc_uc,0xaaaa
+calla cc_z,0xaaaa
+calla cc_nz,0xaaaa
+calla cc_v,0xaaaa
+calla cc_nv,0xaaaa
+calla cc_n,0xaaaa
+calla cc_nn,0xaaaa
+calla cc_c,0xaaaa
+calla cc_nc,0xaaaa
+calla cc_eq,0xaaaa
+calla cc_ne,0xaaaa
+calla cc_ult,0xaaaa
+calla cc_ule,0xaaaa
+calla cc_uge,0xaaaa
+calla cc_ugt,0xaaaa
+calla cc_sle,0xaaaa
+calla cc_sge,0xaaaa
+calla cc_sgt,0xaaaa
+calla cc_net,0xaaaa
+calla cc_slt,0xaaaa
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/calli.s b/gas/testsuite/gas/xc16x/calli.s
new file mode 100644
index 0000000..807ae1b
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/calli.s
@@ -0,0 +1,21 @@
+.text
+xc16x_calli:
+calli cc_uc,[r1]
+calli cc_z,[r1]
+calli cc_nz,[r1]
+calli cc_v,[r1]
+calli cc_nv,[r1]
+calli cc_n,[r1]
+calli cc_nn,[r1]
+calli cc_c,[r1]
+calli cc_nc,[r1]
+calli cc_eq,[r1]
+calli cc_ne,[r1]
+calli cc_ult,[r1]
+calli cc_ule,[r1]
+calli cc_uge,[r1]
+calli cc_ugt,[r1]
+calli cc_sle,[r1]
+calli cc_sge,[r1]
+calli cc_net,[r1]
+calli cc_slt,[r1]
diff --git a/gas/testsuite/gas/xc16x/cmp.s b/gas/testsuite/gas/xc16x/cmp.s
new file mode 100644
index 0000000..5003492
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/cmp.s
@@ -0,0 +1,9 @@
+.text
+xc16x_cmp:
+cmp r0,r1
+cmp r0,[r1]
+cmp r0,[r1+]
+cmp r0,#3
+cmp r0,#0x0234
+cmp r0,0x3452
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/cmp_test.s b/gas/testsuite/gas/xc16x/cmp_test.s
new file mode 100644
index 0000000..932ce96
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/cmp_test.s
@@ -0,0 +1,45 @@
+.text
+cmp r0,r1
+cmp r0,[r1]
+cmp r0,[r1+]
+cmp r0,#3
+cmp r0,#0x0234
+cmp r0,0x3452
+
+cmp r0,r1
+cmp r0,[r1]
+cmp r0,[r1+]
+cmp r0,#3
+cmp r0,#0xcdef
+cmp r0,0xcdef
+
+cmpb rl0,rl1
+cmpb rl0,[r1]
+cmpb rl0,[r1+]
+cmpb rl0,#3
+cmpb rl0,#cd
+cmpb rl0,0x0234
+
+cmpb rl0,rl1
+cmpb rl0,[r1]
+cmpb rl0,[r1+]
+cmpb rl0,#3
+cmpb rl0,#cd
+cmpb rl0,0xcdef
+
+cmpd1 r0,#0x0f
+cmpd1 r0,#0x0fccb
+cmpd1 r0,0xffcb
+cmpd2 r0,#0x0f
+cmpd2 r0,#0x0fccb
+cmpd2 r0,0xffcb
+
+cmpi1 r0,#0x0f
+cmpi1 r0,#0x0fccb
+cmpi1 r0,0xffcb
+cmpi2 r0,#0x0f
+cmpi2 r0,#0x0fccb
+cmpi2 r0,0xffcb
+
+
+
diff --git a/gas/testsuite/gas/xc16x/cmpb.s b/gas/testsuite/gas/xc16x/cmpb.s
new file mode 100644
index 0000000..3dfc698
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/cmpb.s
@@ -0,0 +1,8 @@
+.text
+xc16x_cmpb:
+cmpb rl0,rl1
+cmpb rl0,[r1]
+cmpb rl0,[r1+]
+cmpb rl0,#3
+cmpb rl0,#34
+cmpb rl0,0x0234
diff --git a/gas/testsuite/gas/xc16x/cmpi.s b/gas/testsuite/gas/xc16x/cmpi.s
new file mode 100644
index 0000000..8136890
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/cmpi.s
@@ -0,0 +1,18 @@
+.section .text
+.global _fun
+
+xc16x_cmpd:
+
+ cmpd1 r0,#0x0f
+ cmpd1 r0,#0x0fccb
+ cmpd1 r0,0xffcb
+ cmpd2 r0,#0x0f
+ cmpd2 r0,#0x0fccb
+ cmpd2 r0,0xffcb
+ cmpi1 r0,#0x0f
+ cmpi1 r0,#0x0fccb
+ cmpi1 r0,0xffcb
+ cmpi2 r0,#0x0f
+ cmpi2 r0,#0x0fccb
+ cmpi2 r0,0xffcb
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/cpl.s b/gas/testsuite/gas/xc16x/cpl.s
new file mode 100644
index 0000000..b0d9817
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/cpl.s
@@ -0,0 +1,7 @@
+ .section .text
+ .global _fun
+
+xc16x_cpl_cplb:
+
+ cpl r0
+ cplb rl0
diff --git a/gas/testsuite/gas/xc16x/div.s b/gas/testsuite/gas/xc16x/div.s
new file mode 100644
index 0000000..7b5ad9e
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/div.s
@@ -0,0 +1,8 @@
+ .section .text
+ .global _fun
+xc16x_div:
+
+ div r0
+ divl r0
+ divlu r0
+ divu r0
diff --git a/gas/testsuite/gas/xc16x/jmpa.s b/gas/testsuite/gas/xc16x/jmpa.s
new file mode 100644
index 0000000..732cc47
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/jmpa.s
@@ -0,0 +1,23 @@
+.text
+xc16x_jmpa:
+ jmpa cc_UC,0xaaaa
+ jmpa cc_Z,0xaaaa
+ jmpa cc_NZ,0xaaaa
+ jmpa cc_V,0xaaaa
+ jmpa cc_NV,0xaaaa
+ jmpa cc_N,0xaaaa
+ jmpa cc_NN,0xaaaa
+ jmpa cc_ULT,0xaaaa
+ jmpa cc_UGE,0xaaaa
+ jmpa cc_Z,0xaaaa
+ jmpa cc_NZ,0xaaaa
+ jmpa cc_ULT,0xaaaa
+ jmpa cc_ULE,0xaaaa
+ jmpa cc_UGE,0xaaaa
+ jmpa cc_UGT,0xaaaa
+ jmpa cc_SLE,0xaaaa
+ jmpa cc_SGE,0xaaaa
+ jmpa cc_SGT,0xaaaa
+ jmpa cc_NET,0xaaaa
+
+
diff --git a/gas/testsuite/gas/xc16x/jmpi.s b/gas/testsuite/gas/xc16x/jmpi.s
new file mode 100644
index 0000000..337d5fa
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/jmpi.s
@@ -0,0 +1,24 @@
+.section .text
+.global _fun
+
+xc16x_jmpi:
+
+ jmpi cc_UC, [r7]
+ jmpi cc_z, [r7]
+ jmpi cc_NZ, [r7]
+ jmpi cc_V, [r7]
+ jmpi cc_NV, [r7]
+ jmpi cc_N, [r7]
+ jmpi cc_NN, [r7]
+ jmpi cc_C, [r7]
+ jmpi cc_NC, [r7]
+ jmpi cc_EQ, [r7]
+ jmpi cc_NE, [r7]
+ jmpi cc_ULT,[r7]
+ jmpi cc_ULE,[r7]
+ jmpi cc_UGE,[r7]
+ jmpi cc_UGT,[r7]
+ jmpi cc_SLE,[r7]
+ jmpi cc_SGE,[r7]
+ jmpi cc_SGT,[r7]
+ jmpi cc_NET,[r7]
diff --git a/gas/testsuite/gas/xc16x/jmpr.s b/gas/testsuite/gas/xc16x/jmpr.s
new file mode 100644
index 0000000..7fbdfac
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/jmpr.s
@@ -0,0 +1,25 @@
+ .section .text
+ .global _fun
+
+xc16x_jmpr:
+
+ jmpr cc_uc, xc16x_jmpr
+ jmpr cc_z, xc16x_jmpr
+ jmpr cc_nz, xc16x_jmpr
+ jmpr cc_v, xc16x_jmpr
+ jmpr cc_nv, xc16x_jmpr
+ jmpr cc_n, xc16x_jmpr
+ jmpr cc_nn, xc16x_jmpr
+ jmpr cc_c, xc16x_jmpr
+ jmpr cc_nc, xc16x_jmpr
+ jmpr cc_eq, xc16x_jmpr
+ jmpr cc_ne, xc16x_jmpr
+ jmpr cc_ult,xc16x_jmpr
+ jmpr cc_ule,xc16x_jmpr
+ jmpr cc_uge,xc16x_jmpr
+ jmpr cc_ugt,xc16x_jmpr
+ jmpr cc_sle,xc16x_jmpr
+ jmpr cc_sge,xc16x_jmpr
+ jmpr cc_sgt,xc16x_jmpr
+ jmpr cc_net,xc16x_jmpr
+ jmpr cc_slt,xc16x_jmpr
diff --git a/gas/testsuite/gas/xc16x/mov.s b/gas/testsuite/gas/xc16x/mov.s
new file mode 100644
index 0000000..164d97c
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/mov.s
@@ -0,0 +1,20 @@
+ .section .text
+ .global _fun
+xc16x_mov:
+
+ mov r0,r1
+ mov r0,#02
+ mov r0,#0xfcbe
+ mov r0,[r1]
+ mov r0,[r1+]
+ mov [r0],r1
+ mov [-r0],r1
+ mov [r0],[r1]
+ mov [r0+],[r1]
+ mov [r0],[r1+]
+ mov r0,[r0+#0xffcb]
+ mov [r0+#0xffcb],r0
+ mov [r0],0xffcb
+ mov 0xffcb,[r0]
+ mov r0,0xffcb
+ mov 0xffcb,r0
diff --git a/gas/testsuite/gas/xc16x/mov_test.s b/gas/testsuite/gas/xc16x/mov_test.s
new file mode 100644
index 0000000..a3776c1
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/mov_test.s
@@ -0,0 +1,85 @@
+ .xc16x
+ mov r0,r1
+ mov r0,#02
+ mov r0,#0x0001
+ mov r0,[r1]
+ mov r0,[r1+]
+ mov [r0],r1
+ mov [-r0],r1
+ mov [r0],[r1]
+ mov [r0+],[r1]
+ mov [r0],[r1+]
+ mov r0,[r0+#0x0001]
+ mov [r0+#0x0001],r0
+ mov [r0],0x0001
+ mov 0x0001,[r0]
+ mov r0,0x0001
+ mov 0x0001,r0
+
+ mov r0,r1
+ mov r0,#02
+ mov r0,#0xffff
+ mov r0,[r1]
+ mov r0,[r1+]
+ mov [r0],r1
+ mov [-r0],r1
+ mov [r0],[r1]
+ mov [r0+],[r1]
+ mov [r0],[r1+]
+ mov r0,[r0+#0xffff]
+ mov [r0+#0xffff],r0
+ mov [r0],0xffff
+ mov 0xffff,[r0]
+ mov r0,0xffff
+ mov 0xffff,r0
+
+ movb rl0,r2
+ movb rl0,#0x12
+ movb r3,[r2]
+ movb rl0,[r2+]
+ movb [-r2],rl0
+ movb [r3],[r2+]
+ movb [r3],[r2]
+ movb [r2+],[r3]
+ movb [r2],[r3+]
+ movb rl0,[r3+#0x1234]
+ movb [r3+#0x1234],rl0
+ movb [r3],0x1234
+ movb [r3],0x1234
+ movb 0x1234,[r3]
+ movb rl0,0x12
+ movb 0x12,rl0
+
+ movb rl0,r2
+ movb rl0,#0xff
+ movb r3,[r2]
+ movb rl0,[r2+]
+ movb [-r2],rl0
+ movb [r3],[r2+]
+ movb [r3],[r2]
+ movb [r2+],[r3]
+ movb [r2],[r3+]
+ movb rl0,[r3+#0xffff]
+ movb [r3+#0xffff],rl0
+ movb [r3],0xffff
+ movb [r3],0xffff
+ movb 0xffff,[r3]
+ movb rl0,0xff
+ movb 0xff,rl0
+
+ movbs r0,rl1
+ movbs r0,0x12
+ movbs 0x1234,rl0
+
+ movbs r0,rl1
+ movbs r0,0xff
+ movbs 0xffff,rl0
+
+ movbz r2,rl0
+ movbz r0,0x1234
+ movbz 0x1234,rl0
+
+ movbz r2,rl0
+ movbz r0,0xffff
+ movbz 0xffff,rl0
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/movb.s b/gas/testsuite/gas/xc16x/movb.s
new file mode 100644
index 0000000..3050704
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/movb.s
@@ -0,0 +1,26 @@
+ .section .text
+ .global _fun
+xc16x_movb:
+
+ movb rl0,r2
+ movb rl0,#0x12
+ movb r3,[r2]
+ movb rl0,[r2+]
+ movb [-r2],rl0
+ movb [r3],[r2+]
+ movb [r3],[r2]
+ movb [r2+],[r3]
+ movb [r2],[r3+]
+ movb rl0,[r3+#0x1234]
+ movb [r3+#0x1234],rl0
+ movb [r3],0x1234
+ movb [r3],0xeeff
+ movb 0x1234,[r3]
+ movb rl0,0x12
+ movb 0x12,rl0
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/movbs.s b/gas/testsuite/gas/xc16x/movbs.s
new file mode 100644
index 0000000..36bed4d
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/movbs.s
@@ -0,0 +1,8 @@
+ .section .text
+ .global _fun
+
+xc16x_movbs:
+
+ movbs r0,rl1
+ movbs r0,0xff
+ movbs 0xffcb,rl0
diff --git a/gas/testsuite/gas/xc16x/movbz.s b/gas/testsuite/gas/xc16x/movbz.s
new file mode 100644
index 0000000..8571f96
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/movbz.s
@@ -0,0 +1,9 @@
+ .section .text
+ .global _fun
+xc16x_movbz:
+
+ movbz r2,rl0
+ movbz r0,0x23dd
+ movbz 0x23,rl0
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/mul.s b/gas/testsuite/gas/xc16x/mul.s
new file mode 100644
index 0000000..0e7c4be
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/mul.s
@@ -0,0 +1,6 @@
+ .section .text
+ .global _fun
+xc16x_mul:
+
+ mul r0,r1
+ mulu r0,r1
diff --git a/gas/testsuite/gas/xc16x/neg.s b/gas/testsuite/gas/xc16x/neg.s
new file mode 100644
index 0000000..b95824e
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/neg.s
@@ -0,0 +1,6 @@
+ .section .text
+ .global _fun
+xc16x_neg:
+
+ neg r0
+ negb rl0
diff --git a/gas/testsuite/gas/xc16x/nop.s b/gas/testsuite/gas/xc16x/nop.s
new file mode 100644
index 0000000..cc297e1
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/nop.s
@@ -0,0 +1,6 @@
+ .section .text
+ .global _fun
+xc16x_nop:
+ nop
+ nop
+
diff --git a/gas/testsuite/gas/xc16x/or.s b/gas/testsuite/gas/xc16x/or.s
new file mode 100644
index 0000000..46deecc
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/or.s
@@ -0,0 +1,11 @@
+ .section .text
+ .global _fun
+xc16x_or:
+
+ or r0,r1
+ or r0,[r1]
+ or r0,[r1+]
+ or r0,#3
+ or r0,#0x0234
+ or r0,0x4536
+ or 0x4536,r0
diff --git a/gas/testsuite/gas/xc16x/orb.s b/gas/testsuite/gas/xc16x/orb.s
new file mode 100644
index 0000000..62bfa76
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/orb.s
@@ -0,0 +1,10 @@
+ .section .text
+ .global _fun
+xc16x_or:
+ orb rl0,rl1
+ orb rl0,[r1]
+ orb rl0,[r1+]
+ orb rl0,#3
+ orb rl0,#0x23
+ orb rl0,0x0234
+ orb 0x0234,rl0
diff --git a/gas/testsuite/gas/xc16x/prior.s b/gas/testsuite/gas/xc16x/prior.s
new file mode 100644
index 0000000..aa4bb78
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/prior.s
@@ -0,0 +1,5 @@
+ .section .text
+ .global _fun
+xc16x_prior:
+
+ prior r0,r1
diff --git a/gas/testsuite/gas/xc16x/pushpop.s b/gas/testsuite/gas/xc16x/pushpop.s
new file mode 100644
index 0000000..4fafde6
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/pushpop.s
@@ -0,0 +1,5 @@
+ .section .text
+ .global _fun
+xc16x_pushpop:
+ pop r0
+ push r0
diff --git a/gas/testsuite/gas/xc16x/ret.s b/gas/testsuite/gas/xc16x/ret.s
new file mode 100644
index 0000000..62278a5
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/ret.s
@@ -0,0 +1,9 @@
+ .section .text
+ .global _fun
+
+xc16x_ret:
+ ret
+ reti
+ rets
+ retp r5
+
diff --git a/gas/testsuite/gas/xc16x/scxt.s b/gas/testsuite/gas/xc16x/scxt.s
new file mode 100644
index 0000000..e8a23c3
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/scxt.s
@@ -0,0 +1,6 @@
+ .section .text
+ .global _fun
+xc16x_scxt:
+ scxt r0,#0xffff
+ scxt r0,0xffff
+
diff --git a/gas/testsuite/gas/xc16x/shlrol.s b/gas/testsuite/gas/xc16x/shlrol.s
new file mode 100644
index 0000000..04e6591
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/shlrol.s
@@ -0,0 +1,14 @@
+ .section .text
+ .global _fun
+xc16x_shlrol:
+
+ shl r0,r1
+ shl r0,#a
+ shr r0,r1
+ shr r0,#a
+ rol r0,r1
+ rol r0,#a
+ ror r0,r1
+ ror r0,#a
+ ashr r0,r1
+ ashr r0,#a
diff --git a/gas/testsuite/gas/xc16x/sub.s b/gas/testsuite/gas/xc16x/sub.s
new file mode 100644
index 0000000..5baad82
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/sub.s
@@ -0,0 +1,19 @@
+ .section .text
+ .global _fun
+xc16x_sub:
+
+ sub r0,r1
+ sub r0,[r1]
+ sub r0,[r1+]
+ sub r0,#0x1
+ sub r0,#0x7643
+ sub r0,0x7643
+ sub 0x7643,r0
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/sub_test.s b/gas/testsuite/gas/xc16x/sub_test.s
new file mode 100644
index 0000000..880102e
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/sub_test.s
@@ -0,0 +1,70 @@
+ .text
+_start:
+ sub r0,r1
+ sub r0,[r1]
+ sub r0,[r1+]
+ sub r0,#0x1
+ sub r0,#0x7643
+ sub r0,0x7643
+ sub 0x7643,r0
+
+ sub r1,r0
+ sub r1,[r0]
+ sub r1,[r0+]
+ sub r1,#0x1
+ sub r1,#0xCDEF
+ sub r1,0xCDEF
+ sub 0xCDEF,r1
+
+
+ subb rl0,rl1
+ subb rl0,[r1]
+ subb rl0,[r1+]
+ subb rl0,#0x1
+ subb rl0,#0x43
+ subb rl0,0x7643
+ subb 0x7643,rl0
+
+ subb rl1,rl0
+ subb rl1,[r0]
+ subb rl1,[r0+]
+ subb rl1,#0x1
+ subb rl1,#0xCD
+ subb rl1,0xCDEF
+ subb 0xCDEF,rl1
+
+
+
+ subc r0,r1
+ subc r0,[r1]
+ subc r0,[r1+]
+ subc r0,#0x2
+ subc r0,#0x43
+ subc r0,0x7643
+ subc 0x7643,r0
+
+ subc r1,r0
+ subc r1,[r0]
+ subc r1,[r0+]
+ subc r1,#0xC
+ subc r1,#0xCD
+ subc r1,0xCDEF
+ subc 0xCDEF,r1
+
+ subcb rl0,rl1
+ subcb rl0,[r1]
+ subcb rl0,[r1+]
+ subcb rl0,#0x2
+ subcb rl0,#0x43
+ subcb rl0,0x7643
+ subcb 0x7643,rl0
+
+ subcb rl0,rl1
+ subcb rl0,[r1]
+ subcb rl0,[r1+]
+ subcb rl0,#0x2
+ subcb rl0,#0x43
+ subcb rl0,0x7643
+ subcb 0x7643,rl0
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/subb.s b/gas/testsuite/gas/xc16x/subb.s
new file mode 100644
index 0000000..c066a43
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/subb.s
@@ -0,0 +1,19 @@
+ .section .text
+ .global _fun
+xc16x_subb:
+
+ subb rl0,rl1
+ subb rl0,[r1]
+ subb rl0,[r1+]
+ subb rl0,#0x1
+ subb rl0,#0x43
+ subb rl0,0x7643
+ subb 0x7643,rl0
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/subc.s b/gas/testsuite/gas/xc16x/subc.s
new file mode 100644
index 0000000..a8af7d0
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/subc.s
@@ -0,0 +1,19 @@
+ .section .text
+ .global _fun
+xc16x_subc:
+
+ subc r0,r1
+ subc r0,[r1]
+ subc r0,[r1+]
+ subc r0,#0x2
+ subc r0,#0x43
+ subc r0,0x7643
+ subc 0x7643,r0
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/subcb.s b/gas/testsuite/gas/xc16x/subcb.s
new file mode 100644
index 0000000..e8911ee
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/subcb.s
@@ -0,0 +1,20 @@
+ .section .text
+ .global _fun
+xc16x_subcb:
+
+ subcb rl0,rl1
+ subcb rl0,[r1]
+ subcb rl0,[r1+]
+ subcb rl0,#0x2
+ subcb rl0,#0x43
+ subcb rl0,0x7643
+ subcb 0x7643,rl0
+
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/gas/testsuite/gas/xc16x/syscontrol1.s b/gas/testsuite/gas/xc16x/syscontrol1.s
new file mode 100644
index 0000000..c21f07d
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/syscontrol1.s
@@ -0,0 +1,12 @@
+ .section .text
+ .global _fun
+xc16x_syscontrol:
+ srst
+ sbrk
+ idle
+ pwrdn
+ srvwdt
+ diswdt
+ enwdt
+ einit
+
diff --git a/gas/testsuite/gas/xc16x/syscontrol2.s b/gas/testsuite/gas/xc16x/syscontrol2.s
new file mode 100644
index 0000000..61fb703
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/syscontrol2.s
@@ -0,0 +1,26 @@
+.text
+xc16x_syscontrol2:
+ extr #0x4
+ extr #0x3
+ extr #0x2
+ extr #0x1
+
+ atomic #0x4
+ atomic #0x3
+ atomic #0x2
+ atomic #0x1
+
+ extp r5,#0x4
+ extp #0x3ff,#0x4
+ extpr r5,#0x4
+ extpr #0x3ff,#0x4
+
+ exts r5,#0x4
+ exts #0x1,#0x4
+
+ extsr r5,#0x4
+ extsr #0x1,#0x4
+
+
+
+
diff --git a/gas/testsuite/gas/xc16x/trap.s b/gas/testsuite/gas/xc16x/trap.s
new file mode 100644
index 0000000..f8dc87b
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/trap.s
@@ -0,0 +1,6 @@
+ .section .text
+ .global _fun
+
+xc16x_trap:
+
+ trap #0x02
diff --git a/gas/testsuite/gas/xc16x/xc16x.exp b/gas/testsuite/gas/xc16x/xc16x.exp
new file mode 100644
index 0000000..c53e657
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/xc16x.exp
@@ -0,0 +1,1317 @@
+#
+# Some xc16x tests
+#
+proc do_xc16x_add {} {
+ set testname "add.s: xc16x add word tests"
+ set x 0
+
+ gas_start "add.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 0809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 080D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 0803\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 06F0D204\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 02F0EDFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 04F0EDFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_addb {} {
+ set testname "addb.s: xc16x add byte tests"
+ set x 0
+
+ gas_start "addb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 0909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 090D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 0902\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 07F03300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 03F08723\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 05F08723\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_addc {} {
+ set testname "addc.s: xc16x add with carry tests"
+ set x 0
+
+ gas_start "addc.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 180D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 16F03400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 16F05634\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 12F08723\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 14F08723\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_addcb {} {
+ set testname "addcb.s: xc16x add byte with carry tests"
+ set x 0
+
+ gas_start "addcb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 190D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 17F00200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 17F02300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 15F08723\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 6] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_sub {} {
+ set testname "sub.s: xc16x sub tests"
+ set x 0
+
+ gas_start "sub.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 2001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 2809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 280D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 2801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 26F04376\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 22F04376\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 24F04376\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_subb {} {
+ set testname "subb.s: xc16x sub byte tests"
+ set x 0
+
+ gas_start "subb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 2102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 2909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 290D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 2901\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 27F04300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 23F04376\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 25F04376\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_subc {} {
+ set testname "subc.s: xc16x sub with carry tests"
+ set x 0
+
+ gas_start "subc.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 3001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 3809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 380D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 3802\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 36F04300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 32F04376\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 34F04376\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_subcb {} {
+ set testname "subcb.s: xc16x sub byte with carry tests"
+ set x 0
+
+ gas_start "subcb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 3102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 3909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 390D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 3902\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 37F04300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 33F04376\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 35F04376\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_and {} {
+ set testname "and.s: xc16x and tests"
+ set x 0
+
+ gas_start "and.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 6001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 6809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 680D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6803\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 66F0BEFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 62F03002\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 64F02003\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_andb {} {
+ set testname "andb.s: xc16x and byte tests"
+ set x 0
+
+ gas_start "andb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 6102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 6909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 690D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 6903\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 67F0BE00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 63F03002\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 65F02003\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_or {} {
+ set testname "or.s: xc16x or tests"
+ set x 0
+
+ gas_start "or.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 780D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7803\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 76F03402\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 72F03645\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 74F03645\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_xor {} {
+ set testname "xor.s: xc16x xor tests"
+ set x 0
+
+ gas_start "xor.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 580D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 5803\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 56F03402\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 52F03402\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 54F03402\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_xorb {} {
+ set testname "xorb.s: xc16x xorb tests"
+ set x 0
+
+ gas_start "xorb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 5102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 590D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 5903\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 57F03400\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 53F00324\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 55F00324\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+
+}
+
+proc do_xc16x_mov {} {
+ set testname "mov.s: xc16x mov tests"
+ set x 0
+
+ gas_start "mov.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 F001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 E6F00200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 E6F0BEFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a A801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 9801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e B810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 8810\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 C801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 D801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 E801\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 D400CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c C400CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 8400CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 9400CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 F2F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c F6F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 16] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_movb {} {
+ set testname "movb.s: xc16x movb tests"
+ set x 0
+
+ gas_start "movb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 F3F00000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 E7F01200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 B4020000\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 9902\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 8902\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 E932\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 C932\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 D923\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 E923\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 F4033412\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c E4033412\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 A4033412\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 A403FFEE\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 B4033412\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c F3F01200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 F7F01200\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 16] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_movbs {} {
+ set testname "movbs.s: xc16x mov byte tests"
+ set x 0
+
+ gas_start "movbs.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 D020\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 D2F0FF00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 D5F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 3] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_movbz {} {
+ set testname "movbz.s: xc16x movbz tests"
+ set x 0
+
+ gas_start "movbz.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 C002\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 C2F0DD23\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 C5F02300\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 3] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_pushpop {} {
+ set testname "pushpop.s: xc16x push/pop tests"
+ set x 0
+
+ gas_start "pushpop.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 FCF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 ECF0\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_shlrol {} {
+ set testname "shlrol.s: xc16x shift and rotate tests"
+ set x 0
+
+ gas_start "shlrol.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4C01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 6C01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 0C01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 1C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 2C01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 3C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 AC01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 BC00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 10] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_neg {} {
+ set testname "neg.s: xc16x neg tests"
+ set x 0
+
+ gas_start "neg.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 8100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 A100\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+proc do_xc16x_mul {} {
+ set testname "mul.s: xc16x multiply tests"
+ set x 0
+
+ gas_start "mul.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0B01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1B01\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_div {} {
+ set testname "div.s: xc16x division tests"
+ set x 0
+
+ gas_start "div.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 6B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 7B00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 5B00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 4] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_jmpa {} {
+ set testname "jmpa.s: xc16x jump absolute test"
+ set x 0
+
+ gas_start "jmpa.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 EA00AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 EA20AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 EA30AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c EA40AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 EA50AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 EA60AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 EA70AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c EA80AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 EA90AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 EA20AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 EA30AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c EA80AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 EAF0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 EA90AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0038 EAE0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 003c EAB0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0040 EAD0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0044 EAA0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0048 EA10AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 19] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_jmpi {} {
+ set testname "jmpi.s: xc16x jmp immidiate tests "
+ set x 0
+
+ gas_start "jmpi.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 9C07\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 9C27\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 9C37\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 9C47\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 9C57\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 9C67\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 9C77\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 9C87\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 9C97\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 9C27\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 9C37\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 9C87\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 9CF7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 9C97\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c 9CE7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 9CB7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 9CD7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 9CA7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 9C17\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 19] then { pass $testname } else { fail $testname }
+}
+
+
+proc do_xc16x_jmpr {} {
+ set testname "jmpr.s: xc16x jump relative tests"
+ set x 0
+
+ gas_start "jmpr.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0DFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 2DFE\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 3DFD\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 4DFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 5DFB\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 6DFA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 7DF9\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 8DF8\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 9DF7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 2DF6\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 3DF5\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 8DF4\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 FDF3\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 9DF2\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c EDF1\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e BDF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 DDEF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 ADEE\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 1DED\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0026 CDEC\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 20] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_syscontrol1 {} {
+ set testname "syscontrol1.s: xc16x system control insrutions tests"
+ set x 0
+
+ gas_start "syscontrol1.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 B748B7B7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 8C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 87788787\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 97689797\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e A758A7A7\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 A55AA5A5\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 857A8585\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a B54AB5B5\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_syscontrol2 {} {
+ set testname "syscontrol2.s: xc16x syscontrol2 tests"
+ set x 0
+
+ gas_start "syscontrol2.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 D1B0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 D1A0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 D190\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 D180\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 D130\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a D120\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c D110\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e D100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 DC75\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 D770FF03\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 DCF5\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 D7F0FF03\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c DC35\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e D7300100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 DCB5\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 D7B00100\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 16] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_cpl {} {
+ set testname "cpl.s: xc16x compliment tests"
+ set x 0
+
+ gas_start "cpl.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 9100\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 B100\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_cmp {} {
+ set testname "cmp.s: xc16x misc tests"
+ set x 0
+
+ gas_start "cmp.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4001\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 4809\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 480D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 4803\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 46F03402\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 42F05234\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 6] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_cmpb {} {
+ set testname "cmpb.s: xc16x cmp byte tests"
+ set x 0
+
+ gas_start "cmpb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 4102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 4909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 490D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 4903\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 47F02200\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 43F03402\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 6] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_cmpi {} {
+ set testname "cmpi.s: xc16x cmpi tests"
+ set x 0
+
+ gas_start "cmpi.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 A0F0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 A6F0CBFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 A2F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a B0F0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c B6F0CBFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 B2F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 80F0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 86F0CBFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a 82F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e 90F0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 96F0CBFC\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 92F0CBFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 12] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_calli {} {
+ set testname "calli.s: xc16x call tests"
+ set x 0
+
+ gas_start "calli.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 AB01\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 AB21\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 AB31\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 AB41\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 AB51\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a AB61\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c AB71\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e AB81\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 AB91\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 AB21\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 AB31\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0016 AB81\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 ABF1\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001a AB91\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c ABE1\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001e ABB1\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 ABD1\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0022 AB11\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 ABC1\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 19] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_calla {} {
+ set testname "calla.s: xc16x call tests"
+ set x 0
+
+ gas_start "calla.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 CA00AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 CA20AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 CA30AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c CA40AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 CA50AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 CA60AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 CA70AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 001c CA80AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0020 CA90AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0024 CA20AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0028 CA30AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 002c CA80AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0030 CAF0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0034 CA90AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0038 CAE0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 003c CAB0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0040 CAD0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0044 CAA0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0048 CA10AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 004c CAC0AAAA\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 20] then { pass $testname } else { fail $testname }
+}
+
+
+proc do_xc16x_bit {} {
+ set testname "bit.s: xc16x bit manipulation tests"
+ set x 0
+
+ gas_start "bit.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 1EF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 1FF0\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 4AF0F012\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 3AF0F023\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 6AF0F041\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 5AF0F021\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0014 7AF0F021\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0018 2AF0F021\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 8] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_bfldl {} {
+ set testname "bfldl.s: xc16x bitwise modify masked data tests"
+ set x 0
+
+ gas_start "bfldl.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 0AF0870E\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 1AF00EFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_ret {} {
+ set testname "ret.s: xc16x ret tests"
+ set x 0
+
+ gas_start "ret.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 CB00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 FB88\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 DB00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 EBF5\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 4] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_trap {} {
+ set testname "trap.s: xc16x add/sub tests"
+ set x 0
+
+ gas_start "trap.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 9B04\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 1] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_orb {} {
+ set testname "orb.s: xc16x or byte instructions tests"
+ set x 0
+
+ gas_start "orb.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 7102\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 7909\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 790D\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7903\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0008 77F02300\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000c 73F03402\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0010 75F03402\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 7] then { pass $testname } else { fail $testname }
+}
+
+
+proc do_xc16x_prior {} {
+ set testname "prior.s: Determine no shift cycles tests"
+ set x 0
+
+ gas_start "prior.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 2B01\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 1] then { pass $testname } else { fail $testname }
+}
+
+proc do_xc16x_nop {} {
+ set testname "nop.s: no operation nop tests"
+ set x 0
+
+ gas_start "nop.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 CC00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 CC00\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+
+proc do_xc16x_scxt {} {
+ set testname "scxt.s: push direct word to system stack tests"
+ set x 0
+
+ gas_start "scxt.s" "-al"
+
+ # Check each instruction bit pattern to verify it got
+ # assembled correctly.
+ while 1 {
+ expect {
+ -re " +\[0-9\]+ 0000 C6F0FFFF\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0004 D6F0FFFF\[^\n\]*\n" { set x [expr $x+1] }
+ timeout { perror "timeout\n; break }
+ eof { break }
+ }
+ }
+
+ # This was intended to do any cleanup necessary. It kinda looks like it
+ # isn't needed, but just in case, please keep it in for now.
+ gas_finish
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x == 2] then { pass $testname } else { fail $testname }
+}
+
+
+if [istarget xc16x*-*-*] then {
+ # Test the basic xc16x instruction parser
+ do_xc16x_add
+ do_xc16x_addb
+ do_xc16x_addc
+ do_xc16x_addcb
+ do_xc16x_sub
+ do_xc16x_subb
+ do_xc16x_subc
+ do_xc16x_subcb
+ do_xc16x_and
+ do_xc16x_andb
+ do_xc16x_or
+ do_xc16x_xor
+ do_xc16x_xorb
+ do_xc16x_mov
+ do_xc16x_movb
+ do_xc16x_movbs
+ do_xc16x_movbz
+ do_xc16x_shlrol
+ do_xc16x_neg
+ do_xc16x_mul
+ do_xc16x_div
+ do_xc16x_jmpa
+ do_xc16x_jmpi
+ do_xc16x_jmpr
+ do_xc16x_syscontrol1
+ do_xc16x_syscontrol2
+ do_xc16x_cpl
+ do_xc16x_cmp
+ do_xc16x_cmpb
+ do_xc16x_cmpi
+ do_xc16x_calla
+ do_xc16x_calli
+ do_xc16x_bit
+ do_xc16x_bfldl
+ do_xc16x_ret
+ do_xc16x_trap
+ do_xc16x_orb
+ do_xc16x_prior
+ do_xc16x_nop
+ do_xc16x_scxt
+
+}
diff --git a/gas/testsuite/gas/xc16x/xor.s b/gas/testsuite/gas/xc16x/xor.s
new file mode 100644
index 0000000..bdc83d7
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/xor.s
@@ -0,0 +1,10 @@
+ .section .text
+ .global _fun
+xc16x_or:
+ xor r0,r1
+ xor r0,[r1]
+ xor r0,[r1+]
+ xor r0,#3
+ xor r0,#0x0234
+ xor r0,0x0234
+ xor 0x0234,r0
diff --git a/gas/testsuite/gas/xc16x/xorb.s b/gas/testsuite/gas/xc16x/xorb.s
new file mode 100644
index 0000000..faf4a76
--- /dev/null
+++ b/gas/testsuite/gas/xc16x/xorb.s
@@ -0,0 +1,10 @@
+ .section .text
+ .global _fun
+xc16x_xorb:
+ xorb rl0,rl1
+ xorb rl0,[r1]
+ xorb rl0,[r1+]
+ xorb rl0,#3
+ xorb rl0,#0x34
+ xorb rl0,0x2403
+ xorb 0x2403,rl0