Page 1 of 1

RAM Memory Clash

PostPosted: Fri Nov 11, 2005 1:26 am
by Syed Akbar
Hi Sayed.

(Oops -- I accidentally edited your post instead of replying to it. Your question asked how to prevent Salvo (and C code) from accessing the same areas of RAM that existing assembly code uses ...)

In order to mix Assembly language and C, you (as the programmer) have to ensure that the C code places its variables in an area that is not used by your Assembly code.

All of Salvo's variables are prefixed by "OS", and they are all declared in Salvo's mem.c.

Probably the simplest thing for you to do is to create a custom linker file for your particular compiler and target MSP430, which restricts the amount of RAM available and its location(s) to the compiler. Then, you have to place your assembly-language variables so that they do not overlap those that the compiler will use.

This is really a question for your compiler vendor -- "How to I prevent the compiler from accessing certain areas of RAM memory?" or "How to exclude certain areas of RAM from use by the compiler / linker?"

[This message has been edited by aek (edited November 11, 2005).]

[This message has been edited by aek (edited November 11, 2005).]