dyncode_mips.h
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:4k
源码类别:

Windows CE

开发平台:

C/C++

  1. /*****************************************************************************
  2.  *
  3.  * This program is free software ; you can redistribute it and/or modify
  4.  * it under the terms of the GNU General Public License as published by
  5.  * the Free Software Foundation; either version 2 of the License, or
  6.  * (at your option) any later version.
  7.  *
  8.  * This program is distributed in the hope that it will be useful,
  9.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11.  * GNU General Public License for more details.
  12.  *
  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  16.  *
  17.  * $Id: dyncode_mips.h 341 2005-11-16 00:15:54Z picard $
  18.  *
  19.  * The Core Pocket Media Player
  20.  * Copyright (c) 2004-2005 Gabor Kovacs
  21.  *
  22.  ****************************************************************************/
  23. #ifndef __DYNCODE_MIPS_H
  24. #define __DYNCODE_MIPS_H
  25. #ifdef MIPS
  26. #define DYNCODE
  27. //R0 zero
  28. //R1 at
  29. //R2-R3 v0-v1 result
  30. //R4-R7 a0-a3 argument
  31. //R8-R15,R24,R25 t0-t9 temporary (not preserved)
  32. //R16-R23,R30 s0-s8 saved 
  33. //R26-R27 k0-k1 kernel
  34. //R28 gp global pointer
  35. //R29 sp stack pointer
  36. //R31 ra return address
  37. #define ZERO 0
  38. #define R1 1
  39. #define R2 2
  40. #define R3 3
  41. #define R4 4
  42. #define R5 5
  43. #define R6 6
  44. #define R7 7
  45. #define R8 8
  46. #define R9 9
  47. #define R10 10
  48. #define R11 11
  49. #define R12 12
  50. #define R13 13
  51. #define R14 14
  52. #define R15 15
  53. #define R16 16
  54. #define R17 17
  55. #define R18 18
  56. #define R19 19
  57. #define R20 20
  58. #define R21 21
  59. #define R22 22
  60. #define R23 23
  61. #define R24 24
  62. #define R25 25
  63. #define K0 26
  64. #define K1 27
  65. #define R28 28
  66. #define SP 29
  67. #define R30 30
  68. #define R31 31
  69. #define GP 28
  70. #define RA 31
  71. #define ADDIU 0x24000200
  72. #define ADDU 0x00000121
  73. #define AND  0x00000124
  74. #define ANDI  0x30000200
  75. #define BEQ 0x10000000 
  76. #define BEQL 0x50000000
  77. #define BGEZ 0x04010300
  78. #define BGEZAL 0x04110300
  79. #define BGEZALL 0x04130300
  80. #define BGEZL 0x04030300
  81. #define BGTZ 0x1C000300
  82. #define BGTZL 0x5C000300
  83. #define BLEZ 0x18000300
  84. #define BLEZL 0x58000300
  85. #define BLTZ 0x04000300
  86. #define BLTZAL 0x04100300
  87. #define BLTZALL 0x04120300
  88. #define BLTZL   0x04020300
  89. #define BNE 0x14000000
  90. #define BNEL 0x54000000
  91. #define DADDIU  0x64000200
  92. #define DADDU   0x0000012D
  93. #define DDIV 0x0000041E
  94. #define DDIVU 0x0000041F
  95. #define DIV 0x0000041A
  96. #define DIVU 0x0000041B
  97. #define DMULT 0x0000041C
  98. #define DMULTU 0x0000041D
  99. #define DSLL 0x00000538
  100. #define DSLL32 0x0000053C
  101. #define DSLLV 0x00000614
  102. #define DSRA 0x0000053B
  103. #define DSRA32 0x0000053F
  104. #define DSRAV 0x00000617
  105. #define DSRL 0x0000053A
  106. #define DSRL32 0x0000053E
  107. #define DSRLV 0x00000616
  108. #define DSUBU 0x0000012F
  109. #define JALR 0x00000809
  110. #define JR 0x00000908
  111. #define LB 0x80000200
  112. #define LBU 0x90000200
  113. #define LD 0xDC000200
  114. #define LDL 0x68000200
  115. #define LDR 0x6C000200
  116. #define LH 0x84000200
  117. #define LHU 0x94000200
  118. #define LUI 0x3C000A00
  119. #define LW 0x8C000200
  120. #define LWL 0x88000200
  121. #define LWR 0x98000200
  122. #define LWU 0x9C000200
  123. #define MFHI 0x00000B10
  124. #define MFLO 0x00000B12
  125. #define MTHI 0x00000B11
  126. #define MTLO 0x00000B13
  127. #define MULT 0x00000418
  128. #define MULTU 0x00000419
  129. #define NOR 0x00000127
  130. #define OR 0x00000125
  131. #define ORI 0x34000200
  132. #define SB 0xA0000C00
  133. #define SD 0xFC000C00
  134. #define SDL 0xB0000C00
  135. #define SDR 0xB4000C00
  136. #define SH 0xA4000C00
  137. #define SLL 0x00000500
  138. #define SLLV 0x00000604
  139. #define SLT 0x0000012A
  140. #define SLTI 0x28000200
  141. #define SLTIU 0x2C000200
  142. #define SLTU 0x0000012B
  143. #define SRA 0x00000503
  144. #define SRAV 0x00000607
  145. #define SRL 0x00000502
  146. #define SRLV 0x00000606
  147. #define SUBU 0x00000123
  148. #define SW 0xAC000C00
  149. #define SWL 0xA8000C00
  150. #define SWR 0xB8000C00
  151. #define XOR 0x00000126
  152. #define XORI 0x38000200
  153. void I1(int, reg Reg);
  154. void I1C(int, reg Reg, int Const);
  155. void I2(int, reg Dest, reg Op1);
  156. void I2C(int, reg Dest, reg Op1, int Const);
  157. void I3(int, reg Dest, reg Op1, reg Op2);
  158. void I1P(int, reg Reg, dyninst* Block, int Ofs);
  159. void I2P(int, reg Op1, reg Op2, dyninst*);
  160. void IConst(reg, int Value);
  161. reg IMul(reg Op1, int Mul, reg Tmp1, reg Tmp2, reg Tmp3, bool_t* Neg);
  162. void NOP();
  163. void Break();
  164. void CodeBegin(int Save,int Local,bool_t Align64);
  165. void CodeEnd(int Save,int Local,bool_t Align64);
  166. #endif
  167. #endif