I have a short, instr, that looks like this:
instr
1110xxx111111111
I need to pull out bits 0-9, which I do with (instr &
(instr &
An easier solution is this, for x being a 5-bit 2's complement number, look:
x
z = (x^16)-16