lr35902 (GameBoy CPU) disassembler library
Project description
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. 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'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lr35902dis-1.0.1.tar.gz
(6.4 kB
view hashes)
Built Distribution
Close
Hashes for lr35902dis-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c3bc4e37cff861e04a61e1c6ed926be38a67896462a87e01734e4b35108ba97 |
|
MD5 | 5bb6ba82f9cb26b7c8d7f455c5fb77a5 |
|
BLAKE2b-256 | 6f4aa86f8fec61cf90f7f51d0cf7018c4762518a11553fdcade488a14a3a1c5c |