Professional Documents
Culture Documents
Write instructions that set the Zero flag if the 32-bit value in
EAX is even, and clear the Zero flag if EAX is odd.(6.2.9.11)
test eax,1h
Solution:
mov eax,op1
mov ebx,op2
mov ecx,op3
L1: cmp eax,ebx
jge L7
inc eax
L3: cmp ebx,ecx
jne L5
mov X,2
jmp L6
L5: mov X,3
L6: jmp L1
L7: mov op1,eax