***** Fix to DTR Problem ***** 
Author Message
 ***** Fix to DTR Problem *****

here is a little something i picked up. it completely fixes the QB DTR bug.
-----[clip here]---------------------------------------------------------------

January 14, 1989

Microsoft's solution to 'fixing' the DTR drop problem with QB 4.5
when closing the communications port by outputing a 3 to the
modem status register, is not a sound or reliable solution.

Many modems simply respond too quickly to the loss of DTR.

The correct solution is to of course not turn DTR off in the
first place.  However, after many years and many versions of
Quick Basic, it is apparent that Microsoft either does not listen
to its customers or they simply do not care.

Sound programming practices dictate that when you directly manipulate
a hardware port, you restore that port to the exact same conditions
it had prior to your touching it.  In the case of DTR, this means
that if DTR were ON when the QB program loaded, then DTR should
remain ON when the QB program ends.  If DTR was OFF when the program
loaded, then fine, turn it OFF when the program ends.

To the end that it is an ongoing struggle to get Microsoft to listen
to the needs of the programmer, the following patches are provided
to enable you to patch your copies of BRUN45.EXE and BCOM45.LIB.

Before beginning, make sure you have backup copies of BRUN45.EXE
and BCOM45.LIB.

BCOM45.LIB DTR Patch
--------------------

With Debug in a DOS path, type :

  debug bcom45.lib

Type :

  s cs:0 ffff b0 00 e3 01

Debug should show :

  xxxx:1529

  where xxxx can be any number depending upon where Debug loaded the
  program into memory.  In any case, the number is not important.

Type :

  u 1529

Debug should show :

  MOV   AL,00
  JCXZ  152E
  INC   AX
  ADD   DX,+04
  OUT   DX,AL

This is where QB graciously resets the comm port to parameters it thinks
the comm port should have.

To fix the problem, Type :

  a 1529

  mov   al,01
  [Enter]

  a 152d

  nop
  [Enter]

  where [Enter] is the Enter key (do not type the characters)!

To verify that you typed everything correctly, Type

  u 1529

Debug should show :

  MOV   AL,01
  JCXZ  152E
  NOP
  ADD   DX,+04
  OUT   DX,AL

To save the corrections Type :

  w

Debug should show :

  Writing 35EF7 bytes

Now type Q and you are finished patching BCOM45.LIB

BRUN45.EXE DTR Patch
--------------------

First, rename BRUN45.EXE to BRUN45.X

With Debug in a DOS path, type :

  debug BRUN45.X

Type :

  s cs:0 ffff b0 00 e3 01

Debug should show :

  xxxx:9E78

  where xxxx can be any number depending upon where Debug loaded the
  program into memory.  In any case, the number is not important.

Type :

  u 9e78

Debug should show :

  MOV   AL,00
  JCXZ  9E7D
  INC   AX
  ADD   DX,+04
  OUT   DX,AL

This is where QB graciously resets the comm port to parameters it thinks
the comm port should have.

To fix the problem, Type :

  a 9e78

  mov   al,01
  [Enter]

  a 9e7c

  nop
  [Enter]

  where [Enter] is the Enter key (do not type the characters)!

To verify that you typed everything correctly, Type

  u 9e78

Debug should show :

  MOV   AL,01
  JCXZ  9E7D
  NOP
  ADD   DX,+04
  OUT   DX,AL

To save the corrections Type :

  w

Debug should show :

  Writing 12E80 bytes

Now type Q and you are finished patching BRUN45.X

Rename BRUN45.X back to BRUN45.EXE

The ever powerful Code View de{*filter*} was used to to find these
addresses by tracing a QB program which had but two statments :

  OPEN com port
  CLOSE com port

Any questions may be addressed to :

   Kenny Gardner
   The Crow's Nest BBS
   (714)493-3819

     CIS : 76054,210
   Genie : K.L.Gardner

-----[clip here]---------------------------------------------------------------
your welcome...

-matt



Tue, 02 Dec 1997 03:00:00 GMT  
 ***** Fix to DTR Problem *****

Quote:

> here is a little something i picked up. it completely fixes the QB DTR bug.
> your welcome...

Now all you need to do is post a patch for the Mac version...

        +---- Minnetonka, MN -----------------------------+
        |                                                 |
        |         / / /         = Bill A. Oyler =         |
        |        / / /                                    |
        |  \ \ \/ / /       People usually get what's     |
        |   \ \/ / /        coming to them ... unless     |
        |    \/ / /             it's been mailed.         |
        |                                                 |



Wed, 03 Dec 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. OK -- fixed the big problem -- how to fix little one

2. problem with VB MSComm and the DTR-line

3. Problem with VB MSComm and the DTR-line

4. problem with VB MSComm and the DTR-line

5. The 3048-Problem - Please, MS FIX THIS PROBLEM!!!

6. Fixed String and Fixed Array

7. *** FIX *** Cannot find KeycodeV2.dll, or invalid *** FIX ***

8. detect DTR ?

9. DTR and RTS control in QBASIC

10. DTR, RTS in QB 4.5

11. Controlling RTS and DTR from basic (com port)

12. DTR high after COM disconnect

 

 
Powered by phpBB® Forum Software