git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2672
4a8a32a2-be11-0410-ad9d-
d568d2c75423
<address>
\emph default
keyword, in addition to a storage class, e.g.:
<address>
\emph default
keyword, in addition to a storage class, e.g.:
\end_inset
0x8000 unsigned char PORTA_8255 ;
\end_inset
0x8000 unsigned char PORTA_8255 ;
-\newline
-
-\family default
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
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
\newline
Absolute address can be specified for variables in all storage classes,
e.g.:
\newline
Absolute address can be specified for variables in all storage classes,
e.g.:
The above example will allocate the variable at offset 0x02 in the bit-addressab
le space.
There is no real advantage to assigning absolute addresses to variables
The above example will allocate the variable at offset 0x02 in the bit-addressab
le space.
There is no real advantage to assigning absolute addresses to variables
For example, if you have a routine that uses one or more of the microcontroller
I/O pins, and such pins are different for two different hardwares, you
can declare the I/O pins in you routine using
For example, if you have a routine that uses one or more of the microcontroller
I/O pins, and such pins are different for two different hardwares, you
can declare the I/O pins in you routine using
extern bit SDI;
\newline
extern bit SCLK;
extern bit SDI;
\newline
extern bit SCLK;
Then, someplace in the code for the first hardware you would use
Then, someplace in the code for the first hardware you would use
\family typewriter
bit at 0x80 SDI;\SpecialChar ~
\family typewriter
bit at 0x80 SDI;\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
/*This is a variable, let the linker allocate this one*/
\SpecialChar ~
\SpecialChar ~
/*This is a variable, let the linker allocate this one*/
Similarly, for the second hardware you would use
Similarly, for the second hardware you would use
\family typewriter
bit at 0x83 SDI;\SpecialChar ~
\family typewriter
bit at 0x83 SDI;\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
/*This is a variable, let the linker allocate this one*/
\SpecialChar ~
\SpecialChar ~
/*This is a variable, let the linker allocate this one*/
and you can use the same hardware dependant routine without changes, as
for example in a library.
This is somehow similar to sbit, but only one absolute address has to be
specified in the whole project.
and you can use the same hardware dependant routine without changes, as
for example in a library.
This is somehow similar to sbit, but only one absolute address has to be
specified in the whole project.
-\family typewriter
-
-\newline
-
\layout Subsection
Startup Code
\layout Subsection
Startup Code