Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 13th, 2004, 04:11 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default not compliling!

Hello Fellows,
I am having a difficulty in compling the following simple program under visual C++ 6.0 complier:

#include <iostream>

using namespace std;

void main (void)

    {
        cout << "Przed wydaniem dŸwiêku" << endl;

        asm {
            MOV AH,2
            MOV DL,7
            INT 21H
        }

        cout <<"Zrobione!" << endl;

    }
any help is welcomed
Reply With Quote
  #2 (permalink)  
Old September 13th, 2004, 09:32 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Spivonious
Default

Forgive my ignorance, but what is asm?

edit: Nevermind I figured out that it's assembly code. What compiler error are you getting?
Reply With Quote
  #3 (permalink)  
Old September 13th, 2004, 12:10 PM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi, asm is an instruction of C++ languge that makes possible of insertion of the assembler codes (instructions) in a program like the ones in my program above.
the compiler errors which are generated :
syntax error : '{'
error C2143: syntax error : missing ';' error C2065: 'MOV' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'AH'
error C2065: 'AH' : undeclared identifier
 error C2146: syntax error : missing ';' before identifier 'MOV'
error C2146: syntax error : missing ';' before identifier 'DL'
error C2065: 'DL' : undeclared identifier
error C2059: syntax error : 'bad suffix on number'
error C2146: syntax error : missing ';' before identifier 'INT'
error C2065: 'INT' : undeclared identifier
error C2143: syntax error : missing ';' before 'constant'
error C2146: syntax error : missing ';' before identifier 'H'
error C2065: 'H' : undeclared identifier
error C2143: syntax error : missing ';' before '}'
Error executing cl.exe.



P.S. Thanks for your first reply,

Reply With Quote
  #4 (permalink)  
Old September 14th, 2004, 12:55 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,
I dont know the solution exactly but it seems from the list of errors that your compiler cant determine inline assembly codes,

--------------------------------------------
Mehdi.:)
Reply With Quote
  #5 (permalink)  
Old September 15th, 2004, 01:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

try _asm instead of asm
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add New compliling, but not actually adding record Louisa VB.NET 2002/2003 Basics 1 January 12th, 2004 11:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.