Just installed FreePascal in my linux box and it's great :-) It even has the old Borland Pascal style IDE in text user interface with the very same menu alignments and keyboard mappings. I had some fun time to remembering the old WordStar hotkeys but it seems after 10 years or even more can still remember ^KB & ^KK :-) Anyway, my Pascal knowledge fade a bit away so have to refresh it and made some tests for auto and static procedure/function variables just for fun. Basically 'test' is a recursive procedure so that the staticness of variables can be tracked down easily. The idea is that an auto variable keeps it's value on the same recursion level so when returning from the higher level we can see if the variable changed or not. As you can see the variables declared with 'const' are really static (like the 'static' directive in C) while the ones with the 'var' are 'auto' variables (aka sits on the stack). The interesting part is that if you specify a 'var' to located on top of a 'const' then it becomes static as you just have told the compiler to place the variable on the static data memory area instead of the stack. Here is the source of this test: program test; uses crt; const globConst: Integer = 999; procedure test ( par: Integer ); const v1: Integer = 0; { it's a static variable } var v2: Integer; { it's an auto variable } v3: Integer absolute globConst; { this is supposed to be an auto but it binds to a global static instead } begin v1 := par; v2 := par; v3 := par; write(' test1 = ', v1); write(' test2 = ', v2); writeln(' test3 = ', v3); writeln('--------------'); if par < 5 then test( par + 1 ); write(' test1_exit = ', v1); write(' test2_exit = ', v2); writeln(' test3_exit = ', v3); writeln('--------------'); end; begin writeln('variable test'); test(1); end. ---RESULTS--- variable test test1 = 1 test2 = 1 test3 = 1 -------------- test1 = 2 test2 = 2 test3 = 2 -------------- test1 = 3 test2 = 3 test3 = 3 -------------- test1 = 4 test2 = 4 test3 = 4 -------------- test1 = 5 test2 = 5 test3 = 5 -------------- test1_exit = 5 test2_exit = 5 test3_exit = 5 -------------- test1_exit = 5 test2_exit = 4 test3_exit = 5 -------------- test1_exit = 5 test2_exit = 3 test3_exit = 5 -------------- test1_exit = 5 test2_exit = 2 test3_exit = 5 -------------- test1_exit = 5 test2_exit = 1 test3_exit = 5 -------------- Tamas > > > Of course the choice of section name may be dependent on linker conventions > and definitions in other non-code files, such as the MPLINK control file on > PIC targets. > > > ******************************************************************** > Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products > (978) 742-9014. Gold level PIC consultants since 2000. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.mcuhobby.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist