/* Disassembler code for CR16.
- Copyright 2007, 2008, 2009, 2012, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
Contributed by M R Swami Reddy (MR.Swami.Reddy@nsc.com).
This file is part of GAS, GDB and the GNU binutils.
cr16_match_opcode (void)
{
unsigned long mask;
- /* The instruction 'constant' opcode doewsn't exceed 32 bits. */
+ /* The instruction 'constant' opcode doesn't exceed 32 bits. */
unsigned long doubleWord = (cr16_words[1]
+ (cr16_words[0] << 16)) & 0xffffffff;
switch (a->type)
{
case arg_r:
- p = makelongparameter (cr16_allWords,
+ p = makelongparameter (cr16_allWords,
inst_bit_size - (start_bits + a->size),
inst_bit_size - start_bits);
a->r = p.val;
break;
case arg_ic:
- p = makelongparameter (cr16_allWords,
+ p = makelongparameter (cr16_allWords,
inst_bit_size - (start_bits + a->size),
inst_bit_size - start_bits);
a->constant = p.val;
}
else if (instruction->size == 2)
{
- p = makelongparameter (cr16_allWords, inst_bit_size - 16,
+ p = makelongparameter (cr16_allWords, inst_bit_size - 16,
inst_bit_size);
a->constant = p.val;
}
for (i = 0, mem = memaddr; i < 3; i++, mem += 2)
cr16_words[i] = get_word_at_PC (mem, info);
- cr16_allWords = ((ULONGLONG) cr16_words[0] << 32)
+ cr16_allWords = ((ULONGLONG) cr16_words[0] << 32)
+ ((unsigned long) cr16_words[1] << 16) + cr16_words[2];
}