136 lines
4.6 KiB
HTML
136 lines
4.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
|
|
<!--Converted with LaTeX2HTML 99.1 release (March 30, 1999)
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
* with significant contributions from:
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>3.11 Absolute Addressing</TITLE>
|
|
<META NAME="description" CONTENT="3.11 Absolute Addressing">
|
|
<META NAME="keywords" CONTENT="sdccman">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v99.1 release">
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
<LINK REL="STYLESHEET" HREF="sdccman.css">
|
|
|
|
<LINK REL="next" HREF="node31.html">
|
|
<LINK REL="previous" HREF="node29.html">
|
|
<LINK REL="up" HREF="node19.html">
|
|
<LINK REL="next" HREF="node31.html">
|
|
</HEAD>
|
|
|
|
<BODY >
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html696"
|
|
HREF="node31.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
|
|
<A NAME="tex2html690"
|
|
HREF="node19.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
|
|
<A NAME="tex2html684"
|
|
HREF="node29.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
|
|
<A NAME="tex2html692"
|
|
HREF="node1.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
|
|
<A NAME="tex2html694"
|
|
HREF="node61.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html697"
|
|
HREF="node31.html">3.12 Startup Code</A>
|
|
<B> Up:</B> <A NAME="tex2html691"
|
|
HREF="node19.html">3. Using SDCC</A>
|
|
<B> Previous:</B> <A NAME="tex2html685"
|
|
HREF="node29.html">3.10 Functions using private</A>
|
|
  <B> <A NAME="tex2html693"
|
|
HREF="node1.html">Contents</A></B>
|
|
  <B> <A NAME="tex2html695"
|
|
HREF="node61.html">Index</A></B>
|
|
<BR>
|
|
<BR>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H2><A NAME="SECTION000411000000000000000">
|
|
3.11 Absolute Addressing</A>
|
|
</H2>
|
|
|
|
<P>
|
|
Data items can be assigned an absolute address with the <I>at <address></I>
|
|
keyword, in addition to a storage class, e.g.:
|
|
<BR>
|
|
|
|
<BR>
|
|
<TT>xdata at 0x8000 unsigned char PORTA_8255 ;</TT>
|
|
<BR>
|
|
|
|
<BR>
|
|
In the above example the PORTA_8255 will be allocated to the location
|
|
0x8000 of the external ram. Note that this feature is provided to
|
|
give the programmer access to <I>memory mapped</I> devices attached
|
|
to the controller. The compiler does not actually reserve any space
|
|
for variables declared in this way (they are implemented with an equate
|
|
in the assembler). Thus it is left to the programmer to make sure
|
|
there are no overlaps with other variables that are declared without
|
|
the absolute address. The assembler listing file (.lst) and the linker
|
|
output files (.rst) and (.map) are a good places to look for such
|
|
overlaps.
|
|
<BR>
|
|
|
|
<BR>
|
|
Absolute address can be specified for variables in all storage classes,
|
|
e.g.:
|
|
<BR>
|
|
|
|
<BR>
|
|
<TT>bit at 0x02 bvar;</TT>
|
|
<BR>
|
|
<BR>
|
|
The above example will allocate the variable at offset 0x02 in the
|
|
bit-addressable space. There is no real advantage to assigning absolute
|
|
addresses to variables in this manner, unless you want strict control
|
|
over all the variables allocated.
|
|
|
|
<P>
|
|
<HR>
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html696"
|
|
HREF="node31.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
|
|
<A NAME="tex2html690"
|
|
HREF="node19.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
|
|
<A NAME="tex2html684"
|
|
HREF="node29.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
|
|
<A NAME="tex2html692"
|
|
HREF="node1.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
|
|
<A NAME="tex2html694"
|
|
HREF="node61.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html697"
|
|
HREF="node31.html">3.12 Startup Code</A>
|
|
<B> Up:</B> <A NAME="tex2html691"
|
|
HREF="node19.html">3. Using SDCC</A>
|
|
<B> Previous:</B> <A NAME="tex2html685"
|
|
HREF="node29.html">3.10 Functions using private</A>
|
|
  <B> <A NAME="tex2html693"
|
|
HREF="node1.html">Contents</A></B>
|
|
  <B> <A NAME="tex2html695"
|
|
HREF="node61.html">Index</A></B>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
<I>Johan Knol</I>
|
|
<BR><I>2001-07-13</I>
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|