RISC/6000 assembler examples wanted

jim frost madd at world.std.com
Tue Nov 6 10:43:09 AEST 1990


bengsig at oracle.nl (Bjorn Engsig) writes:

>Article <3210 at ucsfcca.ucsf.edu> by dick at ccnext.UUCP (Dick Karpinski) says:
>|
>|I found the man page for as, but have yet to find the Principles
>|of Operation or anything else that allows me to RTFM.
>The CDROM version of the Info database has an assembler reference manual on it.

Beware that both the printed and online manuals are missing several
assembler instructions.  They were deliberately removed between the
original and final versions of the manual (I have both).  If your
program needs to synchronize the I and D caches, you will need the
"POWER Processor Architecture" document, which is somewhat difficult
to get hold of.

Also beware that the assembler examples are not clear as to how to set
up the various sections of your program.  The `hello' example is poor
at best and the proportional font it's printed in makes it very
difficult to read.

For programming techniques I suggest using dbx's /i command to
disassemble simple C programs.  This won't help you set up the
assembler sections but it provides wonderful insight as to how to call
functions, access globals, and code function prologues and epilogues.

If you care about the calling conventions, beware that both the info
and printed documentation are incorrect about shadowing floating point
arguments and how to call varargs functions.  Floating point arguments
should always be shadowed in GPR's (the documentation says otherwise)
and there is no special calling convention for varargs functions.  If
you are yourself a varargs function you can just write the GPR
arguments onto the stack and access them that way.  Write some sample
C programs and see how they do it, don't trust the documentation.

Happy hacking,

jim frost
saber software
jimf at saber.com



More information about the Comp.unix.aix mailing list