07 June 2012

cmp dan test


cmp eax,4 >> eax - 4
SF : signed flag. Tukar jadi satu jika hasil tolak eax dengan 4 bernilai negatif
ZF: zero flag. Tukar jadi satu jika hasil tolak eax dan 4 bernilai 0.

instructionZero
Flag
Sign
Flag
Overflow
Flag
|JGJEJL
mov eax, 3
cmp eax,4
010--jump
mov eax, 4
cmp eax,4
100-jump-
mov eax, 5
cmp eax,4
000jump--

test eax,4 >> bitwise 'AND' antara eax dan 4, Tukar flags SF, ZF, PF, CF, OF
instructionZero
Flag
Sign
Flag
Overflow
Flag
|JGJEJL
mov eax, 3
test eax,4
100--jump
mov eax, 4
test eax,4
000-jump-
mov eax, 5
test eax,4
000jump--



No comments:

Post a Comment

Terima kasih