added nnn shortcut

This commit is contained in:
Luxferre
2025-04-30 10:33:13 +03:00
parent b4ca237ed8
commit d20c975ac2
2 changed files with 24 additions and 22 deletions
+1
View File
@@ -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
+23 -22
View File
@@ -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