I want to use a PIC16F877A (I have a boot loader on it) to control the speed of an electric motor. I also want to use the PIC for a few other things not related to this problem so I want to program it in assembly for better programming control (and for the fun of it). Motor speed will be controlled using a potentiometer as input in a voltage divider. The voltage will be measured using one of the analog pins on the PIC (I don't care which one). The measured voltage will used to set the value of a PWM signal that will go to an H-bridge.
My circuit is pretty much already built but I've lost my notes from mechatronics class years ago. How can I program the PIC16F877A in assembly code to measure voltage at one of the analog pins and output a PWM signal to an H-bridge?