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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/17/08 07:48
Read: times


 
#160074 - That's not what the manual says
Responding to: ???'s previous message
Mahesh Joshi said:
I use SDCC ver 2.4.0; This is an example how to declare sfr regs & bits.

//declaring sfr registor address
sfr at 0x80 P0 ;(write your comments here)
sfr at 0x81 SP ;

//declaring sfr bit address
sbit at 0x88 IT0 ;
sbit at 0x89 IE0 ;


SDCC Manual said:
3.4.1.7 sfr / sfr16 / sfr32 / sbit

Like the bit keyword, sfr / sfr16 / sfr32 / sbit signify both a data-type and storage class, they are used to describe the special function registers and special bit variables of a 8051, eg:

__sfr __at (0x80) P0;  /* special function register P0 at location 0x80 */  
  
/* 16 bit special function register combination for timer 0  
   with the high byte at location 0x8C and the low byte at location 0x8A */  
__sfr16 __at (0x8C8A) TMR0;  
  
__sbit __at (0xd7) CY;  /* CY (Carry Flag) */ 

http://sdcc.sourceforge.net/doc/sdccm...0000000000


So, has the syntax changed between versions?

Or are you using a "variant" syntax?

Or what?

List of 17 messages in thread
TopicAuthorDate
SDCC declaring SFR bits            01/01/70 00:00      
   Manual            01/01/70 00:00      
   SDCC declaring SFR bits            01/01/70 00:00      
      Header files?            01/01/70 00:00      
         Header files?            01/01/70 00:00      
            The manual is not enough!            01/01/70 00:00      
   This is one way            01/01/70 00:00      
      That's not what the manual says            01/01/70 00:00      
         Those SFR definitions are working            01/01/70 00:00      
            Need someone who knows SDCC: Maarten Brock?            01/01/70 00:00      
         variant syntax of SDCC keywords and ANSI-C compatibility            01/01/70 00:00      
            C standard compliance            01/01/70 00:00      
               Common for all compilers            01/01/70 00:00      
                  coders should think twice            01/01/70 00:00      
                     The preprocessor is often a good friend            01/01/70 00:00      
               Suggestion            01/01/70 00:00      
                  thanks, but...            01/01/70 00:00      

Back to Subject List