home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
techs.zip
/
TECH20.ARC
/
PRNTCHK.ASM
next >
Wrap
Assembly Source File
|
1985-10-30
|
2KB
|
152 lines
.LFCOND
PAGE 60,132
D3DR EQU 1
COM EQU 0
TRUE EQU 1
FALSE EQU 0
;**************************************
CODESEG SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:CODESEG,ES:CODESEG
;--------------------------------------
PRNTCHK PROC FAR
IF COM
ORG 100H
ENDIF
START: JMP NEXT_STEP
;
MESS0 DB 'PRINTER OUT OF PAPER',0DH,0AH,'$'
MESS1 DB 'PRINTER OFF LINE - PLEASE ADJUST',0DH,0AH,'$'
MESS2 DB 'PRINTER NOT TURNED ON - PLEASE TURN IT ON',0DH,0AH,'$'
MESS3 DB 'PRINTER AVAILABLE FOR PRINTING',0DH,0AH,'$'
MESS4 DB 'PRESS ANY KEY TO CONTINUE',0DH,0AH,'$'
OK DB ?
;
NEXT_STEP:
PUSH AX
PUSH BX
PUSH DS
PUSH ES
PUSH CS
POP ES
MOV AX,40H
MOV DS,AX
MOV SI,8
MOV DX,[SI]
INC DX
IN AL,DX
AND AL,0F8H
CMP AL,0D8H
JNE OUT_OF_PAPER
MOV ES:OK,TRUE
IF COM
MOV DX,OFFSET MESS3
CALL PRINTMESS
ENDIF
JMP SHORT EXIT
OUT_OF_PAPER:
CMP AL,0E8H
JNE OFF_LINE
MOV ES:OK,FALSE
IF COM
MOV DX,OFFSET MESS0
CALL PRINTMESS
MOV DX,OFFSET MESS4
CALL PRINTMESS
CALL CRLF
POP ES
POP DS
POP BX
POP AX
CALL WAIT
JMP NEXT_STEP
ENDIF
JMP SHORT EXIT
OFF_LINE:
CMP AL,0C8H
JNE TURNED_OFF
MOV ES:OK,FALSE
IF COM
MOV DX,OFFSET MESS1
CALL PRINTMESS
MOV DX,OFFSET MESS4
CALL PRINTMESS
CALL CRLF
POP ES
POP DS
POP BX
POP AX
CALL WAIT
JMP NEXT_STEP
ENDIF
JMP SHORT EXIT
TURNED_OFF:
MOV ES:OK,FALSE
IF COM
MOV DX,OFFSET MESS2
CALL PRINTMESS
MOV DX,OFFSET MESS4
CALL PRINTMESS
CALL CRLF
POP ES
POP DS
POP BX
POP AX
CALL WAIT
JMP NEXT_STEP
ENDIF
EXIT: POP ES
POP DS
POP BX
IF D3DR
MOV AL,ES:OK
MOV BYTE PTR [BX],AL
ENDIF
POP AX
IF COM
INT 20H
ELSE
RET
ENDIF
;
PRNTCHK ENDP
;----------------------------------------
CRLF PROC NEAR
PUSH AX
PUSH DX
MOV DL,0DH
MOV AH,2
INT 21H
MOV DL,0AH
MOV AH,2
INT 21H
POP DX
POP AX
RET
CRLF ENDP
;----------------------------------------
PRINTMESS PROC NEAR
PUSH AX
PUSH DS
MOV AX,ES
MOV DS,AX
XOR AX,AX
MOV AH,9
INT 21H
POP DS
POP AX
RET
PRINTMESS ENDP
;----------------------------------------
WAIT PROC NEAR
PUSH AX
MOV AH,7
INT 21H
POP AX
RET
WAIT ENDP
;----------------------------------------
CODESEG ENDS
;******************************************
END START