home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
info
/
dostips4.arc
/
DOSPRINT.TXT
< prev
next >
Wrap
Text File
|
1986-06-28
|
9KB
|
233 lines
Printing the PC's Extended Character Set
(PC World February 1986 The Help Screen)
GRAPHICS.COM must be run from DOS before Shift-PrtSc can print
subsequent graphics screens. This does not solve the problem of
printing graphics characters such as the double vertical line and
other similar characters from the PC's extended character set. These
characters are commonly used as borders around text. Using Shift-PrtSc
to dump a screen containing these characters to an Epson FX-80 prints
italic capital letters in place of the graphics characters.
Editor's solution: You can "teach" the PC to display the PC's
extended character set in graphics mode. If you're not inclined to
do the necessary programming yourself, you'll need a utility. Or
consider using GRAFTABL.COM, a utility included with DOS 3.0 and 3.1.
-----------------------------------------------------------------
Epson Mode Changing
(PC Magazine Vol 5 No 8 Apr 29, 1986 Power User)
Switching between draft and near-letter-quality (NLQ) modes on
the new Epson LQ-1500 printer is cumbersome. One way is to go to the
back panel and change the DIP switch settings. The print mode can be
changed through software, but even that method can be awkward.
NLQ.COM, created with DEBUG (see below), switches from draft to
NLQ mode. The program works by using Interrupt 21h, Function 5h, to
send printer control characters to the printer. Three calls to
Interrupt 21h are needed, one for each byte in the control sequence
(1Bh, 78h, and 01h) required to enable near letter quality on the
LQ-1500.
A similar command could be written for a different printer by
using different printer control codes.
A>debug
-a
xxxx:0100 MOV DL,1B
xxxx:0102 MOV AH,05
xxxx:0104 INT 21
xxxx:0106 MOV DL,78
xxxx:0108 MOV AH,05
xxxx:010A INT 21
xxxx:010C MOV DL,01
xxxx:010E MOV AH,05
xxxx:0110 INT 21
xxxx:0112 INT 20
xxxx:0114
-R CX
:14
-N NLQ.COM
-W
Writing 014 bytes
-Q
More on Mode Changes
(PC Magazine Vol 5 No 8 Apr 29, 1986 Power User)
The DOS MODE command lets you configure options for the
asynchronous communications adapter, the display, and the printer.
For example, you can use it to set a printer into condensed (132-
column) mode, but you usually have to refer to the DOS manual to be
sure you have all the MODE options entered correctly. It would also
be nice to have MODE set the printer into enhanced (darkened) mode
printing.
DARK.COM sets the printer to the "enhanced" mode of printing.
SMALL.COM sets up the printer to print in condensed mode. Both can
be created with DEBUG:
A>debug
-n dark.com
-a
xxxx:0100 MOV DL,1b
xxxx:0102 MOV AH,05
xxxx:0104 INT 21
xxxx:0106 MOV DL,45
xxxx:0108 MOV AH,05
xxxx:010A INT 21
xxxx:010C INT 20
xxxx:010E
-r cx
CX 0000
:e
-w
Writing 000E bytes
-q
A>debug
-a
xxxx:0100 MOV DL,0F
xxxx:0102 MOV AH,05
xxxx:0104 INT 21
xxxx:0106 INT 20
xxxx:0108
-r cx
CX 0000
:8
-n small.com
-w
Writing 0008 bytes
-q
Editor's Note: Many small printer-control .COM programs are useful --
for a particular situation. You must be careful in using or modifying
such programs, however. For example, in "Epson Mode Changing" above,
NLQ.COM works only with IBM- or Epson-compatible dot matrix printers.
Most other printers use a 2- or 3-byte code for condensed print, unlike
the IBM/Epson design, which uses only one.
If your printer has a lot of options (and associated control codes)
that you use less frequently, a more general program can be very useful.
Such a program would accept the printer control codes as data and send
them to the printer right from the DOS prompt. PSET.COM takes in the
decimal ASCII codes as part of the command line and sends them to your
printer. PSET is slightly more complex and somewhat larger than
single-purpose printer control programs. Its job is to scan the
command line, looking for numeric characters that represent decimal
ASCII codes. (Be careful when you use it, since it does not check
for non-numeric characters -- if you enter them, you may get strange
results on your printer.)
As PSET finds each code (separated by blanks), it converts it to
binary (internal) representation and pushes it on the stack. When the
scan is done, the codes are popped off the stack and sent to the
printer using Function 5h of DOS Interrupt 21h. A value of 1234h is
pushed onto the stack at the beginning of the program for use as an
"end-of-stack" indicator. Since PSET scans from the end of the command
line to the beginning, the control codes will be sent to the printer in
the correct order when they are popped off the stack.
100 'PSET.BAS: Program to create PSET.COM. From PC Magazine Vol 5
101 'No 8 April 29, 1986 Power User by Craig L. Stark.
110 CLS:PRINT "Checking DATA statements ..."
120 FOR B=1 TO 5
130 FOR C=1 TO 17
140 READ A$:IF C<17 THEN 160
150 Z#=Z#+VAL(A$)
160 NEXT:NEXT
170 IF Z#=8979 THEN RESTORE:GOTO 200
180 PRINT "Error: Check the last number in"
190 PRINT "each DATA statement; then redo."
200 FOR B=1 TO 5
210 FOR C=1 TO 16
220 READ A$:TTL=TTL+VAL("&H"+A$)
230 NEXT
240 READ S:IF S=TTL THEN 270
250 PRINT "DATA error in line ";B*10+330:END
270 TTL=0:NEXT:RESTORE
280 OPEN "PSET.COM" AS #1 LEN=1:FIELD #1,1 AS D$
290 FOR B=1 TO 5
300 FOR C=1 TO 16
310 READ A$:LSET D$=CHR$(VAL("&H"+A$))
320 PUT #1:NEXT:READ DUMMY$:NEXT:CLOSE
330 PRINT "PSET.COM created."
340 DATA BE,80,00,FC,AC,98,8B,C8,49,03,F1,FD,BA,34,12,E8,2291
350 DATA 2C,00,AC,3C,20,75,05,E8,24,00,E2,F6,2C,30,F6,E3,1735
360 DATA 02,D0,8A,C3,B3,0A,F6,E3,8A,D8,E2,E6,E8,0F,00,5A,2352
370 DATA 81,FA,34,12,74,06,B4,05,CD,21,EB,F3,CD,20,5B,52,1882
380 DATA 53,B3,01,33,D2,C3,00,00,00,00,00,00,00,00,00,00,719
The easiest test for PSET.COM is to have it print a few ordinary
characters (the program doesn't care that they're not control codes)
and then issue a form feed to bring in a new page of paper. Try this:
A>pset 80 67 32 77 97 103 97 122 105 110 101 13 12
Once you've got this working, you can issue any printer control codes
you want. For example, the following does the same thing as NLQ.COM:
A>pset 27 120 1
If you find that you use the same PSET command frequently, you could
put it in a .BAT and continue to use PSET.
-----------------------------------------------------------------
PrtSc Feeding
(PC Magazine Vol 5 No 10 May 27, 1986 User-to-User)
The problem with doing a series of print screens is that every
time one finishes you normally have to take the printer off-line, hit
the form-feed button, then put the printer back on-line. PRTSCRFF.COM
does that for you. Run PRTSCRFF.COM when you boot your computer, and
all subsequent Shift-PrtSc's will be followed automatically by a form
feed. PRTSCRFF simply calls the original BIOS print-screen routine
(Interrupt 05h) and follows it up by sending a form feed to the
printer. This is especially useful for the HP LaserJet printer. The
LaserJet's standard print screen is held in a buffer until you take
the printer off-line and press the form-feed button. With PRTSCRFF
the page is automatically printed and fed through the system.
Editor's Note: Since screens are 25 lines deep and printed pages
a little more than twice that, if you don't have too many to print it's
sometimes handy to run off two screens per page.
100 'PRTSCRFF.BAS
110 OPEN "PRTSCRFF.COM" AS #1 LEN=1:FIELD #1,1 AS D$
120 FOR A=1 TO 77:READ a$:LSET D$=CHR$(VAL("&H"+A$))
130 PUT #1:NEXT:CLOSE:PRINT "PRTSCRFF.COM created.":END
140 DATA EB,21,90,00,00,00,00,FB,1E,52,53,50,8C,CB,8E,DB
150 DATA 9C,2E,FF,1E,03,01,BA,00,00,B8,0C,00,CD,17,58,5B
160 DATA 5A,1F,CF,8C,CB,8E,DB,B0,05,B4,35,CD,21,2E,89,1E
170 DATA 03,01,2E,8C,06,05,01,8C,CB,8E,DB,BA,07,01,B0,05
180 DATA B4,25,CD,21,8C,CB,8E,DB,BA,23,01,CD,27
-----------------------------------------------------------------
Tackling a Switch Back
(PC World May 1986 The Help Screen)
If you have two printers and two parallel ports, SWAPLPTS.COM is
a useful program for switching back and forth between printers. It
merely swaps the port address values for LPT1 and LPT2. Running the
program once causes output to be directed to LPT2; running it a second
time causes output to be directed to LPT1.
To create SWAPLPTS.COM, place a copy of DEBUG.COM in drive B: and
a disk for saving the program in drive A:. At the A> prompt, enter:
A>B:DEBUG
-A
xxxx:0100 MOV AX,40
xxxx:0103 MOV DS,AX
xxxx:0105 MOV BX,[8]
xxxx:0109 MOV CX,[A]
xxxx:010D MOV [8],CX
xxxx:0111 MOV [A],BX
xxxx:0115 INT 20
xxxx:0117
-R CX
CX 0000
:17
-N A:SWAPLPTS.COM
-W
Writing 17 bytes
-Q