[docs]classRegisterOffset(int):"""A register offset is an integer that represents the offset of a register in VEX's register memory space. """def__add__(self,other):ifisinstance(other,int):returnRegisterOffset(int(self)+other)returnNotImplemented
TmpVar=NewType("TmpVar",int)# This causes too much issues as a NewType, sot is a simple alias instead# This means that is still legal to pass any str where a RegisterName is expected.# The downside is that PyCharm will show the type as `str` when displaying the signatureRegisterName=str
[docs]classEndness(StrEnum):"""Endness specifies the byte order for integer values :cvar LE: little endian, least significant byte is stored at lowest address :cvar BE: big endian, most significant byte is stored at lowest address :cvar ME: Middle-endian. Yep. """LE="Iend_LE"BE="Iend_BE"ME="Iend_ME"ANY="any"UNSURE="unsure"