source: dev/BasicCompiler32/Compile_Statement.cpp@ 122

Last change on this file since 122 was 122, checked in by dai_9181, 18 years ago

(呼び出し単体コードも対応→)関数の戻り値オブジェクトのメンバ・メソッドを一時オブジェクトを介さずに参照できるようにした。

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