更新异常

This commit is contained in:
moyan 2024-05-07 16:47:19 +08:00
parent 13047c2443
commit bd1b011046

View File

@ -1,15 +1,21 @@
class dtMemoryError(Exception):
class MemoryError(Exception):
pass
class AddressError(dtMemoryError):
class AddressError(MemoryError):
def __init__(self, index=None):
super().__init__(self)
if not index:
self.errorinfo = "None"
else:
self.errorinfo = str(hex(index))
def __str__(self):
return self.errorinfo
class OutOfMemory(MemoryError):
pass
class OutOfMemory(dtMemoryError):
pass
class InstructionError(Exception):
pass
@ -20,3 +26,4 @@ class InvalidInstruction(InstructionError):
class BadOperand(InstructionError):
pass