Aug 22, 2013 at 3:35pm UTC
I have problems when implementing the IDIV Instruction in gcc assembler, the program has compiled ok, but when executing function that imparts the asm codes which contained the IDIV instruction the error box immediately appeared announcing that it should terminates the program quickly.
The following is the complete listing of the program that I just been working on it:
using namespace std;
signed long divider(signed long num, signed long divisor);
int main(int argc, char* argv)
signed long dn0,dn1,dn2;
printf("Enter any positive real number: \n");
cin >> dn1;
printf("Enter any positive divisor number: \n");
cin >> dn2;
dn0 = divider(dn1,dn2);
cout << "The Resulted Quotient Number is: " << dn0 << endl;
signed long divider(signed long num, signed long divisor)
signed long nQuotient,nRemainder;
"movl %1, %%eax;"
"movl %2, %%ebx;"
I compiled it with DevCpp 126.96.36.199, and I had tried on CodeBlocks, in CodeBlocks I made used the int64_t type but still it could not helps more..
Can anybody there please help?
Aug 25, 2013 at 2:12pm UTC
I had tried your suggestion but still not succeed,why the result printed out continues to be zero ( 0 )? what compiler did you used? thanks for your kind attention.
Aug 25, 2013 at 5:08pm UTC
Make sure num > divisor and num != 0 when calling the function.
If num < divisor or num == 0, there shall be zeros returned.
Last edited on
Aug 25, 2013 at 5:09pm UTC
Aug 29, 2013 at 3:02pm UTC
Sure i knew, but still don't works.
Aug 31, 2013 at 1:33am UTC
I wonder what kind of processor do you have?
Sep 22, 2013 at 4:03pm UTC
I had Intel Pentium 4 - 3.0Ghz, stucked on my asus mobo ( LGA Socket ). Didn't it enough to makes it ok??