Category : Files from Magazines
Archive   : N7V11.ZIP
Filename : PRNBYL.ASM
;PRNBYLIN.ASM is a memory resident program that allows you
;to print one or more lines when using
;
;Assemble and link with MASM, then create .COM file using
;EXE2BIN
;set up installation of TSR
CSEG SEGMENT
ASSUME CS:CSEG,DS:CSEG,ES:CSEG
ORG 0100H
START: JMP INIT
IRUPT DW 0
IRPT1 DW 0
CURPOS DW 0
MAIN: PUSH DX ;save registers
PUSH AX
PUSH BX
PUSH CX
PUSH DS
PUSHF
PUSH CS
POP DS
MOV AX,0050H ;check if PrtSc is
MOV ES,AX ;active
CMP BYTE PTR ES:[0000H],01
JZ ENDM
MOV BYTE PTR ES:[0000H],01 ;make PrtSc active
MOV AH,0FH
INT 10H
CMP AL,3 ;check for 80-col mode
JLE SAVECUR
ENDM: POPF ;return to BIOS PrtSc
POP DS
POP CX
POP BX
POP AX
POP DX
JMP FAR [IRUPT]
SAVECUR: MOV AH,3 ;save cursor position
INT 10H
MOV CURPOS,DX
XOR CX,CX
MOV DX,CX
MOV AH,2
INT 10H
CALL ATTR ;show selection bar
GETKEY: XOR AH,AH ;get key
INT 16H
CMP AH,1CH ;test for
JE SELECT
CMP AH,4AH ;test for <+>
JE PGUP
CMP AH,01 ;test for
JE END10 ;quit
CMP AH,4EH ;test for <->
JNE GETKEY
PGDN: CMP CL,24 ;move bar down
JE GETKEY
CMP CH,CL
JNZ PGD1
CALL ATTR
INC CH
PGD1: INC CL
CALL ATTR
JMP GETKEY
SELECT: CMP CH,CL ;get line positions
JNZ PRINT ;and print
CMP CL,24
JE PRINT
INC CL
CALL ATTR
JMP GETKEY
PGUP: CMP CL,0 ;move bar up
JZ GETKEY
CALL ATTR
CMP CH,CL
JNZ PGU1
DEC CH
DEC CL
JMP PGU2
PGU1: DEC CL
CMP CL,CH
JNZ GETKEY
INC CL
PGU2: CALL ATTR
JMP GETKEY
PRINT: MOV DH,CH
SUB CL,CH ;get characters and
XOR CH,CH ;send to printer
INC CX
PRN1: PUSH CX
MOV CL,DH
CALL ATTR
CALL PRNT
INC CL
MOV DH,CL
POP CX
LOOP PRN1
END1: MOV DX,CURPOS ;reset cursor and
MOV AH,2 ;return
INT 10H
MOV BYTE PTR ES:[0000H],00H
POPF
POP DS
POP CX
POP BX
POP AX
POP DX
IRET
END10: CALL ATTR
JMP END1
ATTR: PUSH CX ;get current
MOV DH,CL ;attributes and
XOR DL,DL ;reverse them
MOV CX,80
ATR1: PUSH CX
MOV AH,2
INT 10H
MOV AH,8
INT 10H
XOR AH,7FH
MOV BL,AH
MOV AH,9
MOV CX,1
INT 10H
INC DL
POP CX
LOOP ATR1
POP CX
RET
PRNT: PUSH CX ;printer output
MOV DH,CL ;routine
XOR DL,DL
MOV CX,80
PTR1: PUSH CX
MOV AH,2
INT 10H
MOV AH,8
INT 10H
PUSH DX
XOR DX,DX
XOR AH,AH
INT 17H
POP DX
INC DL
POP CX
LOOP PTR1
PUSH DX
XOR DX,DX
MOV AX,000DH
INT 17H
XOR DX,DX
MOV AX,000AH
INT 17H
POP DX
POP CX
RET
INIT: MOV AX,3505H ;setup TSR
INT 21H
MOV IRUPT,BX ;replace old
MOV IRPT1,ES ;vector with new
MOV DX,OFFSET MAIN ;one
MOV AX,2505H
INT 21H
MOV DX,OFFSET INIT
INT 27H
CSEG ENDS
END START
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/