Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
VeriPrint
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* VeriPrint - Checks if LPT1 (PRN) is available.
;*
;* Shows:   BIOS Interrupt - 17h (Parallel Port Printer Driver)
;*
;* Params:  None
;*
;* Return:  Short integer, 1 for yes or 0 for no
 
VeriPrint PROC
 
        mov     ah, 2                   ; Check printer status for
        sub     dx, dx                  ;   parallel printer (port 0)
        int     17h
        xchg    dx, ax                  ; Put 0 (for error) in AX
 
; If all error bits are off and both operation bits are on, return 1
 
        .IF     !(dh & 00101001y) && (dh & 10010000y)
        inc     ax                      ; Return 1
        .ENDIF
        ret
 
VeriPrint ENDP
                                    -♦-