home *** CD-ROM | disk | FTP | other *** search
Unknown | 1996-08-25 | 42.8 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
| |
100%
| gt2
| Kopftext: 'HELP('
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 48 45 4c 50 28 00 00 00 | c9 00 00 00 60 9c 00 00 |HELP(...|....`...|
|00000010| 2c 00 00 00 00 fd ff ff | 00 00 00 00 44 06 00 00 |,.......|....D...|
|00000020| 00 01 00 00 00 00 00 00 | 24 00 00 00 44 49 52 24 |........|$...DIR$|
|00000030| 4c 06 00 00 4c 06 00 00 | 78 06 00 00 46 ff ff ff |L...L...|x...F...|
|00000040| 70 2d 9f d0 21 04 00 00 | 13 00 00 00 00 00 00 00 |p-..!...|........|
|00000050| 21 52 6f 6f 74 00 00 00 | 9c 0a 00 00 46 ff ff ff |!Root...|....F...|
|00000060| 33 da 2c 82 d6 03 00 00 | 13 00 00 00 00 00 00 00 |3.,.....|........|
|00000070| 63 6f 6e 64 00 00 00 00 | 74 0e 00 00 46 ff ff ff |cond....|t...F...|
|00000080| 3d ec a9 79 e1 00 00 00 | 13 00 00 00 00 00 00 00 |=..y....|........|
|00000090| 4f 70 32 00 58 0f 00 00 | 46 ff ff ff ba c1 a9 79 |Op2.X...|F......y|
|000000a0| 8a 00 00 00 13 00 00 00 | 00 00 00 00 52 64 00 00 |........|....Rd..|
|000000b0| e4 0f 00 00 46 ff ff ff | 5b c5 a9 79 9b 00 00 00 |....F...|[..y....|
|000000c0| 13 00 00 00 00 00 00 00 | 52 6e 00 00 80 10 00 00 |........|Rn......|
|000000d0| 46 ff ff ff 27 03 aa 79 | db 00 00 00 13 00 00 00 |F...'..y|........|
|000000e0| 00 00 00 00 53 00 00 00 | 5c 11 00 00 46 ff ff ff |....S...|\...F...|
|000000f0| 0f cd a9 79 c2 01 00 00 | 13 00 00 00 00 00 00 00 |...y....|........|
|00000100| 53 68 69 66 74 00 00 00 | 20 13 00 00 46 ff ff ff |Shift...| ...F...|
|00000110| 21 fe 1a 76 59 03 00 00 | 13 00 00 00 00 00 00 00 |!..vY...|........|
|00000120| 41 44 43 00 7c 16 00 00 | 46 ff ff ff df 01 1b 76 |ADC.|...|F......v|
|00000130| 0e 02 00 00 13 00 00 00 | 00 00 00 00 41 44 44 00 |........|....ADD.|
|00000140| 8c 18 00 00 46 ff ff ff | c4 21 1b 76 10 03 00 00 |....F...|.!.v....|
|00000150| 13 00 00 00 00 00 00 00 | 52 53 42 00 9c 1b 00 00 |........|RSB.....|
|00000160| 46 ff ff ff af 6c 19 76 | e7 02 00 00 13 00 00 00 |F....l.v|........|
|00000170| 00 00 00 00 53 42 43 00 | 84 1e 00 00 46 ff ff ff |....SBC.|....F...|
|00000180| 9a 28 1b 76 fc 01 00 00 | 13 00 00 00 00 00 00 00 |.(.v....|........|
|00000190| 53 55 42 00 80 20 00 00 | 46 ff ff ff a0 24 1b 76 |SUB.. ..|F....$.v|
|000001a0| bd 02 00 00 13 00 00 00 | 00 00 00 00 52 53 43 00 |........|....RSC.|
|000001b0| 40 23 00 00 46 ff ff ff | bd 17 1b 76 4e 02 00 00 |@#..F...|...vN...|
|000001c0| 13 00 00 00 00 00 00 00 | 4d 4f 56 00 90 25 00 00 |........|MOV..%..|
|000001d0| 46 ff ff ff ba 1a 1b 76 | a6 02 00 00 13 00 00 00 |F......v|........|
|000001e0| 00 00 00 00 4d 56 4e 00 | 38 28 00 00 46 ff ff ff |....MVN.|8(..F...|
|000001f0| c6 49 19 76 b8 03 00 00 | 13 00 00 00 00 00 00 00 |.I.v....|........|
|00000200| 43 4d 50 00 f0 2b 00 00 | 46 ff ff ff cc 0e 1b 76 |CMP..+..|F......v|
|00000210| 18 03 00 00 13 00 00 00 | 00 00 00 00 43 4d 4e 00 |........|....CMN.|
|00000220| 08 2f 00 00 46 ff ff ff | 40 05 1b 76 17 02 00 00 |./..F...|@..v....|
|00000230| 13 00 00 00 00 00 00 00 | 41 4e 44 00 20 31 00 00 |........|AND. 1..|
|00000240| 46 ff ff ff 80 14 1b 76 | 44 02 00 00 13 00 00 00 |F......v|D.......|
|00000250| 00 00 00 00 45 4f 52 00 | 64 33 00 00 46 ff ff ff |....EOR.|d3..F...|
|00000260| 1f 1e 1b 76 72 02 00 00 | 13 00 00 00 00 00 00 00 |...vr...|........|
|00000270| 4f 52 52 00 d8 35 00 00 | 46 ff ff ff 63 0b 1b 76 |ORR..5..|F...c..v|
|00000280| 8a 03 00 00 13 00 00 00 | 00 00 00 00 42 49 43 00 |........|....BIC.|
|00000290| 64 39 00 00 46 ff ff ff | d2 f9 1a 76 6f 03 00 00 |d9..F...|...vo...|
|000002a0| 13 00 00 00 00 00 00 00 | 54 53 54 00 d4 3c 00 00 |........|TST..<..|
|000002b0| 46 ff ff ff d4 c3 1b 76 | 02 03 00 00 13 00 00 00 |F......v|........|
|000002c0| 00 00 00 00 54 45 51 00 | d8 3f 00 00 46 ff ff ff |....TEQ.|.?..F...|
|000002d0| 85 e0 1c 76 6b 03 00 00 | 13 00 00 00 00 00 00 00 |...vk...|........|
|000002e0| 4d 4c 41 00 44 43 00 00 | 46 ff ff ff df 04 1d 76 |MLA.DC..|F......v|
|000002f0| c0 02 00 00 13 00 00 00 | 00 00 00 00 4d 55 4c 00 |........|....MUL.|
|00000300| 04 46 00 00 46 ff ff ff | be b9 1d 76 b3 02 00 00 |.F..F...|...v....|
|00000310| 13 00 00 00 00 00 00 00 | 53 57 49 00 b8 48 00 00 |........|SWI..H..|
|00000320| 46 ff ff ff 51 59 93 76 | 47 02 00 00 13 00 00 00 |F...QY.v|G.......|
|00000330| 00 00 00 00 42 00 00 00 | 00 4b 00 00 46 ff ff ff |....B...|.K..F...|
|00000340| b8 87 c2 79 b6 04 00 00 | 13 00 00 00 00 00 00 00 |...y....|........|
|00000350| 42 4c 00 00 b8 4f 00 00 | 46 ff ff ff aa 8c b0 79 |BL...O..|F......y|
|00000360| fd 01 00 00 13 00 00 00 | 00 00 00 00 4c 44 52 00 |........|....LDR.|
|00000370| b8 51 00 00 46 ff ff ff | 1d 9a b0 79 05 02 00 00 |.Q..F...|...y....|
|00000380| 13 00 00 00 00 00 00 00 | 53 54 52 00 c0 53 00 00 |........|STR..S..|
|00000390| 46 ff ff ff 40 56 b0 79 | 36 01 00 00 13 00 00 00 |F...@V.y|6.......|
|000003a0| 00 00 00 00 42 79 74 65 | 00 00 00 00 f8 54 00 00 |....Byte|.....T..|
|000003b0| 46 ff ff ff 30 3f b1 79 | c3 02 00 00 13 00 00 00 |F...0?.y|........|
|000003c0| 00 00 00 00 50 43 5f 72 | 65 6c 00 00 bc 57 00 00 |....PC_r|el...W..|
|000003d0| 46 ff ff ff 64 bf af 79 | 63 03 00 00 13 00 00 00 |F...d..y|c.......|
|000003e0| 00 00 00 00 50 6f 73 74 | 00 00 00 00 20 5b 00 00 |....Post|.... [..|
|000003f0| 46 ff ff ff f6 62 ab 79 | 21 03 00 00 13 00 00 00 |F....b.y|!.......|
|00000400| 00 00 00 00 50 72 65 00 | 44 5e 00 00 46 ff ff ff |....Pre.|D^..F...|
|00000410| 09 1c af 79 52 04 00 00 | 13 00 00 00 00 00 00 00 |...yR...|........|
|00000420| 77 62 00 00 98 62 00 00 | 46 ff ff ff 34 48 bc 79 |wb...b..|F...4H.y|
|00000430| 81 05 00 00 13 00 00 00 | 00 00 00 00 4c 44 4d 00 |........|....LDM.|
|00000440| 1c 68 00 00 46 ff ff ff | 4f 43 bc 79 c5 05 00 00 |.h..F...|OC.y....|
|00000450| 13 00 00 00 00 00 00 00 | 53 54 4d 00 e4 6d 00 00 |........|STM..m..|
|00000460| 46 ff ff ff 58 2f bc 79 | 9a 05 00 00 13 00 00 00 |F...X/.y|........|
|00000470| 00 00 00 00 4d 5f 6f 70 | 74 73 00 00 80 73 00 00 |....M_op|ts...s..|
|00000480| 46 ff ff ff c9 a3 bd 79 | f1 04 00 00 13 00 00 00 |F......y|........|
|00000490| 00 00 00 00 4d 5f 77 62 | 00 00 00 00 74 78 00 00 |....M_wb|....tx..|
|000004a0| 46 ff ff ff 88 1c c0 79 | 86 08 00 00 13 00 00 00 |F......y|........|
|000004b0| 00 00 00 00 73 74 61 63 | 6b 73 00 00 fc 80 00 00 |....stac|ks......|
|000004c0| 46 ff ff ff a7 76 c1 79 | 78 05 00 00 13 00 00 00 |F....v.y|x.......|
|000004d0| 00 00 00 00 73 74 61 63 | 6b 73 32 00 74 86 00 00 |....stac|ks2.t...|
|000004e0| 46 ff ff ff 51 96 e4 79 | e7 02 00 00 13 00 00 00 |F...Q..y|........|
|000004f0| 00 00 00 00 45 51 55 00 | 5c 89 00 00 46 ff ff ff |....EQU.|\...F...|
|00000500| fa 78 e5 79 1b 01 00 00 | 13 00 00 00 00 00 00 00 |.x.y....|........|
|00000510| 4c 25 00 00 78 8a 00 00 | 46 ff ff ff 23 f4 e4 79 |L%..x...|F...#..y|
|00000520| 02 05 00 00 13 00 00 00 | 00 00 00 00 4f 50 54 00 |........|....OPT.|
|00000530| 7c 8f 00 00 46 ff ff ff | 03 54 e5 79 57 01 00 00 ||...F...|.T.yW...|
|00000540| 13 00 00 00 00 00 00 00 | 50 25 00 00 d4 90 00 00 |........|P%......|
|00000550| 46 ff ff ff 43 09 e6 79 | 30 03 00 00 13 00 00 00 |F...C..y|0.......|
|00000560| 00 00 00 00 52 65 73 65 | 72 76 65 00 04 94 00 00 |....Rese|rve.....|
|00000570| 46 ff ff ff 80 29 3c 7a | fd 01 00 00 13 00 00 00 |F....)<z|........|
|00000580| 00 00 00 00 41 44 52 00 | 04 96 00 00 46 ff ff ff |....ADR.|....F...|
|00000590| e4 62 3b 7a 5f 01 00 00 | 13 00 00 00 00 00 00 00 |.b;z_...|........|
|000005a0| 41 4c 49 47 4e 00 00 00 | 64 97 00 00 46 ff ff ff |ALIGN...|d...F...|
|000005b0| 28 b6 3c 7a 1d 02 00 00 | 13 00 00 00 00 00 00 00 |(.<z....|........|
|000005c0| 50 61 73 73 42 5f 4d 00 | 84 99 00 00 46 ff ff ff |PassB_M.|....F...|
|000005d0| c4 1b 3d 7a c1 01 00 00 | 13 00 00 00 00 00 00 00 |..=z....|........|
|000005e0| 75 73 72 00 48 9b 00 00 | 46 ff ff ff dd 4e 5b 7a |usr.H...|F....N[z|
|000005f0| d6 00 00 00 13 00 00 00 | 00 00 00 00 50 00 00 00 |........|....P...|
|00000600| 84 a8 00 00 47 ff ff ff | a7 4c 66 03 71 01 00 00 |....G...|.Lf.q...|
|00000610| 13 00 00 00 00 00 00 00 | 52 31 34 00 f8 a9 00 00 |........|R14.....|
|00000620| 47 ff ff ff 5d 6c 66 03 | 3e 01 00 00 13 00 00 00 |G...]lf.|>.......|
|00000630| 00 00 00 00 52 31 35 00 | b0 9e 00 00 46 ff ff ff |....R15.|....F...|
|00000640| 2c ed 75 7d 58 08 00 00 | 13 00 00 00 00 00 00 00 |,.u}X...|........|
|00000650| 43 41 4c 4c 00 00 00 00 | 08 a7 00 00 46 ff ff ff |CALL....|....F...|
|00000660| 76 23 a0 d0 7a 01 00 00 | 13 00 00 00 00 00 00 00 |v#..z...|........|
|00000670| 43 72 65 64 69 74 73 00 | 44 41 54 41 21 04 00 00 |Credits.|DATA!...|
|00000680| 41 73 73 65 6d 62 6c 79 | 0a 23 62 61 63 6b 67 72 |Assembly|.#backgr|
|00000690| 6f 75 6e 64 20 77 69 6d | 70 20 31 0a 23 77 72 61 |ound wim|p 1.#wra|
|000006a0| 70 20 6f 66 66 0a 23 61 | 6c 69 67 6e 20 63 65 6e |p off.#a|lign cen|
|000006b0| 74 72 65 0a 2a 41 52 4d | 20 49 6e 73 74 72 75 63 |tre.*ARM| Instruc|
|000006c0| 74 69 6f 6e 73 2a 0a 23 | 61 6c 69 67 6e 0a 23 74 |tions*.#|align.#t|
|000006d0| 61 62 0a 3c 41 44 43 3e | 09 41 64 64 20 77 69 74 |ab.<ADC>|.Add wit|
|000006e0| 68 20 43 61 72 72 79 09 | 09 3c 4d 55 4c 3e 09 4d |h Carry.|.<MUL>.M|
|000006f0| 75 6c 74 69 70 6c 79 0a | 3c 41 44 44 3e 09 41 64 |ultiply.|<ADD>.Ad|
|00000700| 64 09 09 09 3c 4d 56 4e | 3e 09 4d 6f 76 65 20 4e |d...<MVN|>.Move N|
|00000710| 65 67 61 74 69 76 65 0a | 3c 41 4e 44 3e 09 41 6e |egative.|<AND>.An|
|00000720| 64 09 09 09 3c 4f 52 52 | 3e 09 49 6e 63 6c 75 73 |d...<ORR|>.Inclus|
|00000730| 69 76 65 20 4f 52 0a 3c | 42 3e 09 42 72 61 6e 63 |ive OR.<|B>.Branc|
|00000740| 68 09 09 09 3c 52 53 42 | 3e 09 52 65 76 65 72 73 |h...<RSB|>.Revers|
|00000750| 65 20 53 75 62 74 72 61 | 63 74 0a 3c 42 49 43 3e |e Subtra|ct.<BIC>|
|00000760| 09 42 69 74 20 43 6c 65 | 61 72 09 09 3c 52 53 43 |.Bit Cle|ar..<RSC|
|00000770| 3e 09 52 65 76 65 72 73 | 65 20 53 75 62 74 72 61 |>.Revers|e Subtra|
|00000780| 63 74 20 77 69 74 68 20 | 43 61 72 72 79 0a 3c 42 |ct with |Carry.<B|
|00000790| 4c 3e 09 42 72 61 6e 63 | 68 20 77 69 74 68 20 4c |L>.Branc|h with L|
|000007a0| 69 6e 6b 09 3c 53 42 43 | 3e 09 53 75 62 74 72 61 |ink.<SBC|>.Subtra|
|000007b0| 63 74 20 77 69 74 68 20 | 43 61 72 72 79 0a 3c 43 |ct with |Carry.<C|
|000007c0| 4d 4e 3e 09 43 6f 6d 70 | 61 72 65 20 4e 65 67 61 |MN>.Comp|are Nega|
|000007d0| 74 69 76 65 09 3c 53 54 | 4d 3e 09 53 74 6f 72 65 |tive.<ST|M>.Store|
|000007e0| 20 4d 75 6c 74 69 70 6c | 65 0a 3c 43 4d 50 3e 09 | Multipl|e.<CMP>.|
|000007f0| 43 6f 6d 70 61 72 65 09 | 09 09 3c 53 54 52 3e 09 |Compare.|..<STR>.|
|00000800| 53 74 6f 72 65 20 52 65 | 67 69 73 74 65 72 0a 3c |Store Re|gister.<|
|00000810| 45 4f 52 3e 09 45 78 63 | 6c 75 73 69 76 65 20 4f |EOR>.Exc|lusive O|
|00000820| 52 09 09 3c 53 55 42 3e | 09 53 75 62 74 72 61 63 |R..<SUB>|.Subtrac|
|00000830| 74 0a 3c 4c 44 4d 3e 09 | 4c 6f 61 64 20 4d 75 6c |t.<LDM>.|Load Mul|
|00000840| 74 69 70 6c 65 09 09 3c | 53 57 49 3e 09 53 6f 66 |tiple..<|SWI>.Sof|
|00000850| 74 77 61 72 65 20 49 6e | 74 65 72 72 75 70 74 0a |tware In|terrupt.|
|00000860| 3c 4c 44 52 3e 09 4c 6f | 61 64 20 52 65 67 69 73 |<LDR>.Lo|ad Regis|
|00000870| 74 65 72 09 09 3c 54 45 | 51 3e 09 54 65 73 74 20 |ter..<TE|Q>.Test |
|00000880| 66 6f 72 20 45 71 75 61 | 6c 69 74 79 0a 3c 4d 4c |for Equa|lity.<ML|
|00000890| 41 3e 09 4d 75 6c 74 69 | 70 6c 79 20 77 69 74 68 |A>.Multi|ply with|
|000008a0| 20 41 63 63 75 6d 75 6c | 61 74 65 09 3c 54 53 54 | Accumul|ate.<TST|
|000008b0| 3e 09 54 65 73 74 20 4d | 61 73 6b 65 64 09 0a 3c |>.Test M|asked..<|
|000008c0| 4d 4f 56 3e 09 4d 6f 76 | 65 09 09 09 0a 23 74 61 |MOV>.Mov|e....#ta|
|000008d0| 62 0a 23 6c 69 6e 65 0a | 23 61 6c 69 67 6e 20 63 |b.#line.|#align c|
|000008e0| 65 6e 74 72 65 0a 2a 52 | 65 67 69 73 74 65 72 73 |entre.*R|egisters|
|000008f0| 2a 2c 20 2a 49 6e 74 65 | 67 65 72 20 56 61 72 69 |*, *Inte|ger Vari|
|00000900| 61 62 6c 65 73 20 61 6e | 64 20 53 75 66 66 69 78 |ables an|d Suffix|
|00000910| 65 73 2a 0a 3c 43 6f 6e | 64 69 74 69 6f 6e 20 63 |es*.<Con|dition c|
|00000920| 6f 64 65 73 3d 3e 63 6f | 6e 64 3e 20 20 20 20 3c |odes=>co|nd> <|
|00000930| 20 52 64 20 3e 20 20 20 | 20 3c 20 52 6e 20 3e 20 | Rd > | < Rn > |
|00000940| 20 20 20 3c 20 4f 70 32 | 20 3e 20 20 20 20 3c 52 | < Op2| > <R|
|00000950| 31 34 3e 20 20 20 20 3c | 52 31 35 3e 0a 3c 50 25 |14> <|R15>.<P%|
|00000960| 3e 20 20 20 20 3c 4c 25 | 3e 20 20 20 20 3c 20 53 |> <L%|> < S|
|00000970| 20 3e 20 20 20 20 3c 20 | 42 20 3d 3e 42 79 74 65 | > < |B =>Byte|
|00000980| 3e 20 20 20 20 3c 20 50 | 20 3e 0a 23 6c 69 6e 65 |> < P| >.#line|
|00000990| 0a 2a 50 73 65 75 64 6f | 20 6f 70 63 6f 64 65 73 |.*Pseudo| opcodes|
|000009a0| 2a 2c 20 2a 41 73 73 65 | 6d 62 6c 65 72 20 64 69 |*, *Asse|mbler di|
|000009b0| 72 65 63 74 69 76 65 73 | 20 61 6e 64 20 43 41 4c |rectives| and CAL|
|000009c0| 4c 2a 0a 3c 4f 50 54 3e | 20 20 20 20 3c 45 51 55 |L*.<OPT>| <EQU|
|000009d0| 3e 20 20 20 20 3c 41 4c | 49 47 4e 3e 20 20 20 20 |> <AL|IGN> |
|000009e0| 3c 41 44 52 3e 20 20 20 | 20 3c 43 41 4c 4c 3e 0a |<ADR> | <CALL>.|
|000009f0| 23 6c 69 6e 65 0a 2a 4d | 69 73 63 65 6c 6c 61 6e |#line.*M|iscellan|
|00000a00| 65 6f 75 73 2a 0a 3c 52 | 65 73 65 72 76 69 6e 67 |eous*.<R|eserving|
|00000a10| 20 6d 65 6d 6f 72 79 3d | 3e 52 65 73 65 72 76 65 | memory=|>Reserve|
|00000a20| 3e 0a 3c 50 61 73 73 69 | 6e 67 20 64 61 74 61 20 |>.<Passi|ng data |
|00000a30| 74 6f 20 6d 61 63 68 69 | 6e 65 20 63 6f 64 65 20 |to machi|ne code |
|00000a40| 72 6f 75 74 69 6e 65 73 | 3d 3e 50 61 73 73 42 5f |routines|=>PassB_|
|00000a50| 4d 3e 0a 3c 52 65 74 75 | 72 6e 69 6e 67 20 64 61 |M>.<Retu|rning da|
|00000a60| 74 61 20 74 6f 20 42 41 | 53 49 43 3d 3e 75 73 72 |ta to BA|SIC=>usr|
|00000a70| 3e 0a 23 6c 69 6e 65 0a | 3c 43 72 65 64 69 74 73 |>.#line.|<Credits|
|00000a80| 20 61 6e 64 20 43 6f 70 | 79 72 69 67 68 74 3d 3e | and Cop|yright=>|
|00000a90| 43 72 65 64 69 74 73 3e | 0a 00 00 00 44 41 54 41 |Credits>|....DATA|
|00000aa0| d6 03 00 00 43 6f 6e 64 | 69 74 69 6f 6e 20 63 6f |....Cond|ition co|
|00000ab0| 64 65 73 0a 23 62 61 63 | 6b 67 72 6f 75 6e 64 20 |des.#bac|kground |
|00000ac0| 77 69 6d 70 20 31 0a 41 | 6c 6c 20 69 6e 73 74 72 |wimp 1.A|ll instr|
|00000ad0| 75 63 74 69 6f 6e 73 20 | 61 72 65 20 63 6f 6e 64 |uctions |are cond|
|00000ae0| 69 74 69 6f 6e 61 6c 6c | 79 20 65 78 65 63 75 74 |itionall|y execut|
|00000af0| 65 64 2e 20 49 66 20 74 | 68 65 20 63 6f 6e 64 69 |ed. If t|he condi|
|00000b00| 74 69 6f 6e 20 69 6e 20 | 74 68 65 20 74 6f 70 20 |tion in |the top |
|00000b10| 66 6f 75 72 20 62 69 74 | 73 20 6f 66 20 74 68 65 |four bit|s of the|
|00000b20| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 69 73 20 | instruc|tion is |
|00000b30| 6e 6f 74 20 6d 65 74 2c | 20 74 68 65 6e 20 65 76 |not met,| then ev|
|00000b40| 65 6e 20 69 6c 6c 65 67 | 61 6c 20 69 6e 73 74 72 |en illeg|al instr|
|00000b50| 75 63 74 69 6f 6e 73 20 | 77 69 6c 6c 20 68 61 76 |uctions |will hav|
|00000b60| 65 20 6e 6f 20 65 66 66 | 65 63 74 2e 2e 2e 0a 0a |e no eff|ect.....|
|00000b70| 23 77 72 61 70 20 6f 66 | 66 3b 20 74 61 62 0a 43 |#wrap of|f; tab.C|
|00000b80| 6f 6e 64 69 74 69 6f 6e | 20 66 69 65 6c 64 09 20 |ondition| field. |
|00000b90| 09 20 09 45 78 65 63 75 | 74 65 20 49 46 0a 23 4c |. .Execu|te IF.#L|
|00000ba0| 69 6e 65 0a 20 20 30 30 | 30 30 09 45 51 09 3a 09 |ine. 00|00.EQ.:.|
|00000bb0| 20 5a 09 09 28 65 71 75 | 61 6c 29 0a 20 20 30 30 | Z..(equ|al). 00|
|00000bc0| 30 31 09 4e 45 09 3a 09 | 7e 5a 09 09 28 6e 6f 74 |01.NE.:.|~Z..(not|
|00000bd0| 20 65 71 75 61 6c 29 0a | 20 20 30 30 31 30 09 43 | equal).| 0010.C|
|00000be0| 53 09 3a 09 20 43 09 09 | 28 75 6e 73 69 67 6e 65 |S.:. C..|(unsigne|
|00000bf0| 64 20 68 69 67 68 65 72 | 20 6f 72 20 73 61 6d 65 |d higher| or same|
|00000c00| 29 0a 20 20 30 30 31 31 | 09 43 43 09 3a 09 7e 43 |). 0011|.CC.:.~C|
|00000c10| 09 09 28 75 6e 73 69 67 | 6e 65 64 20 6c 6f 77 65 |..(unsig|ned lowe|
|00000c20| 72 29 0a 20 20 30 31 30 | 30 09 4d 49 09 3a 09 20 |r). 010|0.MI.:. |
|00000c30| 4e 09 09 28 6e 65 67 61 | 74 69 76 65 29 0a 20 20 |N..(nega|tive). |
|00000c40| 30 31 30 31 09 50 4c 09 | 3a 09 7e 4e 09 09 28 70 |0101.PL.|:.~N..(p|
|00000c50| 6f 73 69 74 69 76 65 20 | 6f 72 20 7a 65 72 6f 29 |ositive |or zero)|
|00000c60| 0a 20 20 30 31 31 30 09 | 56 53 09 3a 09 20 56 09 |. 0110.|VS.:. V.|
|00000c70| 09 28 6f 76 65 72 66 6c | 6f 77 29 0a 20 20 30 31 |.(overfl|ow). 01|
|00000c80| 31 31 09 56 43 09 3a 09 | 7e 56 09 09 28 6e 6f 20 |11.VC.:.|~V..(no |
|00000c90| 6f 76 65 72 66 6c 6f 77 | 29 0a 20 20 31 30 30 30 |overflow|). 1000|
|00000ca0| 09 48 49 09 3a 09 20 43 | 20 61 6e 64 20 7e 5a 09 |.HI.:. C| and ~Z.|
|00000cb0| 28 75 6e 73 69 67 6e 65 | 64 20 68 69 67 68 65 72 |(unsigne|d higher|
|00000cc0| 29 0a 20 20 31 30 30 31 | 09 4c 53 09 3a 09 7e 43 |). 1001|.LS.:.~C|
|00000cd0| 20 6f 72 20 5a 09 09 28 | 75 6e 73 69 67 6e 65 64 | or Z..(|unsigned|
|00000ce0| 20 6c 6f 77 65 72 20 6f | 72 20 73 61 6d 65 29 0a | lower o|r same).|
|00000cf0| 20 20 31 30 31 30 09 47 | 45 09 3a 09 20 4e 20 3d | 1010.G|E.:. N =|
|00000d00| 20 56 09 09 28 73 69 67 | 6e 65 64 20 68 69 67 68 | V..(sig|ned high|
|00000d10| 65 72 20 6f 72 20 73 61 | 6d 65 29 0a 20 20 31 30 |er or sa|me). 10|
|00000d20| 31 31 09 4c 54 09 3a 09 | 20 4e 20 5c 3c 5c 3e 20 |11.LT.:.| N \<\> |
|00000d30| 56 09 28 73 69 67 6e 65 | 64 20 6c 6f 77 65 72 29 |V.(signe|d lower)|
|00000d40| 0a 20 20 31 31 30 30 09 | 47 54 09 3a 09 7e 5a 20 |. 1100.|GT.:.~Z |
|00000d50| 61 6e 64 20 28 4e 20 3d | 20 56 29 09 28 73 69 67 |and (N =| V).(sig|
|00000d60| 6e 65 64 20 68 69 67 68 | 65 72 29 0a 20 20 31 31 |ned high|er). 11|
|00000d70| 30 31 09 4c 45 09 3a 09 | 20 5a 20 6f 72 20 28 4e |01.LE.:.| Z or (N|
|00000d80| 20 5c 3c 5c 3e 20 56 29 | 09 28 73 69 67 6e 65 64 | \<\> V)|.(signed|
|00000d90| 20 6c 6f 77 65 72 20 6f | 72 20 73 61 6d 65 29 0a | lower o|r same).|
|00000da0| 20 20 31 31 31 30 09 41 | 4c 09 3a 09 20 31 09 09 | 1110.A|L.:. 1..|
|00000db0| 28 61 6c 77 61 79 73 29 | 0a 20 20 31 31 31 31 09 |(always)|. 1111.|
|00000dc0| 4e 56 09 3a 09 20 30 09 | 09 28 6e 65 76 65 72 29 |NV.:. 0.|.(never)|
|00000dd0| 0a 23 74 61 62 3b 20 77 | 72 61 70 20 6e 6f 6a 6f |.#tab; w|rap nojo|
|00000de0| 69 6e 0a 0a 28 20 31 20 | 69 73 20 74 72 75 65 2c |in..( 1 |is true,|
|00000df0| 20 30 20 69 73 20 66 61 | 6c 73 65 2c 20 7e 20 69 | 0 is fa|lse, ~ i|
|00000e00| 73 20 4e 4f 54 20 29 0a | 0a 4e 6f 74 65 3a 20 54 |s NOT ).|.Note: T|
|00000e10| 68 65 20 4e 56 20 63 6f | 64 65 20 73 68 6f 75 6c |he NV co|de shoul|
|00000e20| 64 6e 27 74 20 62 65 20 | 75 73 65 64 20 61 6e 79 |dn't be |used any|
|00000e30| 6d 6f 72 65 2e 20 49 66 | 20 79 6f 75 20 77 61 6e |more. If| you wan|
|00000e40| 74 20 61 20 6e 6f 2d 6f | 70 2c 20 79 6f 75 20 73 |t a no-o|p, you s|
|00000e50| 68 6f 75 6c 64 20 75 73 | 65 20 73 6f 6d 65 74 68 |hould us|e someth|
|00000e60| 69 6e 67 20 6c 69 6b 65 | 20 4d 4f 56 20 52 30 2c |ing like| MOV R0,|
|00000e70| 52 30 00 00 44 41 54 41 | e1 00 00 00 4f 70 32 0a |R0..DATA|....Op2.|
|00000e80| 23 62 61 63 6b 67 72 6f | 75 6e 64 20 77 69 6d 70 |#backgro|und wimp|
|00000e90| 20 31 0a 23 77 72 61 70 | 20 6f 66 66 0a 54 68 69 | 1.#wrap| off.Thi|
|00000ea0| 73 20 63 61 6e 20 74 61 | 6b 65 20 73 65 76 65 72 |s can ta|ke sever|
|00000eb0| 61 6c 20 66 6f 72 6d 73 | 20 3a 0a 20 20 20 2d 09 |al forms| :. -.|
|00000ec0| 52 65 67 0a 20 20 20 2d | 09 52 65 67 20 3c 73 68 |Reg. -|.Reg <sh|
|00000ed0| 69 66 74 3e 20 23 63 6f | 6e 73 74 61 6e 74 0a 20 |ift> #co|nstant. |
|00000ee0| 20 20 2d 09 52 65 67 20 | 3c 73 68 69 66 74 3e 20 | -.Reg |<shift> |
|00000ef0| 52 65 67 0a 09 28 4e 6f | 74 65 3a 20 54 68 69 73 |Reg..(No|te: This|
|00000f00| 20 74 61 6b 65 73 20 61 | 6e 20 65 78 74 72 61 20 | takes a|n extra |
|00000f10| 63 6c 6f 63 6b 20 63 79 | 63 6c 65 29 0a 20 20 20 |clock cy|cle). |
|00000f20| 2d 09 23 63 6f 6e 73 74 | 61 6e 74 0a 09 28 20 6f |-.#const|ant..( o|
|00000f30| 66 20 74 68 65 20 66 6f | 72 6d 20 42 79 74 65 20 |f the fo|rm Byte |
|00000f40| 52 4f 52 20 6e 2a 32 2c | 20 6e 20 69 73 20 30 2e |ROR n*2,| n is 0.|
|00000f50| 2e 31 35 20 29 00 00 00 | 44 41 54 41 8a 00 00 00 |.15 )...|DATA....|
|00000f60| 52 64 0a 23 62 61 63 6b | 67 72 6f 75 6e 64 20 77 |Rd.#back|ground w|
|00000f70| 69 6d 70 20 31 0a 52 64 | 20 63 61 6e 20 62 65 20 |imp 1.Rd| can be |
|00000f80| 61 6e 79 20 6f 66 20 74 | 68 65 20 72 65 67 69 73 |any of t|he regis|
|00000f90| 74 65 72 73 20 66 72 6f | 6d 20 52 30 20 74 6f 20 |ters fro|m R0 to |
|00000fa0| 52 31 35 2e 20 49 66 20 | 52 64 20 3d 20 52 31 35 |R15. If |Rd = R15|
|00000fb0| 20 74 68 65 6e 20 6f 6e | 6c 79 20 74 68 65 20 50 | then on|ly the P|
|00000fc0| 43 20 62 69 74 73 20 77 | 69 6c 6c 20 62 65 20 73 |C bits w|ill be s|
|00000fd0| 65 74 2c 20 6e 6f 74 20 | 74 68 65 20 66 6c 61 67 |et, not |the flag|
|00000fe0| 73 2e 00 00 44 41 54 41 | 9b 00 00 00 52 6e 0a 23 |s...DATA|....Rn.#|
|00000ff0| 62 61 63 6b 67 72 6f 75 | 6e 64 20 77 69 6d 70 20 |backgrou|nd wimp |
|00001000| 31 0a 52 6e 20 63 61 6e | 20 62 65 20 61 6e 79 20 |1.Rn can| be any |
|00001010| 6f 66 20 74 68 65 20 72 | 65 67 69 73 74 65 72 73 |of the r|egisters|
|00001020| 20 66 72 6f 6d 20 52 30 | 20 74 6f 20 52 31 35 2e | from R0| to R15.|
|00001030| 20 49 66 20 52 6e 20 3d | 20 52 31 35 20 74 68 65 | If Rn =| R15 the|
|00001040| 6e 20 6f 6e 6c 79 20 74 | 68 65 20 50 43 20 62 69 |n only t|he PC bi|
|00001050| 74 73 20 61 72 65 20 75 | 73 65 64 2e 20 54 68 65 |ts are u|sed. The|
|00001060| 20 66 6c 61 67 20 62 69 | 74 73 20 77 69 6c 6c 20 | flag bi|ts will |
|00001070| 61 70 70 65 61 72 20 63 | 6c 65 61 72 65 64 2e 00 |appear c|leared..|
|00001080| 44 41 54 41 db 00 00 00 | 54 68 65 20 53 74 61 74 |DATA....|The Stat|
|00001090| 75 73 20 66 6c 61 67 0a | 23 62 61 63 6b 67 72 6f |us flag.|#backgro|
|000010a0| 75 6e 64 20 77 69 6d 70 | 20 31 0a 46 6c 61 67 73 |und wimp| 1.Flags|
|000010b0| 20 77 69 6c 6c 20 6f 6e | 6c 79 20 62 65 20 75 70 | will on|ly be up|
|000010c0| 64 61 74 65 64 20 69 66 | 20 74 68 69 73 20 69 73 |dated if| this is|
|000010d0| 20 70 72 65 73 65 6e 74 | 2e 20 54 68 65 20 53 20 | present|. The S |
|000010e0| 66 6c 61 67 20 69 73 20 | 69 6d 70 6c 69 63 69 74 |flag is |implicit|
|000010f0| 20 69 6e 20 43 4d 50 2c | 20 43 4d 4e 2c 20 54 45 | in CMP,| CMN, TE|
|00001100| 51 20 61 6e 64 20 54 53 | 54 0a 23 77 72 61 70 20 |Q and TS|T.#wrap |
|00001110| 6f 66 66 0a 0a 20 20 53 | 55 42 53 20 52 31 2c 52 |off.. S|UBS R1,R|
|00001120| 31 2c 52 32 09 09 3b 0a | 20 20 41 44 44 20 20 52 |1,R2..;.| ADD R|
|00001130| 31 2c 52 31 2c 52 33 09 | 09 3b 20 0a 20 20 42 65 |1,R1,R3.|.; . Be|
|00001140| 71 20 20 78 78 78 09 09 | 3b 20 6a 75 6d 70 20 69 |q xxx..|; jump i|
|00001150| 66 20 52 31 2d 52 32 20 | 3d 20 30 00 44 41 54 41 |f R1-R2 |= 0.DATA|
|00001160| c2 01 00 00 53 68 69 66 | 74 0a 23 62 61 63 6b 67 |....Shif|t.#backg|
|00001170| 72 6f 75 6e 64 20 77 69 | 6d 70 20 31 0a 54 68 65 |round wi|mp 1.The|
|00001180| 20 73 68 69 66 74 20 74 | 79 70 65 73 20 61 72 65 | shift t|ypes are|
|00001190| 20 3a 0a 20 20 4c 53 4c | 09 4c 6f 67 69 63 61 6c | :. LSL|.Logical|
|000011a0| 20 53 68 69 66 74 20 4c | 65 66 74 20 28 2a 32 29 | Shift L|eft (*2)|
|000011b0| 0a 20 20 4c 53 52 09 4c | 6f 67 69 63 61 6c 20 53 |. LSR.L|ogical S|
|000011c0| 68 69 66 74 20 52 69 67 | 68 74 20 28 2f 32 29 0a |hift Rig|ht (/2).|
|000011d0| 20 20 41 53 52 09 41 72 | 69 74 68 6d 65 74 69 63 | ASR.Ar|ithmetic|
|000011e0| 20 53 68 69 66 74 20 52 | 69 67 68 74 20 28 2f 32 | Shift R|ight (/2|
|000011f0| 29 0a 20 20 52 4f 52 09 | 52 4f 74 61 74 65 20 52 |). ROR.|ROtate R|
|00001200| 69 67 68 74 0a 20 20 52 | 52 58 09 52 6f 74 61 74 |ight. R|RX.Rotat|
|00001210| 65 20 52 69 67 68 74 20 | 65 58 74 65 6e 64 65 64 |e Right |eXtended|
|00001220| 0a 0a 49 6e 20 61 6c 6c | 20 63 61 73 65 73 2c 20 |..In all| cases, |
|00001230| 74 68 65 20 62 69 74 20 | 6c 6f 73 74 20 66 72 6f |the bit |lost fro|
|00001240| 6d 20 74 68 65 20 65 6e | 64 20 69 73 20 73 68 69 |m the en|d is shi|
|00001250| 66 74 65 64 20 69 6e 74 | 6f 20 74 68 65 20 63 61 |fted int|o the ca|
|00001260| 72 72 79 20 66 6c 61 67 | 2e 20 49 6e 20 41 53 52 |rry flag|. In ASR|
|00001270| 2c 20 74 68 65 20 61 72 | 69 74 68 6d 65 74 69 63 |, the ar|ithmetic|
|00001280| 20 73 69 67 6e 20 6f 66 | 20 74 68 65 20 6e 75 6d | sign of| the num|
|00001290| 62 65 72 20 69 73 20 70 | 72 65 73 65 72 76 65 64 |ber is p|reserved|
|000012a0| 20 28 2b 76 65 2f 2d 76 | 65 29 2e 20 49 6e 20 52 | (+ve/-v|e). In R|
|000012b0| 4f 52 2c 20 74 68 65 20 | 62 69 74 20 6c 6f 73 74 |OR, the |bit lost|
|000012c0| 20 69 73 20 61 6c 73 6f | 20 63 6f 70 69 65 64 20 | is also| copied |
|000012d0| 62 61 63 6b 20 74 6f 20 | 62 69 74 20 33 31 2e 20 |back to |bit 31. |
|000012e0| 52 52 58 20 69 73 20 73 | 69 6d 69 6c 61 72 2c 20 |RRX is s|imilar, |
|000012f0| 62 75 74 20 74 68 69 73 | 20 74 69 6d 65 20 74 68 |but this| time th|
|00001300| 65 20 63 61 72 72 79 20 | 66 6c 61 67 20 61 63 74 |e carry |flag act|
|00001310| 73 20 61 73 20 27 62 69 | 74 20 33 32 27 2e 00 00 |s as 'bi|t 32'...|
|00001320| 44 41 54 41 59 03 00 00 | 41 44 43 3a 20 41 64 64 |DATAY...|ADC: Add|
|00001330| 20 77 69 74 68 20 43 61 | 72 72 79 0a 23 62 61 63 | with Ca|rry.#bac|
|00001340| 6b 67 72 6f 75 6e 64 20 | 77 69 6d 70 20 31 0a 23 |kground |wimp 1.#|
|00001350| 77 72 61 70 20 6f 66 66 | 0a 53 79 6e 74 61 78 3a |wrap off|.Syntax:|
|00001360| 20 41 44 43 20 5c 7b 5c | 3c 73 75 66 66 69 78 5c | ADC \{\|<suffix\|
|00001370| 3e 5c 7d 20 5c 3c 64 65 | 73 74 69 6e 61 74 69 6f |>\} \<de|stinatio|
|00001380| 6e 5c 3e 2c 20 5c 3c 6f | 70 65 72 61 6e 64 31 5c |n\>, \<o|perand1\|
|00001390| 3e 2c 20 5c 3c 6f 70 65 | 72 61 6e 64 32 5c 3e 0a |>, \<ope|rand2\>.|
|000013a0| 4f 70 65 72 61 74 69 6f | 6e 3a 20 64 65 73 74 69 |Operatio|n: desti|
|000013b0| 6e 61 74 69 6f 6e 20 3d | 20 6f 70 65 72 61 6e 64 |nation =| operand|
|000013c0| 20 6f 6e 65 20 2b 20 6f | 70 65 72 61 6e 64 20 74 | one + o|perand t|
|000013d0| 77 6f 20 2b 20 63 61 72 | 72 79 0a 46 6c 61 67 73 |wo + car|ry.Flags|
|000013e0| 3a 20 4e 2c 5a 2c 43 2c | 56 0a 23 77 72 61 70 20 |: N,Z,C,|V.#wrap |
|000013f0| 6f 6e 0a 23 6c 69 6e 65 | 0a 54 68 69 73 20 6f 70 |on.#line|.This op|
|00001400| 65 72 61 74 69 6f 6e 20 | 70 65 72 66 6f 72 6d 73 |eration |performs|
|00001410| 20 74 68 65 20 61 72 69 | 74 68 6d 65 74 69 63 20 | the ari|thmetic |
|00001420| 61 64 64 69 74 69 6f 6e | 20 6f 66 20 69 74 73 20 |addition| of its |
|00001430| 74 77 6f 20 6f 70 65 72 | 61 6e 64 73 2c 20 61 6c |two oper|ands, al|
|00001440| 73 6f 20 61 64 64 69 6e | 67 20 74 68 65 20 63 61 |so addin|g the ca|
|00001450| 72 72 79 20 66 6c 61 67 | 2e 20 49 66 20 73 65 74 |rry flag|. If set|
|00001460| 2c 20 74 68 65 20 63 61 | 72 72 79 20 66 6c 61 67 |, the ca|rry flag|
|00001470| 20 69 74 20 69 73 20 74 | 72 65 61 74 65 64 20 61 | it is t|reated a|
|00001480| 73 20 6f 6e 65 20 69 6e | 20 74 68 65 20 61 64 64 |s one in| the add|
|00001490| 69 74 69 6f 6e 2e 20 28 | 4f 74 68 65 72 77 69 73 |ition. (|Otherwis|
|000014a0| 65 2c 20 61 73 20 7a 65 | 72 6f 29 2e 20 54 68 65 |e, as ze|ro). The|
|000014b0| 20 72 65 73 75 6c 74 20 | 69 73 20 73 74 6f 72 65 | result |is store|
|000014c0| 64 20 69 6e 20 74 68 65 | 20 64 65 73 74 69 6e 61 |d in the| destina|
|000014d0| 74 69 6f 6e 20 72 65 67 | 69 73 74 65 72 2e 0a 23 |tion reg|ister..#|
|000014e0| 6c 69 6e 65 0a 41 44 43 | 20 61 6c 6c 6f 77 73 20 |line.ADC| allows |
|000014f0| 75 73 20 74 6f 20 61 64 | 64 20 74 6f 67 65 74 68 |us to ad|d togeth|
|00001500| 65 72 20 6e 75 6d 62 65 | 72 73 20 77 68 69 63 68 |er numbe|rs which|
|00001510| 20 72 65 71 75 69 72 65 | 20 6d 6f 72 65 20 74 68 | require| more th|
|00001520| 61 6e 20 61 20 73 69 6e | 67 6c 65 20 77 6f 72 64 |an a sin|gle word|
|00001530| 20 74 6f 20 72 65 70 72 | 65 73 65 6e 74 20 74 68 | to repr|esent th|
|00001540| 65 6d 2e 20 65 2e 67 2e | 0a 23 74 61 62 0a 23 69 |em. e.g.|.#tab.#i|
|00001550| 6e 64 65 6e 74 20 32 0a | 41 44 44 53 20 72 65 73 |ndent 2.|ADDS res|
|00001560| 75 6c 74 5f 6c 6f 77 2c | 20 6c 6f 77 31 2c 20 6c |ult_low,| low1, l|
|00001570| 6f 77 32 09 41 64 64 20 | 6c 6f 77 20 77 6f 72 64 |ow2.Add |low word|
|00001580| 73 0a 41 44 43 53 20 72 | 65 73 75 6c 74 5f 68 69 |s.ADCS r|esult_hi|
|00001590| 67 68 2c 20 68 69 67 68 | 31 2c 20 68 69 67 68 32 |gh, high|1, high2|
|000015a0| 09 41 64 64 20 68 69 67 | 68 20 77 6f 72 64 73 20 |.Add hig|h words |
|000015b0| 2b 20 63 61 72 72 79 0a | 23 69 6e 64 65 6e 74 0a |+ carry.|#indent.|
|000015c0| 23 74 61 62 0a 2a 4e 6f | 74 65 2a 3a 20 49 74 20 |#tab.*No|te*: It |
|000015d0| 69 73 20 76 69 74 61 6c | 20 74 68 61 74 20 74 68 |is vital| that th|
|000015e0| 65 20 53 20 73 75 66 66 | 69 78 20 69 73 20 75 73 |e S suff|ix is us|
|000015f0| 65 64 20 77 69 74 68 20 | 74 68 65 73 65 20 69 6e |ed with |these in|
|00001600| 73 74 72 75 63 74 69 6f | 6e 73 2c 20 6f 74 68 65 |structio|ns, othe|
|00001610| 72 77 69 73 65 20 74 68 | 65 20 63 61 72 72 79 20 |rwise th|e carry |
|00001620| 66 6c 61 67 20 73 65 74 | 74 69 6e 67 20 77 69 6c |flag set|ting wil|
|00001630| 6c 20 6e 6f 74 20 62 65 | 20 61 66 66 65 63 74 65 |l not be| affecte|
|00001640| 64 20 61 6e 64 20 77 69 | 6c 6c 20 6e 6f 74 20 62 |d and wi|ll not b|
|00001650| 65 20 63 61 72 72 69 65 | 64 20 66 6f 72 77 61 72 |e carrie|d forwar|
|00001660| 64 20 69 6e 74 6f 20 74 | 68 65 20 6e 65 78 74 20 |d into t|he next |
|00001670| 61 64 64 69 74 69 6f 6e | 2e 00 00 00 44 41 54 41 |addition|....DATA|
|00001680| 0e 02 00 00 41 44 44 3a | 20 41 64 64 0a 23 62 61 |....ADD:| Add.#ba|
|00001690| 63 6b 67 72 6f 75 6e 64 | 20 77 69 6d 70 20 31 0a |ckground| wimp 1.|
|000016a0| 23 77 72 61 70 20 6f 66 | 66 0a 53 79 6e 74 61 78 |#wrap of|f.Syntax|
|000016b0| 3a 20 41 44 44 20 5c 7b | 5c 3c 73 75 66 66 69 78 |: ADD \{|\<suffix|
|000016c0| 5c 3e 5c 7d 20 5c 3c 64 | 65 73 74 69 6e 61 74 69 |\>\} \<d|estinati|
|000016d0| 6f 6e 5c 3e 2c 20 5c 3c | 6f 70 65 72 61 6e 64 31 |on\>, \<|operand1|
|000016e0| 5c 3e 2c 20 5c 3c 6f 70 | 65 72 61 6e 64 32 5c 3e |\>, \<op|erand2\>|
|000016f0| 0a 4f 70 65 72 61 74 69 | 6f 6e 3a 20 64 65 73 74 |.Operati|on: dest|
|00001700| 69 6e 61 74 69 6f 6e 20 | 3d 20 6f 70 65 72 61 6e |ination |= operan|
|00001710| 64 20 6f 6e 65 20 2b 20 | 6f 70 65 72 61 6e 64 20 |d one + |operand |
|00001720| 74 77 6f 0a 46 6c 61 67 | 73 3a 20 4e 2c 5a 2c 43 |two.Flag|s: N,Z,C|
|00001730| 2c 56 0a 23 77 72 61 70 | 20 6f 6e 0a 23 6c 69 6e |,V.#wrap| on.#lin|
|00001740| 65 0a 54 68 69 73 20 69 | 6e 73 74 72 75 63 74 69 |e.This i|nstructi|
|00001750| 6f 6e 20 70 65 72 66 6f | 72 6d 73 20 74 68 65 20 |on perfo|rms the |
|00001760| 61 72 69 74 68 6d 65 74 | 69 63 20 61 64 64 69 74 |arithmet|ic addit|
|00001770| 69 6f 6e 20 6f 66 20 69 | 74 73 20 74 77 6f 20 6f |ion of i|ts two o|
|00001780| 70 65 72 61 6e 64 73 2c | 20 61 6e 64 20 73 74 6f |perands,| and sto|
|00001790| 72 65 73 20 74 68 65 20 | 72 65 73 75 6c 74 20 69 |res the |result i|
|000017a0| 6e 20 74 68 65 20 64 65 | 73 74 69 6e 61 74 69 6f |n the de|stinatio|
|000017b0| 6e 20 72 65 67 69 73 74 | 65 72 2e 0a 23 6c 69 6e |n regist|er..#lin|
|000017c0| 65 0a 45 78 61 6d 70 6c | 65 73 3a 0a 23 49 6e 64 |e.Exampl|es:.#Ind|
|000017d0| 65 6e 74 20 32 0a 41 44 | 44 09 52 30 2c 52 33 2c |ent 2.AD|D.R0,R3,|
|000017e0| 52 34 09 52 30 20 3d 20 | 52 33 20 2b 20 52 34 0a |R4.R0 = |R3 + R4.|
|000017f0| 41 44 44 53 09 52 30 2c | 52 33 2c 23 32 09 52 30 |ADDS.R0,|R3,#2.R0|
|00001800| 20 3d 20 52 33 20 2b 20 | 32 20 28 53 65 74 74 69 | = R3 + |2 (Setti|
|00001810| 6e 67 20 73 74 61 74 75 | 73 20 66 6c 61 67 73 29 |ng statu|s flags)|
|00001820| 0a 41 44 44 4d 49 09 52 | 30 2c 52 30 2c 23 31 09 |.ADDMI.R|0,R0,#1.|
|00001830| 49 66 20 6d 69 6e 75 73 | 20 66 6c 61 67 20 73 65 |If minus| flag se|
|00001840| 74 20 69 6e 63 72 65 6d | 65 6e 74 20 52 30 20 62 |t increm|ent R0 b|
|00001850| 79 20 31 0a 41 44 44 09 | 52 30 2c 52 30 2c 52 30 |y 1.ADD.|R0,R0,R0|
|00001860| 2c 4c 53 4c 23 31 09 52 | 30 20 3d 20 52 30 20 2b |,LSL#1.R|0 = R0 +|
|00001870| 20 32 2a 52 30 20 20 28 | 52 30 20 3d 20 33 2a 52 | 2*R0 (|R0 = 3*R|
|00001880| 30 29 0a 23 49 6e 64 65 | 6e 74 00 00 44 41 54 41 |0).#Inde|nt..DATA|
|00001890| 10 03 00 00 52 53 42 3a | 20 52 65 76 65 72 73 65 |....RSB:| Reverse|
|000018a0| 20 53 75 62 74 72 61 63 | 74 0a 23 62 61 63 6b 67 | Subtrac|t.#backg|
|000018b0| 72 6f 75 6e 64 20 77 69 | 6d 70 20 31 0a 23 77 72 |round wi|mp 1.#wr|
|000018c0| 61 70 20 6f 66 66 0a 53 | 79 6e 74 61 78 3a 20 52 |ap off.S|yntax: R|
|000018d0| 53 42 20 5c 7b 5c 3c 73 | 75 66 66 69 78 5c 3e 5c |SB \{\<s|uffix\>\|
|000018e0| 7d 20 5c 3c 64 65 73 74 | 69 6e 61 74 69 6f 6e 5c |} \<dest|ination\|
|000018f0| 3e 2c 20 5c 3c 6f 70 65 | 72 61 6e 64 31 5c 3e 2c |>, \<ope|rand1\>,|
|00001900| 20 5c 3c 6f 70 65 72 61 | 6e 64 32 5c 3e 0a 4f 70 | \<opera|nd2\>.Op|
|00001910| 65 72 61 74 69 6f 6e 3a | 20 64 65 73 74 69 6e 61 |eration:| destina|
|00001920| 74 69 6f 6e 20 3d 20 6f | 70 65 72 61 6e 64 20 74 |tion = o|perand t|
|00001930| 77 6f 20 2d 20 6f 70 65 | 72 61 6e 64 20 6f 6e 65 |wo - ope|rand one|
|00001940| 0a 46 6c 61 67 73 3a 20 | 4e 2c 5a 2c 43 2c 56 0a |.Flags: |N,Z,C,V.|
|00001950| 23 77 72 61 70 20 6f 6e | 0a 23 6c 69 6e 65 0a 54 |#wrap on|.#line.T|
|00001960| 68 69 73 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |his inst|ruction |
|00001970| 70 65 72 66 6f 72 6d 73 | 20 74 68 65 20 61 72 69 |performs| the ari|
|00001980| 74 68 6d 65 74 69 63 20 | 73 75 62 74 72 61 63 74 |thmetic |subtract|
|00001990| 69 6f 6e 20 6f 66 20 69 | 74 73 20 66 69 72 73 74 |ion of i|ts first|
|000019a0| 20 6f 70 65 72 61 6e 64 | 20 66 72 6f 6d 20 69 74 | operand| from it|
|000019b0| 73 20 73 65 63 6f 6e 64 | 20 6f 70 65 72 61 6e 64 |s second| operand|
|000019c0| 2c 20 61 6e 64 20 73 74 | 6f 72 65 73 20 74 68 65 |, and st|ores the|
|000019d0| 20 72 65 73 75 6c 74 20 | 69 6e 20 74 68 65 20 64 | result |in the d|
|000019e0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 72 65 67 69 73 |estinati|on regis|
|000019f0| 74 65 72 2e 20 49 74 20 | 69 73 20 76 65 72 79 20 |ter. It |is very |
|00001a00| 73 69 6d 69 6c 61 72 20 | 74 6f 20 3c 53 55 42 3e |similar |to <SUB>|
|00001a10| 2e 0a 23 6c 69 6e 65 0a | 54 68 69 73 20 69 73 20 |..#line.|This is |
|00001a20| 6e 6f 74 20 61 20 77 61 | 73 74 65 20 6f 66 20 61 |not a wa|ste of a|
|00001a30| 6e 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 21 20 4f |n instru|ction! O|
|00001a40| 70 65 72 61 6e 64 20 74 | 77 6f 20 63 61 6e 20 62 |perand t|wo can b|
|00001a50| 65 20 73 70 65 63 69 66 | 69 65 64 20 69 6e 20 73 |e specif|ied in s|
|00001a60| 65 76 65 72 61 6c 20 64 | 69 66 66 65 72 65 6e 74 |everal d|ifferent|
|00001a70| 20 66 6f 72 6d 61 74 73 | 2c 20 61 6e 64 20 69 74 | formats|, and it|
|00001a80| 20 69 73 20 74 68 75 73 | 20 6d 75 63 68 20 6d 6f | is thus| much mo|
|00001a90| 72 65 20 66 6c 65 78 69 | 62 6c 65 20 74 68 61 6e |re flexi|ble than|
|00001aa0| 20 6f 70 65 72 61 6e 64 | 20 6f 6e 65 2e 20 54 68 | operand| one. Th|
|00001ab0| 65 20 52 53 42 20 69 6e | 73 74 72 75 63 74 69 6f |e RSB in|structio|
|00001ac0| 6e 20 74 68 75 73 20 65 | 6e 73 75 72 65 73 20 74 |n thus e|nsures t|
|00001ad0| 68 61 74 20 65 69 74 68 | 65 72 20 6f 66 20 74 68 |hat eith|er of th|
|00001ae0| 65 20 6f 70 65 72 61 6e | 64 73 20 75 73 65 64 20 |e operan|ds used |
|00001af0| 63 61 6e 20 62 65 20 73 | 70 65 63 69 66 69 65 64 |can be s|pecified|
|00001b00| 20 75 73 69 6e 67 20 74 | 68 65 20 66 6c 65 78 69 | using t|he flexi|
|00001b10| 62 6c 65 20 66 6f 72 6d | 61 74 20 61 6c 6c 6f 77 |ble form|at allow|
|00001b20| 65 64 20 62 79 20 6f 70 | 65 72 61 6e 64 20 74 77 |ed by op|erand tw|
|00001b30| 6f 2e 0a 23 6c 69 6e 65 | 0a 45 78 61 6d 70 6c 65 |o..#line|.Example|
|00001b40| 73 3a 0a 23 49 6e 64 65 | 6e 74 20 32 0a 52 53 42 |s:.#Inde|nt 2.RSB|
|00001b50| 09 52 30 2c 52 30 2c 23 | 30 09 52 30 20 3d 20 30 |.R0,R0,#|0.R0 = 0|
|00001b60| 20 2d 20 52 30 20 28 52 | 30 20 3d 20 2d 52 30 29 | - R0 (R|0 = -R0)|
|00001b70| 0a 52 53 42 09 52 36 2c | 52 33 2c 52 37 2c 4c 53 |.RSB.R6,|R3,R7,LS|
|00001b80| 4c 23 32 09 52 36 20 3d | 20 28 52 37 2a 34 29 20 |L#2.R6 =| (R7*4) |
|00001b90| 2d 20 52 33 0a 23 49 6e | 64 65 6e 74 44 41 54 41 |- R3.#In|dentDATA|
|00001ba0| e7 02 00 00 53 42 43 3a | 20 53 75 62 74 72 61 63 |....SBC:| Subtrac|
|00001bb0| 74 20 77 69 74 68 20 43 | 61 72 72 79 0a 23 62 61 |t with C|arry.#ba|
|00001bc0| 63 6b 67 72 6f 75 6e 64 | 20 77 69 6d 70 20 31 0a |ckground| wimp 1.|
|00001bd0| 23 77 72 61 70 20 6f 66 | 66 0a 53 79 6e 74 61 78 |#wrap of|f.Syntax|
|00001be0| 3a 20 53 42 43 20 5c 7b | 5c 3c 73 75 66 66 69 78 |: SBC \{|\<suffix|
|00001bf0| 5c 3e 5c 7d 20 5c 3c 64 | 65 73 74 69 6e 61 74 69 |\>\} \<d|estinati|
|00001c00| 6f 6e 5c 3e 2c 20 5c 3c | 6f 70 65 72 61 6e 64 31 |on\>, \<|operand1|
|00001c10| 5c 3e 2c 20 5c 3c 6f 70 | 65 72 61 6e 64 32 5c 3e |\>, \<op|erand2\>|
|00001c20| 0a 4f 70 65 72 61 74 69 | 6f 6e 3a 20 64 65 73 74 |.Operati|on: dest|
|00001c30| 69 6e 61 74 69 6f 6e 20 | 3d 20 6f 70 65 72 61 6e |ination |= operan|
|00001c40| 64 20 6f 6e 65 20 2d 20 | 6f 70 65 72 61 6e 64 20 |d one - |operand |
|00001c50| 74 77 6f 20 2d 20 6e 6f | 74 20 28 63 61 72 72 79 |two - no|t (carry|
|00001c60| 29 0a 46 6c 61 67 73 3a | 20 4e 2c 5a 2c 43 2c 56 |).Flags:| N,Z,C,V|
|00001c70| 0a 23 77 72 61 70 20 6f | 6e 0a 23 6c 69 6e 65 0a |.#wrap o|n.#line.|
|00001c80| 54 68 69 73 20 6f 70 65 | 72 61 74 69 6f 6e 20 61 |This ope|ration a|
|00001c90| 6c 6c 6f 77 73 20 6d 75 | 6c 74 69 2d 77 6f 72 64 |llows mu|lti-word|
|00001ca0| 20 73 75 62 74 72 61 63 | 74 69 6f 6e 20 74 6f 20 | subtrac|tion to |
|00001cb0| 62 65 20 70 65 72 66 6f | 72 6d 65 64 20 69 6e 20 |be perfo|rmed in |
|00001cc0| 74 68 65 20 73 61 6d 65 | 20 77 61 79 20 74 68 61 |the same| way tha|
|00001cd0| 74 20 3c 41 44 43 3e 20 | 61 6c 6c 6f 77 73 20 6d |t <ADC> |allows m|
|00001ce0| 75 6c 74 69 2d 77 6f 72 | 64 20 61 64 64 69 74 69 |ulti-wor|d additi|
|00001cf0| 6f 6e 2e 20 54 68 69 73 | 20 74 69 6d 65 20 74 68 |on. This| time th|
|00001d00| 65 20 63 61 72 72 79 20 | 66 6c 61 67 20 69 73 20 |e carry |flag is |
|00001d10| 75 73 65 64 20 74 6f 20 | 69 6e 64 69 63 61 74 65 |used to |indicate|
|00001d20| 20 74 68 61 74 20 61 20 | 22 62 6f 72 72 6f 77 22 | that a |"borrow"|
|00001d30| 20 6f 63 63 75 72 65 64 | 20 77 68 65 6e 20 73 75 | occured| when su|
|00001d40| 62 74 72 61 63 74 69 6e | 67 20 74 77 6f 20 77 6f |btractin|g two wo|
|00001d50| 72 64 73 2e 0a 23 6c 69 | 6e 65 0a 53 42 43 20 63 |rds..#li|ne.SBC c|
|00001d60| 61 6e 20 62 65 20 75 73 | 65 64 20 66 6f 72 20 6d |an be us|ed for m|
|00001d70| 75 6c 74 69 2d 77 6f 72 | 64 20 73 75 62 74 72 61 |ulti-wor|d subtra|
|00001d80| 63 74 69 6f 6e 73 20 61 | 73 20 66 6f 6c 6c 6f 77 |ctions a|s follow|
|00001d90| 73 3a 0a 23 74 61 62 0a | 23 69 6e 64 65 6e 74 20 |s:.#tab.|#indent |
|00001da0| 32 0a 53 55 42 53 20 72 | 65 73 75 6c 74 5f 6c 6f |2.SUBS r|esult_lo|
|00001db0| 77 2c 20 6c 6f 77 31 2c | 20 6c 6f 77 32 09 53 75 |w, low1,| low2.Su|
|00001dc0| 62 74 72 61 63 74 20 6c | 6f 77 20 77 6f 72 64 73 |btract l|ow words|
|00001dd0| 0a 53 42 43 53 20 72 65 | 73 75 6c 74 5f 68 69 67 |.SBCS re|sult_hig|
|00001de0| 68 2c 20 68 69 67 68 31 | 2c 20 68 69 67 68 32 09 |h, high1|, high2.|
|00001df0| 53 75 62 74 72 61 63 74 | 20 68 69 67 68 20 77 6f |Subtract| high wo|
|00001e00| 72 64 73 20 2b 20 63 61 | 72 72 79 0a 23 69 6e 64 |rds + ca|rry.#ind|
|00001e10| 65 6e 74 0a 23 74 61 62 | 0a 2a 4e 6f 74 65 2a 3a |ent.#tab|.*Note*:|
|00001e20| 20 49 74 20 69 73 20 76 | 69 74 61 6c 20 74 68 61 | It is v|ital tha|
|00001e30| 74 20 74 68 65 20 53 20 | 73 75 66 66 69 78 20 69 |t the S |suffix i|
|00001e40| 73 20 75 73 65 64 20 74 | 6f 20 61 6c 6c 6f 77 20 |s used t|o allow |
|00001e50| 74 68 65 20 73 75 62 74 | 72 61 63 74 20 69 6e 73 |the subt|ract ins|
|00001e60| 74 72 75 63 74 69 6f 6e | 73 20 74 6f 20 61 66 66 |truction|s to aff|
|00001e70| 65 63 74 20 74 68 65 20 | 63 61 72 72 79 20 66 6c |ect the |carry fl|
|00001e80| 61 67 2e 00 44 41 54 41 | fc 01 00 00 53 55 42 3a |ag..DATA|....SUB:|
|00001e90| 20 53 75 62 74 72 61 63 | 74 0a 23 62 61 63 6b 67 | Subtrac|t.#backg|
|00001ea0| 72 6f 75 6e 64 20 77 69 | 6d 70 20 31 0a 23 77 72 |round wi|mp 1.#wr|
|00001eb0| 61 70 20 6f 66 66 0a 53 | 79 6e 74 61 78 3a 20 53 |ap off.S|yntax: S|
|00001ec0| 55 42 20 5c 7b 5c 3c 73 | 75 66 66 69 78 5c 3e 5c |UB \{\<s|uffix\>\|
|00001ed0| 7d 20 5c 3c 64 65 73 74 | 69 6e 61 74 69 6f 6e 5c |} \<dest|ination\|
|00001ee0| 3e 2c 20 5c 3c 6f 70 65 | 72 61 6e 64 31 5c 3e 2c |>, \<ope|rand1\>,|
|00001ef0| 20 5c 3c 6f 70 65 72 61 | 6e 64 32 5c 3e 0a 4f 70 | \<opera|nd2\>.Op|
|00001f00| 65 72 61 74 69 6f 6e 3a | 20 64 65 73 74 69 6e 61 |eration:| destina|
|00001f10| 74 69 6f 6e 20 3d 20 6f | 70 65 72 61 6e 64 20 6f |tion = o|perand o|
|00001f20| 6e 65 20 2d 20 6f 70 65 | 72 61 6e 64 20 74 77 6f |ne - ope|rand two|
|00001f30| 0a 46 6c 61 67 73 3a 20 | 4e 2c 5a 2c 43 2c 56 0a |.Flags: |N,Z,C,V.|
|00001f40| 23 77 72 61 70 20 6f 6e | 0a 23 6c 69 6e 65 0a 54 |#wrap on|.#line.T|
|00001f50| 68 69 73 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |his inst|ruction |
|00001f60| 70 65 72 66 6f 72 6d 73 | 20 74 68 65 20 61 72 69 |performs| the ari|
|00001f70| 74 68 6d 65 74 69 63 20 | 73 75 62 74 72 61 63 74 |thmetic |subtract|
|00001f80| 69 6f 6e 20 6f 66 20 69 | 74 73 20 73 65 63 6f 6e |ion of i|ts secon|
|00001f90| 64 20 6f 70 65 72 61 6e | 64 20 66 72 6f 6d 20 69 |d operan|d from i|
|00001fa0| 74 73 20 66 69 72 73 74 | 20 6f 70 65 72 61 6e 64 |ts first| operand|
|00001fb0| 2c 20 61 6e 64 20 73 74 | 6f 72 65 73 20 74 68 65 |, and st|ores the|
|00001fc0| 20 72 65 73 75 6c 74 20 | 69 6e 20 74 68 65 20 64 | result |in the d|
|00001fd0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 72 65 67 69 73 |estinati|on regis|
|00001fe0| 74 65 72 2e 0a 23 6c 69 | 6e 65 0a 45 78 61 6d 70 |ter..#li|ne.Examp|
|00001ff0| 6c 65 73 3a 0a 23 49 6e | 64 65 6e 74 20 32 0a 53 |les:.#In|dent 2.S|
|00002000| 55 42 09 52 31 30 2c 52 | 32 2c 52 34 09 52 31 30 |UB.R10,R|2,R4.R10|
|00002010| 20 3d 20 52 32 20 2d 20 | 52 34 0a 53 55 42 4d 49 | = R2 - |R4.SUBMI|
|00002020| 09 52 31 2c 52 33 2c 23 | 31 30 32 34 09 49 66 20 |.R1,R3,#|1024.If |
|00002030| 6e 65 67 20 66 6c 61 67 | 20 73 65 74 20 52 31 20 |neg flag| set R1 |
|00002040| 3d 20 52 33 20 2d 20 31 | 30 32 34 0a 53 55 42 09 |= R3 - 1|024.SUB.|
|00002050| 52 30 2c 52 30 2c 52 30 | 2c 4c 53 4c 23 31 09 52 |R0,R0,R0|,LSL#1.R|
|00002060| 30 20 3d 20 52 30 20 2d | 20 32 2a 52 30 20 28 52 |0 = R0 -| 2*R0 (R|
|00002070| 30 20 3d 20 2d 52 30 29 | 0a 23 49 6e 64 65 6e 74 |0 = -R0)|.#Indent|
|00002080| 44 41 54 41 bd 02 00 00 | 52 53 43 3a 20 52 65 76 |DATA....|RSC: Rev|
|00002090| 65 72 73 65 20 53 75 62 | 74 72 61 63 74 20 77 69 |erse Sub|tract wi|
|000020a0| 74 68 20 43 61 72 72 79 | 0a 23 62 61 63 6b 67 72 |th Carry|.#backgr|
|000020b0| 6f 75 6e 64 20 77 69 6d | 70 20 31 0a 23 77 72 61 |ound wim|p 1.#wra|
|000020c0| 70 20 6f 66 66 0a 53 79 | 6e 74 61 78 3a 20 52 53 |p off.Sy|ntax: RS|
|000020d0| 43 20 5c 7b 5c 3c 73 75 | 66 66 69 78 5c 3e 5c 7d |C \{\<su|ffix\>\}|
|000020e0| 20 5c 3c 64 65 73 74 69 | 6e 61 74 69 6f 6e 5c 3e | \<desti|nation\>|
|000020f0| 2c 20 5c 3c 6f 70 65 72 | 61 6e 64 31 5c 3e 2c 20 |, \<oper|and1\>, |
|00002100| 5c 3c 6f 70 65 72 61 6e | 64 32 5c 3e 0a 4f 70 65 |\<operan|d2\>.Ope|
|00002110| 72 61 74 69 6f 6e 3a 20 | 64 65 73 74 69 6e 61 74 |ration: |destinat|
|00002120| 69 6f 6e 20 3d 20 6f 70 | 65 72 61 6e 64 20 74 77 |ion = op|erand tw|
|00002130| 6f 20 2d 20 6f 70 65 72 | 61 6e 64 20 6f 6e 65 20 |o - oper|and one |
|00002140| 2d 20 6e 6f 74 20 28 63 | 61 72 72 79 29 0a 46 6c |- not (c|arry).Fl|
|00002150| 61 67 73 3a 20 4e 2c 5a | 2c 43 2c 56 0a 23 77 72 |ags: N,Z|,C,V.#wr|
|00002160| 61 70 20 6f 6e 0a 23 6c | 69 6e 65 0a 54 68 69 73 |ap on.#l|ine.This|
|00002170| 20 6f 70 65 72 61 74 69 | 6f 6e 20 70 65 72 66 6f | operati|on perfo|
|00002180| 72 6d 73 20 61 20 72 65 | 76 65 72 73 65 20 73 75 |rms a re|verse su|
|00002190| 62 74 72 61 63 74 20 6f | 70 65 72 61 74 69 6f 6e |btract o|peration|
|000021a0| 20 77 68 69 6c 65 20 74 | 61 6b 69 6e 67 20 61 63 | while t|aking ac|
|000021b0| 63 6f 75 6e 74 20 6f 66 | 20 61 20 70 72 65 76 69 |count of| a previ|
|000021c0| 6f 75 73 20 62 6f 72 72 | 6f 77 20 69 6e 20 74 68 |ous borr|ow in th|
|000021d0| 65 20 63 61 72 72 79 20 | 66 6c 61 67 2e 0a 23 6c |e carry |flag..#l|
|000021e0| 69 6e 65 0a 54 68 69 73 | 20 6f 70 65 72 61 6e 64 |ine.This| operand|
|000021f0| 20 61 6c 6c 6f 77 73 20 | 72 65 76 65 72 73 65 64 | allows |reversed|
|00002200| 20 73 75 62 74 72 61 63 | 74 69 6f 6e 20 74 6f 20 | subtrac|tion to |
|00002210| 62 65 20 70 65 72 66 6f | 72 6d 65 64 20 6f 6e 20 |be perfo|rmed on |
|00002220| 6d 75 6c 74 69 2d 77 6f | 72 64 20 6f 70 65 72 61 |multi-wo|rd opera|
|00002230| 6e 64 73 2e 20 49 74 20 | 63 6f 72 72 65 73 70 6f |nds. It |correspo|
|00002240| 6e 64 73 20 74 6f 20 74 | 68 65 20 3c 53 42 43 3e |nds to t|he <SBC>|
|00002250| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 69 6e 20 | instruc|tion in |
|00002260| 74 68 65 20 73 61 6d 65 | 20 77 61 79 20 74 68 61 |the same| way tha|
|00002270| 74 20 3c 52 53 42 3e 20 | 63 6f 72 72 65 73 70 6f |t <RSB> |correspo|
|00002280| 6e 64 73 20 74 6f 20 3c | 53 55 42 3e 2e 0a 23 6c |nds to <|SUB>..#l|
|00002290| 69 6e 65 0a 45 78 61 6d | 70 6c 65 73 3a 0a 23 77 |ine.Exam|ples:.#w|
|000022a0| 72 61 70 20 6f 66 66 0a | 23 49 6e 64 65 6e 74 20 |rap off.|#Indent |
|000022b0| 32 0a 52 53 42 53 09 72 | 65 73 75 6c 74 5f 6c 6f |2.RSBS.r|esult_lo|
|000022c0| 77 2c 20 6c 6f 77 31 2c | 20 6c 6f 77 32 09 09 52 |w, low1,| low2..R|
|000022d0| 65 76 65 72 73 65 20 73 | 75 62 74 72 61 63 74 20 |everse s|ubtract |
|000022e0| 6c 6f 77 20 77 6f 72 64 | 73 0a 52 53 43 53 09 72 |low word|s.RSCS.r|
|000022f0| 65 73 75 6c 74 5f 68 69 | 67 68 2c 20 68 69 67 68 |esult_hi|gh, high|
|00002300| 31 2c 20 68 69 67 68 32 | 09 52 65 76 65 72 73 65 |1, high2|.Reverse|
|00002310| 20 73 75 62 74 72 61 63 | 74 20 68 69 67 68 20 77 | subtrac|t high w|
|00002320| 6f 72 64 73 20 2b 20 63 | 61 72 72 79 0a 23 49 6e |ords + c|arry.#In|
|00002330| 64 65 6e 74 0a 23 77 72 | 61 70 20 6f 6e 00 00 00 |dent.#wr|ap on...|
|00002340| 44 41 54 41 4e 02 00 00 | 4d 4f 56 3a 20 4d 6f 76 |DATAN...|MOV: Mov|
|00002350| 65 20 44 61 74 61 0a 23 | 62 61 63 6b 67 72 6f 75 |e Data.#|backgrou|
|00002360| 6e 64 20 77 69 6d 70 20 | 31 0a 23 77 72 61 70 20 |nd wimp |1.#wrap |
|00002370| 6f 66 66 0a 53 79 6e 74 | 61 78 3a 20 4d 4f 56 20 |off.Synt|ax: MOV |
|00002380| 5c 7b 5c 3c 73 75 66 66 | 69 78 5c 3e 5c 7d 20 5c |\{\<suff|ix\>\} \|
|00002390| 3c 64 65 73 74 69 6e 61 | 74 69 6f 6e 5c 3e 2c 20 |<destina|tion\>, |
|000023a0| 5c 3c 6f 70 65 72 61 6e | 64 32 5c 3e 0a 4f 70 65 |\<operan|d2\>.Ope|
|000023b0| 72 61 74 69 6f 6e 3a 20 | 64 65 73 74 69 6e 61 74 |ration: |destinat|
|000023c0| 69 6f 6e 20 3d 20 6f 70 | 65 72 61 6e 64 20 74 77 |ion = op|erand tw|
|000023d0| 6f 0a 46 6c 61 67 73 3a | 20 4e 2c 5a 2c 28 43 29 |o.Flags:| N,Z,(C)|
|000023e0| 0a 23 77 72 61 70 20 6f | 6e 0a 23 6c 69 6e 65 0a |.#wrap o|n.#line.|
|000023f0| 54 68 69 73 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |This ins|truction|
|00002400| 20 6d 6f 76 65 73 20 64 | 61 74 61 20 69 6e 74 6f | moves d|ata into|
|00002410| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00002420| 20 72 65 67 69 73 74 65 | 72 2e 20 4f 70 65 72 61 | registe|r. Opera|
|00002430| 6e 64 20 74 77 6f 2c 20 | 61 73 20 65 78 70 65 63 |nd two, |as expec|
|00002440| 74 65 64 2c 20 63 61 6e | 20 62 65 20 73 70 65 63 |ted, can| be spec|
|00002450| 69 66 69 65 64 20 61 73 | 20 61 20 72 65 67 69 73 |ified as| a regis|
|00002460| 74 65 72 2c 20 61 6e 20 | 69 6d 6d 65 64 69 61 74 |ter, an |immediat|
|00002470| 65 20 6f 70 65 72 61 6e | 64 20 6f 72 20 61 73 20 |e operan|d or as |
|00002480| 61 20 73 68 69 66 74 65 | 64 20 72 65 67 69 73 74 |a shifte|d regist|
|00002490| 65 72 2e 0a 23 6c 69 6e | 65 0a 45 78 61 6d 70 6c |er..#lin|e.Exampl|
|000024a0| 65 73 3a 0a 23 77 72 61 | 70 20 6f 66 66 0a 23 49 |es:.#wra|p off.#I|
|000024b0| 6e 64 65 6e 74 20 32 0a | 4d 4f 56 09 52 31 32 2c |ndent 2.|MOV.R12,|
|000024c0| 52 30 09 09 4d 6f 76 65 | 20 74 68 65 20 63 6f 6e |R0..Move| the con|
|000024d0| 74 65 6e 74 73 20 6f 66 | 20 52 30 20 69 6e 74 6f |tents of| R0 into|
|000024e0| 20 52 31 32 0a 4d 4f 56 | 09 52 36 2c 52 36 2c 41 | R12.MOV|.R6,R6,A|
|000024f0| 53 4c 23 32 09 52 36 20 | 3d 20 52 36 2a 34 0a 4d |SL#2.R6 |= R6*4.M|
|00002500| 4f 56 09 52 30 2c 52 32 | 2c 41 53 4c 20 52 35 09 |OV.R0,R2|,ASL R5.|
|00002510| 52 30 20 3d 20 52 32 20 | 2a 20 28 32 5e 52 35 29 |R0 = R2 |* (2^R5)|
|00002520| 0a 4d 4f 56 45 51 53 09 | 52 30 2c 52 34 09 09 49 |.MOVEQS.|R0,R4..I|
|00002530| 66 20 5a 20 66 6c 61 67 | 20 73 65 74 20 54 68 65 |f Z flag| set The|
|00002540| 6e 20 52 30 20 3d 20 52 | 34 20 28 73 65 74 74 69 |n R0 = R|4 (setti|
|00002550| 6e 67 20 66 6c 61 67 73 | 29 0a 4d 4f 56 09 52 31 |ng flags|).MOV.R1|
|00002560| 35 2c 52 31 34 09 09 52 | 65 74 75 72 6e 20 66 72 |5,R14..R|eturn fr|
|00002570| 6f 6d 20 73 75 62 72 6f | 75 74 69 6e 65 0a 23 49 |om subro|utine.#I|
|00002580| 6e 64 65 6e 74 0a 23 77 | 72 61 70 20 6f 6e 00 00 |ndent.#w|rap on..|
|00002590| 44 41 54 41 a6 02 00 00 | 4d 56 4e 3a 20 4d 6f 76 |DATA....|MVN: Mov|
|000025a0| 65 20 49 6e 76 65 72 74 | 65 64 20 44 61 74 61 0a |e Invert|ed Data.|
|000025b0| 23 62 61 63 6b 67 72 6f | 75 6e 64 20 77 69 6d 70 |#backgro|und wimp|
|000025c0| 20 31 0a 23 77 72 61 70 | 20 6f 66 66 0a 53 79 6e | 1.#wrap| off.Syn|
|000025d0| 74 61 78 3a 20 4d 56 4e | 20 5c 7b 5c 3c 73 75 66 |tax: MVN| \{\<suf|
|000025e0| 66 69 78 5c 3e 5c 7d 20 | 5c 3c 64 65 73 74 69 6e |fix\>\} |\<destin|
|000025f0| 61 74 69 6f 6e 5c 3e 2c | 20 5c 3c 6f 70 65 72 61 |ation\>,| \<opera|
|00002600| 6e 64 32 5c 3e 0a 4f 70 | 65 72 61 74 69 6f 6e 3a |nd2\>.Op|eration:|
|00002610| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 3d 20 6e | destina|tion = n|
|00002620| 6f 74 20 28 6f 70 65 72 | 61 6e 64 20 74 77 6f 29 |ot (oper|and two)|
|00002630| 0a 46 6c 61 67 73 3a 20 | 4e 2c 5a 2c 28 43 29 0a |.Flags: |N,Z,(C).|
|00002640| 23 77 72 61 70 20 6f 6e | 0a 23 6c 69 6e 65 0a 54 |#wrap on|.#line.T|
|00002650| 68 69 73 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |his inst|ruction |
|00002660| 68 61 73 20 65 78 61 63 | 74 6c 79 20 74 68 20 73 |has exac|tly th s|
|00002670| 61 6d 65 20 65 66 66 65 | 63 74 20 61 73 20 3c 4d |ame effe|ct as <M|
|00002680| 4f 56 3e 2c 20 65 78 63 | 65 70 74 20 74 68 61 74 |OV>, exc|ept that|
|00002690| 20 61 6c 6c 20 74 68 65 | 20 62 69 74 73 20 6d 6f | all the| bits mo|
|000026a0| 76 65 64 20 66 72 6f 6d | 20 74 68 65 20 73 6f 75 |ved from| the sou|
|000026b0| 72 63 65 20 72 65 67 69 | 73 74 65 72 20 61 72 65 |rce regi|ster are|
|000026c0| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 20 69 | automat|ically i|
|000026d0| 6e 76 65 72 74 65 64 2e | 20 54 68 69 73 20 61 6c |nverted.| This al|
|000026e0| 6c 6f 77 73 20 6e 65 67 | 61 74 69 76 65 20 69 6d |lows neg|ative im|
|000026f0| 6d 65 64 69 61 74 65 20 | 6e 75 6d 62 65 72 73 20 |mediate |numbers |
|00002700| 74 6f 20 62 65 20 6d 6f | 76 65 64 20 69 6e 74 6f |to be mo|ved into|
|00002710| 20 72 65 67 69 73 74 65 | 72 73 0a 23 6c 69 6e 65 | registe|rs.#line|
|00002720| 0a 55 6e 64 65 72 20 74 | 68 65 20 74 77 6f 27 73 |.Under t|he two's|
|00002730| 20 63 6f 6d 70 6c 65 6d | 65 6e 74 20 73 63 68 65 | complem|ent sche|
|00002740| 6d 65 2c 20 74 68 65 20 | 6e 75 6d 62 65 72 20 27 |me, the |number '|
|00002750| 6e 27 20 69 73 20 72 65 | 70 72 65 73 65 6e 74 65 |n' is re|presente|
|00002760| 64 20 61 73 3a 0a 23 49 | 6e 64 65 6e 74 20 34 0a |d as:.#I|ndent 4.|
|00002770| 4e 4f 54 20 28 6e 29 20 | 2b 20 31 0a 23 49 6e 64 |NOT (n) |+ 1.#Ind|
|00002780| 65 6e 74 0a 23 6c 69 6e | 65 0a 45 78 61 6d 70 6c |ent.#lin|e.Exampl|
|00002790| 65 73 3a 0a 23 77 72 61 | 70 20 6f 66 66 0a 23 49 |es:.#wra|p off.#I|
|000027a0| 6e 64 65 6e 74 20 32 0a | 4d 56 4e 09 52 30 2c 23 |ndent 2.|MVN.R0,#|
|000027b0| 30 09 09 4d 6f 76 65 20 | 2d 31 20 69 6e 74 6f 20 |0..Move |-1 into |
|000027c0| 72 65 67 69 73 74 65 72 | 20 52 30 0a 4d 56 4e 09 |register| R0.MVN.|
|000027d0| 52 31 2c 23 39 09 09 4d | 6f 76 65 20 2d 31 30 20 |R1,#9..M|ove -10 |
|000027e0| 69 6e 74 6f 20 52 31 0a | 4d 56 4e 09 52 33 2c 52 |into R1.|MVN.R3,R|
|000027f0| 35 09 09 52 33 20 3d 20 | 6e 6f 74 20 28 52 35 29 |5..R3 = |not (R5)|
|00002800| 0a 4d 56 4e 09 52 36 2c | 52 37 2c 4c 53 52 20 23 |.MVN.R6,|R7,LSR #|
|00002810| 31 09 52 36 20 3d 20 6e | 6f 74 20 28 52 37 20 64 |1.R6 = n|ot (R7 d|
|00002820| 69 76 20 32 29 0a 23 49 | 6e 64 65 6e 74 0a 23 77 |iv 2).#I|ndent.#w|
|00002830| 72 61 70 20 6f 6e 00 00 | 44 41 54 41 b8 03 00 00 |rap on..|DATA....|
|00002840| 43 4d 50 3a 20 43 6f 6d | 70 61 72 65 0a 23 62 61 |CMP: Com|pare.#ba|
|00002850| 63 6b 67 72 6f 75 6e 64 | 20 77 69 6d 70 20 31 0a |ckground| wimp 1.|
|00002860| 23 77 72 61 70 20 6f 66 | 66 0a 53 79 6e 74 61 78 |#wrap of|f.Syntax|
|00002870| 3a 20 43 4d 50 20 5c 7b | 5c 3c 73 75 66 66 69 78 |: CMP \{|\<suffix|
|00002880| 5c 3e 5c 7d 20 5c 3c 6f | 70 65 72 61 6e 64 31 5c |\>\} \<o|perand1\|
|00002890| 3e 2c 20 5c 3c 6f 70 65 | 72 61 6e 64 32 5c 3e 0a |>, \<ope|rand2\>.|
|000028a0| 4f 70 65 72 61 74 69 6f | 6e 3a 20 52 65 66 6c 65 |Operatio|n: Refle|
|000028b0| 63 74 20 72 65 73 75 6c | 74 20 6f 66 20 6f 70 65 |ct resul|t of ope|
|000028c0| 72 61 6e 64 20 6f 6e 65 | 20 2d 20 6f 70 65 72 61 |rand one| - opera|
|000028d0| 6e 64 20 74 77 6f 0a 46 | 6c 61 67 73 3a 20 4e 2c |nd two.F|lags: N,|
|000028e0| 5a 2c 43 2c 56 0a 23 77 | 72 61 70 20 6f 6e 0a 23 |Z,C,V.#w|rap on.#|
|000028f0| 6c 69 6e 65 0a 54 68 69 | 73 20 69 73 20 61 20 76 |line.Thi|s is a v|
|00002900| 65 72 79 20 69 6d 70 6f | 72 74 61 6e 74 20 69 6e |ery impo|rtant in|
|00002910| 73 74 72 75 63 74 69 6f | 6e 20 63 6f 6e 6e 65 63 |structio|n connec|
|00002920| 74 65 64 20 77 69 74 68 | 20 63 6f 6e 64 69 74 69 |ted with| conditi|
|00002930| 6f 6e 61 6c 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |onal ins|truction|
|00002940| 20 65 78 65 63 75 74 69 | 6f 6e 2e 20 54 68 65 20 | executi|on. The |
|00002950| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 63 6f 6d 70 |instruct|ion comp|
|00002960| 61 72 65 73 20 74 77 6f | 20 6f 70 65 72 61 6e 64 |ares two| operand|
|00002970| 73 2c 20 61 6e 64 20 61 | 6c 74 65 72 73 20 74 68 |s, and a|lters th|
|00002980| 65 20 73 74 61 74 75 73 | 20 66 6c 61 67 73 20 64 |e status| flags d|
|00002990| 65 70 65 6e 64 69 6e 67 | 20 6f 6e 20 74 68 65 20 |epending| on the |
|000029a0| 72 65 73 75 6c 74 2e 0a | 23 6c 69 6e 65 0a 54 68 |result..|#line.Th|
|000029b0| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 74 68 65 20 |e result| of the |
|000029c0| 6f 70 65 72 61 74 69 6f | 6e 20 69 73 20 6e 6f 74 |operatio|n is not|
|000029d0| 20 73 74 6f 72 65 64 20 | 61 6e 79 77 68 65 72 65 | stored |anywhere|
|000029e0| 2c 20 77 68 69 63 68 20 | 65 78 70 6c 61 69 6e 73 |, which |explains|
|000029f0| 20 77 68 79 20 74 68 65 | 72 65 20 69 73 20 6e 6f | why the|re is no|
|00002a00| 20 6e 65 65 64 20 66 6f | 72 20 61 20 64 65 73 74 | need fo|r a dest|
|00002a10| 69 6e 61 74 69 6f 6e 20 | 66 69 65 6c 64 2e 20 54 |ination |field. T|
|00002a20| 68 65 20 6f 6e 6c 79 20 | 74 68 69 6e 67 20 74 6f |he only |thing to|
|00002a30| 20 72 65 6d 65 6d 62 65 | 72 20 69 73 20 74 68 61 | remembe|r is tha|
|00002a40| 74 20 74 68 65 20 76 61 | 72 69 6f 75 73 20 73 75 |t the va|rious su|
|00002a50| 62 73 65 71 75 65 6e 74 | 20 63 6f 6e 64 69 74 69 |bsequent| conditi|
|00002a60| 6f 6e 20 63 6f 64 65 73 | 20 72 65 66 65 72 20 74 |on codes| refer t|
|00002a70| 6f 20 6f 70 65 72 61 6e | 64 20 6f 6e 65 20 63 6f |o operan|d one co|
|00002a80| 6d 70 61 72 65 64 20 77 | 69 74 68 20 6f 70 65 72 |mpared w|ith oper|
|00002a90| 61 6e 64 20 74 77 6f 2e | 20 54 68 75 73 2c 20 74 |and two.| Thus, t|
|00002aa0| 68 65 20 4c 54 20 28 6c | 65 73 73 20 74 68 61 6e |he LT (l|ess than|
|00002ab0| 29 20 73 75 66 66 69 78 | 20 77 69 6c 6c 20 65 78 |) suffix| will ex|
|00002ac0| 65 63 75 74 65 20 69 66 | 20 6f 70 65 72 61 6e 64 |ecute if| operand|
|00002ad0| 20 6f 6e 65 20 69 73 20 | 6c 65 73 73 20 74 68 61 | one is |less tha|
|00002ae0| 6e 20 6f 70 65 72 61 6e | 64 20 74 77 6f 2e 0a 23 |n operan|d two..#|
|00002af0| 6c 69 6e 65 0a 45 78 61 | 6d 70 6c 65 3a 0a 23 77 |line.Exa|mple:.#w|
|00002b00| 72 61 70 20 6f 66 66 0a | 23 69 6e 64 65 6e 74 20 |rap off.|#indent |
|00002b10| 32 0a 43 4d 50 09 52 30 | 2c 52 31 09 09 43 6f 6d |2.CMP.R0|,R1..Com|
|00002b20| 70 61 72 65 20 52 30 20 | 77 69 74 68 20 52 31 0a |pare R0 |with R1.|
|00002b30| 53 57 49 45 51 09 22 4f | 53 5f 4e 65 77 4c 69 6e |SWIEQ."O|S_NewLin|
|00002b40| 65 22 09 49 66 20 28 52 | 30 20 2d 20 52 31 20 3d |e".If (R|0 - R1 =|
|00002b50| 20 30 29 20 65 78 65 63 | 75 74 65 20 53 57 49 20 | 0) exec|ute SWI |
|00002b60| 63 6f 6d 6d 61 6e 64 0a | 23 69 6e 64 65 6e 74 0a |command.|#indent.|
|00002b70| 23 77 72 61 70 20 6f 6e | 0a 2a 4e 6f 74 65 2a 3a |#wrap on|.*Note*:|
|00002b80| 20 53 69 6e 63 65 20 74 | 68 65 20 70 75 72 70 6f | Since t|he purpo|
|00002b90| 73 65 20 6f 66 20 74 68 | 65 20 43 4d 50 20 69 6e |se of th|e CMP in|
|00002ba0| 73 74 72 75 63 74 69 6f | 6e 20 69 73 20 74 6f 20 |structio|n is to |
|00002bb0| 61 66 66 65 63 74 20 74 | 68 65 20 73 74 61 74 75 |affect t|he statu|
|00002bc0| 73 20 66 6c 61 67 73 2c | 20 74 68 65 20 53 20 73 |s flags,| the S s|
|00002bd0| 75 66 66 69 78 20 64 6f | 65 73 20 6e 6f 74 20 68 |uffix do|es not h|
|00002be0| 61 76 65 20 74 6f 20 62 | 65 20 75 73 65 64 2e 0a |ave to b|e used..|
|00002bf0| 44 41 54 41 18 03 00 00 | 43 4d 4e 3a 20 43 6f 6d |DATA....|CMN: Com|
|00002c00| 70 61 72 65 20 4e 65 67 | 61 74 69 76 65 0a 23 62 |pare Neg|ative.#b|
|00002c10| 61 63 6b 67 72 6f 75 6e | 64 20 77 69 6d 70 20 31 |ackgroun|d wimp 1|
|00002c20| 0a 23 77 72 61 70 20 6f | 66 66 0a 53 79 6e 74 61 |.#wrap o|ff.Synta|
|00002c30| 78 3a 20 43 4d 4e 20 5c | 7b 5c 3c 73 75 66 66 69 |x: CMN \|{\<suffi|
|00002c40| 78 5c 3e 5c 7d 20 5c 3c | 6f 70 65 72 61 6e 64 31 |x\>\} \<|operand1|
|00002c50| 5c 3e 2c 20 5c 3c 6f 70 | 65 72 61 6e 64 32 5c 3e |\>, \<op|erand2\>|
|00002c60| 0a 4f 70 65 72 61 74 69 | 6f 6e 3a 20 52 65 66 6c |.Operati|on: Refl|
|00002c70| 65 63 74 20 72 65 73 75 | 6c 74 20 6f 66 20 6f 70 |ect resu|lt of op|
|00002c80| 65 72 61 6e 64 20 6f 6e | 65 20 2d 20 28 2d 20 6f |erand on|e - (- o|
|00002c90| 70 65 72 61 6e 64 20 74 | 77 6f 29 0a 46 6c 61 67 |perand t|wo).Flag|
|00002ca0| 73 3a 20 4e 2c 5a 2c 43 | 2c 56 0a 23 77 72 61 70 |s: N,Z,C|,V.#wrap|
|00002cb0| 20 6f 6e 0a 23 6c 69 6e | 65 0a 43 4d 4e 20 69 73 | on.#lin|e.CMN is|
|00002cc0| 20 65 78 61 63 74 6c 79 | 20 74 68 65 20 73 61 6d | exactly| the sam|
|00002cd0| 65 20 61 73 20 3c 43 4d | 50 3e 2c 20 65 78 63 65 |e as <CM|P>, exce|
|00002ce0| 70 74 20 74 68 61 74 20 | 69 74 20 63 6f 6d 70 61 |pt that |it compa|
|00002cf0| 72 65 73 20 6f 70 65 72 | 61 6e 64 20 6f 6e 65 20 |res oper|and one |
|00002d00| 77 69 74 68 20 74 68 65 | 20 6e 65 67 61 74 69 76 |with the| negativ|
|00002d10| 65 20 6f 66 20 6f 70 65 | 72 61 6e 64 20 74 77 6f |e of ope|rand two|
|00002d20| 2e 0a 23 6c 69 6e 65 0a | 54 68 69 73 20 69 6e 73 |..#line.|This ins|
|00002d30| 74 72 75 63 74 69 6f 6e | 20 61 6c 6c 6f 77 73 20 |truction| allows |
|00002d40| 63 6f 6d 70 61 72 69 73 | 6f 6e 73 20 74 6f 20 62 |comparis|ons to b|
|00002d50| 65 20 6d 61 64 65 20 77 | 69 74 68 20 73 6d 61 6c |e made w|ith smal|
|00002d60| 6c 20 69 6d 6d 65 64 69 | 61 74 65 20 63 6f 6e 73 |l immedi|ate cons|
|00002d70| 74 61 6e 74 73 20 77 68 | 69 63 68 20 63 6f 75 6c |tants wh|ich coul|
|00002d80| 64 20 6e 6f 74 20 62 65 | 20 72 65 70 72 65 73 65 |d not be| represe|
|00002d90| 6e 74 65 64 20 6f 74 68 | 65 72 77 69 73 65 2e 20 |nted oth|erwise. |
|00002da0| 54 68 65 20 41 52 4d 20 | 77 69 6c 6c 20 61 75 74 |The ARM |will aut|
|00002db0| 6f 6d 61 74 69 63 61 6c | 6c 79 20 66 6f 72 6d 20 |omatical|ly form |
|00002dc0| 74 68 65 20 6e 65 67 61 | 74 69 76 65 20 6f 66 20 |the nega|tive of |
|00002dd0| 6f 70 65 72 61 6e 64 20 | 74 77 6f 20 61 6e 64 20 |operand |two and |
|00002de0| 74 68 65 6e 20 6d 61 6b | 65 20 74 68 65 20 63 6f |then mak|e the co|
|00002df0| 6d 70 61 72 69 73 6f 6e | 2e 0a 23 6c 69 6e 65 0a |mparison|..#line.|
|00002e00| 45 78 61 6d 70 6c 65 73 | 0a 23 77 72 61 70 20 6f |Examples|.#wrap o|
|00002e10| 66 66 0a 23 69 6e 64 65 | 6e 74 20 32 0a 43 4d 4e |ff.#inde|nt 2.CMN|
|00002e20| 09 52 35 2c 52 37 09 09 | 43 6f 6d 70 61 72 65 20 |.R5,R7..|Compare |
|00002e30| 52 35 20 77 69 74 68 20 | 2d 52 37 0a 43 4d 4e 09 |R5 with |-R7.CMN.|
|00002e40| 52 36 2c 23 31 09 09 43 | 6f 6d 70 61 72 65 20 52 |R6,#1..C|ompare R|
|00002e50| 36 20 77 69 74 68 20 2d | 31 0a 43 4d 4e 09 52 33 |6 with -|1.CMN.R3|
|00002e60| 2c 52 30 2c 4c 53 4c 23 | 31 09 43 6f 6d 70 61 72 |,R0,LSL#|1.Compar|
|00002e70| 65 20 52 33 20 77 69 74 | 68 20 2d 52 30 2a 32 0a |e R3 wit|h -R0*2.|
|00002e80| 23 69 6e 64 65 6e 74 0a | 23 77 72 61 70 20 6f 6e |#indent.|#wrap on|
|00002e90| 0a 2a 4e 6f 74 65 2a 3a | 20 53 69 6e 63 65 20 74 |.*Note*:| Since t|
|00002ea0| 68 65 20 70 75 72 70 6f | 73 65 20 6f 66 20 74 68 |he purpo|se of th|
|00002eb0| 65 20 43 4d 50 20 69 6e | 73 74 72 75 63 74 69 6f |e CMP in|structio|
|00002ec0| 6e 20 69 73 20 74 6f 20 | 61 66 66 65 63 74 20 74 |n is to |affect t|
|00002ed0| 68 65 20 73 74 61 74 75 | 73 20 66 6c 61 67 73 2c |he statu|s flags,|
|00002ee0| 20 74 68 65 20 53 20 73 | 75 66 66 69 78 20 64 6f | the S s|uffix do|
|00002ef0| 65 73 20 6e 6f 74 20 68 | 61 76 65 20 74 6f 20 62 |es not h|ave to b|
|00002f00| 65 20 75 73 65 64 2e 0a | 44 41 54 41 17 02 00 00 |e used..|DATA....|
|00002f10| 41 4e 44 3a 20 4c 6f 67 | 69 63 61 6c 20 41 4e 44 |AND: Log|ical AND|
|00002f20| 0a 23 62 61 63 6b 67 72 | 6f 75 6e 64 20 77 69 6d |.#backgr|ound wim|
|00002f30| 70 20 31 0a 23 77 72 61 | 70 20 6f 66 66 0a 53 79 |p 1.#wra|p off.Sy|
|00002f40| 6e 74 61 78 3a 20 41 4e | 44 20 5c 7b 5c 3c 73 75 |ntax: AN|D \{\<su|
|00002f50| 66 66 69 78 5c 3e 5c 7d | 20 5c 3c 64 65 73 74 69 |ffix\>\}| \<desti|
|00002f60| 6e 61 74 69 6f 6e 5c 3e | 2c 20 5c 3c 6f 70 65 72 |nation\>|, \<oper|
|00002f70| 61 6e 64 31 5c 3e 2c 20 | 5c 3c 6f 70 65 72 61 6e |and1\>, |\<operan|
|00002f80| 64 32 5c 3e 0a 4f 70 65 | 72 61 74 69 6f 6e 3a 20 |d2\>.Ope|ration: |
|00002f90| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 3d 20 6f 70 |destinat|ion = op|
|00002fa0| 65 72 61 6e 64 20 6f 6e | 65 20 41 4e 44 20 6f 70 |erand on|e AND op|
|00002fb0| 65 72 61 6e 64 20 74 77 | 6f 0a 46 6c 61 67 73 3a |erand tw|o.Flags:|
|00002fc0| 20 4e 2c 5a 2c 28 43 29 | 0a 23 77 72 61 70 20 6f | N,Z,(C)|.#wrap o|
|00002fd0| 6e 0a 23 6c 69 6e 65 0a | 54 68 69 73 20 6f 70 65 |n.#line.|This ope|
|00002fe0| 72 61 74 69 6f 6e 20 70 | 65 72 66 6f 72 6d 73 20 |ration p|erforms |
|00002ff0| 61 20 6c 6f 67 69 63 61 | 6c 20 62 69 74 77 69 73 |a logica|l bitwis|
|00003000| 65 20 41 4e 44 20 6f 70 | 65 72 61 74 69 6f 6e 20 |e AND op|eration |
|00003010| 62 65 74 77 65 65 6e 20 | 69 74 73 20 74 77 6f 20 |between |its two |
|00003020| 6f 70 65 72 61 6e 64 73 | 2c 20 77 69 74 68 20 74 |operands|, with t|
|00003030| 68 65 20 72 65 73 75 6c | 74 20 62 65 69 6e 67 20 |he resul|t being |
|00003040| 70 6c 61 63 65 64 20 69 | 6e 20 74 68 65 20 64 65 |placed i|n the de|
|00003050| 73 74 69 6e 61 74 69 6f | 6e 20 72 65 67 69 73 74 |stinatio|n regist|
|00003060| 65 72 2e 0a 23 6c 69 6e | 65 0a 45 78 61 6d 70 6c |er..#lin|e.Exampl|
|00003070| 65 73 3a 0a 23 77 72 61 | 70 20 6f 66 66 0a 23 49 |es:.#wra|p off.#I|
|00003080| 6e 64 65 6e 74 20 32 0a | 41 4e 44 20 09 52 30 2c |ndent 2.|AND .R0,|
|00003090| 52 31 2c 52 32 09 52 30 | 20 3d 20 52 31 20 41 4e |R1,R2.R0| = R1 AN|
|000030a0| 44 20 52 32 0a 41 4e 44 | 09 52 35 2c 52 35 2c 23 |D R2.AND|.R5,R5,#|
|000030b0| 25 31 31 31 31 09 52 35 | 20 3d 20 52 35 20 41 4e |%1111.R5| = R5 AN|
|000030c0| 44 20 25 31 31 31 31 20 | 28 63 6c 65 61 72 20 61 |D %1111 |(clear a|
|000030d0| 6c 6c 20 62 75 74 20 6c | 6f 77 20 34 20 62 69 74 |ll but l|ow 4 bit|
|000030e0| 73 29 0a 41 4e 44 53 09 | 52 34 2c 52 34 2c 23 31 |s).ANDS.|R4,R4,#1|
|000030f0| 09 52 34 20 3d 20 52 34 | 20 41 4e 44 20 31 20 28 |.R4 = R4| AND 1 (|
|00003100| 73 65 74 74 69 6e 67 20 | 66 6c 61 67 73 29 0a 23 |setting |flags).#|
|00003110| 49 6e 64 65 6e 74 0a 23 | 77 72 61 70 20 6f 6e 00 |Indent.#|wrap on.|
|00003120| 44 41 54 41 44 02 00 00 | 45 4f 52 3a 20 4c 6f 67 |DATAD...|EOR: Log|
|00003130| 69 63 61 6c 20 45 78 63 | 6c 75 73 69 76 65 20 4f |ical Exc|lusive O|
|00003140| 52 0a 23 62 61 63 6b 67 | 72 6f 75 6e 64 20 77 69 |R.#backg|round wi|
|00003150| 6d 70 20 31 0a 23 77 72 | 61 70 20 6f 66 66 0a 53 |mp 1.#wr|ap off.S|
|00003160| 79 6e 74 61 78 3a 20 45 | 4f 52 20 5c 7b 5c 3c 73 |yntax: E|OR \{\<s|
|00003170| 75 66 66 69 78 5c 3e 5c | 7d 20 5c 3c 64 65 73 74 |uffix\>\|} \<dest|
|00003180| 69 6e 61 74 69 6f 6e 5c | 3e 2c 20 5c 3c 6f 70 65 |ination\|>, \<ope|
|00003190| 72 61 6e 64 31 5c 3e 2c | 20 5c 3c 6f 70 65 72 61 |rand1\>,| \<opera|
|000031a0| 6e 64 32 5c 3e 0a 4f 70 | 65 72 61 74 69 6f 6e 3a |nd2\>.Op|eration:|
|000031b0| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 3d 20 6f | destina|tion = o|
|000031c0| 70 65 72 61 6e 64 20 6f | 6e 65 20 45 4f 52 20 6f |perand o|ne EOR o|
|000031d0| 70 65 72 61 6e 64 20 74 | 77 6f 0a 46 6c 61 67 73 |perand t|wo.Flags|
|000031e0| 3a 20 4e 2c 5a 2c 28 43 | 29 0a 23 77 72 61 70 20 |: N,Z,(C|).#wrap |
|000031f0| 6f 6e 0a 23 6c 69 6e 65 | 0a 54 68 69 73 20 6f 70 |on.#line|.This op|
|00003200| 65 72 61 74 69 6f 6e 20 | 70 65 72 66 6f 72 6d 73 |eration |performs|
|00003210| 20 61 20 6c 6f 67 69 63 | 61 6c 20 62 69 74 77 69 | a logic|al bitwi|
|00003220| 73 65 20 45 4f 52 20 6f | 70 65 72 61 74 69 6f 6e |se EOR o|peration|
|00003230| 20 62 65 74 77 65 65 6e | 20 69 74 73 20 74 77 6f | between| its two|
|00003240| 20 6f 70 65 72 61 6e 64 | 73 2c 20 77 69 74 68 20 | operand|s, with |
|00003250| 74 68 65 20 72 65 73 75 | 6c 74 20 62 65 69 6e 67 |the resu|lt being|
|00003260| 20 70 6c 61 63 65 64 20 | 69 6e 20 74 68 65 20 64 | placed |in the d|
|00003270| 65 73 74 69 6e 61 74 69 | 6f 6e 20 72 65 67 69 73 |estinati|on regis|
|00003280| 74 65 72 2e 0a 23 6c 69 | 6e 65 0a 2a 4e 6f 74 65 |ter..#li|ne.*Note|
|00003290| 2a 3a 20 45 4f 52 20 69 | 73 20 76 65 72 79 20 75 |*: EOR i|s very u|
|000032a0| 73 65 66 75 6c 20 69 6e | 20 27 74 6f 67 67 6c 69 |seful in| 'toggli|
|000032b0| 6e 67 27 20 64 61 74 61 | 20 62 65 74 77 65 65 6e |ng' data| between|
|000032c0| 20 74 77 6f 20 70 72 65 | 2d 64 65 66 69 6e 65 64 | two pre|-defined|
|000032d0| 20 76 61 6c 75 65 73 2e | 20 46 6f 72 20 65 78 61 | values.| For exa|
|000032e0| 6d 70 6c 65 2c 20 74 68 | 65 20 72 65 67 69 73 74 |mple, th|e regist|
|000032f0| 65 72 20 52 30 20 63 61 | 6e 20 62 65 20 74 6f 67 |er R0 ca|n be tog|
|00003300| 67 6c 65 64 20 62 65 74 | 77 65 65 6e 20 36 35 20 |gled bet|ween 65 |
|00003310| 61 6e 64 20 39 30 20 62 | 79 20 45 4f 52 69 6e 67 |and 90 b|y EORing|
|00003320| 20 69 74 73 20 63 6f 6e | 74 65 6e 74 73 20 77 69 | its con|tents wi|
|00003330| 74 68 20 32 37 3a 0a 23 | 49 6e 64 65 6e 74 20 34 |th 27:.#|Indent 4|
|00003340| 0a 2e 6c 6f 6f 70 0a 45 | 4f 52 20 52 30 2c 52 30 |..loop.E|OR R0,R0|
|00003350| 2c 23 32 37 0a 42 20 6c | 6f 6f 70 0a 23 49 6e 64 |,#27.B l|oop.#Ind|
|00003360| 65 6e 74 0a 44 41 54 41 | 72 02 00 00 4f 52 52 3a |ent.DATA|r...ORR:|
|00003370| 20 4c 6f 67 69 63 61 6c | 20 4f 52 0a 23 62 61 63 | Logical| OR.#bac|
|00003380| 6b 67 72 6f 75 6e 64 20 | 77 69 6d 70 20 31 0a 23 |kground |wimp 1.#|
|00003390| 77 72 61 70 20 6f 66 66 | 0a 53 79 6e 74 61 78 3a |wrap off|.Syntax:|
|000033a0| 20 4f 52 52 20 5c 7b 5c | 3c 73 75 66 66 69 78 5c | ORR \{\|<suffix\|
|000033b0| 3e 5c 7d 20 5c 3c 64 65 | 73 74 69 6e 61 74 69 6f |>\} \<de|stinatio|
|000033c0| 6e 5c 3e 2c 20 5c 3c 6f | 70 65 72 61 6e 64 31 5c |n\>, \<o|perand1\|
|000033d0| 3e 2c 20 5c 3c 6f 70 65 | 72 61 6e 64 32 5c 3e 0a |>, \<ope|rand2\>.|
|000033e0| 4f 70 65 72 61 74 69 6f | 6e 3a 20 64 65 73 74 69 |Operatio|n: desti|
|000033f0| 6e 61 74 69 6f 6e 20 3d | 20 6f 70 65 72 61 6e 64 |nation =| operand|
|00003400| 20 6f 6e 65 20 4f 52 20 | 6f 70 65 72 61 6e 64 20 | one OR |operand |
|00003410| 74 77 6f 0a 46 6c 61 67 | 73 3a 20 4e 2c 5a 2c 28 |two.Flag|s: N,Z,(|
|00003420| 43 29 0a 23 77 72 61 70 | 20 6f 6e 0a 23 6c 69 6e |C).#wrap| on.#lin|
|00003430| 65 0a 54 68 69 73 20 69 | 6e 73 74 72 75 63 74 69 |e.This i|nstructi|
|00003440| 6f 6e 20 70 65 72 66 6f | 72 6d 73 20 61 20 6c 6f |on perfo|rms a lo|
|00003450| 67 69 63 61 6c 20 62 69 | 74 77 69 73 65 20 4f 52 |gical bi|twise OR|
|00003460| 20 6f 70 65 72 61 74 69 | 6f 6e 20 62 65 74 77 65 | operati|on betwe|
|00003470| 65 6e 20 69 74 73 20 74 | 77 6f 20 6f 70 65 72 61 |en its t|wo opera|
|00003480| 6e 64 73 2c 20 77 69 74 | 68 20 74 68 65 20 72 65 |nds, wit|h the re|
|00003490| 73 75 6c 74 20 62 65 69 | 6e 67 20 70 6c 61 63 65 |sult bei|ng place|
|000034a0| 64 20 69 6e 20 74 68 65 | 20 64 65 73 74 69 6e 61 |d in the| destina|
|000034b0| 74 69 6f 6e 20 72 65 67 | 69 73 74 65 72 2e 0a 23 |tion reg|ister..#|
|000034c0| 6c 69 6e 65 0a 2a 4e 6f | 74 65 2a 3a 20 54 68 69 |line.*No|te*: Thi|
|000034d0| 73 20 6f 70 65 72 61 74 | 69 6f 6e 20 69 73 20 70 |s operat|ion is p|
|000034e0| 61 72 74 69 63 75 6c 61 | 72 6c 79 20 75 73 65 66 |articula|rly usef|
|000034f0| 75 6c 20 66 6f 72 20 66 | 6f 72 63 69 6e 67 20 63 |ul for f|orcing c|
|00003500| 65 72 74 61 69 6e 20 62 | 69 74 73 20 74 6f 20 62 |ertain b|its to b|
|00003510| 65 20 73 65 74 20 69 6e | 20 61 20 64 61 74 61 20 |e set in| a data |
|00003520| 77 6f 72 64 2e 0a 23 6c | 69 6e 65 0a 45 78 61 6d |word..#l|ine.Exam|
|00003530| 70 6c 65 73 3a 0a 23 77 | 72 61 70 20 6f 66 66 0a |ples:.#w|rap off.|
|00003540| 23 49 6e 64 65 6e 74 20 | 32 0a 4f 52 52 09 52 30 |#Indent |2.ORR.R0|
|00003550| 2c 52 31 31 2c 52 32 09 | 52 30 20 3d 20 52 31 31 |,R11,R2.|R0 = R11|
|00003560| 20 4f 52 20 52 32 0a 4f | 52 52 09 52 37 2c 52 37 | OR R2.O|RR.R7,R7|
|00003570| 2c 23 25 31 31 30 30 09 | 52 37 20 3d 20 52 37 20 |,#%1100.|R7 = R7 |
|00003580| 4f 52 20 25 31 31 30 30 | 20 28 73 65 74 20 62 69 |OR %1100| (set bi|
|00003590| 74 73 20 32 20 26 20 33 | 29 0a 4f 52 52 53 09 52 |ts 2 & 3|).ORRS.R|
|000035a0| 35 2c 52 35 2c 23 32 09 | 52 35 20 3d 20 52 35 20 |5,R5,#2.|R5 = R5 |
|000035b0| 4f 52 20 23 32 20 28 73 | 65 74 74 69 6e 67 20 66 |OR #2 (s|etting f|
|000035c0| 6c 61 67 73 29 0a 23 49 | 6e 64 65 6e 74 0a 23 77 |lags).#I|ndent.#w|
|000035d0| 72 61 70 20 6f 6e 00 00 | 44 41 54 41 8a 03 00 00 |rap on..|DATA....|
|000035e0| 42 49 43 3a 20 42 69 74 | 20 43 6c 65 61 72 0a 23 |BIC: Bit| Clear.#|
|000035f0| 62 61 63 6b 67 72 6f 75 | 6e 64 20 77 69 6d 70 20 |backgrou|nd wimp |
|00003600| 31 0a 23 77 72 61 70 20 | 6f 66 66 0a 53 79 6e 74 |1.#wrap |off.Synt|
|00003610| 61 78 3a 20 42 49 43 20 | 5c 7b 5c 3c 73 75 66 66 |ax: BIC |\{\<suff|
|00003620| 69 78 5c 3e 5c 7d 20 5c | 3c 64 65 73 74 69 6e 61 |ix\>\} \|<destina|
|00003630| 74 69 6f 6e 5c 3e 2c 20 | 5c 3c 6f 70 65 72 61 6e |tion\>, |\<operan|
|00003640| 64 31 5c 3e 2c 20 5c 3c | 6f 70 65 72 61 6e 64 32 |d1\>, \<|operand2|
|00003650| 5c 3e 0a 4f 70 65 72 61 | 74 69 6f 6e 3a 20 64 65 |\>.Opera|tion: de|
|00003660| 73 74 69 6e 61 74 69 6f | 6e 20 3d 20 6f 70 65 72 |stinatio|n = oper|
|00003670| 61 6e 64 20 6f 6e 65 20 | 41 4e 44 20 28 4e 4f 54 |and one |AND (NOT|
|00003680| 20 28 6f 70 65 72 61 6e | 64 20 74 77 6f 29 29 0a | (operan|d two)).|
|00003690| 46 6c 61 67 73 3a 20 4e | 2c 5a 2c 28 43 29 0a 23 |Flags: N|,Z,(C).#|
|000036a0| 77 72 61 70 20 6f 6e 0a | 23 6c 69 6e 65 0a 54 68 |wrap on.|#line.Th|
|000036b0| 69 73 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 20 70 |is instr|uction p|
|000036c0| 72 6f 76 69 64 65 73 20 | 61 20 75 73 65 66 75 6c |rovides |a useful|
|000036d0| 20 77 61 79 20 6f 66 20 | 63 6c 65 61 72 69 6e 67 | way of |clearing|
|000036e0| 20 63 65 72 74 61 69 6e | 20 62 69 74 73 20 77 69 | certain| bits wi|
|000036f0| 74 68 69 6e 20 61 20 64 | 61 74 61 20 77 6f 72 64 |thin a d|ata word|
|00003700| 2c 20 77 68 69 6c 65 20 | 6c 65 61 76 69 6e 67 20 |, while |leaving |
|00003710| 6f 74 68 65 72 73 20 75 | 6e 63 68 61 6e 67 65 64 |others u|nchanged|
|00003720| 2e 20 4f 70 65 72 61 6e | 64 20 6f 6e 65 20 69 73 |. Operan|d one is|
|00003730| 20 74 68 65 20 64 61 74 | 61 20 66 69 65 6c 64 20 | the dat|a field |
|00003740| 74 6f 20 62 65 20 6d 6f | 64 69 66 69 65 64 2c 20 |to be mo|dified, |
|00003750| 77 69 74 68 20 74 68 65 | 20 72 65 73 75 6c 74 20 |with the| result |
|00003760| 62 65 69 6e 67 20 70 6c | 61 63 65 64 20 69 6e 20 |being pl|aced in |
|00003770| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|00003780| 72 65 67 69 73 74 65 72 | 2e 0a 23 6c 69 6e 65 0a |register|..#line.|
|00003790| 4f 70 65 72 61 6e 64 20 | 74 77 6f 20 69 73 20 61 |Operand |two is a|
|000037a0| 20 33 32 2d 62 69 74 20 | 77 6f 72 64 20 63 61 6c | 32-bit |word cal|
|000037b0| 6c 65 64 20 74 68 65 20 | 64 61 74 61 20 6d 61 73 |led the |data mas|
|000037c0| 6b 2e 20 41 20 73 65 74 | 20 62 69 74 20 69 6e 20 |k. A set| bit in |
|000037d0| 74 68 65 20 62 69 74 20 | 6d 61 73 6b 20 77 69 6c |the bit |mask wil|
|000037e0| 6c 20 66 6f 72 63 65 20 | 74 68 65 20 63 6f 72 72 |l force |the corr|
|000037f0| 65 73 70 6f 6e 64 69 6e | 67 20 62 69 74 20 69 6e |espondin|g bit in|
|00003800| 20 74 68 65 20 64 61 74 | 61 20 77 6f 72 64 20 74 | the dat|a word t|
|00003810| 6f 20 62 65 20 72 65 73 | 65 74 20 77 68 65 6e 20 |o be res|et when |
|00003820| 74 68 65 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |the inst|ruction |
|00003830| 69 73 20 65 78 65 63 75 | 74 65 64 2e 20 41 20 7a |is execu|ted. A z|
|00003840| 65 72 6f 20 62 69 74 20 | 69 6e 20 74 68 65 20 6d |ero bit |in the m|
|00003850| 61 73 6b 20 77 69 6c 6c | 20 6c 65 61 76 65 20 74 |ask will| leave t|
|00003860| 68 65 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |he corre|sponding|
|00003870| 20 62 69 74 20 69 6e 20 | 74 68 65 20 64 61 74 61 | bit in |the data|
|00003880| 20 77 6f 72 64 20 69 6e | 20 69 74 73 20 6f 72 69 | word in| its ori|
|00003890| 67 69 6e 61 6c 20 73 74 | 61 74 65 2e 0a 23 6c 69 |ginal st|ate..#li|
|000038a0| 6e 65 0a 45 78 61 6d 70 | 6c 65 73 3a 0a 23 77 72 |ne.Examp|les:.#wr|
|000038b0| 61 70 20 6f 66 66 0a 23 | 49 6e 64 65 6e 74 20 32 |ap off.#|Indent 2|
|000038c0| 0a 42 49 43 09 52 30 2c | 52 30 2c 23 25 31 31 31 |.BIC.R0,|R0,#%111|
|000038d0| 31 09 43 6c 65 61 72 20 | 6c 6f 77 20 34 20 62 69 |1.Clear |low 4 bi|
|000038e0| 74 73 20 6f 66 20 52 30 | 0a 42 49 43 09 52 31 2c |ts of R0|.BIC.R1,|
|000038f0| 52 31 2c 52 32 09 43 6c | 65 61 72 20 62 69 74 73 |R1,R2.Cl|ear bits|
|00003900| 20 69 6e 20 52 31 20 77 | 68 69 63 68 20 77 65 72 | in R1 w|hich wer|
|00003910| 65 20 73 65 74 20 69 6e | 20 52 32 0a 42 49 43 09 |e set in| R2.BIC.|
|00003920| 52 36 2c 52 36 2c 52 36 | 09 43 6c 65 61 72 20 62 |R6,R6,R6|.Clear b|
|00003930| 69 74 73 20 77 68 69 63 | 68 20 77 65 72 65 20 73 |its whic|h were s|
|00003940| 65 74 20 69 6e 20 52 36 | 20 28 52 36 20 3d 20 30 |et in R6| (R6 = 0|
|00003950| 29 0a 23 49 6e 64 65 6e | 74 0a 23 77 72 61 70 20 |).#Inden|t.#wrap |
|00003960| 6f 6e 00 00 44 41 54 41 | 6f 03 00 00 54 53 54 3a |on..DATA|o...TST:|
|00003970| 20 54 65 73 74 20 42 69 | 74 73 0a 23 62 61 63 6b | Test Bi|ts.#back|
|00003980| 67 72 6f 75 6e 64 20 77 | 69 6d 70 20 31 0a 23 77 |ground w|imp 1.#w|
|00003990| 72 61 70 20 6f 66 66 0a | 53 79 6e 74 61 78 3a 20 |rap off.|Syntax: |
|000039a0| 54 53 54 20 5c 7b 5c 3c | 73 75 66 66 69 78 5c 3e |TST \{\<|suffix\>|
|000039b0| 5c 7d 20 5c 3c 6f 70 65 | 72 61 6e 64 31 5c 3e 2c |\} \<ope|rand1\>,|
|000039c0| 20 5c 3c 6f 70 65 72 61 | 6e 64 32 5c 3e 0a 4f 70 | \<opera|nd2\>.Op|
|000039d0| 65 72 61 74 69 6f 6e 3a | 20 52 65 66 6c 65 63 74 |eration:| Reflect|
|000039e0| 20 72 65 73 75 6c 74 20 | 6f 66 20 6f 70 65 72 61 | result |of opera|
|000039f0| 6e 64 20 6f 6e 65 20 41 | 4e 44 20 6f 70 65 72 61 |nd one A|ND opera|
|00003a00| 6e 64 20 74 77 6f 0a 46 | 6c 61 67 73 3a 20 4e 2c |nd two.F|lags: N,|
|00003a10| 5a 2c 28 43 29 0a 23 77 | 72 61 70 20 6f 6e 0a 23 |Z,(C).#w|rap on.#|
|00003a20| 6c 69 6e 65 0a 54 68 69 | 73 20 69 6e 73 74 72 75 |line.Thi|s instru|
|00003a30| 63 74 69 6f 6e 20 70 65 | 72 66 6f 72 6d 73 20 74 |ction pe|rforms t|
|00003a40| 68 65 20 6c 6f 67 69 63 | 61 6c 20 62 69 74 77 69 |he logic|al bitwi|
|00003a50| 73 65 20 41 4e 44 69 6e | 67 20 6f 66 20 6f 70 65 |se ANDin|g of ope|
|00003a60| 72 61 6e 64 73 20 6f 6e | 65 20 61 6e 64 20 74 77 |rands on|e and tw|
|00003a70| 6f 2c 20 62 75 74 20 64 | 6f 65 73 20 6e 6f 74 20 |o, but d|oes not |
|00003a80| 73 74 6f 72 65 20 74 68 | 65 20 72 65 73 75 6c 74 |store th|e result|
|00003a90| 20 61 6e 79 77 68 65 72 | 65 20 2d 20 69 6e 73 74 | anywher|e - inst|
|00003aa0| 65 61 64 20 74 68 65 20 | 73 74 61 74 75 73 20 66 |ead the |status f|
|00003ab0| 6c 61 67 73 20 61 72 65 | 20 61 6c 74 65 72 65 64 |lags are| altered|
|00003ac0| 20 74 6f 20 72 65 66 6c | 65 63 74 20 74 68 65 20 | to refl|ect the |
|00003ad0| 72 65 73 75 6c 74 2e 0a | 23 6c 69 6e 65 0a 54 53 |result..|#line.TS|
|00003ae0| 54 20 63 61 6e 20 62 65 | 20 75 73 65 64 20 74 6f |T can be| used to|
|00003af0| 20 73 65 65 20 69 66 20 | 61 20 70 61 72 74 69 63 | see if |a partic|
|00003b00| 75 6c 61 72 20 62 69 74 | 20 69 6e 20 61 20 64 61 |ular bit| in a da|
|00003b10| 74 61 20 77 6f 72 64 20 | 69 73 20 73 65 74 20 6f |ta word |is set o|
|00003b20| 72 20 63 6c 65 61 72 2e | 20 54 68 65 20 64 61 74 |r clear.| The dat|
|00003b30| 61 20 77 6f 72 64 20 66 | 6f 72 6d 73 20 6f 6e 65 |a word f|orms one|
|00003b40| 20 6f 70 65 72 61 6e 64 | 2e 20 41 20 62 69 74 20 | operand|. A bit |
|00003b50| 6d 61 73 6b 2c 20 69 6e | 20 77 68 69 63 68 20 74 |mask, in| which t|
|00003b60| 68 65 20 61 70 70 72 6f | 70 72 69 61 74 65 20 62 |he appro|priate b|
|00003b70| 69 74 20 69 73 20 65 74 | 2c 20 66 6f 72 6d 73 20 |it is et|, forms |
|00003b80| 74 68 65 20 6f 74 68 65 | 72 20 6f 70 65 72 61 6e |the othe|r operan|
|00003b90| 64 2e 20 41 66 74 65 72 | 20 74 68 65 20 54 53 54 |d. After| the TST|
|00003ba0| 20 6f 70 65 72 61 74 69 | 6f 6e 20 74 68 65 20 5a | operati|on the Z|
|00003bb0| 20 66 6c 61 67 20 77 69 | 6c 6c 20 62 65 20 73 65 | flag wi|ll be se|
|00003bc0| 74 20 69 66 20 74 68 65 | 20 62 69 74 20 69 73 20 |t if the| bit is |
|00003bd0| 73 65 74 20 69 6e 20 74 | 68 65 20 64 61 74 61 20 |set in t|he data |
|00003be0| 77 6f 72 64 2c 20 63 6c | 65 61 72 20 69 66 20 69 |word, cl|ear if i|
|00003bf0| 74 20 69 73 20 6e 6f 74 | 2e 0a 23 6c 69 6e 65 0a |t is not|..#line.|
|00003c00| 45 78 61 6d 70 6c 65 73 | 3a 0a 23 77 72 61 70 20 |Examples|:.#wrap |
|00003c10| 6f 66 66 0a 23 49 6e 64 | 65 6e 74 20 32 0a 54 53 |off.#Ind|ent 2.TS|
|00003c20| 54 09 52 31 2c 23 25 31 | 30 30 30 09 54 65 73 74 |T.R1,#%1|000.Test|
|00003c30| 20 74 6f 20 73 65 65 20 | 69 66 20 62 69 74 20 33 | to see |if bit 3|
|00003c40| 20 69 73 20 73 65 74 20 | 69 6e 20 52 31 0a 54 53 | is set |in R1.TS|
|00003c50| 54 09 52 33 2c 52 34 09 | 09 54 65 73 74 20 69 66 |T.R3,R4.|.Test if|
|00003c60| 20 61 6e 79 20 62 69 74 | 73 20 73 65 74 20 69 6e | any bit|s set in|
|00003c70| 20 62 6f 74 68 20 52 33 | 20 61 6e 64 20 52 34 0a | both R3| and R4.|
|00003c80| 23 49 6e 64 65 6e 74 0a | 23 77 72 61 70 20 6f 6e |#Indent.|#wrap on|
|00003c90| 0a 2a 4e 6f 74 65 2a 3a | 20 54 68 69 73 20 69 73 |.*Note*:| This is|
|00003ca0| 20 61 6e 6f 74 68 65 72 | 20 69 6e 73 74 72 75 63 | another| instruc|
|00003cb0| 74 69 6f 6e 20 77 68 65 | 72 65 20 74 68 65 20 53 |tion whe|re the S|
|00003cc0| 20 73 75 66 66 69 78 20 | 69 73 20 69 6d 70 6c 69 | suffix |is impli|
|00003cd0| 65 64 2e 00 44 41 54 41 | 02 03 00 00 54 45 51 3a |ed..DATA|....TEQ:|
|00003ce0| 20 54 65 73 74 20 45 71 | 75 69 76 61 6c 65 6e 63 | Test Eq|uivalenc|
|00003cf0| 65 0a 23 62 61 63 6b 67 | 72 6f 75 6e 64 20 77 69 |e.#backg|round wi|
|00003d00| 6d 70 20 31 0a 23 77 72 | 61 70 20 6f 66 66 0a 53 |mp 1.#wr|ap off.S|
|00003d10| 79 6e 74 61 78 3a 20 54 | 45 51 20 5c 7b 5c 3c 73 |yntax: T|EQ \{\<s|
|00003d20| 75 66 66 69 78 5c 3e 5c | 7d 20 5c 3c 6f 70 65 72 |uffix\>\|} \<oper|
|00003d30| 61 6e 64 31 5c 3e 2c 20 | 5c 3c 6f 70 65 72 61 6e |and1\>, |\<operan|
|00003d40| 64 32 5c 3e 0a 4f 70 65 | 72 61 74 69 6f 6e 3a 20 |d2\>.Ope|ration: |
|00003d50| 52 65 66 6c 65 63 74 20 | 72 65 73 75 6c 74 20 6f |Reflect |result o|
|00003d60| 66 20 6f 70 65 72 61 6e | 64 20 6f 6e 65 20 45 4f |f operan|d one EO|
|00003d70| 52 20 6f 70 65 72 61 6e | 64 20 74 77 6f 0a 46 6c |R operan|d two.Fl|
|00003d80| 61 67 73 3a 20 4e 2c 5a | 2c 28 43 29 0a 23 77 72 |ags: N,Z|,(C).#wr|
|00003d90| 61 70 20 6f 6e 0a 23 6c | 69 6e 65 0a 54 68 69 73 |ap on.#l|ine.This|
|00003da0| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 69 73 20 | instruc|tion is |
|00003db0| 76 65 72 79 20 73 69 6d | 69 6c 61 72 20 74 6f 20 |very sim|ilar to |
|00003dc0| 3c 54 53 54 3e 2e 20 54 | 68 65 20 6f 6e 6c 79 20 |<TST>. T|he only |
|00003dd0| 64 69 66 66 65 72 65 6e | 63 65 20 69 73 20 74 68 |differen|ce is th|
|00003de0| 61 74 20 69 74 20 70 65 | 72 66 6f 72 6d 73 20 61 |at it pe|rforms a|
|00003df0| 20 6e 6f 74 69 6f 6e 61 | 6c 20 45 4f 52 20 6f 70 | notiona|l EOR op|
|00003e00| 65 72 61 74 69 6f 6e 20 | 62 65 74 77 65 65 6e 20 |eration |between |
|00003e10| 69 74 73 20 6f 70 65 72 | 61 6e 64 73 2c 20 69 6e |its oper|ands, in|
|00003e20| 73 74 65 61 64 20 6f 66 | 20 61 6e 20 41 4e 44 2e |stead of| an AND.|
|00003e30| 20 54 68 65 20 54 45 51 | 20 69 6e 73 74 72 75 63 | The TEQ| instruc|
|00003e40| 74 69 6f 6e 20 63 61 6e | 20 62 65 20 75 73 65 64 |tion can| be used|
|00003e50| 20 74 6f 20 73 65 65 20 | 69 66 20 74 68 65 20 62 | to see |if the b|
|00003e60| 69 74 73 20 69 6e 20 74 | 77 6f 20 64 61 74 61 20 |its in t|wo data |
|00003e70| 77 6f 72 64 73 20 61 72 | 65 20 74 68 65 20 73 61 |words ar|e the sa|
|00003e80| 6d 65 20 6f 72 20 6e 6f | 74 2e 0a 23 6c 69 6e 65 |me or no|t..#line|
|00003e90| 0a 54 68 69 73 20 63 6f | 6d 70 61 72 69 73 6f 6e |.This co|mparison|
|00003ea0| 20 77 6f 75 6c 64 20 6e | 6f 72 6d 61 6c 6c 79 20 | would n|ormally |
|00003eb0| 62 65 20 70 65 72 66 6f | 72 6d 65 64 20 75 73 69 |be perfo|rmed usi|
|00003ec0| 6e 67 20 3c 43 4d 50 3e | 2e 20 48 6f 77 65 76 65 |ng <CMP>|. Howeve|
|00003ed0| 72 20 54 45 51 20 64 6f | 65 73 20 6e 6f 74 20 61 |r TEQ do|es not a|
|00003ee0| 66 66 65 63 74 20 74 68 | 65 20 63 61 72 72 79 20 |ffect th|e carry |
|00003ef0| 66 6c 61 67 2c 20 77 68 | 69 63 68 20 6d 61 79 20 |flag, wh|ich may |
|00003f00| 73 6f 6d 65 74 69 6d 65 | 73 20 62 65 20 75 73 65 |sometime|s be use|
|00003f10| 66 75 6c 2e 0a 23 6c 69 | 6e 65 0a 45 78 61 6d 70 |ful..#li|ne.Examp|
|00003f20| 6c 65 73 3a 0a 23 77 72 | 61 70 20 6f 66 66 0a 23 |les:.#wr|ap off.#|
|00003f30| 49 6e 64 65 6e 74 20 32 | 0a 54 45 51 09 52 31 2c |Indent 2|.TEQ.R1,|
|00003f40| 23 35 09 09 54 65 73 74 | 20 74 6f 20 73 65 65 20 |#5..Test| to see |
|00003f50| 69 66 20 52 31 20 63 6f | 6e 74 61 69 6e 73 20 35 |if R1 co|ntains 5|
|00003f60| 0a 54 45 51 09 52 33 2c | 52 34 09 09 54 65 73 74 |.TEQ.R3,|R4..Test|
|00003f70| 20 74 6f 20 73 65 65 20 | 69 66 20 52 33 20 3d 20 | to see |if R3 = |
|00003f80| 52 34 0a 23 49 6e 64 65 | 6e 74 0a 23 77 72 61 70 |R4.#Inde|nt.#wrap|
|00003f90| 20 6f 6e 0a 2a 4e 6f 74 | 65 2a 3a 20 54 68 69 73 | on.*Not|e*: This|
|00003fa0| 20 69 73 20 61 6e 6f 74 | 68 65 72 20 69 6e 73 74 | is anot|her inst|
|00003fb0| 72 75 63 74 69 6f 6e 20 | 77 68 65 72 65 20 74 68 |ruction |where th|
|00003fc0| 65 20 53 20 73 75 66 66 | 69 78 20 69 73 20 69 6d |e S suff|ix is im|
|00003fd0| 70 6c 69 65 64 2e 00 00 | 44 41 54 41 6b 03 00 00 |plied...|DATAk...|
|00003fe0| 4d 4c 41 3a 20 4d 75 6c | 74 69 70 6c 69 63 61 74 |MLA: Mul|tiplicat|
|00003ff0| 69 6f 6e 20 77 69 74 68 | 20 41 63 63 75 6d 75 6c |ion with| Accumul|
|00004000| 61 74 65 0a 23 62 61 63 | 6b 67 72 6f 75 6e 64 20 |ate.#bac|kground |
|00004010| 77 69 6d 70 20 31 0a 23 | 77 72 61 70 20 6f 66 66 |wimp 1.#|wrap off|
|00004020| 0a 53 79 6e 74 61 78 3a | 20 4d 4c 41 20 5c 7b 5c |.Syntax:| MLA \{\|
|00004030| 3c 73 75 66 66 69 78 5c | 3e 5c 7d 20 5c 3c 64 65 |<suffix\|>\} \<de|
|00004040| 73 74 69 6e 61 74 69 6f | 6e 5c 3e 2c 20 5c 3c 6f |stinatio|n\>, \<o|
|00004050| 70 65 72 61 6e 64 31 5c | 3e 2c 20 5c 3c 6f 70 65 |perand1\|>, \<ope|
|00004060| 72 61 6e 64 32 5c 3e 2c | 20 5c 3c 73 75 6d 5c 3e |rand2\>,| \<sum\>|
|00004070| 0a 4f 70 65 72 61 74 69 | 6f 6e 3a 20 64 65 73 74 |.Operati|on: dest|
|00004080| 69 6e 61 74 69 6f 6e 20 | 3d 20 28 6f 70 65 72 61 |ination |= (opera|
|00004090| 6e 64 20 6f 6e 65 20 2a | 20 6f 70 65 72 61 6e 64 |nd one *| operand|
|000040a0| 20 74 77 6f 29 20 2b 20 | 73 75 6d 0a 46 6c 61 67 | two) + |sum.Flag|
|000040b0| 73 3a 20 4e 2c 5a 20 5b | 56 20 2d 20 75 6e 63 68 |s: N,Z [|V - unch|
|000040c0| 61 6e 67 65 64 3b 20 43 | 20 2d 20 75 6e 64 65 66 |anged; C| - undef|
|000040d0| 69 6e 65 64 5d 0a 23 77 | 72 61 70 20 6f 6e 0a 23 |ined].#w|rap on.#|
|000040e0| 6c 69 6e 65 0a 54 68 69 | 73 20 69 6e 73 74 72 75 |line.Thi|s instru|
|000040f0| 63 74 69 6f 6e 20 69 73 | 20 73 69 6d 69 6c 61 72 |ction is| similar|
|00004100| 20 74 6f 20 3c 4d 55 4c | 3e 2c 20 74 68 65 20 64 | to <MUL|>, the d|
|00004110| 69 66 66 65 72 65 6e 63 | 65 20 62 65 69 6e 67 20 |ifferenc|e being |
|00004120| 74 68 61 74 20 74 68 65 | 20 63 6f 6e 74 65 6e 74 |that the| content|
|00004130| 73 20 6f 66 20 74 68 65 | 20 72 65 67 69 73 74 65 |s of the| registe|
|00004140| 72 20 67 69 76 65 6e 20 | 69 6e 20 74 68 65 20 73 |r given |in the s|
|00004150| 75 6d 20 66 69 65 6c 64 | 20 61 72 65 20 61 64 64 |um field| are add|
|00004160| 65 64 20 69 6e 74 6f 20 | 74 68 65 20 72 65 73 75 |ed into |the resu|
|00004170| 6c 74 20 6f 66 20 74 68 | 65 20 6d 75 6c 74 69 70 |lt of th|e multip|
|00004180| 6c 69 63 61 74 69 6f 6e | 20 62 65 66 6f 72 65 20 |lication| before |
|00004190| 73 74 6f 72 69 6e 67 20 | 69 74 20 69 6e 20 74 68 |storing |it in th|
|000041a0| 65 20 64 65 73 74 69 6e | 61 74 69 6f 6e 20 72 65 |e destin|ation re|
|000041b0| 67 69 73 74 65 72 2e 20 | 54 68 65 20 72 65 73 74 |gister. |The rest|
|000041c0| 72 69 63 74 69 6f 6e 73 | 20 77 68 69 63 68 20 61 |rictions| which a|
|000041d0| 70 70 6c 79 20 74 6f 20 | 3c 4d 55 4c 3e 20 61 6c |pply to |<MUL> al|
|000041e0| 73 6f 20 61 70 70 6c 79 | 20 74 6f 20 4d 4c 41 2e |so apply| to MLA.|
|000041f0| 0a 23 6c 69 6e 65 0a 4d | 4c 41 20 69 73 20 75 73 |.#line.M|LA is us|
|00004200| 65 64 20 74 6f 20 6b 65 | 65 70 20 61 20 72 75 6e |ed to ke|ep a run|
|00004210| 6e 69 6e 67 20 74 6f 74 | 61 6c 20 6f 66 20 61 20 |ning tot|al of a |
|00004220| 73 65 72 69 65 73 20 6f | 66 20 6d 75 6c 74 69 70 |series o|f multip|
|00004230| 6c 69 63 61 74 69 6f 6e | 73 2e 20 49 66 20 74 68 |lication|s. If th|
|00004240| 65 20 73 75 6d 20 72 65 | 67 69 73 74 65 72 20 69 |e sum re|gister i|
|00004250| 73 20 73 70 65 63 69 66 | 69 65 64 20 61 73 20 62 |s specif|ied as b|
|00004260| 65 69 6e 67 20 74 68 65 | 20 73 61 6d 65 20 61 73 |eing the| same as|
|00004270| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00004280| 2c 20 74 68 65 6e 20 74 | 68 65 20 72 65 73 75 6c |, then t|he resul|
|00004290| 74 20 6f 66 20 65 61 63 | 68 20 6d 75 6c 74 69 70 |t of eac|h multip|
|000042a0| 6c 69 63 61 74 69 6f 6e | 20 77 69 6c 6c 20 62 65 |lication| will be|
|000042b0| 20 61 63 63 75 6d 75 6c | 61 74 65 64 20 69 6e 20 | accumul|ated in |
|000042c0| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|000042d0| 72 65 67 69 73 74 65 72 | 2e 0a 23 6c 69 6e 65 0a |register|..#line.|
|000042e0| 45 78 61 6d 70 6c 65 73 | 3a 0a 23 49 6e 64 65 6e |Examples|:.#Inden|
|000042f0| 74 20 32 0a 4d 4c 41 09 | 52 30 2c 52 31 2c 52 32 |t 2.MLA.|R0,R1,R2|
|00004300| 2c 52 33 09 52 30 20 3d | 20 28 52 31 20 2a 20 52 |,R3.R0 =| (R1 * R|
|00004310| 32 29 20 2b 20 52 33 0a | 4d 4c 41 09 52 30 2c 52 |2) + R3.|MLA.R0,R|
|00004320| 31 2c 52 32 2c 52 30 09 | 52 30 20 3d 20 28 52 31 |1,R2,R0.|R0 = (R1|
|00004330| 20 2a 20 52 32 29 20 2b | 20 52 30 0a 23 49 6e 64 | * R2) +| R0.#Ind|
|00004340| 65 6e 74 00 44 41 54 41 | c0 02 00 00 4d 55 4c 3a |ent.DATA|....MUL:|
|00004350| 20 4d 75 6c 74 69 70 6c | 69 63 61 74 69 6f 6e 0a | Multipl|ication.|
|00004360| 23 62 61 63 6b 67 72 6f | 75 6e 64 20 77 69 6d 70 |#backgro|und wimp|
|00004370| 20 31 0a 23 77 72 61 70 | 20 6f 66 66 0a 53 79 6e | 1.#wrap| off.Syn|
|00004380| 74 61 78 3a 20 4d 55 4c | 20 5c 7b 5c 3c 73 75 66 |tax: MUL| \{\<suf|
|00004390| 66 69 78 5c 3e 5c 7d 20 | 5c 3c 64 65 73 74 69 6e |fix\>\} |\<destin|
|000043a0| 61 74 69 6f 6e 5c 3e 2c | 20 5c 3c 6f 70 65 72 61 |ation\>,| \<opera|
|000043b0| 6e 64 31 5c 3e 2c 20 5c | 3c 6f 70 65 72 61 6e 64 |nd1\>, \|<operand|
|000043c0| 32 5c 3e 0a 4f 70 65 72 | 61 74 69 6f 6e 3a 20 64 |2\>.Oper|ation: d|
|000043d0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 3d 20 6f 70 65 |estinati|on = ope|
|000043e0| 72 61 6e 64 20 6f 6e 65 | 20 2a 20 6f 70 65 72 61 |rand one| * opera|
|000043f0| 6e 64 20 74 77 6f 0a 46 | 6c 61 67 73 3a 20 4e 2c |nd two.F|lags: N,|
|00004400| 5a 20 5b 56 20 2d 20 75 | 6e 63 68 61 6e 67 65 64 |Z [V - u|nchanged|
|00004410| 3b 20 43 20 2d 20 75 6e | 64 65 66 69 6e 65 64 5d |; C - un|defined]|
|00004420| 0a 23 77 72 61 70 20 6f | 6e 0a 23 6c 69 6e 65 0a |.#wrap o|n.#line.|
|00004430| 54 68 69 73 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |This ins|truction|
|00004440| 20 70 65 72 66 6f 72 6d | 73 20 33 32 2d 62 69 74 | perform|s 32-bit|
|00004450| 20 6d 75 6c 74 69 70 6c | 69 63 61 74 69 6f 6e 20 | multipl|ication |
|00004460| 6f 66 20 74 68 65 20 74 | 77 6f 20 6f 70 65 72 61 |of the t|wo opera|
|00004470| 6e 64 73 2c 20 77 69 74 | 68 20 74 68 65 20 72 65 |nds, wit|h the re|
|00004480| 73 75 6c 74 20 62 65 69 | 6e 67 20 73 74 6f 72 65 |sult bei|ng store|
|00004490| 64 20 69 6e 20 74 68 65 | 20 64 65 73 74 69 6e 61 |d in the| destina|
|000044a0| 74 69 6f 6e 20 72 65 67 | 69 73 74 65 72 2e 0a 23 |tion reg|ister..#|
|000044b0| 6c 69 6e 65 0a 54 68 65 | 72 65 20 61 72 65 20 63 |line.The|re are c|
|000044c0| 65 72 74 61 69 6e 20 72 | 65 73 74 72 69 63 74 69 |ertain r|estricti|
|000044d0| 6f 6e 73 20 61 73 73 6f | 63 69 61 74 65 64 20 77 |ons asso|ciated w|
|000044e0| 69 74 68 20 74 68 65 20 | 75 73 65 20 6f 66 20 74 |ith the |use of t|
|000044f0| 68 69 73 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 3a |his inst|ruction:|
|00004500| 0a 23 77 72 61 70 20 6f | 66 66 0a 23 49 6e 64 65 |.#wrap o|ff.#Inde|
|00004510| 6e 74 20 32 0a 2d 20 54 | 68 65 20 33 20 64 61 74 |nt 2.- T|he 3 dat|
|00004520| 61 20 66 69 65 6c 64 73 | 20 73 70 65 63 69 66 69 |a fields| specifi|
|00004530| 65 64 20 6d 75 73 74 20 | 62 65 20 73 69 6d 70 6c |ed must |be simpl|
|00004540| 65 20 72 65 67 69 73 74 | 65 72 73 0a 2d 20 54 68 |e regist|ers.- Th|
|00004550| 65 20 64 65 73 74 69 6e | 61 74 69 6f 6e 20 61 6e |e destin|ation an|
|00004560| 64 20 6f 70 65 72 61 6e | 64 31 20 6d 75 73 74 20 |d operan|d1 must |
|00004570| 62 65 20 64 69 66 66 65 | 72 65 6e 74 20 72 65 67 |be diffe|rent reg|
|00004580| 69 73 74 65 72 73 0a 2d | 20 52 31 35 20 6d 61 79 |isters.-| R15 may|
|00004590| 20 6e 6f 74 20 62 65 20 | 75 73 65 64 20 61 73 20 | not be |used as |
|000045a0| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|000045b0| 72 65 67 69 73 74 65 72 | 0a 23 49 6e 64 65 6e 74 |register|.#Indent|
|000045c0| 0a 23 77 72 61 70 20 6f | 6e 0a 23 6c 69 6e 65 0a |.#wrap o|n.#line.|
|000045d0| 45 78 61 6d 70 6c 65 3a | 0a 23 49 6e 64 65 6e 74 |Example:|.#Indent|
|000045e0| 20 32 0a 4d 55 4c 09 52 | 30 2c 52 31 2c 52 33 09 | 2.MUL.R|0,R1,R3.|
|000045f0| 52 30 20 3d 20 52 31 20 | 2a 20 52 33 0a 23 49 6e |R0 = R1 |* R3.#In|
|00004600| 64 65 6e 74 44 41 54 41 | b3 02 00 00 53 57 49 3a |dentDATA|....SWI:|
|00004610| 20 53 6f 66 74 77 61 72 | 65 20 49 6e 74 65 72 72 | Softwar|e Interr|
|00004620| 75 70 74 0a 23 62 61 63 | 6b 67 72 6f 75 6e 64 20 |upt.#bac|kground |
|00004630| 77 69 6d 70 20 31 0a 23 | 77 72 61 70 20 6f 66 66 |wimp 1.#|wrap off|
|00004640| 0a 53 79 6e 74 61 78 3a | 20 53 57 49 20 5c 3c 61 |.Syntax:| SWI \<a|
|00004650| 72 67 75 6d 65 6e 74 5c | 3e 20 0a 23 77 72 61 70 |rgument\|> .#wrap|
|00004660| 20 6f 6e 0a 23 6c 69 6e | 65 0a 57 68 65 6e 20 65 | on.#lin|e.When e|
|00004670| 78 65 63 75 74 65 64 2c | 20 74 68 69 73 20 69 6e |xecuted,| this in|
|00004680| 73 74 72 75 63 74 69 6f | 6e 20 63 61 75 73 65 73 |structio|n causes|
|00004690| 20 74 68 65 20 70 72 6f | 63 65 73 73 6f 72 20 74 | the pro|cessor t|
|000046a0| 6f 20 62 72 65 61 6b 20 | 6f 66 66 20 66 72 6f 6d |o break |off from|
|000046b0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 70 72 6f | the cur|rent pro|
|000046c0| 67 72 61 6d 2e 20 54 68 | 65 20 41 52 4d 20 73 77 |gram. Th|e ARM sw|
|000046d0| 69 74 63 68 65 73 20 69 | 6e 74 6f 20 73 75 70 65 |itches i|nto supe|
|000046e0| 72 76 69 73 6f 72 20 6d | 6f 64 65 20 61 6e 64 20 |rvisor m|ode and |
|000046f0| 6a 75 6d 70 73 20 74 6f | 20 61 20 70 72 65 2d 64 |jumps to| a pre-d|
|00004700| 65 66 69 6e 65 64 20 61 | 64 64 72 65 73 73 20 69 |efined a|ddress i|
|00004710| 6e 20 74 68 65 20 4f 53 | 2e 20 54 68 65 20 61 72 |n the OS|. The ar|
|00004720| 67 75 6d 65 6e 74 20 66 | 69 65 6c 64 20 69 73 20 |gument f|ield is |
|00004730| 74 68 65 6e 20 65 78 61 | 6d 69 6e 65 64 20 74 6f |then exa|mined to|
|00004740| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 69 63 68 | determi|ne which|
|00004750| 20 6f 66 20 74 68 65 20 | 6d 61 6e 79 20 4f 53 20 | of the |many OS |
|00004760| 66 61 63 69 6c 69 74 69 | 65 73 20 68 61 73 20 62 |faciliti|es has b|
|00004770| 65 65 6e 20 72 65 71 75 | 65 73 74 65 64 2e 20 57 |een requ|ested. W|
|00004780| 68 65 6e 20 74 68 65 20 | 61 70 70 72 6f 70 72 69 |hen the |appropri|
|00004790| 61 74 65 20 72 6f 75 74 | 69 6e 65 20 68 61 73 20 |ate rout|ine has |
|000047a0| 62 65 65 6e 20 63 6f 6d | 70 6c 65 74 65 64 2c 20 |been com|pleted, |
|000047b0| 74 68 65 20 41 52 4d 20 | 72 65 73 75 6d 65 73 20 |the ARM |resumes |
|000047c0| 74 68 65 20 65 78 65 63 | 75 74 69 6f 6e 20 6f 66 |the exec|ution of|
|000047d0| 20 74 68 65 20 75 73 65 | 72 20 70 72 6f 67 72 61 | the use|r progra|
|000047e0| 6d 20 77 68 65 72 65 20 | 69 74 20 6c 65 66 74 20 |m where |it left |
|000047f0| 6f 66 66 2e 0a 23 6c 69 | 6e 65 0a 45 78 61 6d 70 |off..#li|ne.Examp|
|00004800| 6c 65 73 3a 0a 23 49 6e | 64 65 6e 74 20 32 0a 53 |les:.#In|dent 2.S|
|00004810| 57 49 09 22 4f 53 5f 4d | 6f 75 73 65 22 0a 53 57 |WI."OS_M|ouse".SW|
|00004820| 49 09 22 57 69 6d 70 5f | 43 72 65 61 74 65 57 69 |I."Wimp_|CreateWi|
|00004830| 6e 64 6f 77 22 0a 23 49 | 6e 64 65 6e 74 0a 2a 4e |ndow".#I|ndent.*N|
|00004840| 6f 74 65 2a 3a 20 54 68 | 65 20 6e 61 6d 65 20 6f |ote*: Th|e name o|
|00004850| 66 20 74 68 65 20 72 6f | 75 74 69 6e 65 20 6d 75 |f the ro|utine mu|
|00004860| 73 74 20 6d 61 74 63 68 | 20 75 70 20 77 69 74 68 |st match| up with|
|00004870| 20 74 68 61 74 20 72 65 | 63 6f 67 6e 69 73 65 64 | that re|cognised|
|00004880| 20 62 79 20 74 68 65 20 | 61 73 73 65 6d 62 6c 65 | by the |assemble|
|00004890| 72 20 69 6e 63 6c 75 64 | 69 6e 67 20 74 68 65 20 |r includ|ing the |
|000048a0| 63 61 73 65 20 6f 66 20 | 65 61 63 68 20 63 68 61 |case of |each cha|
|000048b0| 72 61 63 74 65 72 2e 00 | 44 41 54 41 47 02 00 00 |racter..|DATAG...|
|000048c0| 42 3a 20 53 69 6d 70 6c | 65 20 42 72 61 6e 63 68 |B: Simpl|e Branch|
|000048d0| 0a 23 62 61 63 6b 67 72 | 6f 75 6e 64 20 77 69 6d |.#backgr|ound wim|
|000048e0| 70 20 31 0a 23 77 72 61 | 70 20 6f 66 66 0a 53 79 |p 1.#wra|p off.Sy|
|000048f0| 6e 74 61 78 3a 20 42 20 | 5c 3c 61 64 64 72 65 73 |ntax: B |\<addres|
|00004900| 73 5c 3e 0a 4f 70 65 72 | 61 74 69 6f 6e 3a 20 4a |s\>.Oper|ation: J|
|00004910| 75 6d 70 20 74 6f 20 73 | 70 65 63 69 66 69 65 64 |ump to s|pecified|
|00004920| 20 61 64 64 72 65 73 73 | 0a 23 77 72 61 70 20 6f | address|.#wrap o|
|00004930| 6e 0a 23 6c 69 6e 65 0a | 54 68 69 73 20 69 6e 73 |n.#line.|This ins|
|00004940| 74 72 75 63 74 69 6f 6e | 20 69 73 20 61 6e 61 6c |truction| is anal|
|00004950| 6f 67 6f 75 73 20 74 6f | 20 74 68 65 20 42 41 53 |ogous to| the BAS|
|00004960| 49 43 20 47 4f 54 4f 20 | 73 74 61 74 65 6d 65 6e |IC GOTO |statemen|
|00004970| 74 20 2d 20 69 74 20 6d | 61 6b 65 73 20 74 68 65 |t - it m|akes the|
|00004980| 20 70 72 6f 63 65 73 73 | 6f 72 20 62 72 65 61 6b | process|or break|
|00004990| 20 6f 66 66 20 66 72 6f | 6d 20 69 74 73 20 6e 6f | off fro|m its no|
|000049a0| 72 6d 61 6c 20 73 65 71 | 75 65 6e 74 69 61 6c 20 |rmal seq|uential |
|000049b0| 65 78 65 63 75 74 69 6f | 6e 20 6f 66 20 69 6e 73 |executio|n of ins|
|000049c0| 74 72 75 63 74 69 6f 6e | 73 20 61 6e 64 20 6a 75 |truction|s and ju|
|000049d0| 6d 70 20 74 6f 20 61 20 | 6e 65 77 20 69 6e 73 74 |mp to a |new inst|
|000049e0| 72 75 63 74 69 6f 6e 20 | 61 74 20 61 20 64 65 73 |ruction |at a des|
|000049f0| 69 67 6e 61 74 65 64 20 | 6c 6f 63 61 74 69 6f 6e |ignated |location|
|00004a00| 2e 0a 23 6c 69 6e 65 0a | 57 68 65 6e 20 75 73 65 |..#line.|When use|
|00004a10| 64 20 69 6e 20 63 6f 6e | 6a 75 6e 63 74 69 6f 6e |d in con|junction|
|00004a20| 20 77 69 74 68 20 74 68 | 65 20 6e 6f 72 6d 61 6c | with th|e normal|
|00004a30| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 63 6f 64 65 73 | conditi|on codes|
|00004a40| 2c 20 74 68 69 73 20 69 | 6e 73 74 72 75 63 74 69 |, this i|nstructi|
|00004a50| 6f 6e 20 62 65 63 6f 6d | 65 73 20 74 68 65 20 62 |on becom|es the b|
|00004a60| 61 73 69 73 20 6f 66 20 | 63 6f 6e 64 69 74 69 6f |asis of |conditio|
|00004a70| 6e 61 6c 20 62 72 61 6e | 63 68 69 6e 67 2e 0a 23 |nal bran|ching..#|
|00004a80| 6c 69 6e 65 0a 45 78 61 | 6d 70 6c 65 3a 0a 23 49 |line.Exa|mple:.#I|
|00004a90| 6e 64 65 6e 74 20 32 0a | 2e 6c 6f 6f 70 0a 53 55 |ndent 2.|.loop.SU|
|00004aa0| 42 09 52 30 2c 52 30 2c | 23 31 09 52 30 20 3d 20 |B.R0,R0,|#1.R0 = |
|00004ab0| 52 30 20 2d 20 31 0a 43 | 4d 50 09 52 30 2c 23 30 |R0 - 1.C|MP.R0,#0|
|00004ac0| 09 09 69 73 20 52 30 20 | 3d 20 30 3f 0a 42 4e 45 |..is R0 |= 0?.BNE|
|00004ad0| 09 6c 6f 6f 70 09 09 69 | 66 20 6e 6f 74 2c 20 67 |.loop..i|f not, g|
|00004ae0| 6f 20 62 61 63 6b 20 74 | 6f 20 73 74 61 72 74 20 |o back t|o start |
|00004af0| 6f 66 20 6c 6f 6f 70 0a | 23 49 6e 64 65 6e 74 00 |of loop.|#Indent.|
|00004b00| 44 41 54 41 b6 04 00 00 | 42 4c 3a 20 42 72 61 6e |DATA....|BL: Bran|
|00004b10| 63 68 20 77 69 74 68 20 | 4c 69 6e 6b 0a 23 62 61 |ch with |Link.#ba|
|00004b20| 63 6b 67 72 6f 75 6e 64 | 20 77 69 6d 70 20 31 0a |ckground| wimp 1.|
|00004b30| 23 77 72 61 70 20 6f 66 | 66 0a 53 79 6e 74 61 78 |#wrap of|f.Syntax|
|00004b40| 3a 20 42 4c 20 5c 3c 61 | 64 64 72 65 73 73 5c 3e |: BL \<a|ddress\>|
|00004b50| 0a 4f 70 65 72 61 74 69 | 6f 6e 3a 20 5b 4d 4f 56 |.Operati|on: [MOV|
|00004b60| 20 52 31 34 2c 50 43 5d | 20 2b 20 4a 75 6d 70 20 | R14,PC]| + Jump |
|00004b70| 74 6f 20 73 70 65 63 69 | 66 69 65 64 20 61 64 64 |to speci|fied add|
|00004b80| 72 65 73 73 0a 23 77 72 | 61 70 20 6f 6e 0a 23 6c |ress.#wr|ap on.#l|
|00004b90| 69 6e 65 0a 54 68 69 73 | 20 69 6e 73 74 72 75 63 |ine.This| instruc|
|00004ba0| 74 69 6f 6e 20 69 73 20 | 61 6e 61 6c 6f 67 6f 75 |tion is |analogou|
|00004bb0| 73 20 74 6f 20 74 68 65 | 20 42 41 53 49 43 20 47 |s to the| BASIC G|
|00004bc0| 4f 53 55 42 20 73 74 61 | 74 65 6d 65 6e 74 20 2d |OSUB sta|tement -|
|00004bd0| 20 69 74 20 6d 61 6b 65 | 73 20 74 68 65 20 70 72 | it make|s the pr|
|00004be0| 6f 63 65 73 73 6f 72 20 | 62 72 65 61 6b 20 6f 66 |ocessor |break of|
|00004bf0| 66 20 66 72 6f 6d 20 69 | 74 73 20 6e 6f 72 6d 61 |f from i|ts norma|
|00004c00| 6c 20 73 65 71 75 65 6e | 74 69 61 6c 20 65 78 65 |l sequen|tial exe|
|00004c10| 63 75 74 69 6f 6e 20 6f | 66 20 69 6e 73 74 72 75 |cution o|f instru|
|00004c20| 63 74 69 6f 6e 73 20 61 | 6e 64 20 6a 75 6d 70 20 |ctions a|nd jump |
|00004c30| 74 6f 20 61 20 6e 65 77 | 20 69 6e 73 74 72 75 63 |to a new| instruc|
|00004c40| 74 69 6f 6e 20 61 74 20 | 61 20 64 65 73 69 67 6e |tion at |a design|
|00004c50| 61 74 65 64 20 6c 6f 63 | 61 74 69 6f 6e 2e 20 42 |ated loc|ation. B|
|00004c60| 79 20 6d 6f 76 69 6e 67 | 20 74 68 65 20 63 6f 6e |y moving| the con|
|00004c70| 74 65 6e 74 73 20 6f 66 | 20 52 31 34 20 62 61 63 |tents of| R14 bac|
|00004c80| 6b 20 69 6e 74 6f 20 50 | 43 2c 20 77 65 20 63 61 |k into P|C, we ca|
|00004c90| 6e 20 72 65 74 75 72 6e | 20 74 6f 20 74 68 65 20 |n return| to the |
|00004ca0| 6f 72 69 67 69 6e 61 6c | 20 42 72 61 6e 63 68 20 |original| Branch |
|00004cb0| 69 6e 73 74 72 75 63 74 | 69 6f 6e 2e 0a 23 6c 69 |instruct|ion..#li|
|00004cc0| 6e 65 0a 57 68 65 6e 20 | 75 73 65 64 20 69 6e 20 |ne.When |used in |
|00004cd0| 63 6f 6e 6a 75 6e 63 74 | 69 6f 6e 20 77 69 74 68 |conjunct|ion with|
|00004ce0| 20 74 68 65 20 6e 6f 72 | 6d 61 6c 20 63 6f 6e 64 | the nor|mal cond|
|00004cf0| 69 74 69 6f 6e 20 63 6f | 64 65 73 2c 20 74 68 69 |ition co|des, thi|
|00004d00| 73 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 20 62 65 |s instru|ction be|
|00004d10| 63 6f 6d 65 73 20 74 68 | 65 20 62 61 73 69 73 20 |comes th|e basis |
|00004d20| 6f 66 20 63 6f 6e 64 69 | 74 69 6f 6e 61 6c 20 62 |of condi|tional b|
|00004d30| 72 61 6e 63 68 69 6e 67 | 2e 0a 23 6c 69 6e 65 0a |ranching|..#line.|
|00004d40| 45 78 61 6d 70 6c 65 3a | 0a 23 49 6e 64 65 6e 74 |Example:|.#Indent|
|00004d50| 20 32 0a 2e 6c 6f 6f 70 | 0a 53 55 42 09 52 30 2c | 2..loop|.SUB.R0,|
|00004d60| 52 30 2c 23 31 09 52 30 | 20 3d 20 52 30 20 2d 20 |R0,#1.R0| = R0 - |
|00004d70| 31 0a 43 4d 50 09 52 30 | 2c 23 30 09 09 69 73 20 |1.CMP.R0|,#0..is |
|00004d80| 52 30 20 3d 20 30 3f 0a | 42 4e 45 09 6c 6f 6f 70 |R0 = 0?.|BNE.loop|
|00004d90| 09 09 69 66 20 6e 6f 74 | 2c 20 67 6f 20 62 61 63 |..if not|, go bac|
|00004da0| 6b 20 74 6f 20 73 74 61 | 72 74 20 6f 66 20 6c 6f |k to sta|rt of lo|
|00004db0| 6f 70 0a 42 4c 09 73 75 | 62 72 6f 75 74 69 6e 65 |op.BL.su|broutine|
|00004dc0| 09 6f 74 68 65 72 77 69 | 73 65 2c 20 67 6f 20 74 |.otherwi|se, go t|
|00004dd0| 6f 20 73 75 62 72 6f 75 | 74 69 6e 65 0a 2e 2e 2e |o subrou|tine....|
|00004de0| 0a 2e 73 75 62 72 6f 75 | 74 69 6e 65 0a 4d 4f 56 |..subrou|tine.MOV|
|00004df0| 20 50 43 2c 52 31 34 09 | 09 72 65 74 75 72 6e 20 | PC,R14.|.return |
|00004e00| 74 6f 20 6d 61 69 6e 20 | 63 6f 64 65 0a 23 49 6e |to main |code.#In|
|00004e10| 64 65 6e 74 0a 23 6c 69 | 6e 65 3b 20 77 72 61 70 |dent.#li|ne; wrap|
|00004e20| 20 6e 6f 6a 6f 69 6e 0a | 2a 4e 6f 74 65 2a 3a 20 | nojoin.|*Note*: |
|00004e30| 49 74 20 69 73 20 69 6d | 70 6f 72 74 61 6e 74 20 |It is im|portant |
|00004e40| 74 68 61 74 20 74 68 65 | 20 63 6f 6e 74 65 6e 74 |that the| content|
|00004e50| 73 20 6f 66 20 52 31 34 | 20 61 72 65 20 73 74 6f |s of R14| are sto|
|00004e60| 72 65 64 20 65 6c 73 65 | 77 68 65 72 65 20 70 72 |red else|where pr|
|00004e70| 69 6f 72 20 74 6f 20 75 | 73 69 6e 67 20 74 68 69 |ior to u|sing thi|
|00004e80| 73 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 2e 20 54 |s instru|ction. T|
|00004e90| 68 69 73 20 63 61 6e 20 | 62 65 20 64 6f 6e 65 20 |his can |be done |
|00004ea0| 75 73 69 6e 67 20 61 20 | 3c 73 74 61 63 6b 3d 3e |using a |<stack=>|
|00004eb0| 73 74 61 63 6b 73 3e 2e | 0a 54 68 65 20 63 6f 6d |stacks>.|.The com|
|00004ec0| 6d 61 6e 64 20 27 4d 4f | 56 20 50 43 2c 52 31 34 |mand 'MO|V PC,R14|
|00004ed0| 27 20 77 69 6c 6c 20 6d | 65 61 6e 20 74 68 61 74 |' will m|ean that|
|00004ee0| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 73 74 | the ori|ginal st|
|00004ef0| 61 74 75 73 20 66 6c 61 | 67 20 73 65 74 74 69 6e |atus fla|g settin|
|00004f00| 67 73 20 77 69 6c 6c 20 | 6e 6f 74 20 62 65 20 72 |gs will |not be r|
|00004f10| 65 73 74 6f 72 65 64 20 | 6f 6e 63 65 20 74 68 65 |estored |once the|
|00004f20| 20 73 75 62 72 6f 75 74 | 69 6e 65 20 68 61 73 20 | subrout|ine has |
|00004f30| 72 65 74 75 72 6e 65 64 | 2e 20 53 68 6f 75 6c 64 |returned|. Should|
|00004f40| 20 74 68 65 20 75 73 65 | 72 20 77 61 6e 74 20 74 | the use|r want t|
|00004f50| 68 65 20 66 6c 61 67 73 | 20 74 6f 20 62 65 20 75 |he flags| to be u|
|00004f60| 6e 61 66 66 65 63 74 65 | 64 20 62 79 20 74 68 65 |naffecte|d by the|
|00004f70| 20 73 75 62 72 6f 75 74 | 69 6e 65 2c 20 74 68 65 | subrout|ine, the|
|00004f80| 20 63 6f 6d 6d 61 6e 64 | 20 73 68 6f 75 6c 64 20 | command| should |
|00004f90| 62 65 20 6d 6f 64 69 66 | 69 65 64 20 74 6f 20 27 |be modif|ied to '|
|00004fa0| 4d 4f 56 53 20 50 43 2c | 52 31 34 27 2e 0a 23 77 |MOVS PC,|R14'..#w|
|00004fb0| 72 61 70 20 6f 6e 00 00 | 44 41 54 41 fd 01 00 00 |rap on..|DATA....|
|00004fc0| 4c 44 52 3a 20 4c 6f 61 | 64 20 74 6f 20 52 65 67 |LDR: Loa|d to Reg|
|00004fd0| 69 73 74 65 72 0a 23 62 | 61 63 6b 67 72 6f 75 6e |ister.#b|ackgroun|
|00004fe0| 64 20 77 69 6d 70 20 31 | 0a 23 77 72 61 70 20 6f |d wimp 1|.#wrap o|
|00004ff0| 66 66 0a 4f 70 65 72 61 | 74 69 6f 6e 3a 20 44 61 |ff.Opera|tion: Da|
|00005000| 74 61 20 74 72 61 6e 73 | 66 65 72 20 66 72 6f 6d |ta trans|fer from|
|00005010| 20 6d 65 6d 6f 72 79 20 | 74 6f 20 74 68 65 20 72 | memory |to the r|
|00005020| 65 67 69 73 74 65 72 73 | 0a 23 77 72 61 70 20 6f |egisters|.#wrap o|
|00005030| 6e 0a 23 6c 69 6e 65 0a | 54 68 69 73 20 69 6e 73 |n.#line.|This ins|
|00005040| 74 72 75 63 74 69 6f 6e | 20 69 73 20 75 73 65 64 |truction| is used|
|00005050| 20 74 6f 20 74 72 61 6e | 73 66 65 72 20 64 61 74 | to tran|sfer dat|
|00005060| 61 20 66 72 6f 6d 20 6d | 65 6d 6f 72 79 20 69 6e |a from m|emory in|
|00005070| 74 6f 20 74 68 65 20 72 | 65 67 69 73 74 65 72 73 |to the r|egisters|
|00005080| 2e 20 41 20 73 79 73 74 | 65 6d 20 6f 66 20 69 6e |. A syst|em of in|
|00005090| 64 69 72 65 63 74 20 61 | 64 64 72 65 73 73 69 6e |direct a|ddressin|
|000050a0| 67 20 69 73 20 75 73 65 | 64 20 74 6f 20 73 70 65 |g is use|d to spe|
|000050b0| 63 69 66 79 20 74 68 65 | 20 73 6f 75 72 63 65 20 |cify the| source |
|000050c0| 6c 6f 63 61 74 69 6f 6e | 20 61 64 64 72 65 73 73 |location| address|
|000050d0| 20 2d 20 74 68 65 20 61 | 64 64 72 65 73 73 20 74 | - the a|ddress t|
|000050e0| 6f 20 62 65 20 6c 6f 6f | 6b 65 64 20 75 70 20 69 |o be loo|ked up i|
|000050f0| 73 20 68 65 6c 64 20 69 | 6e 20 61 20 72 65 67 69 |s held i|n a regi|
|00005100| 73 74 65 72 2e 0a 54 68 | 65 72 65 20 61 72 65 20 |ster..Th|ere are |
|00005110| 74 77 6f 20 66 6f 72 6d | 73 20 6f 66 20 69 6e 64 |two form|s of ind|
|00005120| 69 72 65 63 74 20 61 64 | 64 72 65 73 73 69 6e 67 |irect ad|dressing|
|00005130| 3a 20 3c 50 72 65 2d 69 | 6e 64 65 78 65 64 3d 3e |: <Pre-i|ndexed=>|
|00005140| 50 72 65 3e 20 61 6e 64 | 20 3c 50 6f 73 74 2d 69 |Pre> and| <Post-i|
|00005150| 6e 64 65 78 65 64 3d 3e | 50 6f 73 74 3e 2e 20 49 |ndexed=>|Post>. I|
|00005160| 6e 20 61 64 64 69 74 69 | 6f 6e 20 74 6f 20 74 68 |n additi|on to th|
|00005170| 65 73 65 20 74 77 6f 20 | 66 6f 72 6d 73 2c 20 61 |ese two |forms, a|
|00005180| 20 3c 50 43 20 72 65 6c | 61 74 69 76 65 3d 3e 50 | <PC rel|ative=>P|
|00005190| 43 5f 72 65 6c 3e 20 61 | 64 64 72 65 73 73 20 63 |C_rel> a|ddress c|
|000051a0| 61 6e 20 61 6c 73 6f 20 | 62 65 20 73 70 65 63 69 |an also |be speci|
|000051b0| 66 69 65 64 2e 00 00 00 | 44 41 54 41 05 02 00 00 |fied....|DATA....|
|000051c0| 53 54 52 3a 20 53 74 6f | 72 65 20 66 72 6f 6d 20 |STR: Sto|re from |
|000051d0| 52 65 67 69 73 74 65 72 | 0a 23 62 61 63 6b 67 72 |Register|.#backgr|
|000051e0| 6f 75 6e 64 20 77 69 6d | 70 20 31 0a 23 77 72 61 |ound wim|p 1.#wra|
|000051f0| 70 20 6f 66 66 0a 4f 70 | 65 72 61 74 69 6f 6e 3a |p off.Op|eration:|
|00005200| 20 44 61 74 61 20 74 72 | 61 6e 73 66 65 72 20 66 | Data tr|ansfer f|
|00005210| 72 6f 6d 20 74 68 65 20 | 72 65 67 69 73 74 65 72 |rom the |register|
|00005220| 73 20 74 6f 20 6d 65 6d | 6f 72 79 0a 23 77 72 61 |s to mem|ory.#wra|
|00005230| 70 20 6f 6e 0a 23 6c 69 | 6e 65 0a 54 68 69 73 20 |p on.#li|ne.This |
|00005240| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 69 73 20 75 |instruct|ion is u|
|00005250| 73 65 64 20 74 6f 20 74 | 72 61 6e 73 66 65 72 20 |sed to t|ransfer |
|00005260| 64 61 74 61 20 66 72 6f | 6d 20 74 68 65 20 72 65 |data fro|m the re|
|00005270| 67 69 73 74 65 72 73 20 | 69 6e 74 6f 20 6d 65 6d |gisters |into mem|
|00005280| 6f 72 79 2e 20 41 20 73 | 79 73 74 65 6d 20 6f 66 |ory. A s|ystem of|
|00005290| 20 69 6e 64 69 72 65 63 | 74 20 61 64 64 72 65 73 | indirec|t addres|
|000052a0| 73 69 6e 67 20 69 73 20 | 75 73 65 64 20 74 6f 20 |sing is |used to |
|000052b0| 73 70 65 63 69 66 79 20 | 74 68 65 20 64 65 73 74 |specify |the dest|
|000052c0| 69 6e 61 74 69 6f 6e 20 | 6c 6f 63 61 74 69 6f 6e |ination |location|
|000052d0| 20 61 64 64 72 65 73 73 | 20 2d 20 74 68 65 20 61 | address| - the a|
|000052e0| 64 64 72 65 73 73 20 74 | 6f 20 62 65 20 6c 6f 6f |ddress t|o be loo|
|000052f0| 6b 65 64 20 75 70 20 69 | 73 20 68 65 6c 64 20 69 |ked up i|s held i|
|00005300| 6e 20 61 20 72 65 67 69 | 73 74 65 72 2e 0a 54 68 |n a regi|ster..Th|
|00005310| 65 72 65 20 61 72 65 20 | 74 77 6f 20 66 6f 72 6d |ere are |two form|
|00005320| 73 20 6f 66 20 69 6e 64 | 69 72 65 63 74 20 61 64 |s of ind|irect ad|
|00005330| 64 72 65 73 73 69 6e 67 | 3a 20 3c 50 72 65 2d 69 |dressing|: <Pre-i|
|00005340| 6e 64 65 78 65 64 3d 3e | 50 72 65 3e 20 61 6e 64 |ndexed=>|Pre> and|
|00005350| 20 3c 50 6f 73 74 2d 69 | 6e 64 65 78 65 64 3d 3e | <Post-i|ndexed=>|
|00005360| 50 6f 73 74 3e 2e 20 49 | 6e 20 61 64 64 69 74 69 |Post>. I|n additi|
|00005370| 6f 6e 20 74 6f 20 74 68 | 65 73 65 20 74 77 6f 20 |on to th|ese two |
|00005380| 66 6f 72 6d 73 2c 20 61 | 20 3c 50 43 20 72 65 6c |forms, a| <PC rel|
|00005390| 61 74 69 76 65 3d 3e 50 | 43 5f 72 65 6c 3e 20 61 |ative=>P|C_rel> a|
|000053a0| 64 64 72 65 73 73 20 63 | 61 6e 20 61 6c 73 6f 20 |ddress c|an also |
|000053b0| 62 65 20 73 70 65 63 69 | 66 69 65 64 2e 00 00 00 |be speci|fied....|
|000053c0| 44 41 54 41 36 01 00 00 | 42 79 74 65 20 61 64 64 |DATA6...|Byte add|
|000053d0| 72 65 73 73 69 6e 67 0a | 23 62 61 63 6b 67 72 6f |ressing.|#backgro|
|000053e0| 75 6e 64 20 77 69 6d 70 | 20 31 0a 42 79 20 64 65 |und wimp| 1.By de|
|000053f0| 66 61 75 6c 74 2c 20 3c | 4c 44 52 3e 20 61 6e 64 |fault, <|LDR> and|
|00005400| 20 3c 53 54 52 3e 20 61 | 63 63 65 73 73 20 63 6f | <STR> a|ccess co|
|00005410| 6d 70 6c 65 74 65 20 77 | 6f 72 64 73 20 6f 66 20 |mplete w|ords of |
|00005420| 6d 65 6d 6f 72 79 20 28 | 66 6f 75 72 20 62 79 74 |memory (|four byt|
|00005430| 65 73 29 2e 20 48 6f 77 | 65 76 65 72 2c 20 74 68 |es). How|ever, th|
|00005440| 65 79 20 63 61 6e 20 62 | 65 20 6d 61 64 65 20 74 |ey can b|e made t|
|00005450| 6f 20 61 63 63 65 73 73 | 20 73 69 6e 67 6c 65 20 |o access| single |
|00005460| 62 79 74 65 73 20 75 73 | 69 6e 67 20 74 68 65 20 |bytes us|ing the |
|00005470| 27 42 27 20 73 75 66 66 | 69 78 2e 0a 23 6c 69 6e |'B' suff|ix..#lin|
|00005480| 65 0a 45 78 61 6d 70 6c | 65 73 3a 0a 23 77 72 61 |e.Exampl|es:.#wra|
|00005490| 70 20 6f 66 66 0a 23 69 | 6e 64 65 6e 74 20 32 0a |p off.#i|ndent 2.|
|000054a0| 4c 44 52 42 09 52 30 2c | 5b 52 32 2c 52 34 5d 0a |LDRB.R0,|[R2,R4].|
|000054b0| 53 54 52 42 09 52 30 2c | 5b 52 35 2c 23 34 5d 0a |STRB.R0,|[R5,#4].|
|000054c0| 4c 44 52 42 09 52 30 2c | 5b 52 36 2c 52 35 2c 4c |LDRB.R0,|[R6,R5,L|
|000054d0| 53 52 23 36 5d 21 0a 4c | 44 52 4e 45 42 09 52 30 |SR#6]!.L|DRNEB.R0|
|000054e0| 2c 5b 52 31 5d 2c 52 33 | 0a 4c 44 52 42 09 52 30 |,[R1],R3|.LDRB.R0|
|000054f0| 2c 74 61 62 6c 65 00 00 | 44 41 54 41 c3 02 00 00 |,table..|DATA....|
|00005500| 50 43 20 72 65 6c 61 74 | 69 76 65 20 61 64 64 72 |PC relat|ive addr|
|00005510| 65 73 73 69 6e 67 0a 23 | 62 61 63 6b 67 72 6f 75 |essing.#|backgrou|
|00005520| 6e 64 20 77 69 6d 70 20 | 31 0a 23 77 72 61 70 20 |nd wimp |1.#wrap |
|00005530| 6f 66 66 0a 53 79 6e 74 | 61 78 3a 20 4c 44 52 20 |off.Synt|ax: LDR |
|00005540| 28 6f 72 20 53 54 52 29 | 20 5c 3c 64 65 73 74 69 |(or STR)| \<desti|
|00005550| 6e 61 74 69 6f 6e 5c 3e | 2c 61 64 64 72 65 73 73 |nation\>|,address|
|00005560| 0a 23 77 72 61 70 20 6e | 6f 6a 6f 69 6e 0a 23 6c |.#wrap n|ojoin.#l|
|00005570| 69 6e 65 0a 50 43 20 72 | 65 6c 61 74 69 76 65 20 |ine.PC r|elative |
|00005580| 61 64 64 72 65 73 73 69 | 6e 67 20 69 73 20 61 20 |addressi|ng is a |
|00005590| 70 73 65 75 64 6f 2d 61 | 64 64 72 65 73 73 69 6e |pseudo-a|ddressin|
|000055a0| 67 20 6d 6f 64 65 20 61 | 73 20 69 74 20 69 73 20 |g mode a|s it is |
|000055b0| 6e 6f 74 20 61 20 64 69 | 73 74 69 6e 63 74 20 61 |not a di|stinct a|
|000055c0| 64 64 72 65 73 73 69 6e | 67 20 6d 6f 64 65 20 73 |ddressin|g mode s|
|000055d0| 75 70 70 6f 72 74 65 64 | 20 62 79 20 74 68 65 20 |upported| by the |
|000055e0| 41 52 4d 2e 20 49 6e 73 | 74 65 61 64 2c 20 73 75 |ARM. Ins|tead, su|
|000055f0| 63 68 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 73 20 |ch instr|uctions |
|00005600| 61 72 65 20 63 6f 6e 76 | 65 72 74 65 64 20 69 6e |are conv|erted in|
|00005610| 74 6f 20 61 6e 20 61 70 | 70 72 6f 70 72 69 61 74 |to an ap|propriat|
|00005620| 65 20 70 72 65 2d 69 6e | 64 65 78 65 64 20 69 6e |e pre-in|dexed in|
|00005630| 73 74 72 75 63 74 69 6f | 6e 20 62 79 20 74 68 65 |structio|n by the|
|00005640| 20 61 73 73 65 6d 62 6c | 65 72 2e 0a 54 68 65 20 | assembl|er..The |
|00005650| 61 64 64 72 65 73 73 20 | 69 73 20 73 69 6d 70 6c |address |is simpl|
|00005660| 79 20 61 6e 20 61 62 73 | 6f 6c 75 74 65 20 6e 75 |y an abs|olute nu|
|00005670| 6d 62 65 72 2c 20 6f 72 | 20 61 6e 20 61 73 73 65 |mber, or| an asse|
|00005680| 6d 62 6c 65 72 20 6c 61 | 62 65 6c 2e 0a 23 6c 69 |mbler la|bel..#li|
|00005690| 6e 65 0a 45 78 61 6d 70 | 6c 65 73 3a 0a 23 77 72 |ne.Examp|les:.#wr|
|000056a0| 61 70 20 6f 66 66 0a 23 | 69 6e 64 65 6e 74 20 32 |ap off.#|indent 2|
|000056b0| 0a 4c 44 52 20 52 30 2c | 26 31 30 30 30 09 4c 6f |.LDR R0,|&1000.Lo|
|000056c0| 61 64 20 77 6f 72 64 20 | 6f 66 20 6d 65 6d 6f 72 |ad word |of memor|
|000056d0| 79 20 66 72 6f 6d 20 6c | 6f 63 61 74 69 6f 6e 20 |y from l|ocation |
|000056e0| 26 31 30 30 30 20 69 6e | 74 6f 20 52 30 0a 53 54 |&1000 in|to R0.ST|
|000056f0| 52 20 52 30 2c 74 61 62 | 6c 65 09 53 74 6f 72 65 |R R0,tab|le.Store|
|00005700| 20 52 30 20 74 6f 20 77 | 6f 72 64 20 6f 66 20 6d | R0 to w|ord of m|
|00005710| 65 6d 6f 72 79 20 73 70 | 65 63 69 66 69 65 64 20 |emory sp|ecified |
|00005720| 62 79 20 27 74 61 62 6c | 65 27 0a 23 69 6e 64 65 |by 'tabl|e'.#inde|
|00005730| 6e 74 0a 23 77 72 61 70 | 20 6f 6e 0a 23 6c 69 6e |nt.#wrap| on.#lin|
|00005740| 65 0a 49 74 20 69 73 20 | 69 6d 70 6f 72 74 61 6e |e.It is |importan|
|00005750| 74 20 74 6f 20 72 65 6d | 65 6d 62 65 72 20 74 68 |t to rem|ember th|
|00005760| 61 74 20 74 68 65 20 72 | 61 6e 67 65 20 6f 66 20 |at the r|ange of |
|00005770| 74 68 65 20 6f 66 66 73 | 65 74 2c 20 61 73 20 69 |the offs|et, as i|
|00005780| 6e 20 3c 70 72 65 2d 69 | 6e 64 65 78 65 64 20 61 |n <pre-i|ndexed a|
|00005790| 64 64 72 65 73 73 69 6e | 67 3d 3e 50 72 65 3e 2c |ddressin|g=>Pre>,|
|000057a0| 20 69 73 20 62 65 74 77 | 65 65 6e 20 2d 34 30 39 | is betw|een -409|
|000057b0| 36 20 61 6e 64 20 34 30 | 39 36 2e 00 44 41 54 41 |6 and 40|96..DATA|
|000057c0| 63 03 00 00 50 6f 73 74 | 2d 69 6e 64 65 78 65 64 |c...Post|-indexed|
|000057d0| 20 61 64 64 72 65 73 73 | 69 6e 67 0a 23 62 61 63 | address|ing.#bac|
|000057e0| 6b 67 72 6f 75 6e 64 20 | 77 69 6d 70 20 31 0a 23 |kground |wimp 1.#|
|000057f0| 77 72 61 70 20 6f 66 66 | 0a 53 79 6e 74 61 78 3a |wrap off|.Syntax:|
|00005800| 20 4c 44 52 20 28 6f 72 | 20 53 54 52 29 20 5c 3c | LDR (or| STR) \<|
|00005810| 64 65 73 74 69 6e 61 74 | 69 6f 6e 5c 3e 2c 20 5b |destinat|ion\>, [|
|00005820| 5c 3c 62 61 73 65 5c 3e | 5d 2c 5c 3c 6f 66 66 73 |\<base\>|],\<offs|
|00005830| 65 74 5c 3e 0a 23 77 72 | 61 70 20 6f 6e 0a 23 6c |et\>.#wr|ap on.#l|
|00005840| 69 6e 65 0a 54 68 69 73 | 20 66 6f 72 6d 20 6f 66 |ine.This| form of|
|00005850| 20 61 64 64 72 65 73 73 | 69 6e 67 20 69 73 20 76 | address|ing is v|
|00005860| 65 72 79 20 73 69 6d 69 | 6c 61 72 20 74 6f 20 3c |ery simi|lar to <|
|00005870| 70 72 65 2d 69 6e 64 65 | 78 65 64 20 61 64 64 72 |pre-inde|xed addr|
|00005880| 65 73 73 69 6e 67 3d 3e | 50 72 65 3e 2e 20 49 6e |essing=>|Pre>. In|
|00005890| 20 74 68 69 73 20 63 61 | 73 65 2c 20 68 6f 77 65 | this ca|se, howe|
|000058a0| 76 65 72 2c 20 74 68 65 | 20 6f 66 66 73 65 74 20 |ver, the| offset |
|000058b0| 66 69 65 6c 64 20 69 73 | 20 2a 6e 6f 74 2a 20 6f |field is| *not* o|
|000058c0| 70 74 69 6f 6e 61 6c 2e | 0a 23 6c 69 6e 65 0a 45 |ptional.|.#line.E|
|000058d0| 78 61 6d 70 6c 65 73 3a | 0a 23 77 72 61 70 20 6f |xamples:|.#wrap o|
|000058e0| 66 66 0a 23 69 6e 64 65 | 6e 74 20 32 0a 4c 44 52 |ff.#inde|nt 2.LDR|
|000058f0| 20 52 31 2c 5b 52 30 5d | 2c 52 37 09 09 4c 6f 61 | R1,[R0]|,R7..Loa|
|00005900| 64 20 52 31 20 66 72 6f | 6d 20 61 64 64 72 65 73 |d R1 fro|m addres|
|00005910| 73 20 52 30 09 3a 20 52 | 30 3d 52 30 2b 52 37 0a |s R0.: R|0=R0+R7.|
|00005920| 53 54 52 20 52 36 2c 5b | 52 37 5d 2c 23 34 09 09 |STR R6,[|R7],#4..|
|00005930| 53 74 6f 72 65 20 52 36 | 20 61 74 20 61 64 64 72 |Store R6| at addr|
|00005940| 65 73 73 20 52 37 09 3a | 20 52 37 3d 52 37 2b 34 |ess R7.:| R7=R7+4|
|00005950| 0a 4c 44 52 20 52 38 2c | 5b 52 32 5d 2c 52 35 2c |.LDR R8,|[R2],R5,|
|00005960| 4c 53 4c 23 34 09 4c 6f | 61 64 20 52 38 20 66 72 |LSL#4.Lo|ad R8 fr|
|00005970| 6f 6d 20 61 64 64 72 65 | 73 73 20 52 32 09 3a 20 |om addre|ss R2.: |
|00005980| 52 32 3d 52 32 2b 52 35 | 2a 31 36 0a 53 54 52 20 |R2=R2+R5|*16.STR |
|00005990| 52 30 2c 5b 52 30 5d 2c | 23 32 30 09 09 53 74 6f |R0,[R0],|#20..Sto|
|000059a0| 72 65 20 52 30 20 61 74 | 20 61 64 64 72 65 73 73 |re R0 at| address|
|000059b0| 20 52 30 09 3a 20 52 30 | 3d 52 30 2b 32 30 0a 23 | R0.: R0|=R0+20.#|
|000059c0| 69 6e 64 65 6e 74 0a 23 | 77 72 61 70 20 6f 6e 0a |indent.#|wrap on.|
|000059d0| 23 6c 69 6e 65 0a 57 68 | 65 6e 20 70 6f 73 74 2d |#line.Wh|en post-|
|000059e0| 69 6e 64 65 78 65 64 20 | 61 64 64 72 65 73 73 69 |indexed |addressi|
|000059f0| 6e 67 20 69 73 20 75 73 | 65 64 2c 20 74 68 65 20 |ng is us|ed, the |
|00005a00| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 74 68 65 20 |contents| of the |
|00005a10| 62 61 73 65 20 72 65 67 | 69 73 74 65 72 20 61 6c |base reg|ister al|
|00005a20| 6f 6e 65 20 61 72 65 20 | 74 61 6b 65 6e 20 61 73 |one are |taken as|
|00005a30| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 6f 66 20 | the add|ress of |
|00005a40| 74 68 65 20 6d 65 6d 6f | 72 79 20 77 6f 72 64 20 |the memo|ry word |
|00005a50| 74 6f 20 62 65 20 61 63 | 63 65 73 73 65 64 2e 20 |to be ac|cessed. |
|00005a60| 4f 6e 6c 79 20 61 66 74 | 65 72 20 74 68 69 73 20 |Only aft|er this |
|00005a70| 77 6f 72 64 20 68 61 73 | 20 62 65 65 6e 20 61 63 |word has| been ac|
|00005a80| 63 65 73 73 65 64 20 61 | 72 65 20 74 68 65 20 63 |cessed a|re the c|
|00005a90| 6f 6e 74 65 6e 74 73 20 | 6f 66 20 74 68 65 20 6f |ontents |of the o|
|00005aa0| 66 66 73 65 74 20 66 69 | 65 6c 64 20 61 64 64 65 |ffset fi|eld adde|
|00005ab0| 64 20 74 6f 20 74 68 65 | 20 62 61 73 65 20 72 65 |d to the| base re|
|00005ac0| 67 69 73 74 65 72 2e 20 | 4f 62 76 69 6f 75 73 6c |gister. |Obviousl|
|00005ad0| 79 2c 20 74 68 69 73 20 | 69 6d 70 6c 69 65 73 20 |y, this |implies |
|00005ae0| 74 68 61 74 20 77 72 69 | 74 65 20 62 61 63 6b 20 |that wri|te back |
|00005af0| 61 6c 77 61 79 73 20 6f | 63 63 75 72 73 2c 20 73 |always o|ccurs, s|
|00005b00| 6f 20 77 65 20 64 6f 20 | 6e 6f 74 20 6e 65 65 64 |o we do |not need|
|00005b10| 20 74 6f 20 73 70 65 63 | 69 66 79 20 69 74 2e 00 | to spec|ify it..|
|00005b20| 44 41 54 41 21 03 00 00 | 50 72 65 2d 69 6e 64 65 |DATA!...|Pre-inde|
|00005b30| 78 65 64 20 61 64 64 72 | 65 73 73 69 6e 67 0a 23 |xed addr|essing.#|
|00005b40| 62 61 63 6b 67 72 6f 75 | 6e 64 20 77 69 6d 70 20 |backgrou|nd wimp |
|00005b50| 31 0a 23 77 72 61 70 20 | 6f 66 66 0a 53 79 6e 74 |1.#wrap |off.Synt|
|00005b60| 61 78 3a 20 4c 44 52 20 | 28 6f 72 20 53 54 52 29 |ax: LDR |(or STR)|
|00005b70| 20 5c 3c 64 65 73 74 69 | 6e 61 74 69 6f 6e 5c 3e | \<desti|nation\>|
|00005b80| 2c 20 5b 5c 3c 62 61 73 | 65 5c 3e 5c 7b 2c 5c 3c |, [\<bas|e\>\{,\<|
|00005b90| 6f 66 66 73 65 74 5c 3e | 5c 7d 5d 0a 23 77 72 61 |offset\>|\}].#wra|
|00005ba0| 70 20 6f 6e 0a 23 6c 69 | 6e 65 0a 54 68 65 20 64 |p on.#li|ne.The d|
|00005bb0| 65 73 74 69 6e 61 74 69 | 6f 6e 20 66 69 65 6c 64 |estinati|on field|
|00005bc0| 20 69 73 20 74 68 65 20 | 72 65 67 69 73 74 65 72 | is the |register|
|00005bd0| 20 69 6e 74 6f 20 77 68 | 69 63 68 20 74 68 65 20 | into wh|ich the |
|00005be0| 64 61 74 61 20 77 69 6c | 6c 20 62 65 20 74 72 61 |data wil|l be tra|
|00005bf0| 6e 73 66 65 72 72 65 64 | 2e 20 54 68 65 20 63 6f |nsferred|. The co|
|00005c00| 6e 74 65 6e 74 73 20 6f | 66 20 74 68 65 20 62 61 |ntents o|f the ba|
|00005c10| 73 65 20 61 6e 64 20 6f | 66 66 73 65 74 20 66 69 |se and o|ffset fi|
|00005c20| 65 6c 64 73 20 74 6f 67 | 65 74 68 65 72 20 73 70 |elds tog|ether sp|
|00005c30| 65 63 69 66 79 20 74 68 | 65 20 6d 65 6d 6f 72 79 |ecify th|e memory|
|00005c40| 20 77 6f 72 64 20 74 6f | 20 62 65 20 61 63 63 65 | word to| be acce|
|00005c50| 73 73 65 64 2e 20 54 68 | 65 20 6f 66 66 73 65 74 |ssed. Th|e offset|
|00005c60| 20 66 69 65 6c 64 20 69 | 73 20 6f 70 74 69 6f 6e | field i|s option|
|00005c70| 61 6c 20 2d 20 69 66 20 | 70 72 65 73 65 6e 74 2c |al - if |present,|
|00005c80| 20 69 74 20 77 69 6c 6c | 20 62 65 20 61 64 64 65 | it will| be adde|
|00005c90| 64 20 74 6f 20 74 68 65 | 20 62 61 73 65 20 66 69 |d to the| base fi|
|00005ca0| 65 6c 64 20 74 6f 20 67 | 69 76 65 20 74 68 65 20 |eld to g|ive the |
|00005cb0| 72 65 71 75 69 72 65 64 | 20 61 64 64 72 65 73 73 |required| address|
|00005cc0| 2e 20 54 68 65 20 6f 66 | 66 73 65 74 20 66 69 65 |. The of|fset fie|
|00005cd0| 6c 64 20 69 73 20 73 70 | 65 63 69 66 69 65 64 20 |ld is sp|ecified |
|00005ce0| 69 6e 20 74 68 65 20 73 | 61 6d 65 20 77 61 79 20 |in the s|ame way |
|00005cf0| 61 73 20 6f 70 65 72 61 | 6e 64 20 74 77 6f 20 69 |as opera|nd two i|
|00005d00| 6e 20 74 68 65 20 64 61 | 74 61 20 70 72 6f 63 65 |n the da|ta proce|
|00005d10| 73 73 69 6e 67 20 69 6e | 73 74 72 75 63 74 69 6f |ssing in|structio|
|00005d20| 6e 73 2e 0a 23 6c 69 6e | 65 0a 45 78 61 6d 70 6c |ns..#lin|e.Exampl|
|00005d30| 65 73 3a 0a 23 77 72 61 | 70 20 6f 66 66 0a 23 69 |es:.#wra|p off.#i|
|00005d40| 6e 64 65 6e 74 20 32 0a | 4c 44 52 20 52 30 2c 5b |ndent 2.|LDR R0,[|
|00005d50| 52 31 5d 09 09 4c 6f 61 | 64 20 52 30 20 66 72 6f |R1]..Loa|d R0 fro|
|00005d60| 6d 20 61 64 64 72 65 73 | 73 20 52 31 0a 53 54 52 |m addres|s R1.STR|
|00005d70| 20 52 30 2c 5b 52 31 2c | 52 32 5d 09 09 53 74 6f | R0,[R1,|R2]..Sto|
|00005d80| 72 65 20 52 30 20 61 74 | 20 61 64 64 72 65 73 73 |re R0 at| address|
|00005d90| 20 52 31 20 2b 20 52 32 | 0a 4c 44 52 20 52 30 2c | R1 + R2|.LDR R0,|
|00005da0| 5b 52 31 2c 23 2d 34 5d | 09 09 4c 6f 61 64 20 52 |[R1,#-4]|..Load R|
|00005db0| 30 20 66 72 6f 6d 20 61 | 64 64 72 65 73 73 20 52 |0 from a|ddress R|
|00005dc0| 31 20 2d 20 34 0a 53 54 | 52 20 52 30 2c 5b 52 31 |1 - 4.ST|R R0,[R1|
|00005dd0| 2c 52 32 2c 4c 53 4c 23 | 32 5d 09 53 74 6f 72 65 |,R2,LSL#|2].Store|
|00005de0| 20 52 30 20 61 74 20 61 | 64 64 72 65 73 73 20 52 | R0 at a|ddress R|
|00005df0| 31 20 2b 20 52 32 2a 34 | 0a 23 69 6e 64 65 6e 74 |1 + R2*4|.#indent|
|00005e00| 0a 23 6c 69 6e 65 0a 41 | 20 66 75 72 74 68 65 72 |.#line.A| further|
|00005e10| 20 6c 65 76 65 6c 20 6f | 66 20 63 6f 6d 70 6c 65 | level o|f comple|
|00005e20| 78 69 74 79 20 69 73 20 | 74 68 61 74 20 6f 66 20 |xity is |that of |
|00005e30| 3c 77 72 69 74 65 20 62 | 61 63 6b 3d 3e 77 62 3e |<write b|ack=>wb>|
|00005e40| 0a 00 00 00 44 41 54 41 | 52 04 00 00 57 72 69 74 |....DATA|R...Writ|
|00005e50| 65 20 42 61 63 6b 0a 23 | 62 61 63 6b 67 72 6f 75 |e Back.#|backgrou|
|00005e60| 6e 64 20 77 69 6d 70 20 | 31 0a 23 77 72 61 70 20 |nd wimp |1.#wrap |
|00005e70| 6f 6e 0a 49 6e 20 63 61 | 6c 63 75 6c 61 74 69 6e |on.In ca|lculatin|
|00005e80| 67 20 77 68 69 63 68 20 | 77 6f 72 64 20 6f 66 20 |g which |word of |
|00005e90| 6d 65 6d 6f 72 79 20 69 | 73 20 74 6f 20 62 65 20 |memory i|s to be |
|00005ea0| 61 63 63 65 73 73 65 64 | 2c 20 74 68 65 20 41 52 |accessed|, the AR|
|00005eb0| 4d 20 61 64 64 73 20 74 | 6f 67 65 74 68 65 72 20 |M adds t|ogether |
|00005ec0| 74 68 65 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |the cont|ents of |
|00005ed0| 74 68 65 20 62 61 73 65 | 20 61 6e 64 20 6f 66 66 |the base| and off|
|00005ee0| 73 65 74 20 72 65 67 69 | 73 74 65 72 73 2e 20 49 |set regi|sters. I|
|00005ef0| 74 20 69 73 20 73 6f 6d | 65 74 69 6d 65 73 20 75 |t is som|etimes u|
|00005f00| 73 65 66 75 6c 20 74 6f | 20 72 65 74 61 69 6e 20 |seful to| retain |
|00005f10| 74 68 69 73 20 6e 65 77 | 6c 79 20 63 61 6c 63 75 |this new|ly calcu|
|00005f20| 6c 61 74 65 64 20 61 64 | 64 72 65 73 73 20 66 6f |lated ad|dress fo|
|00005f30| 72 20 66 75 74 75 72 65 | 20 75 73 65 2e 20 49 6e |r future| use. In|
|00005f40| 20 70 72 65 2d 69 6e 64 | 65 78 65 64 20 61 64 64 | pre-ind|exed add|
|00005f50| 72 65 73 73 69 6e 67 2c | 20 74 68 69 73 20 69 73 |ressing,| this is|
|00005f60| 20 64 6f 6e 65 20 62 79 | 20 75 73 69 6e 67 20 74 | done by| using t|
|00005f70| 68 65 20 41 52 4d 27 73 | 20 27 77 72 69 74 65 20 |he ARM's| 'write |
|00005f80| 62 61 63 6b 27 20 66 61 | 63 69 6c 69 74 79 2e 0a |back' fa|cility..|
|00005f90| 23 6c 69 6e 65 0a 57 72 | 69 74 65 20 62 61 63 6b |#line.Wr|ite back|
|00005fa0| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 20 77 69 | is spec|ified wi|
|00005fb0| 74 68 20 74 68 65 20 27 | 21 27 20 73 75 66 66 69 |th the '|!' suffi|
|00005fc0| 78 2e 0a 23 77 72 61 70 | 20 6f 66 66 0a 45 78 61 |x..#wrap| off.Exa|
|00005fd0| 6d 70 6c 65 73 3a 0a 23 | 69 6e 64 65 6e 74 20 32 |mples:.#|indent 2|
|00005fe0| 0a 4c 44 52 20 52 30 2c | 5b 52 31 2c 52 32 5d 21 |.LDR R0,|[R1,R2]!|
|00005ff0| 09 09 4c 6f 61 64 20 52 | 30 20 66 72 6f 6d 20 61 |..Load R|0 from a|
|00006000| 64 64 72 65 73 73 20 52 | 31 2b 52 32 09 3a 20 52 |ddress R|1+R2.: R|
|00006010| 31 3d 52 31 2b 52 32 0a | 53 54 52 20 52 33 2c 5b |1=R1+R2.|STR R3,[|
|00006020| 52 35 2c 23 31 30 5d 21 | 09 53 74 6f 72 65 20 52 |R5,#10]!|.Store R|
|00006030| 33 20 61 74 20 61 64 64 | 72 65 73 73 20 52 35 2b |3 at add|ress R5+|
|00006040| 52 31 30 09 3a 20 52 35 | 3d 52 35 2b 31 30 0a 4c |R10.: R5|=R5+10.L|
|00006050| 44 52 20 52 37 2c 5b 52 | 33 2c 52 38 2c 4c 53 4c |DR R7,[R|3,R8,LSL|
|00006060| 23 32 5d 21 09 4c 6f 61 | 64 20 52 37 20 66 72 6f |#2]!.Loa|d R7 fro|
|00006070| 6d 20 61 64 64 72 65 73 | 73 20 52 33 2b 52 38 2a |m addres|s R3+R8*|
|00006080| 34 09 3a 20 52 33 3d 52 | 33 2b 52 38 2a 34 0a 23 |4.: R3=R|3+R8*4.#|
|00006090| 69 6e 64 65 6e 74 0a 23 | 77 72 61 70 20 6e 6f 6a |indent.#|wrap noj|
|000060a0| 6f 69 6e 0a 23 6c 69 6e | 65 0a 57 68 65 6e 20 74 |oin.#lin|e.When t|
|000060b0| 68 65 20 41 52 4d 20 65 | 78 65 63 75 74 65 73 20 |he ARM e|xecutes |
|000060c0| 74 68 65 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 2c |the inst|ruction,|
|000060d0| 20 69 74 20 77 69 6c 6c | 20 70 65 72 66 6f 72 6d | it will| perform|
|000060e0| 20 74 68 65 20 75 73 75 | 61 6c 20 61 64 64 69 74 | the usu|al addit|
|000060f0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 62 61 73 65 20 |ion of t|he base |
|00006100| 61 6e 64 20 6f 66 66 73 | 65 74 20 66 69 65 6c 64 |and offs|et field|
|00006110| 73 2e 20 49 74 20 77 69 | 6c 6c 20 74 68 65 6e 20 |s. It wi|ll then |
|00006120| 61 63 63 65 73 73 20 74 | 68 65 20 64 61 74 61 20 |access t|he data |
|00006130| 61 74 20 74 68 65 20 6e | 65 77 6c 79 20 63 61 6c |at the n|ewly cal|
|00006140| 63 75 6c 61 74 65 64 20 | 61 64 64 72 65 73 73 2e |culated |address.|
|00006150| 20 46 69 6e 61 6c 6c 79 | 2c 20 61 73 20 77 72 69 | Finally|, as wri|
|00006160| 74 65 20 62 61 63 6b 20 | 69 73 20 73 65 6c 65 63 |te back |is selec|
|00006170| 74 65 64 2c 20 69 74 20 | 77 69 6c 6c 20 73 74 6f |ted, it |will sto|
|00006180| 72 65 20 74 68 65 20 6e | 65 77 6c 79 20 63 61 6c |re the n|ewly cal|
|00006190| 63 75 6c 61 74 65 64 20 | 61 64 64 72 65 73 73 20 |culated |address |
|000061a0| 62 61 63 6b 20 69 6e 74 | 6f 20 74 68 65 20 62 61 |back int|o the ba|
|000061b0| 73 65 20 72 65 67 69 73 | 74 65 72 2e 0a 57 72 69 |se regis|ter..Wri|
|000061c0| 74 65 20 62 61 63 6b 20 | 69 73 20 70 61 72 74 69 |te back |is parti|
|000061d0| 63 75 6c 61 72 6c 79 20 | 75 73 65 66 75 6c 20 77 |cularly |useful w|
|000061e0| 68 65 6e 20 61 63 63 65 | 73 73 69 6e 67 20 61 20 |hen acce|ssing a |
|000061f0| 73 65 71 75 65 6e 63 65 | 20 6f 66 20 6d 65 6d 6f |sequence| of memo|
|00006200| 72 79 20 6c 6f 63 61 74 | 69 6f 6e 73 2c 20 65 2e |ry locat|ions, e.|
|00006210| 67 2e 2c 20 74 6f 20 61 | 63 63 65 73 73 20 63 6f |g., to a|ccess co|
|00006220| 6e 73 65 63 75 74 69 76 | 65 20 6d 65 6d 6f 72 79 |nsecutiv|e memory|
|00006230| 20 77 6f 72 64 73 20 77 | 65 20 63 61 6e 20 75 73 | words w|e can us|
|00006240| 65 20 27 4c 44 52 20 52 | 30 2c 5b 62 61 73 65 2c |e 'LDR R|0,[base,|
|00006250| 23 34 5d 21 27 2e 20 57 | 72 69 74 65 20 62 61 63 |#4]!'. W|rite bac|
|00006260| 6b 20 68 65 6e 63 65 20 | 61 6c 6c 6f 77 73 20 74 |k hence |allows t|
|00006270| 68 65 20 65 61 73 79 20 | 63 72 65 61 74 69 6f 6e |he easy |creation|
|00006280| 20 61 6e 64 20 61 63 63 | 65 73 73 20 6f 66 20 61 | and acc|ess of a|
|00006290| 72 72 61 79 73 2e 00 00 | 44 41 54 41 81 05 00 00 |rrays...|DATA....|
|000062a0| 4c 44 4d 3a 20 4c 6f 61 | 64 20 4d 75 6c 74 69 70 |LDM: Loa|d Multip|
|000062b0| 6c 65 20 52 65 67 69 73 | 74 65 72 73 0a 23 62 61 |le Regis|ters.#ba|
|000062c0| 63 6b 67 72 6f 75 6e 64 | 20 77 69 6d 70 20 31 0a |ckground| wimp 1.|
|000062d0| 23 77 72 61 70 20 6f 66 | 66 0a 53 79 6e 74 61 78 |#wrap of|f.Syntax|
|000062e0| 3a 20 4c 44 4d 20 5c 3c | 6f 70 74 69 6f 6e 73 5c |: LDM \<|options\|
|000062f0| 3e 20 5c 3c 62 61 73 65 | 5c 3e 20 5c 7b 21 5c 7d |> \<base|\> \{!\}|
|00006300| 2c 20 5c 3c 72 65 67 69 | 73 74 65 72 5c 5f 6c 69 |, \<regi|ster\_li|
|00006310| 73 74 5c 3e 0a 4f 70 65 | 72 61 74 69 6f 6e 3a 20 |st\>.Ope|ration: |
|00006320| 4d 75 6c 74 69 70 6c 65 | 20 74 72 61 6e 73 66 65 |Multiple| transfe|
|00006330| 72 20 6f 66 20 64 61 74 | 61 20 66 72 6f 6d 20 74 |r of dat|a from t|
|00006340| 68 65 20 72 65 67 69 73 | 74 65 72 73 20 74 6f 20 |he regis|ters to |
|00006350| 6d 65 6d 6f 72 79 0a 23 | 77 72 61 70 20 6e 6f 6a |memory.#|wrap noj|
|00006360| 6f 69 6e 0a 23 6c 69 6e | 65 0a 54 68 65 20 72 65 |oin.#lin|e.The re|
|00006370| 67 69 73 74 65 72 5f 6c | 69 73 74 20 69 73 20 74 |gister_l|ist is t|
|00006380| 68 65 20 73 65 72 69 65 | 73 20 6f 66 20 72 65 67 |he serie|s of reg|
|00006390| 69 73 74 65 72 20 6e 61 | 6d 65 73 2c 20 73 65 70 |ister na|mes, sep|
|000063a0| 61 72 61 74 65 64 20 62 | 79 20 63 6f 6d 6d 61 73 |arated b|y commas|
|000063b0| 2c 20 74 68 65 20 63 6f | 6e 74 65 6e 74 73 20 6f |, the co|ntents o|
|000063c0| 66 20 77 68 69 63 68 20 | 77 65 20 77 61 6e 74 20 |f which |we want |
|000063d0| 74 6f 20 6c 6f 61 64 20 | 66 72 6f 6d 20 6d 65 6d |to load |from mem|
|000063e0| 6f 72 79 2e 20 54 68 65 | 20 6f 72 64 65 72 20 6f |ory. The| order o|
|000063f0| 66 20 74 68 65 20 72 65 | 67 69 73 74 65 72 73 20 |f the re|gisters |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.