cbw

Sign-extend al into ax

Sign-extends al into ax, filling ah with copies of the sign bit of al.

8086 and later

Intel's reference: CBW/CWDE/CDQE

CFPFAFZFSFDFOF –––––––
  • Changes no flag

Forms

  • cbw

The rest of rax is unchanged.

global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        cbw

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall