Intial commit
This commit is contained in:
40
h8536/model.py
Normal file
40
h8536/model.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class EA:
|
||||
text: str
|
||||
mode: str
|
||||
size: str
|
||||
length: int
|
||||
reg: int | None = None
|
||||
value: int | None = None
|
||||
address: int | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class Instruction:
|
||||
address: int
|
||||
raw: bytes
|
||||
mnemonic: str
|
||||
operands: str = ""
|
||||
kind: str = "normal"
|
||||
targets: list[int] = field(default_factory=list)
|
||||
fallthrough: bool = True
|
||||
comment: str = ""
|
||||
valid: bool = True
|
||||
references: list[int] = field(default_factory=list)
|
||||
writes_br: bool = False
|
||||
br_value: int | None = None
|
||||
|
||||
@property
|
||||
def size(self) -> int:
|
||||
return len(self.raw)
|
||||
|
||||
@property
|
||||
def text(self) -> str:
|
||||
if self.operands:
|
||||
return f"{self.mnemonic} {self.operands}"
|
||||
return self.mnemonic
|
||||
Reference in New Issue
Block a user