Портал освітньо-інформаційних послуг «Студентська консультація»

  
Телефон +3 8(066) 185-39-18
Телефон +3 8(093) 202-63-01
 (093) 202-63-01
 studscon@gmail.com
 facebook.com/studcons

<script>

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

 

  ga('create', 'UA-53007750-1', 'auto');

  ga('send', 'pageview');

 

</script>

Дизасемблювання TPU, TPP, TPW модулів, написаних на Паскалі

Тип роботи: 
Курсова робота
К-сть сторінок: 
82
Мова: 
Українська
Оцінка: 

= record

    w1 : word;
    flags : entry_flags;
    b1 : byte;
    code_block, offset : word;
  end;
 
  block_ptr = ^block_rec;
  block_rec = record
    w1,size : word;
    relocbytes,owner : word;
  end;
 
  const_block_ptr = ^const_block_rec;
  const_block_rec = record
    w1,size : word;
    relocbytes,obj_ofs : word;
  end;
 
  vmt_block_ptr = ^vmt_block_rec;
  vmt_block_rec = record
    unitnum,rtype : byte;
    entrynum,w3,vmt_ofs : word;
  end;
 
  unit_block60_ptr = ^unit_block60_rec;
  unit_block60_rec = record
    w1 : word;
    name : string;
  end;
 
  unit_block_ptr = ^unit_block_rec;
  unit_block_rec = record
    w1 : word;
{$IFNDEF UNIT60}
    refcount : word;
{$ENDIF}
    name : string;
  end;
 
  dll_block_ptr = ^dll_block_rec;
  dll_block_rec = record
    w1,w2 : word;
    name : string;
  end;
{reloc->}
type
  reloc_ptr = ^reloc_rec;
  reloc_rec = record
    unit_num,            { offset to unit in unit block }
    rtype : byte;
    rblock,roffset,offset : word;
  end;
 
  type
  src_file_ptr = ^src_file_rec;
  src_file_rec = record
    filetype : byte;
    w1 : word;
    packed_date : longint;
    filename : string;
  end;
 
  src_line_ptr = ^src_line_rec;
  src_line_rec = record
    owner_ofs,
    src_ofs,
{$IFNDEF UNIT60}
    header_line,
{$ENDIF}
    entry,startline,numlines : word;
  end;
 
  src_lines_count_ptr = ^src_lines_count_rec;
  src_lines_count_rec = record
    w0,w1,
    count:word;
  end;
 
   browser_ptr = ^browser_rec;
   browser_rec = record
     ofs,
     line:word;
   end;
 
 
const
  code_seg  = 0;
  code_data = 1;
  var_seg   = 2;
  const_seg = 3;
{<-reloc}
var
  last_kind : byte;
  in_function : boolean;
  NowEnum: type_def_ptr;
 
procedure print_entries;
procedure print_code_blocks;
procedure print_const_blocks;
procedure print_var_blocks;
procedure print_dll_blocks;
procedure print_unit_blocks;
function unit_name(ofs:word):string;
function dll_name(ofs:word):string;
 
procedure write_code_block_name(in_unit:unit_list_ptr;blocknum:word);
procedure write_const_block_name(info_ofs : word);
{->blocks}
 
procedure print_name_list(obj_list:list_ptr);
procedure print_obj(obj:obj_ptr);
procedure write_type_info(var name:string; obj:obj_ptr; info:type_info_ptr);
function find_type(unit_rec:unit_list_ptr;def_ofs:word):obj_ptr;
function find_type_or_proc(unit_rec:unit_list_ptr;def_ofs:word):obj_ptr;
function find_proc_with_entry(in_unit:unit_list_ptr;entry:word):string;
procedure write_var_type(type_unit,type_def_ofs:word);
procedure write_var_info(var name:string; info:var_info_ptr);
procedure write_enum_const(type_obj:type_def_ptr;val:longint);
procedure write_const_type(var Val;type_unit,type_def_ofs:word;buffer:pointer);
procedure write_args(arg:arg_ptr; num_args:word);
procedure write_proc_type(var name:string; flags:code_flags; info:func_type_ptr);
procedure write_proc_info(var name:string; info:func_info_ptr);
procedure write_const_info(var name:string; info:const_info_ptr);
procedure write_system_type(var name:string; kind:byte; info:system_info_ptr);
procedure write_general(kind:byte; title,name,suffix:string);
function find_name(unit_rec:unit_list_ptr;info_ofs:word):string;
{  Unreliable way to get a name from a pointer to its info }
{reloc->}
procedure print_reloc(seg:byte);
procedure write_reloc_type(rtype:byte);
{srcfiles->}
procedure print_src_files;
procedure print_src_lines;
procedure print_browser;
 
implementation
 
uses objects;
 
const
  semicrlf = ';'+^M+^J;
 
 
function obj_ofs(obj:pointer):word;
begin
  obj_ofs := ptr_diff(obj,buffer);
end;
 
function get_buffer(obj:pointer):pointer;
begin
  get_buffer := ptr(seg(obj^),0);
end;
 
{$IFDEF UNIT60}
procedure write_type_def(def:type_def_ptr);far;
var
  i : integer;
  l : longint;
  save_kind : byte;
  field_list : list_ptr;
  current : list_ptr;
  obj : obj_ptr;
  no_name : string;
  save_in_array : boolean;
begin
  with def^ do
  begin
    if base_type in [1,2,4,6,8,$a,$e,$f,$10,$11,$12,$13,$15,$18,$19,$1a,$1b,
                     $21,$22,$23] then
      case base_type of
        1 : write('untyped');
        2 : write('shortint');
        4 : write('integer');
        6 : write('longint');
        8 : write('byte');
       $a : write('word');
       $e : write('single');
       $f : write('double');
      $10 : write('extended');
      $11 : write('real');
      $12 : write('boolean');
      $13 : write('char');
      $15 : write('comp');
      $18 :
Фото Капча