BUG: Incorrect Results or Hanging with INTDOSXQQ()

Last reviewed: July 12, 1995
Article ID: Q76669
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, version 5.1
  • Microsoft FORTRAN for OS/2, version 5.1

SYMPTOMS

A program compiled with Microsoft FORTRAN version 5.1 may generate incorrect results, hang the machine under MS-DOS, or generate a protection violation under OS/2 if the program makes a call to the MS-DOS interrupt function subroutine INTDOSXQQ().

CAUSE

The include file FLIB.FI declares the arguments to INTDOSXQQ() to be passed by value, when they should be passed by reference. This corrupts the stack causing unpredictable results.

RESOLUTION

Modify the FLIB.FI file to contain the REFERENCE attribute on the arguments to INTDOSXQQ(). The lines look like this:

      RECORD /REGS$INFO/ REGS1
      RECORD /REGS$INFO/ REGS2
      RECORD /SREGS$INFO/ SREGS
      END

and should be modified to be:

      RECORD /REGS$INFO/ REGS1 [REFERENCE]
      RECORD /REGS$INFO/ REGS2 [REFERENCE]
      RECORD /SREGS$INFO/ SREGS [REFERENCE]
      END

STATUS

Microsoft has confirmed this to be a problem in Microsoft FORTRAN version 5.1 for MS-DOS and OS/2.

This article does not apply to FORTRAN PowerStation.

MORE INFORMATION

The following code reproduces the problem:

Sample code

       include 'flib.fi'
       implicit none
       include 'flib.fd'
       character*64 string[c]
       integer address
       integer*2 addresspart(2)
       record /regs$info/ in,out
       record /sregs$info/ seg
       equivalence (address,addresspart(1))
       address=locfar(string)
       in.wregs.ax=#4700
       in.wregs.bx=#0000
       in.wregs.cx=#0000
       in.wregs.dx=#0000
       in.wregs.si=addresspart(1)
       in.wregs.di=#0000
       in.wregs.cflag=#0000
       seg.es=#0000
       seg.ds=addresspart(2)
       CALL INTDOSxQQ(IN,OUT,seg)   ! this call returns nothing
       WRITE(*,1000) STRING
       STOP
 1000 FORMAT(1x,'THE Current Directory Is: ',A)
       END


Additional reference words: 5.10
KBCategory: kbprg kbbuglist
KBSubcategory: FORTLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 12, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.