* Added.
[fw/sdcc] / doc / sdccman.html / node22.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
3 <!--Converted with LaTeX2HTML 99.1 release (March 30, 1999)
4 original version by:  Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7   Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8 <HTML>
9 <HEAD>
10 <TITLE>3.3 MCS51/DS390 Storage Class Language Extensions</TITLE>
11 <META NAME="description" CONTENT="3.3 MCS51/DS390 Storage Class Language Extensions">
12 <META NAME="keywords" CONTENT="sdccman">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
15
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v99.1 release">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19
20 <LINK REL="STYLESHEET" HREF="sdccman.css">
21
22 <LINK REL="next" HREF="node23.html">
23 <LINK REL="previous" HREF="node21.html">
24 <LINK REL="up" HREF="node19.html">
25 <LINK REL="next" HREF="node23.html">
26 </HEAD>
27
28 <BODY >
29 <!--Navigation Panel-->
30 <A NAME="tex2html579"
31  HREF="node23.html">
32 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
33 <A NAME="tex2html573"
34  HREF="node19.html">
35 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
36 <A NAME="tex2html567"
37  HREF="node21.html">
38 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
39 <A NAME="tex2html575"
40  HREF="node1.html">
41 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
42 <A NAME="tex2html577"
43  HREF="node61.html">
44 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> 
45 <BR>
46 <B> Next:</B> <A NAME="tex2html580"
47  HREF="node23.html">3.4 Pointers</A>
48 <B> Up:</B> <A NAME="tex2html574"
49  HREF="node19.html">3. Using SDCC</A>
50 <B> Previous:</B> <A NAME="tex2html568"
51  HREF="node21.html">3.2 Command Line Options</A>
52  &nbsp <B>  <A NAME="tex2html576"
53  HREF="node1.html">Contents</A></B> 
54  &nbsp <B>  <A NAME="tex2html578"
55  HREF="node61.html">Index</A></B> 
56 <BR>
57 <BR>
58 <!--End of Navigation Panel-->
59 <!--Table of Child-Links-->
60 <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
61
62 <UL>
63 <LI><A NAME="tex2html581"
64  HREF="node22.html#SECTION00043100000000000000">3.3.1 xdata</A>
65 <LI><A NAME="tex2html582"
66  HREF="node22.html#SECTION00043200000000000000">3.3.2 data</A>
67 <LI><A NAME="tex2html583"
68  HREF="node22.html#SECTION00043300000000000000">3.3.3 idata</A>
69 <LI><A NAME="tex2html584"
70  HREF="node22.html#SECTION00043400000000000000">3.3.4 bit</A>
71 <LI><A NAME="tex2html585"
72  HREF="node22.html#SECTION00043500000000000000">3.3.5 sfr / sbit</A>
73 </UL>
74 <!--End of Table of Child-Links-->
75 <HR>
76
77 <H2><A NAME="SECTION00043000000000000000">
78 3.3 MCS51/DS390 Storage Class Language Extensions</A>
79 </H2>
80
81 <P>
82 In addition to the ANSI storage classes SDCC allows the following
83 MCS51 specific storage classes.
84
85 <P>
86
87 <H3><A NAME="SECTION00043100000000000000">
88 3.3.1 xdata</A>
89 </H3>
90
91 <P>
92 Variables declared with this storage class will be placed in the extern
93 RAM. This is the <B>default</B> storage class for Large Memory model,
94 e.g.:
95 <BR>
96
97 <BR>
98 <TT>xdata unsigned char xduc;</TT>
99
100 <P>
101
102 <H3><A NAME="SECTION00043200000000000000">
103 3.3.2 data</A>
104 </H3>
105
106 <P>
107 This is the <B>default</B> storage class for Small Memory model.
108 Variables declared with this storage class will be allocated in the
109 internal RAM, e.g.:
110 <BR>
111
112 <BR>
113 <TT>data int iramdata;</TT>
114
115 <P>
116
117 <H3><A NAME="SECTION00043300000000000000">
118 3.3.3 idata</A>
119 </H3>
120
121 <P>
122 Variables declared with this storage class will be allocated into
123 the indirectly addressable portion of the internal ram of a 8051,
124 e.g.:
125 <BR>
126
127 <BR>
128 <TT>idata int idi;</TT>
129
130 <P>
131
132 <H3><A NAME="SECTION00043400000000000000">
133 3.3.4 bit</A>
134 </H3>
135
136 <P>
137 This is a data-type and a storage class specifier. When a variable
138 is declared as a bit, it is allocated into the bit addressable memory
139 of 8051, e.g.:
140 <BR>
141
142 <BR>
143 <TT>bit iFlag;</TT>
144
145 <P>
146
147 <H3><A NAME="SECTION00043500000000000000">
148 3.3.5 sfr / sbit</A>
149 </H3>
150
151 <P>
152 Like the bit keyword, <I>sfr / sbit</I> signifies both a data-type
153 and storage class, they are used to describe the special function
154 registers and special bit variables of a 8051, eg:
155 <BR>
156
157 <BR>
158 <TT>sfr at 0x80 P0; /* special function register P0 at location
159 0x80 */</TT>&nbsp;
160 <BR>
161 <TT>sbit at 0xd7 CY; /* CY (Carry Flag) */</TT>
162
163 <P>
164 <HR>
165 <!--Navigation Panel-->
166 <A NAME="tex2html579"
167  HREF="node23.html">
168 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
169 <A NAME="tex2html573"
170  HREF="node19.html">
171 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
172 <A NAME="tex2html567"
173  HREF="node21.html">
174 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
175 <A NAME="tex2html575"
176  HREF="node1.html">
177 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
178 <A NAME="tex2html577"
179  HREF="node61.html">
180 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> 
181 <BR>
182 <B> Next:</B> <A NAME="tex2html580"
183  HREF="node23.html">3.4 Pointers</A>
184 <B> Up:</B> <A NAME="tex2html574"
185  HREF="node19.html">3. Using SDCC</A>
186 <B> Previous:</B> <A NAME="tex2html568"
187  HREF="node21.html">3.2 Command Line Options</A>
188  &nbsp <B>  <A NAME="tex2html576"
189  HREF="node1.html">Contents</A></B> 
190  &nbsp <B>  <A NAME="tex2html578"
191  HREF="node61.html">Index</A></B> 
192 <!--End of Navigation Panel-->
193 <ADDRESS>
194 <I>Johan Knol</I>
195 <BR><I>2001-07-13</I>
196 </ADDRESS>
197 </BODY>
198 </HTML>