diff --git a/include/r8asm/r8asm.hh b/include/r8asm/r8asm.hh index 74e9c9f..a95ee46 100644 --- a/include/r8asm/r8asm.hh +++ b/include/r8asm/r8asm.hh @@ -52,6 +52,7 @@ public: AND, OR, NOT, + NEG, }; std::map operator_map = { {"+", operator_t::ADD}, {"-", operator_t::SUB}, {"*", operator_t::MUL}, diff --git a/src/r8asm.cc b/src/r8asm.cc index 0cad2df..ff54a06 100644 --- a/src/r8asm.cc +++ b/src/r8asm.cc @@ -50,6 +50,9 @@ r8asm::general_data r8asm::ast::expand_node_to_data(const ast_node &node) { case operator_t::NOT: to_return = ~a; break; + case operator_t::NEG: + to_return = -a; + break; default:; break; }