diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/__init__.py | 7 | ||||
| -rw-r--r-- | arch/arch.py | 5 | ||||
| -rw-r--r-- | arch/x86.py | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/arch/__init__.py b/arch/__init__.py new file mode 100644 index 0000000..4943749 --- /dev/null +++ b/arch/__init__.py @@ -0,0 +1,7 @@ +from .arch import Arch +from . import x86 + +"""A dictionary containing all supported architectures at their names.""" +supported_architectures: dict[str, Arch] = { + "X86": x86.ArchX86(), +} diff --git a/arch/arch.py b/arch/arch.py index 36a4e3f..a46439e 100644 --- a/arch/arch.py +++ b/arch/arch.py @@ -1,6 +1,7 @@ class Arch(): - def __init__(self, regnames: list[str]): - self.regnames = regnames + def __init__(self, archname: str, regnames: list[str]): + self.archname = archname + self.regnames = set(regnames) def __eq__(self, other): return self.regnames == other.regnames diff --git a/arch/x86.py b/arch/x86.py index 0f60457..2b27315 100644 --- a/arch/x86.py +++ b/arch/x86.py @@ -30,4 +30,4 @@ regnames = ['PC', class ArchX86(Arch): def __init__(self): - super().__init__(regnames) + super().__init__("X86", regnames) |