ogrel.pas 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {
  2. Copyright (c) 2020 by Nikolay Nikolov
  3. Contains the ASCII relocatable object file format (*.rel) reader and writer
  4. This is the object format used on the Z80 platforms.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit ogrel;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. { common }
  23. cclasses,globtype,
  24. { target }
  25. systems,
  26. { assembler }
  27. cpuinfo,cpubase,aasmbase,assemble,link,
  28. { output }
  29. ogbase,
  30. owbase;
  31. type
  32. { TRelObjOutput }
  33. TRelObjOutput = class(tObjOutput)
  34. end;
  35. { TRelAssembler }
  36. TRelAssembler = class(tinternalassembler)
  37. constructor create(info: pasminfo; smart:boolean);override;
  38. end;
  39. implementation
  40. uses
  41. SysUtils,
  42. cutils,verbose,globals,
  43. fmodule,aasmtai,aasmdata,
  44. ogmap,
  45. version
  46. ;
  47. {*****************************************************************************
  48. TRelAssembler
  49. *****************************************************************************}
  50. constructor TRelAssembler.create(info: pasminfo; smart: boolean);
  51. begin
  52. inherited;
  53. CObjOutput:=TRelObjOutput;
  54. end;
  55. {*****************************************************************************
  56. Initialize
  57. *****************************************************************************}
  58. const
  59. as_z80_rel_info : tasminfo =
  60. (
  61. id : as_z80_rel;
  62. idtxt : 'REL';
  63. asmbin : '';
  64. asmcmd : '';
  65. supported_targets : [system_z80_embedded,system_z80_zxspectrum];
  66. flags : [af_outputbinary,af_smartlink_sections];
  67. labelprefix : '..@';
  68. labelmaxlen : -1;
  69. comment : '; ';
  70. dollarsign: '$';
  71. );
  72. initialization
  73. RegisterAssembler(as_z80_rel_info,TRelAssembler);
  74. end.