home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
asm_sour
/
cancel.asm
< prev
next >
Wrap
Assembly Source File
|
1984-08-08
|
3KB
|
87 lines
NAME CANCEL_MAIN
PAGE 75,132
TITLE CANCEL.ASM -- PROCEDURE TO CANCEL PRN SETTINGS
;
; NO STACK SEGMENT
;
;
DISPLAY MACRO MESSAGE ;DISPLAY A MESSAGE TO STD OUTPUT
MOV AH,09
MOV DX,OFFSET MESSAGE
INT 21H ;DOS SERVICE FOR DISPLAY
ENDM
;
WORKAREA SEGMENT PARA PUBLIC 'DATA'
MSG DB 'SYSTEM: Intervention required on LPT1$',10,13
INFO DB 10,13,'LPT1: Cancelled$',10,13
ROWCOL DW ? ;SAVE ROW AND COLUMN OF CURSOR
CMDLINE DB 24,27,'2',27,'8',27,'<',27,'O',7,10
WORKAREA ENDS
;
;
CANCEL_CODE SEGMENT PARA PUBLIC 'CODE'
PUBLIC START
START PROC FAR
ASSUME CS:CANCEL_CODE,DS:WORKAREA
PUSH DS
SUB AX,AX
PUSH AX ;RETURN CODES ON STACK
CLI ;DISABLE INTERRUPTS
MOV AX,WORKAREA ;GET THE DATA SEGMENT
MOV DS,AX ;AND MOVE IN INTO REGISTER
STI
CALL B10TST ;TEST PRN STATS
CALL C10PRT ;PRINT THE COMMAND LINE
RET
START ENDP
;
B10TST PROC NEAR ;LOCAL PROCS ARE NEAR BY
MOV AH,03 ;SET OLD CURSOR POSITION
MOV BH,00
INT 10H ;READ CURSOR PSN
MOV ROWCOL,DX ;SAVE IT
B20:
MOV AH,02
MOV DX,00 ;TEST PRINTER STATUS HERE
INT 17H
TEST AH,00101001B ;SEE IF READY OR NOT
JZ B30 ;NO MESSAGE AND RESCAN
CALL E10MSG ;NOTIFY OPERATOR TO FIX PRN
JMP B20
B30:
RET ;FINISHED, EXIT
B10TST ENDP
;
C10PRT PROC NEAR
LEA SI,CMDLINE ;GET ADDR OF COMMAND LINE
MOV CX,11 ;NUMBER OF BYTES IN COMMAND
CALL D10OUT ;PRINT THE COMMAND TO PRINT CTRLR
RET
C10PRT ENDP
;
D10OUT PROC NEAR
MOV DX,0000
D20:
MOV AH,00
MOV AL,[SI]
INT 17H
INC SI
LOOP D20
DISPLAY INFO
RET
D10OUT ENDP
;
E10MSG PROC NEAR
MOV AH,02 ;REQUEST DISPLAY SERVICE
MOV BH,00 ;SET CURSOR TO OLD PLACE
MOV DX,ROWCOL ;MOVE SETTING INTO DX REG
INT 10H ;BIOS FOR SERVICE
LEA DX,MSG ;GET THE ADDR
MOV AH,09H ;SELECT FUNCTION = DISPLAY ON MONITOR
INT 21H
RET
E10MSG ENDP
;
CANCEL_CODE ENDS
END START