Casio_asm/common/opcodeList.c

97 lines
8.4 KiB
C

#include "opcodeList.h"
#include "opcodeInfo.h"
void Opcode_registerOpcodes() {
Opcode_init();
Opcode_register(OP_nop, "nop", OPCODE_TYPE_NORMAL, "does nothing");
Opcode_register(OP_add_i, "add_i", OPCODE_TYPE_NORMAL, "adds arg0 and arg1");
Opcode_register(OP_sub_i, "sub_i", OPCODE_TYPE_NORMAL, "subtracts arg1 to arg0");
Opcode_register(OP_mul_i, "mul_i", OPCODE_TYPE_NORMAL, "multiplies arg0 and arg1");
Opcode_register(OP_div_i, "div_i", OPCODE_TYPE_NORMAL, "divides arg0 by arg1");
Opcode_register(OP_mod_i, "mod_i", OPCODE_TYPE_NORMAL, "returns the remainder of the integral division of arg0 by arg1");
Opcode_register(OP_neg_i, "neg_i", OPCODE_TYPE_NORMAL, "negates arg0");
Opcode_register(OP_shlt, "shlt", OPCODE_TYPE_NORMAL, "shifts arg0 to the left by arg1 bits");
Opcode_register(OP_shrt, "shrt", OPCODE_TYPE_NORMAL, "shifts arg0 to the right by arg1 bits");
Opcode_register(OP_and, "and", OPCODE_TYPE_NORMAL, "returns a value containing the bits present in arg0 and arg1");
Opcode_register(OP_or, "or", OPCODE_TYPE_NORMAL, "returns a value containing the bits present in arg0 or arg1");
Opcode_register(OP_xor, "xor", OPCODE_TYPE_NORMAL, "returns a value containing the bits present in arg0 or arg1, but not both");
Opcode_register(OP_not, "not", OPCODE_TYPE_NORMAL, "returns a value with all the bits absent in arg0");
Opcode_register(OP_and_l, "and_l", OPCODE_TYPE_NORMAL, "returns 1 if arg0 and arg1 are nonzero, 0 otherwise");
Opcode_register(OP_or_l, "or_l", OPCODE_TYPE_NORMAL, "returns 1 if arg0 or arg1 are nonzero, 0 otherwise");
Opcode_register(OP_xor_l, "xor_l", OPCODE_TYPE_NORMAL, "returns 1 if exactly one of arg0 and arg1 is nonzero, 0 otherwise");
Opcode_register(OP_not_l, "not_l", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is zero, 0 otherwise");
Opcode_register(OP_is_l, "is_l", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is nonzero, 0 otherwise");
Opcode_register(OP_lt_i, "lt_i", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is less than arg1, 0 otherwise");
Opcode_register(OP_le_i, "le_i", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is less than or equal to arg1, 0 otherwise");
Opcode_register(OP_gt_i, "gt_i", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is greater than arg1, 0 otherwise");
Opcode_register(OP_ge_i, "ge_i", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is greater than or equal to arg1, 0 otherwise");
Opcode_register(OP_eq_i, "eq_i", OPCODE_TYPE_NORMAL, "returns 1 if arg0 is equal to arg1, 0 otherwise");
Opcode_register(OP_neq_i, "neq_i", OPCODE_TYPE_NORMAL, "return 1 if arg0 is not equal to arg1, 0 otherwise");
Opcode_register(OP_push, "push", OPCODE_TYPE_NORMAL, "pushes arg0 to the stack");
Opcode_register(OP_dup, "dup", OPCODE_TYPE_NORMAL, "pushes arg0 to the stack twice");
Opcode_register(OP_pop, "pop", OPCODE_TYPE_NORMAL, "does nothing with arg0");
Opcode_register(OP_swap, "swap", OPCODE_TYPE_NORMAL, "pushes arg0 and arg1 to the stack, effectively swapping them");
Opcode_register(OP_high, "high", OPCODE_TYPE_NORMAL, "pushes arg0 to the stack, shifted 16 bits to the left");
Opcode_register(OP_top, "top", OPCODE_TYPE_NORMAL, "returns stack size");
Opcode_register(OP_jmp, "jmp", OPCODE_TYPE_NORMAL, "jumps unconditionally to address arg0");
Opcode_register(OP_jif, "jif", OPCODE_TYPE_NORMAL, "jumps to address arg0 if arg1 is nonzero");
Opcode_register(OP_jnt, "jnt", OPCODE_TYPE_NORMAL, "jumps to address arg0 if arg1 is zero");
Opcode_register(OP_jind, "jind", OPCODE_TYPE_NORMAL, "jumps to address arg0+arg1");
Opcode_register(OP_call, "call", OPCODE_TYPE_NORMAL, "pushes PC to the stack and jumps to address arg0");
Opcode_register(OP_cif, "cif", OPCODE_TYPE_NORMAL, "call arg0 if arg1 is nonzero");
Opcode_register(OP_cnt, "cnt", OPCODE_TYPE_NORMAL, "call arg0 if arg1 is zero");
Opcode_register(OP_store, "store", OPCODE_TYPE_NORMAL, "stores arg1 in register #arg0");
Opcode_register(OP_stind, "stind", OPCODE_TYPE_NORMAL, "stores arg1 in register arg0");
Opcode_register(OP_puind, "puind", OPCODE_TYPE_NORMAL, "pushes value contained in register arg0");
Opcode_register(OP_swreg, "swreg", OPCODE_TYPE_NORMAL, "swaps registers #arg0 and #arg1");
Opcode_register(OP_swregi, "swregi", OPCODE_TYPE_NORMAL, "swaps register arg0 and #arg1");
Opcode_register(OP_halt, "halt", OPCODE_TYPE_NORMAL, "halts execution");
Opcode_register(OP_reset, "reset", OPCODE_TYPE_NORMAL, "resets the processor, clearing RAM and registers");
Opcode_register(OP_int, "int", OPCODE_TYPE_NORMAL, "sends interrupt arg0");
Opcode_register(OP_inth, "inth", OPCODE_TYPE_NORMAL, "sets interrupt handler to address arg0");
Opcode_register(OP_sub, "sub", OPCODE_TYPE_NORMAL, "subscribes to hardware interrupt arg0");
Opcode_register(OP_unsub, "unsub", OPCODE_TYPE_NORMAL, "unsubscribes to hardware interrupt arg0");
Opcode_register(OP_stat_g, "stat_g", OPCODE_TYPE_NORMAL, "reads status bit arg0");
Opcode_register(OP_stat_s, "stat_s", OPCODE_TYPE_NORMAL, "writes arg1 in status bit arg0");
Opcode_register(OP_stat, "stat", OPCODE_TYPE_NORMAL, "reads status");
Opcode_register(OP_ext, "ext", OPCODE_TYPE_NORMAL, "calls external function arg0 which arguments are popped from the stack");
Opcode_register(OP_mem_wr, "mem_wr", OPCODE_TYPE_NORMAL, "reads a word from RAM or ROM at address arg0");
Opcode_register(OP_mem_ww, "mem_ww", OPCODE_TYPE_NORMAL, "writes word arg1 at RAM address arg0");
Opcode_register(OP_mem_hr, "mem_hr", OPCODE_TYPE_NORMAL, "reads half a word from RAM or ROM at address arg0");
Opcode_register(OP_mem_hw, "mem_hw", OPCODE_TYPE_NORMAL, "writes half word arg1 at RAM address arg0");
Opcode_register(OP_mem_br, "mem_br", OPCODE_TYPE_NORMAL, "reads a byte from RAM or ROM at address arg0");
Opcode_register(OP_mem_bw, "mem_bw", OPCODE_TYPE_NORMAL, "writes byte arg1 at RAM address arg0");
Opcode_register(OP_lastad, "lastad", OPCODE_TYPE_NORMAL, "returns the last accessed memory address");
Opcode_register(OP_extend, "extend", OPCODE_TYPE_NORMAL, "allows for wide instructions");
Opcode_register(OP_E_nop, "nop", OPCODE_TYPE_EXT, "extended nop");
Opcode_register(OP_E_add_d, "add_d", OPCODE_TYPE_EXT, "adds arg0 and arg1");
Opcode_register(OP_E_sub_d, "sub_d", OPCODE_TYPE_EXT, "subtracts arg1 from arg0");
Opcode_register(OP_E_mul_d, "mul_d", OPCODE_TYPE_EXT, "multiplies arg0 and arg1");
Opcode_register(OP_E_div_d, "div_d", OPCODE_TYPE_EXT, "divides arg0 by arg1");
Opcode_register(OP_E_pow_d, "pow_d", OPCODE_TYPE_EXT, "returns arg0 to the power of arg1");
Opcode_register(OP_E_neg_d, "neg_d", OPCODE_TYPE_EXT, "negates arg0");
Opcode_register(OP_E_sqrt, "sqrt", OPCODE_TYPE_EXT, "returns the square root of arg0");
Opcode_register(OP_E_cbrt, "cbrt", OPCODE_TYPE_EXT, "returns the cubic root of arg0");
Opcode_register(OP_E_hypot, "hypot", OPCODE_TYPE_EXT, "returns sqrt(arg0^2+arg1^2)");
Opcode_register(OP_E_exp, "exp", OPCODE_TYPE_EXT, "returns e^arg0");
Opcode_register(OP_E_ln, "ln", OPCODE_TYPE_EXT, "returns ln(arg0)");
Opcode_register(OP_E_floor, "floor", OPCODE_TYPE_EXT, "returns floor(arg0)");
Opcode_register(OP_E_ceil, "ceil", OPCODE_TYPE_EXT, "returns ceil(arg0)");
Opcode_register(OP_E_round, "round", OPCODE_TYPE_EXT, "returns round(arg0)");
Opcode_register(OP_E_cos, "cos", OPCODE_TYPE_EXT, "returns cos(arg0)");
Opcode_register(OP_E_sin, "sin", OPCODE_TYPE_EXT, "returns sin(arg0)");
Opcode_register(OP_E_tan, "tan", OPCODE_TYPE_EXT, "returns tan(arg0)");
Opcode_register(OP_E_atan, "atan", OPCODE_TYPE_EXT, "returns atan(arg0)");
Opcode_register(OP_E_atan2, "atan2", OPCODE_TYPE_EXT, "returns atan2(arg0, arg1)");
Opcode_register(OP_E_lt_d, "lt_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is less than arg1, 0 otherwise");
Opcode_register(OP_E_le_d, "le_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is less than or equal to arg1, 0 otherwise");
Opcode_register(OP_E_gt_d, "gt_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is greater than arg1, 0 otherwise");
Opcode_register(OP_E_ge_d, "ge_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is greater than or equal to arg1, 0 otherwise");
Opcode_register(OP_E_eq_d, "eq_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is equal to arg1, 0 otherwise");
Opcode_register(OP_E_neq_d, "neq_d", OPCODE_TYPE_EXT, "returns 1 if arg0 is not equal to arg1, 0 otherwise");
Opcode_register(OP_E_i2d, "i2d", OPCODE_TYPE_EXT, "converts arg0 to a decimal value");
Opcode_register(OP_E_d2i, "d2i", OPCODE_TYPE_EXT, "converts arg0 to an integral value");
Opcode_register(OP_E_cst_pi, "cst_pi", OPCODE_TYPE_EXT, "pushes pi to the stack");
Opcode_register(OP_E_cst_e, "cst_e", OPCODE_TYPE_EXT, "pushes e to the stack");
}