/* Print National Semiconductor 32000 instructions.
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 Free Software Foundation, Inc.
This file is part of the GNU opcodes library.
static int
sign_extend (unsigned int value, unsigned int bits)
{
- unsigned int sign = 1u << bits;
- return ((value & (sign - 1)) ^ sign) - sign;
+ unsigned int sign = 1u << (bits - 1);
+ return ((value & (sign + sign - 1)) ^ sign) - sign;
}
static void