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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/14/06 20:39
Read: times


 
#116190 - Here's what I have
Responding to: ???'s previous message
As you say, _CC51 identifies Tasking.

This came out of a post here a while back about a Philips App Note that used Tasking syntax (though it didn't say so) - so it really just covers the bits relevant to that discussion.

Anyhow, here it is in case it can be of use:

/*
* Andy Neil, Antronics Ltd.
* Portable.h
* Comments: This file contains the compiler-specific definitions allowing
*           the rest of the code to be compiler-independent.
*
* Portable version by Andy Neil, Antronics Ltd:
* Of necessity, this code uses compiler-specific extensions to the ANSI 
* standard language. This version uses conditional compilation to
* automatically use the appopriate extensions.
* Compilers currently supported are:
*    Keil C51 v7;
*    Tasking 8051 C v7.1.
*
*  This is presented "as-is" and without any warranty whatsoever.
*  You may do with it as you wish, entirely at your own risk.
*/

#if defined( _CC51 )
/* Tasking 8051 Compiler */

/*
* Memory-Space specifiers.
* Note: The terms "internal" and "external" originate with the original
*       Intel 8051 devices, in which "external" RAM was literally outside
*       the 8051 IC package; this RAM is accessed by the MOVX instruction.
*
*       Modern 8051 derivates often include on-chip RAM accessed by MOVX; 
*       this is still sometimes referred to as "external" RAM, which can
*       get a little confusing!
*
*/
#define DATA _data /* directly-addressable   "internal" RAM */
#define BDAT _bdat /* bit-addressable        "internal" RAM */
#define IDAT _idat /* indirectly-addressable "internal" RAM */
#define PDAT _pdat /* 256-byte paged         "external" RAM */
#define XDAT _xdat /*                        "external" RAM */
#define CODE _rom  /* Code space  - internal or external    */

/*
* A single bit.
* Effectively, this is both a Type and a Memory-Space specifier.
*/
#define BIT  _bit

/*
* Specify and Absolute Address location
*/
#define ABS_ADR(adr) _at( adr )

/*
* A Function with a Register Bank specification, and the corresponding
* Prototype.
* (The separate Prototype definition is because some Compilers (eg Keil)
*  do not allow 'using' in the Prototype)
*/
#define FN_USING( fn, rb ) using( rb ) fn
#define FN_USING_PROTO( fn, rb ) using( rb ) fn

/*
* An Interrupt-Service Routine with a Vector Number specification
*/
#define ISR_NUM( fn, vn ) interrupt( vn ) fn

/*
* An Interrupt-Service Routine with Vector Number & Register Bank specification
*/
#define ISR_NUM_USING( fn, vn, rb ) interrupt( vn ) using( rb ) fn

#elif defined( __C51__ )
/* Keil C51 Compiler */


/*
* Memory-Space specifiers.
* Note: The terms "internal" and "external" originate with the original
*       Intel 8051 devices, in which "external" RAM was literally outside
*       the 8051 IC package; this RAM is accessed by the MOVX instruction.
*
*       Modern 8051 derivates often include on-chip RAM accessed by MOVX; 
*       this is still sometimes referred to as "external" RAM, which can
*       get a little confusing!
*
*/
#define DATA data  /* directly-addressable   "internal" RAM */
#define BDAT bdata /* bit-addressable        "internal" RAM */
#define IDAT idata /* indirectly-addressable "internal" RAM */
#define PDAT pdata /* 256-byte paged         "external" RAM */
#define XDAT xdata /*                        "external" RAM */
#define CODE code  /* Code space  - internal or external    */

/*
* A single bit.
* Effectively, this is both a Type and a Memory-Space specifier.
*/
#define BIT  bit

/*
* Specify and Absolute Address location
*/
#define ABS_ADR(adr) _at_ adr 

/*
* A Function with a Register Bank specification, and the corresponding
* Prototype.
* (The separate Prototype definition is because some Compilers (eg Keil)
*  do not allow 'using' in the Prototype)
*/
#define FN_USING( fn, rb ) fn using rb
#define FN_USING_PROTO( fn, rb ) fn

/*
* An Interrupt-Service Routine with a Vector Number specification
*/
#define ISR_NUM( fn, vn ) fn interrupt vn

/*
* An Interrupt-Service Routine with Vector Number & Register Bank specification
*/
#define ISR_NUM_USING( fn, vn, rb ) fn interrupt vn using rb
#define ISR_NUM_USING( fn, vn, rb ) fn interrupt vn using rb




#else
#error Unsupported Compiler!
#endif


List of 31 messages in thread
TopicAuthorDate
predefined macros and sfr definitions            01/01/70 00:00      
   old Tasking version            01/01/70 00:00      
      Tasking            01/01/70 00:00      
         Here's what I have            01/01/70 00:00      
            reference            01/01/70 00:00      
   no aswer, but an extra question            01/01/70 00:00      
      assembler macros            01/01/70 00:00      
         not really            01/01/70 00:00      
   I doubt it - but            01/01/70 00:00      
      End of wrong stick?            01/01/70 00:00      
         OK "any", not "ant", but "8051-derivativ            01/01/70 00:00      
            Unfair            01/01/70 00:00      
               can be argued            01/01/70 00:00      
                  No unfair intentions            01/01/70 00:00      
                     universality is not desired            01/01/70 00:00      
                  it's especially all those installs            01/01/70 00:00      
                     They happily coexist at my place            01/01/70 00:00      
                        Uninstalling            01/01/70 00:00      
   Dunfield            01/01/70 00:00      
      Dunfield AppNotes            01/01/70 00:00      
         DDS            01/01/70 00:00      
         if it is asm            01/01/70 00:00      
         what's the big deal?            01/01/70 00:00      
            solution            01/01/70 00:00      
   First try            01/01/70 00:00      
      a couple of problems (for me)            01/01/70 00:00      
         Thanks            01/01/70 00:00      
            Sometimes even using things for "what it            01/01/70 00:00      
            Common Practice            01/01/70 00:00      
               nasty is relative            01/01/70 00:00      
         Limitations            01/01/70 00:00      

Back to Subject List