home *** CD-ROM | disk | FTP | other *** search
- byte printer.to.select;
- {-----------------------------------------------------------}
- procedure select.printer:
- begin
- byte wk.byte;
- byte pointer prn.init.bp;
- external byte IOBYTE address ^h0003;
- external label entry address ^h0005;
-
- move "N" to wk.byte;
- switch on printer.to.select:
- 0 - 15,
- "0" - "9": begin
- and printer.to.select with ^h0f;
- move "Y" to wk.byte;
- end;
- endswitch;
- if wk.byte = "Y" then
- {----------------------------------------------------------
- { Locate Printer Parameters
- {----------------------------------------------------------
- mcall entry using 14,0;
- mcall entry using 32,0;
- open startup.file shared error standard;
- add 1 to printer.to.select giving startup.key;
- read startup.file error begin
- display "Internal Error: Invalid Printer Init";
- goto end;
- end;
- {----------------------------------------------------------
- { Select the indicated printer
- {----------------------------------------------------------
- if startup.prn.unit > 15 then
- move default.printer to startup.prn.unit;
- fi;
- switch on operating.system:
- os.MPM:
- mcall entry using 160,startup.prn.unit;
- else begin
- multiply startup.prn.unit by ^h40 giving wk.word;
- and IOBYTE with ^h3f;
- or IOBYTE with wk.word[byte] giving IOBYTE;
- end;
- endswitch;
- {----------------------------------------------------------
- { Initialize the Printer if needed
- {----------------------------------------------------------
- move #startup.prn.init to prn.init.bp;
- while @prn.init.bp <> ^hff do
- move @prn.init.bp to wk.byte;
- mcall entry using 5,wk.byte;
- add 1 to prn.init.bp;
- od;
- close startup.file error standard;
- mcall entry using 32,prog.user;
- subtract "A" from prog.drive giving wk.byte;
- mcall entry using 14,wk.byte;
- mcall entry using 5,^h1a; {--detach printer--}
- fi;
- end;
- {-----------------------------------------------------------