Changeset 97 in dev for BasicCompiler32/Compile_Calc_PushVar.cpp
- Timestamp:
- Apr 16, 2007, 3:52:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Calc_PushVar.cpp
r66 r97 65 65 } 66 66 } 67 void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg ){67 void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg, bool is64Head){ 68 68 int varSize; 69 69 … … 81 81 82 82 //上位32ビットをedxにロード 83 pRelativeVar->offset+=sizeof(long); 84 SetReg_WholeVariable(DEF_LONG,pRelativeVar,REG_EDX); 85 pRelativeVar->offset-=sizeof(long); 83 SetReg_WholeVariable(DEF_LONG,pRelativeVar,REG_EDX, true); 86 84 87 85 return; 88 86 } 89 87 88 int offsetOf64Head = 0; 89 if( is64Head ){ 90 offsetOf64Head = sizeof(long); 91 } 92 90 93 if(pRelativeVar->dwKind==VAR_GLOBAL){ 91 94 if(pRelativeVar->bOffsetOffset){ 92 95 //mov reg, ptr[ecx+offset] 93 op_mov_RM(varSize,reg,REG_ECX,(int)pRelativeVar->offset ,MOD_BASE_DISP32);96 op_mov_RM(varSize,reg,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32); 94 97 } 95 98 else{ 96 99 //mov reg, ptr[offset] 97 op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset ,MOD_DISP32);100 op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset + offsetOf64Head,MOD_DISP32); 98 101 } 99 102 obp-=sizeof(long); … … 119 122 if(pRelativeVar->bOffsetOffset){ 120 123 //mov reg, ptr[ebp+ecx+offset] 121 op_mov_RM_ex(varSize,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset ,USE_OFFSET);124 op_mov_RM_ex(varSize,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,USE_OFFSET); 122 125 } 123 126 else{ 124 127 //mov reg, ptr[ebp+offset] 125 op_mov_RM(varSize,reg,REG_EBP,(int)pRelativeVar->offset ,MOD_BASE_DISP32);128 op_mov_RM(varSize,reg,REG_EBP,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32); 126 129 } 127 130 obp-=sizeof(long); … … 146 149 else if(pRelativeVar->dwKind==VAR_DIRECTMEM){ 147 150 directmem: 148 //mov reg, ptr[ecx] 149 op_mov_RM(varSize,reg,REG_ECX,0,MOD_BASE); 151 if( is64Head ){ 152 //mov reg, ptr[ecx] 153 op_mov_RM(varSize,reg,REG_ECX,offsetOf64Head,MOD_BASE_DISP8); 154 } 155 else{ 156 //mov reg, ptr[ecx] 157 op_mov_RM(varSize,reg,REG_ECX,0,MOD_BASE); 158 } 150 159 } 151 160 }
Note:
See TracChangeset
for help on using the changeset viewer.