summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorChristian Groessler <chris@groessler.org>2003-05-01 19:59:33 +0000
committerChristian Groessler <chris@groessler.org>2003-05-01 19:59:33 +0000
commit076edb542bb3147bcfc3c621b5b44327a547b91f (patch)
treeb65239130893733eedef282ff6b3bbf5e82c5fb0 /opcodes
parent09edb3933d8048ad54db1efae68073ba732adeb9 (diff)
downloadgdb-076edb542bb3147bcfc3c621b5b44327a547b91f.tar.gz
* expr.h: Fix comments in operatorT typedef.
* config/tc-z8k.c: Add 2003 to copyright message. Fold s_segm() and s_unseg() into one function s_segm(parm) which decides by the parameter. (md_begin): Don't set linkrelax. Only set Z8002 default if no command line argument was given to select the intended architecure. (get_interrupt_operand): Warn if NOP type code is emitted. (newfix): New parameter 'size', forward it to 'fix_new_exp'. (apply_fix): Call newfix with additional 'size' parameter. (build_bytes): Remove unused variable 'nib'. Detect overflow in 4 bit immediate arguments. (md_longopts): Add 'linkrelax' option. (md_parse_option): Adapt to new s_segm function. Set 'linkrelax' variable when 'linkrelax' command line option is specified. (md_show_usage): Display 'linkrelax' option. (md_apply_fix3): Fix cases R_IMM4L, R_JR, and R_IMM8. Add cases R_CALLR and R_REL16. * config/tc-z8k.h: Undef WARN_SIGNED_OVERFLOW_WORD.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/z8k-dis.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/opcodes/z8k-dis.c b/opcodes/z8k-dis.c
index 6c1913892c8..69d1792312a 100644
--- a/opcodes/z8k-dis.c
+++ b/opcodes/z8k-dis.c
@@ -209,11 +209,13 @@ z8k_lookup_instr (nibbles, info)
int nibl_index, tabl_index;
int nibl_matched;
+ int need_fetch = 0;
unsigned short instr_nibl;
unsigned short tabl_datum, datum_class, datum_value;
nibl_matched = 0;
tabl_index = 0;
+ FETCH_DATA (info, 4);
while (!nibl_matched && z8k_table[tabl_index].name)
{
nibl_matched = 1;
@@ -222,8 +224,15 @@ z8k_lookup_instr (nibbles, info)
nibl_index++)
{
if ((nibl_index % 4) == 0)
- /* Fetch one word at a time. */
- FETCH_DATA (info, nibl_index + 4);
+ {
+ /* Fetch data only if it isn't already there. */
+ if (nibl_index >= 4 || (nibl_index < 4 && need_fetch))
+ FETCH_DATA (info, nibl_index + 4); /* Fetch one word at a time. */
+ if (nibl_index < 4)
+ need_fetch = 0;
+ else
+ need_fetch = 1;
+ }
instr_nibl = nibbles[nibl_index];
tabl_datum = z8k_table[tabl_index].byte_info[nibl_index];
@@ -414,14 +423,14 @@ unpack_instr (instr_data, is_segmented, info)
FETCH_DATA (info, nibl_count + 8);
instr_long = (instr_data->words[nibl_count] << 16)
| (instr_data->words[nibl_count + 4]);
- instr_data->address = ((instr_word & 0x7f00) << 8)
+ instr_data->address = ((instr_word & 0x7f00) << 16)
+ (instr_long & 0xffff);
nibl_count += 7;
seg_length = 2;
}
else
{
- instr_data->address = ((instr_word & 0x7f00) << 8)
+ instr_data->address = ((instr_word & 0x7f00) << 16)
+ (instr_word & 0x00ff);
nibl_count += 3;
}
@@ -484,6 +493,13 @@ unpack_instr (instr_data, is_segmented, info)
}
}
+static char *intr_names[] = {
+ "all", /* 0 */
+ "vi", /* 1 */
+ "nvi", /* 2 */
+ "none" /* 3 */
+};
+
static void
unparse_instr (instr_data, is_segmented)
instr_data_s *instr_data;
@@ -536,6 +552,12 @@ unparse_instr (instr_data, is_segmented)
strcat (out_str, tmp_str);
break;
case CLASS_IMM:
+ if (datum_value == ARG_IMM2) /* True with EI/DI instructions only. */
+ {
+ sprintf (tmp_str, "%s", intr_names[instr_data->interrupts]);
+ strcat (out_str, tmp_str);
+ break;
+ }
sprintf (tmp_str, "#0x%0lx", instr_data->immediate);
strcat (out_str, tmp_str);
break;