Path: utzoo!attcan!uunet!world!madd From: madd@world.std.com (jim frost) Newsgroups: comp.unix.aix Subject: Re: RISC/6000 assembler examples wanted Message-ID: <1990Nov5.234309.23556@world.std.com> Date: 5 Nov 90 23:43:09 GMT References: <3210@ucsfcca.ucsf.edu> <1053@nlsun1.oracle.nl> Organization: Saber Software Lines: 39 bengsig@oracle.nl (Bjorn Engsig) writes: >Article <3210@ucsfcca.ucsf.edu> by dick@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@saber.com