.model small .stack 100h .data num1 db -128 ; The number to check positive db "The number is positive $" negative db "The number is negative $" zero db "The number is zero $" .code main: mov ax, @data mov ds, ax mov al, num1 cmp al, 0 jg greater jl lower je zeros greater: mov ah, 09h lea dx, positive int 21h jmp end lower: mov ah, 09h lea dx, negative int 21h jmp end zeros: mov ah, 09h lea dx, zero int 21h end: mov ah, 4Ch int 21h end main
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter