the problem is that when it run, it outputs the not msg, which is a wrong statement. the problem is with the declaration or cmp?
jmp start
msg db "c is equal to a divide b.$"
msg_not db "c is NOT equal to a divide b.$"
start:
mov ax, 41 ; a=41
mov bx, 54 ; b=54
mov cx, 0 ; d=1
div bx ; cx=ax/bx
mov op1,cx ;
mov op2,al ;
cmp op1,0p2 ; compare the value of c and d
je same ; jump if equal to d
jne different ; jump if not equal to d
same:
mov dx, offset msg ;
mov ah, 09 ; output a string
int 21h ; output the message
jmp exit ;
different:
mov dx, offset msg_not ;
mov ah, 09 ; output a string
int 21h ; output the message
jmp exit ;
exit:
mov ah, 4ch ; select function exit
mov al,00 ;exit code 0
int 21h ; terminate program