Home Download Links
 

TML2 cross compiler tools for Z80 target


The compiler tools are written in portable ANSI C and compiles on PC-DOS/Windows and UNIX systems and has been tested on Windows 95/NT, Linux and Sun Solaris / SPARC. 

The package contains a compiler (tml2), a linker (link), an object file dump utility (tmldump) and an absolute loader (ld) which is needed to create ROM-able code etc.

TML2 is a high level language that I have created for embedded systems programming. It is mainly based on Borland's Turbo PASCAL including separately compiled "units" with interface and implementation sections. TML2 is a small language but still supports strong type checking, 8/16/32 bit integers, booleans, arbitrary record types, arrays, pointers, functions, strings, if/then/else, while loops, repeat until loops, expressions etc. All arithmetic is done with unsigned integers to better support system programming. Unchecked type conversions can be used to do nasty things. Inline code can be used in functions etc. 

Read the complete language and compiler specification in PDF format: tml2_compiler_pa3.pdf (Draft 3) 

The compiler needs a runtime support library for 32-bit arithmetic, code overlay etc. Download the support package support.zip here, full source code included. Note: the supplied version of ovl_sup.tml requires OS-X 2.0 for automatic code overlays. 

Read the TML2 compiler tools release notes here: relnotes.txt  

The compiler tools should be started from the command shell. All programs follow the UNIX command line conventions where all options must appear before the first file argument. If the programs are executed without arguments a short help text is displayed. 

To compile, link and locate the program "a.tml" for EPROM execute these commands: 

tml2 a.tml
link a.o
ld a 0
The compiler takes a .tml source file, reads all .o (object) files referenced and creates a new .o (object) file with the same base name as the source file. 

The linker takes the main .o (object) file, links it by loading all referenced .o files and generates a relocatable executable file without extension. 

The loader takes a relocatable executable file, locates it to an absolute base address and creates a .com raw binary file (target memory image). All addresses are resolved to absolute values. This is needed to create EPROMs. 


Download the TML2 tools now! View some demo files here:  emu1.tml  hw80a.tml  memory.tml  strings.tml  system.tml  support.o  makeall.bat. Download all example files, compile and test run them in the Z80 emulator (zemu).



For more information, questions, feedback etc please contact me at: francis.gormarker@swipnet.se 

Last updated: January 4 2004