home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / as / src / HelpAs next >
Encoding:
Text File  |  1993-03-07  |  61.2 KB  |  1,384 lines

  1. %ltorg
  2. Usage:     ltorg
  3. Summary:   Tells the assembler that it is okey to place literals at this
  4.            position. An ltorg is inserted at the end of all areas but it 
  5.            can be necessary to insert ltorgs at other positions in the file
  6.            as there must not be more than 4095 bytes between any use of a
  7.            litarate load (e.g., ldr r0,=31415) and the closest literate area.
  8.  
  9. %lnk
  10. Usage:     lnk filename
  11. Summary:   The assembler switches input to the given file. The rest of the
  12.            current file is ignored.
  13.  
  14. %get
  15. Usage:     get filename 
  16. Summary:   The assembler switches input to the new file, and returns to
  17.            the old file afterwords. The result is as if the new file was
  18.            textually inserted at the position of get.
  19.  
  20. %rn
  21. Usage:     <Identifier> rn <Expression>
  22. Summary:   The identifier can now be used as a cpu register in future
  23.            instructions. The expression must be in the interval 0 to 15
  24.            inclusive.
  25.  
  26. %fn
  27. Usage:     <Identifier> rn <Expression>
  28. Summary:   The identifier can now be used as a fpu register in future
  29.            instructions. The expression must be in the interval 0 to 7
  30.            inclusive
  31.  
  32. %cn
  33. Usage:     <Identifier> rn <Expression>
  34. Summary:   The identifier can now be used as a coprocessor register in
  35.            future instructions. The expression must be in the interval 
  36.            0 to 15 inclusive.
  37.  
  38. %equ
  39. Usage:     <Identifier> equ <Expression>
  40. Summary:   Defines an numerical identifier. '*' is a short form of equ.
  41.  
  42. %*
  43. Usage:     <Identifier> * <Expression>
  44. Summary:   Defines an numerical identifier. '*' is a short form of equ.
  45.  
  46. %dcb
  47. Usage:          dcb <Expression> {,<Expression>}*
  48. Summary:   Dcb defines one or more bytes. String constants are allowed as
  49.            expressions, which causes the characters of the string to be
  50.            loaded in consecutive bytes. '=' is a short form of dcb.
  51.  
  52. %=
  53. Usage:          = <Expression> {,<Expression>}*
  54. Summary:   '=' defines one or more bytes. String constants are allowed as
  55.            expressions, which causes the characters of the string to be
  56.            loaded in consecutive bytes. '=' is a short form of dcb.
  57.            (See ldr and str for alternative use of '='.)
  58.  
  59. %dcw
  60. Usage:          dcw <Expression> {,<Expression>}*
  61. Summary:   Dcw defines one or more 16-bits word. String constants can not
  62.            contain more than two characters and are converted to 16-bits
  63.            integers, 1:st character + (2:nd character << 8).
  64.  
  65. %dcd
  66. Usage:          dcd <Expression> {,<Expression>}*
  67. Summary:   Dcw defines one or more 32-bits word. String constants can not
  68.            contain more than four characters and are converted to 32-bits
  69.            integers, 1:st character + (2:nd character << 8) + (3:rd
  70.            character << 16) + (4:th character << 24).
  71.            '&' is a short form of dcd.
  72.  
  73. %&
  74. Usage:          & <Expression> {,<Expression>}*
  75. Summary:   '&' defines one or more 32-bits word. String constants can not
  76.            contain more than four characters and are converted to 32-bits
  77.            integers, 1:st character + (2:nd character << 8) + (3:rd
  78.            character << 16) + (4:th character << 24).
  79.            '&' is a short form of dcd.
  80.  
  81. %dcfs
  82. Usage:          dcfs <FloatExpression> {,<FloatExpression>}*
  83. Summary:   Dcfs defines one or more 32-bits floats.
  84.  
  85. %dcfd
  86. Usage:          dcfd <FloatExpression> {,<FloatExpression>}*
  87. Summary:   Dcfd defines one or more 64-bits floats.
  88.  
  89. %dcfe
  90. Usage:          dcfe <FloatExpression> {,<FloatExpression>}*
  91. Summary:   Dcfe defines one or more 96-bits floats.
  92. Note:      Dcfe is not implemented!
  93.  
  94. %dcfp
  95. Usage:          dcfp <FloatExpression> {,<FloatExpression>}*
  96. Summary:   Dcfp defines one or more 96-bits packed decimal floats.
  97. Note:      Dcfp is not implemented!
  98.  
  99. %area
  100. Usage:          area <Identifier> {,Attributes}*
  101. Summary:   Area selects a new area for storage. If the identifier is new
  102.            then a new area will be defined with the selected attributes.
  103.            It is not necessary to give the attributes if an old area is
  104.            reselected. Currently implemented attributes are:
  105.            CODE      This area is for code, this is only for the linker.
  106.            DATA      This area is for data, this is only for the linker.
  107.            NOINIT    This area is for zero initsialized data. The assembler
  108.                      will check that this is true.
  109.            READONLY  This area is read only, this is only for the linker.
  110.  
  111. %CODE
  112. Usage:          area <Identifier> , CODE {,<Attributes>}*
  113. Summary:   This tells the linker that this area contains code.
  114.            Other attributes are DATA,NOINIT and READONLY.    
  115.  
  116. %DATA
  117. Usage:          area <Identifier> , DATA {,<Attributes>}*
  118. Summary:   This tells the linker that this area contains data.
  119.            Other attributes are CODE,NOINIT and READONLY.    
  120.  
  121. %NOINIT
  122. Usage:          area <Identifier> , NOINIT {,<Attributes>}*
  123. Summary:   This tells the linker that this area contains zero initsialized
  124.            data. The assembler will check that this is true.
  125.            Other attributes are CODE,DATA and READONLY.    
  126.  
  127. %READONLY
  128. Usage:          area <Identifier> , READONLY {,<Attributes>}*
  129. Summary:   This tells the linker that this area is read only.
  130.            Other attributes are CODE,DATA and NOINIT.
  131.     
  132.  
  133. %align
  134. Usage:          align <Expression>
  135. Summary:   Align moves the next item in the current area to an address which
  136.            is an even multiplier of the expression. Note that the linker
  137.            does not support bigger alignment than four.
  138. Note:      The pad bytes are NOT set to zero! No default value exist as in
  139.            Acorn's assembler and it is not possible to give an offset.
  140.  
  141. %%
  142. Usage:          % <Expression>
  143. Summary:   '%' reserves the given numbers of bytes in the current area.
  144. Note:      The bytes are NOT set to zero!
  145.  
  146. %entry
  147. Usage:          entry
  148. Summary:   This is the entry point for the finished program. 
  149.  
  150. %^
  151. Usage:          ^ <Expression>
  152. Summary:   '^' sets the storage counter used in '#' for laying out areas.
  153. Note:      It is not possible to create register relative addresses as in 
  154.            Acorn's assembler.
  155. %#
  156. Usage:     <Identifier> # <Expression>
  157. Summary:   '#' sets the identifier equal to the storage counter, and then
  158.            increments the counter with the expression. The expression must
  159.            be positive.
  160.  
  161. %{VAR}
  162. Usage:     Don't, use @ instead.
  163. Summary:   This is a synonym for @ in Acorn's assembler it is not availible
  164.            in this assembler.
  165.  
  166. %{PC}
  167. Usage:     Don't, use . instead.
  168. Summary:   This is a synonym for . in Acorn's assembler it is not availible
  169.            in this assembler.
  170.  
  171. %.
  172. E.g:       CurrentPosition *  .  ; Gets the current position in the current area
  173. Summary:   ',' returns the current position in the current area.
  174.  
  175. %@
  176. E.g:       FillArea   # 10-@     ; Makes the storage counter equal to 10,
  177.                                  ; or gives an error if it already is larger.
  178. Summary:   '@' returns the current value of the storage counter.
  179.  
  180. %globl
  181. Usage:          globl <Identifier>
  182. Summary:   Globl instructs the assembler, and the linker, to keep this symbol
  183.            in the object file. Globl is also used to introduce an identifier 
  184.            which is defined in another assembler file. The later usage is
  185.            not compulsary as the assembler treats all undefined identifier as
  186.            introduced by globl. This behaviour may however change.
  187. Note:      Globl will probably be removed in future versions, use export, if the
  188.            identifier is defined in this assembler file, and import if it is not.
  189.  
  190. %export
  191. Usage:          export <Identifier>
  192. Summary:   Export instructs the assembler, and the linker, to keep this symbol
  193.            in the object file.
  194.  
  195. %import
  196. Usage:          import <Identifier>
  197. Summary:   Import is used to introduce an identifier which is defined in
  198.            another assembler file. It is not compulsary as the assembler
  199.            treats all undefined identifier as if they where imported. But
  200.            it is nice for people who read the code, and the assembler may
  201.            demand it in future versions.
  202.  
  203. %Cond
  204. Usage:     Don't
  205. Summary:   This is only a short description of the condition codes.
  206.            All instructons can take a condition code. the condition code is
  207.            written directly after the mnemonic and before options, if it is
  208.            present, e.g.:
  209.              addeq         add  if equal.
  210.              orrgts        or if greater than, and update flags.
  211.              bcs           branch if carry set.
  212.              ldmneib       load multiple, with increment before, if not equal.
  213.            The instruction will be executed if the conition is true.
  214.            The possible conditions are:  and they are true if:
  215.                al     Always,            always.
  216.                nv     Never,             never, this condition code should not be used!
  217.                                          Use mov r0,r0 if a no-operation is needed.
  218.                eq     Equal,             Z is set.
  219.                ne     Not Equal,         Z is cleared.
  220.                vs     Overflow,          V is set.
  221.                vc     No overflow,       V is cleared.
  222.                mi     Minus,             N is set.
  223.                pl     Plus,              N is cleared.
  224.                cs     Carry set,         C is set.
  225.                cc     Carry clear,       C is cleared.
  226.                hi     Higher,            C is set and Z is cleared.
  227.                ls     Lower or same,     C is cleared or Z is set. 
  228.                ge     Greater or equal,  N is cleared and V is cleared,
  229.                                                or N is set and V is set.
  230.                lt     Less,              N is set and V is cleared,
  231.                                                or N is cleared and V is set.
  232.                gt     Greater,           'ge' is true and Z is cleared. 
  233.                le     Less or equal,     'lt' is true or Z is set. 
  234.                hs     Higher or same,    'cs' is true.
  235.                lo     Lower              'cc' is true.
  236.            If no condition is given then 'al' (Always) is assumed.
  237.  
  238. %ShiftOp
  239. Usage:     Don't
  240. Summary:   This is only a short description of the possible shift operations.
  241.            It is sometimes possible to shift the right operand in an instruction.
  242.            The shift amount is a 5 bit constant or, in some instructions, the
  243.            contents of the lowest byte in a register. E.g.:
  244.              r0,lsl #1     shift r0 left one step.
  245.              r2,ror r1     rotate r2 right the number of step given in lowest
  246.                            byte in r1.
  247.              r3,rrx        rotate r3, extended with the carry, right one step.
  248.            Possible shifts are:             Number of steps (if constant):
  249.                lsl  Logical   shift left      0 to 31
  250.                lsr  Logical   shift right     0 to 32
  251.                asl  Atitmetic shift left      0 to 32
  252.                asr  Aritmetic shift right     0 to 32
  253.                ror  Rotate rigth              0 to 31
  254.                rrx  Rotate right extended     Always 1 step.
  255.            For a description of how the shift is done see the shift
  256.            operation in question.
  257.  
  258. %lsl
  259. E.g.:           adds r1,r2,r3,lsl #2  ; r1 = r2+r3<<2 = r2+r3*4
  260. Summary:  Lsl shifts a register left inserting zeroes at the right end:
  261.              C<--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<--0
  262.           The last bit moved out from the register is inserted in the carry
  263.           if the main instruction does not affect the carry and the s-option
  264.           is given, e.g., the lsl in the example will not set the carry as add
  265.           sets the carry itself. The number of steps can be from 0 to 31
  266.           inclusive.
  267.           It is sometimes possible to shift by the context of a register:
  268.             adds r1,r2,r3,lsl r4
  269.           Only the eigth lowest bits in the register are used allowing shifts
  270.           of up to 255 steps.
  271. Note:     Lsl is identical to asl.
  272.  
  273. %lsr
  274. E.g.:           adds r1,r2,r3,lsr #2  ; r1 = r2+r3>>2 = r2+r3/4 (if r3 is unsigned)
  275. Summary:  Lsr shifts a register right inserting zeroes at the left end:
  276.              0-->bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-->C
  277.           The last bit moved out from the register is inserted in the carry
  278.           if the main instruction does not affect the carry and the s-option
  279.           is given, e.g., the lsr in the example will not set the carry as add
  280.           sets the carry itself. The number of steps can be from 0 to 32
  281.           inclusive.
  282.           It is sometimes possible to shift by the context of a register:
  283.             adds r1,r2,r3,lsr r4
  284.           Only the eigth lowest bits in the register are used allowing shifts
  285.           of up to 255 steps.
  286.  
  287. %asl
  288. E.g.:           adds r1,r2,r3,lsl #2  ; r1 = r2+r3<<2 = r2+r3*4
  289. Summary:  Asl shifts a register left inserting zeroes at the right end:
  290.              C<--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<--0
  291.           The last bit moved out from the register is inserted in the carry
  292.           if the main instruction does not affect the carry and the s-option
  293.           is given, e.g., the asl in the example will not set the carry as add
  294.           sets the carry itself. The number of steps can be from 0 to 32
  295.           inclusive.
  296.           It is sometimes possible to shift by the context of a register:
  297.             adds r1,r2,r3,asl r4
  298.           Only the eigth lowest bits in the register are used allowing shifts
  299.           of up to 255 steps.
  300. Note:     Asl is identical to lsl.
  301.  
  302. %asr
  303. E.g.:           adds r1,r2,r3,asr #2  ; r1 = r2+r3>>>2
  304. Summary:  Asr shifts a register right inserting copies of the highest bit at
  305.           the left end, i.e., the n most significants bits becomes equal to
  306.           bit 31:
  307.              /--\
  308.              \->bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb--->C
  309.           The last bit moved out from the register is inserted in the carry
  310.           if the main instruction does not affect the carry and the s-option
  311.           is given, e.g., the asr in the example will not set the carry as add
  312.           sets the carry itself. The number of steps can be from 0 to 32
  313.           inclusive.
  314.           It is sometimes possible to shift by the context of a register:
  315.             adds r1,r2,r3,asr r4
  316.           Only the eigth lowest bits in the register are used allowing shifts
  317.           of up to 255 steps.
  318.  
  319. %ror
  320. E.g.:           adds r1,r2,r3,ror #2
  321. Summary:  Ror rotates the register right:
  322.              /-----------------------------------\
  323.              \->bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb--->C
  324.           The last bit moved out from the register is inserted in the carry
  325.           if the main instruction does not affect the carry andthe s-option
  326.           is given, e.g., the ror in the example will not set the carry as add
  327.           sets the carry itself. The number of steps can be from 0 to 31
  328.           inclusive.
  329.           It is sometimes possible to rotate by the context of a register:
  330.             adds r1,r2,r3,ror r4
  331.           Only the eigth lowest bits in the register are used allowing
  332.           rotates of up to 255 steps.
  333.  
  334. %rrx
  335. E.g.:           adds r1,r2,r3,rrx
  336. Summary:  Rr rotates the register extended by the carry one step right:
  337.              /-----------------------------------------\
  338.              \->bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb--->C--/
  339.           The lowest bit is inserted in the carry if the main instruction
  340.           does not affect the carry and the s-option is given, e.g.,
  341.           the rrx in the example will not set the carry as add sets the
  342.           carry itself.
  343.  
  344. %Core3Op
  345. Usage:     Don't
  346. Summary:   This is only a short description of some cpu instructions.
  347. Syntax:    <Core3Op><Cond><Sflag> <Dst>,<Lhs>,<Rhs>
  348.            where
  349.            <Core3Op> is one of:                    which can update the following flags:
  350.                add     <Dst> = <Lhs> +  <Rhs>          NCVZ
  351.                adc     <Dst> = <Lhs> +  <Rhs> +  C     NCVZ
  352.                sub     <Dst> = <Lhs> -  <Rhs>          NCVZ
  353.                sbc     <Dst> = <Lhs> -  <Rhs> - ~C     NCVZ
  354.                rsb     <Dst> = <Rhs> -  <Lhs>          NCVZ
  355.                rsc     <Dst> = <Rhs> -  <Lhs> - ~C     NCVZ
  356.                eor     <Dst> = <Lhs> ^  <Rhs>          NZ   and <Rhs> can update C
  357.                orr     <Dst> = <Lhs> |  <Rhs>          NZ   and <Rhs> can update C
  358.                and     <Dst> = <Lhs> &  <Rhs>          NZ   and <Rhs> can update C
  359.                bic     <Dst> = <Lhs> & ~<Rhs>          NZ   and <Rhs> can update C
  360.            <Cond>  see Cond.
  361.            <Sflag> is one of:
  362.                s               Flags are updated according to the result.
  363.                        (empty) No flag is updated.
  364.            <Dst> and <Lhs> are registers, (identifiers defined with 'rn').
  365.            <Rhs> is one of:
  366.                #<Expression>   An integer which is possible to express as an 8 bit value
  367.                                rotated an even numbers of bits. The assembler will change
  368.                                the mnemonic, if necessary, to achieve this. Mnemonics that
  369.                                are changed are add/sub, adc/sbc and and/bic.
  370.                Register
  371.                Register,rrx                       see rrx
  372.                Register,<ShiftOp> #<Expression>   see ShiftOp
  373.                Register,<ShiftOp> Register        see ShiftOp
  374.  
  375.  
  376. %CoreCmp   
  377. Usage:     Don't
  378. Summary:   This is only a short description of some cpu instructions.
  379. Syntax:    <CoreCmp><Cond><Sflag><Pflag> <Lhs>,<Rhs>
  380.            where
  381.            <CoreCmp> is one of:              which updates the following flags:
  382.                cmp     <Lhs> - <Rhs>                   NCVZ 
  383.                cmn     <Lhs> + <Rhs>                   NCVZ 
  384.                tst     <Lhs> & <Rhs>                   NZ   and <Rhs> can update C
  385.                teq     <Lhs> ^ <Rhs>                   NZ   and <Rhs> can update C
  386.            <Cond>  see Cond.
  387.            <Sflag> is not used, flags are always uppdated according to the result.
  388.                An 's' can be given but it is ignored.
  389.            <Pflag> is one of:
  390.                p               The result of the operation is moved to the
  391.                                PSR, i.e., the NCVZ flags are set from the top
  392.                                four bits of the result. In modes other than
  393.                                the user mode the NCVZIF flags are set from
  394.                                the top six bits and the mode bits are set
  395.                                from the two lowest bits. 
  396.                        (empty) The flags are updated according to the result of
  397.                                the operation
  398.  
  399.            <Dst> and <Lhs> are registers, (identifiers defined with 'rn').
  400.            <Rhs> is one of:
  401.                #<Expression>   An integer which is possible to express as an 8 bit value
  402.                                rotated an even numbers of bits. The assembler will change
  403.                                the mnemonic, if necessary, to achieve this. Mnemonics that
  404.                                are changed are cmp/cmn.
  405.                Register
  406.                Register,rrx                       see rrx
  407.                Register,<ShiftOp> #<Expression>   see ShiftOp
  408.                Register,<ShiftOp> Register        see ShiftOp
  409.  
  410. %add
  411. E.g.:           add r0,r1,r2
  412. Summary:   Add.
  413. See:       Core3Op
  414.  
  415. %adc
  416. E.g.:           adc r0,r1,r2
  417. Summary:   Add with carry.
  418. See:       Core3Op
  419.  
  420. %syb
  421. E.g.:           sub r0,r1,r2
  422. Summary:   Subtract.
  423. See:       Core3Op
  424.  
  425. %sbc
  426. E.g.:           sbc r0,r1,r2
  427. Summary:   Subtract with carry.
  428. See:       Core3Op
  429.  
  430. %rsb
  431. E.g.:           rsb r0,r1,r2
  432. Summary:   Reverse subtract.
  433. See:       Core3Op
  434.  
  435. %rsc
  436. E.g.:           rsc r0,r1,r2
  437. Summary:   Reverse subtract with carry.
  438. See:       Core3Op
  439.  
  440. %eor
  441. E.g.:           eor r0,r1,r2
  442. Summary:   Bitwise exclusive or.
  443. See:       Core3Op
  444.  
  445. %orr
  446. E.g.:           orr r0,r1,r2
  447. Summary:   Bitwise or. Acorn choosed this spelling!
  448. See:       Core3Op
  449.  
  450. %and
  451. E.g.:           and r0,r1,r2
  452. Summary:   Bitwise and.
  453. See:       Core3Op
  454.  
  455. %bic
  456. E.g.:           bic r0,r1,r2
  457. Summary:   Bit clear, this is an and where the right operand is inverted.
  458. See:       Core3Op
  459.  
  460. %mvn
  461. E.g.:           mvn r0,r1
  462. Summary:   Move not, i.e., the source operand is inverted.
  463. Syntax:    mvn<Cond><Sflag> <Dst>,<Rhs>
  464.            Mvn updates the N and Z flags if the Sflag is given, <Rhs> can
  465.            update the carry.
  466.            <Cond>  see Cond.
  467.            <Sflag> is one of:
  468.                s               Flags are updated according to the result.
  469.                        (empty) No flag is updated.
  470.            <Dst> is a register, (identifiers defined with 'rn').
  471.            <Rhs> is one of:
  472.                #<Expression>   An integer which is possible to express as an 8 bit value
  473.                                rotated an even numbers of bits. The assembler will change
  474.                                the mnemonic, if necessary, to a mov to achieve this.
  475.                Register
  476.                Register,rrx                       see rrx
  477.                Register,<ShiftOp> #<Expression>   see ShiftOp
  478.                Register,<ShiftOp> Register        see ShiftOp
  479.  
  480.  
  481. %mov
  482. E.g.:           mov r0,r1
  483. Summary:   Move, can also be used for shifts (,if you can not integrate the
  484.            shift in another instruction):
  485.             mov r0,r1,lsl #2
  486. Syntax:    mov<Cond><Sflag> <Dst>,<Rhs>
  487.            Mov updates the N and Z flags if the Sflag is given, <Rhs> can
  488.            update the carry.
  489.            <Cond>  see Cond.
  490.            <Sflag> is one of:
  491.                s               Flags are updated according to the result.
  492.                        (empty) No flag is updated.
  493.            <Dst> is a register, (identifiers defined with 'rn').
  494.            <Rhs> is one of:
  495.                #<Expression>   An integer which is possible to express as an 8 bit value
  496.                                rotated an even numbers of bits. The assembler will change
  497.                                the mnemonic, if necessary, to a mvn to achieve this.
  498.                Register
  499.                Register,rrx                       see rrx
  500.                Register,<ShiftOp> #<Expression>   see ShiftOp
  501.                Register,<ShiftOp> Register        see ShiftOp
  502.  
  503. %tst
  504. E.g.:           tst r0,r1
  505. Summary:   Test, a bitwise and where the result isn't saved.
  506. See:       CoreCmp
  507.  
  508. %teq
  509. E.g.:           teq r0,r1
  510. Summary:   Test if equal, a bitwise exclusive or where the result isn't
  511.            saved.
  512. See:       CoreCmp
  513.  
  514. %cmp
  515. E.g.:           cmp r0,r1
  516. Summary:   Compare, a subtraction where the result isn't saved.
  517. See:       CoreCmp
  518.  
  519. %cmn
  520. E.g.:           cmn r0,r1
  521. Summary:   Compare negated, i.e., the second operand is negated before
  522.            comparasion. Cmn is an addition where the result isn't saved.
  523. See:       CoreCmp
  524.  
  525. %mul
  526. E.g.:           mul r0,r1,r2
  527. Summary:   Integer multiplication. The destination and the left operand
  528.            must be different, the assembler will change the order of the
  529.            operands to achieve this.
  530. Syntax:    mul<Cond><Sflag> <Dst>,<Lhs>,<Rhs>
  531.            <Cond>  see Cond.
  532.            <Sflag> is one of:
  533.                s               The NZ flags are updated according to the result,
  534.                                and the carry is undefined.
  535.                        (empty) No flag is updated.
  536.            <Dst>,<Lhs> and <Rhs> are registers, (identifiers defined with 'rn').
  537.  
  538. %mla
  539. E.g.:           mla r0,r1,r2,r4   ; r0 = r1*r2+r4
  540. Summary:   Integer multiplication with accumulator. The destination and the
  541.            left operand of the multiplication must be different, the
  542.            assembler will change the order of the operands to achieve this.
  543. Syntax:    mla<Cond><Sflag> <Dst>,<Lhs>,<Rhs>,Acc
  544.            <Cond>  see Cond.
  545.            <Sflag> is one of:
  546.                s               The NZ flags are updated according to the result,
  547.                                and the carry is undefined.
  548.                        (empty) No flag is updated.
  549.            <Dst>,<Lhs>,<Rhs> and <Acc> are registers, (identifiers defined with 'rn').
  550.  
  551. %b
  552. E.g.:           beq label10
  553. Summary:   This is the branch instruction.
  554. Syntax:    b<Cond>  <Destination>
  555.            b<Cond> #<Expression>
  556.            <Cond>  see Cond.
  557.            <Destination>
  558.              The assembler will calculate the offset to the destination and take
  559.              care of prefetch if no '#' is given.
  560.            <Expression>
  561.              The expression is treated as the byte offset that should be added
  562.              to the pc. Only even multiples of four are allowed.
  563.            Undefined identifiers are allowed in both forms.
  564.  
  565. %bl
  566. E.g.:           bl label10
  567. Summary:   This is the branch with link instruction. The address of the next
  568.            instruction is saved in cpu register 14, and the execution continues
  569.            at the given destiniation.
  570. Syntax:    bl<Cond>  <Destination>
  571.            bl<Cond> #<Expression>
  572.            <Cond>  see Cond.
  573.            <Destination>
  574.              The assembler will calculate the offset to the destination and take
  575.              care of prefetch if no '#' is given.
  576.            <Expression>
  577.              The expression is treated as the byte offset that should be added
  578.              to the pc. Only even multiples of four are allowed.
  579.            Undefined identifiers are allowed in both forms.
  580.  
  581. %swi
  582. E.g.:           swi 256+'a'
  583. Summary:   Software interrupt. The address of the next instruction is saved in
  584.            cpu register svc-14, and the execution continues at 0x00000008 with
  585.            the I flag set and the svc mode selected. This instruction is used
  586.            for system calls.
  587. Syntax:    swi<Cond> <Expression>
  588.            <Cond>  see Cond.
  589.            the expression can be any 24-bit integer.
  590.  
  591. %swp
  592. E.g.:           swpb r0,r1,[r2]
  593. Summary:   Swap is used to implement looks on multi processor computers.
  594. Syntax:    swp<Cond><Bflag> <Dst>,<Src>,[<Addr>]
  595.            <Cond>  see Cond.
  596.            <Bflag>
  597.                b               This is a byte operation. The value is zero extended.
  598.                        (empty) This is a 32-bits operation.
  599.            <Dst>,<Src> and <Addr> are registers, (identifiers defined with 'rn').
  600.            The semantic is: 
  601.              mov                  <temp>,<Src>
  602.              ldr<Cond><Bflag>     <Dst>, [<Addr>]
  603.              str<Cond><Bflag>     <temp>,[<Addr>]
  604.            with a lock signal set on the buss so that other cpus can detect that an
  605.            atomic operation is under progress.
  606. Note:      Not availible on ARM2.
  607.  
  608. %adr:
  609. E.g.:           adr r0,CloseLabel
  610. Summary:   This is a syntesized instruction which is used to put the address of a
  611.            label into a register. The assembler generates either:
  612.              add r0,pc,#Offset
  613.            or
  614.              sub r0,pc,#Offset
  615.            depending on the relative position of the instruction and the label.
  616. Syntax:    add<Cond> <Dst>,<Position>
  617.            <Cond>  see Cond.
  618.            <Position> is a label in the same area as the instruction. The range
  619.            is limited to the positions that can be generated by adding/subtracting
  620.            an 8-bits value rotated by an even number of steps to/from the pc.
  621.  
  622. %ldm:
  623. E.g.:           ldm sp!,{r0-r4,pc}
  624. Summary:   This instruction loads multiple registers. It is normaly used to pop
  625.            from stacks, but is also useful for copying memory.
  626. Syntax:    ldm<Cond><Direction>   <Addr><!flag>,<RegisterList><^flag>
  627.            <Cond>  see Cond.
  628.            <Direction> is one of:
  629.              ib   increment <Addr>, before first load.
  630.              ia   increment <Addr>, after first load.
  631.              db   decrement <Addr>, before first load.
  632.              da   decrement <Addr>, after first load.
  633.              fd   use a  full  descending stack, same as ia.
  634.              ed   use an empty descending stack, same as ib.
  635.              fa   use a  full  ascending  stack, same as da.
  636.              ea   use an empty ascending  stack, same as db.
  637.            <Addr> is a register, (identifiers defined with 'rn').
  638.            <!flag>
  639.                !               <Addr> = <Addr> + 4*number of registers, if increment,
  640.                                       = <Addr> - 4*number of registers, if decrement.
  641.                        (empty) Do not change <Addr>
  642.            <RegisterList> is a comma separated list of registers inside braces or a '#'
  643.                           followed by a 16-bits integer expression.
  644.            <^flag>
  645.                    ^      If pc is loaded then the CZNV will be updated. If the cpu is in
  646.                           a non-user mode then the CZNVIF and the mode bits will be updated.
  647.                           If a non-user mode is selected and the pc is not loaded then the '^'
  648.                           means that it is the user registers that are loaded.
  649.                   (empty) Only the address part of the pc is updated.
  650.  
  651. %stm:
  652. E.g.:           stm sp!,{r0-r4,pc}
  653. Summary:   This instruction stores multiple registers. It is normaly used to push
  654.            on stacks, but is also useful for copying memory.
  655. Syntax:    stm<Cond><Direction>   <Addr><!flag>,<RegisterList><^flag>
  656.            <Cond>  see Cond.
  657.            <Direction> is one of:
  658.              ib   increment <Addr>, before first store.
  659.              ia   increment <Addr>, after first store.
  660.              db   decrement <Addr>, before first store.
  661.              da   decrement <Addr>, after first store.
  662.              fd   use a  full  descending stack, same as db.
  663.              ed   use an empty descending stack, same as da.
  664.              fa   use a  full  ascending  stack, same as ib.
  665.              ea   use an empty ascending  stack, same as ia.
  666.            <Addr> is a register, (identifiers defined with 'rn').
  667.            <!flag>
  668.                !               <Addr> = <Addr> + 4*number of registers, if increment,
  669.                                       = <Addr> - 4*number of registers, if decrement.
  670.                        (empty) Do not change <Addr>
  671.            <RegisterList> is a comma separated list of registers inside braces or a '#'
  672.                           followed by a 16-bits integer expression.
  673.            <^flag>
  674.                    ^      No meaning in user mode, but in non-user mode means that it is
  675.                           the user registers that are stored.
  676.                   (empty) Use the current modes register.
  677.  
  678. %ldr
  679. E.g.:           ldr r0,[r1,r2,lsl #2]   ; Loads the r2'th word from the table at r1 into r0.
  680. Summary:   The load instruction has many possibilities so the following
  681.            description might be a bit complicated.
  682. Syntax:    ldr<Cond><Bflag><Tflag>  <Dst>,<Address><!flag>
  683.            <Cond>  see Cond.
  684.            <Bflag>
  685.                b               This is a byte operation. The value is zero extended.
  686.                        (empty) This is a 32-bits operation, the value read is rotated so
  687.                                that the byte pointed at ends up in the low byte of <Dst>.
  688.            <Tflag>
  689.                t               Make a user mode bus cycle even if in a non-user mode.
  690.                                This flag is only allowed if the address is a post
  691.                                inc/decrement.
  692.                        (empty) Use the bus cycle for the current mode.
  693.            <Dst> is a register, (identifiers defined with 'rn').
  694.            <Address>
  695.              The <Tflag> is allowed in 1 to 5 but not in the others.
  696.              The <!flag> is allowed in 6 to 9 but not in the others.
  697.              10 and 11 is syntetic sugare for pc relative addressing. 
  698.               1 [ <Addr> ]      
  699.                                     indirect register. 
  700.               2 [ <Addr> ],#<Offset>
  701.                                     indirect register with immediate post inc/decrement. 
  702.               3 [ <Addr> ],<+/-> <RegOffset>
  703.               4 [ <Addr> ],<+/-> <RegOffset>, rrx
  704.               5 [ <Addr> ],<+/-> <RegOffset>,<ShiftOp> #<Expression>
  705.                                     indirect register with register post inc/decrement. 
  706.               6 [ <Addr>,#<Offset> ]
  707.                                     indirect register with immediate pre inc/decrement. 
  708.               7 [ <Addr>,<+/-> <RegOffset> ]
  709.               8 [ <Addr>,<+/-> <RegOffset>, rrx ]
  710.               9 [ <Addr>,<+/-> <regOffset>, <ShiftOp> #<Expression> ]
  711.                                     indirect register with register pre inc/decrement.
  712.              10 <Expr>
  713.                                     Translated into [pc,#<Offset>] where <Expr> = pc+<Offset>
  714.                                     compensated for prefetching.
  715.              11 =<Expr>
  716.                                     Translated into a [pc,#<Offset>] pointing at a word in a
  717.                                     literal area  (see ltorg) containing <Expr>. The assembler
  718.                                     tries to share constants if possible.
  719.            <Addr> and <RegOffset> are registers, (identifiers defined with 'rn').
  720.            <+/-> a plus or minus sign, or nothing which means plus.
  721.            <Offset>                 is an expression which value fits in a 12-bit constant
  722.                                     with a sign bit ,-4095 to +4095 inclusive.
  723.            rrx             see rrx.
  724.            <ShiftOp>       see ShiftOp.
  725.            <!flag>
  726.                !               <Addr> = <Addr> <+/-> Offset
  727.                                This flag is only allowed if the address is a pre
  728.                                inc/decrement. The <Addr> register is always updated
  729.                                if the <Address> is a post inc/decrement.
  730.                        (empty) Do not update the <Addr> register unless the <Address>
  731.                                is a post inc/decrement.
  732.  
  733. %str
  734. E.g.:           str r0,[r1,r2,lsl #2]   ; Store r0 at the r2'th word in the table at r1.
  735. Summary:   The store instruction has many possibilities so the following
  736.            description might be a bit complicated.
  737. Syntax:    str<Cond><Bflag><Tflag>  <Src>,<Address><!flag>
  738.            <Cond>  see Cond.
  739.            <Bflag>
  740.                b               This is a byte operation. The top 24-bits in <Src> are 
  741.                                ignored.
  742.                        (empty) This is a 32-bits operation, the two lowes bits of the
  743.                                address are ignored.
  744.            <Tflag>
  745.                t               Make a user mode bus cycle even if in a non-user mode.
  746.                                This flag is only allowed if the address is a post
  747.                                inc/decrement.
  748.                        (empty) Use the bus cycle for the current mode.
  749.            <Src> is a register, (identifiers defined with 'rn').
  750.            <Address>
  751.              The <Tflag> is allowed in 1 to 5 but not in the others.
  752.              The <!flag> is allowed in 6 to 9 but not in the others.
  753.              10 is syntetic sugare for pc relative addressing. 
  754.               1 [ <Addr> ]      
  755.                                     indirect register. 
  756.               2 [ <Addr> ],#<Offset>
  757.                                     indirect register with immediate post inc/decrement. 
  758.               3 [ <Addr> ],<+/-> <RegOffset>
  759.               4 [ <Addr> ],<+/-> <RegOffset>, rrx
  760.               5 [ <Addr> ],<+/-> <RegOffset>,<ShiftOp> #<Expression>
  761.                                     indirect register with register post inc/decrement. 
  762.               6 [ <Addr>,#<Offset> ]
  763.                                     indirect register with immediate pre inc/decrement. 
  764.               7 [ <Addr>,<+/-> <RegOffset> ]
  765.               8 [ <Addr>,<+/-> <RegOffset>, rrx ]
  766.               9 [ <Addr>,<+/-> <regOffset>, <ShiftOp> #<Expression> ]
  767.                                     indirect register with register pre inc/decrement.
  768.              10 <Expr>
  769.                                     Translated into [pc,#<Offset>] where <Expr> = pc+<Offset>
  770.                                     compensated for prefetching.
  771.            <Addr> and <RegOffset> are a registers, (identifiers defined with 'rn').
  772.            <+/-> a plus or minus sign, or nothing which means plus.
  773.            <Offset>                 is an expression which value fits in a 12-bit constant
  774.                                     with a sign bit ,-4095 to +4095 inclusive.
  775.            rrx         see rrx.
  776.            <ShiftOp>   see ShiftOp.
  777.            <!flag>
  778.                !               <Addr> = <Addr> <+/-> Offset
  779.                                This flag is only allowed if the address is a pre
  780.                                inc/decrement. The <Addr> register is always updated
  781.                                if the <Address> is a post inc/decrement.
  782.                        (empty) Do not update the <Addr> register unless the <Address>
  783.                                is a post inc/decrement.
  784.  
  785. %Float3Op
  786. Usage:     Don't
  787. Summary:   This is only a short description of some fpu instructions.
  788. Syntax:    <Float3Op><Cond><Prec><Round> <Dst>,<Lhs>,<Rhs>
  789.            where
  790.            <Float3Op> is one of:
  791.                adf     <Dst> = <Lhs>  +  <Rhs>
  792.                suf     <Dst> = <Lhs>  -  <Rhs>
  793.                rsf     <Dst> = <Rhs>  -  <Lhs>
  794.                muf     <Dst> = <Lhs>  *  <Rhs>
  795.                dvf     <Dst> = <Lhs>  /  <Rhs>
  796.                rdf     <Dst> = <Rhs>  /  <Lhs>
  797.                pow     <Dst> = <Lhs> **  <Rhs>
  798.                rpw     <Dst> = <Rhs> **  <Lhs>
  799.                rmf     <Dst> = <Lhs> mod <Rhs>
  800.                fml     <Dst> = <Lhs>  *  <Rhs>       fast multiplication
  801.                fdv     <Dst> = <Lhs>  /  <Rhs>       fast division
  802.                frd     <Dst> = <Rhs>  /  <Lhs>       fast reverse division
  803.                pol     <Dst> = arctan(<Lhs> / <Rhs>)
  804.            <Cond>  see Cond.
  805.            <Prec> is one of:
  806.                s               Single   precision (32-bit float).
  807.                d               Double   precision (64-bit float).
  808.                e               Extended precision (96-bit float).
  809.            <Round> is one of:
  810.                p               Round to plus infinity.
  811.                m               Round to minus infinity.
  812.                z               Round to zero.
  813.                       (empty)  Round to nearest.
  814.            <Dst> and <Lhs> are fpu registers, (identifiers defined with 'fn').
  815.            <Rhs> is one of:
  816.                #<FloatExpression>   Must evaluate to one of 0.0 1.0 2.0 3.0 4.0 5.0 10.0 or 0.5
  817.                <FpuRegister>        Identifier defined with 'fn'.
  818.  
  819. %Float2Op
  820. Usage:     Don't
  821. Summary:   This is only a short description of some fpu instructions.
  822. Syntax:    <Float2Op><Cond><Prec><Round> <Dst>,<Rhs>
  823.            where
  824.            <Float2Op> is one of:
  825.                mvf     <Dst> =     <Rhs>
  826.                mnf     <Dst> =    - <Rhs>
  827.                abs     <Dst> = abs( <Rhs>)
  828.                rnd     <Dst> = rnd( <Rhs>)     <Rhs> is rounded to an integer.
  829.                sqt     <Dst> = sqr( <Rhs>)     Square root
  830.                log     <Dst> = log( <Rhs>)     Log base 10.
  831.                lgn     <Dst> = lgn( <Rhs>)     Log base e.
  832.                exp     <Dst> = e ** <Rhs>
  833.                sin     <Dst> = sin( <Rhs>)
  834.                cos     <Dst> = cos( <Rhs>)
  835.                tan     <Dst> = tan( <Rhs>)
  836.                asn     <Dst> = asn( <Rhs>)
  837.                acs     <Dst> = acs( <Rhs>)
  838.                atn     <Dst> = atn( <Rhs>)
  839.            <Cond>  see Cond.
  840.            <Prec> is one of:
  841.                s               Single   precision (32-bit float).
  842.                d               Double   precision (64-bit float).
  843.                e               Extended precision (96-bit float).
  844.            <Round> is one of:
  845.                p               Round to plus infinity.
  846.                m               Round to minus infinity.
  847.                z               Round to zero.
  848.                       (empty)  Round to nearest.
  849.            <Dst> is a fpu register, (identifiers defined with 'fn').
  850.            <Rhs> is one of:
  851.                #<FloatExpression>   Must evaluate to one of 0.0 1.0 2.0 3.0 4.0 5.0 10.0 or 0.5
  852.                <FpuRegister>        Identifier defined with 'fn'.
  853.  
  854. %adf
  855. E.g.:           adfs f0,f1,f2
  856. Summary:   Floating point addition.
  857. See:       Float3Op
  858.  
  859. %suf
  860. E.g.:           sufs f0,f1,f2
  861. Summary:   Floating point subtraction.
  862. See:       Float3Op
  863.  
  864. %rsf
  865. E.g.:           rsfs f0,f1,#10.0
  866. Summary:   Reverse floating point subtraction.
  867. See:       Float3Op
  868.  
  869. %muf
  870. E.g.:           mufs f0,f1,f2
  871. Summary:   Floating point multiplication.
  872. See:       Float3Op
  873.  
  874. %dvf
  875. E.g.:           dvfs f0,f1,f2
  876. Summary:   Floating point division.
  877. See:       Float3Op
  878.  
  879. %rdf
  880. E.g.:           rdfs f0,f1,#1.0
  881. Summary:   Reverse floating point division.
  882. See:       Float3Op
  883.  
  884. %pow
  885. E.g.:           pows f0,f1,f2
  886. Summary:   Floating point power operation.
  887. See:       Float3Op
  888.  
  889. %rpw
  890. E.g.:           rpws f0,f1,#10.0
  891. Summary:   Raise a float point constant to the power of a floating point
  892.            register.
  893. See:       Float3Op
  894.  
  895. %rmf
  896. E.g.:           rmfs f0,f1,f2
  897. Summary:   Floating point reminder.
  898. See:       Float3Op
  899.  
  900. %fml
  901. E.g.:           fmls f0,f1,f2
  902. Summary:   Fast floating point multiplication.
  903. See:       Float3Op
  904.  
  905. %fdv
  906. E.g.:           fdvs f0,f1,f2
  907. Summary:   Fast floating point division.
  908. See:       Float3Op
  909.  
  910. %frd
  911. E.g.:           frds f0,f1,#1.0
  912. Summary:   Fast reverse floating point division.
  913. See:       Float3Op
  914.  
  915. %pol
  916. E.g.:           pols f0,f1,f2
  917. Summary:   Float cartesian coordinate to angle.
  918. See:       Float3Op
  919.  
  920. %mvf
  921. E.g.:           mvfs f0,#1.0
  922. Summary:   Floating point move.
  923. See:       Float2Op
  924.  
  925. %mnf
  926. E.g.:           mnfs f0,#1.0
  927. Summary:   Floating point negated move, i.e., the second operand is negated.
  928. See:       Float2Op
  929.  
  930. %abs
  931. E.g.:           abss f0,#1.0
  932. Summary:   Floating point absolute value.
  933. See:       Float2Op
  934.  
  935. %rnd
  936. E.g.:           rnds f0,#1.0
  937. Summary:   Round floating value to integer, result in a floating point
  938.            register. Use fix if the integer should be in a cpu register.
  939. See:       Float2Op fix
  940.  
  941. %sqt
  942. E.g.:           sqts f0,#1.0
  943. Summary:   Floating point square root.
  944. See:       Float2Op
  945.  
  946. %log
  947. E.g.:           logs f0,#1.0
  948. Summary:   Floating point log base 10.
  949. See:       Float2Op
  950.  
  951. %lgn
  952. E.g.:           lgns f0,#1.0
  953. Summary:   Floating point log base e.
  954. See:       Float2Op
  955.  
  956. %exp
  957. E.g.:           exps f0,#1.0
  958. Summary:   E raised to the power of a floating point register, or floating
  959.            point constant.
  960. See:       Float2Op
  961.  
  962. %sin
  963. E.g.:           sins f0,#1.0
  964. Summary:   Floating point sine.
  965. See:       Float2Op
  966.  
  967. %cos
  968. E.g.:           coss f0,#1.0
  969. Summary:   Floating point cosine.
  970. See:       Float2Op
  971.  
  972. %tan
  973. E.g.:           tans f0,#1.0
  974. Summary:   Floating point tangent.
  975. See:       Float2Op
  976.  
  977. %asn
  978. E.g.:           asns f0,#1.0
  979. Summary:   Inverse floating point sine.
  980. See:       Float2Op
  981.  
  982. %acs
  983. E.g.:           acss f0,#1.0
  984. Summary:   Inverse floating point cosine.
  985. See:       Float2Op
  986.  
  987. %atn
  988. E.g.:           atns f0,#1.0
  989. Summary:   Inverse floating point tangent.
  990. See:       Float2Op
  991.  
  992. %FloatCmp
  993. Usage:     Don't
  994. Summary:   This is only a short description of some fpu instructions.
  995. Note:      I'm not sure that this is correct! This is how the assembler
  996.            treats the instructions, but it is possible that a precision
  997.            is needed. 
  998. Syntax:    <FloatCmp><Cond><Prec><Round> <Lhs>,<Rhs>
  999.            where
  1000.            <FloatCmp> is one of:
  1001.                cmf     <Lhs> - <Rhs>
  1002.                cmfe    <Lhs> - <Rhs>  Generates an exception if unorded.
  1003.                cnf     <Lhs> + <Rhs>
  1004.                cnfe    <Lhs> + <Rhs>  Generates an exception if unorded.
  1005.            <Cond>  see Cond.
  1006.            <Lhs> is a fpu register, (identifiers defined with 'fn').
  1007.            <Rhs> is one of:
  1008.                #<FloatExpression>   Must evaluate to one of 0.0 1.0 2.0 3.0 4.0 5.0 10.0 or 0.5
  1009.                <FpuRegister>        Identifier defined with 'fn'.
  1010.  
  1011. %cmf
  1012. E.g.:           cmf f0,#1.0
  1013. Summary:   Floating point compare.
  1014. See:       FloatCmp cmfe
  1015.  
  1016. %cmfe
  1017. E.g.:           cmfe f0,#1.0
  1018. Summary:   Floating point compare. Cmfe raises an exception if the operands are
  1019.            unorded.
  1020. See:       FloatCmp cmf
  1021.  
  1022. %cnf
  1023. E.g.:           cnf f0,#1.0
  1024. Summary:   Floating point negated compare, i.e., the second operand is negated.
  1025. See:       FloatCmp cnfe
  1026.  
  1027. %cnfe
  1028. E.g.:           cnfe f0,#1.0
  1029. Summary:   Floating point negated compare, i.e., the second operand is
  1030.            negated. Cnfe raises an exception if the operands are unorded.
  1031. See:       FloatCmp cnf
  1032.  
  1033. %fix
  1034. E.g.:           fixsz r0,f0
  1035. Summary:   Fix rounds a floating points value to an integer and stores
  1036.            the result in a cpu register. Use rnd if the result should be
  1037.            stored in a floating point number.
  1038. Syntax:    fix<Cond><Prec><Round> <Dst>,<Rhs>
  1039.            <Cond>  see Cond.
  1040.            <Prec> is one of:
  1041.                s               Single   precision (32-bit float).
  1042.                d               Double   precision (64-bit float).
  1043.                e               Extended precision (96-bit float).
  1044.            <Round> is one of:
  1045.                p               Round to plus infinity.
  1046.                m               Round to minus infinity.
  1047.                z               Round to zero.
  1048.                       (empty)  Round to nearest.
  1049.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1050.            <Rhs> is one of:
  1051.                #<FloatExpression>   Must evaluate to one of 0.0 1.0 2.0 3.0
  1052.                                     4.0 5.0 10.0 or 0.5
  1053.                <FpuRegister>        Identifier defined with 'fn'.
  1054.  
  1055. %flt
  1056. E.g.:           fltsz f0,r0
  1057. Summary:   Flt converts an integer in a cpu register to a float and stores
  1058.            the result in a fpu register.
  1059. Syntax:    flt<Cond><Prec><Round> <Dst>,<Rhs>
  1060.            <Cond>  see Cond.
  1061.            <Prec> is one of:
  1062.                s               Single   precision (32-bit float).
  1063.                d               Double   precision (64-bit float).
  1064.                e               Extended precision (96-bit float).
  1065.            <Round> is one of:
  1066.                p               Round to plus infinity.
  1067.                m               Round to minus infinity.
  1068.                z               Round to zero.
  1069.                       (empty)  Round to nearest.
  1070.            <Dst> is a fpu register, (identifiers defined with 'fn').
  1071.            <Rhs> is a cpu register, (identifiers defined with 'rn').
  1072.  
  1073. %rfs
  1074. E.g.:           rfs r0
  1075. Summary:   Rfs copies the fpu's status register into a cpu register. The
  1076.            status register contains the following flags:
  1077.              bit  0:  IVO invalid operation.
  1078.              bit  1:  DVZ divide by zero.
  1079.              bit  2:  OFL overflow.
  1080.              bit  3:  UFL underflow.
  1081.              bit  4:  INX inexact
  1082.              bit  5 to bit 15 Unused, read as zero.
  1083.              bit 16:  IVO mask, set means interrupt enabled.
  1084.              bit 17:  DVZ mask, set means interrupt enabled.
  1085.              bit 18:  OFL mask, set means interrupt enabled.
  1086.              bit 19:  UFL mask, set means interrupt enabled.
  1087.              bit 20 to bit 23 Unused, read as zero.
  1088.              bit 24 to bit 31 System id, where bit 31 set means floating point
  1089.                               hardware, read only. 
  1090. Syntax:    rfs<Cond> <Dst>
  1091.            <Cond>  see Cond.
  1092.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1093.  
  1094. %wfs
  1095. E.g.:           wfs r0
  1096. Summary:   Wfs updates the fpu's status register with the value of a cpu
  1097.            register. The status register contains the following flags:
  1098.              bit  0:  IVO invalid operation.
  1099.              bit  1:  DVZ divide by zero.
  1100.              bit  2:  OFL overflow.
  1101.              bit  3:  UFL underflow.
  1102.              bit  4:  INX inexact
  1103.              bit  5 to bit 15 Unused, read as zero.
  1104.              bit 16:  IVO mask, set means interrupt enabled.
  1105.              bit 17:  DVZ mask, set means interrupt enabled.
  1106.              bit 18:  OFL mask, set means interrupt enabled.
  1107.              bit 19:  UFL mask, set means interrupt enabled.
  1108.              bit 20 to bit 23 Unused, read as zero.
  1109.              bit 24 to bit 31 System id, where bit 31 set means floating point
  1110.                               hardware, read only. 
  1111. Syntax:    wfs<Cond> <Src>
  1112.            <Cond>  see Cond.
  1113.            <Src> is a cpu register, (identifiers defined with 'rn').
  1114.  
  1115. %rfc
  1116. E.g.:           rfc r0
  1117. Summary:   Rfc is a privileged instruction that reads the fpu's control register. An
  1118.            attempt to use it in user mode will cause a trap. I have no information about
  1119.            what the control register contains.
  1120. Syntax:    rfc<Cond> <Dst>
  1121.            <Cond>  see Cond.
  1122.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1123.  
  1124.  
  1125. %wfc
  1126. E.g.:           wfc r0
  1127. Summary:   Wfc is a privileged instruction that updates the fpu's control register. An
  1128.            attempt to use it in user mode will cause a trap. I have no information about
  1129.            what the control register contains.
  1130. Syntax:    rfc<Cond> <Dst>
  1131.            <Cond>  see Cond.
  1132.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1133.  
  1134. %ldf
  1135. E.g.:          ldfs f0,[r0,#16]
  1136. Summary:   Ldf loads floating point values.
  1137. Syntax:    ldf<Cond><Prec> <Dst>,<Address><!flag>
  1138.            <Cond>  see Cond.
  1139.            <Prec> is one of:
  1140.                s               Single   precision (32-bit float).
  1141.                d               Double   precision (64-bit float).
  1142.                e               Extended precision (96-bit float).
  1143.                p               Packed decimal     (96-bit bcd-float).
  1144.            <Dst> is a fpu register, (identifiers defined with 'fn').
  1145.            <Address>
  1146.              The <!flag> is allowed in the last last variants but not in the others.
  1147.              [ <Addr> ]      
  1148.                                     indirect register. 
  1149.              [ <Addr> ],#<Offset>
  1150.                                     indirect register with immediate post inc/decrement. 
  1151.              [ <Addr>,#<Offset> ]
  1152.                                     indirect register with immediate pre inc/decrement. 
  1153.            <Addr> is a registers, (identifiers defined with 'rn').
  1154.            <Offset> is an expression which value fits 10-bit constant with a
  1155.                     sign bit where the two lowes bits set to zero ,-1020 to
  1156.                     +1020 inclusive but only multiples of four.
  1157.            <!flag>
  1158.                !               <Addr> = <Addr> + Offset, if increment,
  1159.                                       = <Addr> - Offset, if decrement.
  1160.                                This flag is only allowed if the address is a pre
  1161.                                inc/decrement. The <Addr> register is always updated
  1162.                                if the <Address> is a post inc/decrement.
  1163.                        (empty) Do not update the <Addr> register unless the <Address>
  1164.                                is a post inc/decrement.
  1165.  
  1166. %stf
  1167. E.g.:           stfs f0,[r0,#16]
  1168. Summary:   Stf stores floating point values. The rounding mode is always round
  1169.            to nearest, use a mvf before if another rounding mode is needed.
  1170. Syntax:    stf<Cond><Prec> <Src>,<Address><!flag>
  1171.            <Cond>  see Cond.
  1172.            <Prec> is one of:
  1173.                s               Single   precision (32-bit float).
  1174.                d               Double   precision (64-bit float).
  1175.                e               Extended precision (96-bit float).
  1176.                p               Packed decimal     (96-bit bcd-float).
  1177.            <Src> is a fpu register, (identifiers defined with 'fn').
  1178.            <Address>
  1179.              The <!flag> is allowed in the last last variants but not in the others.
  1180.              [ <Addr> ]      
  1181.                                     indirect register. 
  1182.              [ <Addr> ],#<Offset>
  1183.                                     indirect register with immediate post inc/decrement. 
  1184.              [ <Addr>,#<Offset> ]
  1185.                                     indirect register with immediate pre inc/decrement. 
  1186.            <Addr> is a registers, (identifiers defined with 'rn').
  1187.            <Offset> is an expression which value fits 10-bit constant with a
  1188.                     sign bit where the two lowes bits set to zero ,-1020 to
  1189.                     +1020 inclusive but only multiples of four.
  1190.            <!flag>
  1191.                !               <Addr> = <Addr> + Offset, if increment,
  1192.                                       = <Addr> - Offset, if decrement.
  1193.                                This flag is only allowed if the address is a pre
  1194.                                inc/decrement. The <Addr> register is always updated
  1195.                                if the <Address> is a post inc/decrement.
  1196.                        (empty) Do not update the <Addr> register unless the <Address>
  1197.                                is a post inc/decrement.
  1198.  
  1199. %ldc
  1200. E.g.:           ldc 10,c0,[r0,#16]
  1201. Summary:   Ldc loads a value to a coprocessor register. The fpu is coprocessor 1 so
  1202.            use ldf instead of ldc 1.
  1203. Syntax:    ldc<Cond><Lflag> <Cop><Dst>,<Address><!flag>
  1204.            <Cond>  see Cond.     
  1205.            <Cop> is the number of the coprocessor:
  1206.                 1 is the fpu.
  1207.               2-14   don't know if they are assign to anything. 
  1208.                15 is cache control on an ARM3.
  1209.            <Lflag> is one of:  (Note it is the coprocessor that decides what this flag means.)
  1210.                l          This is a long transfer.
  1211.                   (empty) This is a short transfer.
  1212.            <Dst> is a coprocessor register, (identifiers defined with 'cn').
  1213.            <Address>
  1214.              The <!flag> is allowed in the last variant but not in the others.
  1215.              [ <Addr> ]      
  1216.                                     indirect register. 
  1217.              [ <Addr> ],#<Offset>
  1218.                                     indirect register with immediate post inc/decrement. 
  1219.              [ <Addr>,#<Offset> ]
  1220.                                     indirect register with immediate pre inc/decrement. 
  1221.            <Addr> is a register, (identifiers defined with 'rn').
  1222.            <Offset> is an expression which value fits 10-bit constant with a
  1223.                     sign bit where the two lowes bits set to zero ,-1020 to
  1224.                     +1020 inclusive but only multiples of four.
  1225.            <!flag>
  1226.                !               <Addr> = <Addr> + Offset, if increment,
  1227.                                       = <Addr> - Offset, if decrement.
  1228.                                This flag is only allowed if the address is a pre
  1229.                                inc/decrement. The <Addr> register is always updated
  1230.                                if the <Address> is a post inc/decrement.
  1231.                        (empty) Do not update the <Addr> register unless the <Address>
  1232.                                is a post inc/decrement.
  1233.  
  1234. %stc
  1235. E.g.:           stc 10,c0,[r0,#16]
  1236. Summary:   Stc stores a value from a coprocessor register. The fpu is coprocessor 1 so
  1237.            use stf instead of stc 1.
  1238. Syntax:    stc<Cond><Lflag> <Cop><Src>,<Address><!flag>
  1239.            <Cond>  see Cond.
  1240.            <Lflag> is one of:  (Note it is the coprocessor that decides what this flag means.)
  1241.                l          This is a long transfer.
  1242.                   (empty) This is a short transfer.
  1243.            <Cop> is the number of the coprocessor:
  1244.                 1 is fpu.
  1245.               2-14   don't know if they are assign to anything. 
  1246.                15 is cache control on an ARM3.
  1247.            <Src> is a coprocessor register, (identifiers defined with 'cn').
  1248.            <Address>
  1249.              The <!flag> is allowed in the last variant but not in the others.
  1250.              [ <Addr> ]      
  1251.                                     indirect register. 
  1252.              [ <Addr> ],#<Offset>
  1253.                                     indirect register with immediate post inc/decrement. 
  1254.              [ <Addr>,#<Offset> ]
  1255.                                     indirect register with immediate pre inc/decrement. 
  1256.            <Addr> is a register, (identifiers defined with 'rn').
  1257.            <Offset> is an expression which value fits 10-bit constant with a
  1258.                     sign bit where the two lowes bits set to zero ,-1020 to
  1259.                     +1020 inclusive but only multiples of four.
  1260.            <!flag>
  1261.                !               <Addr> = <Addr> + Offset
  1262.                                This flag is only allowed if the address is a pre
  1263.                                inc/decrement. The <Addr> register is always updated
  1264.                                if the <Address> is a post inc/decrement.
  1265.                        (empty) Do not update the <Addr> register unless the <Address>
  1266.                                is a post inc/decrement.
  1267.  
  1268. %cdp
  1269. E.g.:           cdp  2,3,c0,c1,c2
  1270. Summary    Cdp is the coprocessor data instruction. Do not use it for coprocessor 1
  1271.            as the fpu has its own mnemonics.
  1272. Syntax:    cdp<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs> or
  1273.            cdp<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs>,<Info>
  1274.            <Cond>  see Cond.
  1275.            <Cop> is the number of the coprocessor:
  1276.                 1     is the fpu.
  1277.               2-14   don't know if they are assign to anything. 
  1278.                15     is cache control on an ARM3.
  1279.            <Opcode> is the number of this opcode, 0 to 15 inclusive.
  1280.            <Dst>,<Rhs> and <Lhs> are coprocessor register, (identifiers defined with 'cn').
  1281.            <Info> is the optional additional information field, 0 to 7 inclusive.
  1282.                   It is set to zero if it is omitted.
  1283.  
  1284. %mrc
  1285. E.g.:           mrc  2,3,r0,c1,c2
  1286. Summary    Mrc moves a value from the cpu to the coprocessor. Do not use it
  1287.            for coprocessor 1 as the fpu has its own mnemonics.
  1288. Syntax:    mrc<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs> or
  1289.            mrc<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs>,<Info>
  1290.            <Cond>  see Cond.
  1291.            <Cop> is the number of the coprocessor:
  1292.                 1     is the fpu.
  1293.               2-14   don't know if they are assign to anything. 
  1294.                15     is cache control on an ARM3 see CachOp.
  1295.            <Opcode> is the number of this opcode, 0 to 7 inclusive.
  1296.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1297.            <Rhs> and <Lhs> are coprocessor register, (identifiers defined with 'cn').
  1298.            <Info> is the optional additional information field, 0 to 7 inclusive.
  1299.                   It is set to zero if it is omitted.
  1300.  
  1301. %mcr
  1302. E.g.:           mcr  2,3,r0,c1,c2
  1303. Summary    Mcr moves a value from the coprocessor to the cpu. Do not use it
  1304.            for coprocessor 1 as the fpu has its own mnemonics.
  1305. Syntax:    mrc<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs> or
  1306.            mrc<Cond> <Cop>,<Operator>,<Dst>,<Rhs>,<Lhs>,<Info>
  1307.            <Cond>  see Cond.
  1308.            <Cop> is the number of the coprocessor:
  1309.                 1     is the fpu.
  1310.               2-14   don't know if they are assign to anything. 
  1311.                15     is cache control on an ARM3 see CachOp.
  1312.            <Opcode> is the number of this opcode, 0 to 7 inclusive.
  1313.            <Dst> is a cpu register, (identifiers defined with 'rn').
  1314.            <Rhs> and <Lhs> are coprocessor register, (identifiers defined with 'cn').
  1315.            <Info> is the optional additional information field, 0 to 7 inclusive.
  1316.                   It is set to zero if it is omitted.
  1317.  
  1318. %CachOp
  1319. Usage:     Don't
  1320. Summary:   This is only a short description of how to control the cache on
  1321.            an ARM3. The information is taken from one article by Andrew Mell
  1322.            (Message-ID: <9108160241.AA17682@mole.gnu.ai.mit.edu>) and one by
  1323.            Michael Hardy (Message-ID: <9189@acorn.co.uk>).
  1324.            I have assumed that c0 and c1 are defined as coprocessor registers
  1325.            0 and 1.
  1326. Note:      According to my knowledge the maximum coprocessor register is 15 not 31 as
  1327.            stated in Mell's article but I might be wrong.
  1328.            I also wonder if there are any mnemonic specified for this operations.
  1329.  
  1330.                mrc<Cond> 15,0,arm-register,control-register,c0
  1331.                                                         writes to the cache controller
  1332.                mcr<Cond> 15,0,arm-register,control-register,c0
  1333.                                                         reads from the cache controller
  1334.  
  1335.                The control registers are:
  1336.  
  1337.                register 0: 32 bit processor identity field
  1338.                            bit 31-24 : Designer (41h = Acorn)
  1339.                            bit 23-16 : Manufacturer (56h = vlsi)
  1340.                            bit 15-8  : Part type (03h = arm3)
  1341.                            bit 7-0   : Revision (0 = revision 0)
  1342.  
  1343.                register 1: cache flush
  1344.                            writing any value to this register flushes the cache
  1345.                            so an ultrafast cache flush is "mrc 15,0,r0,c1,c0".
  1346.  
  1347.                register 2: cache control (3 bit register)
  1348.                            bit 0: high = cache on , low = cache off
  1349.                            bit 1: high = shared supervisor/user address space
  1350.                                   low  = separate supervisor/user address space
  1351.                            bit 2: high = select monitor mode
  1352.                              for program tracing with a logic analyser
  1353.                              leave it low
  1354.                            bit 3-31 : reserved
  1355.  
  1356.                register 3: cacheable areas register (32 bits)
  1357.                   If bit n is set then the 2MBytes starting at n*2MBytes are
  1358.                   cacheable.
  1359.                   The default value stored is &FC007FFF, so ROM, the RAM
  1360.                   disc and logical non-screen RAM are  cacheable, but I/O
  1361.                   space, physical memory and logical screen  memory are not.
  1362.  
  1363.                register 4: updateable areas register (32 bits)
  1364.                   If bit n is set then the 2MBytes starting at n*2MBytes are
  1365.                   updateable.
  1366.                   The default value stored is &00007FFF, so logical
  1367.                   non-screen RAM is updateable,  but ROM/CAM/DAG, I/O space,
  1368.                   physical memory and logical screen memory are  not.
  1369.  
  1370.  
  1371.                register 5: disruptive areas register (32 bits)
  1372.                   If bit n is set then the 2MBytes starting at n*2MBytes are
  1373.                   disruptive.
  1374.                   The default value stored is &F0000000, so the CAM map is
  1375.                   disruptive, but  ROM/DAG, I/O space, physical memory and
  1376.                   logical memory are not. This causes  automatic flushing
  1377.                   whenever MEMC's page mapping is altered, which allows 
  1378.                   programs written for the ARM2 (including RISC OS itself)
  1379.                   to run unaltered, but at  the expense of unnecessary
  1380.                   flushing on page swaps.
  1381.  
  1382.                register 6-31: reserved
  1383.  
  1384.