From: Neil T. D. <ntd...@bs...> - 2004-07-02 15:43:07
|
I'm trying to perform a spline interpolation on the TINI. Wrote all the code and debugged it on my workstation, then went to compile it for the TINI and things broke. I cannot compile floating point operations with SDCC. It seems that the code for floating point operations is not being included. I've included a code sample, the assembly, and the macro and assembler output. The problem seems to be with the following two lines of assembly: mov dptr,#___fsdiv_PARM_2 ......... lcall __fsdiv Neither of those two symbols are defined. Any ideas on how to fix the problem? --------------------CODE-------------------------------- #include <float.h> float fptest(float f) { float a=1.2; return a/f; } ---------END CODE-------------------------------------- -------ASSEMBLY------------------------------------ $BEGIN_MODULE(fptest) ;-------------------------------------------------------- ; File Created by SDCC : FreeWare ANSI-C Compiler ; Version 2.4.1 (Jun 14 2004) ; This file generated Fri Jul 2 10:22:44 2004 ;-------------------------------------------------------- ; .file "fptest.c" $include(tini.inc) $include(ds80c390.inc) $include(tinimacro.inc) $include(apiequ.inc) ; _bpx (frame pointer) mapped to R8_B3:R7_B3 ; _ap mapped to R6_B3 Lib_Native_Init: clr a ret LibraryID: db "DS" db 0, 0, 0, 0, 0, 1 ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- ; .globl fptest ;------------------------------------------------------------ ;Allocation info for local variables in function 'fptest' ;------------------------------------------------------------ ;f Allocated to registers ;a Allocated to registers ;------------------------------------------------------------ ; fptest.c:3: float fptest(float f) ; genFunction ; ----------------------------------------- ; function fptest ; ----------------------------------------- fptest: ; genReceive mov 086h,#01h mov dptr,#___fsdiv_PARM_2 mov a,dpl movx @dptr,a inc dptr mov a,dph movx @dptr,a inc dptr mov a,093h movx @dptr,a inc dptr mov a,b movx @dptr,a mov 086h,#00h ; fptest.c:6: return a/f; ; genCall ; genSend argreg = 1, size = 4 ; Peephole 182 used 16 bit load of dptr mov dptr,# 0999Ah mov 093h,#099h mov b,#03Fh lcall __fsdiv ; genRet ; genLabel L00101: ; genEndFunction ret ; SECTION NOT SUPPORTED $END_MODULE end ---------------------END ASSEMBLER----------------------------- --------------------COMPILER OUTPUT---------------------- +---------------------------------------------------------------------------+ | Dallas Semiconductor DS80C390 Macro Preprocessor, Beta Version 0.601.0055 | +---------------------------------------------------------------------------+ Last build Aug 22 2003 at 08:45:01 Parsing fptest.a51... Parser terminated without error +------------------------------------------------------------------+ | Dallas Semiconductor DS80C390 Assembler, Beta Version 0.121.0022 | +------------------------------------------------------------------+ Last build Jan 24 2003 at 11:29:21 Starting pass 1... Starting pass 2... File: fptest.mpp, line: 73, Undefined symbol ___FSDIV_PARM_2. Last token read was "___fsdiv_PARM_2". --------------END COMPILER OUTPUT---------------------- Neil Dantam |