How to emulate a CD4021 Shift register ? (NES controller)

Hi i want to build a fully andruino controlled NES controller. To do that I need to emulate the behavior of a CD4021 shift register. The CD4021 shift register is an 8bit parallel in, serial out shift register.

to read the 8 bit i used "PIND" but how can i shift the bits out?