Declaring memory

Beta Testing discussion on mikroPascal.
Post Reply
Author
Message
lexdean
Posts: 32
Joined: 19 Aug 2009 22:59

Declaring memory

#1 Post by lexdean » 15 Feb 2010 22:56

I like this product very much its so close to Delphi I have nothing to learn much. Just the pic it self

1/ When i declare memory in a function
The memory is not freed when the function is finnished with
But rather is made global

2/ Pic18fxxx, I need to store an array of data permonetly
example date of an update, or an array of integers in my case
So it needs to be placed in fram and not EEPROM
how do I distinguish the difference from Ram to fram to EEPROM in code.

my only wish is to see the better colours in the editor when the curser is near brackets and begin-end statements
and a stop on a back space at column 0

Thanks in advance,
J Lex Dean
lexdeanair @hotmail.com

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: Declaring memory

#2 Post by tihomir.losic » 16 Feb 2010 18:34

lexdean wrote:my only wish is to see the better colours in the editor when the curser is near brackets and begin-end statements
and a stop on a back space at column 0

Thanks in advance,
J Lex Dean
Hello,

I will pass your suggestion to our developers and they will consider your proposal.
Thank you for your support.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

lexdean
Posts: 32
Joined: 19 Aug 2009 22:59

Re: Declaring memory

#3 Post by lexdean » 16 Feb 2010 23:24

thanks I would like a reply in due caurse if possable

best regards,

J lex Dean
lexdeanair at hotmail.com

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: Declaring memory

#4 Post by tihomir.losic » 17 Feb 2010 17:51

lexdean wrote:1/ When i declare memory in a function
The memory is not freed when the function is finnished with
But rather is made global

2/ Pic18fxxx, I need to store an array of data permonetly
example date of an update, or an array of integers in my case
So it needs to be placed in fram and not EEPROM
how do I distinguish the difference from Ram to fram to EEPROM in code.
Hello,

please, would you post me more detailed description of your request,
or send me an example that will help me in order to send you accurate and simple answer.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

lexdean
Posts: 32
Joined: 19 Aug 2009 22:59

Re: Declaring memory

#5 Post by lexdean » 22 Feb 2010 03:32

Remember I’m fully familiar with Delphi and its stack
Thinking hard about this

Var
…………
global delectations



Procedure main;
Var
………… delectations that are allocated when the procedure is called
and freed when finnished


Procedure sub
Var
……. delectations that are allocated when the procedure is called
and freed when finished

Begin
End;

Begin
End;


Procedure Interrupt
Var
………….delectations that are allocated globally

Begin
End;



Because many chips have such little memory, effective use is everything sometimes
Because so many can count memory size quite easily.
We need to force an over ride and allocate memory to a location point.

Example the complier handle
Var
X: byte @ 0x8E; setting it into byte location $8E in Delphi


Another procedure may have
Var
Count: Word @0x8E using address 8F and 8E

With FRAM the same thing applies and Data can be saved with code
Const
Date: String[10] @ 0x12A0 = ‘22/9/2002’;
Or it could be array of semi permanent data that programmers can access because the no the location of the data.

In my case an array of long integers 100 bytes long

with this I can do so much and be very simple.
come up with a better idea if you like.

lexdean
Posts: 32
Joined: 19 Aug 2009 22:59

Re: Declaring memory

#6 Post by lexdean » 22 Feb 2010 03:42

What I did not say in my last reply

Because I can allocate a declaration to location (dedicated Memory)
the compiler can treat all other memory as global and fit it around
dedicated Memory (memory that has a pacific address).

This may require an extra pass by the compiler over the code to find dedicated Memory.
an issue is telling the programmer ideal space in FRAM to use.
it cold be in the compile result

J lex Dean

Post Reply

Return to “mikroPascal Beta Testing”