cpubase.inc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. {
  2. Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
  3. Contains the basic declarations for the i8086 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 i8086 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. S_YMM
  32. );
  33. {*****************************************************************************
  34. Registers
  35. *****************************************************************************}
  36. const
  37. {# Standard opcode string table (for each tasmop enumeration). The
  38. opcode strings should conform to the names as defined by the
  39. processor manufacturer.
  40. }
  41. std_op2str:op2strtable={$i i8086int.inc}
  42. {*****************************************************************************
  43. GDB Information
  44. *****************************************************************************}
  45. {# Register indexes for stabs information, when some
  46. parameters or variables are stored in registers.
  47. Taken from i386.c (dbx_register_map) and i386.h
  48. (FIXED_REGISTERS) from GCC 3.x source code
  49. }
  50. reg_stab_table : array[tregisterindex] of shortint = (
  51. {$i r8086stab.inc}
  52. );
  53. {*****************************************************************************
  54. Default generic sizes
  55. *****************************************************************************}
  56. {# Defines the default address size for a processor, }
  57. OS_ADDR = OS_16;
  58. {# the natural int size for a processor,
  59. has to match osuinttype/ossinttype as initialized in psystem }
  60. OS_INT = OS_16;
  61. OS_SINT = OS_S16;
  62. {# the maximum float size for a processor, }
  63. OS_FLOAT = OS_F80;
  64. {# the size of a vector register for a processor }
  65. OS_VECTOR = OS_M128;
  66. {*****************************************************************************
  67. Generic Register names
  68. *****************************************************************************}
  69. {# Stack pointer register }
  70. NR_STACK_POINTER_REG = NR_SP;
  71. RS_STACK_POINTER_REG = RS_SP;
  72. {# Frame pointer register }
  73. RS_FRAME_POINTER_REG = RS_BP;
  74. NR_FRAME_POINTER_REG = NR_BP;
  75. { Return address for DWARF }
  76. NR_RETURN_ADDRESS_REG = NR_EIP;
  77. { Results are returned in this register (16-bit values) }
  78. NR_FUNCTION_RETURN_REG = NR_AX;
  79. RS_FUNCTION_RETURN_REG = RS_AX;
  80. { Low part of 32bit return value }
  81. NR_FUNCTION_RETURN32_LOW_REG = NR_AX;
  82. RS_FUNCTION_RETURN32_LOW_REG = RS_AX;
  83. { High part of 32bit return value }
  84. NR_FUNCTION_RETURN32_HIGH_REG = NR_DX;
  85. RS_FUNCTION_RETURN32_HIGH_REG = RS_DX;
  86. { Bits 0..15 of 64bit return value }
  87. NR_FUNCTION_RETURN64_LOW_REG = NR_DX;
  88. RS_FUNCTION_RETURN64_LOW_REG = RS_DX;
  89. { Bits 16..31 of 64bit return value }
  90. NR_FUNCTION_RETURN64_HIGH_REG = NR_CX;
  91. RS_FUNCTION_RETURN64_HIGH_REG = RS_CX;
  92. { Bits 32..47 of 64bit return value }
  93. NR_FUNCTION_RETURN64_HIGHER_REG = NR_BX;
  94. RS_FUNCTION_RETURN64_HIGHER_REG = RS_BX;
  95. { Bits 48..63 of 64bit return value }
  96. NR_FUNCTION_RETURN64_HIGHEST_REG = NR_AX;
  97. RS_FUNCTION_RETURN64_HIGHEST_REG = RS_AX;
  98. { The value returned from a function is available in this register }
  99. NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
  100. RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
  101. { The lowh part of 32bit value returned from a function }
  102. NR_FUNCTION_RESULT32_LOW_REG = NR_FUNCTION_RETURN32_LOW_REG;
  103. RS_FUNCTION_RESULT32_LOW_REG = RS_FUNCTION_RETURN32_LOW_REG;
  104. { The high part of 32bit value returned from a function }
  105. NR_FUNCTION_RESULT32_HIGH_REG = NR_FUNCTION_RETURN32_HIGH_REG;
  106. RS_FUNCTION_RESULT32_HIGH_REG = RS_FUNCTION_RETURN32_HIGH_REG;
  107. { Bits 0..15 of 64bit return value returned from a function }
  108. NR_FUNCTION_RESULT64_LOW_REG = NR_FUNCTION_RETURN64_LOW_REG;
  109. RS_FUNCTION_RESULT64_LOW_REG = RS_FUNCTION_RETURN64_LOW_REG;
  110. { Bits 16..31 of 64bit return value returned from a function }
  111. NR_FUNCTION_RESULT64_HIGH_REG = NR_FUNCTION_RETURN64_HIGH_REG;
  112. RS_FUNCTION_RESULT64_HIGH_REG = RS_FUNCTION_RETURN64_HIGH_REG;
  113. { Bits 32..47 of 64bit return value returned from a function }
  114. NR_FUNCTION_RESULT64_HIGHER_REG = NR_FUNCTION_RETURN64_HIGHER_REG;
  115. RS_FUNCTION_RESULT64_HIGHER_REG = RS_FUNCTION_RETURN64_HIGHER_REG;
  116. { Bits 48..63 of 64bit return value returned from a function }
  117. NR_FUNCTION_RESULT64_HIGHEST_REG = NR_FUNCTION_RETURN64_HIGHEST_REG;
  118. RS_FUNCTION_RESULT64_HIGHEST_REG = RS_FUNCTION_RETURN64_HIGHEST_REG;
  119. { WARNING: don't change to R_ST0!! See comments above implementation of }
  120. { a_loadfpu* methods in rgcpu (JM) }
  121. NR_fpu_result_reg = NR_ST;
  122. NR_mm_result_reg = NR_MM0;
  123. { Offset where the parent framepointer is pushed }
  124. PARENT_FRAMEPOINTER_OFFSET = 8;
  125. {*****************************************************************************
  126. GCC /ABI linking information
  127. *****************************************************************************}
  128. const
  129. {# Registers which must be saved when calling a routine declared as
  130. cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
  131. saved should be the ones as defined in the target ABI and / or GCC.
  132. This value can be deduced from the CALLED_USED_REGISTERS array in the
  133. GCC source.
  134. }
  135. saved_standard_registers : array[0..0] of tsuperregister = (RS_BP);
  136. saved_address_registers : array[0..0] of tsuperregister = (RS_INVALID);
  137. saved_mm_registers : array[0..0] of tsuperregister = (RS_INVALID);
  138. {# Required parameter alignment when calling a routine declared as
  139. stdcall and cdecl. The alignment value should be the one defined
  140. by GCC or the target ABI.
  141. The value of this constant is equal to the constant
  142. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  143. }
  144. std_param_align = 2;