Change IS_DS390 to .model=FLAT24
[fw/sdcc] / doc / sdccman.html / node30.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.11 Absolute Addressing</TITLE>
11 <META NAME="description" CONTENT="3.11 Absolute Addressing">
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="node31.html">
23 <LINK REL="previous" HREF="node29.html">
24 <LINK REL="up" HREF="node19.html">
25 <LINK REL="next" HREF="node31.html">
26 </HEAD>
27
28 <BODY >
29 <!--Navigation Panel-->
30 <A NAME="tex2html696"
31  HREF="node31.html">
32 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
33 <A NAME="tex2html690"
34  HREF="node19.html">
35 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
36 <A NAME="tex2html684"
37  HREF="node29.html">
38 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
39 <A NAME="tex2html692"
40  HREF="node1.html">
41 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
42 <A NAME="tex2html694"
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="tex2html697"
47  HREF="node31.html">3.12 Startup Code</A>
48 <B> Up:</B> <A NAME="tex2html691"
49  HREF="node19.html">3. Using SDCC</A>
50 <B> Previous:</B> <A NAME="tex2html685"
51  HREF="node29.html">3.10 Functions using private</A>
52  &nbsp <B>  <A NAME="tex2html693"
53  HREF="node1.html">Contents</A></B> 
54  &nbsp <B>  <A NAME="tex2html695"
55  HREF="node61.html">Index</A></B> 
56 <BR>
57 <BR>
58 <!--End of Navigation Panel-->
59
60 <H2><A NAME="SECTION000411000000000000000">
61 3.11 Absolute Addressing</A>
62 </H2>
63
64 <P>
65 Data items can be assigned an absolute address with the <I>at &lt;address&gt;</I>
66 keyword, in addition to a storage class, e.g.:
67 <BR>
68
69 <BR>
70 <TT>xdata at 0x8000 unsigned char PORTA_8255 ;</TT>&nbsp;
71 <BR>
72
73 <BR>
74 In the above example the PORTA_8255 will be allocated to the location
75 0x8000 of the external ram. Note that this feature is provided to
76 give the programmer access to <I>memory mapped</I> devices attached
77 to the controller. The compiler does not actually reserve any space
78 for variables declared in this way (they are implemented with an equate
79 in the assembler). Thus it is left to the programmer to make sure
80 there are no overlaps with other variables that are declared without
81 the absolute address. The assembler listing file (.lst) and the linker
82 output files (.rst) and (.map) are a good places to look for such
83 overlaps.
84 <BR>
85
86 <BR>
87 Absolute address can be specified for variables in all storage classes,
88 e.g.:
89 <BR>
90
91 <BR>
92 <TT>bit at 0x02 bvar;</TT>&nbsp;
93 <BR>&nbsp;
94 <BR>
95 The above example will allocate the variable at offset 0x02 in the
96 bit-addressable space. There is no real advantage to assigning absolute
97 addresses to variables in this manner, unless you want strict control
98 over all the variables allocated.
99
100 <P>
101 <HR>
102 <!--Navigation Panel-->
103 <A NAME="tex2html696"
104  HREF="node31.html">
105 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A> 
106 <A NAME="tex2html690"
107  HREF="node19.html">
108 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A> 
109 <A NAME="tex2html684"
110  HREF="node29.html">
111 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A> 
112 <A NAME="tex2html692"
113  HREF="node1.html">
114 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A> 
115 <A NAME="tex2html694"
116  HREF="node61.html">
117 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A> 
118 <BR>
119 <B> Next:</B> <A NAME="tex2html697"
120  HREF="node31.html">3.12 Startup Code</A>
121 <B> Up:</B> <A NAME="tex2html691"
122  HREF="node19.html">3. Using SDCC</A>
123 <B> Previous:</B> <A NAME="tex2html685"
124  HREF="node29.html">3.10 Functions using private</A>
125  &nbsp <B>  <A NAME="tex2html693"
126  HREF="node1.html">Contents</A></B> 
127  &nbsp <B>  <A NAME="tex2html695"
128  HREF="node61.html">Index</A></B> 
129 <!--End of Navigation Panel-->
130 <ADDRESS>
131 <I>Johan Knol</I>
132 <BR><I>2001-07-13</I>
133 </ADDRESS>
134 </BODY>
135 </HTML>