cbmasm

command module
v0.0.0-...-77b56b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

cbmasm

THIS IS WORK IN PROGRESS. DON'T EXPECT IT TO WORK OR EVEN COMPILE OUT OF THE BOX

cbmasm is an assembler targeted primarily to the Commodore 128 that allows the programmer to switch between 8510 and Z80 assembly code in a single source file.

It supports Commodore's prg format natively, but can also generate code for pretty much anything that uses a MOS6502 or Z80 CPU. Besides that, cbmasm comes with all the features that you expect from a decent assembler: local labels, macros, conditional assembly, and many more.

It does not support illegal 6510 operations.

Usage

cbmasm [flags] [inputfile] [outputfile]

Supported flags are:

  • -D sym: defines a symbol; can be repeated
  • -I value: include paths; can be repeated
  • -cpu string: CPU to assemble code for (if not specified otherwise in the source code).
    Supported values are 6502, z80; default is 6502
  • -dump_labels: If true, the labels will be printed.
  • -listing: If true, a listing is generated.
  • -plain: If true, the load address is not added to the generated code.
  • -platform string: Target platform.
    Supported values are c128, c64; default is c128

If inputfile and outputfile are not given, cbmasm reads from standard input and writes to standard output.

The assumber starts in 6502 mode. By default, the generated data starts with the load address, conforming to Commodore's "prg" format. If the -plain flag is set, the load address is suppressed.

For more details, read the docs.

Building

To build cbmasm, just run the following command in the projects rood directory:

go build           

You can also run all the tests to verify the binary is behaving as expected:

go test ./...

Project layout

TODO describe directories

License

Copyright (c) 2020-2023 Andreas Signer.
Licensed under GPLv3.

Documentation

Overview

* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm. * * cbmasm is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * cbmasm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cbmasm. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
pkg
asm
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
asm/mos6502
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
asm/z80
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
errors
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
expr
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
scanner
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
text
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
tools
sidconv
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
testgen
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.
* Copyright (c) 2020 Andreas Signer <asigner@gmail.com> * * This file is part of cbmasm.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL