From 03a9a72d6e7f6e50087f704c1eda7234b4ff923b Mon Sep 17 00:00:00 2001 From: Luxferre Date: Wed, 30 Apr 2025 11:55:41 +0300 Subject: [PATCH] added neg and inv shortcuts --- README.md | 2 ++ mu808asm.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index afdcc0f..f7cdddf 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ The shortcut mnemonics for other operations are as follows: * `iva` is a shortcut to `cpy 2` (indirect value assignment) * `inc` is a shortcut to `fma 127 127` (increment) * `mul` is a shortcut to `fma 0` (multiplication) +* `neg` is a shortcut to `sub 0 127` (negation) +* `inv` is a shortcut to `div 127` (inversion/reciprocal) * `exp` is a shortcut to `nel 0` (natural exponent) * `log` is a shortcut to `nel 1` (natural logarithm) * `sin` is a shortcut to `tri 0` (sine) diff --git a/mu808asm.py b/mu808asm.py index aa4f28f..1d04ca8 100755 --- a/mu808asm.py +++ b/mu808asm.py @@ -39,6 +39,8 @@ jmpfunc_shorts = { 'iva': 'cpy 2', # indirect value assignment 'inc': 'fma 127 127', # increment 'mul': 'fma 0', # multiplication + 'neg': 'sub 0 127', # negation + 'inv': 'div 127', # inversion/reciprocal 'exp': 'nel 0', # natural exponent 'log': 'nel 1', # natural logarithm 'sin': 'tri 0', # sine