Changeset 234 in dev for trunk/abdev/BasicCompiler32/Compile_Var.cpp
- Timestamp:
- Jul 25, 2007, 11:21:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Var.cpp
r233 r234 1033 1033 } 1034 1034 else if( type.IsWord() || type.IsInteger() ){ 1035 //mov ax,InitValue 1036 OpBuffer[obp++]=(char)0x66; 1037 OpBuffer[obp++]=(char)0xB8; 1038 *((WORD *)(OpBuffer+obp))=(WORD)i64data; 1039 obp+=sizeof(WORD); 1040 1041 //mov word ptr[ebp+offset],ax 1042 compiler.codeGenerator.op_mov_MR( sizeof(short), REG_EAX, REG_EBP, offset, MOD_BASE_DISP32, Schedule::LocalVar ); 1035 //mov word ptr[ebp+offset],InitValue 1036 compiler.codeGenerator.op_mov_MV( sizeof(short), REG_EBP, offset, Schedule::LocalVar, (long)i64data ); 1043 1037 } 1044 1038 else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){ 1045 1039 //mov byte ptr[ebp+offset],InitValue 1046 OpBuffer[obp++]=(char)0xC6; 1047 OpBuffer[obp++]=(char)0x85; 1048 *((long *)(OpBuffer+obp))=offset; 1049 AddLocalVarAddrSchedule(); 1050 obp+=sizeof(long); 1051 *((BYTE *)(OpBuffer+obp))=(BYTE)i64data; 1052 obp+=sizeof(BYTE); 1040 compiler.codeGenerator.op_mov_MV( sizeof(char), REG_EBP, offset, Schedule::LocalVar, (long)i64data ); 1053 1041 } 1054 1042 … … 1161 1149 1162 1150 //add eax,offset 1163 OpBuffer[obp++]=(char)0x05; 1164 *((long *)(OpBuffer+obp))=-pVar->GetOffsetAddress(); 1165 AddLocalVarAddrSchedule(); 1166 obp+=sizeof(long); 1151 compiler.codeGenerator.op_add_RV( REG_EAX, -pVar->GetOffsetAddress(), Schedule::LocalVar ); 1167 1152 1168 1153 //push eax
Note:
See TracChangeset
for help on using the changeset viewer.