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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/10/11 12:07
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#180497 - instead of offsetting...
Responding to: ???'s previous message
Hello together,

I used the following construct for a port of CMON51 to my Phytec microMODUL-8051 with SDCC:

	/* memory mapped I/0 registers to control memory mapping for Phytec microMODUL-8051 */
	#define PHYTEC_CTL1_REG (unsigned char xdata *)0xFC00
	#define PHYTEC_CTL2_REG (unsigned char xdata *)0xFC01
	#define PHYTEC_ADDR_REG (unsigned char xdata *)0xFC02
	#define PHYTEC_MASK_REG (unsigned char xdata *)0xFC03

	/* Configure Memory mapping (Phytec microMODUL-8051 specific): 0-7FFF CODE  8000-FFFF  XRAM+CODE */
	*PHYTEC_ADDR_REG=0x00;
	*PHYTEC_MASK_REG=0x7C;
	*PHYTEC_CTL1_REG=0x12;
 


SDCC compiled this correctly and I think it is more readable than using a 0 pointer with offset. A volatile and a const behind the * might be helpful too.

My 2 c,
Matthias

List of 25 messages in thread
TopicAuthorDate
sdcc internal error / C syntax            01/01/70 00:00      
   legality of indexing NULL pointer            01/01/70 00:00      
      bug            01/01/70 00:00      
         version            01/01/70 00:00      
            version revisited            01/01/70 00:00      
               thank you            01/01/70 00:00      
                  Fixed            01/01/70 00:00      
                     no snapshot            01/01/70 00:00      
                        works            01/01/70 00:00      
                           0 is special - but so is NULL. indexing around NULL is bad            01/01/70 00:00      
                              No guarantee that a NULL pointer points to any memory            01/01/70 00:00      
            time            01/01/70 00:00      
               I know :-(            01/01/70 00:00      
       Use of __at ?            01/01/70 00:00      
         What is "that way"?            01/01/70 00:00      
            the antique version....            01/01/70 00:00      
            XBYTE macro            01/01/70 00:00      
               Okay, then the following definition...            01/01/70 00:00      
                  RE: David's remarks about volatility            01/01/70 00:00      
   Close, but no cigar            01/01/70 00:00      
   Avoid the 'volatile'            01/01/70 00:00      
      instead of offsetting...            01/01/70 00:00      
         Dereferencing a '_REG            01/01/70 00:00      
            I agree            01/01/70 00:00      
      Use of __at ? [ed]            01/01/70 00:00      

Back to Subject List