2013-11-26 26 views
0

有什麼方法可以訪問條件標誌的值,比如零標誌,並將該值移入寄存器中?事情是這樣的:在IA32中訪問條件標誌

cmpl %eax,%edx 
movl ZF, %eax 

感謝, 問候

回答

0

所以在網絡上四處衝浪之後,是可以做到幾分相似:

讓資源成爲產生的所有條件標誌的值(零標誌(ZF),進位標誌(CF),符號標誌(SF),溢出標誌(OF))的操作cmpl%eax,& edx。 (執行%edx - %eax並丟棄結果)

sete D //Sets D to ZF    -> %eax == %edx 
setne D //Sets D to ~ZF    -> %eax != %edx 
setg D //Sets D to ~(SF^OF) & ~ZF -> %edx > %eax 
setge D //Sets D to ~(SF^OF)  -> %edx >= %eax 
setl D //Sets D to SF^OF   -> %edx < %eax 
setle D //Sets D to (SF^OF) | ZF -> %edx <= %eax