123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- {
- Copyright (c) 2015 by Nikolay Nikolov
- Contains the binary Relocatable Object Module Format (OMF) reader and writer
- This is the object format used on the i8086-msdos platform.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- ****************************************************************************
- }
- unit ogomf;
- {$i fpcdefs.inc}
- interface
- uses
- { common }
- cclasses,globtype,
- { target }
- systems,
- { assembler }
- cpuinfo,cpubase,aasmbase,assemble,link,
- { OMF definitions }
- omfbase,
- { output }
- ogbase,
- owbase;
- type
- TOmfObjData = class(TObjData)
- public
- function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
- procedure writeReloc(Data:aint;len:aword;p:TObjSymbol;Reloctype:TObjRelocationType);override;
- end;
- TOmfObjOutput = class(tObjOutput)
- protected
- function writeData(Data:TObjData):boolean;override;
- public
- constructor create(AWriter:TObjectWriter);override;
- end;
- TOmfAssembler = class(tinternalassembler)
- constructor create(smart:boolean);override;
- end;
- implementation
- uses
- SysUtils,
- cutils,verbose,globals,
- fmodule,aasmtai,aasmdata,
- ogmap,
- version
- ;
- {****************************************************************************
- TOmfObjData
- ****************************************************************************}
- function TOmfObjData.sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;
- begin
- result:=aname;
- end;
- procedure TOmfObjData.writeReloc(Data:aint;len:aword;p:TObjSymbol;Reloctype:TObjRelocationType);
- begin
- end;
- {****************************************************************************
- TOmfObjOutput
- ****************************************************************************}
- function TOmfObjOutput.writeData(Data:TObjData):boolean;
- begin
- result:=true;
- end;
- constructor TOmfObjOutput.create(AWriter:TObjectWriter);
- begin
- inherited create(AWriter);
- cobjdata:=TOmfObjData;
- end;
- {****************************************************************************
- TOmfAssembler
- ****************************************************************************}
- constructor TOmfAssembler.Create(smart:boolean);
- begin
- inherited Create(smart);
- CObjOutput:=TOmfObjOutput;
- end;
- {*****************************************************************************
- Initialize
- *****************************************************************************}
- {$ifdef i8086}
- const
- as_i8086_omf_info : tasminfo =
- (
- id : as_i8086_omf;
- idtxt : 'OMF';
- asmbin : '';
- asmcmd : '';
- supported_targets : [system_i8086_msdos];
- flags : [af_outputbinary,af_needar,af_no_debug];
- labelprefix : '..@';
- comment : '; ';
- dollarsign: '$';
- );
- {$endif i8086}
- initialization
- {$ifdef i8086}
- RegisterAssembler(as_i8086_omf_info,TOmfAssembler);
- {$endif i8086}
- end.
|