go to single .html
[fw/sdcc] / doc / SDCCUdoc-5.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
5  <TITLE>SDCC Compiler User Guide: Language Extensions</TITLE>
6  <LINK HREF="SDCCUdoc-6.html" REL=next>
7  <LINK HREF="SDCCUdoc-4.html" REL=previous>
8  <LINK HREF="SDCCUdoc.html#toc5" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="SDCCUdoc-6.html">Next</A>
12 <A HREF="SDCCUdoc-4.html">Previous</A>
13 <A HREF="SDCCUdoc.html#toc5">Contents</A>
14 <HR>
15 <H2><A NAME="Language Extension"></A> <A NAME="s5">5. Language Extensions</A> </H2>
16
17 <H2><A NAME="Storage Classes"></A> <A NAME="ss5.1">5.1 Storage Classes.</A>
18  </H2>
19
20 <P>In addition to the ANSI storage classes SDCC allows the following 8051
21 specific storage classes.
22 <H3><A NAME="xdata"></A> xdata. </H3>
23
24 <P>Variables declared with this storage class will be placed in the extern
25 RAM. This is the <B>default</B> storage class for Large Memory model .
26 <P>eg. xdata unsigned char xduc;
27 <H3><A NAME="data"></A> data </H3>
28
29 <P>This is the <B>default</B> storage class for Small Memory model. Variables declared
30 with this storage class will be allocated in the internal RAM.
31 <P>eg. data int iramdata;
32 <H3><A NAME="idata"></A> idata </H3>
33
34 <P>Variables declared with this storage class will be allocated into the indirectly
35 addressable portion of the internal ram of a 8051 .
36 <P>eg.idata int idi;
37 <H3><A NAME="bit"></A> bit </H3>
38
39 <P>This is a data-type and a storage class specifier. When a variable is declared
40 as a bit , it is allocated into the bit addressable memory of 8051.
41 <P>eg.bit iFlag;
42 <H3><A NAME="sfr / sbit"></A> sfr / sbit </H3>
43
44 <P>Like the bit keyword, sfr / sbit signifies both a data-type and storage
45 class, they are used to describe the special function registers and special
46 bit variables of a 8051. 
47 <P>eg. 
48 <P>sfr at 0x80 P0; /* special function register P0 at location 0x80 */
49 <P>sbit at 0xd7 CY; /* CY (Carry Flag) */
50 <HR>
51 <A HREF="SDCCUdoc-6.html">Next</A>
52 <A HREF="SDCCUdoc-4.html">Previous</A>
53 <A HREF="SDCCUdoc.html#toc5">Contents</A>
54 </BODY>
55 </HTML>