Importing MODEND Object File Record
This procedure processes MODEND
object file record ($8A
) and updates statement code size symbol table.
Procedure OMF_MODEND; Far;
Var TempPtr: PtrRec;
StatementCodeSize, NumberOfSourceLines: Word;
begin
{$IFDEF DEBUGOMF}
Writeln (' MODEND');
{$ENDIF}
If SymbolTable [stSourceLineCodeOffsets].UsedSize <> LastBlock_stSourceLineCodeOffsets_Size then
begin
TempPtr.Ptr := IncreaseSymbolTable (stSourceLineCodeOffsets, 2);
StatementCodeSize := SymbolTable [stCode].UsedSize - LastProgramBlockCodeSize - Current_OMF_CodeSize;
If StatementCodeSize >= $80 then
begin
Byte (TempPtr.Ptr^) := Hi (StatementCodeSize) or $80;
Inc (PChar (TempPtr));
end;
Byte (TempPtr.Ptr^) := Lo (StatementCodeSize);
Inc (PChar (TempPtr));
SymbolTable [stSourceLineCodeOffsets].UsedSize := TempPtr.Ofs;
TempPtr.Ofs := LastBlock_stSourceLineCodeOffsets_Size + 8;
NumberOfSourceLines := Current_OMF_SourceLineNumber - Word (TempPtr.Ptr^) + 1;
Inc (TempPtr.Ofs, 2);
Word (TempPtr.Ptr^) := NumberOfSourceLines;
end;
Return := True;
end;