home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1988 / 02 / bcitip / analog.asm next >
Encoding:
Assembly Source File  |  1987-12-03  |  1.3 KB  |  34 lines

  1. ;----------------------- ANALOG.ASM -----------------------
  2. ;       Abfrage eines Game Adapters unter BCI Pascal
  3. ;           Function Analog (Maske) : integer
  4. ;---------------------- 1987 by M.A. ----------------------
  5. public analog
  6. code segment byte public 'PASCAL'   ; ... Grüße an BCI ...
  7. assume cs:code
  8.  
  9. analog proc far                     ; Abfrage Analogeingang
  10.        pop bx
  11.        push cs
  12.        push bx                      ; hier geht's zurück
  13.        mov si,sp
  14.        mov bx,[si+4]                ; hole Maske
  15.        mov dx,0201h                 ; Portadresse
  16.        mov cx,0000h                 ; unser Zähler
  17.        mov ah,00h
  18.        out dx,al                    ; starte Messung
  19. loop:  in al,dx                     ; Wert einlesen
  20.        and al,0fh                   ; Buttons ausblenden
  21.        test al,bl                   ; schon fertig?
  22.        jp exit1
  23.        inc cx                       ; Zähler erhöhen
  24.        cmp cx,1fffh                 ; kleine Notbremse
  25.        jne loop
  26. exit1: mov ax,cx                    ; Ergebnis übergeben
  27.        or ax,ax                     ; Flags säubern
  28.        ret 2                        ; Stack säubern
  29. analog endp                         ; und fertig...
  30.  
  31. code ends
  32. end
  33. ;---------------------- Ende ANALOG.ASM -------------------
  34.