方向标志Direction Flag

方向标志是特定于 Intel 80x86 处理器的 CPU 标识。The direction flag is a CPU flag specific to Intel 80x86 processors. 它适用于所有使用 REP(重复)前缀的程序集指令,如 MOVS、MOVSD、MOVSW 等。It applies to all assembly instructions that use the REP (repeat) prefix, such as MOVS, MOVSD, MOVSW, and others. 如果清除了方向标志,为适用的指令提供的地址将会增加。Addresses provided to applicable instructions are increased if the direction flag is cleared.

C 运行期例程假定方向标志已清除。The C run-time routines assume that the direction flag is cleared. 如果要将其他函数与 C 运行时函数一起使用,您必须确保其他函数让方向标志保持不变或将其还原为原始状态。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.

C 运行库函数(如字符串操作和缓冲区操作例程)期望方向标志保持清晰。The C Run-Time library functions, such as the string-manipulation and buffer-manipulation routines, expect the direction flag to be clear.

另请参阅See Also

CRT 库功能CRT Library Features