adding encode (as addReg) and decode (as decodeReg) on Cbcinterface