Skip to main content

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

Project description

Opcode Tools

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

.W 0x01,0x1234

Example Input

; Example assembly input

.include hardware.asm

._CPU = Z80
.CONST_A = 0x20

0x8000:
Start:

   LD  A,0x23     ; A constant
   LD  B,(0x10)
   LD  H,(DataA)
   LD  E,CONST_A
   JP  Start

DataA:
. 0x10,0x20,0x30

DataB:
. 0x20

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.0.tar.gz (30.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for opcodetools-1.0.tar.gz
Algorithm Hash digest
SHA256 2d34847af9b5c54a78b8992bd43eb100fc5227c2ef006a92239c78b9d980f0ba
MD5 e6e190bbc1dd10a4eebbede8284cec5c
BLAKE2b-256 af67ca9d0a3be1ddb16b02ab09cc0ffb9486b65cde9581929d8931f18101c488

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