Len_data Equ 14
Xcoord Dw 0
Ycoord Dw 0
Ascval Dw ?

Dispdata Label Byte
Xmsg Db 'x = '
Xascii Dw ?
       Db ' '

Ymsg Db 'y = '
Yascii Dw ?

A10main Proc Far
        Mov Ax,2
        Mov Ds,ax
        Mov Es,ax

        Call B10initz
        Cmp Ax,00
        Je A90

A20:    Call C10pointr
        Cmp Bx,01
        Je A80
        Mov Ax,xcoord
        Call D10convrt
        Mov Ax,ascval
        Mov Xascii,ax
        Mov Ax,ycoord
        Call D10convrt
        Mov Ax,ascval
        Mov Yascii,ax
        Call E10disply

A80:    Mov Ax,02h
        Int 33h

A90:   ; Call Q10clear
        Mov Ax,4c00h
        Int 21h

A10main Endp

B10initz Proc Near
        Mov Ax,00h
        Int 33h
        Cmp Ax,00
        Je B90
        Mov Ax,01h
        Int 33h

B90:    Ret
B10initz Endp

C10pointr Proc Near
C20:    Mov Ax,03h
        Int 33h
        Cmp Bx,00000001b
        Je C90
        Shr Cx,03
        Shr Dx,03
        Cmp Cx,xcoord
        Jne C30
        Cmp Dx,ycoord
        Je C20

C30:    Mov Xcoord,cx
        Mov Ycoord,dx

C90:    Ret
C10pointr Endp

D10convrt Proc Near
        Mov Ascval,2020h
        Mov Cx,10
        Lea Si,ascval+1
        Cmp Ax,cx
        Jb D20
        Div Cl
        Or Ah,30h
        Mov [si],ah
        Dec Si

D20:    Or Al,30h
        Mov [si],al
D10convrt Endp

E10disply Proc Near
        Mov Ax,1300h
        Mov Bx,0031h
        Lea Bp,dispdata
        Mov Cx,len_data
        Mov Dx,0020h
        Int 10h
E10disply Endp
        End A10main
Above Are The Codes I Used The Problem Is I Don't Get The Desired Output Which Is The Mouse Pointer Will Be Seen And The X And Y Coordinates As Well.

Pls Help Me Debug. Thanks.

Last edited by shabbir; 4Mar2008 at 11:15.. Reason: Code block -