diff --git a/rcw.py b/rcw.py index e7d3795e..c58e4ce4 100755 --- a/rcw.py +++ b/rcw.py @@ -330,6 +330,34 @@ def build_pbi(lines): v2 = struct.pack(endianess + 'L', p2) subsection += v1 subsection += v2 + elif op == 'loadc': + if p1 == None or p2 == None: + print('Error: "loadc" instruction requires two parameters') + return '' + v1 = struct.pack(endianess + 'L', 0x80140000) + v2 = struct.pack(endianess + 'L', p1) + v3 = struct.pack(endianess + 'L', p2) + subsection += v1 + subsection += v2 + subsection += v3 + elif op == 'jumpc': + if p1 == None or p2 == None: + print('Error: "jumpc" instruction requires two parameters') + return '' + v1 = struct.pack(endianess + 'L', 0x80850000) + v2 = struct.pack(endianess + 'L', p1) + v3 = struct.pack(endianess + 'L', p2) + subsection += v1 + subsection += v2 + subsection += v3 + elif op == 'jump': + if p1 == None: + print('Error: "jump" instruction requires a parameter') + return '' + v1 = struct.pack(endianess + 'L', 0x80840000) + v2 = struct.pack(endianess + 'L', p1) + subsection += v1 + subsection += v2 elif op == 'awrite': if opsize == '.b5': # altconfig write with B=5 (16 bytes) @@ -932,7 +960,7 @@ def create_source(): i += 4 arg2 = struct.unpack(endianess + 'L', pbi[i:i+4])[0] i += 4 - source += "loadcondition 0x%08x,0x%08x\n" % (arg1, arg2) + source += "loadc 0x%08x,0x%08x\n" % (arg1, arg2) elif cmd == 0x20: source += "/* Disassemble not implemented for word 0x%08x */\n" % (word) elif cmd == 0x22: @@ -956,9 +984,9 @@ def create_source(): elif cmd == 0x82: source += "wait 0x%08x\n" % (word & 0xffff) elif cmd == 0x84: - source += "/* Disassemble not implemented for word 0x%08x */\n" % (word) + source += "/* Disassemble not implemented for word 0x%08x (jump) */\n" % (word) elif cmd == 0x85: - source += "/* Disassemble not implemented for word 0x%08x */\n" % (word) + source += "/* Disassemble not implemented for word 0x%08x (jumpc) */\n" % (word) elif cmd == 0x8f: arg1 = struct.unpack(endianess + 'L', pbi[i:i+4])[0] i += 4