diff --git a/smalig/grammar.yaml b/smalig/grammar.yaml index 2c4e96e..6cfbb8c 100644 --- a/smalig/grammar.yaml +++ b/smalig/grammar.yaml @@ -281,7 +281,7 @@ long_desc: "Moves the literal value BBBB0000 into vAA. BBBB is right-zero-extended to 32 bits. The value of BBBB is in the range -32768 to 32767 (-0x80000000 to 0x7FFF0000)." note: "Generaly used to initialise float values." example: "1500 2041 - const/high16 v0, 0x41200000 (#float 10.0)" - example_disc: "Moves the floating literal value 0x41200000(10.0) into v0. The 16 bit literal in the instruction carries the top 16 bits of the floating point number." + example_desc: "Moves the floating literal value 0x41200000(10.0) into v0. The 16 bit literal in the instruction carries the top 16 bits of the floating point number." - opcode: "16" name: "const-wide/16" @@ -293,7 +293,7 @@ long_desc: "Moves the literal value BBBB into register-pair (vAA, vAA+1), expanding the integer constant into a long constant. BBBB is sign-extended to 64 bits. The value of BBBB is in the range -32768 to 32767 (-0x8000 to 0x7FFF)." note: "" example: "1600 0A00 - const-wide/16 v0, 0xa (#long 10.0)" - example_disc: "Moves the long literal value 0xa(10) into (v0,v1) register-pair." + example_desc: "Moves the long literal value 0xa(10) into (v0,v1) register-pair." - opcode: "17" name: "const-wide/32" @@ -305,7 +305,7 @@ long_desc: "Moves the literal value BBBBBBBB into register-pair (vAA, vAA+1), expanding the integer constant into a long constant. BBBBBBBB is sign-extended to 64 bits. The value of BBBBBBBB is in the range -2147483648 to 2147483647 (-0x80000000 to 0x7FFFFFFF)." note: "" example: "1702 4E61 BC00 - const-wide/32 v2, 0x00bc614e" - example_disc: "Moves the long literal value 0x00bc614e into (v2,v3) register-pair." + example_desc: "Moves the long literal value 0x00bc614e into (v2,v3) register-pair." - opcode: "18" name: "const-wide" @@ -317,7 +317,7 @@ long_desc: "Moves the literal value constant BBBBBBBBBBBBBBBB into register-pair (vAA, vAA+1). The value of BBBBBBBBBBBBBBBB is in the range -9223372036854775808 to 9223372036854775807 (-0x8000000000000000 to 0x7FFFFFFFFFFFFFFF)." note: "" example: "1802 874b 6b5d 54dc 2b00- const-wide v2, 0x002bdc545d6b4b87 (#long 12345678901234567)" - example_disc: "Moves the long literal value 0x002bdc545d6b4b87 into (v2,v3) register-pair." + example_desc: "Moves the long literal value 0x002bdc545d6b4b87 into (v2,v3) register-pair." - opcode: "19" name: "const-wide/high16" @@ -329,7 +329,7 @@ long_desc: "Moves the literal value BBBB into register-pair (vAA, vAA+1). BBBB is right-zero-extended to 64 bits. The value of BBBB is in the range -32768 to 32767 (-0x8000 to 0x7FFF)." note: "Generaly used to initialise double values." example: "1900 2440 - const-wide/high16 v0, 0x402400000 (#double 10.0)" - example_disc: "Moves the double literal value 10.0 into (v0,v1) register-pair." + example_desc: "Moves the double literal value 10.0 into (v0,v1) register-pair." - opcode: "28" name: "goto" diff --git a/smalig/utils/__init__.py b/smalig/utils/__init__.py index afa9290..c493c86 100644 --- a/smalig/utils/__init__.py +++ b/smalig/utils/__init__.py @@ -39,6 +39,9 @@ def __init__(self, instructions: list[dict], target: str, exact_match: bool = Tr def __str__(self): if isinstance(self.result, dict): + if not self.result: + results = f"No instruction found for {self.target}!" + return results results = f"Opcode: {self.result['opcode']}\n" results += f"Name: {self.result['name']}\n" results += f"Format: {self.result['format']}\n"