Changeset 234 in dev for trunk/abdev/BasicCompiler32/CodeGenerator.cpp
- Timestamp:
- Jul 25, 2007, 11:21:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/CodeGenerator.cpp
r230 r234 99 99 /////////////////// 100 100 101 void CodeGenerator::op_mov_MV( int op_size, int base_reg, long offset, Schedule::Type offsetScheduleType, long value, Schedule::Type valueScheduleType ) 102 { 103 //mov ptr[base_reg+offset],value 104 105 if( op_size == sizeof(char) ) 106 { 107 pNativeCode->Put( (char)0xC6 ); 108 pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) ); 109 pNativeCode->Put( offset, offsetScheduleType ); 110 pNativeCode->Put( (char)value ); 111 } 112 else if( op_size == sizeof(short) ) 113 { 114 pNativeCode->Put( (char)0x66 ); 115 pNativeCode->Put( (char)0xC7 ); 116 pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) ); 117 pNativeCode->Put( offset, offsetScheduleType ); 118 pNativeCode->Put( (short)value ); 119 } 120 else if( op_size == sizeof(long) ) 121 { 122 pNativeCode->Put( (char)0xC7 ); 123 pNativeCode->Put( (char)(0x80|REGISTER_OPERAND(base_reg)) ); 124 pNativeCode->Put( offset, offsetScheduleType ); 125 pNativeCode->Put( value, valueScheduleType ); 126 } 127 } 101 128 void CodeGenerator::op_mov_RV(int reg,long offset, Schedule::Type scheduleType ){ 102 129 //mov reg,value … … 359 386 { 360 387 // add reg,offset 361 pNativeCode->Put( (char)0x81 ); 362 pNativeCode->Put( (char)(0xC0|REGISTER_OPERAND(reg)) ); 363 pNativeCode->Put( offset, scheduleType ); 388 389 if( reg == REG_EAX ) 390 { 391 // eaxのみ特殊 392 pNativeCode->Put( (char)0x05 ); 393 pNativeCode->Put( offset, scheduleType ); 394 } 395 else 396 { 397 pNativeCode->Put( (char)0x81 ); 398 pNativeCode->Put( (char)(0xC0|REGISTER_OPERAND(reg)) ); 399 pNativeCode->Put( offset, scheduleType ); 400 } 364 401 } 365 402 void CodeGenerator::op_add_RR( int reg1, int reg2 )
Note:
See TracChangeset
for help on using the changeset viewer.