summary refs log tree commit diff homepage
path: root/lib.asm
blob: 22bf196c2583b3e71034425dd6cc0601b958908a (plain) (blame)
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