Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cvl.UUCP Path: utzoo!linus!decvax!ucbvax!ucbcad!tektronix!hplabs!hao!seismo!rlgvax!cvl!jcw From: jcw@cvl.UUCP Newsgroups: net.micro.pc Subject: Changing default printer Message-ID: <1103@cvl.UUCP> Date: Sun, 24-Jun-84 18:33:44 EDT Article-I.D.: cvl.1103 Posted: Sun Jun 24 18:33:44 1984 Date-Received: Wed, 27-Jun-84 03:34:09 EDT Organization: U. of Md. Computer Vision Lab Lines: 52 Here is an assembly language routine for changing the standard printer device, i.e. the printer written to through using system call 5. I wrote it for use with the old version of Computer Innovations' C compiler, which only supports one printer device, "prn:", which normally sends to "lpt1:". The asm function below can change this to any other device, even a file, by saying something like "newprn("lpt3:")". I also have a modified routine, newaux, by just changing the output mode from 1 to 2 and the device handle from 4 to 3. Note that this routine was written for CI-C86 calling conventions. ; ; Newprn: change standard printer device, by jay@rochester ; ; newprn(devname) ; char *devname; ; code segment byte public assume cs:code public newprn newprn: push bp mov bp,sp push dx mov dx,4[bp] mov al,1 ; printer is only for output mov ah,3dh int 21h ; open named device push cx push bx push ax mov bx,ax mov cx,4 ; handle of standard printer mov ah,46h int 21h ; force a dup of that handle on stdprn mov ah,3eh int 21h ; close first device handle pop ax pop bx pop cx pop dx pop bp ret code ends end ---------- Jay Weber ..!seismo!rlgvax!cvl!jcw ..!seismo!rochester!jay jay@rochester.arpa