
February 9th, 2003, 06:30 PM
|
 |
not a fan of fascism (n00b)
|
|
Join Date: Feb 2003
Location: ct
|
|
|
Internal Compiler Error?
i get this error: INTERNAL COMPILER ERROR at the line where i placed an arrow. never seen b4 any ideas??
PHP Code:
#include<iostream.h>
#include<iomanip.h>
template <class T>
void BinOut32(T m)
{
// outputs m binary.
char c; // tmp variable
__asm
{
mov eax, m
push ebx ; save reg so can use <--error line
push ecx
mov ch, 32 ; 32 binary digits to display
BinOut32_1:
mov CL, 1
rol eax, CL
mov BL, AL
; determine binary code for digit
and BL, 00000001b ; mask
add BL, 00110000b
BinOut32_2:
mov c, BL
push eax ; save value
push ecx ; save count
}
_putch (c);
__asm
{
pop ecx ; restore counts
pop eax ; restore value
dec ch
jnz BinOut32_1
pop ecx
pop ebx
}
return;
}
void main()
{
unsigned int num1 = 0, num2 = 0, result = 0;
signed int numA = 0, numB = 0, resultB = 0;
int operand = 0;
char answer;
cout << "(S)igned or (U)nsigned? ";
cin >> answer;
switch(answer)
{
case 's':
case 'S':
{
cout << "Operand 1 ?";
cin >> hex >> numA;
cout << "\nOperand 2 ?";
cin >> hex >> numB;
cout << "\nOperator 1)/ or 2) + :";
cin >> operand;
while((operand != 1)&&(operand != 2))
{
operand = 0;
cout << "\nIncorrect operand, reenter:";
cin >> operand;
}
switch(operand)
{
case 1:
{
result = numA/numB;
cout << "Hex result ";
cout << hex << resultB << endl;
cout << "\nBinary result ";
BinOut32(resultB);
break;
}
case 2:
{
resultB = numA + numB;
cout << "Hex result ";
cout << hex << resultB << endl;
cout << "\nBinary result ";
BinOut32(resultB);
break;
}
}
break;
}
case 'u':
case 'U':
{
cout << "Operand 1 ?";
cin >> hex >> num1;
cout << "\nOperand 2 ?";
cin >> hex >> num2;
cout << "\nOperator 1)/ or 2) + :";
cin >> operand;
while((operand != 1)&&(operand != 2))
{
operand = 0;
cout << "\nIncorrect operand, reenter:";
cin >> operand;
}
switch(operand)
{
case 1:
{
result = num1/num2;
cout << "Hex result ";
cout << hex << result << endl;
cout << "\nBinary result ";
BinOut32(result);
break;
}
case 2:
{
result = num1 + num2;
cout << "Hex result ";
cout << hex << result << endl;
cout << "\nBinary result ";
BinOut32(result);
break;
}
}
break;
}
}
}
|