aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/ops.h
blob: 7a43b91258ec7b2ecfaf938e56720e11c3274eba (plain)
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
#ifndef BDL_OPS_H
#define BDL_OPS_H

typedef enum Ops {
    // Load/store ops.
    OP_CONSTANT,
    OP_DEF,
    OP_SET,
    OP_GET,
    // Arithmetic ops.
    OP_SUM,
    OP_SUB,
    OP_MUL,
    OP_DIV,
    OP_MOD,
    // Logic ops.
    OP_NOT,
    OP_AND,
    OP_OR,
    // Numerical comparison ops.
    OP_EQUAL,
    OP_LESS,
    OP_GREATER,
    OP_LESS_EQUAL,
    OP_GREATER_EQUAL,
    // Jump/conditional ops.
    OP_JUMP,
    OP_JUMP_IF_FALSE,
    // Display ops.
    OP_DISPLAY,
    OP_PRINT,
    OP_NEWLINE,
    // Procedures.
    OP_CALL,
    OP_RETURN,
    // Clear stack after each statement.
    OP_DROP,
} Ops;

#endif // BDL_OPS_H