home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
asm_sour
/
setp.asm
< prev
next >
Wrap
Assembly Source File
|
1984-08-06
|
3KB
|
89 lines
NAME SETP_MAIN
PAGE 75,132
TITLE SETP.ASM -- PROCEDURE TO SET PAGE LINES AND PERFORATION SKIP
;
;
; NO STACK SEGMENT
;
DISPLAY MACRO MESSAGE
MOV AH,09 ;REQUEST DISPLAY
MOV DX,OFFSET MESSAGE ;GET MESSAGE
INT 21H ;DOS SERVICE TO PRINT
ENDM
;
WORKAREA SEGMENT PARA PUBLIC 'DATA'
msg db 'SYSTEM: Intervention required on LPT1 $'
info1 db 10,13,'LPT1: Page length set for 11 inches$'
info2 db 10,13,'LPT1: Perforation skip set to 10 lines$'
info3 db 10,13,'LPT1: Line printer ready',10,13,'$'
ROWCOL DW ? ;ROW AND COLUMN FOR CURSOR
CMDLINE DB 24,27,'9',27,'C',00,11,27,'N',12,07,10
WORKAREA ENDS
;
SETP_CODE SEGMENT PARA PUBLIC 'CODE'
BEGIN PROC FAR ;FAR AWAY FROM DOS 2.10
ASSUME CS:SETP_CODE,DS:WORKAREA
PUSH DS
SUB AX,AX
PUSH AX
CLI ;DISABLE INTERRUPTS
MOV AX,WORKAREA ;GET THE DATA SEGMENT
MOV DS,AX ;SAVE IT
STI ;RESTART INTERRUPTS
CALL B10TST ;SEE IF PRINTER IS READY
CALL C10PRT ;CALL PRINT ROUTINE
RET
BEGIN ENDP ;END OF MAIN CODE
;
B10TST PROC NEAR ;LOCAL PROCS ARE NEAR BY
MOV AH,03 ;FETCH CURSOR POSITION AND SAVE IT
MOV BH,00
INT 10H ;BIOS FOR CURSOR SERVICE
MOV ROWCOL,DX ;SAVE THE RETURNED VALUE
B20:
MOV AH,02 ;TEST PRINTER STATUS
MOV DX,00 ;
INT 17H ;BIOS SERVICE TO TEST DEVICE
TEST AH,00101001B ;SEE IF PRINTER READY ELSE MESSAGE
JZ B30 ;NO - MESSAGE AND EXIT
CALL E10MSG ;PROVIDE MESSAGE
JMP B20
B30:
RET
B10TST ENDP
;
C10PRT PROC NEAR ;PROCEDURE TO PRINT
LEA SI,CMDLINE ;GET THE PRINTER COMMANDS
MOV CX,11 ;NUMBER OF BYTES TO PRINT
CALL D10OUT ;DISPLAY THE LINE
RET
C10PRT ENDP
;
D10OUT PROC NEAR ;PRINT MESSAGE
MOV DX,0000 ;PRINTER #0
D20:
MOV AH,00 ;REQUEST PRINT
MOV AL,[SI] ;GET CHAR FROM LINE
INT 17H ;BIOS TO PRINT SERVICE
INC SI
LOOP D20
DISPLAY INFO1
DISPLAY INFO2
DISPLAY INFO3
RET
D10OUT ENDP
;
E10MSG PROC NEAR ;DISPLAY A MESSAGE
MOV AH,02 ;REQUEST SET CURSOR FUNCTION
MOV BH,00 ;
MOV DX,ROWCOL ;OLD POSITION SAVED
INT 10H ;BIOS FOR DISPLAY SERVICE
LEA DX,MSG ;GET ERROR MESSAGE
MOV AH,09H
INT 21H
RET
E10MSG ENDP
;
SETP_CODE ENDS
END BEGIN