Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Assmbley with Upp
Assmbley with Upp [message #8212] Tue, 20 February 2007 02:30 Go to next message
_Seven_ is currently offline  _Seven_
Messages: 35
Registered: April 2006
Member
Hi. I have lessons about programming with assembly in C. My professor show me this funcion as example:

Quote:


float AreaCirc(float ray){
float area;
asm{
finit
fld dword ptr ray
fmul st,st(0)
fldpi
fmul
fstp dword ptr area
fwait
}
return area;
}



and compiling the code appear some erros in this funcion. They are:

Quote:


C:\MyApps\teste\teste.cpp: In function `float AreaCirc(float)':
C:\MyApps\teste\teste.cpp:6: error: expected `(' before '{' token
C:\MyApps\teste\teste.cpp:6: error: expected asm body before '{' token
C:\MyApps\teste\teste.cpp:8: error: `finit' undeclared (first use this function)
C:\MyApps\teste\teste.cpp:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\MyApps\teste\teste.cpp:8: error: expected `;' before "fld"



Well, was my teacher that made the code and for this reason the code is right, so where is the problem? I think that he use Borland C or MVS.

Thanks for your help.

Re: Assmbley with Upp [message #8215 is a reply to message #8212] Tue, 20 February 2007 08:40 Go to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
Yes, the problem is that GCC syntax for assembly is different.

I suggest you to download free MSC8 compiler to get it work.

Mirek
Previous Topic: MS Com and Unicode issue
Next Topic: what's wrong
Goto Forum:
  


Current Time: Thu May 16 04:18:50 CEST 2024

Total time taken to generate the page: 0.02405 seconds