Last active
November 27, 2022 13:45
-
-
Save alex-robert-fr/7cc5c86c91bee9e3d807db1c9d9a0924 to your computer and use it in GitHub Desktop.
Simple condition in ASM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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