diff --git a/src/lisp/drawl.pla b/src/lisp/drawl.pla index 2dfb73c..7c1a0f1 100644 --- a/src/lisp/drawl.pla +++ b/src/lisp/drawl.pla @@ -721,6 +721,16 @@ def natv_rem(expr) return new_int(num[0], num[1]) end +def natv_neg(expr) + var num[2] + + num[0], num[1] = eval_num(expr) + load32(@num) + neg32 + store32(@num) + return new_int(num[0], num[1]) +end + def natv_gt(expr) var num[2] @@ -780,6 +790,7 @@ def install_defaults#0 new_sym("*")=>natv = @natv_mul) new_sym("/")=>natv = @natv_div) new_sym("REM")=>natv = @natv_rem) + new_sym("NEG")=>natv = @natv_neg) new_sym(">")=>natv = @natv_gt) new_sym("<")=>natv = @natv_lt) new_sym("PRINT")=>natv = @natv_print)