13.07.2015 Views

TASKING VX-toolset for 8051 User Guide

TASKING VX-toolset for 8051 User Guide

TASKING VX-toolset for 8051 User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>8051</strong> <strong>User</strong> <strong>Guide</strong>QualifierDescriptionLocationMaximumobject sizePointersizePointerarithmeticSectiontype *__sfrSpecial functionregisterUpper 128 bytes ininternal RAMNo allocationpossible **8-bit8-bit--__bsfrBit addressablespecial functionregisterUpper 128 bytes ininternal RAMNo allocationpossible **8-bit8-bit--__xdataExternal RAM dataExternal RAM64 kB16-bit16-bitxdata__pdataPage in external RAMdataExternal RAM256 bytes8-bit8-bitpdata__romExternal ROM dataExternal ROM64 kB16-bit16-bitrom* The default section name is equal to the section type followed by a single underscore and thename of the allocated object. You can change the section name with the #pragma section orcommand line option --rename-sections.** Because the SFR area has a predefined layout (little-endian), it is not possible to allocatevariables in this area.The SFR area is only accessible through a direct addressing mode.There<strong>for</strong>e,a warning will be generated when a pointer to __sfr or __bsfr is dereferenced.Examples using explicit memory types__data char c;__rom char text[] = "No smoking";__xdata int array[10][4];__idata long l;The memory type qualifiers are treated like any other data type specifier (such as unsigned).This meansthe examples above can also be declared as:char __data c;char __rom text[] = "No smoking";int __xdata array[10][4];long __idata l;1.2.1.1. Pointers with Memory Type QualifiersPointers <strong>for</strong> the <strong>8051</strong> can have two types: a 'logical' type and a memory type. For example,__rom char *__data p; /* pointer residing in data, pointing to ROM */means p has memory type __data (p itself is allocated in on-chip RAM), but has logical type 'characterin target memory space ROM'. The memory type qualifier used to the left of the '*', specifies the targetmemory of the pointer, the memory type qualifier used to the right of the '*', specifies the storage memoryof the pointer.4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!