Предмет:
Тип роботи:
Курсова робота
К-сть сторінок:
82
Мова:
Українська
<> 0 then
WriteError ('Unknown type '+hexbyte(rtype));
case ref_type(rtype) of
0 : write('Relative ');
1 : write('Offset ');
2 : write('Segment ');
3 : write('Pointer ');
else
WriteError('Unknown ref_type');
end;
case target_type(rtype) of
code_seg : write('Code ');
code_data : write('CS Const');
var_seg : write('Var ');
const_seg : write('DS Const');
else
WriteError('Unknown target_type');
end;
end;
{srcfiles->}
function tf(w:word):string; { Time format of a number }
var
result : string[3]; { Use length 3 in to show errors }
begin
str(w,result);
if length(result) = 1 then
tf := '0'+result
else
tf := result;
end;
procedure print_src_files;
const
monthname : array[1..12] of string[9] = ('January','February',
'March','April','May',
'June','July','August',
'September','October',
'November','December');
var
thisfile : src_file_ptr;
ofs : word;
dt : datetime;
begin
writeln;
writeln('Source File Records');
ofs := header^.ofs_src_name;
{$IFDEF UNIT60}
while ofs < header^.ofs_line_lengths do
{$ELSE}
while ofs < header^.ofs_line_count do
{$ENDIF}
begin
thisfile := add_only_offset(buffer,ofs);
with thisfile^ do
begin
case filetype of
3 : write('Includes ');
4 : write('Main src ');
5 : write('Links to ');
6 : write('Resource ');
else
WriteError('Unknown file type '+DecWord(filetype)+' ');
end;
write(filename);
if packed_date <> 0 then
begin
unpacktime(packed_date,dt);
with dt do
write(' ':(15-length(filename)),tf(hour),':',tf(min),':',tf(sec),' ',monthname[month],' ',day,', ',year);
end;
if w1 <> 0 then
WriteError(' unknown w1 = '+HexWord(w1));
writeln;
inc(ofs,sizeof(src_file_rec)-255+length(filename));
end;
end;
end;
procedure print_src_lines;
var
ofs : word;
line,i,codeofs : word;
thisrec : src_line_ptr;
obj : obj_ptr;
bytes_per_line : byte_array_ptr;
name : string;
src_file : src_file_ptr;
column : byte;
src_lines_count: src_lines_count_ptr;
begin
writeln;
{$IFNDEF UNIT60}
src_lines_count := add_only_offset(buffer,header^.ofs_line_count);
writeln('Total lines: ',src_lines_count^.Count);
if src_lines_count^.w0<>0 then
WriteError('Count lines w0<>0');
if src_lines_count^.w1<>0 then
WriteError('Count lines w1<>0');
writeln;
{$ENDIF}
writeln('Source Line Numbers');
column := 1;
ofs := header^.ofs_line_lengths;
if ofs = header^.sym_size then
writeln('(none)')
else
begin
writeln;
while ofs < header^.sym_size do
begin
thisrec := add_only_offset(buffer,ofs);
with thisrec^ do
begin
if owner_ofs <> 0 then
begin
obj := add_only_offset(buffer,owner_ofs);
name := obj^.name;
end
else
name := 'initialization code';
src_file := add_only_offset(buffer,header^.ofs_src_name+src_ofs);
if (owner_ofs=0) and (src_file^.filetype=3) then
writeln('Line number offsets in ',src_file^.filename)
else
writeln('Line number offsets for ',name,' in ',src_file^.filename);
bytes_per_line := add_only_offset(thisrec,sizeof(src_line_rec));
{$IFNDEF UNIT60}
write(header_line:6,':Head');
column := 1;
{$ELSE}
column := 0;
{$ENDIF}