[comp.sys.hp] Sun as vs. HPUX as

jeffa@hpmwtla.HP.COM (Jeff Aguilera) (01/16/88)

I use HP-UX 5.5, so take this with a grain of salt.

Under 5.5, there is a utility called atrans that converts
from the regular Series/200 format (the one published by
Motorola) to HP-UX format.  If this doesn't exist, or
doesn't work, then...

HP swapped the order of operands in compares:

	cmpa.l	%a0,%a1  ==>	cmpa.l	%a1,%a0

HP requires that the various fields in the addressing mode
be given in a particular order; Motorola specifies that
order is unimportant.

A helpful manual might be HP-UX Assembler Reference Manual
and ADB Tutorial (P/N 98597-90020).  Chapter 7 (Address Mode
Syntax) and Chapter 8 (Instruction Sets) might be of help.

The required order for addressing modes, by the way is

([bd,An],Ri*{scale},od)
([bd,An,Ri*{scale}],od)

etc.

Note that the scale must come after the index!

Good luck!

mike@hpfclq.HP.COM (Mike McNelly) (01/19/88)

> HP swapped the order of operands in compares:

	> cmpa.l	%a0,%a1  ==>	cmpa.l	%a1,%a0

When Motorola first introduced the 68020/68881 chips, the new addressing
modes required a change in assembly syntax because there were
ambiguities introduced.  Hence Motorola came out with two proposed
syntaxes, one for "general" use and another for "*nix" use.  We chose to
use the "*nix" version for HP-UX in order to be as compatable as
possible with the rest of the 68020 world.  Not all manufacturers made
the same decision.

The suggested Motorola syntax specified the swap of cmp instruction
operands.


Mike McNelly

kah@hpfclq.HP.COM (Kathy Harris) (01/20/88)

/ hpfclq:comp.sys.hp / windley@iris (Phil Windley) /  3:35 pm  Jan 13, 1988 /
>I'm trying to port a program from a Sun to an HP9000/200 running HPUX
>5.1.  Everything is going ok except for a small assembly language

If you are going to be doing work with assembly code and envision doing
any upgrades to a later version of HP-UX you should upgrade first.
In release 5.15, HP released 68020/68881 compilers, and we also at that
time released a new assembler.  That assembler was designed to have
a UNIX(*)-like assembler syntax.  The translator tools and assembly manual
referenced in previous responses to your note are for the 5.15 and after
assembler.  The 5.1 system predates the 68020 and 68881.  There is no
support for the addressing modes of the 68020 or for the 68881.

The note about reversed "cmp" arguments applies to the 5.15 and later
assembler -- done to follow what Motorola did with their UNIX(*) version
of their assembler.

In the 5.1 system, you have an "as" with the old/obsoleted HP-UX assembly
syntax, and a translator atrans(1) from the HP Pascal Workstation format
to 5.1 HPUX format.

In the 5.15 system, there is "as" with the new UNIX(*)-like syntax,
atrans(1) to translate from HP Pascal Workstation format to 5.15 format
and astrns(1) to translate pre-5.15 HP-UX format to the new HPUX format.

The HPUX Assembler Manual was written for the 5.15 and later releases.

kathy harris
hewlett packard
hpfcla!kah


*UNIX is a TM of AT&T 

rml@hpfcdc.HP.COM (Bob Lenk) (01/22/88)

> >I'm trying to port a program from a Sun to an HP9000/200 running HPUX
> >5.1.  Everything is going ok except for a small assembly language
> 
> If you are going to be doing work with assembly code and envision doing
> any upgrades to a later version of HP-UX you should upgrade first.
> In release 5.15, HP released 68020/68881 compilers, and we also at that
> time released a new assembler.

5.15 and later releases of HP-UX are supported only on the series 300,
not the series 200.  Much of the 5.15 release, including the new
assembler and atrans(1), may actually work on a series 200 machine, but
I repeat that it is not supported.  Of course 68020/68881 code generated
by the new compilers and assembler will not run on the series 200 (with
a 68010 processor).  5.15 does include compilers and an assembler for
the 68010 that use the new syntax.

		Bob Lenk
		{ihnp4, hplabs}!hpfcla!rml