;Copyright 2000 - Mark McDonald All rights reserved
; mbuttons routine for PowerBASIC
; DECLARE: FUNCTION mbuttons() AS INTEGER
; DESC:    Returns the number of mouse buttons.
; EXAMP:   IF mbuttons THEN ......

MCODE Segment Byte
        Assume  CS: MCODE

        Public  mbuttons

mbuttons Proc Far
        push    BP                      ;
        mov     BP,SP                   ;
        push    DS                      ;

        xor     AX, AX                  ; get mouse type
        int     33h                     ; call mouse interrupt
        or      AX, AX                  ; is a mouse present?
        jz      Exit                    ; no, exit
        mov     AX, BX                  ; put number of buttons in AX
;       or      AX, AX                  ; is it -1 ?
;       jns     Exit                    ; no, return number of buttons
;       mov     AX, 2                   ; there are two buttons
Exit:
        pop     DS                      ;
        pop     BP                      ;
        retf                            ;
mbuttons EndP
MCODE   EndS
        End