is number overlap or not in assembly language programming

[org 0x100]
jmp start

answer: dw 0    

isoverlap: push bp
mov bp,sp
push es
push ds
push si
push di
push cx
push ax

mov ax,[bp+6]
mov cx,160
mul cx
mov si,ax

mov ax,[bp+4]
mov cx,160
mul cx
mov di,ax
mov ax,1
mov word [answer],ax
cmp si,di
ja next
mov ax,2
                        mov word [answer],ax

next:
pop ax
pop cx
pop di
pop si
pop ds
pop es
pop bp

ret 4


start:
mov ax,20
push ax
mov ax,15
push ax
call isoverlap


mov ax,0x4c00
int 0x21

Comments

Popular Posts