Inline Assembly: INTERNAL COMPILER ERROR 
Author Message
 Inline Assembly: INTERNAL COMPILER ERROR

Greetings, Fellow Perfectionists (a.k.a. Assembly Programmers):
Please consider the following code:

// process the Test/Misc menu selection
case ID_MENU_TEST_MISC:
_asm
{
PUSH EBX
POP EBX

Quote:
}

return 0;

The above code produces the following compiler error:

// begin VC++6.0/SP3 compiler error
--------------------Configuration: Test - Win32 Debug--------------------
Compiling...
Test.cpp
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Test\Test.cpp(33) :
fatal error C1001: INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1794)
         Please choose the Technical Support command on the Visual C++
         Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

Test.obj - 1 error(s), 0 warning(s)
// end VC++6.0/SP3 compiler error

Okay, I was under the impression that inline assembly was supposed to
make life easier for the programmer, however, I've discovered that it only
succeeds in making bug-hunting more adventurous.

I am desperately trying to port a DOS5/MASM5 100% assembly program
to the Win98/VC++6.0 environment, but without much success.  Can anyone
recommend some docs in this regard?  I think I would benefit most from a
syntactical comparison of the two environments.  Thank you.

Regards,

The Alien Prophet

--
Nothing is better than freedom.



Mon, 09 Jun 2003 13:46:19 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR

Quote:
> Greetings, Fellow Perfectionists (a.k.a. Assembly Programmers):
> Please consider the following code:

> // process the Test/Misc menu selection
> case ID_MENU_TEST_MISC:
> _asm
> {
> PUSH EBX
> POP EBX
> }
> return 0;

> The above code produces the following compiler error:

> // begin VC++6.0/SP3 compiler error
> --------------------Configuration: Test - Win32 Debug--------------------
> Compiling...
> Test.cpp
> C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Test\Test.cpp(33) :
> fatal error C1001: INTERNAL COMPILER ERROR
>         (compiler file 'msc1.cpp', line 1794)
>          Please choose the Technical Support command on the Visual C++
>          Help menu, or open the Technical Support help file for more
> information
> Error executing cl.exe.

> Test.obj - 1 error(s), 0 warning(s)
> // end VC++6.0/SP3 compiler error

> Okay, I was under the impression that inline assembly was supposed to
> make life easier for the programmer, however, I've discovered that it only
> succeeds in making bug-hunting more adventurous.

> I am desperately trying to port a DOS5/MASM5 100% assembly program
> to the Win98/VC++6.0 environment, but without much success.  Can anyone
> recommend some docs in this regard?  I think I would benefit most from a
> syntactical comparison of the two environments.  Thank you.

This isn't the only bug in the Microsoft C/C++ compiler; apparently, they
put much less effort into regression testing than they do into the various
new "features."

If your program is 100% assembly language, I see no reason for messing about
with C/C++. As far as porting is concerned, you have the following
considerations:

1. Win32 uses the flat 32-bit memory model - all segments have a 4GB limit,
and they all map to the same physical addresses. Protection is enforced by
write-protecting code pages.

2. Any manipulation of segment registers is forbidden. Segment registers may
not be used as scratch registers or for any other purpose.

3. Under the Win32 programming model, port access by user programs is
forbidden. Some ports are accessible in Win9x/Me, but WinNT/2K forbids all
such access.

4. "Far" and "near" pointers are obsolete. All pointers are "near," but are
32 bits long. They can point anywhere in the 4GB address space of your
program.

5. Try to use either the 8-bit registers or the 32-bit registers. Using the
16-bit registers requires a prefix byte which makes your code both larger
and slower. How much slower depends on the processor, but it's not good in
any case.

6. Align variables appropriately:

WORD - address divisible by 2
DWORD - address divisible by 4
QWORD - address divisible by 8
TWORD - address divisible by 8 (or 16)

In some cases, you can improve performance by aligning data on a cache row
(typically an address divisible by 32).

Daniel Pfeffer

.
 performance by aligning data on a cache row
(typically an address divisible by 32).

Daniel Pfeffer

.



Mon, 09 Jun 2003 23:39:15 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR

Quote:

> Okay, I was under the impression that inline assembly was supposed to
> make life easier for the programmer, however, I've discovered that it only
> succeeds in making bug-hunting more adventurous.

Aaaaah...but there is a basic semi-contradiction to the whole affair, isn't
there? the HLL is there to do all the nitty-gritty on your behalf and the
inline assembly lets you do the nitty-gritty yourself...sometimes, what you
want it to do and what it automatically does for you might conflict and then
the compiler is left with a tricky situation...

Its not always obvious from a HLL, but with assembly, each instruction is
not context-free and they depend on each other...it looks like your
"pushing" and "popping" is conflicting with the code the compiler generated
around the inline assembly and BANG!!...you've confused the compiler
completely...

Beth :)

Quote:
> Nothing is better than freedom.

I agree 100% :)...
Unfortunately, some people only consider their own freedom and freedom of
speech worthy...and that the rest of us should suffer and be opressed...


Mon, 09 Jun 2003 23:39:40 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR



Quote:
> Greetings, Fellow Perfectionists (a.k.a. Assembly Programmers):
> Please consider the following code:

> // process the Test/Misc menu selection
> case ID_MENU_TEST_MISC:
> _asm
> {
> PUSH EBX
> POP EBX
> }
> return 0;

> The above code produces the following compiler error:

> // begin VC++6.0/SP3 compiler error
> --------------------Configuration: Test - Win32 Debug--------------------
> Compiling...
> Test.cpp
> C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\Test\Test.cpp(33) :
> fatal error C1001: INTERNAL COMPILER ERROR
>         (compiler file 'msc1.cpp', line 1794)
>          Please choose the Technical Support command on the Visual C++
>          Help menu, or open the Technical Support help file for more
> information
> Error executing cl.exe.

> Test.obj - 1 error(s), 0 warning(s)
> // end VC++6.0/SP3 compiler error

???
What error?
Email me exact code that produces such error, I couldn't reproduce it.

--
jaamataashita
Otto



Tue, 10 Jun 2003 00:45:03 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR



Quote:
> Greetings, Fellow Perfectionists (a.k.a. Assembly Programmers):
> Please consider the following code:

Okay, I've considered it as long as I could stand to.

Quote:
> The above code produces the following compiler error:

[ ... ]

I couldn't use your code as it stood, but the following:

int main(int argc, char **argv) {

        switch(argc) {
                case 1:
                        _asm
                        {
                        PUSH EBX
                        POP EBX
                        }
                        return 0;
                default:
                        return 1;
        }

Quote:
}

compiles and runs without any errors.  IIRC, I'm using SP4, so it's
possible that this problem has already been fixed.  Alternatively,
you haven't really tracked down the entire source of the problem.

Quote:
> fatal error C1001: INTERNAL COMPILER ERROR
>         (compiler file 'msc1.cpp', line 1794)
>          Please choose the Technical Support command on the Visual C++
>          Help menu, or open the Technical Support help file for more
> information

In any case, if you find that your problem perists after updating to
SP4, then it would probably be worthwhile to follow the directions --
I.e. reduce your problem to the smallest piece of code that will
compile by itself and still trigger the problem, then send it as part
of a bug report to the VC++ team.

Quote:
> Okay, I was under the impression that inline assembly was supposed to
> make life easier for the programmer, however, I've discovered that it only
> succeeds in making bug-hunting more adventurous.

Inline assmebly has little or nothing to do with making lifer easier.  
Life is much easier when you can stick to C or C++ and not have to
use inline assembly.  Inline assembly is about providing capabilities
that are missing from C and C++ without having to convert over
entirely to assembly language throughout.  Personally, I'd think very
hard about NOT using inline assembly though: I find things work far
better in the long run if you keep the assembly in separate files
that you feed to the assembler.

Quote:
> I am desperately trying to port a DOS5/MASM5 100% assembly program
> to the Win98/VC++6.0 environment, but without much success.  Can anyone
> recommend some docs in this regard?  I think I would benefit most from a
> syntactical comparison of the two environments.  Thank you.

Syntax is not the problem -- semantics are.  From the looks of your
snippet of code above, you're trying to port this to become a
windowed message-driven program.  Starting with a typical DOS
program, this requires a total change in how you view the vast
majority of what you're dealing with.

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.
.
aling with.

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.
.



Tue, 10 Jun 2003 06:48:31 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR
Greetings, Otto.  Good to hear from you again.

Quote:
>What error?
>Email me exact code that produces such error, I couldn't reproduce it.

You couldn't reproduce the error because the error does not lie in the
code, but in my installation of SP3, as I recently discovered.

After I installed SP3, I discovered that *all* my previously created
projects produced the aforementioned error.  The solution?  Recreate
and recompile *all* my projects.  Yeah, baby!  Now I remember why
I love computers.

BTW, thank you for your most generous offer to test my code on your
own system.  IMO, such a sacrifice of one's valuable (and finite) time
in the aid of another is a true characteristic of selflessness.

Cheers



Tue, 10 Jun 2003 22:13:13 GMT  
 Inline Assembly: INTERNAL COMPILER ERROR
Thanks for the info, Daniel.  You've managed to enlighten me on a few
points, using simple and concise terms -- a mark of high intelligence.

Cheers



Tue, 10 Jun 2003 22:13:44 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. inline assembly & BC++ compiler optimizations

2. problem porting assembly codes from ms inline assembly to linux (gnu - AT&T syntax)

3. Please HELP - compiler internal error

4. ifc: *Compiler Internal Error*

5. Internal compiler error with g77 on linux

6. 1501-230 Internal compiler error

7. Internal Compiler Error (C0000005)-CVF 6.5

8. internal compiler error

9. Sunsoft: Internal compiler error

10. Internal compiler error when both using and passing an intrinsic function

11. Internal compiler error

12. internal compiler error; AIX fortran

 

 
Powered by phpBB® Forum Software