diff --git a/parseinstrs.py b/parseinstrs.py index 7ac0847..3239407 100644 --- a/parseinstrs.py +++ b/parseinstrs.py @@ -245,7 +245,8 @@ import re opcode_regex = re.compile( r"^(?:(?P(?PVEX\.)?(?PNP|66|F2|F3|NFx)\." + r"(?:W(?P[01]|IG)\.)?(?:L(?P[01]|IG)\.)?))?" + - r"(?P(?:[0-9a-f]{2})+)" + + r"(?P(?:0f|0f38|0f3a)?)" + + r"(?P[0-9a-f]{2})" + r"(?P//?[0-7]|//[c-f][0-9a-f])?" + r"(?P\+)?$") @@ -275,8 +276,8 @@ class Opcode(NamedTuple): return cls( prefix=match.group("legacy"), - escape=["", "0f", "0f38", "0f3a"].index(match.group("opcode")[:-2]), - opc=int(match.group("opcode")[-2:], 16), + escape=["", "0f", "0f38", "0f3a"].index(match.group("escape")), + opc=int(match.group("opcode"), 16), opcext=opcext, extended=match.group("extended") is not None, vex=match.group("vex") is not None,