Assembly language -- how to test for even number???!!?

lovin life

New member
I have to write an assembly program for the following problem:

P = sum of even numbers from 1 to Q.

P = 0;
Q = 30; // also test on Q = 19
for (D2 = 1; D2 ≤ Q; D2++)
if (D2 is even) P = P + D2;

My question is how do you test D2 for an even number (using assembly language)?
 
Back
Top