STD
Usage: STD Modifies flags: DF
Sets the Direction Flag to 1 causing string instructions to auto-decrement SI and DI instead of auto-increment.
Set Flags
STC ; F9 [8086]
STD ; FD [8086]
STI ; FB [8086]
These instructions set various flags. STC sets the carry flag; STD sets the direction flag; and STI sets the interrupt flag (thus enabling interrupts).
To clear the carry, direction, or interrupt flags, use the CLC, CLD and CLI instructions. To invert the carry flag, use CMC.
Example:
std
Do
mov al bl | and al 0F | add al '0'
On al > '9', add al 7
stosb | shr ebx 4
Do_Loop
cld