;************************************************************** ;Programmed by Billal BEGUERADJ ;www.begueradj.50megs.com ;Bejaia University ;beg.bill@yahoo.com ;the aim of my program : ;Check if mouse driver is installed ;Shows the position of the cursor ;Checks which button of mouse is pressed ;************************************************************* pile SEGMENT STACK dw 100 dup(?) pile ends ; *********************************************** data SEGMENT msg db 'there is a mouse driver which is installed',10,13,'$' msgbd db 'you have pressed the right button' db 'at position:$' msgbg db 'you have pressed the left button' db 10,13,'at position:$' esps db ',$' data ends ; ************************************************ code SEGMENT assume cs:code,ds:data,ss:pile ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- mod_text proc push ax mov ax,03 int 10h pop ax ret mod_text endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* mod_graph proc push ax mov ax,13h int 10h pop ax ret mod_graph endp readkey proc push ax mov ah,8 int 21h pop ax ret readkey endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* aff_msg proc push ax mov ah,09h int 21h pop ax ret aff_msg endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* INIT_SOURIS proc mov ax,0 int 33h ret init_souris endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* pointer_visibl proc push ax mov ax,01 int 33h pop ax ret pointer_visibl endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* masqu_pointer proc push ax mov ax,2 int 33h pop ax ret masqu_pointer endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* PEX_XY PROC push bx mov bl,8 mov al,cl mul bl mov cx,ax mov bl,16 mov al,dl mul bl mov dx,ax pop bx ret pex_xy endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* bouton_g proc mov ax,5 mov bx,00 int 33h ret bouton_g endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* bouton_d proc mov ax,5 mov bx,01 int 33h ret bouton_d endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* hex_dec proc mov cx,00 mov bx,0ah ref:mov dx,00 div bx push dx inc cx cmp ax,00 jne ref ref2:pop dx call af_chif loop ref2 ret hex_dec endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* af_chif proc add dl,30h mov ah,2 int 21h ret af_chif endp ;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* ;************************************************************** debut:mov ax,data mov ds,ax call mod_graph call init_souris call pointer_visibl call readkey call masqu_pointer call mod_text call init_souris call pointer_visibl call readkey lea dx,msg call aff_msg call readkey refair:mov ax,3 int 33h cmp bx,1 jne saut push cx push dx lea dx,msgbg call aff_msg jmp fin saut:cmp bx,2 jne refair push cx push dx lea dx,msgbd call aff_msg fin:pop ax call hex_dec lea dx,esps call aff_msg pop ax call hex_dec call readkey call masqu_pointer mov ah,4ch int 21h code ends end debut