Lines Matching defs:inst
681 * @param inst The instruction corresponding to the binary operator to execute.
684 bc_program_op(BcProgram* p, uchar inst)
691 size_t idx = inst - BC_INST_POWER;
948 * @param inst The instruction for the type of print we are doing.
952 bc_program_print(BcProgram* p, uchar inst, size_t idx)
957 bool pop = (inst != BC_INST_PRINT);
994 assert(inst != BC_INST_PRINT_STR);
1012 if (inst == BC_INST_PRINT_STR) bc_program_printChars(str);
1019 if (inst == BC_INST_PRINT) bc_vm_putchar('\n', bc_flush_err);
1052 * @param inst The unary operation.
1055 bc_program_unary(BcProgram* p, uchar inst)
1072 bc_program_unarys[inst - BC_INST_NEG](res, num);
1079 * @param inst The operator.
1082 bc_program_logical(BcProgram* p, uchar inst)
1100 if (inst == BC_INST_BOOL_AND)
1104 else if (inst == BC_INST_BOOL_OR)
1113 switch (inst)
1421 * @param inst The assignment operator to execute.
1424 bc_program_assign(BcProgram* p, uchar inst)
1432 bool ob, sc, use_val = BC_INST_USE_VAL(inst);
1445 if (inst != BC_INST_ASSIGN && inst != BC_INST_ASSIGN_NO_VAL)
1479 if (inst == BC_INST_ASSIGN)
1494 if (BC_INST_IS_ASSIGN(inst))
1535 inst -= (BC_INST_ASSIGN_POWER_NO_VAL - BC_INST_ASSIGN_POWER);
1543 bc_program_ops[inst - BC_INST_ASSIGN_POWER](l, r, l, scale);
1665 * @param inst The instruction; whether to push an array or an array element.
1669 size_t* restrict bgn, uchar inst)
1687 if (inst == BC_INST_ARRAY)
1718 * @param inst The instruction; whether to do an increment or decrement.
1721 bc_program_incdec(BcProgram* p, uchar inst)
1741 inst2 = BC_INST_ASSIGN_PLUS_NO_VAL + (inst & 0x01);
1853 * @param inst The return instruction. bc can return void, and we need to know
1857 bc_program_return(BcProgram* p, uchar inst)
1876 assert(BC_PROG_STACK(&p->results, ip->len + (inst == BC_INST_RET)));
1884 if (inst == BC_INST_RET)
1910 else if (inst == BC_INST_RET_VOID) res->t = BC_RESULT_VOID;
1948 * @param inst The builtin to execute.
1951 bc_program_builtin(BcProgram* p, uchar inst)
1956 bool len = (inst == BC_INST_LENGTH);
1960 assert(inst >= BC_INST_LENGTH && inst <= BC_INST_IRAND);
1962 assert(inst >= BC_INST_LENGTH && inst <= BC_INST_IS_STRING);
1983 if (!len && (inst != BC_INST_SCALE_FUNC || BC_IS_BC) &&
1984 inst != BC_INST_IS_NUMBER && inst != BC_INST_IS_STRING)
1990 if (inst == BC_INST_SQRT) bc_num_sqrt(num, &res->d.n, BC_PROG_SCALE(p));
1993 else if (inst == BC_INST_ABS)
2005 else if (inst == BC_INST_IS_NUMBER || inst == BC_INST_IS_STRING)
2022 cond = ((inst == BC_INST_IS_STRING) == is_str);
2029 else if (inst == BC_INST_IRAND)
2407 * @param inst The instruction to tell us how many. There is one to pop up to
2412 bc_program_nquit(BcProgram* p, uchar inst)
2423 if (inst == BC_INST_QUIT) val = 2;
2673 * @param inst Which global to push, as an instruction.
2676 bc_program_pushGlobal(BcProgram* p, uchar inst)
2681 assert(inst >= BC_INST_IBASE && inst <= BC_INST_SCALE);
2684 t = inst - BC_INST_IBASE + BC_RESULT_IBASE;
2685 bc_program_pushBigdig(p, p->globals[inst - BC_INST_IBASE], t);
2691 * @param inst Which global setting to push, as an instruction.
2694 bc_program_globalSetting(BcProgram* p, uchar inst)
2700 assert((inst >= BC_INST_LINE_LENGTH && inst <= BC_INST_LEADING_ZERO) ||
2701 (BC_IS_DC && inst == BC_INST_EXTENDED_REGISTERS));
2703 assert(inst >= BC_INST_LINE_LENGTH && inst <= BC_INST_LEADING_ZERO);
2706 if (inst == BC_INST_LINE_LENGTH)
2711 else if (inst == BC_INST_GLOBAL_STACKS)
2717 else if (inst == BC_INST_EXTENDED_REGISTERS)
3029 uchar inst;
3095 BC_PROG_JUMP(inst, code, ip);
3100 inst = (uchar) code[(ip->idx)++];
3105 bc_file_printf(&vm->ferr, "inst: %s\n", bc_inst_names[inst]);
3110 switch (inst)
3137 if (inst == BC_INST_JUMP || cond)
3150 BC_PROG_JUMP(inst, code, ip);
3169 BC_PROG_JUMP(inst, code, ip);
3177 bc_program_incdec(p, inst);
3178 BC_PROG_JUMP(inst, code, ip);
3190 BC_PROG_JUMP(inst, code, ip);
3199 bc_program_return(p, inst);
3209 BC_PROG_JUMP(inst, code, ip);
3224 bc_program_logical(p, inst);
3225 BC_PROG_JUMP(inst, code, ip);
3246 BC_PROG_JUMP(inst, code, ip);
3255 BC_PROG_JUMP(inst, code, ip);
3268 BcBigDig dig = vm->maxes[inst - BC_INST_MAXIBASE];
3270 BC_PROG_JUMP(inst, code, ip);
3284 bc_program_globalSetting(p, inst);
3285 BC_PROG_JUMP(inst, code, ip);
3293 BC_PROG_JUMP(inst, code, ip);
3301 bc_program_pushArray(p, code, &ip->idx, inst);
3302 BC_PROG_JUMP(inst, code, ip);
3311 bc_program_pushGlobal(p, inst);
3312 BC_PROG_JUMP(inst, code, ip);
3321 BC_PROG_JUMP(inst, code, ip);
3337 bc_program_builtin(p, inst);
3338 BC_PROG_JUMP(inst, code, ip);
3355 BC_PROG_JUMP(inst, code, ip);
3363 BC_PROG_JUMP(inst, code, ip);
3374 r.t = BC_RESULT_ZERO + (inst - BC_INST_ZERO);
3376 BC_PROG_JUMP(inst, code, ip);
3387 bc_program_print(p, inst, 0);
3393 BC_PROG_JUMP(inst, code, ip);
3405 BC_PROG_JUMP(inst, code, ip);
3422 bc_program_op(p, inst);
3423 BC_PROG_JUMP(inst, code, ip);
3434 bc_program_unary(p, inst);
3435 BC_PROG_JUMP(inst, code, ip);
3467 bc_program_assign(p, inst);
3468 BC_PROG_JUMP(inst, code, ip);
3490 BC_PROG_JUMP(inst, code, ip);
3519 BC_PROG_JUMP(inst, code, ip);
3527 BC_PROG_JUMP(inst, code, ip);
3535 BC_PROG_JUMP(inst, code, ip);
3543 BC_PROG_JUMP(inst, code, ip);
3566 BC_PROG_JUMP(inst, code, ip);
3574 cond = (inst == BC_INST_EXEC_COND);
3586 BC_PROG_JUMP(inst, code, ip);
3594 BC_PROG_JUMP(inst, code, ip);
3602 BC_PROG_JUMP(inst, code, ip);
3610 BC_PROG_JUMP(inst, code, ip);
3618 BC_PROG_JUMP(inst, code, ip);
3644 BC_PROG_JUMP(inst, code, ip);
3652 bool copy = (inst == BC_INST_LOAD);
3654 BC_PROG_JUMP(inst, code, ip);
3663 BC_PROG_JUMP(inst, code, ip);
3671 bc_program_nquit(p, inst);
3681 BC_PROG_JUMP(inst, code, ip);
3689 BC_PROG_JUMP(inst, code, ip);
3797 uchar inst = (uchar) code[(*bgn)++];
3799 bc_vm_printf("Inst[%zu]: %s [%lu]; ", *bgn - 1, bc_inst_names[inst],
3800 (unsigned long) inst);
3802 if (inst == BC_INST_VAR || inst == BC_INST_ARRAY_ELEM ||
3803 inst == BC_INST_ARRAY)
3807 else if (inst == BC_INST_STR) bc_program_printStr(p, code, bgn);
3808 else if (inst == BC_INST_NUM)
3814 else if (inst == BC_INST_CALL ||
3815 (inst > BC_INST_STR && inst <= BC_INST_JUMP_ZERO))
3818 if (inst == BC_INST_CALL) bc_program_printIndex(code, bgn);