section("some_far_section")
int far abc[100];
int near def[100];
main() {
assert(sizeof(&abc)==2 && sizeof(&def)==1);
}
Conversions Between Far and Near Pointers
Conversions between
truncate the Most Significant Word (MSW) of a
verting a
pointer to a
far
near-pointer will be done by making the MSW of the output far-pointer
the same as that of the internal data area.
Care should be taken to avoid de-referencing truncated
data accessed will be in the internal memory area. The compiler will gen-
erate a warning when it sees a conversion from a
pointer.
For example,
int near * near_iptr;
int far * far_iptr;
void trunc_far (int far *i) {
near_iptr = i;
}
void extend_far (int near *i) {
far_iptr = i;
}
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
and near pointers are valid. The compiler will
far
pointer. The conversion from a
near
/* truncate MSW leaving LSW -
will cause a compiler warning */
/* extend MSW with value of internal memory
addresses */
Compiler
pointer when con-
far
pointers as the
far
pointer to a
far
near
1-101
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?