Skip to content

Commit

Permalink
Fix: Typo in grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiTheModder committed Jan 2, 2025
1 parent db5b9d7 commit ae8ed2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions smalig/grammar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions smalig/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ae8ed2a

Please sign in to comment.