BUG: Incorrect Results or Hanging with INTDOSXQQ()Last reviewed: July 12, 1995Article ID: Q76669 |
The information in this article applies to:
SYMPTOMSA 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().
CAUSEThe 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.
RESOLUTIONModify 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
STATUSMicrosoft 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 INFORMATIONThe 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |