CLDby (Login T3sl4)
CLear Direction flag: makes string operations go up. MOVSW, for instance, is equivalent to:
where 'reg' is a temporary register- in reality, probably a bus latch, not a real addressable register.
It does this in one (repeatable) operation, without changing any flags (although when repeated, the REP prefix changes flags on decrementing CX).
AFAIK, QBasic always leaves the direction flag cleared, so clearing it is superfluous. Still good practice though. Apparently QB should also have flags saved (hence the PUSHF and POPF), too, although I've never seen a problem with that, either. Maybe it's a problem if you leave DF set.