1{ 2 Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman 3 4 Contains the basic declarations for the i8086 architecture 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 20 **************************************************************************** 21} 22{ This include file contains the basic declarations for the i8086 architecture. 23} 24 25{***************************************************************************** 26 Operand Sizes 27*****************************************************************************} 28 29 type 30 topsize = (S_NO, 31 S_B,S_W,S_L,S_Q,S_BW,S_BL,S_WL, 32 S_IS,S_IL,S_IQ, 33 S_FS,S_FL,S_FX,S_FV,S_FXX, 34 S_MD, 35 S_NEAR,S_FAR,S_SHORT, 36 S_T, 37 S_XMM, 38 S_YMM, 39 S_ZMM 40 ); 41 42 TOpSizes = set of topsize; 43 44{***************************************************************************** 45 Registers 46*****************************************************************************} 47 const 48 {# Standard opcode string table (for each tasmop enumeration). The 49 opcode strings should conform to the names as defined by the 50 processor manufacturer. 51 } 52 std_op2str:op2strtable={$i i8086int.inc} 53 54{***************************************************************************** 55 GDB Information 56*****************************************************************************} 57 58 {# Register indexes for stabs information, when some 59 parameters or variables are stored in registers. 60 61 Taken from i386.c (dbx_register_map) and i386.h 62 (FIXED_REGISTERS) from GCC 3.x source code 63 64 } 65 reg_stab_table : array[tregisterindex] of shortint = ( 66 {$i r8086stab.inc} 67 ); 68 69 70{***************************************************************************** 71 Default generic sizes 72*****************************************************************************} 73 74 {# Defines the default address size for a processor, } 75 OS_ADDR = OS_16; 76 {# the natural int size for a processor, 77 has to match osuinttype/ossinttype as initialized in psystem } 78 OS_INT = OS_16; 79 OS_SINT = OS_S16; 80 {# the maximum float size for a processor, } 81 OS_FLOAT = OS_F80; 82 {# the size of a vector register for a processor } 83 OS_VECTOR = OS_M128; 84 85{***************************************************************************** 86 Generic Register names 87*****************************************************************************} 88 89 {# Stack pointer register } 90 NR_STACK_POINTER_REG = NR_SP; 91 RS_STACK_POINTER_REG = RS_SP; 92 {# Frame pointer register } 93 RS_FRAME_POINTER_REG = RS_BP; 94 NR_FRAME_POINTER_REG = NR_BP; 95 { Return address for DWARF } 96 NR_RETURN_ADDRESS_REG = NR_EIP; 97 { Results are returned in this register (16-bit values) } 98 NR_FUNCTION_RETURN_REG = NR_AX; 99 RS_FUNCTION_RETURN_REG = RS_AX; 100 { Low part of 32bit return value } 101 NR_FUNCTION_RETURN32_LOW_REG = NR_AX; 102 RS_FUNCTION_RETURN32_LOW_REG = RS_AX; 103 { High part of 32bit return value } 104 NR_FUNCTION_RETURN32_HIGH_REG = NR_DX; 105 RS_FUNCTION_RETURN32_HIGH_REG = RS_DX; 106 { Bits 0..15 of 64bit return value } 107 NR_FUNCTION_RETURN64_LOW_REG = NR_DX; 108 RS_FUNCTION_RETURN64_LOW_REG = RS_DX; 109 { Bits 16..31 of 64bit return value } 110 NR_FUNCTION_RETURN64_HIGH_REG = NR_CX; 111 RS_FUNCTION_RETURN64_HIGH_REG = RS_CX; 112 { Bits 32..47 of 64bit return value } 113 NR_FUNCTION_RETURN64_HIGHER_REG = NR_BX; 114 RS_FUNCTION_RETURN64_HIGHER_REG = RS_BX; 115 { Bits 48..63 of 64bit return value } 116 NR_FUNCTION_RETURN64_HIGHEST_REG = NR_AX; 117 RS_FUNCTION_RETURN64_HIGHEST_REG = RS_AX; 118 { The value returned from a function is available in this register } 119 NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG; 120 RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG; 121 { The lowh part of 32bit value returned from a function } 122 NR_FUNCTION_RESULT32_LOW_REG = NR_FUNCTION_RETURN32_LOW_REG; 123 RS_FUNCTION_RESULT32_LOW_REG = RS_FUNCTION_RETURN32_LOW_REG; 124 { The high part of 32bit value returned from a function } 125 NR_FUNCTION_RESULT32_HIGH_REG = NR_FUNCTION_RETURN32_HIGH_REG; 126 RS_FUNCTION_RESULT32_HIGH_REG = RS_FUNCTION_RETURN32_HIGH_REG; 127 { Bits 0..15 of 64bit return value returned from a function } 128 NR_FUNCTION_RESULT64_LOW_REG = NR_FUNCTION_RETURN64_LOW_REG; 129 RS_FUNCTION_RESULT64_LOW_REG = RS_FUNCTION_RETURN64_LOW_REG; 130 { Bits 16..31 of 64bit return value returned from a function } 131 NR_FUNCTION_RESULT64_HIGH_REG = NR_FUNCTION_RETURN64_HIGH_REG; 132 RS_FUNCTION_RESULT64_HIGH_REG = RS_FUNCTION_RETURN64_HIGH_REG; 133 { Bits 32..47 of 64bit return value returned from a function } 134 NR_FUNCTION_RESULT64_HIGHER_REG = NR_FUNCTION_RETURN64_HIGHER_REG; 135 RS_FUNCTION_RESULT64_HIGHER_REG = RS_FUNCTION_RETURN64_HIGHER_REG; 136 { Bits 48..63 of 64bit return value returned from a function } 137 NR_FUNCTION_RESULT64_HIGHEST_REG = NR_FUNCTION_RETURN64_HIGHEST_REG; 138 RS_FUNCTION_RESULT64_HIGHEST_REG = RS_FUNCTION_RETURN64_HIGHEST_REG; 139 140 { WARNING: don't change to R_ST0!! See comments above implementation of } 141 { a_loadfpu* methods in rgcpu (JM) } 142 NR_fpu_result_reg = NR_ST; 143 NR_mm_result_reg = NR_MM0; 144 145 { Offset where the parent framepointer is pushed } 146 PARENT_FRAMEPOINTER_OFFSET = 8; 147 148{***************************************************************************** 149 GCC /ABI linking information 150*****************************************************************************} 151 152 const 153 {# Required parameter alignment when calling a routine declared as 154 stdcall and cdecl. The alignment value should be the one defined 155 by GCC or the target ABI. 156 157 The value of this constant is equal to the constant 158 PARM_BOUNDARY / BITS_PER_UNIT in the GCC source. 159 } 160 std_param_align = 2; 161