itcpugas.pas 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit contains the m68k GAS instruction tables
  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 itcpugas;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cpubase,cgbase;
  23. const
  24. gas_op2str : op2strtable=
  25. { warning: CPU32 opcodes are not fully compatible with the MC68020. }
  26. { 68000 only opcodes }
  27. ('abcd',
  28. 'add','adda','addi','addq','addx','and','andi',
  29. 'asl','asr','bcc','bcs','beq','bge','bgt','bhi',
  30. 'ble','bls','blt','bmi','bne','bpl','bvc','bvs',
  31. 'bchg','bclr','bra','bset','bsr','btst','chk',
  32. 'clr','cmp','cmpa','cmpi','cmpm','dbcc','dbcs','dbeq','dbge',
  33. 'dbgt','dbhi','dble','dbls','dblt','dbmi','dbne','dbra',
  34. 'dbpl','dbt','dbvc','dbvs','dbf','divs','divu',
  35. 'eor','eori','exg','illegal','ext','jmp','jsr',
  36. 'lea','link','lsl','lsr','move','movea','movei','moveq',
  37. 'movem','movep','muls','mulu','nbcd','neg','negx',
  38. 'nop','not','or','ori','pea','rol','ror','roxl',
  39. 'roxr','rtr','rts','sbcd','scc','scs','seq','sge',
  40. 'sgt','shi','sle','sls','slt','smi','sne',
  41. 'spl','st','svc','svs','sf','sub','suba','subi','subq',
  42. 'subx','swap','tas','trap','trapv','tst','unlk',
  43. 'rte','reset','stop',
  44. { mc68010 instructions }
  45. 'bkpt','movec','moves','rtd',
  46. { mc68020 instructions }
  47. 'bfchg','bfclr','bfexts','bfextu','bfffo',
  48. 'bfins','bfset','bftst','callm','cas','cas2',
  49. 'chk2','cmp2','divsl','divul','extb','pack','rtm',
  50. 'trapcc','tracs','trapeq','trapf','trapge','trapgt',
  51. 'traphi','traple','trapls','traplt','trapmi','trapne',
  52. 'trappl','trapt','trapvc','trapvs','unpk',
  53. { fpu processor instructions - directly supported only. }
  54. { ieee aware and misc. condition codes not supported }
  55. 'fabs','fadd',
  56. 'fbeq','fbne','fbngt','fbgt','fbge','fbnge',
  57. 'fblt','fbnlt','fble','fbgl','fbngl','fbgle','fbngle',
  58. 'fdbeq','fdbne','fdbgt','fdbngt','fdbge','fdbnge',
  59. 'fdblt','fdbnlt','fdble','fdbgl','fdbngl','fdbgle','fdbngle',
  60. 'fseq','fsne','fsgt','fsngt','fsge','fsnge',
  61. 'fslt','fsnlt','fsle','fsgl','fsngl','fsgle','fsngle',
  62. 'fcmp','fdiv','fmove','fmovem',
  63. 'fmul','fneg','fnop','fsqrt','fsub','fsgldiv',
  64. 'fsflmul','ftst',
  65. 'ftrapeq','ftrapne','ftrapgt','ftrapngt','ftrapge','ftrapnge',
  66. 'ftraplt','ftrapnlt','ftraple','ftrapgl','ftrapngl','ftrapgle','ftrapngle',
  67. { protected instructions }
  68. 'cprestore','cpsave',
  69. { fpu unit protected instructions }
  70. { and 68030/68851 common mmu instructions }
  71. { (this may include 68040 mmu instructions) }
  72. 'frestore','fsave','pflush','pflusha','pload','pmove','ptest',
  73. { useful for assembly language output }
  74. 'label','none','db','s','b','fb');
  75. function gas_regnum_search(const s:string):Tregister;
  76. function gas_regname(r:Tregister):string;
  77. implementation
  78. const
  79. gas_reg2str : array[tregisterindex] of string[7] = (
  80. ('', '%d0','%d1','%d2','%d3','%d4','%d5','%d6','%d7',
  81. '%a0','%a1','%a2','%a3','%a4','%a5','%a6','%sp',
  82. '%ccr','%fp0','%fp1','%fp2','%fp3','%fp4','%fp5',
  83. '%fp6','%fp7','%fpcr','%sr','%ssp','%dfc',
  84. '%sfc','%vbr','%fpsr');
  85. function gas_regnum_search(const s:string):Tregister;
  86. begin
  87. result:=std_regnum_search(s);
  88. end;
  89. function gas_regname(r:Tregister):string;
  90. begin
  91. result:=std_regname(r);
  92. end;
  93. end.
  94. {
  95. $Log$
  96. Revision 1.1 2004-04-27 05:43:42 florian
  97. * initial revision
  98. }