Hello,
I've looked in a lot of places and I couldn't find much about modulo!

Like I have this for example:
Code:
int X = 0;
int Y = 1;
while(X <= 10 ){
if(X % 2 == 0)
Y = Y * X;
else
Y++;
X++;
}
cout << "Y is: "<< Y << endl;
And I'm pretty much stuck on the X % 2 == 0 part..
This is what I have so far..
Code:
ORG $1000
START: ; first instruction of program
* Put program code here
MOVE.W #0,D1 ; X-value = 0
MOVE.W #1,D2 ; Y-value = 1
WHILE CMPI.B #10,D1
BLE MOD
*----- Attempt on doing the modulus -----*
MOD CLR.L D2 ; Clear out all 32 bits of D2
MOVE.W D0,D2 ; Copy the contents of D0 into D2's last 16 bits (word length)
DIVU D1,D2 ; Divide D2 by D1... D2 should now have the remainder in the upper 16 bits? (i think)
SWAP D2 ; Swap the upper and lower words of D2... And now I can refer to D2.W as the remainder of D0 divided by D1
*----------------------------------------*
* Put variables and constants here
CR EQU $0D
LF EQU $0A
OUTPUT DC.B 'Y is: ',0
NEWLINE DC.B '',CR,LF,0
END START ; last line of source