home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PASTUT34
/
PRINTER.TXT
< prev
next >
Wrap
Text File
|
1993-01-23
|
2KB
|
67 lines
OUTPUT TO PRINTERS.
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Printers may be connected to the parallel printer connector (Centronics,
25-way D-type), if they use the standard parallel interface. Alternatively,
if they use the standard serial interface, they may be connected to the
serial interface connector (RS232 25-way D-type), which also serves as a
communications link.
The port connections for any computer can be determined by using the DOS
command DEVICE, which returns a screen message similar to the one below:
╔════════════════════════════════════════════════╗
║ Amstrad PC2086 Device Assignments (1.0) ║
║ Copyright (C) Amstrad plc 1988 ║
╚════════════════════════════════════════════════╝
SERIAL/PARALLEL PORTS
COM1: 03F8 (Internal)
COM2: Not Assigned
LPT1: 0378 (Internal)
LPT2: Not Assigned
LPT3: Not Assigned
VIDEO
Display Adapter ............. Internal PVGA (Colour-80)
Current Video Mode .......... 03h
Multi-Frequency Mode ........ Disabled
Auto Mono/Colour switching .. Enabled
Display Option Switch 3 ..... Off
Display Option Switch 4 ..... Off
DISK DRIVES AND ADAPTERS
Drive A type is 720K Bytes, 3.5 inch, With Changeline
Drive B type is 720K Bytes, 3.5 inch, With Changeline
Maths Co-processor (NDP) Not Fitted
Hard Disk drive C: 768 tracks, 3 heads, 27 sectors/track (31Mb)
---------------------------------------------------------------
The serial ports are usually called COM1 and COM2, whilst the parallel
printer ports are referred to as LPT1, LPT2 and LPT3. The addresses of
these ports are also given, so that data can be sent to the port instead
of memory.
The note COMPORT.TXT describes Direct Memory and Port Access and
Communication and further information can be found in the IBM PC Technical
Reference Manual.
Turbo Pascal and DOS describe the display, the keyboard and printers as
Devices. Pages 134-6 of the Programmer's Guide discuss Devices. A unit,
called PRINTER, is available in Turbo Pascal, and a text-file variable Lst
is declared, which enables output to be sent to the printer. A simple
example program is:
Program testPtr;
Uses Printer;
Begin
Writeln(Lst,'Text to printer on parallel port');
End.
PRINTER.TXT
16.11.91