ogrel.pas 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. protected
  35. function writeData(Data:TObjData):boolean;override;
  36. end;
  37. { TRelAssembler }
  38. TRelAssembler = class(tinternalassembler)
  39. constructor create(info: pasminfo; smart:boolean);override;
  40. end;
  41. implementation
  42. uses
  43. SysUtils,
  44. cutils,verbose,globals,
  45. fmodule,aasmtai,aasmdata,
  46. ogmap,
  47. version
  48. ;
  49. {*****************************************************************************
  50. TRelObjOutput
  51. *****************************************************************************}
  52. function TRelObjOutput.writeData(Data: TObjData): boolean;
  53. begin
  54. { todo: implement }
  55. result:=true;
  56. end;
  57. {*****************************************************************************
  58. TRelAssembler
  59. *****************************************************************************}
  60. constructor TRelAssembler.create(info: pasminfo; smart: boolean);
  61. begin
  62. inherited;
  63. CObjOutput:=TRelObjOutput;
  64. end;
  65. {*****************************************************************************
  66. Initialize
  67. *****************************************************************************}
  68. const
  69. as_z80_rel_info : tasminfo =
  70. (
  71. id : as_z80_rel;
  72. idtxt : 'REL';
  73. asmbin : '';
  74. asmcmd : '';
  75. supported_targets : [system_z80_embedded,system_z80_zxspectrum];
  76. flags : [af_outputbinary,af_smartlink_sections];
  77. labelprefix : '..@';
  78. labelmaxlen : -1;
  79. comment : '; ';
  80. dollarsign: '$';
  81. );
  82. initialization
  83. RegisterAssembler(as_z80_rel_info,TRelAssembler);
  84. end.