next up previous contents index
Next: 3.4 Pointers Up: 3. Using SDCC Previous: 3.2 Command Line Options   Contents   Index

Subsections

3.3 MCS51/DS390 Storage Class Language Extensions

In addition to the ANSI storage classes SDCC allows the following MCS51 specific storage classes.

3.3.1 xdata

Variables declared with this storage class will be placed in the extern RAM. This is the default storage class for Large Memory model, e.g.:

xdata unsigned char xduc;

3.3.2 data

This is the default storage class for Small Memory model. Variables declared with this storage class will be allocated in the internal RAM, e.g.:

data int iramdata;

3.3.3 idata

Variables declared with this storage class will be allocated into the indirectly addressable portion of the internal ram of a 8051, e.g.:

idata int idi;

3.3.4 bit

This is a data-type and a storage class specifier. When a variable is declared as a bit, it is allocated into the bit addressable memory of 8051, e.g.:

bit iFlag;

3.3.5 sfr / sbit

Like the bit keyword, sfr / sbit signifies 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 */ 
sbit at 0xd7 CY; /* CY (Carry Flag) */


next up previous contents index
Next: 3.4 Pointers Up: 3. Using SDCC Previous: 3.2 Command Line Options   Contents   Index
Johan Knol
2001-07-13