Nios/abs

From ASMBits

nios/oddPrevious

Write a function that returns the absolute value of its parameter. The parameter is a two's-complement signed integer.

int abs (int n);

Expected solution length: Around 4 lines.

Sample Input

10
-10

Sample Output

10
10

Write your solution here

Upload a source file...