diff --git a/osaca/parser/parser_x86att.py b/osaca/parser/parser_x86att.py index f12d9aa..8739e00 100755 --- a/osaca/parser/parser_x86att.py +++ b/osaca/parser/parser_x86att.py @@ -22,7 +22,7 @@ class ParserX86ATT(BaseParser): self.isa = "x86" def construct_parser(self): - """Create parser for ARM AArch64 ISA.""" + """Create parser for x86 AT&T ISA.""" decimal_number = pp.Combine( pp.Optional(pp.Literal("-")) + pp.Word(pp.nums) ).setResultsName("value") @@ -36,7 +36,7 @@ class ParserX86ATT(BaseParser): # Define x86 assembly identifier relocation = pp.Combine(pp.Literal("@") + pp.Word(pp.alphas)) id_offset = pp.Word(pp.nums) + pp.Suppress(pp.Literal("+")) - first = pp.Word(pp.alphas + "_.", exact=1) + first = pp.Word(pp.alphas + "-_.", exact=1) rest = pp.Word(pp.alphanums + "$_.+-") identifier = pp.Group( pp.Optional(id_offset).setResultsName("offset") @@ -89,7 +89,7 @@ class ParserX86ATT(BaseParser): ).setResultsName(self.IMMEDIATE_ID) # Memory preparations - offset = pp.Group(identifier | hex_number | decimal_number).setResultsName( + offset = pp.Group(hex_number | decimal_number | identifier).setResultsName( self.IMMEDIATE_ID ) scale = pp.Word("1248", exact=1) diff --git a/osaca/semantics/isa_semantics.py b/osaca/semantics/isa_semantics.py index b792de9..5c7fa9e 100755 --- a/osaca/semantics/isa_semantics.py +++ b/osaca/semantics/isa_semantics.py @@ -227,7 +227,7 @@ class ISASemantics(object): Create operand dictionary containing src/dst operands out of the ISA data entry and the oeprands of an instruction form - If breaks_pedendency_on_equal_operands is True (configuted per instruction in ISA db) + If breaks_dependency_on_equal_operands is True (configuted per instruction in ISA db) and all operands are equal, place operand into destination only. :param dict isa_data: ISA DB entry @@ -240,12 +240,12 @@ class ISASemantics(object): op_dict["src_dst"] = [] # handle dependency breaking instructions - if "breaks_pedendency_on_equal_operands" in isa_data and operands[1:] == operands[:-1]: + if "breaks_dependency_on_equal_operands" in isa_data and operands[1:] == operands[:-1]: op_dict["destination"] += operands if "hidden_operands" in isa_data: op_dict["destination"] += [ AttrDict.convert_dict( - {hop["class"]: {k: hop[k] for k in ["class", "source", "destination"]}} + {hop["class"]: {k: hop[k] for k in ["name", "class", "source", "destination"]}} ) for hop in isa_data["hidden_operands"] ]