Skip to main content

Assemblers/Disassemblers for retro processors (Z80, 6502, 6809, etc)

Project description

Opcode Tools

Known CPUs

  • 6502
  • 6803
  • 6809
  • 8052
  • DVG (Atari vector generator used in OmegaRace, Asteroids, etc)
  • Z80
  • Z80GB (Z80 variant used in the Nintendo GameBoy)

Disassembler

py -m opcodetools.dasm Z80 0 "test1.bin+test2.bin"
  • CPU
  • Origin
  • One or more files that make up the binary

Assembler

py -m opcodetools.asm hello.asm

See the Example Input below.

The assembler recognizes four different kinds of text lines:

  • A blank line (ignored)
  • A label: a single word/number ending with a ":"
  • A directive: a line beginning with a "."
  • Everything else is a line of assembly opcodes

Comments

  LD  A,5  ; Five rows per object

Everything after a ";" on a line is ignored as a comment. Lines that begin with a ";" are seen as blank lines (ignored).

Includes

.include hardware.asm

Key/Value Constants

._CPU = Z80
.CONST_A = 0x20

KEY = VALUE pairs. Keys that begin with "_" are meant for the assembler.

Data Definition

Bytes

. 0x01,2,3,4,0x05

Words

.word 0x01,0x1234

Example Input

; Example assembly input

.include hardware.asm

._CPU = Z80
.CONST_A = 0x20

0x8000:
Start:

   LD  A,0x23     ; constant
   LD  A,(0x10)   ; memory location
   LD  HL,(DataB) ; memory location
   LD  HL,DataA   ; constant
   LD  E,CONST_A  ; constant
   JP  Start

DataA:
. 0x10,0x20,0x30

DataB:
. 0x40,0x50

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opcodetools-1.3.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opcodetools-1.3-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file opcodetools-1.3.tar.gz.

File metadata

  • Download URL: opcodetools-1.3.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for opcodetools-1.3.tar.gz
Algorithm Hash digest
SHA256 0a6725aef2b29a4d24d5306cec9159174c9dd46a7f92133693aa6b739b58338a
MD5 683134c1ff2ecdd7359f0356693c9611
BLAKE2b-256 c29da3bd355611e1b1586f55c63cd765cc283d7e972d1a47bb3d6dac7a568b4f

See more details on using hashes here.

File details

Details for the file opcodetools-1.3-py3-none-any.whl.

File metadata

  • Download URL: opcodetools-1.3-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for opcodetools-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3f80f9475d1d0ec381c92c507f7a3bf6c3d780cc68dc7a6a2a39fd1d3e2eb6dd
MD5 78c2e9bed8789246a8e1cdd9573c2919
BLAKE2b-256 529edca796468c49c927dd9c0c71b4aeea9f8d9cd84b70d5947d01d190effcd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page