pass
+class DisassemblerError(Exception):
+ pass
+
+
+
+def collect(stream, byteorder=ByteOrder.LITTLE):
+ while True:
+ insn = stream.read(4)
+ length = len(insn)
+ if length == 0:
+ return
+ elif length < 4:
+ raise IOError(insn)
+ insn = WordInstruction.integer(value=insn, byteorder=byteorder)
+ if insn.PO == 0x1:
+ suffix = stream.read(4)
+ length = len(suffix)
+ if length == 0:
+ yield insn
+ return
+ elif length < 4:
+ raise IOError(suffix)
+
+ prefix = insn
+ suffix = WordInstruction.integer(value=suffix, byteorder=byteorder)
+ insn = SVP64Instruction.pair(prefix=prefix, suffix=suffix)
+ if insn.prefix.id != 0b11:
+ insn = PrefixedInstruction.pair(prefix=prefix, suffix=suffix)
+ yield insn
+
+
class Database:
def __init__(self, root):
root = _pathlib.Path(root)
arguments=arguments, specifiers=specifiers)
raise AssemblerError(opcode)
+
+ def disassemble(self, insn, byteorder=ByteOrder.LITTLE, style=Style.NORMAL):
+ return insn.disassemble(record=self[insn],
+ byteorder=byteorder, style=style)