This is for a non-latching shift register which is fast enough for an LED display,
but for latching shift register like 74595 you only have to pull the latch pin at the end right before the return.
Code:
byte cnt’
byte buff’
byte send byte’ byte to send to port


shiftbyte:
for cnt = 0 TO 7
buff = sendbyte >> cnt;
SERCLK_PIN = 0;
SERDAT_PIN = buff.bit0;
SERCLK_PIN = 1;
NEXT cnt
return