Changeset 250 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Jul 29, 2007, 9:30:14 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/Compile.cpp
r248 r250 23 23 LABEL *pLabelNames; 24 24 int MaxLabelNum; 25 26 //Caseスケジュール27 DWORD *pCaseSchedule;28 int CaseScheduleNum;29 int NowCaseSchedule;30 25 31 26 //グローバル変数初期バッファ -
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r248 r250 265 265 const PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 266 266 public: 267 const PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );268 const PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );269 const PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );270 const PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );271 const PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );272 const PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );273 const PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );274 const PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );275 const PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );276 const PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false );267 const PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 268 const PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 269 const PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 270 const PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 271 const PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 272 const PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 273 const PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 274 const PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 275 const PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 276 const PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 277 277 const PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false ); 278 278 void op_jmp_continue(); … … 435 435 void op_call_R( int reg ); 436 436 void op_call(const UserProc *pUserProc); 437 void op_call(const DllProc *pDllProc); 437 438 void op_ret(); 438 439 void op_ret( short stackFrameSize ); -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r245 r250 33 33 LONG_PTR lpValue; 34 34 const ::UserProc *pUserProc; 35 const ::DllProc *pDllProc; 35 36 }; 36 37 … … 58 59 , offset( offset ) 59 60 , pUserProc( pUserProc ) 61 { 62 } 63 Schedule( const ::DllProc *pDllProc, long offest ) 64 : type( Schedule::UserProc ) 65 , offset( offset ) 66 , pDllProc( pDllProc ) 60 67 { 61 68 } … … 242 249 } 243 250 void PutUserProcSchedule( const UserProc *pUserProc, bool isCall ); 251 void PutDllProcSchedule( const DllProc *pDllProc ); 244 252 void Put( short s ) 245 253 { -
trunk/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp
r248 r250 158 158 return pPertialSchedule; 159 159 } 160 const PertialSchedule *CodeGenerator::op_jle( long offset, int op_size, bool isPertialSchedule )161 { 162 return __jmp_op_format( (char)0x0E, offset, op_size, isPertialSchedule );163 } 164 const PertialSchedule *CodeGenerator::op_jbe( long offset, int op_size, bool isPertialSchedule )165 { 166 return __jmp_op_format( (char)0x06, offset, op_size, isPertialSchedule );167 } 168 const PertialSchedule *CodeGenerator::op_jge( long offset, int op_size, bool isPertialSchedule )169 { 170 return __jmp_op_format( (char)0x0D, offset, op_size, isPertialSchedule );171 } 172 const PertialSchedule *CodeGenerator::op_jae( long offset, int op_size, bool isPertialSchedule )173 { 174 return __jmp_op_format( (char)0x03, offset, op_size, isPertialSchedule );175 } 176 const PertialSchedule *CodeGenerator::op_jl( long offset, int op_size, bool isPertialSchedule )177 { 178 return __jmp_op_format( (char)0x0C, offset, op_size, isPertialSchedule );179 } 180 const PertialSchedule *CodeGenerator::op_jb( long offset, int op_size, bool isPertialSchedule )181 { 182 return __jmp_op_format( (char)0x02, offset, op_size, isPertialSchedule );183 } 184 const PertialSchedule *CodeGenerator::op_jg( long offset, int op_size, bool isPertialSchedule )185 { 186 return __jmp_op_format( (char)0x0F, offset, op_size, isPertialSchedule );187 } 188 const PertialSchedule *CodeGenerator::op_ja( long offset, int op_size, bool isPertialSchedule )189 { 190 return __jmp_op_format( (char)0x07, offset, op_size, isPertialSchedule );191 } 192 const PertialSchedule *CodeGenerator::op_jne( long offset, int op_size, bool isPertialSchedule )193 { 194 return __jmp_op_format( (char)0x05, offset, op_size, isPertialSchedule );195 } 196 const PertialSchedule *CodeGenerator::op_je( long offset, int op_size, bool isPertialSchedule )197 { 198 return __jmp_op_format( (char)0x04, offset, op_size, isPertialSchedule );160 const PertialSchedule *CodeGenerator::op_jle( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 161 { 162 return __jmp_op_format( (char)0x0E, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 163 } 164 const PertialSchedule *CodeGenerator::op_jbe( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 165 { 166 return __jmp_op_format( (char)0x06, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 167 } 168 const PertialSchedule *CodeGenerator::op_jge( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 169 { 170 return __jmp_op_format( (char)0x0D, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 171 } 172 const PertialSchedule *CodeGenerator::op_jae( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 173 { 174 return __jmp_op_format( (char)0x03, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 175 } 176 const PertialSchedule *CodeGenerator::op_jl( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 177 { 178 return __jmp_op_format( (char)0x0C, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 179 } 180 const PertialSchedule *CodeGenerator::op_jb( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 181 { 182 return __jmp_op_format( (char)0x02, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 183 } 184 const PertialSchedule *CodeGenerator::op_jg( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 185 { 186 return __jmp_op_format( (char)0x0F, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 187 } 188 const PertialSchedule *CodeGenerator::op_ja( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 189 { 190 return __jmp_op_format( (char)0x07, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 191 } 192 const PertialSchedule *CodeGenerator::op_jne( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 193 { 194 return __jmp_op_format( (char)0x05, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 195 } 196 const PertialSchedule *CodeGenerator::op_je( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) 197 { 198 return __jmp_op_format( (char)0x04, offset, op_size, isPertialSchedule, isSelfOpcodeOffset ); 199 199 } 200 200 const PertialSchedule *CodeGenerator::op_jmp( long offset, int op_size, bool isPertialSchedule, bool isSelfOpcodeOffset ) -
trunk/abdev/BasicCompiler_Common/src/NativeCode.cpp
r245 r250 48 48 ObpPlus( sizeof(long) ); 49 49 } 50 51 void NativeCode::PutDllProcSchedule( const DllProc *pDllProc ) 52 { 53 pDllProc->Using(); 54 55 schedules.push_back( Schedule( pDllProc, size ) ); 56 57 *((long *)(codeBuffer+size))=0; 58 size += sizeof(long); 59 60 61 62 // 未完成 63 pobj_ImportAddrSchedule->add(pDllProc); 64 extern char *OpBuffer; 65 extern int obp; 66 *((long *)(OpBuffer+obp))=0; 67 ObpPlus( sizeof(long) ); 68 }
Note:
See TracChangeset
for help on using the changeset viewer.