rearrange IDCODE readout code (done before reading input file)