It's important to include a module to the users will be able to administrate the memory use.
I mean that I want to program which memory (RAM and ROM used my proyect) Actually mikroC do that only with ROM memory like:
ej. #pragma orgall 0x200
but we cant do that for RAM memory.
Why is it important to programers?
I will show you a pactice example. We have a OS run in a PIC. This OS can upload a new program (Aplication Program) that it wil run (kind of bootloader). For that when we program both OS and Aplication Software we need to do a well use of the memory in orther to no overlap both memories.
We have some troubles with this issues and mikroe.
Please If already exist some way for reserve or administrate the RAM memory tell us.
Best Regard
Memory administration compiler
-
- Posts: 68
- Joined: 17 Jan 2008 19:32
- Location: Venezuela
- Contact:
-
- Posts: 68
- Joined: 17 Jan 2008 19:32
- Location: Venezuela
- Contact:
Example
I have 2 programs on the same pic living at the same time. (kind of OS and application program).
But I am having conflict with RAM memory because mickroC choice RAM memory used for my.
If I can say to the compiler which memory sector use each program I wont have any problem right.
Example
Projet OS memory configuration
RX registers 0-10
RAM memory (some memory bytes for my OS) 21-100
Projet Application Program memory configuration
RX registers 11-20
RAM memory (some memory bytes for my OS) 101-500
But I am having conflict with RAM memory because mickroC choice RAM memory used for my.
If I can say to the compiler which memory sector use each program I wont have any problem right.
Example
Projet OS memory configuration
RX registers 0-10
RAM memory (some memory bytes for my OS) 21-100
Projet Application Program memory configuration
RX registers 11-20
RAM memory (some memory bytes for my OS) 101-500
Hi,
If you take a look at Linker Directives section of the Help file, you may see the definition of absolute directive:
Best regards,
Aleksandar
If you take a look at Linker Directives section of the Help file, you may see the definition of absolute directive:
So, this might just be the key thing you were looking for, am I right?Directive absolute specifies the starting address in RAM for a variable. If the variable is multi-byte, higher bytes will be stored at the consecutive locations. Directive absolute is appended to declaration of a variable:
short x absolute 0x22;
// Variable x will occupy 1 byte at address 0x22
int y absolute 0x23;
// Variable y will occupy 2 bytes at addresses 0x23 and 0x24
Best regards,
Aleksandar
Web Department Manager
-
- Posts: 68
- Joined: 17 Jan 2008 19:32
- Location: Venezuela
- Contact:
Reply
Hi Aleksandar. thank you for your reply.
I know that statement and I actually am using but in some case a cant use that for example in a functions like
void putst (unsigned char * c absolute 0x22)
{
.......
}
It doesnt work and in other case too like when the compiler used the access bank like rx registers.
It will be very interesting a some #pragma directive like you already used for create ROM segmentation.
Example
#pragma org 0x200 (this already exist)
#pragma absolute rx (10,20) (use the rx's register 10 until 20) no implemented jet.
#prama absolute data(0x100-0x400) (use just ram memory sector between 0x200 and 0x400 )
I know that statement and I actually am using but in some case a cant use that for example in a functions like
void putst (unsigned char * c absolute 0x22)
{
.......
}
It doesnt work and in other case too like when the compiler used the access bank like rx registers.
It will be very interesting a some #pragma directive like you already used for create ROM segmentation.
Example
#pragma org 0x200 (this already exist)
#pragma absolute rx (10,20) (use the rx's register 10 until 20) no implemented jet.
#prama absolute data(0x100-0x400) (use just ram memory sector between 0x200 and 0x400 )
-
- Posts: 68
- Joined: 17 Jan 2008 19:32
- Location: Venezuela
- Contact:
Or
Or maybe somethig like this
#pragma org 0x200 (this already exist)
#pragma absolute rx offset 10 (use the rx's register after 0x0A) no implemented jet.
#prama absolute data offset 0x200 (use ram memory after 0x200) no implemented jet.
I mean Programers need to have the control that which resource use our system.
Thank you.
#pragma org 0x200 (this already exist)
#pragma absolute rx offset 10 (use the rx's register after 0x0A) no implemented jet.
#prama absolute data offset 0x200 (use ram memory after 0x200) no implemented jet.
I mean Programers need to have the control that which resource use our system.
Thank you.
I was given information that this option as for now, is not going to be implemented.#pragma absolute rx offset 10 (use the rx's register after 0x0A) no implemented jet.
I have filed an enhancement report to our developers, and they will consider introducing this linker directive, as a RAM counterpart of orgall.#prama absolute data offset 0x200 (use ram memory after 0x200) no implemented jet.
Thank you for your suggestions.
Best regards,
Aleksandar
Web Department Manager