A program opens a printer by using Open File with Handle (Interrupt 21h Function 3Dh). The function takes the device name PRN and the write-only access parameter and returns a handle to the printer. The program uses this handle with Write File or Device (Interrupt 21h Function 40h) to write to the printer.
If the printer is not present or not ready to receive data, a program that writes to it may hold indefinitely. Before attempting to send data to a printer, a program should use Check Device Output Status (Interrupt 21h Function 4407h) to determine whether the printer is present and ready to receive output.