home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / utility / unittool / turbo5 / intrfac5 / intrfc.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-12-13  |  2.6 KB  |  94 lines

  1. program intrfc;
  2. {  Prints out the information contained in a TPU file  }
  3.  
  4. uses
  5.   util,globals,objstuff,test1,hash,dump;
  6.  
  7. procedure dump_header;
  8. var
  9.   i:integer;
  10. begin
  11.   with header^ do
  12.   begin
  13.     writeln('file_id:',^I,file_id);
  14.     writeln('i4:',^I,i4);
  15.     writeln('i6:',^I,i6);
  16.     writeln('ofs_this_unit:',^I,ofs_this_unit);
  17.     writeln('ofs_hashtable:',^I,ofs_hashtable);
  18.     writeln('ofs_3:',^I,ofs_3);
  19.     dumpbytes(add_offset(buffer,ofs_3)^,minw(ofs_storage_req-ofs_3,20));
  20.     writeln('ofs_storage_req:',^I,ofs_storage_req);
  21.     dumpbytes(add_offset(buffer,ofs_storage_req)^,minw(ofs_5-ofs_storage_req,20));
  22.     writeln('ofs_5:',^I,ofs_5);
  23.     writeln('ofs_6:',^I,ofs_6);
  24.     writeln('ofs_src_name:',^I,ofs_src_name);
  25.     writeln('ofs_line_nums:',^I,ofs_line_nums);
  26.     writeln('sym_size:',^I,sym_size);
  27.     writeln('code_size:',^I,code_size);
  28.     writeln('reloc_size:',^I,reloc_size);
  29.     writeln('const_size:',^I,const_size);
  30.     writeln('var_size:',^I,var_size);
  31.     writeln('ofs_localhash:',^I,ofs_localhash);
  32.     writeln('float_flag:',^I,float_flag);
  33.  
  34.     for i := $26 div 2 to $3f div 2 do
  35.       writeln('word ',i,':',^I,other[i]);
  36.   end;
  37. end;
  38.  
  39. var
  40.   i,j,t:word;
  41.   result : word;
  42.   this_unit : obj_ptr;
  43.  
  44. begin
  45.   writeln('INTRFC version 1.1.  Written by D.J. Murdoch.');
  46.   writeln('Hit break when done.');
  47.   if paramcount > 0 then
  48.     uses_path := paramstr(1)
  49.   else
  50.     uses_path := '.\';
  51.  
  52.   if uses_path[length(uses_path)] <> '\' then
  53.     uses_path := uses_path + '\';
  54.  
  55.   tpl_size := read_file('turbo.tpl',pointer(tpl_buffer));
  56.   if tpl_buffer = nil then
  57.     tpl_size := read_file(uses_path+'turbo.tpl',pointer(tpl_buffer));
  58.   if tpl_buffer <> nil then
  59.     got_tpl := true
  60.   else
  61.   begin
  62.     got_tpl := false;
  63.     writeln('Warning:  TURBO.TPL not found.');
  64.   end;
  65.  
  66.   repeat
  67.     mark(just_tpl);
  68.     repeat
  69.       write('Enter filename (without .TPU): ');
  70.       readln(unitname);
  71.       unit_size := read_file(unitname+'.tpu',pointer(buffer));
  72.     until buffer <> nil;
  73.  
  74.     header := pointer(buffer);
  75.     dump_header;
  76.  
  77.     {  Record this unit in the unit list  }
  78.     fillchar(unit_list,sizeof(unit_list),0);
  79.     this_unit := add_offset(buffer,header^.ofs_this_unit);
  80.     add_unit(this_unit,add_offset(this_unit,3+length(this_unit^.name)));
  81.  
  82. {    hash_table := add_offset(buffer,header^.ofs_localhash); }
  83.     hash_table := add_offset(buffer,header^.ofs_hashtable);
  84.  
  85.     {Build main object list}
  86.  
  87.     build_list(obj_list,buffer,hash_table);
  88.  
  89.     { Now print it }
  90.     in_function := false;
  91.     print_obj_list;
  92.     release(just_tpl);
  93.   until false;
  94. end.