please help me with my code.. :(
i am suppose to enter a 4-digit number and compare it to '0000'. i don't know why my code isn't working. i am not very good in debugging.. please help me
sseg segment para stack "stack"
db 4096 dup(?)
sseg ends
dseg segment para public "data"
msg db "Enter number: $"
nline db 13, 10, "$"
smaxlen db 50
scurrlen db ?
sdata db 50 dup(?)
number db "0000$"
equal db "Equal!$"
nequal db "Not equal!$"
dseg ends
cseg segment para public "code"
assume cs:cseg, ds:dseg
compare proc
mov ax, cs
mov ds, ax
mov es, ax
cld
lea si, number
lea di, sdata
mov cx, 4
repe cmpsb
jnz not_equal
mov dx, offset equal
mov ah, 09h
int 21h
jmp exit_here
not_equal:
mov dx, offset nequal
mov ah, 09h
int 21h
exit_here:
ret
compare endp
main proc
mov ax, dseg
mov ds, ax
mov ah, 09h
mov dx, offset msg
int 21h
mov ah, 0ah
mov dx, offset smaxlen
int 21h
mov dx, offset nline
mov ah, 09h
int 21h
call compare
exit:
mov ah, 4ch
int 21h
main endp
cseg ends
end main