Having a slight register problem with div using inline asm under vs2010.
testScore and gradeScale are integers.
_asm
{
mov eax, testScore //student's score - let's test 36
mov ebx, 40 //max possible score of 40
xor edx,edx //prevented an integer overflow error.
div ebx //divide and multiple by 100 to get letter grade.
//SHOULD BE 36/40 = .9 but 36 is in EDX instead.
imul edx, 100 //should now be 90 in EDX, but it's at 3600.
mov gradeScale, edx //move result to gradeScale
}
36/40 should place 0 in EAX and .9 in EDX. then multiply that by 100 and store it to gradescale.
Should be simple but I'm missing something here...