diff --git a/software/include/fpvm/ast.h b/software/include/fpvm/ast.h index a1a79d22..6fb54fb5 100644 --- a/software/include/fpvm/ast.h +++ b/software/include/fpvm/ast.h @@ -47,7 +47,7 @@ enum ast_op { op_min, op_max, op_int, - op_vops, /* virtual operations start here */ + op_not, }; /* maximum supported arity is 3 */ diff --git a/software/libfpvm/fpvm.c b/software/libfpvm/fpvm.c index 8bac60ad..dd8b9aed 100644 --- a/software/libfpvm/fpvm.c +++ b/software/libfpvm/fpvm.c @@ -522,6 +522,12 @@ static int compile(struct fpvm_fragment *fragment, int reg, struct ast_node *nod return FPVM_INVALID_REG; ADD_ISN(FPVM_OPCODE_TSIGN, opa, opb, reg); break; + case op_not: + opb = REG_CONST(0); + if(opb == FPVM_INVALID_REG) + return FPVM_INVALID_REG; + ADD_ISN(FPVM_OPCODE_EQUAL, opa, opb, reg); + break; default: /* Normal case */ opcode = operator2opcode(node->op);