Changeset 230 in dev for trunk/abdev/BasicCompiler32/Compile_Var.cpp
- Timestamp:
- Jul 24, 2007, 7:11:26 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Var.cpp
r225 r230 857 857 858 858 //mov dword ptr[offset],eax 859 OpBuffer[obp++]=(char)0xA3; 860 *((long *)(OpBuffer+obp))=offset; 861 pobj_GlobalVarSchedule->add(); 862 obp+=sizeof(long); 859 compiler.codeGenerator.op_mov_MR( sizeof(long), REG_EAX, 0, offset, MOD_DISP32, Schedule::GlobalVar ); 863 860 } 864 861 else{ … … 1250 1247 if(pRelativeVar->bOffsetOffset){ 1251 1248 //lea eax,dword ptr[ecx+offset] 1252 OpBuffer[obp++]=(char)0x8D; 1253 OpBuffer[obp++]=(char)0x81; 1254 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 1255 pobj_GlobalVarSchedule->add(); 1256 obp+=sizeof(long); 1249 compiler.codeGenerator.op_lea_RM( REG_EAX, REG_ECX, pRelativeVar->offset, MOD_BASE_DISP32, Schedule::GlobalVar ); 1257 1250 } 1258 1251 else{ 1259 1252 //mov eax,offset 1260 OpBuffer[obp++]=(char)0xB8; 1261 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 1262 pobj_GlobalVarSchedule->add(); 1263 obp+=sizeof(long); 1253 compiler.codeGenerator.op_mov_RV( REG_EAX, pRelativeVar->offset, Schedule::GlobalVar ); 1264 1254 } 1265 1255 } … … 1271 1261 1272 1262 //add eax,dword ptr[offset] 1273 compiler.codeGenerator.op_add_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );1263 compiler.codeGenerator.op_add_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 1274 1264 } 1275 1265 else{ 1276 1266 //mov eax,dword ptr[offset] 1277 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1278 } 1279 obp-=sizeof(long); 1280 pobj_GlobalVarSchedule->add(); 1281 obp+=sizeof(long); 1267 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 1268 } 1282 1269 } 1283 1270 else if(pRelativeVar->dwKind==VAR_LOCAL){ 1284 1271 if(pRelativeVar->bOffsetOffset){ 1285 1272 //add ecx,offset 1286 OpBuffer[obp++]=(char)0x81; 1287 OpBuffer[obp++]=(char)0xC1; 1288 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 1289 AddLocalVarAddrSchedule(); 1290 obp+=sizeof(long); 1273 compiler.codeGenerator.op_add_RV( REG_ECX, pRelativeVar->offset, Schedule::LocalVar ); 1291 1274 1292 1275 //lea eax,dword ptr[ebp+ecx] … … 1297 1280 } 1298 1281 else{ 1299 //lea eax,dword ptr[ebp+offset] 1300 OpBuffer[obp++]=(char)0x8D; 1301 OpBuffer[obp++]=(char)0x85; 1302 *((long *)(OpBuffer+obp))=pRelativeVar->offset; 1303 AddLocalVarAddrSchedule(); 1304 obp+=sizeof(long); 1282 //lea eax,dword ptr[ecx+offset] 1283 compiler.codeGenerator.op_lea_RM( REG_EAX, REG_EBP, pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 1305 1284 } 1306 1285 }
Note:
See TracChangeset
for help on using the changeset viewer.