A nice encoder and decoder implemented in PBP (SIRC protocol).
http://www.rentron.com/PicBasic/IR_Chips.htm