Home

Awesome

tasm6801

Simple Telemark-like assembler for the Motorola 6801/6803 processor for use with linux/OS-X. Intended to be used in conjunction with various emulators of the TRS-80 MC-10 (most notably James Tamer's "Virtual MC-10").

Compatibility and Extensions

Supported directives and their corresponding pseudo-op's are:

DirectivePseudo-opSyntaxDescription
.msfirstignored
.orgorg[label] .org addressset program counter to new address.
.endend[label] .end [expr]finalize object record. optionally set execution start address to expression.
.execstart[label] .execstartset execution start address to the current program counter.
.equequlabel .equ exprmay be used to assign values to labels. expressions may contain other labels.
.modulemodule[label] .module labelinterpret labels beginning with "_" as local labels until encountering the next .module
.bytefcb[label] .byte expr [, expr ...]write a sequence of bytes to the object file.
.wordfdb[label] .word expr [, expr ...]write a sequence of words (two bytes each) to the object file.
.fillrzb[label] .fill num_bytes [, fill_value]fill a specified number of bytes with a constant value. (zero by default)
.blockrmb[label] .block num_bytesbump the program counter by the specified number of bytes without writing a value.
.textfcc[label] .text ("string"|expr) [, ("string"|expr) ...]write a sequence of strings or byte expressions to the object file.
.strsfcs[label] .strs "string" [, "string" ...]write a sequence of msb-terminated strings.
.strzfcz[label] .strz "string" [, "string" ...]write a sequence of null-terminated strings.

Preprocessor macros are not yet supported, however you may use "#define" to preform simple literal substitution.

Expressions respect traditional operator precedence: (e.g. "a+b*c" evaluates as "a + (b*c)" instead of "(a+b) * c")

You may specify quaternary constants by prefixing with '&' or postfixing with 'Q' or 'q' in the same fashion as binary, octal, and hexadecimal constants (prefixed by '%', '@', and '$'; or postfixed by 'B' or 'b', 'O' or 'o', and 'H' or 'h'; respectively).

Compilation

MacOS (Darwin)

Requires C++14. Tested on Apple clang version 12.0.0 (clang-1200.0.32.28). The simple makefile should work on most systems.

If you'd rather compile without make, navigate to the "src" directory and enter: c++ -std=c++14 -I. */*.cpp */*/*.cpp -o ../tasm6801

This should compile the program and put the executable in the parent directory.

Windows 10

Some attempt has been made to make the source compatible with Windows Visual Studio 2017. What works is to launch the Visual Studio "developer command prompt" by following the instructions here. If the link fails, try searching the internet for "Walkthrough: Compile a C program on the command line".

Once you have the developer command prompt open, navigate to the "src" directory of tasm6801, then run the vscompile.bat script by typing:

vscompile

You should see tasm.exe created in the src directory.

Usage

You should be comfortable using either a shell program (in linux) or a command prompt (in Windows) and know how to place an executable on your path. Once it is on your path, you may invoke it like any other command line utility.

Save your assembly program as a text file. You may use any extension (e.g., ".txt" or ".asm"). Once you have your assembly program, you may assemble it via:

tasm6801 [options] <yourprogram.asm>

Where [options] can be:

OptionDescription
‑helpdisplay help.
‑help <option>display help for a particular option.
‑compactsuppress line numbers in the output listing.
‑objoutput object file (.obj) (default) [-no-obj to disable]
‑c10output cassette file (.c10) (default) [-no-c10 to disable]
‑lstoutput list file (.lst) (default) [-no-lst to disable]
‑symoutput symbol table (.sym)
‑gbloutput global table (.gbl) with useage by other modules
‑Wbranchwarn when JMP or JSR can be replaced by BRA or BSR, respectively.
‑Wglobalwarn about global labels unused by any other module.
‑Wunusedwarn about unused labels in the source files.
‑‑treat subsequent arguments as file input (so you can compile a file that starts with "-", like "-filename.asm")

You can also compile multiple files via:

tasm6801 [options] file1.asm file2.asm ...

This will read the files (in order), compile, and output a listing file (file1.lst), an object file (file1.obj) and a MC-10 cassette (file1.c10) file. Most MC-10 emulators can load a .c10 file into memory. By default, the load address of the object binary is used as the execution start address for MICROCOLOR BASIC's EXEC command.

If you are a user of the Virtual MC-10 you can load the .obj into memory at your preferred address.