we start with a 32 bit code e.g: "AA BB CC DD" (little endian)
we want "AA DD CC BB" as end result (big endian). I've managed to write it in 8 lines, with %ebx as the entry and %ecx as the exit. The teacher mentioned it was possible to write this in less than 4 lines, 3 being the record. I was curious to see how it can be shortened.
mov %R1, %ebx
mov %bx, %cx
shl $16, %ecx
mov %cl, %dl
mov %bl, %cl
mov %bh, %dh
shr %16, %edx
and %edx, %ecx