Tatara

Chapter 1
Introduction

1.1 What Tatara and Tanren are

Tatara and Tanren are the two tools you need to turn a program written in Z80 assembly language into a program that runs on an MSX.

Tatara is an assembler. It reads the program you have written, a text file of instructions such as ld a,5 and call 5, and turns it into the machine code that the Z80 processor understands.

Tanren is a linker. It takes the machine code that Tatara has produced, from one file or from several, joins it together, decides where in memory each part will go, and writes a finished program that you can run.

Why there are two tools and not one, and what each of them does in detail, is the subject of chapter 2.

Both tools run on the MSX itself, under MSX-DOS2 or Nextor. You write your program, assemble it, link it and run it on the same machine, with no other computer involved. They run in the same way in an MSX emulator.

Tatara reads the assembly language of Microsoft’s MACRO-80, the assembler that was used to write much of the software of the CP/M and early MSX years. Programs and books written for MACRO-80 can therefore be used with Tatara. Appendix J lists where the two differ.

1.2 Where the names come from

The two names come from the traditional way of making a Japanese sword.

A tatara (たたら) is a clay furnace. Iron sand and charcoal are loaded into it and burnt, over about three days, until they have turned into raw steel: a rough block of metal, strong but shapeless, and not yet a blade.

Tanren (鍛錬) is the forging that follows. The smith heats the raw steel, hammers it and folds it, again and again, until it becomes a finished blade. In everyday Japanese the same word also means training and discipline.

The two tools do the same two jobs for a program, as figure 1.1 shows. The source files you write are the raw materials. TATARA turns them into object files: real machine code, but not yet a program you can run, in the same way that raw steel is not yet a sword. TANREN takes one or more object files and forges them into the finished program. Chapter 2 builds on this picture.

PIC

Figure 1.1: From raw materials to a finished blade, and from source files to a finished program.

1.3 What they can do

This is a short list, for a first reading. Each point is explained in full in the chapter it refers to.

1.4 What you need

To use Tatara and Tanren you need:

Any MSX2 or later model that can run MSX-DOS2 or Nextor will do, and so will any MSX emulator that can run them.

1.5 What is next

Chapter 2 explains what an assembler and a linker do, and why a program is built in two steps. Chapter 3 installs the tools, and chapter 4 uses them to build and run a first program.