Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/01/01 09:17
Read: times


 
#8886 - C Compiler Comparison results
Hi all,

I have now compiled my example with SDCC.
It need about 40% more code space and also more RAM.
But it runs not right. I assume, there are some faults in the
compiler on handling pointers. It looks, that variables overwritten
by other functions.
The Keil need 30 bytes more (still below 2kB) with the following changes, but runs still right.


To try the SDCC, only some little changes must be made:

1. no sbit with sfr names:
Keil:
sbit KEY_LEFT = P1^2;
sbit KEY_RIGHT = P1^0;

SDCC or Keil:
sbit KEY_LEFT = 0x92;
sbit KEY_RIGHT = 0x90;


2. no bit return:
Keil:
bit w1_reset(void);

SDCC or Keil:
char w1_reset(void);


3. no bdata:
Keil:
uchar bdata alhour;
sbit alarm_off = alhour^7;
sbit alarm_stop = alhour^6;

alarm_off = 0;
alarm_stop = 1;

SDCC or Keil:
uchar alhour;
#define ALARM_OFF 0x80
#define ALARM_STOP 0x40

alhour &= ~ALARM_OFF;
alhour |= ALARM_STOP;


Hi Henrik,

yes, my batch give the advantages of a make file without the disadvantage to edit it. Thus why it was named as MAGIC C.BAT.

As you can see, only 3 changes must be made to make Keil sources SDCC friendly.
So be not afraid about "With IAR I get 1790 errors :) ".
Simple catch the 1. error, read it and correct it. Than compile again. Often the following code was also seen as errorious and so you can get an error count above 1000 with only 1 error in real.
Thus why some compilers can be set to stop compiling e.g. after 10 errors.

Additonal the SDCC accept no source files *.c51, only *.c. So you must rename my example files.


Peter


List of 8 messages in thread
TopicAuthorDate
C Compiler Comparison results            01/01/70 00:00      
RE: C Compiler Comparison results            01/01/70 00:00      
RE: C Compiler Comparison results            01/01/70 00:00      
RE: C Compiler Comparison results            01/01/70 00:00      
to Henrik, Michael, Andy            01/01/70 00:00      
RE: to Henrik, Michael, Andy            01/01/70 00:00      
RE: C Compiler Comparison results            01/01/70 00:00      
RE: C Compiler Comparison results            01/01/70 00:00      

Back to Subject List