论文部分内容阅读
IBM PC及各种兼容计算机一般均有1~2个并行口,可用来连接打印机。对于普通使用者来说,借助于DOS所提供的打印控制方法(如拷屏、联机打印等)或利用高级语言所提供的打印命令,可以实现源程序打印、数据输出等操作。但在许多实际应用系统,尤其是在一些监控系统中,要想根据工作需要,灵活方便地完成各种打印输出任务,则需要自己编制打印驱动程序,以实现对打印机的控制。本文根据作者在实际工作中的摸索,集中而又比较全面地说明了这方面的有关问题。一、打印机适配器及其寄存器结构为了与打印机联接,对每一个并行接口,PC内部相应地设有一个打印机适配器,对打印机的所有控制操作,都可通过对该适配器3个寄存器的读写来实现。在PC内部,每个并行口占有3个连续的口地址,其基地址
IBM PC and various compatible computers generally have 1 ~ 2 parallel port, can be used to connect the printer. For ordinary users, with the DOS provided by the print control methods (such as copying, online printing, etc.) or the use of high-level language provided by the print command, you can achieve the source print, data output and other operations. However, in many practical application systems, especially in some monitoring systems, in order to flexibly and conveniently perform various printout tasks according to work requirements, it is necessary to prepare a print driver program for printer control. Based on the author’s exploration in the practical work, this article focuses on the relevant issues in this area in a more comprehensive manner. First, the printer adapter and its register structure In order to connect with the printer, for each parallel interface, the PC has a corresponding printer adapter, all of the printer’s control operations can be achieved by reading and writing the adapter 3 registers . Inside the PC, each parallel port occupies three consecutive port addresses, its base address