Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/arch/interface/quad.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Quad:
"""Implements a Quad code instruction."""

instr: str
instr: ICInstruction
args: tuple[str, ...]

def __init__(self, instr: ICInstruction, *args) -> None:
Expand Down
3 changes: 2 additions & 1 deletion src/arch/z80/backend/icinstruction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import StrEnum
from functools import lru_cache
from typing import Any

Expand All @@ -7,7 +8,7 @@


# HINT: Do not use Enums here. They cannot be subclassed
class ICInstruction:
class ICInstruction(StrEnum):
ADDU8 = "addu8"
ADDI8 = "addi8"
ADDI16 = "addi16"
Expand Down
2 changes: 1 addition & 1 deletion src/arch/z80/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Backend(BackendInterface):

def _set_quad_table(self):
"""Lowlevel (to ASM) instructions implementation"""
self._QUAD_TABLE = {
self._QUAD_TABLE: dict[ICInstruction, ICInfo] = {
ICInstruction.ADDU8: ICInfo(3, Bits8.add8),
ICInstruction.ADDI8: ICInfo(3, Bits8.add8),
ICInstruction.ADDI16: ICInfo(3, Bits16.add16),
Expand Down