Memory administration compiler

Post your requests and ideas on the future development of mikroC PRO for PIC.
Post Reply
Author
Message
alejandroflamerich
Posts: 68
Joined: 17 Jan 2008 19:32
Location: Venezuela
Contact:

Memory administration compiler

#1 Post by alejandroflamerich » 28 Dec 2009 00:40

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

alejandroflamerich
Posts: 68
Joined: 17 Jan 2008 19:32
Location: Venezuela
Contact:

Example

#2 Post by alejandroflamerich » 05 Jan 2010 22:15

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

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#3 Post by anikolic » 06 Jan 2010 14:51

Hi,
If you take a look at Linker Directives section of the Help file, you may see the definition of absolute directive:
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
So, this might just be the key thing you were looking for, am I right?

Best regards,
Aleksandar
Web Department Manager

alejandroflamerich
Posts: 68
Joined: 17 Jan 2008 19:32
Location: Venezuela
Contact:

Reply

#4 Post by alejandroflamerich » 06 Jan 2010 16:25

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 )

alejandroflamerich
Posts: 68
Joined: 17 Jan 2008 19:32
Location: Venezuela
Contact:

Or

#5 Post by alejandroflamerich » 06 Jan 2010 20:13

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.

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#6 Post by anikolic » 08 Jan 2010 15:55

#pragma absolute rx offset 10 (use the rx's register after 0x0A) no implemented jet.
I was given information that this option as for now, is not going to be implemented.
#prama absolute data offset 0x200 (use ram memory after 0x200) 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.

Thank you for your suggestions.

Best regards,
Aleksandar
Web Department Manager

Post Reply

Return to “mikroC PRO for PIC Wish List”