Floating Point Operations

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Floating Point Operations

4,418 Views
SebaS
Contributor III
Hello Everybody!!!

Well, I'm stuck again; but now it's about Floating Point Operations.
I'm using a Motorola HCS12 and I'm programming it with CodeWorrior (in C language), wich won't let me do any float point operation.

Whe I compile my project, this errors flash:

"Symbol _FADD in is undefined"

"Symbol _FMUL in is undefined"

"Symbol _FSFLOAT in is undefined"

I don't know much but I guess those missing symbols are the definitions of the routines that make such operations.

The problem is: Where are (should be) those routines????? or Where can I get them?

I've found (from an old project) the routines for HC11. But in there, the symbol's names where different. For example it says "__fpadd" instead of "_FADD" so I renamed it. [I still don't know if that works]. Same thing with "_FMUL". But I couldn't find the symbol "_FSFLOAT" or it alias. So I'm stuck!

HELP!!!!
Labels (1)
0 Kudos
6 Replies

638 Views
bigmac
Specialist III

Hello,

You need to stipulate whether or not you need to use floating point when you first create a project.  The new project wizard dialog should provide this option.

Regards,
Mac

 

0 Kudos

638 Views
SebaS
Contributor III
Oh, Thank You so much!!! You're right, now I remember!!!!

Well, now I'm gonna try that, if something goes wrong I'll ask You again.

See You

SebaS
0 Kudos

638 Views
kwik
Contributor I
So you cant change that later on ?????
0 Kudos

638 Views
CrasyCat
Specialist III
Hello
 
You can do it but you have to manually adjust the settings.
 
Basically for HC12 you have to remove the option -D__NO_FLOAT__ from compiler command line and add floating point format option (if needed) then replace ansi library file.
To retrieve the appropriate ansi library file check the file readme.txt from {Install}\lib\hc12c.
 
Re-creating the project with the wizard is just easier and avoid any discrepancy between compiler options and library file.
 
CrasyCat
0 Kudos

638 Views
SebaS
Contributor III
Thanks for the Help Above!!!

Now I'm working with a project that combines C and ASM and the startup code was done in ASM languaje (we didn't use the one that wizard made, because we wanted to have a little more control). How can we use floating point operation now? Because it keep saying that the symbol _FSUB (and many more) are undefined. What should I do? Which are the files or libraries that I've got to include or compile in my project?

Thanks again!
:smileyhappy:
0 Kudos

638 Views
CrasyCat
Specialist III
Hello
 
Messages _FSUB (and many more) are undefined are generated if you are linking your application with the wrong ansi library file or without ANSI library file.
 
Please check the file {Install}\lib\hc12c\readme.txt to determine which library file you need to add to your project.
 
CrasyCat
0 Kudos