Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Joshobotic VM
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <stdlib.h>
- enum ValueTypes {
- VALUE_8POS, VALUE_8NEG, VALUE_16POS, VALUE_16NEG, VALUE_32CONST, VALUE_VARIABLE, VALUE_FUNCTION, VALUE_ORIGINAL,
- VALUE_ADDITION, VALUE_SUBTRACT, VALUE_MULTIPLY, VALUE_DIVIDE, VALUE_MODULO, VALUE_BIT_AND, VALUE_BIT_OR, VALUE_BIT_XOR,
- VALUE_TERNARY, VALUE_MIN, VALUE_MAX, VALUE_NEGATE, VALUE_INDIRECT, VALUE_INDIRECT_INDEX, VALUE_SHIFT_LEFT, VALUE_SHIFT_RIGHT,
- VALUE_BOOL_TO_VAL1, VALUE_BOOL_TO_VAL2, VALUE_ARRAYVALUE, VALUE_ARRAYREFERENCE, VALUE_BIT_NOT, VALUE_INDIRECT_SET,
- VALUE_INCREMENT, VALUE_DECREMENT,
- VALUE_PREDEC_INDIRECT, VALUE_PREINC_INDIRECT, VALUE_POSTDEC_INDIRECT, VALUE_POSTINC_INDIRECT,
- VALUE_POST_ADD, VALUE_POST_SUB, VALUE_LOOP_INDEX,
- VALUE_4POS = 0x30, VALUE_4NEG = 0x40, VALUE_FUNCARG = 0x50, VALUE_ARGREF = 0x60,
- };
- enum BoolTypes {
- BOOL_CMP, BOOL_NOT, BOOL_AND, BOOL_OR, BOOL_XOR, BOOL_NAND, BOOL_NOR, BOOL_NXOR, BOOL_TRUE, BOOL_FALSE, BOOL_RANDOM, BOOL_NONZERO
- BOOL_FUNCTION, BOOL_MEMCMP, BOOL_STRCMP, BOOL_STRCASECMP,
- BOOL_EQUAL, BOOL_NOTEQUAL, BOOL_LESSTHAN, BOOL_LESSEQUAL, BOOL_GREATERTHAN, BOOL_GREATEREQUAL,
- BOOL_AND3, BOOL_AND4, BOOL_AND5, BOOL_OR3, BOOL_OR4, BOOL_OR5
- };
- enum CompTypes {
- COMP_EQUALTO, COMP_NOTEQUAL, COMP_LESSTHAN, COMP_LESSEQUAL, COMP_GREATERTHAN, COMP_GREATEREQUAL
- };
- enum OpcodeTypes {
- OPCODE_SET = 0x08, OPCODE_SWAP = 0x0c, OPCODE_MATH = 0x10, OPCODE_RMATH = 0x14,
- OPCODE_GOTO = 0x18, OPCODE_CALL = 0x1b, OPCODE_RETURN = 0x1e, OPCODE_FRET = 0x20,
- OPCODE_INITLOCAL = 0x23, OPCODE_ACALL = 0x24, OPCODE_ATAIL = 0x26, OPCODE_ARET = 0x28
- };
- //set, swap, add, sub, goto, call, return, function return, initlocal, argument call, argument tailcall, argument return
- void JVM_InitVM(JVM_Info *VM) {
- VM->PC = 0;
- VM->ParamStackPointer = 0;
- VM->ReturnStackPointer = 0;
- int i,j;
- for(i=0;i<JVM_PARAM_STACK_LENGTH;i++)
- for(j=0;j<JVM_PARAM_STACK_ITEMS;j++)
- VM->ParamStackData[i][j]=0;
- }
- char JVM_Compare2(char Code, signed long A, signed long B) {
- switch(Code) {
- case COMP_EQUALTO:
- return A==B;
- case COMP_NOTEQUAL:
- return A!=B;
- case COMP_LESSTHAN:
- return A<B;
- case COMP_LESSEQUAL:
- return A<=B;
- case COMP_GREATERTHAN:
- return A>B;
- case COMP_GREATEREQUAL:
- return A>=B;
- }
- return 0;
- }
- signed long JVM_ReadValue(JVM_Info*, unsigned char*, unsigned char**);
- char JVM_ReadBool(JVM_Info *VM, unsigned char *Peek, unsigned char **End) {
- long A, B, C, D, E;
- unsigned char op = *(Peek++);
- switch(op) {
- case BOOL_CMP:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadValue(VM, *End, End);
- C = JVM_ReadValue(VM, *End, End);
- return JVM_Compare2(A, B, C);
- case BOOL_NOT:
- return !JVM_ReadBool(VM, Peek, End);
- case BOOL_AND:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return A&&B;
- case BOOL_OR:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return A||B;
- case BOOL_XOR:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return (A!=0)!=(B!=0);
- case BOOL_NAND:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return !(A&&B);
- case BOOL_NOR:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return !(A||B);
- case BOOL_NXOR:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- return (A!=0)==(B!=0);
- case BOOL_TRUE:
- return 1;
- case BOOL_FALSE:
- return 0;
- case BOOL_RANDOM:
- return rand()&1;
- case BOOL_NONZERO:
- A = JVM_ReadValue(VM, Peek, End);
- return A!=0;
- break;
- case BOOL_EQUAL ... CASE BOOL_GREATEREQUAL:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadValue(VM, *End, End);
- C = JVM_ReadValue(VM, *End, End);
- return JVM_Compare2(A, B, code-BOOL_EQUAL);
- case BOOL_AND3:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- return A&&B&&C;
- case BOOL_AND4:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- D = JVM_ReadBool(VM, *End, End);
- return A&&B&&C&&D;
- case BOOL_AND5:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- D = JVM_ReadBool(VM, *End, End);
- E = JVM_ReadBool(VM, *End, End);
- return A&&B&&C&&D&&E;
- case BOOL_OR3:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- return A||B||C;
- case BOOL_OR4:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- D = JVM_ReadBool(VM, *End, End);
- return A||B||C||D;
- case BOOL_OR5:
- A = JVM_ReadBool(VM, Peek, End);
- B = JVM_ReadBool(VM, *End, End);
- C = JVM_ReadBool(VM, *End, End);
- D = JVM_ReadBool(VM, *End, End);
- E = JVM_ReadBool(VM, *End, End);
- return A||B||C||D||E;
- }
- return 0;
- }
- signed long JVM_ReadValue(JVM_Info *VM, unsigned char *Peek, unsigned char **End) {
- long A, B;
- char cc;
- unsigned short *ShortPtr;
- long *LongPtr;
- JVM_VarAddrSpace *VarPtr;
- switch(*(Peek++)) {
- case VALUE_8POS:
- A = (unsigned char)Peek[0];
- (*End)+=2;
- return A;
- case VALUE_8NEG:
- A = (unsigned char)Peek[0];
- (*End)+=2;
- return -A;
- case VALUE_16POS:
- ShortPtr = (unsigned short*)(Peek);
- (*End)+=3;
- return *ShortPtr;
- case VALUE_16NEG:
- ShortPtr = (unsigned short*)(Peek);
- (*End)+=3;
- return -(*ShortPtr);
- case VALUE_32CONST:
- LongPtr = (signed long*)(Peek);
- (*End)+=5;
- return *LongPtr;
- case VALUE_VARIABLE:
- VarPtr = (JVM_VarAddrSpace*)(Peek);
- (*End)+=1+sizeof(JVM_VarAddrSpace);
- return JVM_ReadMemory(VM, *VarPtr);;
- case VALUE_FUNCTION:
- // implement later
- break;
- case VALUE_ORIGINAL:
- return VM->OriginalValue[VM->OriginalValuePointer];
- case VALUE_ADDITION:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A+B;
- case VALUE_SUBTRACT:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A-B;
- case VALUE_MULTIPLY:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A*B;
- case VALUE_DIVIDE:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- if(!B) return 0;
- return A/B;
- case VALUE_MODULO:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- if(!B) return 0;
- return A%B;
- case VALUE_BIT_AND:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A&B;
- case VALUE_BIT_OR:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A|B;
- case VALUE_BIT_XOR:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A^B;
- case VALUE_TERNARY:
- cc = JVM_ReadBool(VM, Peek, &Peek);
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return cc?A:B;
- case VALUE_MIN:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- if(A<B) return A;
- return B;
- case VALUE_MAX:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- if(A>B) return A;
- return B;
- case VALUE_NEGATE:
- A = JVM_ReadValue(VM, Peek, End);
- return -B;
- case VALUE_INDIRECT:
- A = JVM_ReadValue(VM, Peek, End);
- return JVM_ReadMemory(VM, A);
- case VALUE_INDIRECT_INDEX:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return JVM_ReadMemory(VM, A+B);
- case VALUE_SHIFT_LEFT:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A<<B;
- case VALUE_SHIFT_RIGHT:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- return A>>B;
- case VALUE_BOOL_TO_VAL1:
- A = JVM_ReadBool(VM, Peek, End);
- return A;
- case VALUE_BOOL_TO_VAL2:
- A = JVM_ReadBool(VM, Peek, End);
- return -A;
- case VALUE_ARRAYVALUE:
- ShortPtr = (unsigned short*)(Peek);
- Peek+=2;
- A = JVM_ReadValue(VM, Peek, End);
- return JVM_ReadMemory(VM, A+B);
- case VALUE_ARRAYREFERENCE:
- ShortPtr = (unsigned short*)(Peek);
- Peek+=2;
- A = JVM_ReadValue(VM, Peek, End);
- return A+B;
- case VALUE_BIT_NOT:
- A = JVM_ReadValue(VM, Peek, End);
- return ~A;
- case VALUE_INDIRECT_SET:
- A = JVM_ReadValue(VM, Peek, &Peek);
- B = JVM_ReadValue(VM, Peek, End);
- JVM_WriteMemory(VM, A, B);
- return B;
- case VALUE_INCREMENT:
- A = JVM_ReadValue(VM, Peek, End);
- return A+1;
- case VALUE_DECREMENT:
- A = JVM_ReadValue(VM, Peek, End);
- return A-1;
- case VALUE_PREDEC_INDIRECT:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A)-1;
- JVM_WriteMemory(VM, A, B);
- return B;
- case VALUE_PREINC_INDIRECT:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A)+1;
- JVM_WriteMemory(VM, A, B);
- return B;
- case VALUE_POSTDEC_INDIRECT:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A);
- JVM_WriteMemory(VM, A, B-1);
- return B;
- case VALUE_POSTINC_INDIRECT:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A);
- JVM_WriteMemory(VM, A, B+1);
- return B;
- case VALUE_POST_ADD: // todo
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A);
- JVM_WriteMemory(VM, A, B+1);
- return 0;
- case VALUE_POST_SUB:
- A = JVM_ReadValue(VM, Peek, End);
- B = JVM_ReadMemory(VM, A);
- JVM_WriteMemory(VM, A, B+1);
- return 0;
- case VALUE_LOOP_INDEX:
- return VM->RMathIndex[VM->RMathIndexPointer];
- case VALUE_4POS ... VALUE_4POS+15:
- (*End)++;
- return Peek[-1]-VALUE_4POS;
- case VALUE_4NEG ... VALUE_4NEG+15:
- (*End)++;
- return -(Peek[-1]-VALUE_4NEG);
- case VALUE_FUNCARG ... VALUE_FUNCARG+15:
- (*End)++;
- return JVM_ReadMemory(VM, Peek[-1]-VALUE_FUNCARG);
- case VALUE_ARGREF ... VALUE_ARGREF+15:
- (*End)++;
- return 0x2000 + VM->ParamStackPointer + (Peek[-1]-VALUE_ARGREF);
- }
- return 0;
- }
- // OPCODE_SET = 0x08, OPCODE_SWAP = 0x0c, OPCODE_MATH = 0x10, OPCODE_RMATH = 0x14,
- // OPCODE_GOTO = 0x18, OPCODE_CALL = 0x1b, OPCODE_RETURN = 0x1e, OPCODE_FRET = 0x20,
- // OPCODE_ACALL = 0x24, OPCODE_ATAIL = 0x26, OPCODE_ARET = 0x28
- void inline JVM_SwapInt(signed long *A, signed long *B) {
- signed long T;
- T=*B;
- *B=*A;
- *A=T;
- }
- #define JVM_PARAM_START 2
- void JVM_ReadArgsIntoLocals(JVM_Info *VM, unsigned char *ParPtr, unsigned char **NewParPtr) {
- unsigned char ParamByte = *(ParPtr++);
- unsigned char ParamByteLo = ParamByte & 15;
- unsigned char ParamByteHi = (ParamByte>>4)&15;
- int i;
- signed long Val;
- for(i=0;i<=ParamByteLo;i++) {
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- JVM_WriteMemory(VM, (i+ParamByteHi)&15, Val);
- }
- *NewParPtr = ParPtr;
- }
- int JVM_ExecuteOpcode(JVM_Info *VM) {
- unsigned char Len = VM->Program[VM->PC];
- unsigned char Op = VM->Program[VM->PC+1];
- unsigned char Mod;
- unsigned char Condition=0;
- unsigned char *ParPtr = VM->Program + VM->PC + JVM_PARAM_START;
- signed long Val, Dst, Alt;
- signed long Tmp1, Tmp2;
- unsigned char *OldPtr;
- VM->PC += Len+1;
- switch(Op) {
- case OPCODE_SET ... OPCODE_SWAP-1:
- Mod = Op - OPCODE_SET;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- Dst = JVM_ReadValue(VM, ParPtr, &ParPtr);
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod>1) Alt = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod==2 && Condition) JVM_SwapInt(&Val, &Alt);
- if(Mod==3 && Condition) JVM_SwapInt(&Dst, &Alt);
- JVM_WriteMemory(VM, Dst, Val);
- break;
- case OPCODE_SWAP ... OPCODE_MATH-1:
- Mod = Op - OPCODE_SWAP;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- Dst = JVM_ReadValue(VM, ParPtr, &ParPtr);
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod>1) Alt = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod==2 && Condition) JVM_SwapInt(&Val, &Alt);
- if(Mod==3 && Condition) JVM_SwapInt(&Dst, &Alt);
- Tmp1 = JVM_ReadMemory(VM, Dst);
- Tmp2 = JVM_ReadMemory(VM, Val);
- JVM_WriteMemory(VM, Dst, Tmp2);
- JVM_WriteMemory(VM, Val, Tmp1);
- break;
- case OPCODE_MATH ... OPCODE_RMATH-1:
- Mod = Op - OPCODE_MATH;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- Dst = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod>1) Alt = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod==2 && Condition) JVM_SwapInt(&Val, &Alt);
- if(Mod==3 && Condition) JVM_SwapInt(&Dst, &Alt);
- VM->OriginalValuePointer++;
- VM->OriginalValue[VM->OriginalValuePointer] = JVM_ReadMemory(VM, Dst);
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->OriginalValuePointer--;
- JVM_WriteMemory(VM, Dst, Val);
- break;
- case OPCODE_RMATH ... OPCODE_GOTO-1:
- Mod = Op - OPCODE_RMATH;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- OldPtr = ParPtr;
- Tmp1 = JVM_ReadValue(VM, ParPtr, &ParPtr);
- for(Tmp2=0;Tmp2<Tmp1;Tmp2++) {
- VM->RMathIndexPointer++;
- VM->RMathIndex[VM->OriginalValuePointer] = Tmp2;
- Dst = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->OriginalValuePointer++;
- VM->OriginalValue[VM->OriginalValuePointer] = JVM_ReadMemory(VM, Dst);
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->OriginalValuePointer--;
- JVM_WriteMemory(VM, Dst, Val);
- VM->RMathIndexPointer--;
- }
- break;
- case OPCODE_GOTO ... OPCODE_CALL-1:
- Mod = Op - OPCODE_GOTO;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod>1) Alt = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod==2 && Condition) JVM_SwapInt(&Val, &Alt);
- VM->PC = Val;
- break;
- case OPCODE_CALL ... OPCODE_RETURN-1:
- Mod = Op - OPCODE_CALL;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- Val = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod>1) Alt = JVM_ReadValue(VM, ParPtr, &ParPtr);
- if(Mod==2 && Condition) JVM_SwapInt(&Val, &Alt);
- VM->ReturnStack[VM->ReturnStackPointer++] = VM->PC;
- VM->PC = Val;
- break;
- case OPCODE_RETURN ... OPCODE_FRET-1:
- Mod = Op - OPCODE_RETURN;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- VM->PC = VM->ReturnStack[--VM->ReturnStackPointer];
- break;
- case OPCODE_FRET ... OPCODE_INITLOCAL-1:
- Mod = Op - OPCODE_FRET;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- VM->PC = VM->ReturnStack[--VM->ReturnStackPointer];
- VM->ReturnValue = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->ParamStackPointer--;
- break;
- case OPCODE_INITLOCAL:
- JVM_ReadArgsIntoLocals(VM, ParPtr, &ParPtr);
- break;
- case OPCODE_ACALL ... OPCODE_ATAIL-1:
- Mod = Op - OPCODE_ACALL;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- VM->ReturnStack[VM->ReturnStackPointer++] = VM->PC;
- VM->PC = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->ParamStackPointer++;
- JVM_ReadArgsIntoLocals(VM, ParPtr, &ParPtr);
- break;
- case OPCODE_ATAIL ... OPCODE_ARET-1:
- Mod = Op - OPCODE_ATAIL;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- VM->PC = JVM_ReadValue(VM, ParPtr, &ParPtr);
- VM->ParamStackPointer++;
- JVM_ReadArgsIntoLocals(VM, ParPtr, &ParPtr);
- break;
- case OPCODE_ARET ... OPCODE_ARET+1:
- Mod = Op - OPCODE_RETURN;
- if(Mod!=0) Condition = JVM_ReadBool(VM, ParPtr, &ParPtr);
- if(Mod==1 && !Condition) break;
- VM->PC = VM->ReturnStack[--VM->ReturnStackPointer];
- VM->ParamStackPointer--;
- return 0;
- }
- return 1;
- }
- int JVM_ExecuteUntilReturn(JVM_Info *VM, int NewPC) {
- int OldSP = VM->ReturnStackPointer;
- VM->ReturnStack[VM->ReturnStackPointer++] = VM->PC;
- VM->PC = NewPC;
- while (JVM_ExecuteOpcode(VM)) {
- printf("%6i %6i %6i %6i %4i %2i %2i\n", (int)VM->ParamStackData[VM->ParamStackPointer][0], (int)VM->ParamStackData[VM->ParamStackPointer][1], (int)VM->ParamStackData[VM->ParamStackPointer][2], (int)VM->ParamStackData[VM->ParamStackPointer][3], VM->PC, VM->ReturnStackPointer, VM->ParamStackPointer);
- if(VM->PC > 100) break;
- if(VM->ReturnStackPointer == OldSP) break;
- }
- return VM->ReturnValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement