-
Notifications
You must be signed in to change notification settings - Fork 1
/
opcodes.h
92 lines (88 loc) · 2.14 KB
/
opcodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
////////////////////////////////////////////////////////////////////////////////
// DScript Scripting Language
// Copyright (C) 2003 Bryan "daerid" Ross
//
// Permission to copy, use, modify, sell and distribute this software is
// granted provided this copyright notice appears in all copies. This
// software is provided "as is" without express or implied warranty, and
// with no claim as to its suitability for any purpose.
////////////////////////////////////////////////////////////////////////////////
#ifndef __DSCRIPT_OPCODES_H__
#define __DSCRIPT_OPCODES_H__
namespace dscript
{
/// All the opcodes that the runtime will recognize
enum op_code
{
op_push_param = 0,
op_call_func,
op_push_str,
op_push_int,
op_push_float,
op_cat_aidx_expr,
op_push_var,
op_push_var_value,
op_load_ret,
op_inc_var,
op_dec_var,
op_neg,
op_log_not,
op_bit_not,
op_mul,
op_div,
op_mod,
op_add,
op_sub,
op_cat,
op_shl,
op_shr,
op_cmp_less_eq,
op_cmp_less,
op_cmp_grtr_eq,
op_cmp_grtr,
op_eq,
op_neq,
op_bit_and,
op_bit_or,
op_bit_xor,
op_log_and,
op_log_or,
op_decl_func,
op_pop_param,
op_return,
op_store_ret,
op_assign,
op_assign_var,
op_mul_asn,
op_mul_asn_var,
op_div_asn,
op_div_asn_var,
op_mod_asn,
op_mod_asn_var,
op_add_asn,
op_add_asn_var,
op_sub_asn,
op_sub_asn_var,
op_cat_asn,
op_cat_asn_var,
op_band_asn,
op_band_asn_var,
op_bor_asn,
op_bor_asn_var,
op_bxor_asn,
op_bxor_asn_var,
op_shl_asn,
op_shl_asn_var,
op_shr_asn,
op_shr_asn_var,
op_jmp_false,
op_jmp,
// num of op_codes
op_count,
// debugging
op_invalid = -1
};
/// Returns the string name an op_code
const char* get_op_name(op_code op);
}
#endif//__DSCRIPT_OPCODES_H__