Initial revision
[fw/sdcc] / doc / SDCCUdoc-10.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.9">
5  <TITLE>SDCC Compiler User Guide: Absolute addressing.</TITLE>
6  <LINK HREF="SDCCUdoc-11.html" REL=next>
7  <LINK HREF="SDCCUdoc-9.html" REL=previous>
8  <LINK HREF="SDCCUdoc.html#toc10" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="SDCCUdoc-11.html">Next</A>
12 <A HREF="SDCCUdoc-9.html">Previous</A>
13 <A HREF="SDCCUdoc.html#toc10">Contents</A>
14 <HR>
15 <H2><A NAME="Absolute Addressing"></A> <A NAME="s10">10. Absolute addressing.</A> </H2>
16
17 <P>Data items can be assigned an absolute address with the at &lt;address&gt;
18 keyword, in addition to a storage class.
19 <P>
20 <PRE>
21 eg. xdata at 0x8000 unsigned char PORTA_8255 ;
22  
23 </PRE>
24 <P>In the above example the PORTA_8255 will be allocated to the location 0x8000
25 of the external ram. 
26 <P>Note that is this feature is provided to give the programmer access to
27 memory mapped devices attached to the controller. The compiler does not actually
28 reserve any space for variables declared in this way (they are implemented
29 with an equate in the assembler), thus it is left to the programmer to make
30 sure there are no overlaps with other variables that are declared without the
31 absolute address, the assembler listing file (.lst) and the linker output files
32 (&lt;filename&gt;.rst) and (&lt;filename&gt;.map) are a good places to look
33 for such overlaps.
34 <P>Absolute address can be specified for variables in all storage classes.
35 <P>
36 <PRE>
37 eg.bit at 0x02 bvar;
38  
39 </PRE>
40 <P>The above example will allocate the variable at offset 0x02 in the bit-addressable
41 space. There is no real advantage to assigning absolute addresses to variables
42 in this manner , unless you want strict control over all the variables allocated.
43 <HR>
44 <A HREF="SDCCUdoc-11.html">Next</A>
45 <A HREF="SDCCUdoc-9.html">Previous</A>
46 <A HREF="SDCCUdoc.html#toc10">Contents</A>
47 </BODY>
48 </HTML>