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 mikroPascal compiler for dsPIC.
asm MOV W1, W0 ADD W0, W1, W0 end;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.
var coef : array of word; absolute $0900; series : array of real; absolute $1900;In the above example array coef is located at address $0900 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 ($0900 ... $0913). Array series is located at address $1900 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 ($1900 ... $193F).
procedure ADC1_Int; org $2A; var s : word; begin IFS0.11 := 0; //clear AD1IF s := ADCBUF0; //fetch sample end;The above example shows the method of instructing the compiler that the given procedure is saved in the part of the program memory starting from location $2A.