Example #1
0
void bhvm::exec_instruction (const std::string& instruction)
{
    if (instruction == "pop")
    {
        exec_pop();
    }
    else if (instruction == "nop")
    {
        exec_nop();
    }
    else if (instruction == "calle")
    {
        exec_calle();
    }
    else if (instruction == "jump")
    {
        exec_jump();
    }
    else if (instruction.substr(0, 5) == "push ")
    {
        exec_push(instruction.substr(5));
    }
    else
        throw Alarm(MTK_HERE, "bhvm",  MTK_SS("unknown command " << instruction), alPriorCritic);
}
Example #2
0
File: exec.c Project: moxley/parse1
struct t_value * exec_i_jmp(struct t_exec *exec, struct t_icode *jmp)
{
  if (exec_jump(exec, jmp->operand->intval) < 0) {
    return NULL;
  }

  return &nullvalue;
}
Example #3
0
File: exec.c Project: moxley/parse1
/*
 * Jump to location identified by the top of stack.
 */
struct t_value * exec_i_jst(struct t_exec *exec, struct t_icode *jmp)
{
  struct t_value *ret = &nullvalue;

  ret = list_pop(&exec->stack);
  assert(ret);
  exec_jump(exec, ret->intval);

  return ret;
}