C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 9th, 2003, 06:30 PM
infamous41md's Avatar
infamous41md infamous41md is offline
not a fan of fascism (n00b)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2003
Location: ct
Posts: 2,756 infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level)infamous41md User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 11 h 4 m 29 sec
Reputation Power: 94
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   eaxm
    push  ebx    
save reg so can use  <--error line
    push  ecx
    mov   ch
32  32 binary digits to display
BinOut32_1
:
    
mov   CL1
    rol   eax
CL
    mov   BL
AL
determine binary code for digit
    
and   BL00000001b  mask
    add   BL
00110000b
    
BinOut32_2
:
    
mov   cBL
    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 0num2 0result 0;
    
signed int numA 0numB 0resultB 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;
        }
    }


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Internal Compiler Error?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap