Arm/signext

From ASMBits

arm/zeroextPrevious

Write a function (named signext) that will sign-extend an 8-bit input number (the lowest 8 bits of the function parameter) to 32 bits. The upper 24 bits of the input number should be ignored (and may not necessarily be zero).

int signext(char n);


Sample Input

0xf0

Sample Output

0xfffffff0

Write your solution here

Upload a source file...