当前位置:网站首页>Assemble relevant knowledge points of flag bit (connected)

Assemble relevant knowledge points of flag bit (connected)

2022-06-25 13:09:00 wangzhiyuyeshou

2022-6-21

	neg eax
	sbb eax,eax
① neg: Complement command . Specific operation :neg eax==>eax=0-eax, namely 0 Subtract the operands .

neg eax influence CF、SF、PF、AF、ZF

When eax=0,eax=0x0000 0000. here PF=1,ZF=1,CF=0,AF=0

When eax>0,eax=-eax,CF,PF,AF,SF All become 1.

When eax<0,eax=-eax,CF=AF=1.

② sbb: subtraction with carry . Specific operation :sbb eax,eax==>eax=eax-eax-CF.

So ultimately this code depends on CF What is the position 0, still 1, if CF==1, be eax=0xFFFFFFFF, if CF=0, be eax=0x0

③ summary

The above two lines of code verify eax Is it 0, if eax by 0, be eax The final result is 0; if eax Not for 0, be eax The final result is -1

原网站

版权声明
本文为[wangzhiyuyeshou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251221428957.html