I have tested both compiler with a smallest program. Test result is:
MicroC:Used ROM :
36 Used RAM :
18CCS C:Used ROM :
69Used RAM :
9CCS C --> more ROM, smaller RAM
MicroC --> smaller ROM, more RAM
And also have a great difference:
-CCS doesn't show the asm code of whole program. It cuts the some important intgrated operation like multiplication:
The program and the ASM outputs of both ones are:
Micro C:char a,b;
void main()
{
//a = 3;
//b = 5;
PORTB = a*b;
}
Micro C - ASM Output:; ASM code generated by mikroVirtualMachine for PIC - V. 8.1.0.0
; Date/Time: 04/03/2008 15:37:48
; Info:
http://www.mikroe.com; ADDRESS OPCODE ASM
; ----------------------------------------------
$0000 $281D GOTO _main
$0004 $ _Mul_8x8_U:
$0004 $1303 BCF STATUS, RP1
$0005 $1283 BCF STATUS, RP0
$0006 $0870 MOVF STACK_0, W
$0007 $00F1 MOVWF STACK_1
$0008 $01F0 CLRF STACK_0
$0009 $3008 MOVLW 8
$000A $00FC MOVWF STACK_12
$000B $0871 MOVF STACK_1, W
$000C $0CF4 RRF STACK_4, F
$000D $1803 BTFSC STATUS, C
$000E $2813 GOTO $+5
$000F $0BFC DECFSZ STACK_12, F
$0010 $280C GOTO $-4
$0011 $01F1 CLRF STACK_1, F
$0012 $3400 RETLW 0
$0013 $1003 BCF STATUS, C
$0014 $2818 GOTO $+4
$0015 $0CF4 RRF STACK_4, F
$0016 $1803 BTFSC STATUS, C
$0017 $07F1 ADDWF STACK_1, F
$0018 $0CF1 RRF STACK_1, F
$0019 $0CF0 RRF STACK_0, F
$001A $0BFC DECFSZ STACK_12, F
$001B $2815 GOTO $-6
$001C $0008 RETURN
$001D $ _main:
;Muitiplication.c,3 :: void main()
;Muitiplication.c,7 :: PORTB = a*b;
$001D $1303 BCF STATUS, RP1
$001E $1283 BCF STATUS, RP0
$001F $0820 MOVF _a, 0
$0020 $00F0 MOVWF STACK_0
$0021 $0821 MOVF _b, 0
$0022 $00F4 MOVWF STACK_4
$0023 $2004 CALL _mul_8x8_u
$0024 $0870 MOVF STACK_0, 0
$0025 $0086 MOVWF PORTB
;Muitiplication.c,8 :: }
$0026 $2826 GOTO $
CCS C:#include <16F88.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES NOLVP //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#use delay(clock=8000000)
char a,b;
Void main()
{
Output_B(a * b);
}
CCS C - ASM Output:CCS PCM C Compiler, Version 4.068, 34857 03-Apr-08 15:38
Filename: I:\PIC-Elektronik\PIC\Prog_Source Codes\ccs_c PCW\PIC16F88 Projeleri\PIC16F88 Binary Mult.lst
ROM used: 69 words (2%)
Largest free fragment is 2048
RAM used: 9 (2%) at main() level
10 (3%) worst case
Stack: 1 locations
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 02A
0003: NOP
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES INTRC_IO //Internal RC Osc, no CLKOUT
.................... #FUSES NOLVP //Low Voltage Programming on B3(PIC16) or B5(PIC18)
....................
.................... #use delay(clock=8000000)
....................
.................... char a,b;
....................
.................... Void main()
.................... {
002A: CLRF 04
002B: BCF 03.7
002C: MOVLW 1F
002D: ANDWF 03,F
002E: MOVLW 72
002F: BSF 03.5
0030: MOVWF 0F
0031: MOVF 0F,W
0032: BCF 1F.4
0033: BCF 1F.5
0034: MOVF 1B,W
0035: ANDLW 80
0036: MOVWF 1B
0037: MOVLW 07
0038: MOVWF 1C
.................... Output_B(a * b);
0039: BCF 03.5
003A: MOVF 20,W
003B: MOVWF 22
003C: MOVF 21,W
003D: MOVWF 23
003E: GOTO 004
003F: BSF 03.5
0040: CLRF 06
0041: BCF 03.5
0042: MOVF 78,W
0043: MOVWF 06
.................... }
0044: SLEEP
Configuration Fuses:
Word 1: 3F70 NOWDT PUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
Word 2: 3FFF FCMEN IESO
In MicroC Fuses and Clock are setted at sperately. Same fuses and clock rate has choosen. So, All everthing same. But the outputs are not same. As you can see, CCS C has not multiplication algorith but MicroC has.
This program is very very shot. Then, that is not a true comparion. But gives us some ideas.
I use CCS. But I have trying MicroC in a few days. MicroC has some internal utilities an statements. And also,
I din't run USART with CCS but MicroC I have run. Some code but CCS didn't give any output at USART PIN's. Because of the fact that, I tried MicroC. Now, I am testing both anywhere.
But I like CCS ...