DOCERR: Run-Time Routines Assume Direction Flag Is Clear in CLast reviewed: September 30, 1997Article ID: Q50712 |
The information in this article applies to:
SUMMARYThe C run-time routines assume that the direction flag is cleared. If you are using other functions with the C run-time functions, you must ensure that the other functions leave the direction flag alone or restore it to its original condition. Expecting the direction flag to be clear upon entry makes the run-time code faster and more efficient.
MORE INFORMATIONThe direction flag is a CPU flag specific to Intel 80x86 processors. It applies to all assembly instructions that use the REP (repeat) prefix, such as MOVS, MOVSD, MOVSW, etc. Addresses provided to applicable instructions are increased if the direction flag is cleared. The CRT function, such as the string manipulation and buffer manipulation routines, expect the direction flag to be clear. This is usually the case and is documented in the "Microsoft Macro Assembler Programmer's Guide," for versions 5.0 and 5.1, as follows:
Under DOS, the direction flag will normally be cleared if your program has not changed it. Keywords : CRTIss Version : MS-DOS: 5.1, 6.0, 6.00a, 6.00ax, 7.0; WINDOWS: 1.0, 1.5; WINDOWS NT: 1.0, 2.0, 2.1, 4.0, 5.0 Platform : MS-DOS NT WINDOWS Issue type : kbdocerr |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |