Here's the code to check printer status before AR invoices were printed.
SUB check_prn
local status%,a$,parPort%,mes1$,mes2$,mes3$,s$
DEF SEG = &H40
ParPort%=(peek(8)+256*peek(9))+1 'get address of LPT1
DEF SEG
! push bp
! push sp
! push ds ;Save the Data Segment
! mov dx, Parport% ;LPT 1 Printer Address +1 (&h379 or 889)
! in ax, dx ;Request Status
! and ax, &hF0 ;turn off LSB's
! mov status%, ax ;Load the register into status%
! pop ds ;Return the Data Segment
! pop sp
! pop bp
SELECT CASE Status%
CASE &H80, &H70, &H60 ' ************** Printer bad ****************
mes1$ = "THE PRINTER IS NOT RESPONDING! PRESS ANY KEY ..."
EXIT SELECT
CASE &HD0 '************ Printer OK ***********
EXIT SUB
CASE ELSE ' ************** Printer bad ****************
mes1$ = "THE PRINTER IS NOT RESPONDING! PRESS ANY KEY ..."
EXIT SELECT
END SELECT
s$ = savescreen$
popwindow 11,15,12,67,4,fnattr%(0,7),0,-5,20," OOPS! "
xqprint mes1$,11,15,fnattr%(0,7)
a$ = INPUT$( 1 )
restorescreen s$
EXIT FAR
END SUB