[206] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
[183] | 3 | #include <jenga/include/smoothie/LexicalAnalysis.h>
|
---|
| 4 |
|
---|
[248] | 5 | #include <LexicalScope.h>
|
---|
[183] | 6 | #include <Compiler.h>
|
---|
| 7 |
|
---|
[3] | 8 | #include "../BasicCompiler_Common/common.h"
|
---|
| 9 | #include "Opcode.h"
|
---|
| 10 |
|
---|
[129] | 11 | void OpcodeOthers( const char *Command ){
|
---|
[3] | 12 | int i,i2;
|
---|
| 13 |
|
---|
[122] | 14 | char leftTerm[8192];
|
---|
| 15 | int lastParePos = 0;
|
---|
[3] | 16 | for(i=0;;i++){
|
---|
[122] | 17 | if(Command[i]=='\"'){
|
---|
| 18 | //ダブルクォートは不正なのでエラー扱い
|
---|
| 19 | leftTerm[i]=0;
|
---|
| 20 | SetError(3,leftTerm,cp);
|
---|
| 21 | return;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | if(Command[i]=='('){
|
---|
| 25 | lastParePos = i;
|
---|
| 26 | i2=GetStringInPare(leftTerm+i,Command+i);
|
---|
[3] | 27 | i+=i2-1;
|
---|
| 28 | continue;
|
---|
| 29 | }
|
---|
[122] | 30 | if(Command[i]=='['){
|
---|
| 31 | i2=GetStringInBracket(leftTerm+i,Command+i);
|
---|
| 32 | i+=i2-1;
|
---|
[3] | 33 | continue;
|
---|
| 34 | }
|
---|
[122] | 35 | if(Command[i]=='\0'){
|
---|
| 36 | leftTerm[i] = 0;
|
---|
[3] | 37 | break;
|
---|
| 38 | }
|
---|
[122] | 39 |
|
---|
| 40 | if( IsNumCalcMark( Command, i ) ){
|
---|
| 41 | leftTerm[i] = 0;
|
---|
| 42 | break;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | leftTerm[i]=Command[i];
|
---|
[3] | 46 | }
|
---|
| 47 | if(!(
|
---|
[122] | 48 | IsVariableTopChar(leftTerm[0])||
|
---|
| 49 | leftTerm[0]=='.'||
|
---|
| 50 | (leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
|
---|
[3] | 51 | )){
|
---|
| 52 | SetError(1,NULL,cp);
|
---|
| 53 | return;
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 |
|
---|
[122] | 57 | if(Command[i]=='\0' && lastParePos == 0){
|
---|
[3] | 58 | //////////////////////////////
|
---|
| 59 | // パラメータ無しのマクロ検索
|
---|
| 60 | //////////////////////////////
|
---|
| 61 |
|
---|
[206] | 62 | const UserProc *pUserProc = GetSubHash(Command);
|
---|
[3] | 63 |
|
---|
| 64 | //GetSubHash内でエラー提示が行われた場合
|
---|
[75] | 65 | if(pUserProc==(UserProc *)-1) return;
|
---|
[3] | 66 |
|
---|
[75] | 67 | if(pUserProc==0){
|
---|
[3] | 68 | char temporary[VN_SIZE];
|
---|
| 69 | lstrcpy(temporary,Command);
|
---|
| 70 |
|
---|
| 71 | CharUpper(temporary);
|
---|
[75] | 72 | pUserProc=GetSubHash(temporary);
|
---|
[3] | 73 |
|
---|
| 74 | //GetSubHash内でエラー提示が行われた場合
|
---|
[75] | 75 | if(pUserProc==(UserProc *)-1) return;
|
---|
[3] | 76 | }
|
---|
| 77 |
|
---|
[75] | 78 | if(pUserProc){
|
---|
[122] | 79 | if( !pUserProc->IsMacro() ){
|
---|
| 80 | SetError(10,Command,cp);
|
---|
| 81 | }
|
---|
[3] | 82 |
|
---|
[75] | 83 | Opcode_CallProc("",pUserProc,0,"",0);
|
---|
[3] | 84 |
|
---|
| 85 | return;
|
---|
| 86 | }
|
---|
| 87 | }
|
---|
| 88 | else if(IsNumCalcMark(Command,i)){
|
---|
| 89 | //代入演算
|
---|
| 90 | OpcodeCalc(Command);
|
---|
| 91 | return;
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 |
|
---|
[122] | 95 | Type resultType;
|
---|
| 96 | bool isLiteral;
|
---|
| 97 | BOOL bUseHeap;
|
---|
[128] | 98 | bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, false, NULL, true );
|
---|
[122] | 99 | if( result ){
|
---|
[3] | 100 |
|
---|
| 101 | /////////////////////
|
---|
| 102 | // 戻り値の処理
|
---|
| 103 | /////////////////////
|
---|
| 104 |
|
---|
[76] | 105 | if( resultType.IsReal() ){
|
---|
[3] | 106 | //fstp st(0)
|
---|
[236] | 107 | compiler.codeGenerator.PutOld(
|
---|
| 108 | (char)0xDD,
|
---|
| 109 | (char)0xD8
|
---|
| 110 | );
|
---|
[3] | 111 | }
|
---|
[76] | 112 | else if( resultType.IsStruct() ){
|
---|
[51] | 113 | //mov ebx,eax
|
---|
[225] | 114 | compiler.codeGenerator.op_mov_RR(REG_EBX,REG_EAX);
|
---|
[3] | 115 |
|
---|
[76] | 116 | FreeTempObject(REG_EBX,&resultType.GetClass());
|
---|
[3] | 117 | }
|
---|
[122] | 118 |
|
---|
| 119 | //成功
|
---|
[3] | 120 | return;
|
---|
| 121 | }
|
---|
| 122 |
|
---|
[122] | 123 | // 失敗
|
---|
| 124 | SetError(1, NULL,cp);
|
---|
[3] | 125 | }
|
---|
| 126 |
|
---|
| 127 | void OpcodeIf(char *Parameter){
|
---|
[241] | 128 | int i,i2;
|
---|
[76] | 129 | Type tempType;
|
---|
[3] | 130 |
|
---|
| 131 | for(i=0;;i++){
|
---|
| 132 | if(Parameter[i]=='\0'){
|
---|
| 133 | SetError(21,NULL,cp);
|
---|
| 134 | return;
|
---|
| 135 | }
|
---|
| 136 | if(Parameter[i]==1&&Parameter[i+1]==ESC_THEN){
|
---|
| 137 | Parameter[i]=0;
|
---|
| 138 | break;
|
---|
| 139 | }
|
---|
| 140 | }
|
---|
| 141 |
|
---|
[248] | 142 | const PertialSchedule *pIfPertialSchedule = NULL;
|
---|
[76] | 143 | if( !NumOpe(Parameter,Type(),tempType) ){
|
---|
[3] | 144 | //NumOpe内でエラー
|
---|
| 145 | }
|
---|
[76] | 146 | else if( tempType.IsDouble() ){
|
---|
[3] | 147 | //fld qword ptr[esp]
|
---|
[225] | 148 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 149 |
|
---|
| 150 | //push 0
|
---|
[225] | 151 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 152 |
|
---|
| 153 | //fild dword ptr[esp]
|
---|
[225] | 154 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 155 |
|
---|
| 156 | //add esp,sizeof(double)+sizeof(long)
|
---|
[225] | 157 | compiler.codeGenerator.op_add_esp(sizeof(double)+sizeof(long));
|
---|
[3] | 158 |
|
---|
| 159 | //fcompp
|
---|
[225] | 160 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 161 |
|
---|
| 162 | //fnstsw ax
|
---|
[225] | 163 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 164 |
|
---|
| 165 | //test ah,40
|
---|
[225] | 166 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 167 |
|
---|
| 168 | //jne (endif、または else まで)
|
---|
[241] | 169 | pIfPertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(long), true );
|
---|
[3] | 170 | }
|
---|
[76] | 171 | else if( tempType.IsSingle() ){
|
---|
[3] | 172 | //fld dword ptr[esp]
|
---|
[225] | 173 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 174 |
|
---|
| 175 | //push 0
|
---|
[225] | 176 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 177 |
|
---|
| 178 | //fild dword ptr[esp]
|
---|
[225] | 179 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 180 |
|
---|
| 181 | //add esp,sizeof(float)+sizeof(long)
|
---|
[225] | 182 | compiler.codeGenerator.op_add_esp(sizeof(float)+sizeof(long));
|
---|
[3] | 183 |
|
---|
| 184 | //fcompp
|
---|
[225] | 185 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 186 |
|
---|
| 187 | //fnstsw ax
|
---|
[225] | 188 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 189 |
|
---|
| 190 | //test ah,40
|
---|
[225] | 191 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 192 |
|
---|
| 193 | //jne (endif、または else まで)
|
---|
[241] | 194 | pIfPertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(long), true );
|
---|
[3] | 195 | }
|
---|
[76] | 196 | else if( tempType.Is64() ){
|
---|
[3] | 197 | //64ビット型
|
---|
| 198 |
|
---|
| 199 | //pop eax
|
---|
[225] | 200 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 201 |
|
---|
| 202 | //pop ebx
|
---|
[225] | 203 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 204 |
|
---|
| 205 | //cmp eax,0
|
---|
[236] | 206 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 207 |
|
---|
| 208 | //jne
|
---|
[248] | 209 | const PertialSchedule *pTempPertialSchedule1 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 210 |
|
---|
| 211 | //cmp ebx,0
|
---|
[236] | 212 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EBX, 0 );
|
---|
[3] | 213 |
|
---|
| 214 | //jne
|
---|
[248] | 215 | const PertialSchedule *pTempPertialSchedule2 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 216 |
|
---|
| 217 | //jmp (endif、または else までジャンプ)
|
---|
[241] | 218 | pIfPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 219 |
|
---|
[241] | 220 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule1 );
|
---|
| 221 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule2 );
|
---|
[3] | 222 | }
|
---|
| 223 | else{
|
---|
| 224 | //32ビット型
|
---|
| 225 |
|
---|
| 226 | //pop eax
|
---|
[225] | 227 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 228 |
|
---|
| 229 | //cmp eax,0
|
---|
[236] | 230 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 231 |
|
---|
| 232 | //je (endif、または else まで条件ジャンプ)
|
---|
[241] | 233 | pIfPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(long), true );
|
---|
[3] | 234 | }
|
---|
| 235 |
|
---|
| 236 |
|
---|
| 237 | /////////////////////////
|
---|
| 238 | // If内をコード化
|
---|
| 239 | /////////////////////////
|
---|
| 240 |
|
---|
| 241 | //レキシカルスコープをレベルアップ
|
---|
[248] | 242 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_IF );
|
---|
[3] | 243 |
|
---|
| 244 | i2=CompileBuffer(ESC_ENDIF,0);
|
---|
| 245 |
|
---|
| 246 | //レキシカルスコープをレベルダウン
|
---|
[248] | 247 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 248 |
|
---|
| 249 |
|
---|
[241] | 250 | if( pIfPertialSchedule == NULL ) return;
|
---|
[3] | 251 |
|
---|
| 252 | if(i2==ESC_ELSE){
|
---|
| 253 | //jmp (endifまで)
|
---|
[248] | 254 | const PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 255 |
|
---|
[241] | 256 | compiler.codeGenerator.opfix_JmpPertialSchedule( pIfPertialSchedule );
|
---|
[3] | 257 |
|
---|
| 258 |
|
---|
| 259 | /////////////////////////
|
---|
| 260 | // Else内をコード化
|
---|
| 261 | /////////////////////////
|
---|
| 262 |
|
---|
| 263 | //レキシカルスコープをレベルアップ
|
---|
[248] | 264 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_IF );
|
---|
[3] | 265 |
|
---|
| 266 | CompileBuffer(ESC_ENDIF,0);
|
---|
| 267 |
|
---|
| 268 | //レキシカルスコープをレベルダウン
|
---|
[248] | 269 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 270 |
|
---|
| 271 |
|
---|
[241] | 272 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
|
---|
[3] | 273 | }
|
---|
| 274 | else{
|
---|
[241] | 275 | compiler.codeGenerator.opfix_JmpPertialSchedule( pIfPertialSchedule );
|
---|
[3] | 276 | }
|
---|
| 277 | }
|
---|
| 278 |
|
---|
| 279 | int GetLabelAddress(char *LabelName,int LineNum){
|
---|
| 280 | extern int MaxLabelNum;
|
---|
| 281 | extern LABEL *pLabelNames;
|
---|
| 282 | int i;
|
---|
| 283 |
|
---|
| 284 | if(LabelName){
|
---|
| 285 | for(i=0;i<MaxLabelNum;i++){
|
---|
| 286 | if(pLabelNames[i].pName){
|
---|
| 287 | if(lstrcmp(LabelName,pLabelNames[i].pName)==0) return pLabelNames[i].address;
|
---|
| 288 | }
|
---|
| 289 | }
|
---|
| 290 | }
|
---|
| 291 | else{
|
---|
| 292 | for(i=0;i<MaxLabelNum;i++){
|
---|
| 293 | if(pLabelNames[i].pName==0){
|
---|
| 294 | if(LineNum==pLabelNames[i].line) return pLabelNames[i].address;
|
---|
| 295 | }
|
---|
| 296 | }
|
---|
| 297 | }
|
---|
| 298 | return -1;
|
---|
| 299 | }
|
---|
| 300 | void OpcodeGoto(char *Parameter){
|
---|
| 301 | extern HANDLE hHeap;
|
---|
| 302 | int i,LineNum;
|
---|
| 303 |
|
---|
| 304 | if(Parameter[0]=='*'){
|
---|
| 305 | i=GetLabelAddress(Parameter+1,0);
|
---|
| 306 |
|
---|
[246] | 307 | if( i == -1 )
|
---|
| 308 | {
|
---|
| 309 | //jmp ...(schedule)
|
---|
| 310 | compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( (const std::string)(Parameter + 1), obp, cp ) );
|
---|
[3] | 311 | }
|
---|
[246] | 312 | else
|
---|
| 313 | {
|
---|
| 314 | //jmp ...
|
---|
| 315 | compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
|
---|
| 316 | }
|
---|
[3] | 317 | }
|
---|
| 318 | else{
|
---|
| 319 | LineNum=atoi(Parameter);
|
---|
| 320 | i=GetLabelAddress(0,LineNum);
|
---|
| 321 |
|
---|
[246] | 322 | if( i == -1 )
|
---|
| 323 | {
|
---|
| 324 | //jmp ...(schedule)
|
---|
| 325 | compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( LineNum, obp, cp ) );
|
---|
[3] | 326 | }
|
---|
[246] | 327 | else
|
---|
| 328 | {
|
---|
| 329 | //jmp ...
|
---|
| 330 | compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
|
---|
| 331 | }
|
---|
[3] | 332 | }
|
---|
| 333 | }
|
---|
| 334 | void OpcodeWhile(char *Parameter){
|
---|
| 335 | extern HANDLE hHeap;
|
---|
| 336 |
|
---|
| 337 | //Continueアドレスのバックアップとセット
|
---|
[241] | 338 | compiler.codeGenerator.ContinueAreaBegin();
|
---|
[3] | 339 |
|
---|
| 340 | if(!Parameter[0]) SetError(10,"While",cp);
|
---|
| 341 |
|
---|
[248] | 342 | const PertialSchedule *pWhilePertialSchedule = NULL;
|
---|
[76] | 343 | Type tempType;
|
---|
| 344 | if( !NumOpe(Parameter,Type(),tempType) ){
|
---|
| 345 | //ダミー
|
---|
| 346 | }
|
---|
| 347 | else if( tempType.IsDouble() ){
|
---|
[3] | 348 | //fld qword ptr[esp]
|
---|
[225] | 349 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 350 |
|
---|
| 351 | //push 0
|
---|
[225] | 352 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 353 |
|
---|
| 354 | //fild dword ptr[esp]
|
---|
[225] | 355 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 356 |
|
---|
| 357 | //add esp,sizeof(double)+sizeof(long)
|
---|
[225] | 358 | compiler.codeGenerator.op_add_esp(sizeof(double)+sizeof(long));
|
---|
[3] | 359 |
|
---|
| 360 | //fcompp
|
---|
[225] | 361 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 362 |
|
---|
| 363 | //fnstsw ax
|
---|
[225] | 364 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 365 |
|
---|
| 366 | //test ah,40
|
---|
[225] | 367 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 368 |
|
---|
| 369 | //jne (Wend まで)
|
---|
[241] | 370 | pWhilePertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(long), true );
|
---|
[3] | 371 | }
|
---|
[76] | 372 | else if( tempType.IsSingle() ){
|
---|
[3] | 373 | //fld dword ptr[esp]
|
---|
[225] | 374 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 375 |
|
---|
| 376 | //push 0
|
---|
[225] | 377 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 378 |
|
---|
| 379 | //fild dword ptr[esp]
|
---|
[225] | 380 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 381 |
|
---|
| 382 | //add esp,sizeof(float)+sizeof(long)
|
---|
[225] | 383 | compiler.codeGenerator.op_add_esp(sizeof(float)+sizeof(long));
|
---|
[3] | 384 |
|
---|
| 385 | //fcompp
|
---|
[225] | 386 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 387 |
|
---|
| 388 | //fnstsw ax
|
---|
[225] | 389 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 390 |
|
---|
[241] | 391 | //test ah,40h
|
---|
[225] | 392 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 393 |
|
---|
| 394 | //jne (Wend まで)
|
---|
[241] | 395 | pWhilePertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(long), true );
|
---|
[3] | 396 | }
|
---|
[76] | 397 | else if( tempType.Is64() ){
|
---|
[3] | 398 | //64ビット型
|
---|
| 399 |
|
---|
| 400 | //pop eax
|
---|
[225] | 401 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 402 |
|
---|
| 403 | //pop ebx
|
---|
[225] | 404 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 405 |
|
---|
| 406 | //cmp eax,0
|
---|
[236] | 407 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 408 |
|
---|
| 409 | //jne
|
---|
[248] | 410 | const PertialSchedule *pTempPertialSchedule1 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 411 |
|
---|
| 412 | //cmp ebx,0
|
---|
[236] | 413 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EBX, 0 );
|
---|
[3] | 414 |
|
---|
| 415 | //jne
|
---|
[248] | 416 | const PertialSchedule *pTempPertialSchedule2 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 417 |
|
---|
[241] | 418 | //jmp (Wendまでジャンプ)
|
---|
| 419 | pWhilePertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 420 |
|
---|
[241] | 421 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule1 );
|
---|
| 422 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule2 );
|
---|
[3] | 423 | }
|
---|
| 424 | else{
|
---|
| 425 | //その他整数型
|
---|
| 426 |
|
---|
| 427 | //pop eax
|
---|
[225] | 428 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 429 |
|
---|
| 430 | //cmp eax,0
|
---|
[236] | 431 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 432 |
|
---|
| 433 | //je (Wend まで)
|
---|
[241] | 434 | pWhilePertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(long), true );
|
---|
[3] | 435 | }
|
---|
| 436 |
|
---|
| 437 | //レキシカルスコープをレベルアップ
|
---|
[248] | 438 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_WHILE );
|
---|
[3] | 439 |
|
---|
| 440 | //While内をコンパイル
|
---|
| 441 | CompileBuffer(0,COM_WEND);
|
---|
| 442 |
|
---|
[248] | 443 | compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd();
|
---|
[3] | 444 |
|
---|
| 445 | //jmp ...
|
---|
[241] | 446 | compiler.codeGenerator.op_jmp_continue();
|
---|
[3] | 447 |
|
---|
| 448 | //レキシカルスコープをレベルダウン
|
---|
[248] | 449 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 450 |
|
---|
[241] | 451 | if( pWhilePertialSchedule )
|
---|
| 452 | {
|
---|
| 453 | compiler.codeGenerator.opfix_JmpPertialSchedule( pWhilePertialSchedule );
|
---|
| 454 | }
|
---|
[3] | 455 |
|
---|
[241] | 456 | compiler.codeGenerator.ContinueAreaEnd();
|
---|
[3] | 457 | }
|
---|
| 458 |
|
---|
| 459 | char szNextVariable[VN_SIZE];
|
---|
| 460 | void OpcodeFor(char *Parameter){
|
---|
| 461 | extern HANDLE hHeap;
|
---|
[241] | 462 | int i,i2;
|
---|
[3] | 463 | char temporary[VN_SIZE],variable[VN_SIZE],JudgeNum[VN_SIZE],StepNum[VN_SIZE];
|
---|
| 464 |
|
---|
| 465 | //第1パラメータを取得
|
---|
| 466 | i=GetOneParameter(Parameter,0,temporary);
|
---|
| 467 | if(!Parameter[i]){
|
---|
| 468 | SetError(12,"For",cp);
|
---|
| 469 | goto ErrorStep;
|
---|
| 470 | }
|
---|
| 471 |
|
---|
| 472 | for(i2=0;;i2++){
|
---|
| 473 | if(temporary[i2]=='='){
|
---|
| 474 | variable[i2]=0;
|
---|
| 475 |
|
---|
| 476 | //カウンタ初期化
|
---|
| 477 | OpcodeCalc(temporary);
|
---|
| 478 | break;
|
---|
| 479 | }
|
---|
| 480 | if(temporary[i2]=='\0'){
|
---|
| 481 | SetError(12,"For",cp);
|
---|
| 482 | goto ErrorStep;
|
---|
| 483 | }
|
---|
| 484 | variable[i2]=temporary[i2];
|
---|
| 485 | }
|
---|
| 486 |
|
---|
| 487 | //jmp ...
|
---|
[248] | 488 | const PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 489 |
|
---|
| 490 | //Continueアドレスのバックアップとセット
|
---|
[241] | 491 | compiler.codeGenerator.ContinueAreaBegin();
|
---|
[3] | 492 |
|
---|
| 493 | //第2パラメータを取得(to~)
|
---|
| 494 | i=GetOneParameter(Parameter,i,JudgeNum);
|
---|
| 495 |
|
---|
| 496 | //第3パラメータを取得(step~)
|
---|
| 497 | if(Parameter[i]){
|
---|
| 498 | i=GetOneParameter(Parameter,i,StepNum);
|
---|
| 499 | if(Parameter[i]) SetError(12,"For",cp);
|
---|
| 500 | }
|
---|
| 501 | else lstrcpy(StepNum,"1");
|
---|
| 502 |
|
---|
| 503 | //カウンタを増加させる
|
---|
| 504 | sprintf(temporary,"%s=(%s)+(%s)",variable,variable,StepNum);
|
---|
| 505 | OpcodeCalc(temporary);
|
---|
| 506 |
|
---|
[241] | 507 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
|
---|
[3] | 508 |
|
---|
| 509 | //増加か減少かを区別する
|
---|
| 510 | sprintf(temporary,"(%s)>=0",StepNum);
|
---|
[76] | 511 | NumOpe(temporary,Type(),Type());
|
---|
[3] | 512 |
|
---|
| 513 | //pop eax
|
---|
[225] | 514 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 515 |
|
---|
| 516 | //cmp eax,0
|
---|
[236] | 517 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 518 |
|
---|
| 519 | //je [カウンタ減少の場合の判定]
|
---|
[241] | 520 | pTempPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(long), true );
|
---|
[3] | 521 |
|
---|
| 522 | //判定(カウンタ増加の場合)
|
---|
| 523 | sprintf(temporary,"%s<=(%s)",variable,JudgeNum);
|
---|
[76] | 524 | NumOpe(temporary,Type(),Type());
|
---|
[3] | 525 |
|
---|
| 526 | //pop eax
|
---|
[225] | 527 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 528 |
|
---|
| 529 | //jmp [カウンタ減少の場合の判定を飛び越す]
|
---|
[248] | 530 | const PertialSchedule *pTempPertialSchedule2 = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 531 |
|
---|
[241] | 532 | //jeジャンプ先のオフセット値
|
---|
| 533 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
|
---|
[3] | 534 |
|
---|
| 535 | //判定(カウンタ減少の場合)
|
---|
| 536 | sprintf(temporary,"%s>=(%s)",variable,JudgeNum);
|
---|
[76] | 537 | NumOpe(temporary,Type(),Type());
|
---|
[3] | 538 |
|
---|
| 539 | //pop eax
|
---|
[225] | 540 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 541 |
|
---|
[241] | 542 | //jmpジャンプ先のオフセット値
|
---|
| 543 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule2 );
|
---|
[3] | 544 |
|
---|
| 545 | //cmp eax,0
|
---|
[236] | 546 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 547 |
|
---|
| 548 | ErrorStep:
|
---|
| 549 |
|
---|
| 550 | //je ...
|
---|
[241] | 551 | pTempPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(long), true );
|
---|
[3] | 552 |
|
---|
| 553 | //レキシカルスコープをレベルアップ
|
---|
[248] | 554 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_FOR );
|
---|
[3] | 555 |
|
---|
| 556 | //For内をコンパイル
|
---|
| 557 | CompileBuffer(0,COM_NEXT);
|
---|
| 558 |
|
---|
[248] | 559 | compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd();
|
---|
[3] | 560 |
|
---|
| 561 | if(szNextVariable[0]){
|
---|
| 562 | if(lstrcmp(szNextVariable,variable)!=0){
|
---|
| 563 | SetError(55,szNextVariable,cp);
|
---|
| 564 | }
|
---|
| 565 | }
|
---|
| 566 |
|
---|
| 567 | //jmp ...
|
---|
[241] | 568 | compiler.codeGenerator.op_jmp_continue();
|
---|
[3] | 569 |
|
---|
| 570 | //レキシカルスコープをレベルダウン
|
---|
[248] | 571 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 572 |
|
---|
[241] | 573 | //jeジャンプ先のオフセット値
|
---|
| 574 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
|
---|
[3] | 575 |
|
---|
| 576 | //Continueアドレスを復元
|
---|
[241] | 577 | compiler.codeGenerator.ContinueAreaEnd();
|
---|
[3] | 578 | }
|
---|
| 579 |
|
---|
| 580 | void OpcodeDo(char *Parameter){
|
---|
| 581 | extern HANDLE hHeap;
|
---|
[247] | 582 | int i,i2,i3;
|
---|
[3] | 583 |
|
---|
| 584 | if(Parameter[0]) SetError(10,"Do",cp);
|
---|
| 585 |
|
---|
| 586 | //Continueアドレスのバックアップとセット
|
---|
[241] | 587 | compiler.codeGenerator.ContinueAreaBegin();
|
---|
[3] | 588 |
|
---|
| 589 | //レキシカルスコープをレベルアップ
|
---|
[248] | 590 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_DO );
|
---|
[3] | 591 |
|
---|
| 592 | //Do内をコンパイル
|
---|
| 593 | CompileBuffer(0,COM_LOOP);
|
---|
| 594 |
|
---|
[248] | 595 | compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd();
|
---|
[3] | 596 |
|
---|
[248] | 597 | const PertialSchedule *pDoPertialSchedule = NULL;
|
---|
[241] | 598 |
|
---|
[3] | 599 | extern char *basbuf;
|
---|
| 600 | char temporary[VN_SIZE];
|
---|
| 601 | for(i=cp-1;;i--){
|
---|
| 602 | if(IsCommandDelimitation(basbuf[i])){
|
---|
| 603 | i+=3;
|
---|
| 604 | if(!(basbuf[i]=='0'||basbuf[i]=='1')){
|
---|
| 605 | //無条件ループ
|
---|
| 606 | break;
|
---|
| 607 | }
|
---|
| 608 | i3=i;
|
---|
| 609 |
|
---|
| 610 | for(i+=2,i2=0;;i++,i2++){
|
---|
| 611 | if(IsCommandDelimitation(basbuf[i])){
|
---|
| 612 | temporary[i2]=0;
|
---|
| 613 | break;
|
---|
| 614 | }
|
---|
| 615 | temporary[i2]=basbuf[i];
|
---|
| 616 | }
|
---|
| 617 |
|
---|
[76] | 618 | Type tempType;
|
---|
| 619 | NumOpe(temporary,Type(),tempType);
|
---|
[3] | 620 |
|
---|
[76] | 621 | if( tempType.IsDouble() ){
|
---|
[3] | 622 | //fld qword ptr[esp]
|
---|
[225] | 623 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 624 |
|
---|
| 625 | //push 0
|
---|
[225] | 626 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 627 |
|
---|
| 628 | //fild dword ptr[esp]
|
---|
[225] | 629 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 630 |
|
---|
| 631 | //add esp,sizeof(double)+sizeof(long)
|
---|
[225] | 632 | compiler.codeGenerator.op_add_esp(sizeof(double)+sizeof(long));
|
---|
[3] | 633 |
|
---|
| 634 | //fcompp
|
---|
[225] | 635 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 636 |
|
---|
| 637 | //fnstsw ax
|
---|
[225] | 638 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 639 |
|
---|
| 640 | //test ah,40
|
---|
[225] | 641 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 642 |
|
---|
| 643 | if(basbuf[i3]=='0'){
|
---|
| 644 | //While
|
---|
| 645 |
|
---|
| 646 | //jne 5(ループ終了)
|
---|
[241] | 647 | pDoPertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 648 | }
|
---|
| 649 | else if(basbuf[i3]=='1'){
|
---|
| 650 | //Until
|
---|
| 651 |
|
---|
| 652 | //je 5(ループ終了)
|
---|
[241] | 653 | pDoPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(char), true );
|
---|
[3] | 654 | }
|
---|
| 655 | }
|
---|
[76] | 656 | else if( tempType.IsSingle() ){
|
---|
[3] | 657 | //fld dword ptr[esp]
|
---|
[225] | 658 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 659 |
|
---|
| 660 | //push 0
|
---|
[225] | 661 | compiler.codeGenerator.op_push_V(0);
|
---|
[3] | 662 |
|
---|
| 663 | //fild dword ptr[esp]
|
---|
[225] | 664 | compiler.codeGenerator.op_fld_ptr_esp(DEF_LONG);
|
---|
[3] | 665 |
|
---|
| 666 | //add esp,sizeof(float)+sizeof(long)
|
---|
[225] | 667 | compiler.codeGenerator.op_add_esp(sizeof(float)+sizeof(long));
|
---|
[3] | 668 |
|
---|
| 669 | //fcompp
|
---|
[225] | 670 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 671 |
|
---|
| 672 | //fnstsw ax
|
---|
[225] | 673 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 674 |
|
---|
| 675 | //test ah,40
|
---|
[225] | 676 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 677 |
|
---|
| 678 | if(basbuf[i3]=='0'){
|
---|
| 679 | //While
|
---|
| 680 |
|
---|
| 681 | //jne 5(ループ終了)
|
---|
[241] | 682 | pDoPertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 683 | }
|
---|
| 684 | else if(basbuf[i3]=='1'){
|
---|
| 685 | //Until
|
---|
| 686 |
|
---|
| 687 | //je 5(ループ終了)
|
---|
[241] | 688 | pDoPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(char), true );
|
---|
[3] | 689 | }
|
---|
| 690 | }
|
---|
[76] | 691 | else if( tempType.Is64() ){
|
---|
[3] | 692 | //64ビット型
|
---|
| 693 |
|
---|
| 694 | //pop eax
|
---|
[225] | 695 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 696 |
|
---|
| 697 | //pop ebx
|
---|
[225] | 698 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 699 |
|
---|
| 700 | //cmp eax,0
|
---|
[236] | 701 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 702 |
|
---|
| 703 | //jne
|
---|
[248] | 704 | const PertialSchedule *pTempPertialSchedule1 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 705 |
|
---|
| 706 | //cmp ebx,0
|
---|
[236] | 707 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EBX, 0 );
|
---|
[3] | 708 |
|
---|
| 709 | //jne
|
---|
[248] | 710 | const PertialSchedule *pTempPertialSchedule2 = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 711 |
|
---|
| 712 | if(basbuf[i3]=='0'){
|
---|
| 713 | //While
|
---|
| 714 |
|
---|
| 715 | //jmp 5(ループ終了)
|
---|
[241] | 716 | pDoPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(char), true );
|
---|
[3] | 717 |
|
---|
[247] | 718 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule1 );
|
---|
| 719 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule2 );
|
---|
[3] | 720 | }
|
---|
| 721 | else if(basbuf[i3]=='1'){
|
---|
| 722 | //Until
|
---|
| 723 |
|
---|
| 724 | //jmp 2(ループを続ける)
|
---|
[248] | 725 | const PertialSchedule *pTempPertialSchedule3 = compiler.codeGenerator.op_jmp( 0, sizeof(char), true );
|
---|
[3] | 726 |
|
---|
[247] | 727 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule1 );
|
---|
| 728 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule2 );
|
---|
[3] | 729 |
|
---|
| 730 | //jmp 5(ループ終了)
|
---|
[241] | 731 | pDoPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(char), true );
|
---|
[247] | 732 |
|
---|
| 733 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule3 );
|
---|
[3] | 734 | }
|
---|
| 735 | }
|
---|
| 736 | else{
|
---|
| 737 | //pop eax
|
---|
[225] | 738 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 739 |
|
---|
| 740 | //cmp eax,0
|
---|
[236] | 741 | compiler.codeGenerator.op_cmp_value( sizeof(long), REG_EAX, 0 );
|
---|
[3] | 742 |
|
---|
| 743 | if(basbuf[i3]=='0'){
|
---|
| 744 | //While
|
---|
| 745 |
|
---|
| 746 | //je 5(ループ終了)
|
---|
[241] | 747 | pDoPertialSchedule = compiler.codeGenerator.op_je( 0, sizeof(char), true );
|
---|
[3] | 748 | }
|
---|
| 749 | else if(basbuf[i3]=='1'){
|
---|
| 750 | //Until
|
---|
| 751 |
|
---|
| 752 | //jne 5(ループ終了)
|
---|
[241] | 753 | pDoPertialSchedule = compiler.codeGenerator.op_jne( 0, sizeof(char), true );
|
---|
[3] | 754 | }
|
---|
| 755 | }
|
---|
| 756 | break;
|
---|
| 757 | }
|
---|
| 758 | }
|
---|
| 759 |
|
---|
| 760 | //jmp ...
|
---|
[241] | 761 | compiler.codeGenerator.op_jmp_continue();
|
---|
[3] | 762 |
|
---|
[241] | 763 | if( pDoPertialSchedule )
|
---|
| 764 | {
|
---|
| 765 | compiler.codeGenerator.opfix_JmpPertialSchedule( pDoPertialSchedule );
|
---|
| 766 | }
|
---|
| 767 |
|
---|
[3] | 768 | //jmp ...
|
---|
[248] | 769 | const PertialSchedule *pTempPertialSchedule = compiler.codeGenerator.op_jmp( 0, sizeof(long), true );
|
---|
[3] | 770 |
|
---|
| 771 | //レキシカルスコープをレベルダウン
|
---|
[248] | 772 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 773 |
|
---|
[243] | 774 | //jmpジャンプ先のオフセット値
|
---|
| 775 | compiler.codeGenerator.opfix_JmpPertialSchedule( pTempPertialSchedule );
|
---|
[3] | 776 |
|
---|
| 777 | //Continueアドレスを復元
|
---|
[241] | 778 | compiler.codeGenerator.ContinueAreaEnd();
|
---|
[3] | 779 | }
|
---|
| 780 | void OpcodeContinue(void){
|
---|
| 781 | //jmp ...(Continue addr)
|
---|
[241] | 782 | compiler.codeGenerator.op_jmp_continue();
|
---|
[3] | 783 | }
|
---|
| 784 |
|
---|
| 785 | void OpcodeExitSub(void){
|
---|
| 786 | extern HANDLE hHeap;
|
---|
| 787 |
|
---|
[76] | 788 | if( UserProc::IsGlobalAreaCompiling() ){
|
---|
[3] | 789 | SetError(12,"Exit Sub/Function",cp);
|
---|
| 790 | return;
|
---|
| 791 | }
|
---|
| 792 |
|
---|
[34] | 793 | //未解放のローカルオブジェクトのデストラクタを呼び出す
|
---|
[248] | 794 | compiler.codeGenerator.lexicalScopes.CallDestructorsOfReturn();
|
---|
[34] | 795 |
|
---|
[3] | 796 | //jmp ...(End Sub/Function)
|
---|
[247] | 797 | compiler.codeGenerator.op_jmp_exitsub();
|
---|
[3] | 798 | }
|
---|
| 799 |
|
---|
| 800 | void AddCaseSchedule(void){
|
---|
| 801 | extern DWORD *pCaseSchedule;
|
---|
| 802 | extern int CaseScheduleNum;
|
---|
| 803 | extern HANDLE hHeap;
|
---|
| 804 |
|
---|
| 805 | pCaseSchedule=(DWORD *)HeapReAlloc(hHeap,0,pCaseSchedule,(CaseScheduleNum+1)*sizeof(DWORD));
|
---|
| 806 | pCaseSchedule[CaseScheduleNum]=obp;
|
---|
| 807 | CaseScheduleNum++;
|
---|
| 808 | }
|
---|
| 809 |
|
---|
| 810 | int CaseTypeSize;
|
---|
[76] | 811 | void OpcodeSelect(const char *lpszParms){
|
---|
[3] | 812 | extern DWORD *pCaseSchedule;
|
---|
| 813 | extern int CaseScheduleNum;
|
---|
| 814 | extern int NowCaseSchedule;
|
---|
| 815 | extern int CaseTypeSize;
|
---|
| 816 | extern HANDLE hHeap;
|
---|
| 817 | extern char *basbuf;
|
---|
[76] | 818 | int i,i2,i3,sw,NowCaseCp;
|
---|
[3] | 819 | char temporary[VN_SIZE];
|
---|
| 820 |
|
---|
| 821 | DWORD *temp_pCaseSchedule;
|
---|
| 822 | int temp_CaseScheduleNum;
|
---|
| 823 | int temp_NowCaseSchedule;
|
---|
| 824 | int temp_CaseTypeSize;
|
---|
| 825 |
|
---|
| 826 | temp_pCaseSchedule=pCaseSchedule;
|
---|
| 827 | temp_CaseScheduleNum=CaseScheduleNum;
|
---|
| 828 | temp_NowCaseSchedule=NowCaseSchedule;
|
---|
| 829 | temp_CaseTypeSize=CaseTypeSize;
|
---|
| 830 | pCaseSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
|
---|
| 831 | CaseScheduleNum=0;
|
---|
| 832 | NowCaseSchedule=0;
|
---|
| 833 |
|
---|
[76] | 834 | Type type1;
|
---|
| 835 | if( !NumOpe(lpszParms,Type(), type1 ) ){
|
---|
| 836 | return;
|
---|
[3] | 837 | }
|
---|
| 838 |
|
---|
[76] | 839 | CaseTypeSize = type1.GetSize();
|
---|
| 840 | if( CaseTypeSize < sizeof(long) ){
|
---|
| 841 | CaseTypeSize=sizeof(long);
|
---|
| 842 | }
|
---|
| 843 |
|
---|
[3] | 844 | for(i=cp,sw=0;;i++){
|
---|
| 845 | if(basbuf[i]=='\0'){
|
---|
| 846 | HeapDefaultFree(pCaseSchedule);
|
---|
| 847 | pCaseSchedule=temp_pCaseSchedule;
|
---|
| 848 | CaseScheduleNum=temp_CaseScheduleNum;
|
---|
| 849 | NowCaseSchedule=temp_NowCaseSchedule;
|
---|
| 850 | CaseTypeSize=temp_CaseTypeSize;
|
---|
| 851 | SetError(22,"Select",cp);
|
---|
| 852 | return;
|
---|
| 853 | }
|
---|
| 854 | if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE){
|
---|
| 855 | for(i2=0;;i++){
|
---|
| 856 | if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE) i2++;
|
---|
| 857 | if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
|
---|
| 858 | i2--;
|
---|
| 859 | if(i2==0) break;
|
---|
| 860 | }
|
---|
| 861 | }
|
---|
| 862 | continue;
|
---|
| 863 | }
|
---|
| 864 | if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
|
---|
| 865 | if(sw==0){
|
---|
| 866 | //add esp,CaseTypeSize
|
---|
[225] | 867 | compiler.codeGenerator.op_add_esp(CaseTypeSize);
|
---|
[3] | 868 | }
|
---|
| 869 | break;
|
---|
| 870 | }
|
---|
| 871 | if(basbuf[i]==1&&basbuf[i+1]==ESC_CASE){
|
---|
| 872 | NowCaseCp=i;
|
---|
| 873 |
|
---|
| 874 | i++;
|
---|
| 875 | while(1){
|
---|
| 876 | for(i++,i2=0;;i++,i2++){
|
---|
| 877 | if(basbuf[i]=='\"'){
|
---|
| 878 | i3=GetStringInQuotation(temporary+i2,basbuf+i);
|
---|
| 879 | i+=i3-1;
|
---|
| 880 | i2+=i3-1;
|
---|
| 881 | continue;
|
---|
| 882 | }
|
---|
| 883 | if(basbuf[i]=='('){
|
---|
| 884 | i3=GetStringInPare(temporary+i2,basbuf+i);
|
---|
| 885 | i+=i3-1;
|
---|
| 886 | i2+=i3-1;
|
---|
| 887 | continue;
|
---|
| 888 | }
|
---|
| 889 | if(basbuf[i]=='['){
|
---|
| 890 | i3=GetStringInBracket(temporary+i2,basbuf+i);
|
---|
| 891 | i+=i3-1;
|
---|
| 892 | i2+=i3-1;
|
---|
| 893 | continue;
|
---|
| 894 | }
|
---|
| 895 |
|
---|
| 896 | if(IsCommandDelimitation(basbuf[i])){
|
---|
| 897 | temporary[i2]=0;
|
---|
| 898 | break;
|
---|
| 899 | }
|
---|
| 900 | if(basbuf[i]==','){
|
---|
| 901 | temporary[i2]=0;
|
---|
| 902 | break;
|
---|
| 903 | }
|
---|
| 904 |
|
---|
| 905 | temporary[i2]=basbuf[i];
|
---|
| 906 | }
|
---|
| 907 |
|
---|
| 908 | //エラー用
|
---|
| 909 | i2=cp;
|
---|
| 910 | cp=NowCaseCp;
|
---|
| 911 |
|
---|
[76] | 912 | Type type2;
|
---|
| 913 | if( !NumOpe(temporary,type1,type2) ){
|
---|
| 914 | return;
|
---|
| 915 | }
|
---|
[3] | 916 |
|
---|
| 917 | cp=i2;
|
---|
| 918 |
|
---|
[76] | 919 | if(type1.IsObject()){
|
---|
[206] | 920 | std::vector<const UserProc *> subs;
|
---|
[135] | 921 | type1.GetClass().GetMethods().Enum( CALC_EQUAL, subs );
|
---|
[50] | 922 | if( subs.size() == 0 ){
|
---|
[3] | 923 | return;
|
---|
| 924 | }
|
---|
| 925 |
|
---|
[75] | 926 | Parameters params;
|
---|
[76] | 927 | params.push_back( new Parameter( "", Type( type2 ) ) );
|
---|
[3] | 928 |
|
---|
| 929 | //オーバーロードを解決
|
---|
[206] | 930 | const UserProc *pUserProc = OverloadSolution("==",subs, params, NULL);
|
---|
[3] | 931 |
|
---|
[75] | 932 | delete params[0];
|
---|
| 933 |
|
---|
| 934 | if(!pUserProc){
|
---|
[3] | 935 | //エラー
|
---|
| 936 | return;
|
---|
| 937 | }
|
---|
| 938 |
|
---|
| 939 |
|
---|
| 940 | //pop edx
|
---|
[225] | 941 | compiler.codeGenerator.op_pop(REG_EDX);
|
---|
[3] | 942 |
|
---|
| 943 | //mov ecx,dword ptr[esp]
|
---|
[225] | 944 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_ESP,0,MOD_BASE);
|
---|
[3] | 945 |
|
---|
| 946 | //push edx
|
---|
[225] | 947 | compiler.codeGenerator.op_push(REG_EDX);
|
---|
[3] | 948 |
|
---|
| 949 | //push ecx
|
---|
[225] | 950 | compiler.codeGenerator.op_push(REG_ECX);
|
---|
[3] | 951 |
|
---|
| 952 | //call operator_proc ※ ==演算子
|
---|
[225] | 953 | compiler.codeGenerator.op_call(pUserProc);
|
---|
[3] | 954 |
|
---|
| 955 | //test eax,eax
|
---|
[225] | 956 | compiler.codeGenerator.op_test(REG_EAX,REG_EAX);
|
---|
[3] | 957 |
|
---|
| 958 | //jne ...
|
---|
| 959 | OpBuffer[obp++]=(char)0x0F;
|
---|
| 960 | OpBuffer[obp++]=(char)0x85;
|
---|
| 961 | AddCaseSchedule();
|
---|
| 962 | obp+=sizeof(long);
|
---|
| 963 | }
|
---|
[76] | 964 | else if(type1.IsDouble()){
|
---|
| 965 | ChangeTypeToDouble(type2.GetBasicType());
|
---|
[3] | 966 |
|
---|
| 967 | //fld qword ptr[esp]
|
---|
[225] | 968 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 969 |
|
---|
| 970 | //add esp,CaseTypeSize
|
---|
[225] | 971 | compiler.codeGenerator.op_add_esp(CaseTypeSize);
|
---|
[3] | 972 |
|
---|
| 973 | //fld qword ptr[esp]
|
---|
[225] | 974 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 975 |
|
---|
| 976 | //fcompp
|
---|
[225] | 977 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 978 |
|
---|
| 979 | //fnstsw ax
|
---|
[225] | 980 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 981 |
|
---|
| 982 | //test ah,40
|
---|
[225] | 983 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 984 |
|
---|
| 985 | //jne ...
|
---|
| 986 | OpBuffer[obp++]=(char)0x0F;
|
---|
| 987 | OpBuffer[obp++]=(char)0x85;
|
---|
| 988 | AddCaseSchedule();
|
---|
| 989 | obp+=sizeof(long);
|
---|
| 990 | }
|
---|
[76] | 991 | else if(type1.IsSingle()){
|
---|
| 992 | ChangeTypeToSingle(type2.GetBasicType());
|
---|
[3] | 993 |
|
---|
| 994 | //fld dword ptr[esp]
|
---|
[225] | 995 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 996 |
|
---|
| 997 | //add esp,CaseTypeSize
|
---|
[225] | 998 | compiler.codeGenerator.op_add_esp(CaseTypeSize);
|
---|
[3] | 999 |
|
---|
| 1000 | //fld dword ptr[esp]
|
---|
[225] | 1001 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 1002 |
|
---|
| 1003 | //fcompp
|
---|
[225] | 1004 | compiler.codeGenerator.op_fcompp();
|
---|
[3] | 1005 |
|
---|
| 1006 | //fnstsw ax
|
---|
[225] | 1007 | compiler.codeGenerator.op_fnstsw_ax();
|
---|
[3] | 1008 |
|
---|
| 1009 | //test ah,40
|
---|
[225] | 1010 | compiler.codeGenerator.op_test_ah( (char)0x40 );
|
---|
[3] | 1011 |
|
---|
| 1012 | //jne ...
|
---|
| 1013 | OpBuffer[obp++]=(char)0x0F;
|
---|
| 1014 | OpBuffer[obp++]=(char)0x85;
|
---|
| 1015 | AddCaseSchedule();
|
---|
| 1016 | obp+=sizeof(long);
|
---|
| 1017 | }
|
---|
| 1018 | else{
|
---|
| 1019 | //その他整数型
|
---|
| 1020 |
|
---|
| 1021 | //pop ebx
|
---|
[225] | 1022 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1023 |
|
---|
| 1024 | //mov eax,dword ptr[esp]
|
---|
[236] | 1025 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_ESP, 0, MOD_BASE );
|
---|
[3] | 1026 |
|
---|
| 1027 | //cmp eax,ebx
|
---|
[227] | 1028 | compiler.codeGenerator.op_cmp_RR( REG_EAX, REG_EBX );
|
---|
[3] | 1029 |
|
---|
| 1030 | //je ...
|
---|
| 1031 | OpBuffer[obp++]=(char)0x0F;
|
---|
| 1032 | OpBuffer[obp++]=(char)0x84;
|
---|
| 1033 | AddCaseSchedule();
|
---|
| 1034 | obp+=sizeof(long);
|
---|
| 1035 | }
|
---|
| 1036 |
|
---|
| 1037 | if(basbuf[i]!=',') break;
|
---|
| 1038 | }
|
---|
| 1039 | }
|
---|
| 1040 | if(basbuf[i]==1&&basbuf[i+1]==ESC_CASEELSE){
|
---|
| 1041 | sw=1;
|
---|
| 1042 |
|
---|
| 1043 | //jmp ...
|
---|
| 1044 | OpBuffer[obp++]=(char)0xE9;
|
---|
| 1045 | AddCaseSchedule();
|
---|
| 1046 | obp+=sizeof(long);
|
---|
| 1047 | }
|
---|
| 1048 | }
|
---|
| 1049 |
|
---|
| 1050 | //レキシカルスコープをレベルアップ
|
---|
[248] | 1051 | compiler.codeGenerator.lexicalScopes.Start( obp, LexicalScope::SCOPE_TYPE_SELECT );
|
---|
[3] | 1052 |
|
---|
| 1053 | //Select Case内をコンパイル
|
---|
| 1054 | CompileBuffer(ESC_ENDSELECT,0);
|
---|
| 1055 |
|
---|
| 1056 | //jmp EndSelect
|
---|
| 1057 | OpBuffer[obp++]=(char)0xE9;
|
---|
| 1058 | AddCaseSchedule();
|
---|
| 1059 | obp+=sizeof(long);
|
---|
| 1060 |
|
---|
| 1061 | //最終スケジュール
|
---|
| 1062 | for(i=NowCaseSchedule;i<CaseScheduleNum;i++){
|
---|
| 1063 | *(long *)(OpBuffer+pCaseSchedule[i])=obp-(pCaseSchedule[i]+sizeof(long));
|
---|
| 1064 | }
|
---|
| 1065 | HeapDefaultFree(pCaseSchedule);
|
---|
| 1066 |
|
---|
| 1067 | //レキシカルスコープをレベルダウン
|
---|
[248] | 1068 | compiler.codeGenerator.lexicalScopes.End();
|
---|
[3] | 1069 |
|
---|
| 1070 | pCaseSchedule=temp_pCaseSchedule;
|
---|
| 1071 | CaseScheduleNum=temp_CaseScheduleNum;
|
---|
| 1072 | NowCaseSchedule=temp_NowCaseSchedule;
|
---|
| 1073 | CaseTypeSize=temp_CaseTypeSize;
|
---|
| 1074 | }
|
---|
| 1075 | void OpcodeCase(char *Parameter){
|
---|
| 1076 | extern DWORD *pCaseSchedule;
|
---|
| 1077 | extern int NowCaseSchedule;
|
---|
| 1078 | extern int CaseTypeSize;
|
---|
| 1079 | int i;
|
---|
| 1080 |
|
---|
| 1081 | if(!pCaseSchedule){
|
---|
| 1082 | SetError(30,"Case",cp);
|
---|
| 1083 | return;
|
---|
| 1084 | }
|
---|
| 1085 |
|
---|
| 1086 | //jmp EndSelect
|
---|
| 1087 | OpBuffer[obp++]=(char)0xE9;
|
---|
| 1088 | AddCaseSchedule();
|
---|
| 1089 | obp+=sizeof(long);
|
---|
| 1090 |
|
---|
| 1091 | i=0;
|
---|
| 1092 | while(1){
|
---|
| 1093 | //Caseスケジュール
|
---|
| 1094 | *(long *)(OpBuffer+pCaseSchedule[NowCaseSchedule])=obp-(pCaseSchedule[NowCaseSchedule]+sizeof(long));
|
---|
| 1095 | NowCaseSchedule++;
|
---|
| 1096 |
|
---|
| 1097 | i=JumpOneParameter(Parameter,i);
|
---|
| 1098 | if(Parameter[i]=='\0') break;
|
---|
| 1099 | }
|
---|
| 1100 |
|
---|
| 1101 | //add esp,CaseTypeSize
|
---|
[225] | 1102 | compiler.codeGenerator.op_add_esp(CaseTypeSize);
|
---|
[3] | 1103 | }
|
---|
| 1104 |
|
---|
| 1105 | void OpcodeGosub(char *Parameter){
|
---|
| 1106 | extern HANDLE hHeap;
|
---|
| 1107 | int i,LineNum;
|
---|
| 1108 |
|
---|
| 1109 | if(Parameter[0]=='*'){
|
---|
| 1110 | i=GetLabelAddress(Parameter+1,0);
|
---|
| 1111 |
|
---|
[246] | 1112 | if( i == -1 )
|
---|
| 1113 | {
|
---|
| 1114 | //jmp ...(schedule)
|
---|
| 1115 | compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( (const std::string)(Parameter + 1), obp, cp ) );
|
---|
[3] | 1116 | }
|
---|
[246] | 1117 | else
|
---|
| 1118 | {
|
---|
| 1119 | //jmp ...
|
---|
| 1120 | compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
|
---|
| 1121 | }
|
---|
[3] | 1122 | }
|
---|
| 1123 | else{
|
---|
| 1124 | LineNum=atoi(Parameter);
|
---|
| 1125 | i=GetLabelAddress(0,LineNum);
|
---|
| 1126 |
|
---|
[246] | 1127 | if( i == -1 )
|
---|
| 1128 | {
|
---|
| 1129 | //jmp ...(schedule)
|
---|
| 1130 | compiler.codeGenerator.op_jmp_goto_schedule( GotoLabelSchedule( LineNum, obp, cp ) );
|
---|
[3] | 1131 | }
|
---|
[246] | 1132 | else
|
---|
| 1133 | {
|
---|
| 1134 | //jmp ...
|
---|
| 1135 | compiler.codeGenerator.op_jmp( i-obp, sizeof(long), false, true );
|
---|
| 1136 | }
|
---|
[3] | 1137 | }
|
---|
| 1138 | }
|
---|
| 1139 | void OpcodeReturn(char *Parameter){
|
---|
[76] | 1140 | if( UserProc::IsGlobalAreaCompiling() ){
|
---|
[3] | 1141 | //Gosub~Returnとして扱う
|
---|
| 1142 |
|
---|
| 1143 | //ret
|
---|
[225] | 1144 | compiler.codeGenerator.op_ret();
|
---|
[3] | 1145 | }
|
---|
| 1146 | else{
|
---|
| 1147 | //戻り値をセット
|
---|
| 1148 | if(Parameter[0]){
|
---|
[206] | 1149 | const UserProc &proc = UserProc::CompilingUserProc();
|
---|
[76] | 1150 |
|
---|
[75] | 1151 | const char *temp = "_System_ReturnValue";
|
---|
[76] | 1152 | if(proc.GetName()[0]==1&&proc.GetName()[1]==ESC_OPERATOR)
|
---|
[75] | 1153 | {
|
---|
| 1154 | }
|
---|
[76] | 1155 | else{
|
---|
| 1156 | temp=proc.GetName().c_str();
|
---|
| 1157 | }
|
---|
[3] | 1158 |
|
---|
[75] | 1159 | char temporary[VN_SIZE];
|
---|
| 1160 | sprintf(temporary,"%s=%s",temp,Parameter);
|
---|
| 1161 | OpcodeCalc(temporary);
|
---|
[3] | 1162 | }
|
---|
| 1163 |
|
---|
| 1164 | //プロシージャを抜け出す(C言語のreturnと同様の処理を行う)
|
---|
| 1165 | OpcodeExitSub();
|
---|
| 1166 | }
|
---|
| 1167 | }
|
---|
| 1168 |
|
---|
| 1169 |
|
---|
| 1170 | ////////////
|
---|
| 1171 | // ポインタ
|
---|
| 1172 |
|
---|
| 1173 | void OpcodeSetPtrData(char *Parameter,int type){
|
---|
[76] | 1174 | int i;
|
---|
[3] | 1175 | char temporary[VN_SIZE];
|
---|
| 1176 |
|
---|
| 1177 | if(Parameter[0]=='('){
|
---|
| 1178 | i=JumpStringInPare(Parameter,1);
|
---|
| 1179 | if(Parameter[i+1]=='\0'){
|
---|
| 1180 | for(i=0;;i++){
|
---|
| 1181 | Parameter[i]=Parameter[i+1];
|
---|
| 1182 | if(Parameter[i]=='\0') break;
|
---|
| 1183 | }
|
---|
| 1184 | Parameter[i-1]=0;
|
---|
| 1185 | }
|
---|
| 1186 | }
|
---|
| 1187 |
|
---|
| 1188 | //第1パラメータを取得
|
---|
| 1189 | i=GetOneParameter(Parameter,0,temporary);
|
---|
| 1190 | if(!Parameter[i]){
|
---|
| 1191 | SetError(1,NULL,cp);
|
---|
| 1192 | return;
|
---|
| 1193 | }
|
---|
| 1194 |
|
---|
[76] | 1195 | Type resultType;
|
---|
| 1196 | if( !NumOpe(temporary,Type(),resultType) ){
|
---|
| 1197 | return;
|
---|
| 1198 | }
|
---|
| 1199 | if(!resultType.IsWhole()){
|
---|
| 1200 | SetError(11,Parameter,cp);
|
---|
| 1201 | return;
|
---|
| 1202 | }
|
---|
[3] | 1203 |
|
---|
[76] | 1204 | ChangeTypeToLong( resultType.GetBasicType() );
|
---|
| 1205 |
|
---|
[3] | 1206 | //第2パラメータを取得
|
---|
| 1207 | i=GetOneParameter(Parameter,i,temporary);
|
---|
| 1208 | if(Parameter[i]){
|
---|
| 1209 | SetError(1,NULL,cp);
|
---|
| 1210 | return;
|
---|
| 1211 | }
|
---|
| 1212 |
|
---|
[76] | 1213 | if( !NumOpe(temporary,Type(),resultType) ){
|
---|
| 1214 | return;
|
---|
| 1215 | }
|
---|
| 1216 |
|
---|
[3] | 1217 | if(type==DEF_DOUBLE){
|
---|
[76] | 1218 | ChangeTypeToDouble_ToFpuReg( resultType.GetBasicType() );
|
---|
[3] | 1219 |
|
---|
| 1220 | //pop eax
|
---|
[225] | 1221 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1222 |
|
---|
| 1223 | //fstp qword ptr[eax]
|
---|
[236] | 1224 | compiler.codeGenerator.PutOld(
|
---|
| 1225 | (char)0xDD,
|
---|
| 1226 | (char)0x18
|
---|
| 1227 | );
|
---|
[3] | 1228 | }
|
---|
| 1229 | else if(type==DEF_SINGLE){
|
---|
[76] | 1230 | ChangeTypeToSingle( resultType.GetBasicType() );
|
---|
[3] | 1231 |
|
---|
| 1232 | //pop ebx
|
---|
[225] | 1233 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1234 |
|
---|
| 1235 | //pop eax
|
---|
[225] | 1236 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1237 |
|
---|
| 1238 | //mov dword ptr[eax],ebx
|
---|
[225] | 1239 | compiler.codeGenerator.op_mov_MR( sizeof(long), REG_EBX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 1240 | }
|
---|
| 1241 | else if(type==DEF_QWORD){
|
---|
[76] | 1242 | ChangeTypeToInt64( resultType.GetBasicType() );
|
---|
[3] | 1243 |
|
---|
| 1244 | //pop ecx
|
---|
[225] | 1245 | compiler.codeGenerator.op_pop(REG_ECX);
|
---|
[3] | 1246 |
|
---|
| 1247 | //pop ebx
|
---|
[225] | 1248 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1249 |
|
---|
| 1250 | //pop eax
|
---|
[225] | 1251 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1252 |
|
---|
| 1253 | //mov dword ptr[eax],ecx
|
---|
[225] | 1254 | compiler.codeGenerator.op_mov_MR( sizeof(long), REG_ECX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 1255 |
|
---|
| 1256 | //mov dword ptr[eax+sizeof(long)],ebx
|
---|
[225] | 1257 | compiler.codeGenerator.op_mov_MR( sizeof(long), REG_EBX, REG_EAX, 0x04, MOD_BASE_DISP8 );
|
---|
[3] | 1258 | }
|
---|
| 1259 | else if(type==DEF_DWORD){
|
---|
[76] | 1260 | ChangeTypeToLong( resultType.GetBasicType() );
|
---|
[3] | 1261 |
|
---|
| 1262 | //pop ebx
|
---|
[225] | 1263 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1264 |
|
---|
| 1265 | //pop eax
|
---|
[225] | 1266 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1267 |
|
---|
| 1268 | //mov dword ptr[eax],ebx
|
---|
[225] | 1269 | compiler.codeGenerator.op_mov_MR( sizeof(long), REG_EBX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 1270 | }
|
---|
| 1271 | else if(type==DEF_WORD){
|
---|
[76] | 1272 | ChangeTypeToLong( resultType.GetBasicType() );
|
---|
[3] | 1273 |
|
---|
| 1274 | //pop ebx
|
---|
[225] | 1275 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1276 |
|
---|
| 1277 | //pop eax
|
---|
[225] | 1278 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1279 |
|
---|
| 1280 | //mov word ptr[eax],bx
|
---|
[236] | 1281 | compiler.codeGenerator.op_mov_MR( sizeof(short), REG_EBX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 1282 | }
|
---|
| 1283 | else if(type==DEF_BYTE){
|
---|
[76] | 1284 | ChangeTypeToLong( resultType.GetBasicType() );
|
---|
[3] | 1285 |
|
---|
| 1286 | //pop ebx
|
---|
[225] | 1287 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 1288 |
|
---|
| 1289 | //pop eax
|
---|
[225] | 1290 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 1291 |
|
---|
| 1292 | //mov byte ptr[eax],bl
|
---|
[236] | 1293 | compiler.codeGenerator.op_mov_MR( sizeof(char), REG_EBX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 1294 | }
|
---|
| 1295 | }
|
---|