jAsm Logo

"If you'll take thunder and lightning, and a steamboat and a buzz-saw, and mix 'em up, and put 'em into a woman, that's jAsm"

Zapac citing Josiah Gilbert Holland

The Assembler

This is the official home for the 6502 and Z80 assembler jAsm. jAsm was written by me, Jonas Hultén, during 7 months in 2015. It is heavily geared towards C64 development, since that's what it's intended to be used for. It currently runs on the 64-bit Linux and Windows platforms but it should be fairly easy to port it to other platforms since it has no dependencies except the standard C++ library.

The Documentation

Have a look at the documentation.

The Binaries

Windows binaries requires the C++ Redistributable for VS2015 to be installed.

The Source

As a tribute to Matthew Dillon, who created DAsm and released the source code to the public, I am releasing the source code to jAsm as well. I have used DAsm for many years and I have made smaller adjustments to suit my needs over the years. That wouldn't have been possible without access to the source code. I am very grateful and I am giving back to the community by releasing the source for free.

The source code is available on BitBucket at https://bitbucket.org/bjonte/jasm.

Version History

  • 1.22
    • Symbol difference dump added at debug verbosity when an oscillating state occurs. Also the generation pass is run to give more error information if that happens.
    • Removed CodeBlocks project in favor of KDevelop.
    • Migrated from Git to Mercurial.
  • 1.21
    • Fixed broken instruction data labels on Z80.
    • Removed the special syntax for petscii strings and character literals. This is replaced by the string() function that now takes over the translation.
    • Added string conversion to ZX80 and ZX81 character sets.
    • If there are more addressing mode combinations that 11, the printout is skipped to avoid spamming the error log.
    • Added No$GBA symbol dump format to aid ZX80/81 coding in EightyOne.
    • Fixed unnamed scopes in the symbol dump file for repeat scopes and the root scope.
    • Removed the initial namespace separator in symbol dump file.
    • Allow exporting instruction data labels from modules.
  • 1.20
    • Added unicode function to convert a character to a string.
  • 1.19
    • Fixed a serious problem in the z80 version where the automatic @i variable couldn't be used.
    • It is now possible to make local variables with names using processor keywords.
    • 6502 register names are now reserved keywords. It was possible to create global variables with register names. This change is one step towards storing a register type in a variable.
  • 1.18
    • Fixed a serious problem in the z80 version where instruction names were colliding with keywords and property names.
    • Fixed documentation bug.
    • Optimized variable handling.
  • 1.17
    • Fixed a bug where references to values were not followed when defining data.
    • Floats can no longer be used as keys in maps since they shouldn't be compared for equality.
    • Fixed a bug where different internal types were treated as different even if the value was actually the same.
    • Optimized copy-on-write to only make copies if there are at least two references to the object. Large lists and maps were incredibly slow before this change.
  • 1.16
    • Fixed a serious bug that caused crashes if expressions contained macro calls that generated a lot of local variables.
  • 1.15
    • Fixed a serious bug that caused broken expressions if they contained a lot of operators.
    • Dropped support for Code::Blocks due to bugs in the IDE. Now Sublime Text 3 and GDB is used instead.
  • 1.14
    • The map data type was added.
    • The operator precedence for shift is now higher than multiply, divide, add and subtract.
    • Fixed a bug where variables could be fetched from the previous assembly pass.
  • 1.13
    • The Z80 instructions adc, add, sbc and sub has mirrored addressing modes to support both immediate value and a register or only the immediate value.
    • An unstable variable state is considered an error now.
  • 1.12
    • Fixed setting word registers to negative values in Z80.
    • Fixed a parsing bug in Z80 indirect addressing mode instructions.
  • 1.11
    • Changed operator precendence so that &, | and ^ has higher priority than compare operators. This basically abandons the C-style precendence and adopts the Rust one.
    • Added a warning for a code path passing through the end of a subroutine.
    • Fixed a serious bug where local and global constants or variables with the same name could be mixed up in the root scope.
  • 1.10
    • Stderr is no longer used
    • Select function like ternary if
    • Modulo and remainder functions
    • Multi bank mode truncates word arguments and definitions
  • 1.9
    • Macro function support
  • 1.8
    • List support
    • Range-based for loop
    • Fixed cases where constant could be modified
  • 1.7
    • Z80 support
    • C-style multiline comments
    • Removed the -hraw argument. This is now default.
  • 1.6
    • Tailing comma allowed in enum definitions
    • Ellipsis can be used in data definitions to create repeated patterns
    • Fill byte can be specified when aligning memory
    • Incbin takes optional arguments for start offset and max size
  • 1.5
    • Module import variables
  • 1.4
    • Dynamically generated symbol names
    • Print function
    • Fixed a serious precedence and associativity bug in the expression evaluation
  • 1.3
    • Modules
    • Macro call stack in error messages
  • 1.2
    • Generic predeclared symbols
    • Macro code can use local variables surrounding the macro code
  • 1.1
    • Section parts
    • Section part mappings
    • Syntax highlighting for Sublime Text 3
    • Local subroutines
    • Reservation of zero sized arrays
  • 1.0
    • Initial release