home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / database / armdb_2 / Arm (.txt) next >
Psion Database  |  1997-03-15  |  34KB  |  221 lines

  1. OPLDatabaseFile
  2. The ARM processor is a 32 bit RISC processor, capable on most instructions of executing 1 instruction per clock cycle. It is also able within a single instruction, to do up to a full 32 bit shift or rotate left or right, without any time penalty, all inst
  3. ructions can be made conditional on any flag. The ARM has a 3  (5 on >= ARM 6) stage pipeline, and a full 32 bit data and address bus (26bit address on ARM 2 & 3).  The ARM has 27 (31 on >=ARM6) 32 bit general purpose registers, of which 16 are visible ad
  4. t any one time, and only one is tied up by the processor. A 230Mhz Strong Arm can execute 232MIPS!.
  5. )Status  bits on ARM processors after ARM3
  6. bit 43210     Name        Meaning(       00000     usr_26    26 bit PC User Mode'       00001     fiq_26    26 bit PC FIQ Mode'       00010     irq_26    26 bit PC IRQ Mode'       00011     svc_26    26 bit PC SVC Mode
  7.  New Modes(       10000     usr_32    32 bit PC User Mode'       10001     fiq_32    32 bit PC FIQ Mode'       10010     irq_32    32 bit PC IRQ Mode'       10011     svc_32    32 bit PC SVC Mode'       10111     abt_32    32 bit PC Abt Mode'       11011     und_32    32 bit PC Und ModeO
  8. Flags in Register  R15  ARM 2&3
  9. bit 31        N        Negative result flag
  10. bit 30        Z        Zero result flag
  11. bit 29        C        Carry flag
  12. bit 28        V        Overflow result flag!bit 27        IRQ    Interupt disable flag&bit 26        FIQ    Fast interupt disable flag
  13. bit 0        S0        Processor mode 0
  14. bit 1        S1        Processor mode 19NZCVIFxx xxxxxxxx xxxxxxxx xxxxxxSS  (xxxxx=Prog counter)
  15. #Flags in status Register on ARM >=6
  16. bit 31        N        Negative result flag
  17. bit 30        Z        Zero result flag
  18. bit 29        C        Carry flag
  19. bit 28        V        Overflow result flag bit 7        IRQ    Interupt disable flag%bit 6        FIQ    Fast interupt disable flag
  20. bit 0-4     M        Processor mode5NZCVxxxx xxxxxxxx xxxxxxxx IFxMMMMM  (xxxxx=not used)
  21. R15 now only contains the PC, but optionally can be made to revert to ARM 2&3 mode, but only the bottom 64Mb of memory will be visible.
  22. %XXX {cond} {S} <dest> , <lhs> , <rhs>,A brief Description of what the opcode does.*Which Flags are affected by the operation.'Any Notes pertanent to the instruction.&{cond} is a two letter condition flag..{S} if present, causes result flags to be set.
  23. <dest> and <lhs> are registers, <rhs> may be a register, which can be shifted or rotated, by a number, or a register; or, an immediate number, which can be represented by [(0 to 255),ROR (0 to 16)*2]. Some examples, if you are lucky.
  24. Interrupts.
  25. wThe ARM has two interupt types. IRQ and FIQ, both cause the current program to suspend, while the interupt is serviced.0The IRQ can be disabled by setting the IRQ flag.
  26. The FIQ can be disabled by setting the FIQ flag. If an FIQ is activated, the IRQ bit is automatically set. The reverse is not true, and a FIQ can be processed while an IRQ is active. Each interrupt has its own private copy of some of the regs., which replZ
  27. ace the previous copies, but whose contense are not lost, and are replaced when finished.
  28. Processor Modes
  29. S1  S0        Modes ARM2 & 3 only% 0    0        User mode. Normal operation.= 0    1        FIQ or fast interupt. Has private set of regs R8-R149 1    0        IRQ or interupt. Has private set of regs. R13-14: 1    1        SVC or supervisor. Has private set of regs R13-14
  30. The private regs. mentioned replace the standard regs. and are their contense is only visible when in the appropriate mode. The S0 & S1 flags can only be changed from within a mode other than user.
  31. GE?check for Greater or Equal (N clear & V clear or N set & V set)
  32. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.4Use for signed numbers. For unsigned numbers use CS.
  33. GT?check Greater Than (N clr& V clr& Z clr or N set& V set& Z clr)
  34. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.4Use for signed numbers. For unsigned numbers use HI.
  35. LT8check for Less Than (N set & V clear or N clear & V set)
  36. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.4Use for signed numbers. For unsigned numbers use CC.
  37. check for EQual (Z flag set)
  38. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.
  39. VC2check for oVerflow Clear (V [overflow] flag clear)
  40. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.9Add, subtract and compare instructions affect the V flag.
  41. VS.check for oVerflow Set (V [overflow] flag set)
  42. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.8Add, Subtract and compare instructions affect the V flagX
  43. HI+check for HIgher (C flag set  Z flag clear)
  44. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.=The Carry flag is affected by instructions such as ADD, SUB &6CMP, it is also altered by shift or rotate operations.-Used for unsigned numbers, for signed use GT.j
  45. CC  or  LO-check for Carry Clear or LOwer (C flag clear)
  46. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.=The Carry flag is affected by instructions such as ADD, SUB &6CMP, it is also altered by shift or rotate operations.5Used for unsigned numbers. For signed numbers use LT.
  47. NE"check for Not Equal (Z flag clear)
  48. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.l
  49. CS  or  HS/check for Carry Set or Higher Same (C flag set)
  50. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.=The Carry flag is affected by instructions such as ADD, SUB &6CMP, it is also altered by shift or rotate operations.5Used for unsigned numbers. For signed numbers use GE.
  51. check for MInus (N flag set)
  52. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.(The N flag reflects the state of bit 31.
  53. check for PLus (N flag clear)
  54. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.(The N flag reflects the state of bit 31.g
  55. LS2check for Lower or Same (C flag clear  Z flag set)
  56. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.=The Carry flag is affected by instructions such as ADD, SUB &6CMP, it is also altered by shift or rotate operations.5Used for unsigned numbers. For signed numbers use LE.
  57. LEAcheck for Less or Equal (N set & V clr or N clr & V set or Z set)
  58. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.4Use for signed numbers. For unsigned numbers use LS.
  59. check for ALways
  60. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.>To save having to add AL after the majority of instructions it9can be ommitted. Thus ADDAL and ADD are exactly the same.
  61. NV,check for NeVer. Instruction never executed.
  62. none?This is not strictly a mnemonic, but a condition code which can@be added after any instruction mnemonic, to make it conditional.6This would probably only ever be used to create a NOP.
  63. ASR  {#}<shift>*Shift <reg> by <shift> bits right, into C 
  64. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.
  65. The last bit shifted out from bit 0 is put in C, and the contents of bit 31 is repeated and shifted down from bit 31. ie sign extended.:MOV R2, R2, ASR, #1    ;R2=R2 shifted right by 1    (R2=R2/2)
  66. ROR  {#}<shift>/Rotate <reg> by <shift> bits right, setting  C 
  67. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.
  68. The reg is rotated such that bit 0 goes into bit 31, also the last bit shifted out from bit 0 is put in C. Note that there is no rotate right by 32 bits, this combination is reserved for RRX:MOV R1, R2, ROR, R3    ;R1=R2 rotated right by contents of R3
  69. LSL  {#}<shift>)Shift <reg> by <shift> bits left, into C 
  70. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.oThe last bit shifted out from bit 31 is put in C, zeros are shifted into bit 0.  LSL has the same effect as ASL;MOV R1, R2, LSL,R3    ;R1=R2 shift left by R3   (R1=R2*(2^R3))
  71. ASL  {#}<shift>)Shift <reg> by <shift> bits left, into C 
  72. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.oThe last bit shifted out from bit 31 is put in C, zeros are shifted into bit 0. ASL has the same effect as LSL.<MOV R1, R2, ASL, R3    ;R1=R2 shifted left R3    (R1=R2/(2^R3))
  73. LSR  {#}<shift>*Shift <reg> by <shift> bits right, into C 
  74. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.OThe last bit shifted out from bit 0 is put in C, zeros are shifted into bit 31.9MOV R1, R2, LSR #3    ;R1=R2 shifted right by 3    (R1=R2/8)
  75. RRX7rotate <reg> by one bit right, using C as an extension.
  76. This is not strictly a mnemonic, but an optional bit shift that may be applied to the <rhs> register before it is used, the register contents is not affected, unless it is also the <dest> register.
  77. The C flag is used as a bit 32 in the rotate, so the Carry is put into bit 31, and the bit in 0 is put in the Carry. Note there is no RLX rotate, the same effect can be achieved by ADCS R0,R0,R0,MOV R1, R2, RRX    ;R1=R2 rotated 1 bit using C
  78. MOV {cond} {S} <dest> , <rhs>
  79. Move data <rhs> to <dest>
  80. N Z)See the generic opcode XXX for more info.5MOVS    R0, R1            ;move content of R1 to R0 setting flags@MOVPL  R0, R0,LSL #2    ;if positive shift R0 2 left, or R0 = R0 *4
  81. MOV    R2, #256        ;set R2 to 256_
  82. MVN {cond} {S} <dest> , <rhs>'Move data inverted,  NOT<rhs> to <dest>
  83. N Z)See the generic opcode XXX for more info.rthis enables negative immediate values to be loaded. By taking the positive value, subtracting one, and using MVN.1MVNS    R0, R0        ;invert all bits in R0 and set flags*MVN    R2, #0        ;set R2 to &FFFFFFFF,  ie.  -1
  84. MVN    R3, #41    ;set R2 to -42
  85.  TEQ {cond} {S} {P} <lhs> , <rhs>?Test equal, bitwise <lhs> EOR <rhs> set flags, result not saved
  86. N ZvSee the generic opcode XXX for more info. If the P  option is set, it is possible to change the status flags directly.2TEQ always assumes TEQS, ie. flags are always set.+TEQ    R0,R5    ;test bits using R5 setting flags(TEQ    R0, #0    ;test if Ro is zero, ie Z set.TEQP  R15, #&20000000    ;Set only the carry flag
  87.  CMP {cond} {S} {P} <lhs> , <rhs>3Compare <lhs> - <rhs> result not stored, flags set.
  88. N Z V CvSee the generic opcode XXX for more info. If the P  option is set, it is possible to change the status flags directly.2CMP always assumes CMPS, ie. flags are always set.8CMP    R1,#&100    ;test if R1 will fit in one byte, set flags
  89. ......,CMP    R1,R2        ;compare  R1 and R2 setting flags'MOVLT R1,R2    ;put largest number into R1
  90.  CMN {cond} {S} {P} <lhs> , <rhs>5Compare <lhs> - - <rhs> result not stored, flags set.
  91. N Z V CvSee the generic opcode XXX for more info. If the P  option is set, it is possible to change the status flags directly.?main use is to compare a reg with a small neg. immediate value.)CMN  R2,#2    ;compare R2 with -2, set flags9CMN  R1,#&100    ;Make sure R1 is less than or equal to -256'MVNLT R1,#&FF    ;if too small set to -256z
  92.  TST {cond} {S} {P} <lhs> , <rhs>@Test bits, bitwise <lhs> AND <rhs> result not stored, flags set.
  93. N ZvSee the generic opcode XXX for more info. If the P  option is set, it is possible to change the status flags directly.2TST always assumes TSTS, ie. flags are always set.,TST    R0,R5        ;test bits using R5 setting flags<TST    R0, #&20    ;test for case of char, if Z set then it's caps<
  94. %ADD {cond} {S} <dest> , <lhs> , <rhs>;Add <lhs> to <rhs> with result in <dest> signed or unsigned
  95. N Z V C%See generic opcode XXX for more info.=ADDNES  R0,R0, #1    ;if flags Not Equal R0=R0+1, then set flags>ADD R0, R0, R0, LSL #1    ;R0=R0+R0*2  ==  R0*3, do not set flags.ADDS R8, R8, R3        ;add R3 to R8, then set flags
  96. %SUB {cond} {S} <dest> , <lhs> , <rhs>1subrtact <rhs> from <lhs> result in <dest> signed
  97. N Z V C%See generic opcode XXX for more info.4SUBS  R6, R6, #1    ;decrement R6 by one, setting flags1SUB  R1, R1, R1, ASR #2    ;R1=3/4*R1   (R1=R1-R1/4)~
  98. %SBC {cond} {S} <dest> , <lhs> , <rhs>;Subtract <lhs> - <rhs> - NOT<carry> result in <dest> signed
  99. N Z V C%See generic opcode XXX for more info.:A subtract that does not need a borrow will set the C flag7This is to allow a 64 bit subtraction  R8 R9 from R6 R7>SBCS  R6, R6, R8    ;subtract lower half of number, setting flags;SBC  R7, R7, R9        ;subtract upper half of number with borrow
  100. %RSB {cond} {S} <dest> , <lhs> , <rhs>1Subtract <lhs> from <rhs> result in <dest> signed
  101. N Z V C%See generic opcode XXX for more info.DThis is to allow a subtract to make full use of the shift facilaties RSB R6, R7, #1                    ; R6 = 1 - R7'RSB R6, R7, R8, ASR#2        ; R6 = R8/4 - R7
  102. %RSC {cond} {S} <dest> , <lhs> , <rhs>;Subtract <rhs> - <lhs> - NOT<carry> result in <dest> signed
  103. N Z V C%See generic opcode XXX for more info.:A subtract that does not need a borrow will set the C flag<This is to allow a 64 bit subtraction eg. &10000000000-R6,R7>RSCS  R6, R6, #0    ;subtract lower half of number, setting flags:RSC  R7, R7, #4    ;subtract upper half of number with borrow
  104. %ORR {cond} {S} <dest> , <lhs> , <rhs>/logical bitwise <lhs> OR <rhs> result in <dest>
  105. N Z)See the generic opcode XXX for more info.$eg.  01100101 OR 10110011 = 11110111;ORRS  R0,R0,R5   ;set desired bits using R5, then set flags-ORR      R0, R0, #&80000000   ;set top bit of R0
  106. %AND {cond} {S} <dest> , <lhs> , <rhs>1logical bitwise <lhs> AND  <rhs> result in <dest>
  107. N Z)See the generic opcode XXX for more info.%eg.  01100101 AND 10110011 = 00100001AANDNES  R0,R0,R5   ;if flags NE mask bits with R5, then set flags/AND  R0, R0, #&DF   ;convert char to lower case
  108. %EOR {cond} {S} <dest> , <lhs> , <rhs>0logical bitwise <lhs> EOR <rhs> result in <dest>
  109. N Z)See the generic opcode XXX for more info.%eg.  01100101 EOR 10110011 = 11010110?EORS  R0,R0,R5   ;Invert required bits using R5, then set flags!EOR      R0, R0, #16   ;toggle bit 4
  110. %MUL {cond} {S} <dest> , <lhs> , <rhs>0Multiply <lhs> by <rhs> putting result in <dest>
  111. This is a simple multiply, the regs. used for <rhs> and <dest> must be different, and no shift or rotate or immediate values of the <rhs> is allowed.
  112. MUL  R0, R1, R2    ;R0 = R1*R2T
  113. -MLA {cond} {S} <dest> , <lhs> , <rhs> , <add>:MuLtiply Accumulate <lhs> * <rhs> + <add> result in <dest>
  114. This is a multiply with add, the regs. used for <rhs> and <dest> must be different, and no shift or rotate or immediate values of the <rhs> is allowed. The extra add is done after the multiply.$MLA  R0, R1, R2, R3    ;R0 = R1*R2 + R3B
  115. &STM{cond}<type>  <base>{!}, <regs> {^}:STore Multiple regs in <regs> starting from address <base>
  116. Used for storing multiple registers in a stack. {cond} is as normal, <type> is a two letter code from the letter pairs F/E  (Full/Empty) or [I/D (Increment/Decrement)] and A/D (Ascending/Descending) or [B/A (Before/After)] where FD or DB would be valid pa
  117. irs, see relevent pair descriptions. <base> is the stack ponter, {!} defines if write back of the new value is to occur, <regs> is  list of registers to save, and {^} defines that if in a non USR mode, the regs saved will be from the USR set, not the cur
  118. rent mode set of registers. kSTMPLFD R9,{R1-R4}    ;if positive store R1,R2,R3,R4, at address in R9, R9 is not updated with the new addressPSTMED R1!,{R2,R4,R6}    ;store R2,R4,R6 at address in R1, R1 is updated with R1-#12
  119. &LDM{cond}<type>  <base>{!}, <regs> {^}7LoaD Multiple regs in <regs> starting at address <base>Eif ^ specified N Z C V, in non USR modes processor status flags also.
  120. Used for loading multiple registers from stack. {cond} is as normal, <type> is a two letter code from the letter pairs F/E  (Full/Empty) or [I/D (Increment/Decrement)] and A/D (Ascending/Descending) or [B/A (Before/After)] where ED or DA would be valid pa
  121. irs, see relevent pair descriptions. <base> is the stack ponter, {!} defines if write back of the new stack value is to occur, <regs> is a list of registers to save, and {^} defines that if R15 is one of the registers to be loaded, the flags should be loH
  122. aded as well. Registers are always stored lowest reg at lowest address.TLDMEQIA R5!, {R1,R3,R6-R9}    ;if equal load R1,R3,R6,R7,R8,R9, replacing R5 with R5+24QLDMIB R1, {R1-R5,R15}^    ;load R1,R2,R3,R4,R5,R15, including flags, R1 is unchanged
  123. B{cond}  <expression>
  124. Branch to a new location
  125. This causes the execution to branch to a new location in the code, as usual the {cond} can be added to make a more normal looking branch instruction. <expression> is the address where the branch is to go, this would normally be a label which is defined el
  126. se where.:BEQ  reset         ;if equal to zero branch to label reset>BVC no_overf  ;if overflow flag clear branch to label no_overf/BAL  finish      ;always branch to label finish
  127. BL {cond}  <expression>6Branch with Link, (branch saving the current location)
  128. This command is used to implement subroutine calls, when it is called, R15 is automatically put into R14, before the branch to <expression> occurs, then if the called routine needs to use R14 it has to save it first. To return from a subroutine all that i-
  129. s necessary to do is to perform MOV R15, R14:BLMI  negative  ;if negative branch to subroutine negative
  130. . . . .>MOVS R15, R14;return from the branch, restoring original flags2
  131. %BIC {cond} {S} <dest> , <lhs> , <rhs>:Clear BIts, a bitwise <lhs> AND NOT <rhs> result in <dest>
  132. N Z)See the generic opcode XXX for more info.)eg.  01100101 AND NOT 10110011 = 01000100<BICS  R0,R0,R5   ;zero unwanted bits with R5, then set flags;BIC     R0, R0, #&20   ;convert char to caps by clearing bit 5F
  133. %ADC {cond} {S} <dest> , <lhs> , <rhs>@Add <lhs> to <rhs> + <carry> result in <dest> signed or unsigned
  134. N Z V C%See generic opcode XXX for more info.:This is to allow a 64 bit addition. eg. add R6 R7 to R8 R9@ADDS  R6, R6, R8    ;add lower half of 64 bit number, setting flags4ADC  R7, R7, R9    ;add upper half of number with carryZ
  135. FA  or [DA(load)  or IB(store)]:Full Ascending stack [Decrement After or Increment Before]
  136. These are not mnemonics, but a code added to STM or LDM comands to decide how the data is to be stored. Full means that the stack pointer points to the last item put on the stack. Ascending means that the stack pointer gets Incremented as the stack gets f
  137. illed.@STMFA R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at end of stack&LDMFA R13!,{R1,R2} ;Restores R1 and R2%or the same thing could be done with:@STMIB R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at end of stack&LDMDA R13!,{R1,R2} ;Restores R1 and R2\
  138. FD  or [IA(load)  or DB(store)];Full Descending stack [Increment After or Decrement Before]
  139. These are not mnemonics, but a code added to STM or LDM comands to decide how the data is to be stored. Full means that the stack pointer points to the last item put on the stack. Descending means that the stack pointer gets Decremented as the stack gets 
  140. filled.@STMFD R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at top of stack&LDMFD R13!,{R1,R2} ;Restores R1 and R2%or the same thing could be done with:@STMDB R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at top of stack&LDMIA R13!,{R1,R2} ;Restores R1 and R2X
  141. ED  or [IB(load)  or DA(store)]<Empty Descending stack [Increment Before or Decrement After]
  142. These are not mnemonics, but a code added to STM or LDM comands to decide how the data is to be stored. Empty means that the stack pointer points at the next Empty location. Descending means that the stack pointer gets decremented as the stack gets filled
  143. .@STMED R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at top of stack&LDMED R13!,{R1,R2} ;Restores R1 and R2%or the same thing could be done with:@STMDA R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at top of stack'LDMIB  R13!,{R1,R2} ;Restores R1 and R2U
  144. EA  or [DB(load)  or IA(store)];Empty Ascending stack [Decrement Before or Increment After]
  145. These are not mnemonics, but a code added to STM or LDM comands to decide how the data is to be stored. Empty means that the stack pointer points at the next Empty location. Ascending means that the stack pointer gets incremented as the stack gets filled.
  146. @STMEA R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at end of stack&LDMEA R13!,{R1,R2} ;Restores R1 and R2%or the same thing could be done with:@STMIA R13!,{R1,R2}  ;Puts R1 low in memory, i.e. at end of stack&LDMDB R13!,{R1,R2} ;Restores R1 and R2
  147. 5CDP{cond}  <cp#> , <p> , <o> , <lhs> , <rhs> , {info}
  148. Co-processor Data processing
  149. This instruction is passed on to co-processor <cp#>. {cond} is the normal condition code, telling it to perform operation <p>, on co-processor registers <lhs> and <rhs>, and place the result into <o>. {info} may supply additional information about the ope
  150. ration concerned. Apart from the co-processor number <cp#> the above is only a recommendation, and is entirley defined by how the co-processor interprets the data.
  151. ;MRC{cond}  <cp#> , <o> , <ARM src> , <lhs> , <rhs> , {info}
  152. Move from  ARM to Co-processor
  153. This command allows 32 bit values to be transfered from the ARM to a co-processor. {cond} is the condition code, <o> is the operation required, <ARM src> is the ARM register from which the data is taken, <lhs> and <rhs> are co-processor register numbers, 
  154. {info} any extra information. Apart from <cp#> the exect interpretation of the fields is not fixed, and depends on the co-processor.
  155. <MCR{cond}  <cp#> , <o> , <ARM dest> , <lhs> , <rhs> , {info}
  156. Move from  Co-processor to ARM
  157. This command allows 32 bit values to be transfered from the co-processor to the ARM. {cond} is the condition code, <o> is the operation required, |ARM dest> is the ARM register to which the data is to be transfered, <lhs> and <rhs> are co-processor regist
  158. er numbers, {info} any extra information. Apart from <cp#> the exect interpretation of the fields is not fixed, and depends on the co-processor.
  159. DLDC{cond}{L},<cp#>,<dest>,[<base>,<offset>]{!} or  [<base>],<offset>ALoad co-processor registers using Pre-indexing or  Post-indexing.
  160. <cp#> is the co-processor number, <dest> is the co-processor reg to which the data is to be transfered <base> is the reg with the base address of the location required. <offset> is an optional value added to the <base>, the <offset> is an immediate number
  161.  +/-1020 bytes. The {L} option allows multiple registers to be loaded, it is up to the co-processor how many registers are transfered.
  162. For Pre-indexing there is not normally write back, ie the <base> + <offset> once used, is not stored, however if a ! is used after the command, the new calculated <base> will be stored. eg.kLDC 1, F0, [R2, #-4] !    ;load reg F0 on co-proc no 1, from the address in R2-4 which is stored back into R2.}LDCL 1, F0, [R2, #-16] !    ;load 4 regs F0 to 3 on co-proc no 1, starting from the address in R2-16 which is stored back in R2.
  163. For Post-indexing the <offset> is not added to <base> until after the the store occurs, write-back always occurs, so no ! is needed. eg.
  164. LDCL 1, F0, [R2], #16    ;load 4 regs starting from address in R2, to regs F0 to 3, on co-proc no 1, then R2 is incremented by 16.
  165. A special form is LDC <cp#>,<dest>,<expresn>, where <expresn> yields an address, this will use the PC as <base> and add the <expression> if this is not in the range +/-1020 an error is given.>LDC    1, F1, label    ;load value at label into F1 on co-proc. no 1
  166. DSTC{cond}{L},<cp#>,<dest>,[<base>,<offset>]{!} or  [<base>],<offset>BSTore Co-processor registers using Pre-indexing or  Post-indexing.
  167. <cp#> is the co-processor number, <dest> is the co-processor reg from which the data is to be transfered <base> is the reg with the base address of the location required. <offset> is an optional value added to the <base>, the <offset> is an immediate numb
  168. er +/-1020 bytes. The {L} option allows multiple registers to be stored, it is up to the co-processor how many registers are transfered.
  169. For Pre-indexing there is not normally write back, ie the <base> + <offset> once used, is not stored, however if a ! is used after the command, the new calculated <base> will be stored. eg.jSTC 1, F0, [R2, #-4] !    ;store reg F0 on co-proc no 1, to the address in R2-4 which is stored back into R2.~STCL 1, F0, [R2, #-16] !    ;store 4 regs F0 to 3 on co-proc no 1, starting from the address in R2-16 which is stored back in R2.
  170. For Post-indexing the <offset> is not added to <base> until after the the store occurs, write-back always occurs, so no ! is needed. eg.
  171. STCL 1, F0, [R2], #16    ;store 4 regs starting from address in R2, from regs F0 to 3, on co-proc no 1, then R2 is incremented by 16.
  172. A special form is STC <cp#>,<dest>,<expresn>, where <expresn> yields an address, this will use the PC as <base> and add the <expression> if this is not in the range +/-1020 an error is given.QSTC    1, F1, label    ;store value to label from F1 on co-proc. no 1 not a good idea.!
  173. MRS{cond} {S} <type>, <data>/Status Register transfer Save (ARM 6 and later)
  174. MRS is used for transfering a status register to a processor register. The S bit, when set means access the SPSR of the current privileged mode, rather than the CPSR. This bit must only be set when in a privileged mode. R15 should not be specified as the ,
  175. destination register of an MRS instruction..MRS  R4, CPSR    ;save proc status to register R4I
  176. MSR{cond} {S} <type>, <data>/Status Register transfer Load (ARM 6 and later)
  177. All, if requested.
  178. MSR is used for transfering a register or constant to a status register. The S bit, when set means access the SPSR of the current privileged mode, rather than the CPSR. This must only be set when executed in a privileged mode. R15 should not be specified .
  179. as the source register of an MSR instruction.>MSR SPSR_all, R3    ;set control and flag bits of the PSR from R3;MSR CPSR_flg, #&F0000000    ;Set only flag bits using constant>MSREQ CPSR_ctl, R2    ;if equal set only the control bits from R24
  180.     Registers
  181. 4Registers visible on ARM processor in various modes.
  182. Mode                Registers available
  183. USR    R0    -                -    -        -    -    R14       R15"FIQ    R0-R7    R8_FIQ    -            -    R14_FIQ    R15#IRQ    R0    -        R12    R13_IRQ    -    R14_IRQ    R15#SVC    R0    -        R12    R13_SVC    -    R14_SVC    R15+ABT    R0    -        R12    R13_ABT    -    R14_ABT    R15    ARM >=6+UND    R0    -        R12    R13_UND    -    R14_UND    R15    ARM >=6
  184. There are six status registers on the ARM6 and later processors. One is the current processor status register (CPSR) and holds information about the current state of the processor. The other five are the saved processor status registers (SPSRs): there is 
  185. one of these for each privileged mode, it holds information about the state the processor must be returned to when exception handling in that mode is complete.QThese registers are set and read using the MSR and MRS instructions respectively.
  186. ROM::BJ.WDR
  187. $SMULL {cond} {S} <Rh> <Rl> <Rm> <Rs>3Signed Multiply with 64 bit result,  (ARM >=7 only)
  188. Only on ARM 7 and above. Rm is multiplied by Rs to give a 64-bit signed result, this is stored with its least significant half in Rl and its most significant half in Rh. The program counter, R15 should not be used. Rh, Rl and Rm should be different regist
  189. ers.5SMULL  R1, R2, R3, R4  ;R3*R4  signed result in R1&R2
  190. $UMLAL {cond} {S} <Rh> <Rl> <Rm> <Rs>=Unsigned Multiply and Add with 64 bit result,  (ARM >=7 only)
  191. Only on ARM 7 and above. Rm is multiplied by Rs to give a 64-bit result, and then added to Rl and Rh, to give a final 64 bit result, this is stored with its least significant half in Rl and its most significant half in Rh. The program counter, R15 should :
  192. not be used. Rh, Rl and Rm should be different registers.=UMLAL R1, R2, R3, R4 ;R3*R4 +(R1,R2) unsigned result in R1&R2
  193. $SMLAL {cond} {S} <Rh> <Rl> <Rm> <Rs>;Signed Multiply and Add with 64 bit result,  (ARM >=7 only)
  194. Only on ARM 7 and above. Rm is multiplied by Rs to give a 64-bit signed result, and then added to Rl and Rh, to give a final 64 bit signed result, this is stored with its least significant half in Rl and its most significant half in Rh. The program counteH
  195. r, R15 should not be used. Rh, Rl and Rm should be different registers.;SMLAL R1, R2, R3, R4 ;R3*R4 +(R1,R2) signed result in R1&R2
  196. $UMULL {cond} {S} <Rh> <Rl> <Rm> <Rs>5Unsigned Multiply with 64 bit result,  (ARM >=7 only)
  197. Only on ARM 7 and above. Rm is multiplied by Rs to obtain a 64-bit product. The result is stored with its least significant half in Rl and its most significant half in Rh. The program counter, R15 should not be used. Rh, Rl and Rm should be different regi
  198. sters.=UMULL R1, R2, R3, R4 ;Multiply R3*R4 unsigned result in R1&R2r
  199. CLDR {cond}{B}{T} <src> , [<base> , <offset>]    or    [<base>] , <offset>9Load register <src> using Pre-indexing    or     Post-indexing.
  200. None<<src> is the register to which the data is to be transfered.A<base> is the reg with the base address of the location required.
  201. <offset> is an optional value added to the <base>. The <offset> may be a immediate number +/-4095, or a possibly shifted register, however the shift can only be an immediate number, and not a register. B option loads only the least significant byte. The T
  202.  option forces the load to be in user mode regardless of, from where it came. On ARM>=7 there are some extra options SB to load a signed byte, where bits 8-31 in the <src> are set to the state of bit 7 in the byte. H load a half word, ie bits 0-15. SH siC
  203. gned halfword, same as for SB except bits 16-31 are set to bit 15.
  204. For Pre-indexing there is not normally write back, ie the <base> + <offset> once used, is not stored, however if a ! is used after the command, the new calculated <base> will be stored. eg. ?LDRB  R0, [R2, #-8]!    ;load byte at R2-8 into R0, reduce R2 by 8:LDR    R0, [R2, R3, LSL#1]    ;load from address R2+R3*2 into R0
  205. For Post-indexing the <offset> is not added to <base> until after the the load occurs, write-back always occurs, so no ! is needed.;LDRB R0, [R2], R3    ;load byte from address R2, then R2=R2+R3=LDR    R0, [R5], #4    ;load R0 from address R5 & inc. R5 by 1 word
  206. A special form is LDR <dest>,<expression>, where <expression> yields an address, this will use the PC as <base> and add the <expression> if this is not in the range +/-4095 an error is given.3LDR    R0, a_label    ;load a value from location a_label
  207. ESTR {cond}{B}{T} <src> , [<base> , <offset>]  or  [<base>] , <offset>6Store a register using Pre-indexing    or     Post-indexing.
  208. None><src> is the register from which the data is to be transfered.A<base> is the reg with the base address of the location required.
  209. <offset> is an optional value added to the <base>. The <offset> may be a immediate number +/-4095, or a possibly shifted register, however the shift can only be an immediate number, and not a register. B option saves only the least significant byte. The T
  210.  option forces the load to be in user mode regardless of, from where it came. On ARM>=7 there is an extra option H save a half word, ie bits 0-15.
  211. For Pre-indexing there is not normally write back, ie the <base> + <offset> once used, is not stored, however if a ! is used after the command, the new calculated <base> will be stored. eg.>STRB  R0, [R2, #-8]!    ;store byte in R0 at R2-8, reduce R2 by 84STR    R0, [R2, R3, LSL#1]    ;store R0 at address R2+R3*2
  212. For Post-indexing the <offset> is not added to <base> until after the the store occurs, write-back always occurs, so no ! is needed.=STRB R0, [R2], R3    ;store byte R0 at address R2, then R2=R2+R3<STR    R0, [R5], #4    ;store R0 at address R5 & inc. R5 by 1 word
  213. A special form is LDR <dest>,<expression>, where <expression> yields an address, this will use the PC as <base> and add the <expression> if this is not in the range +/-4095 an error is given.BSTR    R0, a_label    ;store value to location a_label. NOT good ideaP
  214. 'SWP {cond} {B} <dest> , <src> , [addrs]@Put data at [addrs] into <dest>, and store <src> at same address
  215. The <dest> and <src> may be the same, in which case the memory and register are swapped. If the B option is selected then only a byte is transfered. ARM>=3 only.?SWPGT  R1, R1, R3    ;if > swap data at address R3 with data in R1$
  216. SWI {cond}  <expression>
  217. SoftWare Interupt
  218. This is the users way of accessing the operating system. When called the processor will save the return address in R14_SVC and branch to location 8, from here the operating system will read the value of <expression> which can only be up to a 24 bit value,
  219.  and perform some task dependent on that value, anything from making a sound to reading a key press, this is fully dependent on the operating system, so little more can be said.@SWILT write_char  ;if less than write a character to the screen.
  220. ROM::BJ.WDR
  221.