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 mikroBasic compiler for dsPIC.
asm MOV W1, W0 ADD W0, W1, W0 end asmWhen 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.
dim x as word absolute 0x32 ' Variable x will occupy 1 word (16 bits) at address 0x32 dim y as longint absolute 0x34 ' Variable y will occupy 2 words at addresses 0x34 and 0x36In 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).
sub procedure proc(dim par as word) org 0x200 ' Procedure will start at the address 0x200; ... end subThe 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.