Do I need to do anything to source code that contains a #pragma psect directive when porting this code to an OCG compiler?
The #pragma psect directive was present in non-OCG compilers to allow C objects to be placed into user-defined psects which could then be linked at locations specified by the programmer. In early versions of OCG compiler (prior to version 9.70) the #pragma psect directive was not implemented, but was re-implemented in versions 9.70 and above. OCG-compilers do allow objects to be defined as absolute, thus bypassing the need to use this pragma in many instances. If you are using a version 9.70 compiler, you can continue to use this pragma, although the name of the default psect may have changed. (To check this, comment out the pragma, compile and check which psect the object is normally placed in using either the map or assembly list files.) Alternatively you can make the object absolute. See your manual for more details, but the following illustrate examples of absolute objects. int input @ 0x10; // place input at address 10h const data[] @ 0x2000 = { 0, 1, 2, 3 }; // place array at 200
Related Questions
- Do I need to do anything to C source code that contains a #pragma interrupt_level directive when porting this code to an OCG compiler?
- What do I need to do to assembly code that references temp-type temporary variables when porting this code to an OCG compiler?
- Can I access C pointers from assembly code written for an OCG compiler?