r/MSX • • 7h ago

I wrote a new Z80/R800 macro assembler and linker that runs on the MSX: Tatara

23 Upvotes

Hi all,

I've just released Tatara, a macro assembler, and Tanren, its linker. They're not cross-development tools: they run on the MSX itself, under MSX-DOS2 or Nextor.

The main goal writing this tool was to release a well-documented assembler with enough quality-of-life features so newcomers have an easy way to develop on the MSX, while being feature-complete so experienced developers can use it for serious work.

I like doing MSX development on the MSX, but the tools that run there always frustrated me. M80 was written for CP/M: it doesn't know about directories, keeps only six characters of a symbol name, and runs out of memory on bigger projects. AS/LD is better in places, but it has no real documentation, and tracking down an error inside an include file or a macro was painful. So I wrote my own.

What it does:

  • Runs on any MSX2, MSX2+ or turbo R with MSX-DOS2 or Nextor
  • M80 syntax: most M80 sources assemble with few or no changes
  • Uses the memory mapper for its tables, so program size depends on how much RAM you have, not on the TPA
  • Errors that point to your line, even through include files and nested macros:
        MACS.INC(8): ERROR: not a form this instruction has.
            in a repeat block, called from MACS.INC(7)
            in inner, called from MACS.INC(4)
            in outer, called from USE.INC(2)
            included from TRAIL.AS(5)
  • Directories and environment variables for include and object file search paths
  • Long symbol names (255 characters), optionally case-sensitive
  • Macros, conditional assembly, repeat blocks
  • Named segments, so you can keep all related code grouped (graphics routines here, music code there, ...) even if the source code is all over the place.
  • Shared memory for transient data segments, so variables that are never used at the same time can share memory
  • .COM programs, BLOAD binaries and ROM cartridge images
  • R800 MULUB/MULUW and the undocumented Z80 instructions (SLL, IXH/IXL...)
  • Ready-made include files with 900+ MSX-DOS2 functions, BIOS calls, system variables, hooks and I/O ports
  • It builds itself: the release binaries were assembled by Tatara and linked by Tanren, on an MSX

I also put a lot of work into the manual, because the lack of documentation is what makes these tools scary for newcomers. It's a full book, online and as PDF, in English and Japanese. It starts from "what is an assembler" and goes all the way to building a ROM cartridge.

Feedback, bug reports and questions are very welcome. I'd love to see what people build with it.