Casio_asm/interpreter/executer.c

286 lines
6.6 KiB
C

#include "executer.h"
void Proc_executeInstruction(proc_t *proc, opcode_data_t *instruction) {
if(instruction->ext) {
switch(instruction->op) {
case OP_E_nop:
instructionExt_nop(proc, instruction);
break;
case OP_E_add_d:
instructionExt_add_d(proc, instruction);
break;
case OP_E_sub_d:
instructionExt_sub_d(proc, instruction);
break;
case OP_E_mul_d:
instructionExt_mul_d(proc, instruction);
break;
case OP_E_div_d:
instructionExt_div_d(proc, instruction);
break;
case OP_E_pow_d:
instructionExt_pow_d(proc, instruction);
break;
case OP_E_neg_d:
instructionExt_neg_d(proc, instruction);
break;
case OP_E_sqrt:
instructionExt_sqrt(proc, instruction);
break;
case OP_E_cbrt:
instructionExt_cbrt(proc, instruction);
break;
case OP_E_hypot:
instructionExt_hypot(proc, instruction);
break;
case OP_E_exp:
instructionExt_exp(proc, instruction);
break;
case OP_E_ln:
instructionExt_ln(proc, instruction);
break;
case OP_E_floor:
instructionExt_floor(proc, instruction);
break;
case OP_E_ceil:
instructionExt_ceil(proc, instruction);
break;
case OP_E_round:
instructionExt_round(proc, instruction);
break;
case OP_E_cos:
instructionExt_cos(proc, instruction);
break;
case OP_E_sin:
instructionExt_sin(proc, instruction);
break;
case OP_E_tan:
instructionExt_tan(proc, instruction);
break;
case OP_E_atan:
instructionExt_atan(proc, instruction);
break;
case OP_E_atan2:
instructionExt_atan2(proc, instruction);
break;
case OP_E_lt_d:
instructionExt_lt_d(proc, instruction);
break;
case OP_E_le_d:
instructionExt_le_d(proc, instruction);
break;
case OP_E_gt_d:
instructionExt_gt_d(proc, instruction);
break;
case OP_E_ge_d:
instructionExt_ge_d(proc, instruction);
break;
case OP_E_eq_d:
instructionExt_eq_d(proc, instruction);
break;
case OP_E_neq_d:
instructionExt_neq_d(proc, instruction);
break;
case OP_E_i2d:
instructionExt_i2d(proc, instruction);
break;
case OP_E_d2i:
instructionExt_d2i(proc, instruction);
break;
case OP_E_cst_pi:
instructionExt_cst_pi(proc, instruction);
break;
case OP_E_cst_e:
instructionExt_cst_e(proc, instruction);
break;
default:
illegalInstruction(proc, instruction);
}
} else {
switch(instruction->op) {
case OP_nop:
instruction_nop(proc, instruction);
break;
case OP_add_i:
instruction_add_i(proc, instruction);
break;
case OP_sub_i:
instruction_sub_i(proc, instruction);
break;
case OP_mul_i:
instruction_mul_i(proc, instruction);
break;
case OP_div_i:
instruction_div_i(proc, instruction);
break;
case OP_mod_i:
instruction_mod_i(proc, instruction);
break;
case OP_neg_i:
instruction_neg_i(proc, instruction);
break;
case OP_shlt:
instruction_shlt(proc, instruction);
break;
case OP_shrt:
instruction_shrt(proc, instruction);
break;
case OP_and:
instruction_and(proc, instruction);
break;
case OP_or:
instruction_or(proc, instruction);
break;
case OP_xor:
instruction_xor(proc, instruction);
break;
case OP_not:
instruction_not(proc, instruction);
break;
case OP_and_l:
instruction_and_l(proc, instruction);
break;
case OP_or_l:
instruction_or_l(proc, instruction);
break;
case OP_xor_l:
instruction_xor_l(proc, instruction);
break;
case OP_not_l:
instruction_not_l(proc, instruction);
break;
case OP_is_l:
instruction_is_l(proc, instruction);
break;
case OP_lt_i:
instruction_lt_i(proc, instruction);
break;
case OP_le_i:
instruction_le_i(proc, instruction);
break;
case OP_gt_i:
instruction_gt_i(proc, instruction);
break;
case OP_ge_i:
instruction_ge_i(proc, instruction);
break;
case OP_eq_i:
instruction_eq_i(proc, instruction);
break;
case OP_neq_i:
instruction_neq_i(proc, instruction);
break;
case OP_push:
instruction_push(proc, instruction);
break;
case OP_dup:
instruction_dup(proc, instruction);
break;
case OP_pop:
instruction_pop(proc, instruction);
break;
case OP_swap:
instruction_swap(proc, instruction);
break;
case OP_high:
instruction_high(proc, instruction);
break;
case OP_top:
instruction_top(proc, instruction);
break;
case OP_jmp:
instruction_jmp(proc, instruction);
break;
case OP_jif:
instruction_jif(proc, instruction);
break;
case OP_jnt:
instruction_jnt(proc, instruction);
break;
case OP_jind:
instruction_jind(proc, instruction);
break;
case OP_call:
instruction_call(proc, instruction);
break;
case OP_cif:
instruction_cif(proc, instruction);
break;
case OP_cnt:
instruction_cnt(proc, instruction);
break;
case OP_store:
instruction_store(proc, instruction);
break;
case OP_stind:
instruction_stind(proc, instruction);
break;
case OP_puind:
instruction_puind(proc, instruction);
break;
case OP_swreg:
instruction_swreg(proc, instruction);
break;
case OP_swregi:
instruction_swregi(proc, instruction);
break;
case OP_halt:
instruction_halt(proc, instruction);
break;
case OP_reset:
instruction_reset(proc, instruction);
break;
case OP_int:
instruction_int(proc, instruction);
break;
case OP_inth:
instruction_inth(proc, instruction);
break;
case OP_sub:
instruction_sub(proc, instruction);
break;
case OP_unsub:
instruction_unsub(proc, instruction);
break;
case OP_stat_g:
instruction_stat_g(proc, instruction);
break;
case OP_stat_s:
instruction_stat_s(proc, instruction);
break;
case OP_stat:
instruction_stat(proc, instruction);
break;
case OP_ext:
instruction_ext(proc, instruction);
break;
case OP_mem_wr:
instruction_mem_wr(proc, instruction);
break;
case OP_mem_ww:
instruction_mem_ww(proc, instruction);
break;
case OP_mem_hr:
instruction_mem_hr(proc, instruction);
break;
case OP_mem_hw:
instruction_mem_hw(proc, instruction);
break;
case OP_mem_br:
instruction_mem_br(proc, instruction);
break;
case OP_mem_bw:
instruction_mem_bw(proc, instruction);
break;
case OP_lastad:
instruction_lastad(proc, instruction);
break;
case OP_extend:
instruction_extend(proc, instruction);
break;
default:
illegalInstruction(proc, instruction);
}
}
}