void ring_vm_inclpjump ( VM *pVM ) { List *pVar ; double nNum1,nNum2 ; /* Check Scope Life Time */ if ( RING_VM_IR_READIVALUE(4) != pVM->nActiveScopeID ) { RING_VM_IR_OPCODE = ICO_INCJUMP ; ring_list_deliteminsidelist_gc(pVM->pRingState,pVM->aNewByteCodeItems,RING_VM_IR_ITEM(3)); ring_list_deliteminsidelist_gc(pVM->pRingState,pVM->aNewByteCodeItems,RING_VM_IR_ITEM(4)); #if RING_SHOWICFINAL RING_VM_IR_PARACOUNT = RING_VM_IR_PARACOUNT - 2 ; ring_list_deleteitem_gc(pVM->pRingState,RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); ring_list_deleteitem_gc(pVM->pRingState,RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); #endif pVM->nPC-- ; return ; } pVar = (List *) RING_VM_IR_READPVALUE(3) ; nNum1 = ring_list_getdouble(pVM->aForStep,ring_list_getsize(pVM->aForStep)); /* Check Data */ if ( ring_list_isstring(pVar,RING_VAR_VALUE) ) { nNum2 = ring_vm_stringtonum(pVM,ring_list_getstring(pVar,RING_VAR_VALUE)); } else if ( ring_list_isnumber(pVar,RING_VAR_VALUE) ) { nNum2 = ring_list_getdouble(pVar,RING_VAR_VALUE) ; } else { ring_vm_error(pVM,RING_VM_ERROR_FORLOOPDATATYPE); return ; } ring_list_setdouble_gc(pVM->pRingState,pVar,RING_VAR_VALUE,nNum2 + nNum1); /* Jump */ pVM->nPC = RING_VM_IR_READIVALUE(2) ; }
void ring_vm_loadfuncp ( VM *pVM ) { List *pList ; pVM->nFuncExecute++ ; pVM->nFuncExecute2++ ; pList = ring_list_newlist(pVM->pFuncCallList); ring_list_addint(pList,RING_VM_IR_READIVALUE(3)); ring_list_addstring(pList,RING_VM_IR_READC); ring_list_addint(pList,RING_VM_IR_READIVALUE(2)); ring_list_addint(pList,pVM->nSP); ring_list_newlist(pList); ring_list_addpointer(pList,pVM->cFileName); pVM->cFileName = (char *) RING_VM_IR_READPVALUE(4) ; ring_list_addint(pList,RING_VM_IR_READIVALUE(5)); ring_vm_saveloadaddressscope(pVM); }
void ring_vm_pushplocal ( VM *pVM ) { /* Check Scope Life Time */ if ( RING_VM_IR_READIVALUE(4) != pVM->nActiveScopeID ) { RING_VM_IR_OPCODE = ICO_LOADADDRESS ; ring_list_deliteminsidelist(pVM->aNewByteCodeItems,RING_VM_IR_ITEM(3)); ring_list_deliteminsidelist(pVM->aNewByteCodeItems,RING_VM_IR_ITEM(4)); #if RING_SHOWICFINAL RING_VM_IR_PARACOUNT = RING_VM_IR_PARACOUNT - 2 ; ring_list_deleteitem(RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); ring_list_deleteitem(RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); #endif pVM->nPC-- ; return ; } RING_VM_STACK_PUSHPVALUE(RING_VM_IR_READPVALUE(3)) ; RING_VM_STACK_OBJTYPE = RING_OBJTYPE_VARIABLE ; }
void ring_vm_jumpvarlplenum ( VM *pVM ) { List *pVar ; double nNum1,nNum2 ; /* Check Scope Life Time */ if ( RING_VM_IR_READIVALUE(5) != pVM->nActiveScopeID ) { RING_VM_IR_OPCODE = ICO_JUMPVARLENUM ; #if RING_SHOWICFINAL RING_VM_IR_PARACOUNT = RING_VM_IR_PARACOUNT - 2 ; ring_list_deleteitem_gc(pVM->pRingState,RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); ring_list_deleteitem_gc(pVM->pRingState,RING_VM_IR_LIST,ring_list_getsize(RING_VM_IR_LIST)); #endif pVM->nPC-- ; return ; } pVar = (List *) RING_VM_IR_READPVALUE(4) ; nNum1 = ring_list_getdouble(pVM->aForStep,ring_list_getsize(pVM->aForStep)); /* Check Data */ if ( ring_list_isstring(pVar,RING_VAR_VALUE) ) { nNum2 = ring_vm_stringtonum(pVM,ring_list_getstring(pVar,RING_VAR_VALUE)); } else if ( ring_list_isnumber(pVar,RING_VAR_VALUE) ) { nNum2 = ring_list_getdouble(pVar,RING_VAR_VALUE) ; } else { ring_vm_error(pVM,RING_VM_ERROR_FORLOOPDATATYPE); return ; } if ( nNum1 < 0 ) { if ( ! (nNum2 >= RING_VM_IR_READDVALUE(2)) ) { /* Jump */ pVM->nPC = RING_VM_IR_READIVALUE(3) ; } } else { if ( ! (nNum2 <= RING_VM_IR_READDVALUE(2)) ) { /* Jump */ pVM->nPC = RING_VM_IR_READIVALUE(3) ; } } }