cpubase.inc 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {
  2. Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
  3. Contains the basic declarations for the i386 architecture
  4. This program 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 2 of the License, or
  7. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. { This include file contains the basic declarations for the i386 architecture.
  18. }
  19. {*****************************************************************************
  20. Operand Sizes
  21. *****************************************************************************}
  22. type
  23. topsize = (S_NO,
  24. S_B,S_W,S_L,S_Q,S_BW,S_BL,S_WL,
  25. S_IS,S_IL,S_IQ,
  26. S_FS,S_FL,S_FX,S_FV,S_FXX,
  27. S_MD,
  28. S_NEAR,S_FAR,S_SHORT,
  29. S_T,
  30. S_XMM
  31. );
  32. {*****************************************************************************
  33. Registers
  34. *****************************************************************************}
  35. const
  36. {# Standard opcode string table (for each tasmop enumeration). The
  37. opcode strings should conform to the names as defined by the
  38. processor manufacturer.
  39. }
  40. std_op2str:op2strtable={$i i386int.inc}
  41. {*****************************************************************************
  42. GDB Information
  43. *****************************************************************************}
  44. {# Register indexes for stabs information, when some
  45. parameters or variables are stored in registers.
  46. Taken from i386.c (dbx_register_map) and i386.h
  47. (FIXED_REGISTERS) from GCC 3.x source code
  48. }
  49. reg_stab_table : array[tregisterindex] of shortint = (
  50. {$i r386stab.inc}
  51. );
  52. {*****************************************************************************
  53. Default generic sizes
  54. *****************************************************************************}
  55. {# Defines the default address size for a processor, }
  56. OS_ADDR = OS_32;
  57. {# the natural int size for a processor, }
  58. OS_INT = OS_32;
  59. OS_SINT = OS_S32;
  60. {# the maximum float size for a processor, }
  61. OS_FLOAT = OS_F80;
  62. {# the size of a vector register for a processor }
  63. OS_VECTOR = OS_M128;
  64. {*****************************************************************************
  65. Generic Register names
  66. *****************************************************************************}
  67. {# Stack pointer register }
  68. NR_STACK_POINTER_REG = NR_ESP;
  69. RS_STACK_POINTER_REG = RS_ESP;
  70. {# Frame pointer register }
  71. RS_FRAME_POINTER_REG = RS_EBP;
  72. NR_FRAME_POINTER_REG = NR_EBP;
  73. { Return address for DWARF }
  74. NR_RETURN_ADDRESS_REG = NR_EIP;
  75. {# Register for addressing absolute data in a position independant way,
  76. such as in PIC code. The exact meaning is ABI specific. For
  77. further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
  78. }
  79. NR_PIC_OFFSET_REG = NR_EBX;
  80. { Results are returned in this register (32-bit values) }
  81. NR_FUNCTION_RETURN_REG = NR_EAX;
  82. RS_FUNCTION_RETURN_REG = RS_EAX;
  83. { Low part of 64bit return value }
  84. NR_FUNCTION_RETURN64_LOW_REG = NR_EAX;
  85. RS_FUNCTION_RETURN64_LOW_REG = RS_EAX;
  86. { High part of 64bit return value }
  87. NR_FUNCTION_RETURN64_HIGH_REG = NR_EDX;
  88. RS_FUNCTION_RETURN64_HIGH_REG = RS_EDX;
  89. { The value returned from a function is available in this register }
  90. NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
  91. RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
  92. { The lowh part of 64bit value returned from a function }
  93. NR_FUNCTION_RESULT64_LOW_REG = NR_FUNCTION_RETURN64_LOW_REG;
  94. RS_FUNCTION_RESULT64_LOW_REG = RS_FUNCTION_RETURN64_LOW_REG;
  95. { The high part of 64bit value returned from a function }
  96. NR_FUNCTION_RESULT64_HIGH_REG = NR_FUNCTION_RETURN64_HIGH_REG;
  97. RS_FUNCTION_RESULT64_HIGH_REG = RS_FUNCTION_RETURN64_HIGH_REG;
  98. { WARNING: don't change to R_ST0!! See comments above implementation of }
  99. { a_loadfpu* methods in rgcpu (JM) }
  100. NR_fpu_result_reg = NR_ST;
  101. NR_mm_result_reg = NR_MM0;
  102. { Offset where the parent framepointer is pushed }
  103. PARENT_FRAMEPOINTER_OFFSET = 8;
  104. {*****************************************************************************
  105. GCC /ABI linking information
  106. *****************************************************************************}
  107. const
  108. {# Registers which must be saved when calling a routine declared as
  109. cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
  110. saved should be the ones as defined in the target ABI and / or GCC.
  111. This value can be deduced from the CALLED_USED_REGISTERS array in the
  112. GCC source.
  113. }
  114. saved_standard_registers : array[0..2] of tsuperregister = (RS_EBX,RS_ESI,RS_EDI);
  115. saved_mm_registers : array[0..0] of tsuperregister = (RS_INVALID);
  116. {# Required parameter alignment when calling a routine declared as
  117. stdcall and cdecl. The alignment value should be the one defined
  118. by GCC or the target ABI.
  119. The value of this constant is equal to the constant
  120. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  121. }
  122. std_param_align = 4;