What are CLD and STD for in x86 assembly language? What does DF do?

后端 未结 5 1411
走了就别回头了
走了就别回头了 2021-01-30 21:55

well, I know that CLD clears direction flag and STD sets direction flag. but what\'s the point in setting and clearing direction flag?

5条回答
  •  难免孤独
    2021-01-30 22:45

    If using Windows, then as per the STDCALL calling convention -

    Under STDCALL, the direction flag is clear on entry and must be returned clear.

    So if you set DF, then before an API call you must clear it.

提交回复
热议问题