summary refs log tree commit diff homepage
path: root/lib.asm
blob: 10d0e1c28b1d3e0aac67abcc160e979372500a4b (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