;
;---------------------------pwm section-----------------------------------
;
pwmo movf pulsehi,w ;o/p high for pwm cycles
btfsc status,z
goto lows
;
movlw b'00000001'
iorwf portb,f
decf pulsehi,f
retlw d'0'
;
lows movf pulselo,w ;output low for pwm-128 cycles
btfsc status,z
goto reload
;
movlw b'11111110'
andwf portb,f
decf pulselo,f
retlw d'0'
;
reload movf pwm,w
movwf pulsehi ;tranfer desired pwm to pulsehi
movlw d'128'
movwf pulselo
movf pwm,w
subwf pulselo,f ;and put the opposite in pulselo
retlw d'0'