asm-syntax.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* Definitions for 68k syntax variations.
  2. Copyright (C) 1992-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library. Its master source is NOT part of
  4. the C library, however. The master source lives in the GNU MP Library.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library 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 GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library. If not, see
  15. <http://www.gnu.org/licenses/>. */
  16. /* For ELF we need to prefix register names and local labels. */
  17. #define R_(r) %##r
  18. #define R(r) R_(r)
  19. #define L(label) .##label
  20. #ifdef MIT_SYNTAX
  21. #define MEM(base)R(base)@
  22. #define MEM_DISP(base,displacement)R(base)@(displacement)
  23. #define MEM_INDX(base,idx,size_suffix)R(base)@(R(idx):size_suffix)
  24. #define MEM_INDX1(base,idx,size_suffix,scale)R(base)@(R(idx):size_suffix:scale)
  25. #define MEM_PREDEC(memory_base)R(memory_base)@-
  26. #define MEM_POSTINC(memory_base)R(memory_base)@+
  27. #define TEXT .text
  28. /* Use variable sized opcodes. */
  29. #define bcc jcc
  30. #define bcs jcs
  31. #define bls jls
  32. #define beq jeq
  33. #define bne jne
  34. #define bra jra
  35. #endif
  36. #ifdef MOTOROLA_SYNTAX
  37. #define MEM(base)(R(base))
  38. #define MEM_DISP(base,displacement)(displacement,R(base))
  39. #define MEM_PREDEC(memory_base)-(R(memory_base))
  40. #define MEM_POSTINC(memory_base)(R(memory_base))+
  41. #define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix))
  42. #define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix)
  43. #define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale))
  44. #define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale)
  45. #define TEXT .text
  46. #define bcc jbcc
  47. #define bcs jbcs
  48. #define bls jbls
  49. #define beq jbeq
  50. #define bne jbne
  51. #define bra jbra
  52. #define movel move.l
  53. #define moveml movem.l
  54. #define moveql moveq.l
  55. #define cmpl cmp.l
  56. #define orl or.l
  57. #define clrl clr.l
  58. #define andw and.w
  59. #define eorw eor.w
  60. #define andl and.l
  61. #define lsrl lsr.l
  62. #define lsll lsl.l
  63. #define roxrl roxr.l
  64. #define roxll roxl.l
  65. #define addl add.l
  66. #define addxl addx.l
  67. #define addql addq.l
  68. #define subl sub.l
  69. #define subxl subx.l
  70. #define subqw subq.w
  71. #define subql subq.l
  72. #define negl neg.l
  73. #define mulul mulu.l
  74. #define tstw tst.w
  75. #define tstl tst.l
  76. #endif