aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-m32c.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-10-26 20:42:00 +0000
committerDJ Delorie <dj@redhat.com>2005-10-26 20:42:00 +0000
commitd14c4fad02815b17dec6e8f6aa7bf921b0349e0b (patch)
treee753a5ef7be674cfab26d2e59dca9abd0fb36899 /gas/config/tc-m32c.c
parent6b73c529e04e27601eb1183d2a5be8e955053100 (diff)
downloadgdb-d14c4fad02815b17dec6e8f6aa7bf921b0349e0b.zip
gdb-d14c4fad02815b17dec6e8f6aa7bf921b0349e0b.tar.gz
gdb-d14c4fad02815b17dec6e8f6aa7bf921b0349e0b.tar.bz2
* config/tc-m32c.c (md_relax_table, subtype_mappings,
md_convert_frag): Add jsr.w support.
Diffstat (limited to 'gas/config/tc-m32c.c')
-rw-r--r--gas/config/tc-m32c.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index cb589ac..9a9b825 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -395,7 +395,12 @@ const relax_typeS md_relax_table[] =
/* 15 */ { 8, 1, 1, 16 }, /* jmp32.s */
/* 16 */ { 127, -128, 2, 17 }, /* jmp32.b */
/* 17 */ { 32767, -32768, 3, 18 }, /* jmp32.w */
- /* 18 */ { 0, 0, 4, 0 } /* jmp32.a */
+ /* 18 */ { 0, 0, 4, 0 }, /* jmp32.a */
+
+ /* 19 */ { 32767, -32768, 3, 20 }, /* jsr16.w */
+ /* 20 */ { 0, 0, 4, 0 }, /* jsr16.a */
+ /* 21 */ { 32767, -32768, 3, 11 }, /* jsr32.w */
+ /* 22 */ { 0, 0, 4, 0 } /* jsr32.a */
};
enum {
@@ -436,7 +441,12 @@ static struct {
/* 15 */ { M32C_INSN_JMP32_S, 1, M32C_INSN_JMP32_A, 0 },
/* 16 */ { M32C_INSN_JMP32_B, 2, M32C_INSN_JMP32_A, 1 },
/* 17 */ { M32C_INSN_JMP32_W, 3, M32C_INSN_JMP32_A, 2 },
- /* 18 */ { M32C_INSN_JMP32_A, 4, M32C_INSN_JMP32_A, 0 }
+ /* 18 */ { M32C_INSN_JMP32_A, 4, M32C_INSN_JMP32_A, 0 },
+
+ /* 19 */ { M32C_INSN_JSR16_W, 3, M32C_INSN_JSR16_A, 2 },
+ /* 20 */ { M32C_INSN_JSR16_A, 4, M32C_INSN_JSR16_A, 0 },
+ /* 21 */ { M32C_INSN_JSR32_W, 3, M32C_INSN_JSR32_A, 2 },
+ /* 22 */ { M32C_INSN_JSR32_A, 4, M32C_INSN_JSR32_A, 0 }
};
#define NUM_MAPPINGS (sizeof (subtype_mappings) / sizeof (subtype_mappings[0]))
@@ -677,6 +687,38 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
break;
+ case M32C_INSN_JSR16_W:
+ op[0] = 0xf5;
+ op[1] = addend - 1;
+ op[2] = (addend - 1) >> 8;
+ operand = M32C_OPERAND_LAB_8_16;
+ break;
+
+ case M32C_INSN_JSR16_A:
+ op[0] = 0xfd;
+ op[1] = 0;
+ op[2] = 0;
+ op[3] = 0;
+ operand = M32C_OPERAND_LAB_8_24;
+ break;
+
+ case M32C_INSN_JSR32_W:
+ op[0] = 0xcf;
+ op[1] = addend - 1;
+ op[2] = (addend - 1) >> 8;
+ operand = M32C_OPERAND_LAB_8_16;
+ break;
+
+ case M32C_INSN_JSR32_A:
+ op[0] = 0xcd;
+ op[1] = 0;
+ op[2] = 0;
+ op[3] = 0;
+ operand = M32C_OPERAND_LAB_8_24;
+ break;
+
+
+
default:
printf("\nHey! Need more opcode converters! missing: %d %s\n\n",
fragP->fr_subtype,