why is this code not working on 18F1320.any ideas!!!!

Define OSC 8
ADCON1 = 7

DUTY var WORD

P1A var PORTB.3 ' ECCP pin defines . Replace those with your actual device pins
P1B var PORTB.2
P1C var PORTB.6
P1D var PORTB.7
TMR2IF var PIR1.1 ' TMR2 interrupt flag



P1A=1 'Tristate
P1B=1 ' Tristate
P1C=1 ' Tristate
P1D=1 'Tristate
PR2 = 249 ' set PR2 to 249 , that is 1Khz PWM frequency
CCP1CON =0 ' PWM generator stopped
CCPR1L = 0 ' zero Duty Cycle
'CLEAR TMR2IF
TMR2IF=0



FORWARD:
DUTY=200
CCP1CON=0 ; stop the PWM generator
P1A=0 ' P1A = 1 ; P1A = active
P1B=1 ; P1B = tristate
P1C=1 ; P1C = tristate
P1D=0 ; P1D = PWM modulated
;------------------------
CCP1CON.4 = DUTY.0 ; here we stat loading the CCPR1
CCP1CON.5 = DUTY.1 ; with the value of DUTY Cycle parameter
CCPR1L = DUTY >> 2 ;
;-----------------------
CCP1CON = %01001100 ; set CCP1CON to full bridge , high output, Forward
T2CON = %00000101 ; start TMR2 , also TMR2 prescaler 1:4
WHILE TMR2IF = 0
WEND ; wait for a TMR2 period to expire
RETURN