Subject: Requirements for PAL-compatible cross-assemblers

From: [email-masked] (Charles Lasner)
Date: 16 Dec 1993 21:22:39 GMT

I will be putting together a PAL "torture test" file that will include some 
"sticky" examples of the kind of code a truly compatible assembler needs to
support PAL code properly.  In passing, it should be noted that currently
there are *no* assemblers that will totally pass this torture test fully.  The
reason is simply that all known viable candidates have some implementation
restrictions.  Some of the restrictions are cosmetic, while others actually
force programming technique limitations on the programmer.

Some of the problems revolve around known bugs.  For example, PAL8 has always
had a problematic bug associated with the syntax of literals.  The following
code functions as documented in PAL8:

	TAD	(3)-1	/GET WHAT'S IN ADDRESS BEFORE LITERAL

The PAL8 documentation says this should generate 1376 and a literal 0003 in
0377.  TOPS-10 PAL10 and P?S/8 PAL both do this.  However, all known versions
of PAL8 instead generate 1377 and 0004 in 0377, i.e., the ")" character is
ignored! This leads to the requirement that literal expressions be simplified,
etc.

The number of passes taken by an assembler can influence the result in some
cases.  Programmers are warned of using forward references to literal
expressions.  The values of the expressions can change as a function of the
pass number.  Since PAL8 does a first pass, then does an optional binary
second pass, then an optional listing third pass, a third pass listing may
not match the binary output!  The proof would be to do two assemblies.  If
one assembly deletes the binary pass, then the listings won't match in this
case.  Therefore, for compatibility, it's necessary that any cross-assemblers
be written in exactly two passes to avoid this, etc.  (Note:  PAL8 was done
this way due to the generic OS/8 limitation that only one file at a time can
be open on a specific device.  To avoid the need to specify multiple devices,
the third-pass method is a simple copout, not to mention requiring about
50% longer assembly time!)

Hopefully, this compilation will guide cross-develops towards a "better"
PAL assembler.

cjl