implemented spec change: now cell 127 always return 1
This commit is contained in:
+25
-24
@@ -19,30 +19,31 @@ mnemos = ['nop', 'jmp', 'iat', 'out', 'inp', 'set', 'cpy', 'fma',
|
||||
|
||||
# mu808 jump/function shortcuts
|
||||
jmpfunc_shorts = {
|
||||
'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
|
||||
'dca': 'cpy 0', # direct constant assignment
|
||||
'dva': 'cpy 1', # direct value assignment
|
||||
'iva': 'cpy 2', # indirect value assignment
|
||||
'mul': 'fma 0', # multiplication
|
||||
'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
|
||||
'dca': 'cpy 0', # direct constant assignment
|
||||
'dva': 'cpy 1', # direct value assignment
|
||||
'iva': 'cpy 2', # indirect value assignment
|
||||
'inc': 'fma 127 127', # increment
|
||||
'mul': 'fma 0', # multiplication
|
||||
'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
|
||||
|
||||
Reference in New Issue
Block a user