1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
section .rodata hexDigits: db '0123456789abcdef' section .text hex32: push rbx mov rbx, hexDigits xor rax, rax %rep 8 shl rax, 8 mov al, dil and al, 0x0f xlatb shr rdi, 4 %endrep pop rbx ret