What is the scope of the #memmap directive?
If I declare “#memmap xmem” in my .c file, will that force all library functions (not explicitly declared as “root”) into xmem? Or do I also have to include the directive at the beginning of every .lib file?
I have tried to use this message board a few times, usually with limited success. I’ve seen other posts indicating that I am not alone. It appears that Rabbit Tech Support does not monitor the messages posted here. In fact, here is a snippet of my online chat with Suziet in sales. . .
You are now chatting with suziet
suziet: Good morning, Audi!
Audi McAvoy: Hi, I posted a question on the forum regarding the scope of the #memmap directive. However, I didn’t get a response.
suziet: That is because the forum is there for a user interface, not the first line of contact for Technical Support
suziet: You should always email Technical Support first- Support@Rabbit.com
So. . . I sent my question to firstname.lastname@example.org and did get an answer. It follows the end of my message here. I have also attached the referenced .zip file.
~ ~ ~ ~ ~ ~ ~
Mr. McAvoy, Sir:
With 4 years experience of programming the Rabbit based boards,
I am sure that you are very familiar with the *.MAP file, that is
generated everytime you compile a file in Dynamic C. In this *.MAP
file, you have seen addresses where functions start. If the addresses
did not have the following:
where bb represents the base address, and aaaa is the offset. For such,
that function would be in xmem code space. This you already know. For
functions with only aaaa, these are in the root code space. Attached
are libraries, programs and the resulting *.MAP files. Only one of the
libraries, LIBRARY_LEVEL5.LIB has the keyword root at the start of the
function listing LEVEL5. You will also find the listing of the function
in all the attached *.MAP files where it is listed as being in root.
For the program LIB_TEST_1_4_XMEM.C, you will find those functions
listed as being in xmem code space, with the exception of function
LEVEL5, which remains in root code space. Therefore, the keywords
#memmap xmem applies, unless so stipulated as in the function listing of
LEVEL5. For the program LIB_TEST_1_4_NO_XMEM.C, you will find the ever
present LEVEL5 in root, with LEVEL4, and LEVEL6. Due to root code
memory constraints found by Dynamic C, LEVEL1,LEVEL2 and LEVEL3 were in
xmem code space.
Was there an error in our documentation of the key words,
#memmap and xmem ?