google is your friend
search adc 8051 "C code"
The MCU module is to new here, and most write outside of MCU using tools like Keil or Metalink since those are the gears of the embedded industry.
You can still plug your source into MCU and it will simulate but I'd use and intellisense editor package to ensure 100% code functionality before a simulation dev