SourceForge has been redesigned. Learn more.

#1150 PIC14: Cannot operate with floats


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


Thanks a lot


  • Nobody/Anonymous

    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

  • Raphael Neider

    Raphael Neider - 2006-06-18

    Logged In: YES

    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...


  • Raphael Neider

    Raphael Neider - 2006-06-18
    • labels: 355282 --> pic14 target
    • assigned_to: nobody --> tecodev
  • Nobody/Anonymous

    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

    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,

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

  • Raphael Neider

    Raphael Neider - 2006-06-26

    Logged In: YES

    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...


  • Maarten Brock

    Maarten Brock - 2011-09-18
    • summary: Cannot operate with floats --> PIC14: Cannot operate with floats
  • Philipp Klaus Krause

    • Category: --> PIC14

Log in to post a comment.