What type of compiler you have? You must have a samples in your compiler. If you need some info about C look for ANSI C books.Also you must read very carefully the processor data sheet.
When you have a real task, please write what is the difficult for you, and i believe that will have a many people that will help you.