Skip to content

Instantly share code, notes, and snippets.

@alex-robert-fr
Last active November 27, 2022 13:45
Show Gist options
  • Save alex-robert-fr/7cc5c86c91bee9e3d807db1c9d9a0924 to your computer and use it in GitHub Desktop.
Save alex-robert-fr/7cc5c86c91bee9e3d807db1c9d9a0924 to your computer and use it in GitHub Desktop.
Simple condition in ASM
; if (bx <= 4)
; mov al, 'A'
; else if (bx < 40)
; mov al, 'B'
; else
; mov al, 'C'
mov bx, 40
cmp bx, 4
jle less_or_equal
cmp bx, 40
jl less
mov al, 'C'
jmp end
less_or_equal:
mov al, 'A'
jmp end
less:
mov al, 'B'
jmp end
end:
mov ah, 0x0e
int 0x10
jmp $
times 510-($-$$) db 0
dw 0xaa55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment