8051 >> HI-TECH C PRO for the Silicon Labs 8051 MCU Family

Pages: 1
pavan01
Tester
***

Reged: Apr 11 2008
Posts: 16
Loc: India
problem with compiling a program
      #58062 - Sat May 24 2008 01:15 AM

I have change my program but now there is a problem with compiling.
Now program is
Code:
  
#include <stdio.h>
unsigned char g_byTemp;
unsigned char g_byBuff[20];
unsigned char g_byBuffr[] = "Hello ";
unsigned char* _ptemp;
unsigned char g_byindex;
void main(void)
{
g_byTemp = 0;
_ptemp = 0;
_ptemp = &g_byTemp;
while (1)
{
g_byTemp++;
sprintf(g_byBuff,"%d",g_byTemp);
for (g_byindex = 0;g_byindex < 10;g_byindex++)
{
g_byBuff[g_byindex] = g_byBuffr[g_byindex];
}
}
}


And the error given by the compiler is

as51 "--edf=C:\Program Files\HI-TECH Software\HC51\PRO\9.70\dat\en_msgs.txt" -o
"-CC:\Program Files\HI-TECH Software\HC51\PRO\9.70\dat\8051-c.ini" -ver=V9.70 -o
main.obj C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 142: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 185: (845) symbol "__size_of_sprintf" def
ined more than once
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 187: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 389: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 394: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 427: (845) symbol "__size_of___lwmod" def
ined more than once
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 432: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 507: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 512: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 546: (845) symbol "__size_of___lwdiv" def
ined more than once
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 551: (876) syntax error
C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.: 551: too many errors (11)
(908) exit status = 1
del main.obj
del C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.
del C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.1
del C:\DOCUME~1\Updesh\LOCALS~1\Temp\spc.2


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan Henry
Guru
****

Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
Re: problem with compiling a program [Re: pavan01]
      #58122 - Sat May 24 2008 12:59 PM

I pasted your code into t.c and compiled:

Code:
>"c:\Program Files\HI-TECH Software\hc51\pro\9.70\bin\c51" -M --chip=c8051f120 --asmlist t.c
HI-TECH C 51-Pro Pro beta build 2241 V9.70
Copyright (C) 1984-2008 HI-TECH SOFTWARE
Serial number: HC51P-117069242
this licence will expire on Fri, 30 May 2008
Totalrefs = 109
(1269) there are 6 days left until this licence will expire (warning)

Memory Summary:
Program space used 1B6h ( 438) of 10000h bytes ( 0.7%)
Internal Data used 31h ( 49) of E0h bytes ( 21.9%)
External Data used 0h ( 0) of 2000h bytes ( 0.0%)


How did you invoke your compilation?


Post Extras: Print Post   Remind Me!   Notify Moderator  
pavan01
Tester
***

Reged: Apr 11 2008
Posts: 16
Loc: India
Re: problem with compiling a program [Re: Dan Henry]
      #58142 - Sun May 25 2008 01:30 AM

I tried it with as follows

>C51 --chip=c8051f410 -Bh -V -C main.c

If I remove option -Bh, it works fine.

Actually I was just trying the above sample code to understand the expected changes for a code which works OK with SDCC.

I am looking to compile a huge code with Hitech and based on the manual I tried adding this option.

Does it auto decides to select huge model now?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan Henry
Guru
****

Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
Re: problem with compiling a program [Re: pavan01]
      #58182 - Sun May 25 2008 11:16 AM

Quote:

>C51 --chip=c8051f410 -Bh -V -C main.c

...

I am looking to compile a huge code with Hitech and based on the manual I tried adding this option.



With the 'F410 only having 32KB of program memory, the huge model is unwarranted in my opinion. Any of the other models should be fine depending on what you mean by "a huge code" and how that "huge code" is currently written.

Quote:

Does it auto decides to select huge model now?



I don't know whether it "auto decides" a memory model. It defaults to using the small model.


Post Extras: Print Post   Remind Me!   Notify Moderator  
pavan01
Tester
***

Reged: Apr 11 2008
Posts: 16
Loc: India
Re: problem with compiling a program [Re: Dan Henry]
      #58252 - Mon May 26 2008 12:08 AM

The code size is around 30K and External RAM used as 3.5K.
Referring the manual.pdf that is installed with the compiler, it says available memory model are only small & huge (table 2.5, page 41) while referring the section 3.14 it says Medium model also exist and based on guidelines, it should be a Medium model.

Is there any document exist to guide on the considerations of porting the code for HiTech that are written to other compilers like SDCC?

Thanks
Pavan


Post Extras: Print Post   Remind Me!   Notify Moderator  
clydeAdministrator
HI-TECH team member
*****

Reged: Oct 16 2003
Posts: 633
Re: problem with compiling a program [Re: pavan01]
      #58282 - Mon May 26 2008 05:08 AM

With HI-TECH C PRO there are no medium or small memory models. The huge model (which is not currently implemented) will be provided to deal with code space sizes greater than 64K, but data allocation is done automatically by the code generator and does not require any model selection.

So you do not need to choose a memory model. Once huge model is implemented, you will need to choose it only if you require > 64K code (and have a chip that supports that).

Clyde


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
1 registered and 0 anonymous users are browsing this forum.

Moderator:  Andrew L, clyde, Brent W, jeff, dave g, meisty, josh stevo 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1125

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5