Key words are the concepts in a programming language having special meanings. The names of the variables must not use this set of words. In this chapter 3 key words whose understaning is very important will be treated. More details concerning key words could be found in the help-system accompanying the mikroC compiler for dsPIC.
asm { MOVLW 10 // just a test MOVLW _myvar MOVLW 0 // just a test MOVLW _myvar+1 }When using the key word asm, care has to be taken of the available resources. For this reason the use of this key word is not recommended unless it is necessary. The use of the key word asm is necessary when using the DSP module which will be discussed in Chapter 11. In this case there is no alternative if the maximum use of the DSP module is targeted.
int coef[10] absolute 0x0900; double series[16] absolute 0x1900;In the above example array coef is located at address 0x0900 in the memory. It takes 10x2=20 bytes (10 elements, 2 bytes each), i.e. 20 addresses (10 locations), thus the range of addresses containing the elements of array coef is (0x0900 ... 0x0913). Array series is located at address 0x1900 in the memory. It takes 16x4=64 bytes (16 element, 4 bytes each), i.e. 64 addresses (32 locations) and the range of addresses containing the elements of array series is (0x1900 ... 0x193F).
void ADC1_Int() org 0x2A{ int s; IFS0.F11 = 0; //clear AD1IF s = ADCBUF0; //fetch sample }The above example shows the method of instructing the compiler that the given function is saved in the part of the program memory starting from location 0x2A.