Title: CCS & mikroC comparsion indirect addressing Post by: msamar on November 29, 2009, 05:40:02 17:40 Hello every body I would like to make comparison between two kind of PIC microcontroller compilers mikroC & CCS as example using pointers indirect addressingHere is the code: mcu /pic 16f877A ////////////////////////////////////////////////////// 1- For mikroC write this C code Code: Char cntr =3 absolute 0x121; 2- for CCS write this C code Code: #BYTE portb= 0x6 1- mikroC asm lst file Code: ;ex1.c,11 :: portb = *ptr; 2- CCS asm lst file Code: .................... portb = *ptr; If we check the data sheet PIC : REGISTER 2-1: STATUS REGISTER (ADDRESS 03h, 83h, 103h, 183h) bit 7 IRP: Register Bank Select bit (used for indirect addressing) 1 = Bank 2, 3 (100h - 1FFh) 0 = Bank 0, 1 (00h - FFh) //////////////////////////////////////////////////////////// Conclusion : I find that Mikroc don’t care of IRP bit for indirect addressing as you note before . On other side if we update c file by adding an asm line of code like this Mikroc write this C file : Code: char cntr absolute 0x121; On that we can resolve our problems on mikroC pointers indirect addressing. About me I don’t like any one . but I note that CCS is pro compiler About mikroC is easy one but if you are professional programmer you don’t prefer it any way . |