DGROUP GROUP DATA Title 'PC DOS Printer Output Module' ; Revision : Jan. 04, 1984 File : ZPRINTIO.A86 V1.0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Printer_out : Output through ROM BIOS routines (INT 17) to printer ; ; This Routine Displays an error message on the console ; ; if the char. cannot be printed. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dseg ; This port may be patched by Graphics Install Utility ; to redirect the printer port (0, 1, 2) for a traget system Extrn Print_port:word Extrn Abort_flg:byte Print_err Db 'Printer Time Out Error',0Ah, 0Dh, '$' Print_io Equ 17H ; ROM BIOS entry point, Software Interrupt 17h BDOS Equ 224 ; BDOS Function Call Cseg PUBLIC Printer_out, Pout ;----------------------------------------------------------------------------+ ; Printer_out + ; Output to Printer, Cx points to the No. of bytes to output + ; Followed by the data string + ; + ; Input + ; = Address of the Count and the Data String to output + ; Registers Cx is modified + ; All others unchanged + ; + ;----------------------------------------------------------------------------+ Printer_Out: ; Save Registers Push Ax Push Bx Push Dx Push Es Mov Bx, Cx Mov Cl, Byte Ptr [BX] ; No. of Byte to Output Out: Push Cx Inc Bx Push Bx Mov Al, Byte Ptr [Bx] Mov Ah, 0 ; Print the Char. in Mov Dx, Print_Port ; Output Printer Port Int Print_io And Ah, 00101001B ; If the Char. can not be printed, Jz Pj1 ; = xxxxxxx1 (Time Out). ; = xx1xxxxx (Out of Paper). ; = xxxx1xxx (I/O Error). ;;;;; Mov Byte Ptr Abort_flg, 0ffH ; Set Abort Flag ; Output Printer Time Out Message Mov Dx, (Offset Print_err) Mov Cl, 09 ; Output error message to Console Int BDOS Pj1: Pop Bx Pop Cx Dec Cl Jnz Out ; Restore Registers Pop Es Pop Dx Pop Bx Pop Ax RET ;----------------------------------------------------------------------------+ ; + ; POUT: Output a byte in
Through Rom Bios Printer Io Function + ; + ; Input :
= Data byte + ; Output: Printer Port + ; Registers All Changed, Caller must save it's own registers + ; + ;----------------------------------------------------------------------------+ POUT: Mov Al, Dl Mov Ah, 0 Mov Dx, Print_Port ; Output Printer Port Int Print_io ; Output Byte to Printer ; Through Rom BIOS function Ret End