diff --git a/README.md b/README.md index 967a43a..b76d280 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,7 @@ The shortcut mnemonics for other operations are as follows: * `sin` is a shortcut to `tri 0` (sine) * `cos` is a shortcut to `tri 1` (cosine) * `atn` is a shortcut to `tri 2` (arctangent) +* `nnn` is a shortcut to `nop 0 0 0` (a short alias for NOP) ### Port input and output diff --git a/mu808asm.py b/mu808asm.py index 67d7b7d..c97fdaf 100755 --- a/mu808asm.py +++ b/mu808asm.py @@ -19,28 +19,29 @@ mnemos = ['nop', 'jmp', 'iat', 'out', 'inp', 'set', 'cpy', 'fma', # mu808 jump/function shortcuts jmpfunc_shorts = { - 'ige': 'jmp 10', # indirect jump if greater than or equals to zero - 'ile': 'jmp 11', # indirect jump if less than or equals to zero - 'ine': 'jmp 12', # indirect jump if not equals to zero - 'iuc': 'jmp 13 0', # indirect unconditional jump - 'jeq': 'jmp 0', # direct jump if equals to zero - 'jgt': 'jmp 1', # direct jump if greater than zero - 'jlt': 'jmp 2', # direct jump if less than zero - 'jge': 'jmp 3', # direct jump if greater than or equals to zero - 'jle': 'jmp 4', # direct jump if less than or equals to zero - 'jne': 'jmp 5', # direct jump if not equals to zero - 'juc': 'jmp 6 0', # direct unconditional jump - 'ieq': 'jmp 7', # indirect jump if equals to zero - 'igt': 'jmp 8', # indirect jump if greater than zero - 'ilt': 'jmp 9', # indirect jump if less than zero - 'dia': 'cpy 0', # direct integer assignment - 'dva': 'cpy 1', # direct value assignment - 'iva': 'cpy 2', # indirect value assignment - 'exp': 'nel 0', # natural exponent - 'log': 'nel 1', # natural logarithm - 'sin': 'tri 0', # sine - 'cos': 'tri 1', # cosine - 'atn': 'tri 2' # arctangent + 'nnn': 'nop 0 0 0', # alias for nop + 'ige': 'jmp 10', # indirect jump if greater than or equals to zero + 'ile': 'jmp 11', # indirect jump if less than or equals to zero + 'ine': 'jmp 12', # indirect jump if not equals to zero + 'iuc': 'jmp 13 0', # indirect unconditional jump + 'jeq': 'jmp 0', # direct jump if equals to zero + 'jgt': 'jmp 1', # direct jump if greater than zero + 'jlt': 'jmp 2', # direct jump if less than zero + 'jge': 'jmp 3', # direct jump if greater than or equals to zero + 'jle': 'jmp 4', # direct jump if less than or equals to zero + 'jne': 'jmp 5', # direct jump if not equals to zero + 'juc': 'jmp 6 0', # direct unconditional jump + 'ieq': 'jmp 7', # indirect jump if equals to zero + 'igt': 'jmp 8', # indirect jump if greater than zero + 'ilt': 'jmp 9', # indirect jump if less than zero + 'dia': 'cpy 0', # direct integer assignment + 'dva': 'cpy 1', # direct value assignment + 'iva': 'cpy 2', # indirect value assignment + 'exp': 'nel 0', # natural exponent + 'log': 'nel 1', # natural logarithm + 'sin': 'tri 0', # sine + 'cos': 'tri 1', # cosine + 'atn': 'tri 2' # arctangent } # converts the MU8A source code to the plaintext machine code representation