Souris, boutons, curseur

Contenu du snippet

le programme qui suit est réalisé dans le cadre d'un mini projet semestriel. C'est le premier que j'e dépose sur ce site.

il vous donne la position
il vous dit quel bouton est appuyé

Source / Exemple :

 ;************************************************************** ;Programmed by Billal BEGUERADJ  ;www.begueradj.50megs.com ;Bejaia University ;beg.bill@yahoo.com ;the aim of my program : ;vérifie si le driver de la souris est installe ;vous donne la position  ;vous dit quel bouton est appuyé ;*************************************************************   pile SEGMENT STACK          dw 100 dup(?)   pile ends  ; ***********************************************   data SEGMENT   msg db 'il y a un driver de souris installé',10,13,'$'   msgbd db 'vous avez apuye sur le bouton droit'         db 'a la position:$'   msgbg db 'vous avez apuye sur le bouton gauche'         db 10,13,'ala 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 

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.