Giter Site home page Giter Site logo

xbbasm's Introduction

xbbasm: The seX-Bob-omB X-Assembler!

A cross-assembler targeting the 6502/6510 processor. Mainly written for learning purposes and to assist me in my experiments with assembly language programming for the Commodore 64. Its syntax, although very limited, borrows a bit from Merlin and from the C64 Macro Assembler Development System.

Alt text

Usage

Basic usage is extremely simple, just run:

$ ./xbbasm program.asm

Optionally specify an output with:

$ ./xbbasm -out b.prg program.asm

For maximum convenience (!) put the binary into your local ~/bin and make sure it's in your PATH.

Features

Some cool things you can do with it (a.k.a. Do-s and Don't-s):

  • Use LISP style S-Expressions in operands like:
lda [+ color $27]
ldy [- color 1],x
  • Use include syntax anywhere in your file like:
./include screen.asm

{... some code ...}

./include subs/math.asm

{... some more code ...}

./include ../misc.asm
  • Insert binary files with ./bin {filename}

  • Inline or off-line labels, just take into account that labels not on the same line need to end with :. For labels on the same line that is optional.

  • It is allowed to enter label aliases (EQU in Merlin) between an off-line label and the next code line (see examples). This helps to put those below the subroutine name label but above the code and give it a more function-like look.

  • For opcodes and operands syntax is case-insensitive.

Notes

About the examples:

Example asm source files in the /examples directory were taken from different sources, credited when relevant, mostly to show what it can be done.

A note on building from sources:

For keeping the directory structure of the project, if you're using the default workspace in $HOME/go in Linux you can create a symbolic link like:

$ ln -s /home/you/path/to/xbbasm/src/ /home/you/go/src/xbbasm

To-Dos:

  • Document all the supported syntax so a user doesn't have to go through the sources to figure things not in the examples.
  • Add more unit tests since at the moment only the most basic ones exist (no tests for expected errors for example).
  • Would be nice to extend the ./bin instruction to support offset and length params ACME style.

xbbasm's People

Contributors

juliannemosca avatar

Watchers

James Cloos avatar  avatar

xbbasm's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.