Tatara

Appendix J
Source compatibility with M80

This appendix is for readers who have sources written for M80 and want to assemble them with TATARA. It compares TATARA with MSX-M80, the M80 in ASCII’s MSX-DOS2 TOOLS, whose listings call it MSX.M-80 2.00.

Most Z80 sources written for M80 assemble with TATARA unchanged. A few directives and forms need changing, and are listed below with what to write instead. Object files are not interchangeable: TATARA writes object files of its own (appendix F), not M80’s .REL files.

J.1 What carries over

These work in TATARA as they do in M80:

M80’s other names for directives are accepted too: COND and IFT for IF, IFF for IFE, DEFB and DEFM for DB, DEFS for DS, DEFW for DW, ENTRY for PUBLIC, EXT for EXTRN, and *EJECT and $EJECT, in column 1, for PAGE (section A.4).

J.2 M80 directives that TATARA does not accept

The directives in table J.1 stop TATARA with not a directive, a macro or an instruction., or, for the two control lines, with only *EJECT and its dollar spelling are control lines.

Table J.1: M80 directives that TATARA does not accept, and what to write instead.

M80

In TATARA

SET

DEFL, which does the same (section 12.4).

GLOBAL

PUBLIC.

EXTERNAL

EXTRN.

ENDC

ENDIF.

MACLIB, $INCLUDE, *INCLUDE

INCLUDE.

*TITLE, $TITLE

SUBTTL, with the text without brackets or quotation marks.

.Z80

Delete it. TATARA always assembles Z80 instructions.

.8080

TATARA has no 8080 mode. The source has to be rewritten with Z80 mnemonics.

.RADIX

Write each number with its suffix: 0FFh, not 0FF after .radix 16.

COMMON

Define the variables in one module and share them with PUBLIC and EXTRN (section 12.5); for blocks that take turns in the same memory, use a transient segment (chapter 29).

NAME

Delete it. The name of a module is the name of its source file (section F.1).

.COMMENT

Start each line of the comment with ;, or put the block between if 0 and ENDIF.

.PRINTX

No equivalent. Delete it.

.REQUEST

Name the file on TANREN’s command line or in a link file (chapter 21).

.PHASE, .DEPHASE

No equivalent.

.CREF, .XCREF

Delete them. TATARA makes no cross-reference file.

J.3 Other forms

Table J.2 compares the other parts of a source that differ, or that a reader who knows M80 may wonder about.

Table J.2: Other forms in M80 sources, and how TATARA reads them.

M80 form

In TATARA

foo::

The same: a label that is also PUBLIC.

far##

Not accepted: undefined symbol in an expression. Declare the name with EXTRN and write it without ##.

X’41’

Not accepted: undefined symbol in an expression. Write 41h.

NUL

Not accepted. Test an argument with IFB or IFNB (section 16.6).

TYPE

Not accepted, and has no equivalent. IFDEF tells whether a name is defined.

%lb in a macro argument

The same: the value of lb is passed, in decimal.

a!;b and <a;b>

The same: both pass a;b, with the semicolon.

;; in a macro

The same: the comment is not kept in the expansion.

An expression alone on a line

Not accepted. M80 takes 41h on its own as db 41h; in TATARA, write the DB.

8080 mnemonics

Not accepted: mvi a,1 is ld a,1.

A word in column 1 that starts with * or $

A control line, as in M80. Only *EJECT and $EJECT are accepted; any other stops TATARA, so $loop: cannot be a label.

A label with other characters

Refused: a name may hold only letters, digits, ? @ . _ and the dollar sign.

The length of a name

M80 uses only the first six characters of a name; TATARA uses all of them, up to 255 (section 7.2). Two names that M80 took as one, such as buffer1 and buffer2, are two names in TATARA.

Upper and lower case

The same by default: they do not matter in a name. /C makes them matter (section 7.3).

The length of a line

M80 reads 132 characters; TATARA reads 255.

A label named IXH, IXL, IYH or IYL

Legal in M80, refused in TATARA, where the four are registers: IXH, IXL, IYH and IYL are registers, not names.

J.4 What TATARA adds

TATARA does more than MSX-M80 in these ways:

J.5 Other differences

The command line.

MSX-M80 takes a command such as m80 =hello/l, with the output files before the =. TATARA takes the source first: tatara /l hello.as (chapter 5).

The object file.

TATARA writes a .TRO file, which TANREN links (appendix F). It cannot write a .REL file, and TANREN cannot read one, so every module of a program is assembled with TATARA.

The listing.

The layout is close to M80’s, with the differences noted in chapter 18.

Messages.

M80 marks a line with a letter, such as U or V, and goes on to the end of the source. TATARA prints a sentence and stops at the first error (section 20.2, appendix D).

J.6 Converting a source

To assemble a source written for MSX-M80 with TATARA:

  1. Delete .Z80, NAME, .PRINTX, .CREF and .XCREF.
  2. Change SET to DEFL, GLOBAL to PUBLIC, EXTERNAL to EXTRN, ENDC to ENDIF, MACLIB, $INCLUDE and *INCLUDE to INCLUDE, and $TITLE or *TITLE to SUBTTL.
  3. Replace name## with EXTRN declarations, X’nn’ with nnH, and numbers written after .RADIX with numbers that carry their suffix.
  4. Rewrite .COMMENT blocks, COMMON blocks and any expression alone on a line, as in tables J.1 and J.2.
  5. Set TATARA to the directories of the include files, if they are not beside the source or in the current directory. TATARA does not read INCLUDE.
  6. Rename any label called IXH, IXL, IYH or IYL.
  7. Look for names that differ only after their sixth character: M80 took them as one name, TATARA does not.
  8. Assemble. TATARA stops at the first line it cannot take, and the message names the file and line, so the rest can be found one at a time.
  9. Assemble every module of the program with TATARA, and link them with TANREN.