Can I access C pointers from assembly code written for an OCG compiler?
Pointer variables defined in C code will have a size and format which is determined by the compiler after analysing the entire C project. This pointer sizes and formats can change from one build to another as the C program is developed. This would make it very difficult to access C pointers from assembly code as the size and format is not fixed. The 9.70 (PIC10/12/16 9.70PL1 introduced this for mid-range devices) compilers will fix the pointer class so that it has maximum size and can access all objects from all memory spaces. For all PIC10/12/16 devices, the size of these pointers is 2 bytes. For Baseline and Mid- range PIC devices, the most significant bit is set if the address is that of a data memory- based object; clear if it is that of an object in program memory. For Enhanced Mid-range PIC devices, the state of this bit is reserved: set indicates a program memory address; clear the address of an object in data memory. This encoding enables the pointer to be accessed correctly fr
Related Questions
- What do I need to do to assembly code that references temp-type temporary variables when porting this code to an OCG compiler?
- When using inline assembly instructions on the TI C compiler, why does the code break at run-time?
- When using inline assembly instructions on the TI C compiler, why the code breaks at run-time?