armv7l_defs.M1 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ## Copyright (C) 2016 Jeremiah Orians
  2. ## This file is part of stage0.
  3. ##
  4. ## stage0 is free software: you can redistribute it and/or modify
  5. ## it under the terms of the GNU General Public License as published by
  6. ## the Free Software Foundation, either version 3 of the License, or
  7. ## (at your option) any later version.
  8. ##
  9. ## stage0 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. ##
  14. ## You should have received a copy of the GNU General Public License
  15. ## along with stage0. If not, see <http://www.gnu.org/licenses/>.
  16. # M2-Planet standards
  17. DEFINE NULL 00000000
  18. # Registers
  19. DEFINE R0 0
  20. DEFINE R1 1
  21. DEFINE R2 2
  22. DEFINE R3 3
  23. DEFINE R4 4
  24. DEFINE R5 5
  25. DEFINE R6 6
  26. DEFINE R7 7
  27. DEFINE R8 8
  28. DEFINE R9 9
  29. DEFINE R10 A
  30. DEFINE R11 B
  31. DEFINE R12 C
  32. DEFINE BP C
  33. DEFINE R13 D
  34. DEFINE SP D
  35. DEFINE R14 E
  36. DEFINE LR E
  37. DEFINE R15 F
  38. DEFINE PC F
  39. # Register masks for push/pop16
  40. DEFINE {R0} 0100
  41. DEFINE {R1} 0200
  42. DEFINE {R2} 0400
  43. DEFINE {R3} 0800
  44. DEFINE {R4} 1000
  45. DEFINE {R11} 0008
  46. DEFINE {BP} 0010
  47. DEFINE {LR} 0040
  48. # Bitshift constants
  49. DEFINE NO_SHIFT 0
  50. DEFINE LEFT 1
  51. DEFINE RIGHT 3
  52. DEFINE ARITH_RIGHT 5
  53. # LOAD/STORE
  54. DEFINE HALF_MEMORY E1
  55. DEFINE MEMORY E5
  56. DEFINE NO_OFFSET B0
  57. DEFINE STORE32 08
  58. DEFINE STORE16 0C
  59. DEFINE STORE8 0C
  60. DEFINE LOAD32 09
  61. DEFINE LOADU8 0
  62. DEFINE LOADS8 D0
  63. DEFINE LOADS16 F0
  64. DEFINE LOAD 0D
  65. DEFINE LOADI8_ALWAYS 0A0E3
  66. DEFINE LOADI8_G 0A0C3
  67. DEFINE LOADI8_GE 0A0A3
  68. DEFINE LOADI8_EQUAL 0A003
  69. DEFINE LOADI8_NE 0A013
  70. DEFINE LOADI8_LE 0A0D3
  71. DEFINE LOADI8_L 0A0B3
  72. DEFINE LOADI8_HI 0A083
  73. DEFINE LOADI8_HS 0A023
  74. DEFINE LOADI8_LS 0A093
  75. DEFINE LOADI8_LO 0A033
  76. # JUMP/BRANCH
  77. DEFINE JUMP_ALWAYS EA
  78. DEFINE JUMP_EQUAL 0A
  79. DEFINE JUMP_NE 1A
  80. DEFINE CALL_ALWAYS EB
  81. DEFINE CALL_REG_ALWAYS FF2FE1
  82. DEFINE RETURN FF2FE1
  83. # Data movement
  84. DEFINE MOVE_ALWAYS A0E1
  85. DEFINE MVN_ALWAYS 0E0E1
  86. DEFINE MVN_LT 0E0B1
  87. DEFINE MVNI8_EQUAL 0E003
  88. DEFINE PUSH_ALWAYS 2DE9
  89. DEFINE POP_ALWAYS BDE8
  90. # Arithmetic/logic
  91. DEFINE AUX_ALWAYS E1
  92. DEFINE IMM_ALWAYS E3
  93. DEFINE ARITH_ALWAYS E2
  94. DEFINE ARITH_GE A2
  95. DEFINE ARITH_LT B2
  96. DEFINE ARITH_NE 12
  97. DEFINE ARITH2_ALWAYS E0
  98. DEFINE ARITH2_GE A0
  99. DEFINE ADC 0A
  100. DEFINE ADCS 0B
  101. DEFINE ADD 08
  102. DEFINE ADDS 09
  103. DEFINE AND 00
  104. DEFINE CMP 005
  105. DEFINE CMPI8 005
  106. DEFINE MUL 0
  107. DEFINE MULS 1
  108. DEFINE OR 08
  109. DEFINE SHIFT A0
  110. DEFINE SUB 04
  111. DEFINE RSUB 06
  112. DEFINE XOR 02
  113. # SYSCALL
  114. DEFINE SYSCALL_ALWAYS 000000EF