; by 罗云彬, http://asm.yeah.net
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; FindFile.asm
; 全盘文件搜索程序 —— 指定一个起始目录,查找所有文件(包括子目录下
; 的文件).data?
dwOption db ?
F_SEARCHING equ 0001h 
F_STOP equ 0002h 
;我知道下面两句的意思是设置事件标志位,\
;可不明白他是怎么设置的.dwOption是预留的全局变量空间,\
;F_STOP,F_SEARCHING只是数字不知道它们做 '与','或'运算有什么结果。 
and dwOption,not F_STOP 
or dwOption,F_SEARCHING
;这个也是设置标志位
and dwOption,not F_SEARCHING
mov eax,wMsg
.if eax == WM_CLOSE
.if ! (dwOption & F_SEARCHING) ;这个应该是判断标志位
invoke EndDialog,hWnd,NULL
.endif

解决方案 »

  1.   

    and dwOptions, not F_STOP: 清除F_STOP位
    or dwOptions, F_SEARCHING: 置位F_SEARCHING位
    and dwOption,not F_SEARCHING:清除F_SEARCHING位

    标志位有两位
      

  2.   

    问下,这是死定义的啊!还是有什么推理过来的啊!哪本书讲到这方面的内容了啊!这跟那Of CF的标志位有什么联系吗?
      

  3.   

    和CPU的Flag寄存器无关。dwOption表示一组标志位,每位为1表示置位,为零表示复位。二进制:
    00000000000000000000000000000011
    F_STOP equ 0002h:
    00000000000000000000000000000010
    not F_STOP:
    11111111111111111111111111111101
    and dwOptions, not F_STOP:
    and运算后保证F_STOP位为0,其他位不变。即复位F_STOP标志。