/* * What in the everloving fuck is this instruction? * Who even came up with this? * Why is this a thing? * * compile with -m32 (if on x86_64) */ #include #include int main(){ volatile uint16_t a = 0; uint16_t input = 0x0902; printf("Input: %04xh\n", input); asm volatile("\ movw %[input], %%ax \n \ aad $16 \n \ mov %%ax, %[a] \n": [a] "=m" (a): [input] "m" (input): "rax", "cc"); printf("Output:\nb10: %d\nb8: %06o\nb16: %04xh\n", a, a, a); return 0; }