Thanks Ichan for the correction.
Anyway, I changed the whole coding...trying to learn the phase control concept...
UPDATE:
Below coding is not working in real HW. Looking for some advice...pls. 
// Compiler: CCS PCWHD 4.120
// Motor Speed Control - AC220V/50Hz
#include <16F886.H>
#device adc=10;
#fuses HS //High speed Osc (> 4mhz for PCM/PCH)
#fuses NOWDT //No Watch Dog Timer
#fuses NOLVP //No low voltage programing, B3(PIC16)
#fuses NOPROTECT //Code not protected from reading
//#fuses NOBROWNOUT //No brownout reset
//#FUSES NOPUT //No Power Up Timer
#use delay(clock=20M) //20MHz clock, one instruction=0.2us
#define LCD_DB4 PIN_B1
#define LCD_DB5 PIN_B2
#define LCD_DB6 PIN_B3
#define LCD_DB7 PIN_B4
#define LCD_E PIN_C5
#define LCD_RS PIN_C4
#define LCD_RW PIN_C6
#include <flex_LCD.c>
#define PORT_adc sAN0 // PIN_A0
#define PORT_zero PIN_B0
#define GATE PIN_B6
int16 duty=0;
int16 intensity;
int16 percent;
float div = 0.1022;
#int_ext
void key_interrupt(void) {
int phaseangle=10;
duty=percent;
// force triac off at startup since we do not know the pulse state
if (duty==0) {
OUTPUT_LOW(GATE);
}
if (input(PORT_zero)) {
// Here since the input is low,
// we now need to look for a low to high transition
ext_int_edge( L_TO_H );
OUTPUT_LOW(GATE);
delay_us(phaseangle);
OUTPUT_HIGH(GATE);
delay_us(duty);
OUTPUT_LOW(GATE);
}
// else {
// Here since the input is high,
// we need to next look for the high to low transition
// ext_int_edge( H_TO_L);
// OUTPUT_LOW(GATE);
// delay_us(phaseangle);
// OUTPUT_HIGH(GATE);
// delay_us(duty);
// OUTPUT_LOW(GATE);
// }
}
void main(void) {
set_tris_a( 0b00000001 );
set_tris_b( 0b00000001 );
// Setup the ADC so we can read a value from 0 to 1022
// as we turn a trimpot which is connected to pin A0.
// setup_comparator(NC_NC_NC_NC);
setup_adc_ports(PORT_adc);
setup_adc(ADC_CLOCK_DIV_32); // Divisor for 20 MHz oscillator
set_adc_channel(0);
delay_us(15);
lcd_init(); //LCD start
lcd_putc("\f"); // Clear the LCD
delay_ms(100);
lcd_gotoxy(1,1); //Goto first line
printf(lcd_putc, "Intensity");
// Set _one_ active edge.
// Set it to the next change that can occur
if (input(PORT_zero)) ext_int_edge( H_TO_L );
else ext_int_edge(L_TO_H);
clear_interrupt(INT_EXT);
enable_interrupts(int_ext);
enable_interrupts(global);
//Must ensure code does not exit.
while (true) {
intensity = read_adc(); // Read speed set value from the ADC
percent = intensity/div ;
lcd_gotoxy(1,2); //Goto second line
printf(lcd_putc, "%lu ", duty); //Show intensity for test perpose
}
}