Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.10 $; site techsup Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!inuxc!pur-ee!uiucdcs!convex!techsup!mikey From: mikey@techsup Newsgroups: net.micro.trs-80 Subject: DTR on MS-DOS Message-ID: <-1677886@techsup> Date: Wed, 27-Nov-85 10:47:00 EST Article-I.D.: techsup.-1677886 Posted: Wed Nov 27 10:47:00 1985 Date-Received: Sat, 30-Nov-85 06:46:14 EST Lines: 87 Nf-ID: #N:techsup:-1677886:000:3485 Nf-From: techsup!mikey Nov 27 09:47:00 1985 There is a feature of MSDOS that may cause you some problems with older autoanswer modems. Since there is no control in the DOS for DTR, CTS, and the OUT lines on the 8250, and since DTR is necessary for most modems to work, the DOS defaults to DTR asserted on booting. This lets dumb terminal packages from BASIC or routing to the AUX port to function with minimal problems. However, if you have an older non-intellegent modem with autoanswer attached to the machine, it may try to answer your phone at inconvenient times. This is because a lot of the older modems use DTR as an enable for operations and if it is asserted it assumes that it should answer the phone. I wrote the following program to fix the problem. It can be entered with DEBUG very easily. On each execution it will toggle the DTR, so the same program can be used to turn DTR on as well as off. I tried to write it as a tutorial so a 'non-programmer' could enter it without any problems. The first step is to enter DEBUG by typing: DEBUG You will then enter the following code. Do not type the comments after the ';' character, they are there to tell you what the program is doing. Do not type the numbers in the first column, they are there to double check your work. Type only the second column, starting with 'mov' and end each line with a (an key). Begin by typing: a This puts DEBUG into the assemble mode, starting with address 100. Now enter the following program. The at the end will get you out of the assemble mode. |<----Type this---->| 0100 MOV DX,03FC ; The address of control register 0103 IN AL,DX ; Get old DTR, CTS, OUTs, and LOOP 0104 MOV AH,01 ; Mask DTR bit 0106 XOR AL,AH ; Toggle the DTR 0108 OUT DX,AL ; Write to control 0109 MOV AH,4C ; Return to MsDOS 010B INT 21 010D Now it must be written to disk. I chose to name the program 'DTR.COM', so type the following line to name it: n dtr.com This tells debug what name to use to write it to disk. The next step is to tell DEBUG how big the program is. Since the program is 0Dh bytes long, type: r cx d We just told debug the size of the program. Now write to disk with: w DEBUG will respond with writing 000D bytes so just hit 'q' to quit back to dos. If your modem has indicator lights, type: DTR And you should see the DTR light go on and off each time you run the the program. DTR can be put in the autoexec.bat files for booting up without the modem autoanswering. If you want to do the same thing for the secondary RS-232 card, just substitute 2fc for the address in the first line (in place of the 3fc). This problem showed up when I lent my old Datacom 1200bps modem to my brother for use on his 1000 until he got his regular modem back from RV. I'm assumimg this is a generic MSDOS problem. Finally, if you use this on an AT machine, you will have to add the line: jmp $+2 just before the out instruction and adjust the number of bytes you write out. The 80286 is too fast for the 8250 but you can make it work by flushing the prefetch que right before the out instruction. mikey at bbimg