Metadata-Version: 2.1
Name: lr35902dis
Version: 1.0.1
Summary: lr35902 (GameBoy CPU) disassembler library
Home-page: https://github.com/Lukas-Dresel/lr35902dis
Author: Lukas Dresel
Author-email: foo@bar.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Disassemblers
Description-Content-Type: text/markdown
License-File: LICENSE

# lr35902dis

A python disassembler library for the LR35902 CPU (the CPU of the GameBoy, similar to a Z80 processor).
This is an adaptation of [z80dis](https://github.com/lwerdna/z80dis). Any errors are probably mine, PRs welcome :).

# Use

```
>>> from lr35902dis import lr35902
>>> lr35902.disasm(b'\xCB\xE7', 0)
'set 4,a'
```

Or, if you'd like access to the instruction internals, like opcode identifier, length, and operands:

```
>>> decoded = lr35902.decode(b'\xCB\xE7', 0)
>>> decoded.op
<OP.SET: 58>
>>> decoded.operands[0]
(<OPER_TYPE.IMM: 45>, 4)
>>> decoded.operands[1]
(<OPER_TYPE.REG_A: 1>,)
>>> decoded.len
2
```

The decoded structure can be supplied to disasm() to make a string:

```
>>> lr35902.disasm(decoded)
'set 4,a'
```



