Function InByte: byte;
Begin
  If BytePtr>127 then
    Begin BlockRead (RelFile,Buffer,1); BytePtr :=0 End;
  InByte := Buffer[BytePtr]; BytePtr := Succ(BytePtr);
End;

Function GetBits (NBits: Bits): byte;
Begin
  WB.High :=0;
  if BitCnt<NBits then
  Begin WW := WW shl BitCnt; NBits := NBits - BitCnt;
        WB.Low := InByte; BitCnt := 8 End;
  WW := WW shl NBits; BitCnt := BitCnt - NBits;
  GetBits := WB.High
End;

Function GetByte: byte;
Begin
  If BitCnt=0 then GetByte := InByte else GetByte := GetBits(8)
End;

Function GetWord: integer;
  Var WB: ByteRec; WW: integer absolute WB;
Begin
  with WB do Begin Low := GetByte; High := GetByte End;
  GetWord := WW
End;

