home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / PMLINK.LBR / PMLINK.BIO < prev    next >
Text File  |  2000-06-30  |  768b  |  31 lines

  1. Function InByte: byte;
  2. Begin
  3.   If BytePtr>127 then
  4.     Begin BlockRead (RelFile,Buffer,1); BytePtr :=0 End;
  5.   InByte := Buffer[BytePtr]; BytePtr := Succ(BytePtr);
  6. End;
  7.  
  8. Function GetBits (NBits: Bits): byte;
  9. Begin
  10.   WB.High :=0;
  11.   if BitCnt<NBits then
  12.   Begin WW := WW shl BitCnt; NBits := NBits - BitCnt;
  13.         WB.Low := InByte; BitCnt := 8 End;
  14.   WW := WW shl NBits; BitCnt := BitCnt - NBits;
  15.   GetBits := WB.High
  16. End;
  17.  
  18. Function GetByte: byte;
  19. Begin
  20.   If BitCnt=0 then GetByte := InByte else GetByte := GetBits(8)
  21. End;
  22.  
  23. Function GetWord: integer;
  24.   Var WB: ByteRec; WW: integer absolute WB;
  25. Begin
  26.   with WB do Begin Low := GetByte; High := GetByte End;
  27.   GetWord := WW
  28. End;
  29. etByte: byte;
  30. Begin
  31.   If BitCnt=0 then GetByte := InByte els