home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Programming / vbcc_MorphOS / doc / pasm.doc next >
Text File  |  2000-08-20  |  45KB  |  2,195 lines

  1. pasm V1.3          VBCC ANSI C Compiler Reference Manual            pasm V1.3
  2.  
  3. NAME
  4.      pasm - PowerPC assembler
  5.  
  6. SYNOPSIS
  7.      pasm [-mwxRVX] [-B address] [-D symbol[=value]] [-F format]
  8.           [-I include-path] [-O opt-level] [-o filename] source-file
  9.  
  10. DESCRIPTION
  11.      pasm is a 32/64-bit PowerPC assembler and its usual task is to
  12.      assemble the output of the vbcc C compiler. It supports macros
  13.      and include files, so it could also be used for direct PowerPC
  14.      program development.
  15.  
  16.      pasm uses the same syntax as Motorola's PAS assembler or the
  17.      PPC-port of the GNU assembler.
  18.  
  19.      All PowerPC standard instructions are supported: User level-,
  20.      supervisor level-, optional-, 32-bit and 64-bit instructions.
  21.      Additionally, there is a huge set of extended mnemonics as proposed
  22.      in the "PowerPC Programming Environments" from IBM and Motorola.
  23.  
  24.      The options are as follows:
  25.  
  26.      -B address
  27.              Sets the base address for absolute output format.
  28.  
  29.      -D symbol[=value]
  30.              Defines a symbol. Its value defaults to '1'.
  31.  
  32.      -F format
  33.              Sets the output file format:
  34.              0: Absolute, raw format. Base address defaults to
  35.                 zero, but may be changed by "-B addr".
  36.              1: ELF-32bit-PowerPC object.
  37.              2: EHF object. Only used under AmigaOS with WarpOS
  38.                 extension from Haage&Partner.
  39.              3: ADOS object. The difference between ADOS and and EHF
  40.                 is, that ADOS uses HUNK_CODE instead HUNK_PPC_CODE
  41.                 and doesn't support any PPC-specific relocations and
  42.                 reference types. This makes it possible to link
  43.                 simple PowerPC programs with an old linker, like
  44.                 BLink, SLink or PhxLnk.
  45.  
  46.      -I include-path
  47.              Adds another include file path. Example:
  48.              -IWork:PPCIncludes  or  -I /usr/local/include
  49.  
  50.      -m64    Enable 64-bit instructions.
  51.  
  52.      -ms     Enable supervisor instructions.
  53.  
  54.      -mo     Enable optional instructions.
  55.  
  56.      -O opt-level
  57.              Sets optimization level. The level contains 32 flags to
  58.              enable different optimizations and features. Currently,
  59.              the following are used:
  60.              65536: Automatic correction of far branches. A
  61.                     "Bcc label" with label out of range (more
  62.                     than 32764 bytes away) will be converted
  63.                     into a "B!cc $+8 / B label" combination.
  64.  
  65.      -o filename
  66.              Specifies the name of the output file. If not given, pasm
  67.              will use the name of the source text and replaces the
  68.              extension by ".o".
  69.  
  70.      -R      Don't predefine register symbols r0-r31, f0-f31, cr0-c7,
  71.              xer, eq, etc.
  72.  
  73.      -V      Prints version identification and build string. Example:
  74.              pasm V0.69 (Amiga OS/M68k)  (c)1997-98 by Frank Wille
  75.              build date: Jan  2 1998, 11:51:47
  76.  
  77.      -w      Suppress all warning messages.
  78.  
  79.      -x      Undefined symbols are automatically defined as external
  80.              symbols.
  81.  
  82.      -X      No extended mnemonics. This means you will have to write
  83.              "bc 12,2,label" instead "beq label". All predefined extened
  84.              mnemonics are listed in the section EXTENDED MNEMONICS.
  85.  
  86.  
  87. GENERAL FORMAT
  88.      Source texts in the following format will be accepted by pasm:
  89.  
  90.      [<label>] [<opcode> [<operand>[,<operand>,...]]]
  91.  
  92.      The opcode field may start at the first column, because pasm requires
  93.      all labels to be terminated by a ':'. Opcodes are directives, macros
  94.      and PowerPC instructions.
  95.  
  96.      These statements are separated by a line feed (0xa) or a ';' character.
  97.      Theoretically, you can write your whole program in a single line.
  98.      Example:
  99.  
  100.      .text;.global start;start: li r3,0;blr
  101.  
  102.      Comments are introduced by a '#':
  103.  
  104.      # This is a comment
  105.              nop     # another comment
  106.  
  107.  
  108. SNYTAX
  109.  
  110.      Supported operators in expressions:
  111.  
  112.           Unary (highest priority):
  113.           +             positive
  114.           -             negate
  115.           ~             not
  116.  
  117.           Binary (priority):
  118.           +             addition (4)
  119.           -             subtraction (4)
  120.           *             multiplication (5)
  121.           /             division (5)
  122.           %             modulo (5)
  123.           <<            shift left (3)
  124.           >>            shift right (3)
  125.           &             and (2)
  126.           |             or (0)
  127.           ^             exclusive or (1)
  128.  
  129.      Supported constants:
  130.  
  131.           1234          decimal
  132.           01234         octal
  133.           0x1234        hexadecimal
  134.           0b1010        binary
  135.           "abcd"        string
  136.  
  137.      ELF relocation suffix:
  138.  
  139.           Syntax: <expression>@<reloc type>
  140.  
  141.           @l            low half word (R_PPC_ADDR16_LO)
  142.           @h            high half word (R_PPC_ADDR16_HI)
  143.           @ha           high half word for addition (R_PPC_ADDR16_HA)
  144.           @sdax         base relative section offset (R_PPC_SDAREL16)
  145.           @sdarx        base relative section offset (R_PPC_SDAREL16)
  146.  
  147.  
  148.  
  149. DIRECTIVES
  150.       .ascii <exp1>[,<exp2>,"<string1>"...]
  151.       ----------------------------------
  152.       See ".byte".
  153.  
  154.       .asciiz "<string1>"[,"<string2>"...]
  155.       ------------------------------------
  156.       See ".string".
  157.  
  158.       .align <bit_count>
  159.       ------------------
  160.       Insert as much zero bytes as required to reach an address where
  161.       <bit_count> low order bits are zero. For example ".align 2" would
  162.       make an alignment to the next 32-bit boundary.
  163.  
  164.       .baserel <section>,<base_reg>
  165.       -----------------------------
  166.       Allow base relative access via register <base_reg> in the section
  167.       called <section>. In absolute mode, <base_reg> must be initialized
  168.       with an address pointing 32764 bytes behind the start address of
  169.       this section. In EHF, <base_reg> must be initialized with the linker
  170.       symbol _LinkerDB. By default, base relative access via r2 (rtoc)
  171.       on the section ".tocd" is set.
  172.       ** This directive is obsolete, since pasm V1.1! **
  173.       pasm can access multiple small data sections using the .sdreg
  174.       directive now. .baserel may be useful, when creating an
  175.       absolute output file, though.
  176.  
  177.       .bss <symbol>,<size>[,<alignment>]
  178.       ----------------------------------
  179.       Allocate <size> bytes of space in the .bss section and assign
  180.       the value to that location to <symbol>. If <alignment> is given,
  181.       then the space will be aligned to an address having <alignment>
  182.       low zero bits or 2, whichever is greater.
  183.       <symbol> may be made globally visible by the .globl directive.
  184.  
  185.       .byte <exp1>[,<exp2>,"<string1>"...]
  186.       ------------------------------------
  187.       Assign the integer or string constant operands into successive
  188.       bytes of memory in the current section. Any combination of integer
  189.       and character string constant operands is permitted.
  190.  
  191.       .comm <symbol>,<size>
  192.       ---------------------
  193.       Allocate <size> bytes of space in the .bss section and assign
  194.       the value to that location to <symbol>. <symbol> is always made
  195.       globally visible. ".comm"-areas of less than 8 bytes in size are
  196.       aligned to word boundaries, otherwise to doubleword boundaries.
  197.  
  198.       .double <float1>[,<float2>...]
  199.       ------------------------------
  200.       If the current section location counter is not on a doubleword
  201.       boundary advance it to the next doubleword boundary. Then assign
  202.       the values of the operands as IEEE 754 double-precision 64-bit
  203.       format numbers to successive doublewords of memory in the current
  204.       section.
  205.  
  206.       .else
  207.       -----
  208.       Begins the "else"-part in a block of conditional assembly.
  209.  
  210.       .endif
  211.       ------
  212.       Ends a block of conditional assembly.
  213.  
  214.       .endm
  215.       -----
  216.       Ends a macro definition.
  217.  
  218.       .extern <symbol>
  219.       ----------------
  220.       See ".globl".
  221.  
  222.       .fail
  223.       -----
  224.       Abort assembly with displaying the error message "fail directive
  225.       encountered".
  226.  
  227.       .file "<file name>"
  228.       -------------------
  229.       Specify the source file name, which is included into the ELF object
  230.       file as a symbol of type "FILE" with local binding. In EHF objects,
  231.       it is used as unit name.
  232.  
  233.       .float <float1>[,<float2>...]
  234.       -----------------------------
  235.       If the current section location counter is not on a word boundary
  236.       advance it to the next word boundary. Then assign the values of the
  237.       operands as IEEE 754 single precision 32-bit format numbers to
  238.       successive words of memory in the current section.
  239.  
  240.       .global <symbol>
  241.       ----------------
  242.       See ".globl".
  243.  
  244.       .globl <symbol>
  245.       ---------------
  246.       Flag <symbol> as an external symbol, which means that <symbol> is
  247.       visible to all modules in the linking process. It may be either
  248.       defined or undefined.
  249.  
  250.       .half <exp1>[,<exp2>...]
  251.       ------------------------
  252.       If the current section location counter is not on a halfword
  253.       boundary, advance it to the next halfword boundary. Then, assign
  254.       the values of the operands into successive halfwords of memory in
  255.       the current section.
  256.  
  257.       .ident "<string>"
  258.       -----------------
  259.       Place an indentification string into the .comment section (ELF).
  260.  
  261.       .if<cond> <exp>
  262.       ---------------
  263.       The following block will only be assembled, if the condition <cond>
  264.       is valid for the expression <exp>. Available conditions are:
  265.       .if     assemble, if <exp> is not zero.
  266.       .ifeq   assemble, if <exp> is zero.
  267.       .ifne   assemble, if <exp> is not zero.
  268.       .ifgt   assemble, if <exp> is greater than zero.
  269.       .ifge   assemble, if <exp> is greater than zero or equal (positive).
  270.       .iflt   assemble, if <exp> is less than zero (negative).
  271.       .ifle   assemble, if <exp> is less than zero or equal.
  272.       .ifdef  assemble, if <exp> is defined.
  273.       .ifndef assemble, if <exp> is undefined.
  274.       A block of conditional assembly is ended by ".endif". A maximum of
  275.       eight if-levels is allowed.
  276.  
  277.       .incbin <file name>
  278.       -------------------
  279.       Inserts the contents of a binary file into the current section.
  280.  
  281.       .include <file name>
  282.       --------------------
  283.       Includes another source text. Besides the current directory, all
  284.       include paths defined by the -I option are searched.
  285.  
  286.       .lcomm <symbol>,<size>[,<alignment>]
  287.       ------------------------------------
  288.       See ".bss".
  289.  
  290.       .local <symbol>
  291.       ---------------
  292.       Explicitely declare symbol to have local binding. It is not
  293.       visible outside the object file containing its definition.
  294.       <symbol> must be known (ELF only).
  295.  
  296.       .long <exp1>[,<exp2>...]
  297.       ------------------------
  298.       See ".word".
  299.  
  300.       .macro <name>
  301.       -------------
  302.       Define a new macro, called <name>. Macro parameters can be acces-
  303.       sed by \1 to \9. \0 is reserved for the branch hint. Example:
  304.       .macro  bdz
  305.               bc\0   18,0,\1
  306.       .endm
  307.       \@ will be replaced by a unique number on every macro invocation
  308.       and should be used when defining labels in a macro.
  309.  
  310.       .newsection <name>[,"<attributes>"]
  311.       -----------------------------------
  312.       This directives differs from the normal .section directive in the
  313.       case if a section called <name> already exists. .newsection will
  314.       then force the start of a new section with the same name and
  315.       effectively ends any further definition for the earlier section.
  316.       For the rest, see ".section".
  317.  
  318.       .sdreg <base_reg>
  319.       -----------------------------
  320.       Set a base register (r2-r31) for small data access. This enables
  321.       auto detection of base relative data access. The normal method
  322.       to create a R_PPC_SDAREL16 relocation would be:
  323.         lwz    r3,variable@sdarx(r13)   # r13: small data base reg.
  324.  
  325.       .section <name>[,"<attributes>"]
  326.       --------------------------------
  327.       Starts a new section named <name> or reactivate an old one. If
  328.       attributes are given for an already existing section, they must
  329.       match exactly. The section's name will also be defined as a new
  330.       symbol, which represents the section's start address.
  331.       The "<attributes>" string may consist of the following characters:
  332.       Section Contents:
  333.             c - section has code
  334.             d - section has initialized data
  335.             u - section has uninitialized data
  336.             i - section has directives (info section)
  337.             n - section can be discarded
  338.             R - remove section at link time
  339.       Section Protection:
  340.             r - section is readable
  341.             w - section is writable
  342.             x - section is executable
  343.             s - section is sharable
  344.       Section Alignment (only one):
  345.             0 - align to byte boundary
  346.             1 - align to halfword boundary
  347.             2 - align to word boundary
  348.             3 - align to doubleword boundary
  349.             4 - align to quadword boundary
  350.             5 - align to 32 byte boundary
  351.             6 - align to 64 byte boundary
  352.       Memory flags (EHF and ADOS only):
  353.             C - load section to Chip RAM
  354.             F - load section to Fast RAM
  355.  
  356.       .set <symbol>,<expression>
  357.       --------------------------
  358.       Create a new program symbol with the name <symbol> and assign to it
  359.       the value of <expression>. If <symbol> is already assigned, it will
  360.       contain a new value from now on. If <expression> is undefined in
  361.       pass 1 (because symbols in it are defined some lines later) it will
  362.       get a default value of '1', which is changed in pass 2 to the
  363.       correct value. So it is visible for .ifdef, etc.
  364.  
  365.       .size <symbol>,<size>
  366.       ---------------------
  367.       Set the size in bytes of an object defined at <symbol>.
  368.  
  369.       .short <exp1>[,<exp2>...]
  370.       -------------------------
  371.       See ".half".
  372.  
  373.       .space <exp>
  374.       ------------
  375.       Insert <exp> zero bytes into the current section.
  376.  
  377.       .string "<string1>"[,"<string2>"...]
  378.       ------------------------------------
  379.       Assign the characters in each string along with a final zero byte
  380.       to successive memory locations in the current section.
  381.  
  382.       .type <symbol>,<type>
  383.       ---------------------
  384.       Set type of symbol called <symbol> to <type>, which must be one of:
  385.       1: Object
  386.       2: Function
  387.       3: Section
  388.       4: File
  389.       The predefined symbols @object and @function are available for
  390.       this purpose.
  391.  
  392.       .uadouble <float1>[,<float2>...]
  393.       --------------------------------
  394.       Assign the values of the operands as IEEE 754 double-precision 64-
  395.       bit format numbers to successive eight-byte areas of memory in the
  396.       current section regardless of section alignment.
  397.  
  398.       .uafloat <float1>[,<float2>...]
  399.       -------------------------------
  400.       Assign the values of the operands as IEEE 754 single precision 32-
  401.       bit format numbers to successive 4-byte areas of memory in the
  402.       current section regardless of section alignment.
  403.  
  404.       .uahalf <exp1>[,<exp2>...]
  405.       --------------------------
  406.       Assign the values of the operands into successive two byte areas of
  407.       memory in the current section regardless of section alignment.
  408.  
  409.       .ualong <exp1>[,<exp2>...]
  410.       --------------------------
  411.       See ".uaword".
  412.  
  413.       .uashort <exp1>[,<exp2>...]
  414.       ---------------------------
  415.       See ".uahalf".
  416.  
  417.       .uaword <exp1>[,<exp2>...]
  418.       --------------------------
  419.       Assign the values of the operands into successive four-byte areas
  420.       of memory in the current section regardless of section alignment.
  421.  
  422.       .word <exp1>[,<exp2>...]
  423.       ------------------------
  424.       If the current section location counter is not on a word boundary
  425.       advance it to the next word boundary. Then assign the values of the
  426.       operands into successive words of memory in the current section.
  427.  
  428.  
  429. PREDEFINED SYMBOLS
  430.       There are two symbols, which are always updated by the assembler.
  431.       $       Current address counter value.
  432.       $NARG   Number of macro arguments during macro execution.
  433.               It is zero, when outside of a macro.
  434.  
  435.       The following symbols are constant and may be deactivated by
  436.       specifying the -R option.
  437.               .set r0,0
  438.               .set r1,1
  439.               .set r2,2
  440.               .set r3,3
  441.               .set r4,4
  442.               .set r5,5
  443.               .set r6,6
  444.               .set r7,7
  445.               .set r8,8
  446.               .set r9,9
  447.               .set r10,10
  448.               .set r11,11
  449.               .set r12,12
  450.               .set r13,13
  451.               .set r14,14
  452.               .set r15,15
  453.               .set r16,16
  454.               .set r17,17
  455.               .set r18,18
  456.               .set r19,19
  457.               .set r20,20
  458.               .set r21,21
  459.               .set r22,22
  460.               .set r23,23
  461.               .set r24,24
  462.               .set r25,25
  463.               .set r26,26
  464.               .set r27,27
  465.               .set r28,28
  466.               .set r29,29
  467.               .set r30,30
  468.               .set r31,31
  469.               .set f0,0
  470.               .set f1,1
  471.               .set f2,2
  472.               .set f3,3
  473.               .set f4,4
  474.               .set f5,5
  475.               .set f6,6
  476.               .set f7,7
  477.               .set f8,8
  478.               .set f9,9
  479.               .set f10,10
  480.               .set f11,11
  481.               .set f12,12
  482.               .set f13,13
  483.               .set f14,14
  484.               .set f15,15
  485.               .set f16,16
  486.               .set f17,17
  487.               .set f18,18
  488.               .set f19,19
  489.               .set f20,20
  490.               .set f21,21
  491.               .set f22,22
  492.               .set f23,23
  493.               .set f24,24
  494.               .set f25,25
  495.               .set f26,26
  496.               .set f27,27
  497.               .set f28,28
  498.               .set f29,29
  499.               .set f30,30
  500.               .set f31,31
  501.               .set cr0,0
  502.               .set cr1,1
  503.               .set cr2,2
  504.               .set cr3,3
  505.               .set cr4,4
  506.               .set cr5,5
  507.               .set cr6,6
  508.               .set cr7,7
  509.               .set lt,0
  510.               .set gt,1
  511.               .set eq,2
  512.               .set so,3
  513.               .set un,3
  514.               .set sp,1
  515.               .set rtoc,2
  516.               .set fp,31
  517.               .set fpscr,0
  518.               .set xer,1
  519.               .set lr,8
  520.               .set ctr,9
  521.  
  522.  
  523. PREDEFINED SECTIONS
  524.         .section .text,"crx4"
  525.         .section .data,"drw4"
  526.         .section .rodata,"dr4"
  527.         .section .sdata,"drw4"
  528.         .section .sdata2,"dr4"
  529.         .section .bss,"urw4"
  530.         .section .sbss,"urw4"
  531.         .section .init,"crx4"
  532.         .section .fini,"crx4"
  533.         .section .tocd,"drw4"
  534.  
  535.  
  536. EXTENDED MNEMONICS
  537.       There is a huge set of extended mnemonics, proposed by Motorola
  538.       and IBM in the "PowerPC Programming Environments", to make the
  539.       programmer's life easier. Except for some 64-bit mnemonics (I only
  540.       downloaded the 32-bit manuals for now), pasm supports them all.
  541.  
  542.       Currently all extended mnemonics (except "la") are implemented
  543.       as macros and can be deactivated with the -X option.
  544.  
  545.       List of extended mnemonics
  546.       --------------------------
  547.       .macro subi
  548.        addi \1,\2,-(\3)
  549.       .endm
  550.       
  551.       .macro subis
  552.        addis \1,\2,-(\3)
  553.       .endm
  554.       
  555.       .macro subic
  556.        addic \1,\2,-(\3)
  557.       .endm
  558.       
  559.       .macro subic.
  560.        addic. \1,\2,-(\3)
  561.       .endm
  562.       
  563.       .macro sub
  564.        subf \1,\3,\2
  565.       .endm
  566.       
  567.       .macro sub.
  568.        subf. \1,\3,\2
  569.       .endm
  570.       
  571.       .macro subo
  572.        subfo \1,\3,\2
  573.       .endm
  574.       
  575.       .macro subo.
  576.        subfo. \1,\3,\2
  577.       .endm
  578.       
  579.       .macro subc
  580.        subfc \1,\3,\2
  581.       .endm
  582.       
  583.       .macro subc.
  584.        subfc. \1,\3,\2
  585.       .endm
  586.       
  587.       .macro subco
  588.        subfco \1,\3,\2
  589.       .endm
  590.       
  591.       .macro subco.
  592.        subfco. \1,\3,\2
  593.       .endm
  594.       
  595.       .macro cmpwi
  596.       .ifeq $NARG-2
  597.        cmpi 0,0,\1,\2
  598.       .else
  599.        cmpi \1,0,\2,\3
  600.       .endif
  601.       .endm
  602.       
  603.       .macro cmpw
  604.       .ifeq $NARG-2
  605.        cmp 0,0,\1,\2
  606.       .else
  607.        cmp \1,0,\2,\3
  608.       .endif
  609.       .endm
  610.       
  611.       .macro cmplwi
  612.       .ifeq $NARG-2
  613.        cmpli 0,0,\1,\2
  614.       .else
  615.        cmpli \1,0,\2,\3
  616.       .endif
  617.       .endm
  618.       
  619.       .macro cmplw
  620.       .ifeq $NARG-2
  621.        cmpl 0,0,\1,\2
  622.       .else
  623.        cmpl \1,0,\2,\3
  624.       .endif
  625.       .endm
  626.       
  627.       .macro cmpdi
  628.       .ifeq $NARG-2
  629.        cmpi 0,1,\1,\2
  630.       .else
  631.        cmpi \1,1,\2,\3
  632.       .endif
  633.       .endm
  634.       
  635.       .macro cmpd
  636.       .ifeq $NARG-2
  637.        cmp 0,1,\1,\2
  638.       .else
  639.        cmp \1,1,\2,\3
  640.       .endif
  641.       .endm
  642.       
  643.       .macro cmpldi
  644.       .ifeq $NARG-2
  645.        cmpli 0,1,\1,\2
  646.       .else
  647.        cmpli \1,1,\2,\3
  648.       .endif
  649.       .endm
  650.       
  651.       .macro cmpld
  652.       .ifeq $NARG-2
  653.        cmpl 0,1,\1,\2
  654.       .else
  655.        cmpl \1,1,\2,\3
  656.       .endif
  657.       .endm
  658.       
  659.       
  660.       .macro extlwi
  661.        rlwinm \1,\2,\4,0,(\3)-1
  662.       .endm
  663.       
  664.       .macro extlwi.
  665.        rlwinm. \1,\2,\4,0,(\3)-1
  666.       .endm
  667.       
  668.       .macro extrwi
  669.        rlwinm \1,\2,(\4)+(\3),32-(\3),31
  670.       .endm
  671.       
  672.       .macro extrwi.
  673.        rlwinm. \1,\2,(\4)+(\3),32-(\3),31
  674.       .endm
  675.       
  676.       .macro inslwi
  677.        rlwimi \1,\2,32-(\4),\4,((\4)+(\3))-1
  678.       .endm
  679.       
  680.       .macro inslwi.
  681.        rlwimi. \1,\2,32-(\4),\4,((\4)+(\3))-1
  682.       .endm
  683.       
  684.       .macro insrwi
  685.        rlwimi \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  686.       .endm
  687.       
  688.       .macro insrwi.
  689.        rlwimi. \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  690.       .endm
  691.       
  692.       .macro rotlwi
  693.        rlwinm \1,\2,\3,0,31
  694.       .endm
  695.       
  696.       .macro rotlwi.
  697.        rlwinm. \1,\2,\3,0,31
  698.       .endm
  699.       
  700.       .macro rotrwi
  701.        rlwinm \1,\2,32-(\3),0,31
  702.       .endm
  703.       
  704.       .macro rotrwi.
  705.        rlwinm. \1,\2,32-(\3),0,31
  706.       .endm
  707.       
  708.       .macro rotlw
  709.        rlwnm \1,\2,\3,0,31
  710.       .endm
  711.       
  712.       .macro rotlw.
  713.        rlwnm. \1,\2,\3,0,31
  714.       .endm
  715.       
  716.       .macro slwi
  717.        rlwinm \1,\2,\3,0,31-(\3)
  718.       .endm
  719.       
  720.       .macro slwi.
  721.        rlwinm. \1,\2,\3,0,31-(\3)
  722.       .endm
  723.       
  724.       .macro srwi
  725.        rlwinm \1,\2,32-(\3),\3,31
  726.       .endm
  727.       
  728.       .macro srwi.
  729.        rlwinm. \1,\2,32-(\3),\3,31
  730.       .endm
  731.       
  732.       .macro clrlwi
  733.        rlwinm \1,\2,0,\3,31
  734.       .endm
  735.       
  736.       .macro clrlwi.
  737.        rlwinm. \1,\2,0,\3,31
  738.       .endm
  739.       
  740.       .macro clrrwi
  741.        rlwinm \1,\2,0,0,31-(\3)
  742.       .endm
  743.       
  744.       .macro clrrwi.
  745.        rlwinm. \1,\2,0,0,31-(\3)
  746.       .endm
  747.       
  748.       .macro clrlslwi
  749.        rlwinm \1,\2,\4,(\3)-(\4),31-(\4)
  750.       .endm
  751.       
  752.       .macro clrlslwi.
  753.        rlwinm. \1,\2,\4,(\3)-(\4),31-(\4)
  754.       .endm
  755.       
  756.       
  757.       .macro bt
  758.        bc\0 12,\1,\2
  759.       .endm
  760.       
  761.       .macro bf
  762.        bc\0 4,\1,\2
  763.       .endm
  764.       
  765.       .macro bdnz
  766.        bc\0 16,0,\1
  767.       .endm
  768.       
  769.       .macro bdnzt
  770.        bc\0 8,\1,\2
  771.       .endm
  772.       
  773.       .macro bdnzf
  774.        bc\0 0,\1,\2
  775.       .endm
  776.       
  777.       .macro bdz
  778.        bc\0 18,0,\1
  779.       .endm
  780.       
  781.       .macro bdzt
  782.        bc\0 10,\1,\2
  783.       .endm
  784.       
  785.       .macro bdzf
  786.        bc\0 2,\1,\2
  787.       .endm
  788.       
  789.       .macro bta
  790.        bca\0 12,\1,\2
  791.       .endm
  792.       
  793.       .macro bfa
  794.        bca\0 4,\1,\2
  795.       .endm
  796.       
  797.       .macro bdnza
  798.        bca\0 16,0,\1
  799.       .endm
  800.       
  801.       .macro bdnzta
  802.        bca\0 8,\1,\2
  803.       .endm
  804.       
  805.       .macro bdnzfa
  806.        bca\0 0,\1,\2
  807.       .endm
  808.       
  809.       .macro bdza
  810.        bca\0 18,0,\1
  811.       .endm
  812.       
  813.       .macro bdzta
  814.        bca\0 10,\1,\2
  815.       .endm
  816.       
  817.       .macro bdzfa
  818.        bca\0 2,\1,\2
  819.       .endm
  820.       
  821.       .macro blr
  822.        bclr 20,0
  823.       .endm
  824.       
  825.       .macro btlr
  826.        bclr\0 12,\1
  827.       .endm
  828.       
  829.       .macro bflr
  830.        bclr\0 4,\1
  831.       .endm
  832.       
  833.       .macro bdnzlr
  834.        bclr\0 16,0
  835.       .endm
  836.       
  837.       .macro bdnztlr
  838.        bclr\0 8,\1
  839.       .endm
  840.       
  841.       .macro bdnzflr
  842.        bclr\0 0,\1
  843.       .endm
  844.       
  845.       .macro bdzlr
  846.        bclr\0 18,0
  847.       .endm
  848.       
  849.       .macro bdztlr
  850.        bclr\0 10,\1
  851.       .endm
  852.       
  853.       .macro bdzflr
  854.        bclr\0 2,\1
  855.       .endm
  856.       
  857.       .macro bctr
  858.        bcctr 20,0
  859.       .endm
  860.       
  861.       .macro btctr
  862.        bcctr\0 12,\1
  863.       .endm
  864.       
  865.       .macro bfctr
  866.        bcctr\0 4,\1
  867.       .endm
  868.       
  869.       .macro btl
  870.        bcl\0 12,\1,\2
  871.       .endm
  872.       
  873.       .macro bfl
  874.        bcl\0 4,\1,\2
  875.       .endm
  876.       
  877.       .macro bdnzl
  878.        bcl\0 16,0,\1
  879.       .endm
  880.       
  881.       .macro bdnztl
  882.        bcl\0 8,\1,\2
  883.       .endm
  884.       
  885.       .macro bdnzfl
  886.        bcl\0 0,\1,\2
  887.       .endm
  888.       
  889.       .macro bdzl
  890.        bcl\0 18,0,\1
  891.       .endm
  892.       
  893.       .macro bdztl
  894.        bcl\0 10,\1,\2
  895.       .endm
  896.       
  897.       .macro bdzfl
  898.        bcl\0 2,\1,\2
  899.       .endm
  900.       
  901.       .macro btla
  902.        bcla\0 12,\1,\2
  903.       .endm
  904.       
  905.       .macro bfla
  906.        bcla\0 4,\1,\2
  907.       .endm
  908.       
  909.       .macro bdnzla
  910.        bcla\0 16,0,\1
  911.       .endm
  912.       
  913.       .macro bdnztla
  914.        bcla\0 8,\1,\2
  915.       .endm
  916.       
  917.       .macro bdnzfla
  918.        bcla\0 0,\1,\2
  919.       .endm
  920.       
  921.       .macro bdzla
  922.        bcla\0 18,0,\1
  923.       .endm
  924.       
  925.       .macro bdztla
  926.        bcla\0 10,\1,\2
  927.       .endm
  928.       
  929.       .macro bdzfla
  930.        bcla\0 2,\1,\2
  931.       .endm
  932.       
  933.       .macro blrl
  934.        bclrl 20,0
  935.       .endm
  936.       
  937.       .macro btlrl
  938.        bclrl\0 12,\1
  939.       .endm
  940.       
  941.       .macro bflrl
  942.        bclrl\0 4,\1
  943.       .endm
  944.       
  945.       .macro bdnzlrl
  946.        bclrl\0 16,0
  947.       .endm
  948.       
  949.       .macro bdnztlrl
  950.        bclrl\0 8,\1
  951.       .endm
  952.       
  953.       .macro bdnzflrl
  954.        bclrl\0 0,\1
  955.       .endm
  956.       
  957.       .macro bdzlrl
  958.        bclrl\0 18,0
  959.       .endm
  960.       
  961.       .macro bdztlrl
  962.        bclrl\0 10,\1
  963.       .endm
  964.       
  965.       .macro bdzflrl
  966.        bclrl\0 2,\1
  967.       .endm
  968.       
  969.       .macro bctrl
  970.        bcctrl 20,0
  971.       .endm
  972.       
  973.       .macro btctrl
  974.        bcctrl\0 12,\1
  975.       .endm
  976.       
  977.       .macro bfctrl
  978.        bcctrl\0 4,\1
  979.       .endm
  980.       
  981.       
  982.       .macro blt
  983.       .ifeq $NARG-1
  984.        bc\0 12,0,\1
  985.       .else
  986.        bc\0 12,4*(\1)+0,\2
  987.       .endif
  988.       .endm
  989.       
  990.       .macro ble
  991.       .ifeq $NARG-1
  992.        bc\0 4,1,\1
  993.       .else
  994.        bc\0 4,4*(\1)+1,\2
  995.       .endif
  996.       .endm
  997.       
  998.       .macro beq
  999.       .ifeq $NARG-1
  1000.        bc\0 12,2,\1
  1001.       .else
  1002.        bc\0 12,4*(\1)+2,\2
  1003.       .endif
  1004.       .endm
  1005.       
  1006.       .macro bge
  1007.       .ifeq $NARG-1
  1008.        bc\0 4,0,\1
  1009.       .else
  1010.        bc\0 4,4*(\1)+0,\2
  1011.       .endif
  1012.       .endm
  1013.       
  1014.       .macro bgt
  1015.       .ifeq $NARG-1
  1016.        bc\0 12,1,\1
  1017.       .else
  1018.        bc\0 12,4*(\1)+1,\2
  1019.       .endif
  1020.       .endm
  1021.       
  1022.       .macro bnl
  1023.       .ifeq $NARG-1
  1024.        bc\0 4,0,\1
  1025.       .else
  1026.        bc\0 4,4*(\1)+0,\2
  1027.       .endif
  1028.       .endm
  1029.       
  1030.       .macro bne
  1031.       .ifeq $NARG-1
  1032.        bc\0 4,2,\1
  1033.       .else
  1034.        bc\0 4,4*(\1)+2,\2
  1035.       .endif
  1036.       .endm
  1037.       
  1038.       .macro bng
  1039.       .ifeq $NARG-1
  1040.        bc\0 4,1,\1
  1041.       .else
  1042.        bc\0 4,4*(\1)+1,\2
  1043.       .endif
  1044.       .endm
  1045.       
  1046.       .macro bso
  1047.       .ifeq $NARG-1
  1048.        bc\0 12,3,\1
  1049.       .else
  1050.        bc\0 12,4*(\1)+3,\2
  1051.       .endif
  1052.       .endm
  1053.       
  1054.       .macro bns
  1055.       .ifeq $NARG-1
  1056.        bc\0 4,3,\1
  1057.       .else
  1058.        bc\0 4,4*(\1)+3,\2
  1059.       .endif
  1060.       .endm
  1061.       
  1062.       .macro bun
  1063.       .ifeq $NARG-1
  1064.        bc\0 12,3,\1
  1065.       .else
  1066.        bc\0 12,4*(\1)+3,\2
  1067.       .endif
  1068.       .endm
  1069.       
  1070.       .macro bnu
  1071.       .ifeq $NARG-1
  1072.        bc\0 4,3,\1
  1073.       .else
  1074.        bc\0 4,4*(\1)+3,\2
  1075.       .endif
  1076.       .endm
  1077.       
  1078.       .macro blta
  1079.       .ifeq $NARG-1
  1080.        bca\0 12,0,\1
  1081.       .else
  1082.        bca\0 12,4*(\1)+0,\2
  1083.       .endif
  1084.       .endm
  1085.       
  1086.       .macro blea
  1087.       .ifeq $NARG-1
  1088.        bca\0 4,1,\1
  1089.       .else
  1090.        bca\0 4,4*(\1)+1,\2
  1091.       .endif
  1092.       .endm
  1093.       
  1094.       .macro beqa
  1095.       .ifeq $NARG-1
  1096.        bca\0 12,2,\1
  1097.       .else
  1098.        bca\0 12,4*(\1)+2,\2
  1099.       .endif
  1100.       .endm
  1101.       
  1102.       .macro bgea
  1103.       .ifeq $NARG-1
  1104.        bca\0 4,0,\1
  1105.       .else
  1106.        bca\0 4,4*(\1)+0,\2
  1107.       .endif
  1108.       .endm
  1109.       
  1110.       .macro bgta
  1111.       .ifeq $NARG-1
  1112.        bca\0 12,1,\1
  1113.       .else
  1114.        bca\0 12,4*(\1)+1,\2
  1115.       .endif
  1116.       .endm
  1117.       
  1118.       .macro bnla
  1119.       .ifeq $NARG-1
  1120.        bca\0 4,0,\1
  1121.       .else
  1122.        bca\0 4,4*(\1)+0,\2
  1123.       .endif
  1124.       .endm
  1125.       
  1126.       .macro bnea
  1127.       .ifeq $NARG-1
  1128.        bca\0 4,2,\1
  1129.       .else
  1130.        bca\0 4,4*(\1)+2,\2
  1131.       .endif
  1132.       .endm
  1133.       
  1134.       .macro bnga
  1135.       .ifeq $NARG-1
  1136.        bca\0 4,1,\1
  1137.       .else
  1138.        bca\0 4,4*(\1)+1,\2
  1139.       .endif
  1140.       .endm
  1141.       
  1142.       .macro bsoa
  1143.       .ifeq $NARG-1
  1144.        bca\0 12,3,\1
  1145.       .else
  1146.        bca\0 12,4*(\1)+3,\2
  1147.       .endif
  1148.       .endm
  1149.       
  1150.       .macro bnsa
  1151.       .ifeq $NARG-1
  1152.        bca\0 4,3,\1
  1153.       .else
  1154.        bca\0 4,4*(\1)+3,\2
  1155.       .endif
  1156.       .endm
  1157.       
  1158.       .macro buna
  1159.       .ifeq $NARG-1
  1160.        bca\0 12,3,\1
  1161.       .else
  1162.        bca\0 12,4*(\1)+3,\2
  1163.       .endif
  1164.       .endm
  1165.       
  1166.       .macro bnua
  1167.       .ifeq $NARG-1
  1168.        bca\0 4,3,\1
  1169.       .else
  1170.        bca\0 4,4*(\1)+3,\2
  1171.       .endif
  1172.       .endm
  1173.       
  1174.       
  1175.       .macro bltlr
  1176.       .ifeq $NARG-1
  1177.        bclr\0 12,4*(\1)+0
  1178.       .else
  1179.        bclr\0 12,0
  1180.       .endif
  1181.       .endm
  1182.       
  1183.       .macro blelr
  1184.       .ifeq $NARG-1
  1185.        bclr\0 4,4*(\1)+1
  1186.       .else
  1187.        bclr\0 4,1
  1188.       .endif
  1189.       .endm
  1190.       
  1191.       .macro beqlr
  1192.       .ifeq $NARG-1
  1193.        bclr\0 12,4*(\1)+2
  1194.       .else
  1195.        bclr\0 12,2
  1196.       .endif
  1197.       .endm
  1198.       
  1199.       .macro bgelr
  1200.       .ifeq $NARG-1
  1201.        bclr\0 4,4*(\1)+0
  1202.       .else
  1203.        bclr\0 4,0
  1204.       .endif
  1205.       .endm
  1206.       
  1207.       .macro bgtlr
  1208.       .ifeq $NARG-1
  1209.        bclr\0 12,4*(\1)+1
  1210.       .else
  1211.        bclr\0 12,1
  1212.       .endif
  1213.       .endm
  1214.       
  1215.       .macro bnllr
  1216.       .ifeq $NARG-1
  1217.        bclr\0 4,4*(\1)+0
  1218.       .else
  1219.        bclr\0 4,0
  1220.       .endif
  1221.       .endm
  1222.       
  1223.       .macro bnelr
  1224.       .ifeq $NARG-1
  1225.        bclr\0 4,4*(\1)+2
  1226.       .else
  1227.        bclr\0 4,2
  1228.       .endif
  1229.       .endm
  1230.       
  1231.       .macro bnglr
  1232.       .ifeq $NARG-1
  1233.        bclr\0 4,4*(\1)+1
  1234.       .else
  1235.        bclr\0 4,1
  1236.       .endif
  1237.       .endm
  1238.       
  1239.       .macro bsolr
  1240.       .ifeq $NARG-1
  1241.        bclr\0 12,4*(\1)+3
  1242.       .else
  1243.        bclr\0 12,3
  1244.       .endif
  1245.       .endm
  1246.       
  1247.       .macro bnslr
  1248.       .ifeq $NARG-1
  1249.        bclr\0 4,4*(\1)+3
  1250.       .else
  1251.        bclr\0 4,3
  1252.       .endif
  1253.       .endm
  1254.       
  1255.       .macro bunlr
  1256.       .ifeq $NARG-1
  1257.        bclr\0 12,4*(\1)+3
  1258.       .else
  1259.        bclr\0 12,3
  1260.       .endif
  1261.       .endm
  1262.       
  1263.       .macro bnulr
  1264.       .ifeq $NARG-1
  1265.        bclr\0 4,4*(\1)+3
  1266.       .else
  1267.        bclr\0 4,3
  1268.       .endif
  1269.       .endm
  1270.       
  1271.       .macro bltctr
  1272.       .ifeq $NARG-1
  1273.        bcctr\0 12,4*(\1)+0
  1274.       .else
  1275.        bcctr\0 12,0
  1276.       .endif
  1277.       .endm
  1278.       
  1279.       .macro blectr
  1280.       .ifeq $NARG-1
  1281.        bcctr\0 4,4*(\1)+1
  1282.       .else
  1283.        bcctr\0 4,1
  1284.       .endif
  1285.       .endm
  1286.       
  1287.       .macro beqctr
  1288.       .ifeq $NARG-1
  1289.        bcctr\0 12,4*(\1)+2
  1290.       .else
  1291.        bcctr\0 12,2
  1292.       .endif
  1293.       .endm
  1294.       
  1295.       .macro bgectr
  1296.       .ifeq $NARG-1
  1297.        bcctr\0 4,4*(\1)+0
  1298.       .else
  1299.        bcctr\0 4,0
  1300.       .endif
  1301.       .endm
  1302.       
  1303.       .macro bgtctr
  1304.       .ifeq $NARG-1
  1305.        bcctr\0 12,4*(\1)+1
  1306.       .else
  1307.        bcctr\0 12,1
  1308.       .endif
  1309.       .endm
  1310.       
  1311.       .macro bnlctr
  1312.       .ifeq $NARG-1
  1313.        bcctr\0 4,4*(\1)+0
  1314.       .else
  1315.        bcctr\0 4,0
  1316.       .endif
  1317.       .endm
  1318.       
  1319.       .macro bnectr
  1320.       .ifeq $NARG-1
  1321.        bcctr\0 4,4*(\1)+2
  1322.       .else
  1323.        bcctr\0 4,2
  1324.       .endif
  1325.       .endm
  1326.       
  1327.       .macro bngctr
  1328.       .ifeq $NARG-1
  1329.        bcctr\0 4,4*(\1)+1
  1330.       .else
  1331.        bcctr\0 4,1
  1332.       .endif
  1333.       .endm
  1334.       
  1335.       .macro bsoctr
  1336.       .ifeq $NARG-1
  1337.        bcctr\0 12,4*(\1)+3
  1338.       .else
  1339.        bcctr\0 12,3
  1340.       .endif
  1341.       .endm
  1342.       
  1343.       .macro bnsctr
  1344.       .ifeq $NARG-1
  1345.        bcctr\0 4,4*(\1)+3
  1346.       .else
  1347.        bcctr\0 4,3
  1348.       .endif
  1349.       .endm
  1350.       
  1351.       .macro bunctr
  1352.       .ifeq $NARG-1
  1353.        bcctr\0 12,4*(\1)+3
  1354.       .else
  1355.        bcctr\0 12,3
  1356.       .endif
  1357.       .endm
  1358.       
  1359.       .macro bnuctr
  1360.       .ifeq $NARG-1
  1361.        bcctr\0 4,4*(\1)+3
  1362.       .else
  1363.        bcctr\0 4,3
  1364.       .endif
  1365.       .endm
  1366.       
  1367.       
  1368.       .macro bltl
  1369.       .ifeq $NARG-1
  1370.        bcl\0 12,0,\1
  1371.       .else
  1372.        bcl\0 12,4*(\1)+0,\2
  1373.       .endif
  1374.       .endm
  1375.       
  1376.       .macro blel
  1377.       .ifeq $NARG-1
  1378.        bcl\0 4,1,\1
  1379.       .else
  1380.        bcl\0 4,4*(\1)+1,\2
  1381.       .endif
  1382.       .endm
  1383.       
  1384.       .macro beql
  1385.       .ifeq $NARG-1
  1386.        bcl\0 12,2,\1
  1387.       .else
  1388.        bcl\0 12,4*(\1)+2,\2
  1389.       .endif
  1390.       .endm
  1391.       
  1392.       .macro bgel
  1393.       .ifeq $NARG-1
  1394.        bcl\0 4,0,\1
  1395.       .else
  1396.        bcl\0 4,4*(\1)+0,\2
  1397.       .endif
  1398.       .endm
  1399.       
  1400.       .macro bgtl
  1401.       .ifeq $NARG-1
  1402.        bcl\0 12,1,\1
  1403.       .else
  1404.        bcl\0 12,4*(\1)+1,\2
  1405.       .endif
  1406.       .endm
  1407.       
  1408.       .macro bnll
  1409.       .ifeq $NARG-1
  1410.        bcl\0 4,0,\1
  1411.       .else
  1412.        bcl\0 4,4*(\1)+0,\2
  1413.       .endif
  1414.       .endm
  1415.       
  1416.       .macro bnel
  1417.       .ifeq $NARG-1
  1418.        bcl\0 4,2,\1
  1419.       .else
  1420.        bcl\0 4,4*(\1)+2,\2
  1421.       .endif
  1422.       .endm
  1423.       
  1424.       .macro bngl
  1425.       .ifeq $NARG-1
  1426.        bcl\0 4,1,\1
  1427.       .else
  1428.        bcl\0 4,4*(\1)+1,\2
  1429.       .endif
  1430.       .endm
  1431.       
  1432.       .macro bsol
  1433.       .ifeq $NARG-1
  1434.        bcl\0 12,3,\1
  1435.       .else
  1436.        bcl\0 12,4*(\1)+3,\2
  1437.       .endif
  1438.       .endm
  1439.       
  1440.       .macro bnsl
  1441.       .ifeq $NARG-1
  1442.        bcl\0 4,3,\1
  1443.       .else
  1444.        bcl\0 4,4*(\1)+3,\2
  1445.       .endif
  1446.       .endm
  1447.       
  1448.       .macro bunl
  1449.       .ifeq $NARG-1
  1450.        bcl\0 12,3,\1
  1451.       .else
  1452.        bcl\0 12,4*(\1)+3,\2
  1453.       .endif
  1454.       .endm
  1455.       
  1456.       .macro bnul
  1457.       .ifeq $NARG-1
  1458.        bcl\0 4,3,\1
  1459.       .else
  1460.        bcl\0 4,4*(\1)+3,\2
  1461.       .endif
  1462.       .endm
  1463.       
  1464.       .macro bltla
  1465.       .ifeq $NARG-1
  1466.        bcla\0 12,0,\1
  1467.       .else
  1468.        bcla\0 12,4*(\1)+0,\2
  1469.       .endif
  1470.       .endm
  1471.       
  1472.       .macro blela
  1473.       .ifeq $NARG-1
  1474.        bcla\0 4,1,\1
  1475.       .else
  1476.        bcla\0 4,4*(\1)+1,\2
  1477.       .endif
  1478.       .endm
  1479.       
  1480.       .macro beqla
  1481.       .ifeq $NARG-1
  1482.        bcla\0 12,2,\1
  1483.       .else
  1484.        bcla\0 12,4*(\1)+2,\2
  1485.       .endif
  1486.       .endm
  1487.       
  1488.       .macro bgela
  1489.       .ifeq $NARG-1
  1490.        bcla\0 4,0,\1
  1491.       .else
  1492.        bcla\0 4,4*(\1)+0,\2
  1493.       .endif
  1494.       .endm
  1495.       
  1496.       .macro bgtla
  1497.       .ifeq $NARG-1
  1498.        bcla\0 12,1,\1
  1499.       .else
  1500.        bcla\0 12,4*(\1)+1,\2
  1501.       .endif
  1502.       .endm
  1503.       
  1504.       .macro bnlla
  1505.       .ifeq $NARG-1
  1506.        bcla\0 4,0,\1
  1507.       .else
  1508.        bcla\0 4,4*(\1)+0,\2
  1509.       .endif
  1510.       .endm
  1511.       
  1512.       .macro bnela
  1513.       .ifeq $NARG-1
  1514.        bcla\0 4,2,\1
  1515.       .else
  1516.        bcla\0 4,4*(\1)+2,\2
  1517.       .endif
  1518.       .endm
  1519.       
  1520.       .macro bngla
  1521.       .ifeq $NARG-1
  1522.        bcla\0 4,1,\1
  1523.       .else
  1524.        bcla\0 4,4*(\1)+1,\2
  1525.       .endif
  1526.       .endm
  1527.       
  1528.       .macro bsola
  1529.       .ifeq $NARG-1
  1530.        bcla\0 12,3,\1
  1531.       .else
  1532.        bcla\0 12,4*(\1)+3,\2
  1533.       .endif
  1534.       .endm
  1535.       
  1536.       .macro bnsla
  1537.       .ifeq $NARG-1
  1538.        bcla\0 4,3,\1
  1539.       .else
  1540.        bcla\0 4,4*(\1)+3,\2
  1541.       .endif
  1542.       .endm
  1543.       
  1544.       .macro bunla
  1545.       .ifeq $NARG-1
  1546.        bcla\0 12,3,\1
  1547.       .else
  1548.        bcla\0 12,4*(\1)+3,\2
  1549.       .endif
  1550.       .endm
  1551.       
  1552.       .macro bnula
  1553.       .ifeq $NARG-1
  1554.        bcla\0 4,3,\1
  1555.       .else
  1556.        bcla\0 4,4*(\1)+3,\2
  1557.       .endif
  1558.       .endm
  1559.       
  1560.       
  1561.       .macro bltlrl
  1562.       .ifeq $NARG-1
  1563.        bclrl\0 12,4*(\1)+0
  1564.       .else
  1565.        bclrl\0 12,0
  1566.       .endif
  1567.       .endm
  1568.       
  1569.       .macro blelrl
  1570.       .ifeq $NARG-1
  1571.        bclrl\0 4,4*(\1)+1
  1572.       .else
  1573.        bclrl\0 4,1
  1574.       .endif
  1575.       .endm
  1576.       
  1577.       .macro beqlrl
  1578.       .ifeq $NARG-1
  1579.        bclrl\0 12,4*(\1)+2
  1580.       .else
  1581.        bclrl\0 12,2
  1582.       .endif
  1583.       .endm
  1584.       
  1585.       .macro bgelrl
  1586.       .ifeq $NARG-1
  1587.        bclrl\0 4,4*(\1)+0
  1588.       .else
  1589.        bclrl\0 4,0
  1590.       .endif
  1591.       .endm
  1592.       
  1593.       .macro bgtlrl
  1594.       .ifeq $NARG-1
  1595.        bclrl\0 12,4*(\1)+1
  1596.       .else
  1597.        bclrl\0 12,1
  1598.       .endif
  1599.       .endm
  1600.       
  1601.       .macro bnllrl
  1602.       .ifeq $NARG-1
  1603.        bclrl\0 4,4*(\1)+0
  1604.       .else
  1605.        bclrl\0 4,0
  1606.       .endif
  1607.       .endm
  1608.       
  1609.       .macro bnelrl
  1610.       .ifeq $NARG-1
  1611.        bclrl\0 4,4*(\1)+2
  1612.       .else
  1613.        bclrl\0 4,2
  1614.       .endif
  1615.       .endm
  1616.       
  1617.       .macro bnglrl
  1618.       .ifeq $NARG-1
  1619.        bclrl\0 4,4*(\1)+1
  1620.       .else
  1621.        bclrl\0 4,1
  1622.       .endif
  1623.       .endm
  1624.       
  1625.       .macro bsolrl
  1626.       .ifeq $NARG-1
  1627.        bclrl\0 12,4*(\1)+3
  1628.       .else
  1629.        bclrl\0 12,3
  1630.       .endif
  1631.       .endm
  1632.       
  1633.       .macro bnslrl
  1634.       .ifeq $NARG-1
  1635.        bclrl\0 4,4*(\1)+3
  1636.       .else
  1637.        bclrl\0 4,3
  1638.       .endif
  1639.       .endm
  1640.       
  1641.       .macro bunlrl
  1642.       .ifeq $NARG-1
  1643.        bclrl\0 12,4*(\1)+3
  1644.       .else
  1645.        bclrl\0 12,3
  1646.       .endif
  1647.       .endm
  1648.       
  1649.       .macro bnulrl
  1650.       .ifeq $NARG-1
  1651.        bclrl\0 4,4*(\1)+3
  1652.       .else
  1653.        bclrl\0 4,3
  1654.       .endif
  1655.       .endm
  1656.       
  1657.       .macro bltctrl
  1658.       .ifeq $NARG-1
  1659.        bcctrl\0 12,4*(\1)+0
  1660.       .else
  1661.        bcctrl\0 12,0
  1662.       .endif
  1663.       .endm
  1664.       
  1665.       .macro blectrl
  1666.       .ifeq $NARG-1
  1667.        bcctrl\0 4,4*(\1)+1
  1668.       .else
  1669.        bcctrl\0 4,1
  1670.       .endif
  1671.       .endm
  1672.       
  1673.       .macro beqctrl
  1674.       .ifeq $NARG-1
  1675.        bcctrl\0 12,4*(\1)+2
  1676.       .else
  1677.        bcctrl\0 12,2
  1678.       .endif
  1679.       .endm
  1680.       
  1681.       .macro bgectrl
  1682.       .ifeq $NARG-1
  1683.        bcctrl\0 4,4*(\1)+0
  1684.       .else
  1685.        bcctrl\0 4,0
  1686.       .endif
  1687.       .endm
  1688.       
  1689.       .macro bgtctrl
  1690.       .ifeq $NARG-1
  1691.        bcctrl\0 12,4*(\1)+1
  1692.       .else
  1693.        bcctrl\0 12,1
  1694.       .endif
  1695.       .endm
  1696.       
  1697.       .macro bnlctrl
  1698.       .ifeq $NARG-1
  1699.        bcctrl\0 4,4*(\1)+0
  1700.       .else
  1701.        bcctrl\0 4,0
  1702.       .endif
  1703.       .endm
  1704.       
  1705.       .macro bnectrl
  1706.       .ifeq $NARG-1
  1707.        bcctrl\0 4,4*(\1)+2
  1708.       .else
  1709.        bcctrl\0 4,2
  1710.       .endif
  1711.       .endm
  1712.       
  1713.       .macro bngctrl
  1714.       .ifeq $NARG-1
  1715.        bcctrl\0 4,4*(\1)+1
  1716.       .else
  1717.        bcctrl\0 4,1
  1718.       .endif
  1719.       .endm
  1720.       
  1721.       .macro bsoctrl
  1722.       .ifeq $NARG-1
  1723.        bcctrl\0 12,4*(\1)+3
  1724.       .else
  1725.        bcctrl\0 12,3
  1726.       .endif
  1727.       .endm
  1728.       
  1729.       .macro bnsctrl
  1730.       .ifeq $NARG-1
  1731.        bcctrl\0 4,4*(\1)+3
  1732.       .else
  1733.        bcctrl\0 4,3
  1734.       .endif
  1735.       .endm
  1736.       
  1737.       .macro bunctrl
  1738.       .ifeq $NARG-1
  1739.        bcctrl\0 12,4*(\1)+3
  1740.       .else
  1741.        bcctrl\0 12,3
  1742.       .endif
  1743.       .endm
  1744.       
  1745.       .macro bnuctrl
  1746.       .ifeq $NARG-1
  1747.        bcctrl\0 4,4*(\1)+3
  1748.       .else
  1749.        bcctrl\0 4,3
  1750.       .endif
  1751.       .endm
  1752.       
  1753.       
  1754.       .macro crset
  1755.        creqv \1,\1,\1
  1756.       .endm
  1757.       
  1758.       .macro crclr
  1759.        crxor \1,\1,\1
  1760.       .endm
  1761.       
  1762.       .macro crmove
  1763.        cror \1,\2,\2
  1764.       .endm
  1765.       
  1766.       .macro crnot
  1767.        crnor \1,\2,\2
  1768.       .endm
  1769.       
  1770.       
  1771.       .macro trap
  1772.        tw 31,0,0
  1773.       .endm
  1774.       
  1775.       .macro twlt
  1776.        tw 16,\1,\2
  1777.       .endm
  1778.       
  1779.       .macro twle
  1780.        tw 20,\1,\2
  1781.       .endm
  1782.       
  1783.       .macro tweq
  1784.        tw 4,\1,\2
  1785.       .endm
  1786.       
  1787.       .macro twge
  1788.        tw 12,\1,\2
  1789.       .endm
  1790.       
  1791.       .macro twgt
  1792.        tw 8,\1,\2
  1793.       .endm
  1794.       
  1795.       .macro twnl
  1796.        tw 12,\1,\2
  1797.       .endm
  1798.       
  1799.       .macro twne
  1800.        tw 24,\1,\2
  1801.       .endm
  1802.       
  1803.       .macro twng
  1804.        tw 20,\1,\2
  1805.       .endm
  1806.       
  1807.       .macro twllt
  1808.        tw 2,\1,\2
  1809.       .endm
  1810.       
  1811.       .macro twlle
  1812.        tw 6,\1,\2
  1813.       .endm
  1814.       
  1815.       .macro twlge
  1816.        tw 5,\1,\2
  1817.       .endm
  1818.       
  1819.       .macro twlgt
  1820.        tw 1,\1,\2
  1821.       .endm
  1822.       
  1823.       .macro twlnl
  1824.        tw 5,\1,\2
  1825.       .endm
  1826.       
  1827.       .macro twlng
  1828.        tw 6,\1,\2
  1829.       .endm
  1830.       
  1831.       .macro twlti
  1832.        twi 16,\1,\2
  1833.       .endm
  1834.       
  1835.       .macro twlei
  1836.        twi 20,\1,\2
  1837.       .endm
  1838.       
  1839.       .macro tweqi
  1840.        twi 4,\1,\2
  1841.       .endm
  1842.       
  1843.       .macro twgei
  1844.        twi 12,\1,\2
  1845.       .endm
  1846.       
  1847.       .macro twgti
  1848.        twi 8,\1,\2
  1849.       .endm
  1850.       
  1851.       .macro twnli
  1852.        twi 12,\1,\2
  1853.       .endm
  1854.       
  1855.       .macro twnei
  1856.        twi 24,\1,\2
  1857.       .endm
  1858.       
  1859.       .macro twngi
  1860.        twi 20,\1,\2
  1861.       .endm
  1862.       
  1863.       .macro twllti
  1864.        twi 2,\1,\2
  1865.       .endm
  1866.       
  1867.       .macro twllei
  1868.        twi 6,\1,\2
  1869.       .endm
  1870.       
  1871.       .macro twlgei
  1872.        twi 5,\1,\2
  1873.       .endm
  1874.       
  1875.       .macro twlgti
  1876.        twi 1,\1,\2
  1877.       .endm
  1878.       
  1879.       .macro twlnli
  1880.        twi 5,\1,\2
  1881.       .endm
  1882.       
  1883.       .macro twlngi
  1884.        twi 6,\1,\2
  1885.       .endm
  1886.       
  1887.       .macro tdlt
  1888.        td 16,\1,\2
  1889.       .endm
  1890.       
  1891.       .macro tdle
  1892.        td 20,\1,\2
  1893.       .endm
  1894.       
  1895.       .macro tdeq
  1896.        td 4,\1,\2
  1897.       .endm
  1898.       
  1899.       .macro tdge
  1900.        td 12,\1,\2
  1901.       .endm
  1902.       
  1903.       .macro tdgt
  1904.        td 8,\1,\2
  1905.       .endm
  1906.       
  1907.       .macro tdnl
  1908.        td 12,\1,\2
  1909.       .endm
  1910.       
  1911.       .macro tdne
  1912.        td 24,\1,\2
  1913.       .endm
  1914.       
  1915.       .macro tdng
  1916.        td 20,\1,\2
  1917.       .endm
  1918.       
  1919.       .macro tdllt
  1920.        td 2,\1,\2
  1921.       .endm
  1922.       
  1923.       .macro tdlle
  1924.        td 6,\1,\2
  1925.       .endm
  1926.       
  1927.       .macro tdlge
  1928.        td 5,\1,\2
  1929.       .endm
  1930.       
  1931.       .macro tdlgt
  1932.        td 1,\1,\2
  1933.       .endm
  1934.       
  1935.       .macro tdlnl
  1936.        td 5,\1,\2
  1937.       .endm
  1938.       
  1939.       .macro tdlng
  1940.        td 6,\1,\2
  1941.       .endm
  1942.       
  1943.       .macro tdlti
  1944.        tdi 16,\1,\2
  1945.       .endm
  1946.       
  1947.       .macro tdlei
  1948.        tdi 20,\1,\2
  1949.       .endm
  1950.       
  1951.       .macro tdeqi
  1952.        tdi 4,\1,\2
  1953.       .endm
  1954.       
  1955.       .macro tdgei
  1956.        tdi 12,\1,\2
  1957.       .endm
  1958.       
  1959.       .macro tdgti
  1960.        tdi 8,\1,\2
  1961.       .endm
  1962.       
  1963.       .macro tdnli
  1964.        tdi 12,\1,\2
  1965.       .endm
  1966.       
  1967.       .macro tdnei
  1968.        tdi 24,\1,\2
  1969.       .endm
  1970.       
  1971.       .macro tdngi
  1972.        tdi 20,\1,\2
  1973.       .endm
  1974.       
  1975.       .macro tdllti
  1976.        tdi 2,\1,\2
  1977.       .endm
  1978.       
  1979.       .macro tdllei
  1980.        tdi 6,\1,\2
  1981.       .endm
  1982.       
  1983.       .macro tdlgei
  1984.        tdi 5,\1,\2
  1985.       .endm
  1986.       
  1987.       .macro tdlgti
  1988.        tdi 1,\1,\2
  1989.       .endm
  1990.       
  1991.       .macro tdlnli
  1992.        tdi 5,\1,\2
  1993.       .endm
  1994.       
  1995.       .macro tdlngi
  1996.        tdi 6,\1,\2
  1997.       .endm
  1998.       
  1999.       
  2000.       .macro mtxer
  2001.        mtspr 1,\1
  2002.       .endm
  2003.       
  2004.       .macro mtlr
  2005.        mtspr 8,\1
  2006.       .endm
  2007.       
  2008.       .macro mtctr
  2009.        mtspr 9,\1
  2010.       .endm
  2011.       
  2012.       .macro mtdsisr
  2013.        mtspr 18,\1
  2014.       .endm
  2015.       
  2016.       .macro mtdar
  2017.        mtspr 19,\1
  2018.       .endm
  2019.       
  2020.       .macro mtdec
  2021.        mtspr 22,\1
  2022.       .endm
  2023.       
  2024.       .macro mtsdr1
  2025.        mtspr 25,\1
  2026.       .endm
  2027.       
  2028.       .macro mtsrr0
  2029.        mtspr 26,\1
  2030.       .endm
  2031.       
  2032.       .macro mtsrr1
  2033.        mtspr 27,\1
  2034.       .endm
  2035.       
  2036.       .macro mtsprg
  2037.        mtspr 272+(\1),\2
  2038.       .endm
  2039.       
  2040.       .macro mtasr
  2041.        mtspr 280,\1
  2042.       .endm
  2043.       
  2044.       .macro mtear
  2045.        mtspr 282,\1
  2046.       .endm
  2047.       
  2048.       .macro mttbl
  2049.        mtspr 284,\1
  2050.       .endm
  2051.       
  2052.       .macro mttbu
  2053.        mtspr 285,\1
  2054.       .endm
  2055.       
  2056.       .macro mtibatu
  2057.        mtspr 528+2*(\1),\2
  2058.       .endm
  2059.       
  2060.       .macro mtibatl
  2061.        mtspr 529+2*(\1),\2
  2062.       .endm
  2063.       
  2064.       .macro mtdbatu
  2065.        mtspr 536+2*(\1),\2
  2066.       .endm
  2067.       
  2068.       .macro mtdbatl
  2069.        mtspr 537+2*(\1),\2
  2070.       .endm
  2071.       
  2072.       .macro mtdabr
  2073.        mtspr 1013,\1
  2074.       .endm
  2075.       
  2076.       .macro mfxer
  2077.        mfspr \1,1
  2078.       .endm
  2079.       
  2080.       .macro mflr
  2081.        mfspr \1,8
  2082.       .endm
  2083.       
  2084.       .macro mfctr
  2085.        mfspr \1,9
  2086.       .endm
  2087.       
  2088.       .macro mfdsisr
  2089.        mfspr \1,18
  2090.       .endm
  2091.       
  2092.       .macro mfdar
  2093.        mfspr \1,19
  2094.       .endm
  2095.       
  2096.       .macro mfdec
  2097.        mfspr 22,\1
  2098.       .endm
  2099.       
  2100.       .macro mfsdr1
  2101.        mfspr \1,25
  2102.       .endm
  2103.       
  2104.       .macro mfsrr0
  2105.        mfspr \1,26
  2106.       .endm
  2107.       
  2108.       .macro mfsrr1
  2109.        mfspr \1,27
  2110.       .endm
  2111.       
  2112.       .macro mfsprg
  2113.        mfspr \1,272+(\2)
  2114.       .endm
  2115.       
  2116.       .macro mfasr
  2117.        mfspr \1,280
  2118.       .endm
  2119.       
  2120.       .macro mfear
  2121.        mfspr \1,282
  2122.       .endm
  2123.       
  2124.       .macro mftbl
  2125.        mftb \1,268
  2126.       .endm
  2127.       
  2128.       .macro mftbu
  2129.        mftb \1,269
  2130.       .endm
  2131.       
  2132.       .macro mfpvr
  2133.        mfspr \1,287
  2134.       .endm
  2135.       
  2136.       .macro mfibatu
  2137.        mfspr \1,528+2*(\2)
  2138.       .endm
  2139.       
  2140.       .macro mfibatl
  2141.        mfspr \1,529+2*(\2)
  2142.       .endm
  2143.       
  2144.       .macro mfdbatu
  2145.        mfspr \1,536+2*(\2)
  2146.       .endm
  2147.       
  2148.       .macro mfdbatl
  2149.        mfspr \1,537+2*(\2)
  2150.       .endm
  2151.       
  2152.       .macro mfdabr
  2153.        mfspr \1,1013
  2154.       .endm
  2155.       
  2156.       
  2157.       .macro nop
  2158.        ori 0,0,0
  2159.       .endm
  2160.       
  2161.       .macro li
  2162.        addi \1,0,\2
  2163.       .endm
  2164.       
  2165.       .macro lis
  2166.        addis \1,0,\2
  2167.       .endm
  2168.       
  2169.       .macro mr
  2170.        or \1,\2,\2
  2171.       .endm
  2172.       
  2173.       .macro mr.
  2174.        or. \1,\2,\2
  2175.       .endm
  2176.       
  2177.       .macro not
  2178.        nor \1,\2,\2
  2179.       .endm
  2180.       
  2181.       .macro not.
  2182.        nor. \1,\2,\2
  2183.       .endm
  2184.       
  2185.       .macro mtcr
  2186.        mtcrf 0xff,\1
  2187.       .endm
  2188.  
  2189.  
  2190. BUGS
  2191.      Not all of the 64-bit extended mnemonics are supported.
  2192.  
  2193.  
  2194. Frank Wille                  08-Feb-2000                frank@phoenix.owl.de
  2195.