Difference between revisions of "Programming under Unix-like operating systems"

From WikiTI
Jump to: navigation, search
(revamp section a bit Syntax coloring)
(Add Pasmo, z80asm, and binutils Assembling)
Line 80: Line 80:
 
'''Author''': benryves
 
'''Author''': benryves
  
'''Home page''' [http://benryves.com/bin/brass/ http://benryves.com/bin/brass/]
+
'''Home page''': [http://benryves.com/bin/brass/ http://benryves.com/bin/brass/]
  
 
Brass runs under Linux thanks to Mono.
 
Brass runs under Linux thanks to Mono.
Line 87: Line 87:
 
'''Author''': Ville Helin
 
'''Author''': Ville Helin
  
'''Home page''' [http://users.tkk.fi/~vhelin/wla.html http://users.tkk.fi/~vhelin/wla.html]
+
'''Home page''': [http://users.tkk.fi/~vhelin/wla.html http://users.tkk.fi/~vhelin/wla.html]
  
 
WLA DX is another open-source (GNU GPL) cross-assembler with a primary focus on targeting video game consoles. It is a high-powered assembler with a wide variety of features such as, e.g. separate compilation, POSIX-like file I/O, and code sectioning. However it is cumbersome when assembling small projects, and semantics are unorthodox compared to other assemblers. (~ is the XOR operator, macro arguments are passed by value, etc.) Furthermore, development appears to have ceased since January 2006.
 
WLA DX is another open-source (GNU GPL) cross-assembler with a primary focus on targeting video game consoles. It is a high-powered assembler with a wide variety of features such as, e.g. separate compilation, POSIX-like file I/O, and code sectioning. However it is cumbersome when assembling small projects, and semantics are unorthodox compared to other assemblers. (~ is the XOR operator, macro arguments are passed by value, etc.) Furthermore, development appears to have ceased since January 2006.
  
 
WLA DX has had an influence in the development of Brass.
 
WLA DX has had an influence in the development of Brass.
 +
 +
=== Pasmo ===
 +
'''Author''': Julián Albo
 +
 +
'''Home page''': [http://www.arrakis.es/~ninsesabe/pasmo/ http://www.arrakis.es/~ninsesabe/pasmo/]
 +
 +
Pasmo is another standalone Z80 cross-assembler with basic macro support, but without the ability to generate
 +
relocatable object files.  It is licensed under the GNU GPL, and exists as the package <tt>pasmo</tt> in the Debian pool.
 +
 +
=== z80asm ===
 +
'''Author''': Bas Wijnen
 +
 +
'''Home page''': [http://savannah.nongnu.org/projects/z80asm/ http://savannah.nongnu.org/projects/z80asm/]
 +
 +
z80asm is a standalone Z80 cross-assembler similar in nature to Pasmo, in that it has macro support but cannot generate relocatable object files.  It too is licensed under the GNU GPL (version 2 or later), and exists as the package <tt>z80asm</tt> in the Debian pool.
 +
 +
=== GNU as ===
 +
'''Author''': the GNU binutils team
 +
 +
'''Home page''': [http://www.gnu.org/software/binutils/ http://www.gnu.org/software/binutils/]
 +
 +
Starting from version 2.17, the GNU assembler, part of the binutils package, is capable of cross-assembling Z80 code when configured for it at compile-time, such as with <tt>--target=z80-unknown-coff</tt>.  binutils includes a powerful assembler and linker both, along with various utilities for handling object files, such as objcopy and objdump.  While this is probably one of the more powerful tools in the list for Z80 development, it also requires more work to start with, as the traditional way to get a cross-assembling binutils is to compile it oneself.  Being a GNU package, binutils is naturally licensed under the GNU GPL (version 2 or later).  Prepackaged binary versions of binutils are very common, but usually do not have cross-assembling capability.
  
 
==Sending programs to the calc==
 
==Sending programs to the calc==
 
* TILP
 
* TILP
 
* titranz : commandline tool, only works for TI-83/TI-83+
 
* titranz : commandline tool, only works for TI-83/TI-83+

Revision as of 22:03, 5 August 2006

Here are the different tools at your disposal:

Emulators

  • TilEm [1]
  • VTI (with Wine)

Syntax highlighting

Several editors have native or extensional support for editing Z80 assembly code with syntax highlighting:

  • Kwrite and Kate can be made to syntax-highlight Z80 assembly with the appropriate definition file. The file can be placed in /usr/share/apps/katepart/syntax to install it.
  • SciTE and Emacs both have native modes for assembly code. For Emacs, one must make sure to turn on Font Lock mode as well.
  • The Z80 Assembly IDE has simple syntax highlighting built-in.
  • Users of Vim and WLA DX can use this syntax file.

Assembling

SPASM

Author: Spencer Putt

Home Page: http://www.revsoft.org/phpBB2/viewforum.php?f=21

SPASM is a portable Z80 assembler released under the GPL. Its distinguishing features are extremely fast assembly and powerful macro support. The output is only available in binary form, however with the use of Wabbitsign, written by James Montelongo and Spencer Putt, it can easily be converted to any desired program type.

assembler foo.asm foo.bin
wabbit foo.bin foo.8xp

tpasm

Author: Todd Squires

Home page: http://www.sqrt.com/

tpasm is a Free (GPL) assembler which supports the Z80 as well as the 6805, 6809, 68HC11, 6502, Sunplus, 8051, PIC, and AVR. It uses syntax very similar to ZMASM.

tpasm 1.2 does not support binary file output, but you can use objcopy (from the GNU binutils package) to convert its Intel Hex output into binary; e.g.

tpasm foo.asm -o intel foo.hex -l foo.lst
objcopy -I ihex foo.hex -O binary foo.bin

ASxxxx

Author: Alan R. Baldwin

Home page: http://shop-pdp.kent.edu/ashtml/asxxxx.htm

ASxxxx is a freeware assembler which supports the Z80 along with a large variety of other processors. It more closely resembles a modern PC assembler than a typical Z80 assembler, as it assembles each file into a relocatable object format which can then be linked with other files to produce the complete program. The linking is done by a separate program called ASlink (included with the package.)

To assemble and link a simple program you might do something like

asz80 -plogff foo.asm
aslink -u -b _CODE=0x9D95 -i foo.ihx foo.rel
objcopy -I ihex foo.ihx -O binary foo.bin

Note that the syntax is rather different from that of most Z80 assemblers. The important differences are

  • Immediate values are marked with #.
  • Indexed memory access is written as N(ix) rather than (ix+N).
  • Constants are written differently: 0xAA, 0hAA, or $$AA for hexadecimal; 0o252, 0q252, or $&252 for octal; 0b10101010 or $%10101010 for binary.

For example,

ld hl,#str_hello
add a,3(ix)
xor #0x0f

There is also a modified version of ASxxxx distributed with the Small Device C Compiler. This version is, if anything, more confusing to use due to the poorly-documented changes made by the SDCC team.

TASM

Author: Thomas N. Anderson

Home page: http://home.comcast.net/~tasm/

TASM is a shareware assembler which also supports a variety of processors.

There are several ways that you can use tasm under Linux:

  • The TASM 3.1 for Linux shareware release is still in the wild. To use this you will need to enable "a.out" support in your kernel (it may be available as the module binfmt_aout.) You will also need to obtain the ancient Linux libc version 4 (not glibc) which can be found here.
  • You can use TASM 3.2 for Windows with Wine.
  • You can pay the $40 and compile it yourself on the platform of your choice.

Brass

Author: benryves

Home page: http://benryves.com/bin/brass/

Brass runs under Linux thanks to Mono.

WLA DX

Author: Ville Helin

Home page: http://users.tkk.fi/~vhelin/wla.html

WLA DX is another open-source (GNU GPL) cross-assembler with a primary focus on targeting video game consoles. It is a high-powered assembler with a wide variety of features such as, e.g. separate compilation, POSIX-like file I/O, and code sectioning. However it is cumbersome when assembling small projects, and semantics are unorthodox compared to other assemblers. (~ is the XOR operator, macro arguments are passed by value, etc.) Furthermore, development appears to have ceased since January 2006.

WLA DX has had an influence in the development of Brass.

Pasmo

Author: Julián Albo

Home page: http://www.arrakis.es/~ninsesabe/pasmo/

Pasmo is another standalone Z80 cross-assembler with basic macro support, but without the ability to generate relocatable object files. It is licensed under the GNU GPL, and exists as the package pasmo in the Debian pool.

z80asm

Author: Bas Wijnen

Home page: http://savannah.nongnu.org/projects/z80asm/

z80asm is a standalone Z80 cross-assembler similar in nature to Pasmo, in that it has macro support but cannot generate relocatable object files. It too is licensed under the GNU GPL (version 2 or later), and exists as the package z80asm in the Debian pool.

GNU as

Author: the GNU binutils team

Home page: http://www.gnu.org/software/binutils/

Starting from version 2.17, the GNU assembler, part of the binutils package, is capable of cross-assembling Z80 code when configured for it at compile-time, such as with --target=z80-unknown-coff. binutils includes a powerful assembler and linker both, along with various utilities for handling object files, such as objcopy and objdump. While this is probably one of the more powerful tools in the list for Z80 development, it also requires more work to start with, as the traditional way to get a cross-assembling binutils is to compile it oneself. Being a GNU package, binutils is naturally licensed under the GNU GPL (version 2 or later). Prepackaged binary versions of binutils are very common, but usually do not have cross-assembling capability.

Sending programs to the calc

  • TILP
  • titranz : commandline tool, only works for TI-83/TI-83+