anonymous
2010-01-23 09:27:42 UTC
Here is the code that I wrote in C++:
#include
#include
using namespace std;
int random(int max)
{
int seed = timeGetTime();
return (seed % max);
}
int main()
{
cout << random(4);
return 0;
}
Now, I am having trouble implementing modulus in mASM
To my understanding, the following function should be the following in assembly:
.DATA?
seed DWORD ?
.CODE
start:
call timeGetTime
mov seed, eax
;to my understanding i have to call the MOD function. However, the following does not work:
MOD seed, 4
end start
So my question is, how can I preform the modulus operator in mASM so that I can generate a random number?