From ASMBits


When communicating multi-byte (hword or word) values between machines of different endianness, it is sometimes necessary to swap the byte ordering. Write a function that will reverse the byte ordering in a 32-bit word. (Note that only bytes are swapped. The 8 bits within each byte are still in the same order.)

The function has one parameter: The input number.

Expected solution length: Around 2 lines.

Sample Input


Sample Output


The rev instruction may be useful.

Write your solution here

Upload a source file...