Setting the Direction Flag with MASM

Product Version(s): 3.20
Operating System:   MS-DOS
Flags: ENDUSER |
Last Modified: 12-MAY-1988    ArticleIdent: Q10664

Question:
   Setting the direction flag with an assembly language routine may
cause the subsequent I/O operation to fail. The following source files
demonstrate the problem:

   program dftst
   x = 1.2
   write(*, 100) 100 format(' Before direction flag has been set')
   write(*,*) x
   call dirflg
   write(*, 200) 200 format(' After direction flag has been set')
   write(*,*) x
   end

data segment public 'data' data ends ; dgroup group data ; code segment 'code
   ASSUME CS:code, ds:dgroup, ss:dgroup
   public dirflg dirflg proc far
   std
   ret dirflg endp code ends
   end

Response:
   The workaround for this problem is to link with DOS2FOR.
