#1150 PIC14: Cannot operate with floats

open
PIC14
5
2013-07-16
2006-06-14
Anonymous
No

I can't operate with floats, I have an error in asm
file such us:

trabajo.asm:874:Error [113] Symbol not previously
defined (___fsmul).
trabajo.asm:900:Error [113] Symbol not previously
defined (___fsmul).
trabajo.asm:924:Error [113] Symbol not previously
defined (___fsmul).
trabajo.asm:950:Error [113] Symbol not previously
defined (___fsmul).
trabajo.asm:974:Error [113] Symbol not previously
defined (___fsmul).
trabajo.asm:1000:Error [113] Symbol not previously
defined (___fssub).
trabajo.asm:1024:Error [113] Symbol not previously
defined (___fsadd).
trabajo.asm:1048:Error [113] Symbol not previously
defined (___fssub).
make.exe: *** [trabajo.o] Error 1

It's just multiplicating or dividing, not with
complex operations.

I'm working with PIC 16f876A, and I can't even use
math.h

e-mail: tanok.barracus@gmail.com

Thanks a lot

Discussion

  • Logged In: NO

    floats will be supported if pic14 port supports unions. The
    union float_long is required in some operations and pic14
    port doesn't handle unions!

    This is a big deal, so I believe fixing this issue, pic14
    can handle successfully floats, unless we have another issue
    related to internal representation of floats in the uC
    structures...

     
  • Raphael Neider
    Raphael Neider
    2006-06-18

    Logged In: YES
    user_id=1115835

    The pic14 port is currently missing the required support
    routines (__fssub, __fsmul, ...) to deal with floats.
    I guess using floats on a device as small as a pic14 device
    does not make much sense, but I will add the functions
    nonetheless. Should be there within the week... I hope...

    Regards,
    Raphael

     
  • Raphael Neider
    Raphael Neider
    2006-06-18

    • labels: 355282 --> pic14 target
    • assigned_to: nobody --> tecodev
     
  • Logged In: NO

    Correction about unions... the pic14 port supports, but
    all variables must be declared static! (Deviation from
    ANSI?) I moved all _fs things from lib/src, to libsdcc
    inside pic/ and run make again. Some errors ocurred but
    mitigated revoking some volatiles and putting "static"
    before any "union" type var declaration.

    Also There are duplicated symbols that is being generated
    by sdcc during compilation that makes gpasm to fail. To
    solve this I edited manually the .asm amd compiled it
    (using gpasm).

    As far as I know, it's working fine (I didn't do
    regression tests, maybe I write one!)

     
  • Raphael Neider
    Raphael Neider
    2006-06-25

    Logged In: YES
    user_id=1115835

    Floating point support has now been added to PIC14, but
    beware: Due to register allocation problems and code page
    selection problems (still to to further investigated) this
    is to regarded more as a technology demo than production
    quality code. I just managed to get one FP operation (add,
    sub od mul) execute correctly, further applications jump
    into nirvana...
    Div loops endlessly, mod is untested, but if you want to
    give it a try, it's part of SDCC r4250.

    Keeping this report open for now,
    Raphael

    BTW: Support for local variables has been added, too!

     
  • Raphael Neider
    Raphael Neider
    2006-06-26

    Logged In: YES
    user_id=1115835

    Oh, I forgot to mention: Currently you need to manually link
    against libm.lib when using more advanced mathematics
    (again: highly untested).
    Just thougth you might want to know...

    Regards,
    Raphael

     
  • Maarten Brock
    Maarten Brock
    2011-09-18

    • summary: Cannot operate with floats --> PIC14: Cannot operate with floats
     
    • Category: --> PIC14