diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arch.py | 6 | ||||
| -rw-r--r-- | arch/x86.py | 33 |
2 files changed, 39 insertions, 0 deletions
diff --git a/arch/arch.py b/arch/arch.py new file mode 100644 index 0000000..36a4e3f --- /dev/null +++ b/arch/arch.py @@ -0,0 +1,6 @@ +class Arch(): + def __init__(self, regnames: list[str]): + self.regnames = regnames + + def __eq__(self, other): + return self.regnames == other.regnames diff --git a/arch/x86.py b/arch/x86.py new file mode 100644 index 0000000..0f60457 --- /dev/null +++ b/arch/x86.py @@ -0,0 +1,33 @@ +"""Architexture-specific configuration.""" + +from .arch import Arch + +# Names of registers in the architexture +regnames = ['PC', + 'RAX', + 'RBX', + 'RCX', + 'RDX', + 'RSI', + 'RDI', + 'RBP', + 'RSP', + 'R8', + 'R9', + 'R10', + 'R11', + 'R12', + 'R13', + 'R14', + 'R15', + 'RFLAGS', + 'flag ZF', + 'flag CF', + 'flag OF', + 'flag SF', + 'flag PF', + 'flag DF'] + +class ArchX86(Arch): + def __init__(self): + super().__init__(regnames) |