asmx 2.0 macro cross-assembler


asmx 2.0 macro cross-assembler

Last updated May 7 2014. Edited by Herb Johnson, (c) Herb Johnson, except for content written by others. Contact Herb at www.retrotechnology.com, an email address is on that page..

Introduction:

This Web page is about a 2012 adaptation of the asmx cross-assembler to support the COSMAC 1802 "Membership Card" created by Lee Hart. Other 1802 software is available from this linked Web page.

asmx

The asmx cross assembler is a multi-CPU macro assembler written by Bruce Tomlin and available from his xi6.com Web site. The version I downloaded, is "asmx-2.0b5.zip" Version 2.0 beta 5, downloaded early 2012. There's no specific terms of use or licence described on site. Bruce seems to support a lot of classic video-game project with hardware and software. There's other tools on his site which may be of interest.

The cross-assemble supports "macro" capability; that's a feature I wanted to make available for M/S card owners; in a cross-assembler with sources freely available. It supports many 8-bit microprocessors; my interest on this page is the RCA COSMAC 1802 and related support.

Features of the cross-assembler are in a documentation file; I've modified the document to note the changes I made. Most of my changes are initialed with "HRJ" or "Herb".

asmx as offered by me

Here's my MODIFIED version of asmx v2.0b5, a ZIP file with all sources and the compiled program. My changes are described below, a similar document is in the ZIP file. Reported errors are listed below. The compiled program runs in a 32-bit MS-DOS window under versions of Windows. To run on a "pure" MS-DOS system, you would have to recompile with an MS-DOS compiler. Try some early version of Borland's "Turbo C", for example.

the ZIP file is in the same scheme as was copied from Bruce's Web site, plus I added a directory "newsrc" for the changed C and H files I modified. Plus I added some notes, and I modified Bruce's asmx-doc.html file. To recompile with my changes, replace the older sources with my newer ones.

I run the assembler as follows:

C:>asmx20 C1802 -l -o -w -e [source].asm

This produces a [source].asm.lst listing, and a [source].asm.hex file in Intel hex format. Other object options are S-type Motorola, or binary. Error message go to the screen, and are in the listing file.

asmx changes

I made a few changes to the source, first to accomodate lcc-32's restrictions that procedures like "procedure()" must be defined as "procedure(void)"; and secondly to accomodate features of some 1802 assemblers. I've initialed my changes in the modified sources, except for all the "(void)"'s I had to add.

Features specific to 1802 users are:

INCL was not used, it's called INCLUDE

PAGE was not active code, but I restored function to assembler; adds FF char to start of PAGE line

HIGH was > or H() (but I fixed assembler to accept HIGH)
LOW was < or L() (but I fixed assembler to accept LOW)

A "feature" I can't change, is the fact that error messages in listings and copied to the console (command line) provide the error message, followed by the source line where the error occurred. I find this different from other software tools that reverse that order. But it's too difficult to change this.

A feature of some 1802 assemblers is to accept statements like:

DB ("B"+80H)
DB ("="+80H)

But in asmx, single char strings are not treated as byte value for byte operations. But single characters are accepted in these formats:

DB "GOT",80H ; four bytes long
DB ('='+80H) ; one byte long

So one has to fix their source, "x" changed to 'x' where x is any single char. I wrote a C program "quote.c" to find all "x" not in comments, and change to 'x'. The program in C source and lcc-32 compiled .exe is in the ZIP file. Review the result in case my program goofs.

Errors

There are test sources and resulting listings for each processor, included with the assembler from Bruce, for test purposes. Some of them have deliberate errors. I've documented the one difference I found between Bruce's listings and mine.

Again, my interests are in the 1802, so I assembled a number of 1802 software sources on this site. They look good but I've not checked every byte. You may have to modify some sources, see the notes above and with the assembler. I'd like to hear about any specific errors especially for the 1802, but you may have to go back to Bruce for errors with other processors. Check his site for any policies and for contact info. - Herb Johnson

April 2 2013: Paul Robson reports: "I used your asmx cross assembler Windows port and it has a bug. When writing out binary files it doesn’t (I think) do so in binary mode, as on my system it is writing out 0D 0A for 0A values." I fixed this in April 2014.

June 25 2013: Josh Bendason reports: "1. Hex numbers beginning with $ are not recogonized. (That's true, it's an option set in the Z80 C source to permit lables such as $HERE.) 2. z80 assembler: The ADD command must be in the form ADD A,r". Herb comments: A Zilog manual shows "ADD A,r" but not "ADD value".

Apr 2014: I've added an 8008 cross assembler. It used the older Intel 8008 mnemonics, three letters only. Later, Intel produced an 8008 assembly mnemnonic set like their 8080 set. I'll get to that another day. This is still a work in progress. There's many ancient 8008 assembly features not supported in this version.

May 2014: Bill Beech suggested ASMX does not well-support parenthesis ( ) in expressions. When () are part of the syntax of the assembler, use [] brackets instead of parens in expressions. Also ASMX didn't handle 'SHR', 'SHL', 'AND', 'OR', 'NOT', etc. in the expression analyzer. It does do '>>', '<<', '&' and '|' and '!'. Bill fixed that. Thanks.


Contact information:
Herb Johnson
New Jersey, USA
To email @ me, see
see my home Web page.

This page and edited content is copyright Herb Johnson (c) 2014. Copyright of other contents beyond brief quotes, is held by those authors. Contact Herb at www.retrotechnology.com, an email address is available on that page..