have a look at 8052.com. you will get lots of codes
Added after 2 minutes:
You also can get keil demo cross compiler from keil.com where you will be able to write embedded c and also can try UMPS where you will be able to write assembly language and debug it