home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / drcpas10.zip / ABSTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1992-11-17  |  786b  |  41 lines

  1. {$A+,B-,D-,E-,F-,I+,L-,N-,O-,R-,S+,V-}
  2. {$M 16384,0,0}
  3. program abstest;
  4.  
  5. (* example of absio.pas: read a sector and display it in hexadecimal *)
  6.  
  7. uses absio, tools;
  8.  
  9. type
  10.   sector = array[1..512] of byte;
  11.  
  12. var
  13.   s : sector;
  14.   i,j,k : integer;
  15.  
  16. begin
  17.   absread (2, 1, 1, s);
  18.   if abserror <> 0 then
  19.     begin
  20.       writeln ('Error ',hexw(abserror),': reading absolute disk sector.');
  21.       halt (1);
  22.     end;
  23.   for i := 0 to 20 do
  24.     begin
  25.       for j := 0 to 5 do
  26.         begin
  27.           for k := 1 to 4 do
  28.             write (hexb(s[i*24+j*4+k]));
  29.           write (' ');
  30.         end;
  31.       writeln;
  32.     end;
  33.   for j := 0 to 1 do
  34.     begin
  35.       for k := 1 to 4 do
  36.         write (hexb(s[21*24+j*4+k]));
  37.       write (' ');
  38.     end;
  39.   writeln;
  40. end.
  41.