pavan01
Tester
 
Reged: Apr 11 2008
Posts: 16
Loc: India
|
|
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
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
|
|
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?
|
pavan01
Tester
 
Reged: Apr 11 2008
Posts: 16
Loc: India
|
|
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?
|
Dan Henry
Guru
  
Reged: Oct 16 2003
Posts: 3401
Loc: Boulder, Colorado U.S.A.
|
|
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.
|
pavan01
Tester
 
Reged: Apr 11 2008
Posts: 16
Loc: India
|
|
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
|
clyde
HI-TECH team member
   
Reged: Oct 16 2003
Posts: 633
|
|
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
|