Init code for reading and writing SD card with MCS51?
SD cards can be accessed either using


the full 4 bit wide data bus, 
or via 
SPI (serial peripheral interface)


The latter one (SPI) has lower throughput but it is a very simple interface commonly used between micro controller and periherals ICs.

The simplified version of the physical layer of the SD card spec
gives you more detailed info: see download area of https://www.sdcard.org/

There is also an aplication note by TI that explains how to access SD cards via SPI using their MSP430 µC and might be very helpful even though you are using a different µC.