2024-09-24 07:03:52 -07:00
|
|
|
#include "constants.h"
|
|
|
|
|
|
|
|
const char *INSTRUCTION_NAMES[] = {
|
|
|
|
[INST_NIL] = "NIL",
|
|
|
|
[INST_T] = "T",
|
|
|
|
[INST_STRING] = "STRING",
|
|
|
|
[INST_INT] = "INT",
|
|
|
|
[INST_FLOAT] = "FLOAT",
|
|
|
|
[INST_CONS] = "CONS",
|
|
|
|
[INST_LIST] = "LIST",
|
|
|
|
[INST_VECTOR] = "VECTOR",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_LENGTH] = "LENGTH",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_INTERN_LIT] = "INTERN_LIT",
|
|
|
|
[INST_INTERN_DYN] = "INTERN_DYN",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_TYPE_OF] = "TYPE_OF",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_SYMBOL_NAME] = "SYMBOL_NAME",
|
|
|
|
[INST_MOV] = "MOV",
|
|
|
|
[INST_FUNCALL] = "FUNCALL",
|
|
|
|
[INST_RETVAL_COUNT] = "RETVAL_COUNT",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_GET_RETVAL_COUNT] = "GET_RETVAL_COUNT",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_ENTER_LEXENV] = "ENTER_LEXENV",
|
|
|
|
[INST_ENTER_BLOCK] = "ENTER_BLOCK",
|
|
|
|
[INST_LEAVE_BLOCK] = "LEAVE_BLOCK",
|
|
|
|
[INST_SET_VALUE] = "SET_VALUE",
|
|
|
|
[INST_SET_FUNCTION] = "SET_FUNCTION",
|
|
|
|
[INST_GET_VALUE] = "GET_VALUE",
|
|
|
|
[INST_GET_FUNCTION] = "GET_FUNCTION",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_BOUNDP] = "BOUNDP",
|
|
|
|
[INST_FUNCTIONP] = "FUNCTIONP",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_NEWFUNCTION_LIT] = "NEWFUNCTION_LIT",
|
|
|
|
[INST_NEWFUNCTION_DYN] = "NEWFUNCTION_DYN",
|
|
|
|
[INST_PUT] = "PUT",
|
|
|
|
[INST_GET] = "GET",
|
|
|
|
[INST_AND] = "AND",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_ANDN] = "ANDN",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_OR] = "OR",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_ORN] = "ORN",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_XOR] = "XOR",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_XORN] = "XORN",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_NOT] = "NOT",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_JMP] = "JMP",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_CJMP] = "CJMP",
|
|
|
|
[INST_CAR] = "CAR",
|
|
|
|
[INST_CDR] = "CDR",
|
|
|
|
[INST_SETCAR] = "SETCAR",
|
|
|
|
[INST_SETCDR] = "SETCDR",
|
|
|
|
[INST_GETELT_LIT] = "GETELT_LIT",
|
|
|
|
[INST_GETELT_DYN] = "GETELT_DYN",
|
|
|
|
[INST_SETELT_LIT] = "SETELT_LIT",
|
|
|
|
[INST_SETELT_DYN] = "SETELT_DYN",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_EQ] = "EQ",
|
2024-09-24 07:03:52 -07:00
|
|
|
[INST_NUM_GT] = "NUM_GT",
|
|
|
|
[INST_NUM_GE] = "NUM_GE",
|
|
|
|
[INST_NUM_EQ] = "NUM_EQ",
|
|
|
|
[INST_NUM_LE] = "NUM_LE",
|
|
|
|
[INST_NUM_LT] = "NUM_LT",
|
2024-09-27 04:50:47 -07:00
|
|
|
[INST_ADD] = "ADD",
|
|
|
|
[INST_ADDN] = "ADDN",
|
|
|
|
[INST_SUB] = "SUB",
|
|
|
|
[INST_SUBN] = "SUBN",
|
|
|
|
[INST_MUL] = "MUL",
|
|
|
|
[INST_MULN] = "MULN",
|
|
|
|
[INST_DIV] = "DIV",
|
|
|
|
[INST_INT_DIV] = "INT_DIV",
|
|
|
|
[INST_RECIP] = "RECIP",
|
|
|
|
[INST_MOD] = "MOD",
|
|
|
|
[INST_SQRT] = "SQRT",
|
|
|
|
[INST_POW] = "POW",
|
|
|
|
[INST_LN] = "LN",
|
|
|
|
[INST_EXP] = "EXP",
|
|
|
|
[INST_SIN] = "SIN",
|
|
|
|
[INST_COS] = "COS",
|
|
|
|
[INST_TAN] = "TAN",
|
|
|
|
[INST_ASIN] = "ASIN",
|
|
|
|
[INST_ACOS] = "ACOS",
|
|
|
|
[INST_ATAN] = "ATAN",
|
|
|
|
[INST_BITAND] = "BITAND",
|
|
|
|
[INST_BITOR] = "BITOR",
|
|
|
|
[INST_BITXOR] = "BITXOR",
|
|
|
|
[INST_BITNOR] = "BITNOR",
|
|
|
|
[INST_BITNEG] = "BITNEG",
|
|
|
|
[INST_LSH] = "LSH",
|
|
|
|
[INST_ASH] = "ASH",
|
2024-09-24 07:03:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
const char *REGISTER_NAMES[] = {
|
|
|
|
[REG_VAL] = "val",
|
|
|
|
[REG_SAVED] = "saved",
|
|
|
|
[REG_ARG] = "arg",
|
|
|
|
[REG_RET] = "ret",
|
|
|
|
};
|