positive or negative
Sat May 04 2024 09:56:59 GMT+0000 (Coordinated Universal Time)
Saved by
@signup
.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
content_copyCOPY
Comments