home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / turbofix.arc / TURBOFIX.DOC
Text File  |  1987-06-23  |  16KB  |  408 lines

  1. The following material consists of three patches for Borland's Turbo C
  2. version 1.0.  It was taken from the notes newsgroup comp.sys.ibm.pc and
  3. was originally posted as a reply to a message reporting a bug in the
  4. handling of floating division of two constants.  Part of the original
  5. message is preserved below (the lines prefixed with >).
  6.  
  7. The bug is reported to have been only in the earliest copies of Turbo
  8. C shipped.  It is easy enough to see if your copy has it, just do the
  9. test outlined below.  If you get 0.8 as the answer, your copy has the
  10. bug.
  11.  
  12. The other two patches claim to fix other problems.  These are outlined
  13. below.
  14.  
  15. Though I do not know the original source of the patches, I believe them
  16. to be authoritative.
  17.  
  18.                                    -------- Paul J. Gans
  19.  
  20.  
  21. ========================================================================
  22.  
  23. Date: 22 Jun 87 22:29:10 GMT
  24. From: cmcl2!yale!husc6!panda!teddy!jpn (John P. Nelson)
  25. Newsgroups: comp.sys.ibm.pc
  26. Subject: Re: Turbo C division bug
  27.  
  28. >It [Turbo C] does, however, seem to have a serious bug with the floating
  29. >point division routines. If your program does division on two constants:
  30. >
  31. >float x;
  32. >
  33. >x = 5.0/4.0;
  34. >
  35. >The result will be as if the division was inverted (i.e x = 4.0/5.0)
  36.  
  37. And here is the patch.  Apparently only the earliest copies are afflicted
  38. with the bug.  Enjoy.
  39.  
  40. PRODUCT : TURBO C
  41. VERSION : 1.0
  42.      OS : PC-DOS
  43.    DATE : MAY 20, 1987                                       PAGE : 1/2
  44.  
  45.   TITLE : FLOATING POINT EVALUATION - PATCH
  46.  
  47.  
  48.  
  49.  
  50.      The following patch solves a problem with dividing floating point
  51.      evaluation.
  52.  
  53.      To apply this patch, you will need to use the DOS utility DEBUG.COM.
  54.      You may obtain a copy of DEBUG.COM from one of your original PC-DOS
  55.      or  MS-DOS diskettes.
  56.  
  57.      NOTE:   1. Do not patch your original Turbo C disk, use a working or
  58.                 backup copy of TCC.EXE and TC.EXE for this patch.
  59.  
  60.              2. DEBUG is not sensitive to upper and lower case.  All ad-
  61.                 dresses are listed in upper case for ease of readibility.
  62.  
  63.              3. XXXX,YYYY,ZZZZ are hexidecimal digits returned by DEBUG.
  64.                 You must  replace these  digits accordingly when  typing
  65.                 in your commands.
  66.  
  67.              4. While in DEBUG, the prompt will appear as a dash (-).
  68.  
  69.              5. If you do not receive the appropriate response,press "q"
  70.                 followed by  <Enter>,  to exit  from DEBUG.   Check your
  71.                 version number and, if correct, try again.
  72.  
  73.              6. TCC.EXE and TC.EXE will not fit together onto a 360K disk.
  74.                 To patch both  programs on a floppy disk,  you may need to
  75.                 copy  TCC.EXE and DEBUG.COM  onto one disk and perform the
  76.                 patch.  Save the patched version of TCC.EXE to another
  77.                 disk.  Repeat the same steps using TC.EXE.
  78.  
  79.      At the  DOS prompt,  type the  following  information exactly as it
  80.      appears (Conclude each line by pressing <Enter>).
  81.  
  82. PRODUCT : TURBO C
  83. VERSION : 1.0
  84.      OS : PC-DOS
  85.    DATE : MAY 20, 1987                                       PAGE : 2/2
  86.   TITLE : DIVISION OF CONSTANTS - PATCH
  87.  
  88.                          Patch for TCC.EXE
  89.  
  90.      Type the following:                      You will see:
  91.  
  92.      ren tcc.exe tcc.xex<Enter>               A>
  93.  
  94.      debug tcc.xex<Enter>                     -
  95.  
  96.      r<Enter>                                 ... CS=XXXX ...
  97.                                               -
  98.  
  99.      h XXXX 2420<Enter>                       YYYY  ZZZZ
  100.                                               -
  101.  
  102.      e YYYY:369<Enter>                        YYYY:0369   0A.
  103.  
  104.      6<Enter>                                 -
  105.  
  106.      e YYYY:36F<Enter>                        YYYY:036F   06.
  107.  
  108.      A<Enter>                                 -
  109.  
  110.      w<Enter>                                 Writing 2948A bytes
  111.  
  112.      q<Enter>                                 A>
  113.  
  114.      ren tcc.xex tcc.exe<Enter>
  115.  
  116.                              Patch for TC.EXE
  117.  
  118.      Type the following:                      You will see:
  119.  
  120.      ren tc.exe tc.xex<Enter>                 A>
  121.  
  122.      debug tc.xex<Enter>                      -
  123.  
  124.      r<Enter>                                 ... CS=XXXX ...
  125.                                               -
  126.  
  127.      h XXXX 2D01<Enter>                       YYYY  ZZZZ
  128.                                               -
  129.  
  130.      e YYYY:35E<Enter>                        YYYY:035E   0A.
  131.  
  132.      6<Enter>                                 -
  133.  
  134.      e YYYY:364<Enter>                        YYYY:0364   06.
  135.  
  136.      A<Enter>                                 -
  137.  
  138.      w<Enter>                                 Writing 38759 bytes
  139.  
  140.      q<Enter>                                 A>
  141.  
  142.      ren tc.xex tc.exe<Enter>
  143.  
  144. =============================================================================
  145.  
  146. Date: 22-Jun-87 18:54 EDT
  147. From: acf4!cmcl2!yale!husc6!panda!teddy!jpn (John P. Nelson)
  148. Newsgroups: comp.sys.ibm.pc
  149. Subject: Turbo C structure bug (+Fix)
  150.  
  151. PRODUCT : TURBO C                                               NUMBER : 355
  152. VERSION : 1.0                                           
  153.      OS : PC-DOS
  154.    DATE : May 28, 1987                                          PAGE : 1/1
  155.  
  156.  TITLE  : STRUCTURE PUSH FLOATING POINT PATCH
  157.  
  158. ______________________________________________________________________________
  159.  
  160.  
  161.      The following patch solves a problem with pushing structures
  162.      with floating point elements onto the stack in Turbo C.
  163.  
  164.      To apply this patch, you will need to use the DOS utility DEBUG.COM.
  165.      You may obtain a copy of DEBUG.COM from one of your original PC-DOS
  166.      or  MS-DOS diskettes.
  167.  
  168.      NOTE:   1. Do not patch your original Turbo C disk, use a working or
  169.                 backup copy of TCC.EXE and TC.EXE for this patch.
  170.  
  171.              2. DEBUG is not sensitive to upper and lower case.  All ad-
  172.                 dresses are listed in upper case for ease of readibility.
  173.  
  174.              3. XXXX,YYYY,ZZZZ are hexidecimal digits returned by DEBUG.
  175.                 You must  replace these  digits accordingly when  typing
  176.                 in your commands.
  177.  
  178.              4. While in DEBUG, the prompt will appear as a dash (-).
  179.  
  180.              5. If you do not receive the appropriate response,press "q"
  181.                 followed by  <Enter>,  to exit  from DEBUG.   Check your
  182.                 version number and, if correct, try again.
  183.  
  184.              6. TCC.EXE and TC.EXE will not fit together onto a 360K disk.
  185.                 To patch both  programs on a floppy disk,  you may need to
  186.                 copy  TCC.EXE and DEBUG.COM  onto one disk and perform the
  187.                 patch.  Save the patched version of TCC.EXE to another
  188.                 disk.  Repeat the same steps using TC.EXE.
  189.  
  190.      At the  DOS prompt,  type the  following  information exactly as it
  191.      appears (Conclude each line by pressing <Enter>).
  192.  
  193.  
  194.                              Patch for TCC.EXE
  195.  
  196.      Type the following:          You will see:
  197.  
  198.      ren tcc.exe tcc.xex<Enter>   A>
  199.  
  200.      debug tcc.xex<Enter>         -
  201.  
  202.      r<Enter>                     ... CS=XXXX ...
  203.                                   -
  204.  
  205.      h XXXX 1C0C<Enter>           YYYY  ZZZZ
  206.                                   -
  207.  
  208.      e YYYY:2FAD<Enter>           YYYY:2FAD   25.
  209.  
  210.      A9<Space>                    YYYY:2FAD   25.A9   01.
  211.      <Space>                      YYYY:2FAD   25.A9   01.     00.
  212.      <Space>                      YYYY:2FB0   81.
  213.      74<Space>                    YYYY:2FB0   81.74   E2.
  214.      0B<Space>                    YYYY:2FB0   81.74   E2.0B   00.
  215.      40<Space>                    YYYY:2FB0   81.74   E2.0B   00.40   00.
  216.      26<Space>                    YYYY:2FB0   81.74   E2.0B   00.40   00.26
  217.                                               0B.
  218.      83<Space>                    YYYY:2FB0   81.74   E2.0B   00.40   00.26
  219.                                               0B.83   D0.
  220.      47<Space>                    YYYY:2FB0   81.74   E2.0B   00.40   00.26
  221.                                               0B.83   D0.47   74.
  222.      6<Space>                     YYYY:2FB0   81.74   E2.0B   00.40   00.26
  223.                                               0B.83   D0.47   74.6    0A.
  224.      1<Space>                     YYYY:2FB8   26.
  225.      <Space>                      YYYY:2FB8   26.     83.
  226.      <Space>                      YYYY:2FB8   26.     83.     47.
  227.      57<Space>                    YYYY:2FB8   26.     83.     47.57   06.
  228.      8<Space>                     YYYY:2FB8   26.     83.     47.57   06.8
  229.                                               01.
  230.      0<Space>                     YYYY:2FB8   26.     83.     47.57   06.8
  231.                                               01.00   26.
  232.      29<Space>                    YYYY:2FB8   26.     83.     47.57   06.8
  233.                                               01.00   26.29   83.
  234.      6<Space>                     YYYY:2FB8   26.     83.     47.57   06.8
  235.                                               01.00   26.29   83.6    57.
  236.      54<Space>                    YYYY:2FC0   08.
  237.      74<Space>                    YYYY:2FC0   08.74   00.
  238.      90<Enter>                    YYYY:2FC0   08.74   00.90
  239.                                   -
  240.  
  241.      w<Enter>                     Writing 2948A bytes
  242.                                   -
  243.  
  244.      q<Enter>                     A>
  245.  
  246.      ren tcc.xex tcc.exe<Enter>   A>
  247.  
  248.  
  249.                              Patch for TC.EXE
  250.  
  251.      Type the following:          You will see:
  252.  
  253.      ren tc.exe tc.xex<Enter>     A>
  254.  
  255.      debug tc.xex<Enter>          -
  256.  
  257.      r<Enter>                     ... CS=XXXX ...
  258.                                   -
  259.  
  260.      h XXXX 2557<Enter>           YYYY  ZZZZ
  261.                                   -
  262.  
  263.      e YYYY:2FA4<Enter>           YYYY:2FA4   25.
  264.  
  265.      A9<Space>                    YYYY:2FA4   25.A9   01.
  266.      <Space>                      YYYY:2FA4   25.A9   01.     00.
  267.      <Space>                      YYYY:2FA4   25.A9   01.     00.     81.
  268.      74<Space>                    YYYY:2FA8   E2.
  269.      0B<Space>                    YYYY:2FA8   E2.0B   00.
  270.      40<Space>                    YYYY:2FA8   E2.0B   00.40   00.
  271.      26<Space>                    YYYY:2FA8   E2.0B   00.40   00.26   0B.
  272.      83<Space>                    YYYY:2FA8   E2.0B   00.40   00.26   0B.83
  273.                                               D0.
  274.      47<Space>                    YYYY:2FA8   E2.0B   00.40   00.26   0B.83
  275.                                               D0.47   74.
  276.      6<Space>                     YYYY:2FA8   E2.0B   00.40   00.26   0B.83
  277.                                               D0.47   74.6    0A.
  278.      1<Space>                     YYYY:2FA8   E2.0B   00.40   00.26   0B.83
  279.                                               D0.47   74.6    0A.1    26.
  280.      <Space>                      YYYY:2FB0   83.
  281.      <Space>                      YYYY:2FB0   83.     47.
  282.      57<Space>                    YYYY:2FB0   83.     47.57   06.8    26.
  283.      8<Space>                     YYYY:2FB0   83.     47.57   06.8    01.
  284.      0<Space>                     YYYY:2FB0   83.     47.57   06.8    01.00
  285.                                               26.
  286.      29<Space>                    YYYY:2FB0   83.     47.57   06.8    01.00
  287.                                               26.29   83.
  288.      6<Space>                     YYYY:2FB0   83.     47.57   06.8    01.00
  289.                                               26.29   83.6    57.6    08.
  290.      C<Space>                     YYYY:2FB0   83.     47.57   06.8    01.00
  291.                                               26.29   83.6    57.C    08.
  292.      A3<Space>                    YYYY:2FB8   00.
  293.      90<Enter>                    YYYY:2FB8   00.90
  294.                                   -
  295.  
  296.      w<Enter>                     Writing 38759 bytes
  297.                                   -
  298.  
  299.      q<Enter>                     A>
  300.  
  301.      ren tc.xex tc.exe<Enter>     A>
  302.  
  303.  
  304. ===========================================================================
  305.  
  306. Date: 22-Jun-87 18:52 EDT
  307. From: acf4!cmcl2!yale!husc6!panda!teddy!jpn (John P. Nelson)
  308. Newsgroups: comp.sys.ibm.pc
  309. Subject: Turbo C -G bug (FIX!)
  310.  
  311. PRODUCT : TURBO C                                               NUMBER : 356
  312. VERSION : 1.0                                           
  313.      OS : PC-DOS
  314.    DATE : May 28, 1987                                          PAGE : 1/1
  315.  
  316.  TITLE  : -G PATCH
  317.  
  318. ______________________________________________________________________________
  319.  
  320.  
  321.      The following patch solves a problem in Turbo C where the
  322.      compiler can run out of memory compiling a large switch
  323.      statement if the -G option is used.
  324.  
  325.      To apply this patch, you will need to use the DOS utility DEBUG.COM.
  326.      You may obtain a copy of DEBUG.COM from one of your original PC-DOS
  327.      or  MS-DOS diskettes.
  328.  
  329.      NOTE:   1. Do not patch your original Turbo C disk, use a working or
  330.                 backup copy of TCC.EXE and TC.EXE for this patch.
  331.  
  332.              2. DEBUG is not sensitive to upper and lower case.  All ad-
  333.                 dresses are listed in upper case for ease of readibility.
  334.  
  335.              3. XXXX,YYYY,ZZZZ are hexidecimal digits returned by DEBUG.
  336.                 You must  replace these  digits accordingly when  typing
  337.                 in your commands.
  338.  
  339.              4. While in DEBUG, the prompt will appear as a dash (-).
  340.  
  341.              5. If you do not receive the appropriate response,press "q"
  342.                 followed by  <Enter>,  to exit  from DEBUG.   Check your
  343.                 version number and, if correct, try again.
  344.  
  345.              6. TCC.EXE and TC.EXE will not fit together onto a 360K disk.
  346.                 To patch both  programs on a floppy disk,  you may need to
  347.                 copy  TCC.EXE and DEBUG.COM  onto one disk and perform the
  348.                 patch.  Save the patched version of TCC.EXE to another
  349.                 disk.  Repeat the same steps using TC.EXE.
  350.  
  351.      At the  DOS prompt,  type the  following  information exactly as it
  352.      appears (Conclude each line by pressing <Enter>).
  353.  
  354.  
  355.                              Patch for TCC.EXE
  356.  
  357.      Type the following:          You will see:
  358.  
  359.      ren tcc.exe tcc.xex<Enter>   A>
  360.  
  361.      debug tcc.xex<Enter>         -
  362.  
  363.      r<Enter>                     ... CS=XXXX ...
  364.                                   -
  365.  
  366.      h XXXX 1635<Enter>           YYYY  ZZZZ
  367.                                   -
  368.  
  369.      e YYYY:7E0<Enter>            YYYY:07E0   7C.
  370.  
  371.      72<Enter>                    YYYY:07E0   7C.72
  372.                                   -
  373.  
  374.      w<Enter>                     Writing 2948A bytes
  375.                                   -
  376.  
  377.      q<Enter>                     A>
  378.  
  379.      ren tcc.xex tcc.exe<Enter>   A>
  380.  
  381.  
  382.                              Patch for TC.EXE
  383.  
  384.      Type the following:          You will see:
  385.  
  386.      ren tc.exe tc.xex<Enter>     A>
  387.  
  388.      debug tc.xex<Enter>          -
  389.  
  390.      r<Enter>                     ... CS=XXXX ...
  391.                                   -
  392.  
  393.      h XXXX 1F84<Enter>           YYYY  ZZZZ
  394.                                   -
  395.  
  396.      e YYYY:7E1<Enter>            YYYY:07E1   7C.
  397.  
  398.      72<Enter>                    YYYY:07E1   7C.72
  399.                                   -
  400.  
  401.      w<Enter>                     Writing 38759 bytes
  402.                                   -
  403.  
  404.      q<Enter>                     A>
  405.  
  406.      ren tc.xex tc.exe<Enter>     A>
  407.  
  408.