The Complete Machine Code Tutor (UK) (Face 3) (1985) [Original] [TAPE] [UTILITAIRE].cdt
HexaDumpAscii only
000000:  5A 58 54 61 70 65 21 1A 01 0C 20 0D 40 11 09 09    ZXTape!... .@...
000010:  A6 04 57 04 8F 04 1C 09 00 10 08 0F 00 07 01 00    ..W.............
000020:  2C 4D 2F 43 20 54 55 54 4F 52 00 00 00 00 00 00    ,M/C TUTOR......
000030:  00 01 FF 02 6F 05 FA 0F FF 6F 05 00 10 00 00 00    ....o....o......
000040:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000050:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000060:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000070:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000080:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000090:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0000F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000100:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000110:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000120:  00 E6 79 FF FF FF FF 11 06 09 A6 04 57 04 8D 04    ..y.........W...
000130:  18 09 00 10 08 E7 21 11 06 00 16 CD A1 BC D4 00    ......!.........
000140:  00 CD FF BB 3E 00 DD 21 A3 10 DD 46 00 48 F5 CD    ....>..!£..F.H..
000150:  32 BC F1 DD 23 3C FE 04 20 F0 01 0E 0E CD 38 BC    2...#<.. .....8.
000160:  21 00 C0 11 01 C0 01 FF 3F 36 00 ED B0 3E 05 CD    !.......?6...>..
000170:  6F BB 3E 16 CD 72 BB 06 1F 21 A7 10 7E C5 E5 CD    o.>..r...!..~...
000180:  5D BB E1 C1 23 10 F5 DD 21 C6 10 21 00 C0 11 00    ]...#...!..!....
000190:  08 CD 63 10 21 00 E0 CD 63 10 21 00 10 11 00 43    ..c.!...c.!....C
0001A0:  3E 6C 18 97 DD 7E 00 07 DD AE 00 E6 22 DD 7E 00    >l...~......".~.
0001B0:  DD 23 0E 01 20 05 DD 4E 00 DD 23 B9 20 03 FE 00    .#.. ..N..#. ...
0001C0:  C8 06 04 E5 F5 77 CB 67 20 06 CB 27 CB A7 18 04    .....w.g ..'....
0001D0:  CB 27 CB E7 CB 4F 28 01 3C 19 10 E9 F1 E1 23 0D    .'...O(.<.....#.
0001E0:  20 DF 18 C0 0E 18 09 01 A4 20 4E 65 77 20 47 65     ........ New Ge
0001F0:  6E 65 72 61 74 69 6F 6E 20 53 6F 66 74 77 61 72    neration Softwar
000200:  65 20 20 31 39 38 35 00 C0 11 F0 05 11 F0 01 00    e  1985.........
000210:  01 11 F0 01 11 F0 04 00 42 FF 01 F0 01 00 02 FF    ........B.......
000220:  01 F0 04 FF 01 F0 03 00 43 FF 01 F0 01 00 02 FF    ........C.......
000230:  01 F0 01 00 01 FF 01 F0 01 FF 01 0C 76 F0 04 00    ............v...
000240:  D2 11 F0 01 0F 01 1F F0 01 00 01 11 F0 01 0F 01    ................
000250:  1F F0 01 FF 01 F0 02 11 F0 02 FF 01 F0 01 0F 01    ................
000260:  1F F0 01 FF 01 F0 01 00 03 FF 01 F0 01 0F 02 0E    ................
000270:  EF 0F 01 1F F0 01 0F 01 0E FF 01 F0 01 0F 02 0E    ................
000280:  00 25 FF 01 F0 01 00 01 11 F0 01 00 01 FF 01 F0    .%..............
000290:  01 00 01 FF 01 F0 01 FF 01 F0 01 EF 0E FF 01 F0    ................
0002A0:  01 FF 01 F0 01 0F 01 0E 00 01 FF 01 F0 01 00 03    ................
0002B0:  FF 01 F0 01 0F 01 0E 00 03 FF 01 F0 01 00 02 FF    ................
0002C0:  01 F0 01 0F 01 0E 00 27 EF 0F 01 0E 00 03 EF 0F    .......'........
0002D0:  01 0E 00 01 EF 0E 00 02 EF 0E EF 0E 00 03 EF 0F    ................
0002E0:  03 0E EF 0F 03 0E 00 02 EF 0E 00 02 EF 0F 03 0E    ................
0002F0:  00 69 11 F0 01 00 02 11 F0 01 00 03 11 F0 01 00    .i..............
000300:  04 11 F0 02 00 02 11 F0 01 00 01 11 F0 01 00 01    ................
000310:  11 F0 01 00 01 11 F0 01 00 02 11 F0 01 11 F0 04    ................
000320:  00 09 11 F0 02 00 02 11 F0 02 00 01 11 F0 03 00    ................
000330:  01 11 F0 04 00 0C FF 01 F0 01 1F F0 01 FF 56 1F    ..............V.
000340:  F0 01 00 01 11 F0 01 0E EF 1F F0 01 00 01 FF 01    ................
000350:  F0 01 00 01 EF 0E 00 01 FF 01 F0 04 00 01 FF 01    ................
000360:  F0 01 00 01 FF 01 F0 01 1F F0 01 FF 01 F0 01 FF    ................
000370:  01 F0 03 00 09 FF 01 F0 01 00 01 EF 0E FF 01 F0    ................
000380:  01 00 01 FF 01 F0 01 FF 01 F0 01 00 01 FF 01 F0    ................
000390:  01 FF 01 F0 03 00 0D FF 01 F0 01 00 02 FF 01 F0    ................
0003A0:  01 00 01 FF 01 F0 01 0F 02 1F F0 01 00 01 EF 1F    ................
0003B0:  F0 02 0E 00 01 FF 01 F0 01 00 01 FF 01 F0 01 00    ................
0003C0:  01 FF 01 F0 01 00 01 FF 01 F0 01 00 01 EF 1F F0    ................
0003D0:  01 FF 01 F0 04 00 08 EF 1F F0 02 0E EF 1F F0 02    ................
0003E0:  0E FF 01 F0 03 0E FF 01 F0 04 00 C0 EF 0F 01 1F    ................
0003F0:  F0 01 0F 01 0E FF 01 F0 01 00 01 FF 01 F0 01 EF    ................
000400:  0F 01 1F F0 01 0F 01 0E 11 F0 01 0F 01 1F F0 01    ................
000410:  FF 01 F0 01 0F 01 1F F0 01 00 37 FF 01 F0 01 00    ..........7.....
000420:  02 FF 01 F0 01 00 01 FF 01 F0 01 00 02 FF 01 F0    ................
000430:  01 00 02 FF 01 F0 01 00 01 FF 01 F0 01 FF 01 DE    ................
000440:  A2 F0 01 1F F0 01 00 38 EF 0E 00 03 EF 0F 01 0E    .......8........
000450:  00 03 EF 0E 00 03 EF 0F 01 0E 00 01 EF 0E 00 01    ................
000460:  EF 0E 00 00 00 C0 EF 0F 01 1F F0 01 0F 01 0E FF    ................
000470:  01 F0 01 00 01 FF 01 F0 01 FF 01 F0 01 0F 02 0E    ................
000480:  00 42 FF 01 F0 01 00 02 FF 01 F0 01 0F 01 1F F0    .B..............
000490:  01 FF 01 F0 01 0F 01 0E 00 43 EF 0E 00 02 EF 0E    .........C......
0004A0:  00 01 EF 0E EF 0F 03 0E 00 83 11 F0 02 00 03 11    ................
0004B0:  F0 02 00 01 11 F0 01 00 02 11 F0 01 11 F0 03 00    ................
0004C0:  01 11 F0 01 00 03 11 F0 04 11 F0 05 11 F0 04 00    ................
0004D0:  25 FF 01 F0 01 00 01 EF 0E 00 01 FF 01 F0 01 00    %...............
0004E0:  01 FF 01 F0 01 FF 01 F0 01 1F F0 01 1F F0 01 FF    ................
0004F0:  01 F0 03 0E FF 01 F0 01 00 03 FF 01 F0 03 00 03    ................
000500:  FF 01 F0 01 00 02 FF 01 F0 03 00 26 EF 1F F0 02    ...........&....
000510:  0E 00 01 EF 1F F0 02 0E FF 01 F0 01 00 02 FF 01    ................
000520:  F0 01 FF 01 F0 01 00 03 FF 01 F0 04 FF 01 F0 04    ................
000530:  00 02 FF 01 F0 01 00 02 FF 01 F0 04 00 B9 FF 01    ................
000540:  F0 00 32 02 11 F0 02 00 02 11 F0 01 1F F0 01 00    ..2.............
000550:  02 11 F0 01 0F 01 1F F0 01 00 01 FF 01 F0 01 00    ................
000560:  01 FF 01 F0 01 00 01 FF 01 F0 01 00 01 FF 01 F0    ................
000570:  02 00 01 FF 01 F0 01 FF 01 F0 01 0F 02 0E 00 08    ................
000580:  11 F0 01 0F 01 1F F0 01 11 F0 01 0F 01 1F F0 01    ................
000590:  FF 01 F0 01 0F 01 1F F0 01 FF 01 F0 01 0F 02 0E    ................
0005A0:  00 0C FF 01 F0 01 EF 0E FF 01 F0 01 00 01 FF 01    ................
0005B0:  F0 05 00 01 FF 01 F0 01 00 01 11 F0 01 00 01 FF    ................
0005C0:  01 F0 01 0F 01 1F F0 01 00 01 FF 01 F0 01 00 01    ................
0005D0:  FF 01 F0 01 EF 1F F0 02 FF 01 F0 01 0F 01 0E 00    ................
0005E0:  09 FF 01 F0 01 00 01 11 F0 01 FF 01 F0 01 00 01    ................
0005F0:  FF 01 F0 01 FF 01 F0 01 00 01 FF 01 F0 01 FF 01    ................
000600:  F0 01 0F 01 0E 00 0D EF 0E 00 02 EF 0E 00 01 EF    ................
000610:  0E 00 02 EF 0E 00 02 EF 0F 01 0E 00 02 EF 0E 00    ................
000620:  01 EF 0E 00 01 EF 0E 00 01 EF 0E 00 02 EF 0E EF    ................
000630:  0F 03 0E 00 09 EF 0F 01 0E 00 02 EF 0F 01 0E 00    ................
000640:  01 EF 0F 70 8F 02 0E 00 01 EF 0F 03 0E 00 70 11    ...p..........p.
000650:  F0 05 11 F0 01 00 01 11 F0 01 11 F0 05 00 01 11    ................
000660:  F0 02 00 01 11 F0 03 00 38 FF 01 F0 01 00 02 FF    ........8.......
000670:  01 F0 01 00 01 FF 01 F0 01 00 02 FF 01 F0 01 00    ................
000680:  02 FF 01 F0 01 00 01 FF 01 F0 01 FF 01 F0 03 0E    ................
000690:  00 37 FF 01 F0 01 00 02 EF 1F F0 02 0E 00 02 FF    .7..............
0006A0:  01 F0 01 00 02 EF 1F F0 02 0E FF 01 F0 01 EF 1F    ................
0006B0:  F0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0006C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0006D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0006E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0006F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000700:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000710:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000720:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000730:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000740:  00 00 00 00 00 50 B3 FF FF FF FF 11 08 09 A6 04    .....P..........
000750:  57 04 8B 04 16 09 FF 0F 08 FB 1D 8B 43 00 6C 0D    W...........C.l.
000760:  71 BC 21 BA 10 CD 88 10 CD D9 51 38 18 CD 9B 10    q.!.......Q8....
000770:  CD CB 51 CD B3 19 CD 1F 10 CD CB 51 18 E4 ED 73    ..Q........Q...s
000780:  59 14 C3 48 12 21 00 11 CD 88 10 21 B7 11 11 01    Y..H.!.....!....
000790:  00 3E FC CD A1 BC 30 3C 3A B7 11 FE 00 21 22 11    .>....0<:....!".
0007A0:  28 15 FE 02 21 40 11 28 0E FE 04 21 5F 11 28 07    (...!@.(...!_.(.
0007B0:  FE 06 21 7E 11 20 24 CD 88 10 21 00 58 11 00 55    ..!~. $...!.X..U
0007C0:  3E FB CD A1 BC 30 0D CD 9B 10 3E 0F 32 91 1A CD    >....0....>.2...
0007D0:  E8 50 18 B1 21 E0 10 FE 00 28 03 21 9D 11 CD 88    .P..!....(.!....
0007E0:  10 CD 93 10 C3 03 10 3E F0 32 91 1A 11 00 18 C3    .......>.2......
0007F0:  B0 51 06 00 CD 19 BD 10 FB C9 CD FF BB 3E 00 DD    .Q...........>..
000800:  21 92 1A DD 46 00 48 F5 CD 32 BC F1 DD 23 3C FE    !...F.H..2...#<.
000810:  04 20 F0 01 0E 0E C3 38 BC 20 20 44 6F 20 79 6F    . .....8.  Do yo
000820:  75 20 77 69 73 68 20 74 6F 20 65 6E 74 65 72 20    u wish to enter 
000830:  6C 65 73 73 6F 6E 73 3F 20 20 20 59 2F 4E A3 20    lessons?   Y/N£ 
000840:  20 20 20 20 20 20 4C 6F 61 64 69 6E 67 20 68 61          Loading ha
000850:  73 20 62 65 65 6E 20 73 74 6F 70 70 65 64 A3 B2    s been stopped£.
000860:  00 20 20 20 20 20 20 20 50 6C 65 61 73 65 20 73    .       Please s
000870:  74 61 72 74 20 74 61 70 65 20 72 65 63 6F 72 64    tart tape record
000880:  65 72 A3 20 20 20 20 20 20 20 20 20 20 4C 6F 61    er£          Loa
000890:  64 69 6E 67 20 6C 65 73 73 6F 6E 73 20 31 2D 39    ding lessons 1-9
0008A0:  A3 20 20 20 20 20 20 20 20 20 4C 6F 61 64 69 6E    £         Loadin
0008B0:  67 20 6C 65 73 73 6F 6E 73 20 31 30 2D 31 37 A3    g lessons 10-17£
0008C0:  20 20 20 20 20 20 20 20 20 4C 6F 61 64 69 6E 67             Loading
0008D0:  20 6C 65 73 73 6F 6E 73 20 31 38 2D 32 35 A3 20     lessons 18-25£ 
0008E0:  20 20 20 20 20 20 20 20 4C 6F 61 64 69 6E 67 20            Loading 
0008F0:  6C 65 73 73 6F 6E 73 20 32 36 2D 33 35 A3 20 20    lessons 26-35£  
000900:  20 20 20 20 20 20 20 20 20 20 4C 6F 61 64 69 6E              Loadin
000910:  67 20 65 72 72 6F 72 A3 00 00 ED 73 59 14 CD 55    g error£...sY..U
000920:  13 CD E6 12 CD 00 14 CD DF 33 CD CB 13 21 3C 16    .........3...!<.
000930:  11 00 12 CD F1 32 C3 6A 12 CD 06 BB CD 19 BD FE    .....2.j........
000940:  45 28 66 FE 54 CA 0A 13 FE 52 28 11 3E 42 CD 1E    E(f.T....R(.>B..
000950:  BB 28 E6 ED 7B 59 14 3E 0F 32 91 1A C9 CD E6 12    .(..{Y.>.2......
000960:  CD 95 07 76 12 DD 2A EC 3B 11 00 12 ED 53 D0 31    ...v..*.;....S.1
000970:  DD 7E 03 FE 72 38 08 21 EC 15 CD F1 32 18 BC CD    .~..r8.!....2...
000980:  46 20 DD 7E 03 FE 72 30 B2 CD 06 BB FE 53 28 0F    F .~..r0.....S(.
000990:  FE 45 28 17 FE 23 28 BD CD 35 3E 30 C5 18 9C 21    .E(..#(..5>0...!
0009A0:  8C 16 11 00 12 CD F1 32 C3 D8 11 CD 8F 13 CD E6    .......2........
0009B0:  12 CD B6 18 CD 00 14 CD E6 12 ED 73 0E 3B CD DF    ...........s.;..
0009C0:  33 CD CB 13 21 4B 15 11 00 12 CD F1 32 CD F3 3C    3...!K......2..<
0009D0:  CD AE 3D CD E6 12 C3 D8 11 2A 12 14 CD 1A BC 0E    ..=......*......
0009E0:  08 06 50 7E E6 0F 77 23 10 F9 11 B0 07 19 0D 20    ..P~..w#....... 
0009F0:  F0 DD 21 20 3B ED 5B CD 31 21 02 00 06 10 C5 DD    ..! ;.[.1!......
000A00:  CB 00 7E 28 29 DD 7E 08 BB 20 23 DD 7E 09 BA 20    ..~().~.. #.~.. 
000A10:  1D C1 DD 22 EC 3B 22 12 14 CD 1A BC 0E 08 06 50    ...".;"........P
000A20:  7E ED 6F 23 10 FA 11 B0 07 19 0D 20 F1 C9 01 0C    ~.o#....... ....
000A30:  00 DD 09 2C C1 10 C7 3E 0F 32 91 1A 11 00 12 21    ...,...>.2.....!
000A40:  9C 15 CD F1 32 E1 C3 D8 11 DD 21 20 3B DD 22 EC    ....2.....! ;.".
000A50:  3B DD 6E 08 DD 66 09 22 CD 31 21 01 02 22 D0 31    ;.n..f.".1!..".1
000A60:  21 45 17 95 3F 22 EE 3B 21 FE 0F 22 9B 42 C9 3A    !E..?".;!..".B.:
000A70:  CF 31 EE 01 32 CF 31 CD 21 13 CD E6 12 CD 00 14    .1..2.1.!.......
000A80:  CD DF 33 C3 6A 12 CD B3 19 DD 21 20 3B 11 45 17    ..3.j.....! ;.E.
000A90:  06 10 21 CF 31 CB D6 C5 D5 DD 22 EC 3B CD D2 31    ..!.1.....".;..1
000AA0:  11 0C 00 DD 19 D1 21 17 00 19 EB C1 10 E9 21 CF    ......!.......!.
000AB0:  31 CB 96 CD CB 13 CD D9 19 C9 CD B3 19 2A 41 17    1............*A.
000AC0:  11 45 17 06 10 3E 20 C5 BE 01 06 00 28 05 ED B0    .E...> .....(...
000AD0:  13 18 05 EB 0C 09 EB 23 01 10 00 CB 7E 20 0C ED    .......#....~ ..
000AE0:  A0 EA 76 13 C1 10 E0 CD D9 19 C9 23 ED A0 E2 7F    ..v........#....
000AF0:  13 2B 18 F8 3E F0 32 91 1A 11 00 00 21 83 14 CD    .+..>.2.....!...
000B00:  F1 32 3E 0F 32 91 1A 3E 20 CD 45 1A 3E 14 BA 20    .2>.2..> .E.>.. 
000B10:  F6 DD 21 3B 14 06 0A C5 DD 7E 00 32 91 1A DD 6E    ..!;.....~.2...n
000B20:  01 DD 66 02 CD F1 32 01 03 00 DD 09 C1 10 E8 C9    ..f...2.........
000B30:  3E F0 32 91 1A 11 00 00 21 5B 14 CD F1 32 3E 0F    >.2.....![...2>.
000B40:  32 91 1A 11 00 14 DD 21 14 14 06 0D C5 DD 7E 00    2......!......~.
000B50:  32 91 1A DD 6E 01 DD 66 02 CD F1 32 01 03 00 DD    2...n..f...2....
000B60:  09 C1 10 E8 C9 95 F4 11 00 02 21 2F 17 CD F1 32    ..........!/...2
000B70:  14 1E 00 3E 12 BA 20 F2 C9 02 00 F0 DD 16 0F 05    ...>.. .........
000B80:  17 F0 23 17 0F 3C 17 0F 0A 17 0F 23 17 0F 3C 17    ..#..<.....#..<.
000B90:  0F 0F 17 F0 23 17 0F 3C 17 0F 14 17 0F 23 17 0F    ....#..<.....#..
000BA0:  3C 17 0F AB 14 0F 19 17 F0 FB 14 0F FE 14 F0 0B    <...............
000BB0:  15 0F 10 15 F0 23 15 0F 26 15 F0 33 15 0F 38 15    .....#..&..3..8.
000BC0:  00 00 41 44 44 52 45 53 53 20 4D 41 43 48 49 4E    ..ADDRESS MACHIN
000BD0:  45 20 43 4F 44 45 20 20 20 20 53 4F 55 52 43 45    E CODE    SOURCE
000BE0:  20 43 4F 44 45 20 20 20 20 A0 20 41 53 53 45 4D     CODE    . ASSEM
000BF0:  42 4C 45 44 20 43 4F 44 45 20 20 20 4C 41 42 45    BLED CODE   LABE
000C00:  4C 53 20 20 49 4E 53 54 52 55 43 54 49 4F 4E 53    LS  INSTRUCTIONS
000C10:  20 A0 43 75 72 73 6F 72 20 6B 65 79 73 2C 20 64     .Cursor keys, d
000C20:  65 6C 65 74 65 2C 20 61 6E 64 20 61 75 74 6F 2D    elete, and auto-
000C30:  72 65 70 65 61 74 20 61 72 65 61 73 20 73 74 61    repeat areas sta
000C40:  6E 64 61 72 64 2E 20 45 53 43 20 72 65 74 75 72    ndard. ESC retur
000C50:  6E 73 20 79 6F 75 20 74 6F 20 6D 65 6E 75 2E 20    ns you to menu. 
000C60:  20 A0 5B 43 DD 20 63 3D AC 6C 65 61 72 73 20 61     .[C. c=.lears a
000C70:  6C 6C 20 A0 45 4E 54 45 D2 20 74 61 62 73 20 74    ll .ENTE. tabs t
000C80:  6F 20 6E 65 78 74 20 6C 69 6E 65 A0 5B 41 DD 20    o next line.[A. 
000C90:  61 73 73 65 6D 62 6C 65 73 20 20 A0 53 50 41 43    assembles  .SPAC
000CA0:  C5 20 74 61 62 73 20 69 6E 20 6C 61 62 65 6C 20    . tabs in label 
000CB0:  61 72 65 E1 20 50 72 6F 67 72 61 6D 20 68 61 73    are. Program has
000CC0:  20 73 75 63 63 65 73 73 66 75 6C 6C 79 20 61 73     successfully as
000CD0:  73 65 6D 62 6C 65 64 2E 20 20 20 20 50 72 65 73    sembled.    Pres
000CE0:  73 20 52 75 6E 2C 20 45 64 69 74 2C 20 6F 72 20    s Run, Edit, or 
000CF0:  45 53 43 20 74 6F 20 65 78 69 74 2E 20 20 20 20    ESC to exit.    
000D00:  20 20 20 A0 A0 20 50 72 6F 67 72 61 6D 20 63 6F       .. Program co
000D10:  75 6E 74 65 72 20 68 61 73 20 6A 75 6D 70 65 64    unter has jumped
000D20:  20 74 6F 20 6E 6F 6E 2D 76 61 6C 69 64 61 64 64     to non-validadd
000D30:  72 65 73 73 2E 20 45 44 49 54 20 6F 72 20 72 65    ress. EDIT or re
000D40:  52 55 4E 20 70 72 6F 67 72 61 6D 2E 20 20 20 20    RUN program.    
000D50:  20 20 20 20 A0 20 59 6F 75 20 61 72 65 20 74 72        . You are tr
000D60:  79 69 6E 67 20 74 6F 20 72 C7 30 75 6E 20 63 6F    ying to r.0un co
000D70:  64 65 20 69 6E 20 61 6C 6C 6F 63 61 74 65 64 73    de in allocateds
000D80:  74 6F 72 61 67 65 20 61 72 65 61 2E 20 52 45 54    torage area. RET
000D90:  20 6D 69 73 73 69 6E 67 3F 20 50 6C 65 61 73 65     missing? Please
000DA0:  20 45 44 49 54 20 A0 20 50 72 65 73 73 20 5B 52     EDIT . Press [R
000DB0:  5D 20 74 6F 20 72 75 6E 20 65 78 61 6D 70 6C 65    ] to run example
000DC0:  2C 20 5B 45 5D 20 74 6F 20 20 65 64 69 74 2C 61    , [E] to  edit,a
000DD0:  6E 64 20 45 53 43 20 74 6F 20 72 65 74 75 72 6E    nd ESC to return
000DE0:  20 74 6F 20 6D 65 6E 75 2E 20 20 20 20 20 20 20     to menu.       
000DF0:  20 20 20 20 20 20 A0 20 50 72 6F 67 72 61 6D 20          . Program 
000E00:  73 74 6F 70 70 65 64 2E 20 59 6F 75 20 6D 61 79    stopped. You may
000E10:  20 72 65 2D 52 55 4E 2C 20 45 44 49 54 20 20 6F     re-RUN, EDIT  o
000E20:  72 20 70 72 65 73 73 20 45 53 43 20 74 6F 20 72    r press ESC to r
000E30:  65 74 75 72 6E 20 74 6F 20 6D 65 6E 75 2E 20 20    eturn to menu.  
000E40:  20 20 20 20 20 20 20 A0 46 4C 41 47 53 20 20 20           .FLAGS   
000E50:  20 52 65 67 69 73 74 65 72 73 20 61 6E 64 20 43     Registers and C
000E60:  6F 6E 74 65 6E 74 73 20 20 20 20 D6 C6 53 54 41    ontents    ..STA
000E70:  43 CB 20 43 3A 20 A0 20 5A 3A 20 A0 50 56 3A 20    C. C: . Z: .PV: 
000E80:  A0 20 53 3A 20 A0 20 20 20 20 20 20 20 20 20 20    . S: .          
000E90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
000EA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 A0 00 00                 ...
000EB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000EC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000ED0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000EE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000EF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F00:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F60:  00 00 00 00 00 00 00 00 00 00 00 00 00 7A 6E 00    .............zn.
000F70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000F90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000FF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001010:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001020:  00 00 00 00 00 DD 21 3F 1A CD D9 19 CD 15 1A CD    ......!?........
001030:  06 BB 32 43 1A 3E 42 CD 1E BB 28 05 ED 7B 59 14    ..2C.>B...(..{Y.
001040:  C9 CD 19 BD CD 2A 1A 3A 43 1A FE 0D 20 13 DD 36    .....*.:C... ..6
001050:  00 00 DD 34 01 DD 7E 01 FE 10 20 CD DD 35 01 18    ...4..~... ..5..
001060:  C8 FE F2 01 FF 00 28 4E FE F3 01 01 00 28 47 4B    ......(N.....(GK
001070:  19 FE F1 01 00 01 28 40 FE F0 01 00 FF 28 39 FE    ......(@.....(9.
001080:  43 CA A2 19 FE 7F 28 6B FE 41 C8 FE 20 38 9F FE    C.....(k.A.. 8..
001090:  3A 38 0A FE 61 38 97 FE 7B 30 93 D6 20 CD C1 19    :8..a8..{0.. ...
0010A0:  3A 43 1A FE 20 20 0E DD 7E 00 FE 06 30 07 DD 34    :C..  ..~...0..4
0010B0:  00 3E 20 18 E8 01 01 00 DD 36 03 0F DD 7E 00 81    .> ......6...~..
0010C0:  FE 16 38 0C CB 79 20 05 3E 00 04 18 03 05 3E 15    ..8..y .>.....>.
0010D0:  DD 77 00 DD 7E 01 80 FE 10 30 06 DD 77 01 C3 BA    .w..~....0..w...
0010E0:  18 CB 78 28 07 DD 36 01 00 C3 BA 18 DD 36 01 0F    ..x(..6......6..
0010F0:  C3 BA 18 DD 35 00 F2 9A 19 DD 36 00 15 DD 35 01    ....5.....6...5.
001100:  F2 9A 19 DD 36 00 00 DD 36 01 00 3E 20 CD C1 19    ....6...6..> ...
001110:  C3 BA 18 CD B3 19 DD 36 00 00 DD 36 01 00 DD 36    .......6...6...6
001120:  02 00 18 94 21 45 17 11 46 17 36 20 01 6F 01 ED    ....!E..F.6 .o..
001130:  B0 C9 4F 21 45 17 11 17 00 DD 7E 01 FE 00 28 04    ..O!E.....~...(.
001140:  47 19 10 FD DD 5E 00 19 71 C9 21 43 17 11 17 00    G....^..q.!C....
001150:  06 10 19 CB FE 10 FB 21 45 17 06 10 11 12 02 C5    .......!E.......
001160:  CD F1 32 23 23 1E 12 C1 10 F5 21 43 17 11 17 00    ..2##.....!C....
001170:  06 97 F9 10 19 CB BE 10 FB C9 DD 6E 01 2C 2C 3E    ...........n.,,>
001180:  12 DD 86 00 67 C3 1A BC CD 07 1A 11 FF 07 06 08    ....g...........
001190:  3E 00 ED 6F 23 3E 00 ED 6F 19 10 F4 C9 CD 07 1A    >..o#>..o.......
0011A0:  11 FF 07 06 08 3E 00 ED 67 23 3E 00 ED 67 19 10    .....>..g#>..g..
0011B0:  F4 C9 00 00 00 00 00 00 E5 21 CF 31 CB 56 28 04    .........!.1.V(.
0011C0:  12 13 E1 C9 D5 6F 26 00 29 29 29 25 29 01 96 1A    .....o&.)))%)...
0011D0:  09 CD 72 1A D1 1C 3E 28 BB 20 08 1E 00 3E 18 BA    ..r...>(. ...>..
0011E0:  28 01 14 E1 C9 EB 7C 65 6F CD 1A BC 3A 91 1A 4F    (.....|eo...:..O
0011F0:  06 08 C5 1A A1 77 23 13 1A A1 77 13 01 FF 07 09    .....w#...w.....
001200:  C1 10 EF C9 0F 00 18 0E 06 FF FF FF FF FF FF FF    ................
001210:  FF FF FF FF FF FF FF FF FF EE 77 EE 77 EE 77 EE    ..........w.w.w.
001220:  77 EE 77 FF FF EE 77 FF FF 39 39 39 39 39 39 FF    w.w...w..999999.
001230:  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF    ................
001240:  FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00    ................
001250:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001260:  00 00 00 00 00 00 00 00 00 CC 77 99 33 CC 77 88    ..........w.3.w.
001270:  99 22 33 71 CA 33 33 88 99 FF FF EE 77 EE 77 CC    ."3q.33.....w.w.
001280:  FF FF FF FF FF FF FF FF FF FF FF FF 33 EE 77 CC    ............3.w.
001290:  FF CC FF CC FF EE 77 FF 33 FF FF CC FF EE 77 FF    ......w.3.....w.
0012A0:  33 FF 33 FF 33 EE 77 CC FF FF FF FF FF 99 99 CC    3.3.3.w.........
0012B0:  33 00 00 CC 33 99 99 FF FF FF FF FF FF EE 77 EE    3...3.........w.
0012C0:  77 88 11 EE 77 EE 77 FF FF FF FF FF FF FF FF FF    w...w.w.........
0012D0:  FF FF FF FF FF EE 77 EE 77 CC FF FF FF FF FF FF    ......w.w.......
0012E0:  FF 88 11 FF FF FF FF FF FF FF FF FF FF FF FF FF    ................
0012F0:  FF FF FF FF FF EE 77 EE 77 FF FF FF 99 FF 33 EE    ......w.w.....3.
001300:  77 CC FF 99 FF 33 FF 77 FF FF FF 88 33 33 99 33    w....3.w....33.3
001310:  11 22 99 11 99 33 99 88 33 FF FF EE 77 CC 77 EE    ."...3..3...w.w.
001320:  77 EE 77 EE 77 EE 77 88 11 FF FF CC 33 99 99 FF    w.w.w.w.....3...
001330:  99 CC 33 99 FF 99 99 88 11 FF FF CC 33 BB 99 FF    ..3.........3...
001340:  99 EE 33 FF 99 99 99 CC 33 FF FF EE 77 CC 77 AA    ..3.....3...w.w.
001350:  77 66 77 00 11 EE 77 CC 33 FF FF 88 11 99 DD 99    wfw...w.3.......
001360:  FF CC 33 FF 99 99 99 CC 33 FF FF CC 33 99 99 99    ..3.....3...3...
001370:  FF 88 33 99 99 78 28 99 99 CC 33 FF FF 88 11 BB    ..3..x(...3.....
001380:  99 FF 99 FF 33 EE 77 EE 77 EE 77 FF FF CC 33 99    ....3.w.w.w...3.
001390:  99 99 99 CC 33 99 99 99 99 CC 33 FF FF CC 33 99    ....3.....3...3.
0013A0:  99 99 99 CC 11 FF 99 99 99 CC 33 FF FF FF FF FF    ..........3.....
0013B0:  FF EE 77 EE 77 FF FF EE 77 EE 77 FF FF FF FF FF    ..w.w...w.w.....
0013C0:  FF EE 77 EE 77 FF FF EE 77 EE 77 CC FF FF 33 EE    ..w.w...w.w...3.
0013D0:  77 CC FF 99 FF CC FF EE 77 FF 33 FF FF FF FF FF    w.......w.3.....
0013E0:  FF 88 11 FF FF FF FF 88 11 FF FF FF FF 99 FF CC    ................
0013F0:  FF EE 77 FF 33 EE 77 CC FF 99 FF FF FF CC 33 99    ..w.3.w.......3.
001400:  99 FF 99 FF 33 EE 77 FF FF EE 77 FF FF 88 33 33    ....3.w...w...33
001410:  99 22 11 22 11 22 11 33 FF 88 33 FF FF EE 77 CC    .".".".3..3...w.
001420:  33 99 99 99 99 88 11 99 99 99 99 FF FF 00 33 99    3.............3.
001430:  99 99 99 88 33 99 99 99 99 00 33 FF FF CC 33 99    ....3.....3...3.
001440:  99 33 FF 33 FF 33 FF 99 99 CC 33 FF FF 00 77 99    .3.3.3....3...w.
001450:  33 99 99 99 99 99 99 99 33 00 77 FF FF 00 11 99    3.......3.w.....
001460:  DD 99 77 88 77 99 77 99 DD 00 11 FF FF 00 11 99    ..w.w.w.........
001470:  DD 99 77 88 77 99 77 B6 D0 99 FF 00 FF FF FF CC    ..w.w.w.........
001480:  33 99 99 33 FF 33 FF 33 11 33 99 88 11 FF FF 99    3..3.3.3.3......
001490:  99 99 99 99 99 88 11 99 99 99 99 99 99 FF FF 88    ................
0014A0:  11 EE 77 EE 77 EE 77 EE 77 EE 77 88 11 FF FF EE    ..w.w.w.w.w.....
0014B0:  11 FF 33 FF 33 FF 33 33 33 33 33 88 77 FF FF 11    ..3.3.33333.w...
0014C0:  99 99 99 99 33 88 77 99 33 99 99 11 99 FF FF 00    ....3.w.3.......
0014D0:  FF 99 FF 99 FF 99 FF 99 DD 99 99 00 11 FF FF 33    ...............3
0014E0:  99 11 11 00 11 00 11 22 99 33 99 33 99 FF FF 33    .......".3.3...3
0014F0:  99 11 99 00 99 22 11 33 11 33 99 33 99 FF FF CC    .....".3.3.3....
001500:  77 99 33 33 99 33 99 33 99 99 33 CC 77 FF FF 00    w.33.3.3..3.w...
001510:  33 99 99 99 99 88 77 99 FF 99 FF 00 FF FF FF CC    3.....w.........
001520:  77 99 33 33 99 33 99 22 55 33 33 88 99 FF FF 00    w.33.3."U33.....
001530:  33 99 99 99 99 88 33 99 33 99 99 11 99 FF FF CC    3.....3.3.......
001540:  33 99 99 99 FF CC 33 FF 99 99 99 CC 33 FF FF 88    3.....3.....3...
001550:  11 AA 55 EE 77 EE 77 EE 77 EE 77 CC 33 FF FF 99    ..U.w.w.w.w.3...
001560:  99 99 99 99 99 99 99 99 99 99 99 CC 33 FF FF 99    ............3...
001570:  99 99 99 99 99 99 99 99 99 C7 20 CC 33 EE 77 FF    .......... .3.w.
001580:  FF 33 99 33 99 33 99 22 99 00 11 11 11 33 99 FF    .3.3.3.".....3..
001590:  FF 33 99 99 33 CC 77 CC 77 99 33 33 99 33 99 FF    .3..3.w.w.33.3..
0015A0:  FF 99 99 99 99 99 99 CC 33 EE 77 EE 77 CC 33 FF    ........3.w.w.3.
0015B0:  FF 00 11 33 99 77 33 EE 77 CC DD 99 99 00 11 FF    ...3.w3.w.......
0015C0:  FF CC 33 CC FF CC FF CC FF CC FF CC FF CC 33 FF    ..3...........3.
0015D0:  FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0015E0:  00 CC 33 FF 33 FF 33 FF 33 FF 33 FF 33 CC 33 FF    ..3.3.3.3.3.3.3.
0015F0:  FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001600:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001610:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001620:  00 FF FF FF FF 88 77 FF 33 88 33 33 33 88 99 FF    ......w.3.333...
001630:  FF 11 FF 11 FF 88 33 99 99 99 99 99 99 44 33 FF    ......3......D3.
001640:  FF FF FF FF FF CC 33 99 99 99 FF 99 99 CC 33 FF    ......3.......3.
001650:  FF EE 33 FF 33 88 33 33 33 33 33 33 33 88 99 FF    ..3.3.3333333...
001660:  FF FF FF FF FF CC 33 99 99 88 11 99 FF CC 33 FF    ......3.......3.
001670:  FF EE 33 CC 99 CC FF 88 77 CC FF D4 C0 CC FF 88    ..3.....w.......
001680:  77 FF FF FF FF FF FF CC 11 99 99 99 99 CC 11 FF    w...............
001690:  99 88 33 11 FF 99 FF 99 33 88 99 99 99 99 99 11    ..3.....3.......
0016A0:  99 FF FF EE 77 FF FF CC 77 EE 77 EE 77 EE 77 CC    ....w...w.w.w.w.
0016B0:  33 FF FF FF DD FF FF FF 11 FF 99 FF 99 99 99 99    3...............
0016C0:  99 CC 33 11 FF 99 FF 99 99 99 33 88 77 99 33 11    ..3.......3.w.3.
0016D0:  99 FF FF CC 77 EE 77 EE 77 EE 77 EE 77 EE 77 CC    ....w.w.w.w.w.w.
0016E0:  33 FF FF FF FF FF FF 55 33 00 11 22 99 22 99 33    3......U3..".".3
0016F0:  99 FF FF FF FF FF FF 22 77 99 99 99 99 99 99 99    ......."w.......
001700:  99 FF FF FF FF FF FF CC 33 99 99 99 99 99 99 CC    ........3.......
001710:  33 FF FF FF FF FF FF 22 33 99 99 99 99 88 33 99    3......"3.....3.
001720:  FF 00 FF FF FF FF FF 88 99 33 33 33 33 88 33 FF    .........3333.3.
001730:  33 EE 11 FF FF FF FF 22 77 99 33 99 FF 99 FF 00    3......"w.3.....
001740:  FF FF FF FF FF FF FF CC 33 99 FF CC 33 FF 99 88    ........3...3...
001750:  33 FF FF CC FF CC FF 88 33 CC FF CC FF CC 99 EE    3.......3.......
001760:  33 FF FF FF FF FF FF 99 99 99 99 99 99 99 99 CC    3...............
001770:  11 FF FF FF FF FF FF 99 99 99 99 99 99 95 00 CC    ................
001780:  33 EE 77 FF FF FF FF FF FF 33 99 22 99 22 99 00    3.w......3."."..
001790:  11 99 33 FF FF FF FF FF FF 33 99 99 33 CC 77 99    ..3......3..3.w.
0017A0:  33 33 99 FF FF FF FF FF FF 99 99 99 99 99 99 CC    33..............
0017B0:  11 FF 99 88 33 FF FF 88 11 BB 33 EE 77 CC FF 88    ....3.....3.w...
0017C0:  11 FF FF FF FF 3E 0F 32 91 1A 21 CF 31 CB EE DD    .....>.2..!.1...
0017D0:  7E 03 FE 28 30 3D DD CB 00 56 20 7E FE 0E 20 17    ~..(0=...V ~.. .
0017E0:  CD D1 20 DD 7E 04 FE 02 28 06 21 7B 22 CD 0A 22    .. .~...(.!{".."
0017F0:  CD 08 21 CD E9 21 C9 FE 16 38 0B FE 1E 30 07 DD    ..!..!...8...0..
001800:  7E 05 FE 7F 28 0D CD 08 21 CD D1 20 CD 86 21 CD    ~...(...!.. ..!.
001810:  E9 21 C9 FE 3C 28 EF FE 54 28 28 FE 60 28 11 FE    .!..<(..T((.`(..
001820:  6A 28 0D CD D1 20 CD 08 21 CD 86 21 CD E9 21 C9    j(... ..!..!..!.
001830:  CD D1 20 CD 86 21 21 A6 22 CD 0A 22 CD 08 21 CD    .. ..!!.".."..!.
001840:  E9 21 C9 CD D1 20 CD 08 21 1D 1D 1D CD E9 21 C9    .!... ..!.....!.
001850:  DD 7E 03 21 A9 22 CD 02 22 C9 DD 7E 03 FE 0E 30    .~.!.".."..~...0
001860:  10 CD 08 21 21 1B 23 DD 7E 03 CD 02 22 CD E9 21    ...!!.#.~..."..!
001870:  C9 21 1B 23 CD 02 22 CD 08 21 DD 7E 05 21 2F 7F    .!.#.."..!.~.!/.
001880:  F8 23 CD 02 22 CD E9 21 C9 DD 7E 04 FE 7F C8 FE    .#.."..!..~.....
001890:  1A 28 5E FE 76 28 3B FE 72 28 3D FE 74 28 39 FE    .(^.v(;.r(=.t(9.
0018A0:  0C 28 0C FE 02 CA D0 21 21 2F 23 CD 02 22 C9 DD    .(.....!!/#.."..
0018B0:  7E 03 FE 16 28 0F FE 1A 28 0B FE 1C 28 07 FE 22    ~...(...(...(.."
0018C0:  DD 7E 04 20 E3 21 F1 23 CD 0A 22 C9 C9 CD 0A 22    .~. .!.#.."...."
0018D0:  18 06 21 8B 22 CD 0A 22 7B FE 22 38 0A 3E 20 CD    ..!.".."{."8.> .
0018E0:  45 1A 7B FE 00 20 F6 DD 6E 01 DD 66 02 CD 0A 22    E.{.. ..n..f..."
0018F0:  C9 21 8B 22 CD 0A 22 DD E5 E1 01 06 00 09 CD 67    .!.".."........g
001900:  22 3E 20 CD 45 1A C9 DD 7E 05 FE 7F C8 FE 18 28    "> .E...~......(
001910:  38 FE 02 28 3C FE 74 28 BF FE 72 28 BB FE 48 28    8..(<.t(..r(..H(
001920:  19 FE 4A 28 15 FE 32 28 11 21 7F 22 CD 0A 22 DD    ..J(..2(.!."..".
001930:  7E 05 FE 1A 28 BB FE 76 28 98 21 2F 23 CD 02 22    ~...(..v(.!/#.."
001940:  C9 21 9B 22 CD 0A 22 18 8F 21 9B 22 CD 0A 22 18    .!.".."..!."..".
001950:  A6 21 9B 22 CD 0A 22 DD 7E 00 E6 03 01 06 00 28    .!."..".~......(
001960:  01 0C DD E5 E1 09 CD 5B 22 C9 3E 2E CD 45 1A CD    .......[".>..E..
001970:  F7 21 7A FE 14 38 F8 C9 3E 20 CD 45 1A 7B FE 00    .!z..8..> .E.{..
001980:  20 2C 02 F6 C9 4F 06 00 09 4E 23 66 69 3A CF 31     ,...O...N#fi:.1
001990:  CB 6F 28 13 E6 DF 32 CF 31 7E E6 DF 18 0A CD 45    .o(...2.1~.....E
0019A0:  1A 23 7B FE 00 28 0B 7E CB 7F 28 F2 E6 7F CD 45    .#{..(.~..(....E
0019B0:  1A C9 7E CB 7F 20 07 FE 20 20 08 23 18 E9 E6 7F    ..~.. ..  .#....
0019C0:  FE 20 C8 3E 20 1E 28 15 2B 1D 7E E6 7F FE 20 20    . .> .(.+.~...  
0019D0:  F7 23 3E 20 CD 45 1A 7B FE 00 20 F6 18 C9 7B FE    .#> .E.{.. ...{.
0019E0:  26 38 03 CD F7 21 CD 1D 33 C9 7B FE 24 38 03 CD    &8...!..3.{.$8..
0019F0:  F7 21 CD 31 33 C9 61 64 64 72 65 73 73 A0 74 68    .!.13.address.th
001A00:  65 20 63 6F 6E 74 65 6E 74 73 20 6F 66 A0 6D 65    e contents of.me
001A10:  6D 6F 72 79 20 6C 6F 63 61 74 69 6F 6E A0 74 68    mory location.th
001A20:  65 20 6E 75 6D 62 65 72 A0 74 6F A0 46 29 86 29    e number.to.F).)
001A30:  D0 29 10 2A 72 26 81 26 91 26 AB 26 D2 26 EE 26    .).*r&.&.&.&.&.&
001A40:  02 27 57 2A 70 2A B4 2A DE 2A EE 2A 2D 2B 5F 2B    .'W*p*.*.*.*-+_+
001A50:  16 27 43 27 87 2B C6 2B F6 2B 35 2C 5F 2C 8C 2C    .'C'.+.+.+5,_,.,
001A60:  70 27 A9 2C 93 27 B7 27 F7 27 09 28 32 28 63 28    p'.,.'.'.'.(2(c(
001A70:  DA 2C 0C 2D 2E 2D 62 2D 88 28 A3 28 85 2D C9 2D    .,.-.-b-.(£(.-.-
001A80:  0E 2E 27 F7 12 2E 3A 2E 80 2E B8 2E FE 2E 36 2F    ..'...:.......6/
001A90:  46 2F 7D 2F C3 2F FA 2F 3F 30 46 30 76 30 ED 28    F/}/././?0F0v0.(
001AA0:  A5 30 CF 30 EA 30 16 31 32 31 64 31 98 31 2B 29    .0.0.0.121d1.1+)
001AB0:  34 29 3C 29 9E 23 AA 23 B5 23 C1 23 CF 23 DB 23    4)<).#.#.#.#.#.#
001AC0:  E6 23 07 24 12 24 1D 24 28 24 33 24 AA 23 CC 31    .#.$.$.$($3$.#.1
001AD0:  3F 24 54 24 60 24 79 24 93 24 9F 24 AB 24 C0 24    ?$T$`$y$.$.$.$.$
001AE0:  D5 24 E3 24 F1 24 FE 24 17 25 25 25 45 25 53 25    .$.$.$.$.%%%E%S%
001AF0:  61 25 67 25 84 25 9C 25 B0 25 CA 25 DB 25 F5 25    a%g%.%.%.%.%.%.%
001B00:  0C 26 1A 26 1F 26 24 26 29 26 2E 26 33 26 38 26    .&.&.&$&)&.&3&8&
001B10:  3D 26 42 26 48 26 4E 26 54 26 5A 26 60 26 66 26    =&B&H&N&T&Z&`&f&
001B20:  6C 26 A0 61 63 63 75 6D 75 6C 61 74 6F 72 A0 74    l&.accumulator.t
001B30:  68 65 20 6E 75 6D 62 65 72 A0 48 4C 20 72 65 67    he number.HL reg
001B40:  69 73 74 65 72 A0 6C 6F 63 61 74 69 6F 6E 20 28    ister.location (
001B50:  48 4C 29 A0 44 45 20 72 65 67 69 73 74 65 72 A0    HL).DE register.
001B60:  42 20 72 65 67 69 73 74 65 72 A0 43 20 72 65 67    B register.C reg
001B70:  69 73 74 65 72 A0 69 66 20 43 61 72 72 79 20 66    ister.if Carry f
001B80:  6C 61 67 20 69 47 85 73 20 73 65 74 2C A0 44 20    lag iG.s set,.D 
001B90:  72 65 67 69 73 74 65 72 A0 45 20 72 65 67 69 73    register.E regis
001BA0:  74 65 72 A0 48 20 72 65 67 69 73 74 65 72 A0 4C    ter.H register.L
001BB0:  20 72 65 67 69 73 74 65 72 A0 42 43 20 72 65 67     register.BC reg
001BC0:  69 73 74 65 72 A0 69 66 20 5A 65 72 6F 20 66 6C    ister.if Zero fl
001BD0:  61 67 20 69 73 20 73 65 74 2C A0 4E 4F 54 20 44    ag is set,.NOT D
001BE0:  45 46 49 4E 45 44 A0 69 66 20 5A 65 72 6F 20 66    EFINED.if Zero f
001BF0:  6C 61 67 20 69 73 20 6E 6F 74 20 73 65 74 2C A0    lag is not set,.
001C00:  69 66 20 43 61 72 72 79 20 66 6C 61 67 20 69 73    if Carry flag is
001C10:  20 6E 6F 74 20 73 65 74 2C A0 49 58 20 72 65 67     not set,.IX reg
001C20:  69 73 74 65 72 A0 49 59 20 72 65 67 69 73 74 65    ister.IY registe
001C30:  72 A0 6C 6F 63 61 74 69 6F 6E 20 28 49 58 2B 6F    r.location (IX+o
001C40:  66 66 73 65 74 29 A0 6C 6F 63 61 74 69 6F 6E 20    ffset).location 
001C50:  28 49 59 2B 6F 66 66 73 65 74 29 A0 6C 6F 63 61    (IY+offset).loca
001C60:  74 69 6F 6E 20 28 42 43 29 A0 6C 6F 63 61 74 69    tion (BC).locati
001C70:  6F 6E 20 28 44 45 29 A0 41 46 20 72 65 67 69 73    on (DE).AF regis
001C80:  74 65 72 73 A0 61 6C D8 F8 74 65 72 6E 61 74 69    ters.al..ternati
001C90:  76 65 20 41 46 20 72 65 67 69 73 74 65 72 73 A0    ve AF registers.
001CA0:  53 74 61 63 6B 20 50 6F 69 6E 74 65 72 A0 69 66    Stack Pointer.if
001CB0:  20 53 69 67 6E 20 66 6C 61 67 20 69 73 20 30 2C     Sign flag is 0,
001CC0:  20 69 65 20 50 6F 73 69 74 69 76 65 2C A0 6C 6F     ie Positive,.lo
001CD0:  63 61 74 69 6F 6E 20 28 49 58 29 A0 6C 6F 63 61    cation (IX).loca
001CE0:  74 69 6F 6E 20 28 49 59 29 A0 73 74 61 63 6B A0    tion (IY).stack.
001CF0:  69 66 20 53 69 67 6E 20 66 6C 61 67 20 69 73 20    if Sign flag is 
001D00:  31 2C 20 69 65 20 4D 69 6E 75 73 2C A0 69 66 20    1, ie Minus,.if 
001D10:  50 2F 56 20 66 6C 61 67 20 69 73 20 6E 4F 74 20    P/V flag is nOt 
001D20:  73 65 74 2C A0 69 66 20 50 2F 56 20 66 6C 61 67    set,.if P/V flag
001D30:  20 69 73 20 73 45 74 2C A0 49 6E 74 65 72 72 75     is sEt,.Interru
001D40:  70 74 20 76 65 63 74 6F 72 20 72 65 67 69 73 74    pt vector regist
001D50:  65 72 A0 52 65 66 72 65 73 68 20 72 65 67 69 73    er.Refresh regis
001D60:  74 65 72 A0 70 6F 72 74 20 77 68 6F 73 65 20 6E    ter.port whose n
001D70:  75 6D 62 65 72 20 69 73 20 69 6E 20 43 A0 70 6F    umber is in C.po
001D80:  72 74 20 77 69 74 68 20 61 BA 13 62 6F 76 65 20    rt with a..bove 
001D90:  6E 75 6D 62 65 72 A0 46 6C 61 67 20 72 65 67 69    number.Flag regi
001DA0:  73 74 65 72 A0 30 20 6F 66 A0 31 20 6F 66 A0 32    ster.0 of.1 of.2
001DB0:  20 6F 66 A0 33 20 6F 66 A0 34 20 6F 66 A0 35 20     of.3 of.4 of.5 
001DC0:  6F 66 A0 36 20 6F 66 A0 37 20 6F 66 A0 30 30 30    of.6 of.7 of.000
001DD0:  30 48 A0 30 30 30 38 48 A0 30 30 31 30 48 A0 30    0H.0008H.0010H.0
001DE0:  30 31 38 48 A0 30 30 32 30 48 A0 30 30 32 38 48    018H.0020H.0028H
001DF0:  A0 30 30 33 30 48 A0 30 30 33 38 48 A0 69 73 20    .0030H.0038H.is 
001E00:  6C 6F 61 64 65 64 20 77 69 74 68 A0 68 61 73 20    loaded with.has 
001E10:  61 64 64 65 64 20 74 6F 20 69 74 A0 68 61 73 20    added to it.has 
001E20:  61 64 64 65 64 20 74 6F 20 69 74 20 63 61 72 72    added to it carr
001E30:  79 20 61 6E 64 A0 54 68 65 20 41 63 63 75 6D 75    y and.The Accumu
001E40:  6C 61 74 6F 72 20 68 61 73 20 73 75 62 74 72 61    lator has subtra
001E50:  63 74 65 64 20 66 72 6F 6D 20 69 74 A0 68 61 73    cted from it.has
001E60:  20 74 61 6B 65 6E 20 66 72 6F 6D 20 69 74 20 63     taken from it c
001E70:  61 72 72 79 20 61 6E 64 A0 69 73 20 49 4E 43 72    arry and.is INCr
001E80:  65 6D 65 6E 74 65 64 20 62 79 20 8A AC 31 A0 69    emented by ..1.i
001E90:  73 20 44 45 43 72 65 6D 65 6E 74 65 64 20 62 79    s DECremented by
001EA0:  20 31 A0 69 73 20 50 55 53 48 65 64 20 6F 6E 74     1.is PUSHed ont
001EB0:  6F 20 73 74 61 63 6B 20 61 6E 64 20 53 50 20 64    o stack and SP d
001EC0:  65 63 72 65 6D 65 6E 74 65 64 20 62 79 20 32 A0    ecremented by 2.
001ED0:  69 73 20 50 4F 50 70 65 64 20 66 72 6F 6D 20 73    is POPped from s
001EE0:  74 61 63 6B 20 61 6E 64 20 53 50 20 69 6E 63 72    tack and SP incr
001EF0:  65 6D 65 6E 74 65 64 20 62 79 20 32 A0 41 63 63    emented by 2.Acc
001F00:  75 6D 75 6C 61 74 6F 72 20 69 73 20 6C 6F 67 69    umulator is logi
001F10:  63 61 6C 6C 79 20 4F 52 65 64 20 77 69 74 68 A0    cally ORed with.
001F20:  41 63 63 75 6D 75 6C 61 74 6F 72 20 69 73 20 6C    Accumulator is l
001F30:  6F 67 69 63 61 6C 6C 79 20 41 4E 44 65 64 20 77    ogically ANDed w
001F40:  69 74 68 A0 42 43 2C 20 44 45 2C 20 48 4C 20 72    ith.BC, DE, HL r
001F50:  65 67 69 73 74 65 72 73 20 61 72 65 20 61 6C 6C    egisters are all
001F60:  20 45 58 63 68 61 6E 67 65 64 20 77 69 74 68 20     EXchanged with 
001F70:  74 68 65 20 61 6C 74 65 72 6E 61 74 69 76 65 20    the alternative 
001F80:  73 65 74 A0 69 73 20 45 58 63 68 61 6E 7B 71 67    set.is EXchan{qg
001F90:  65 64 20 77 69 74 68 A0 41 63 63 75 6D 75 6C 61    ed with.Accumula
001FA0:  74 6F 72 20 69 73 20 4E 45 47 61 74 65 64 2C 20    tor is NEGated, 
001FB0:  69 65 20 6D 61 64 65 20 6E 65 67 61 74 69 76 65    ie made negative
001FC0:  A0 63 61 72 72 79 20 66 6C 61 67 20 69 73 20 69    .carry flag is i
001FD0:  6E 76 65 72 74 65 64 2C 20 69 65 20 43 6F 6D 70    nverted, ie Comp
001FE0:  6C 69 6D 65 6E 74 20 43 61 72 72 79 20 46 6C 61    liment Carry Fla
001FF0:  67 A0 63 61 72 72 79 20 66 6C 61 67 20 69 73 20    g.carry flag is 
002000:  73 65 74 2C 20 69 65 20 53 65 74 20 43 61 72 72    set, ie Set Carr
002010:  79 20 46 6C 61 67 A0 64 65 63 69 6D 61 6C 20 41    y Flag.decimal A
002020:  64 6A 75 73 74 20 41 63 63 75 6D 75 6C 61 74 6F    djust Accumulato
002030:  72 A0 4E 6F 20 4F 50 65 72 61 74 69 6F 6E 20 69    r.No OPeration i
002040:  73 20 70 65 72 66 6F 72 6D 65 64 2C 20 69 6E 73    s performed, ins
002050:  70 69 74 65 20 6F 66 20 74 68 69 73 20 69 74 20    pite of this it 
002060:  74 61 6B 65 73 20 2E 30 30 30 30 30 31 20 73 65    takes .000001 se
002070:  63 73 20 74 6F 20 64 6F 20 69 74 A0 63 6F 6D 70    cs to do it.comp
002080:  75 74 65 72 20 69 73 20 48 41 4C 54 65 64 20 3C    uter is HALTed <
002090:  15 75 6E 74 69 6C 20 61 6E 20 69 6E 74 65 72 72    .until an interr
0020A0:  75 70 74 20 63 6F 6D 65 73 20 74 6F 20 61 77 61    upt comes to awa
0020B0:  6B 65 20 69 74 20 61 67 61 69 6E A0 74 65 73 74    ke it again.test
0020C0:  20 42 49 54 A0 53 45 54 20 62 69 74 A0 52 45 53     BIT.SET bit.RES
0020D0:  65 74 20 62 69 74 A0 62 6C 6F 63 6B 20 74 72 61    et bit.block tra
0020E0:  6E 73 66 65 72 20 28 42 43 29 20 62 79 74 65 73    nsfer (BC) bytes
0020F0:  20 73 74 61 72 74 69 6E 67 20 61 74 20 28 48 4C     starting at (HL
002100:  29 20 74 6F 20 28 44 45 29 20 69 6E 63 72 65 6D    ) to (DE) increm
002110:  65 6E 74 69 6E 67 A0 74 72 61 6E 73 66 65 72 20    enting.transfer 
002120:  28 48 4C 29 20 74 6F 20 28 44 45 29 2C 20 69 6E    (HL) to (DE), in
002130:  63 72 65 6D 65 6E 74 20 48 4C 20 61 6E 64 20 44    crement HL and D
002140:  45 2C 20 64 65 63 20 42 43 2C 20 72 65 73 65 74    E, dec BC, reset
002150:  20 50 56 20 66 6C 61 67 20 69 66 20 42 43 3D 30     PV flag if BC=0
002160:  A0 62 6C 6F 63 6B 20 74 72 61 6E 73 66 65 72 20    .block transfer 
002170:  28 42 43 29 20 62 79 74 65 73 20 73 74 61 72 74    (BC) bytes start
002180:  69 6E 67 20 61 74 20 28 48 4C 29 20 74 6F 20 28    ing at (HL) to (
002190:  44 A0 82 45 29 20 64 65 63 72 65 6D 65 6E 74 69    D..E) decrementi
0021A0:  6E 67 A0 74 72 61 6E 73 66 65 72 20 28 48 4C 29    ng.transfer (HL)
0021B0:  20 74 6F 20 28 44 45 29 2C 20 64 65 63 72 65 6D     to (DE), decrem
0021C0:  65 6E 74 20 48 4C 2C 20 44 45 2C 20 61 6E 64 20    ent HL, DE, and 
0021D0:  42 43 2C 20 72 65 73 65 74 20 50 56 20 66 6C 61    BC, reset PV fla
0021E0:  67 20 69 66 20 42 43 3D 30 A0 70 65 72 66 6F 72    g if BC=0.perfor
0021F0:  6D 20 72 65 6C 61 74 69 76 65 20 6A 75 6D 70 20    m relative jump 
002200:  74 6F A0 64 65 63 72 65 6D 65 6E 74 20 42 2C 20    to.decrement B, 
002210:  69 66 20 7A 65 72 6F 20 63 6F 6E 74 69 6E 75 65    if zero continue
002220:  2C 20 69 66 20 4E 6F 74 20 5A 65 72 6F 20 70 65    , if Not Zero pe
002230:  72 66 6F 72 6D 20 72 65 6C 61 74 69 76 65 20 6A    rform relative j
002240:  75 6D 70 20 74 6F A0 70 75 73 68 20 74 68 65 20    ump to.push the 
002250:  72 65 74 75 72 6E 20 61 64 64 72 65 73 73 20 74    return address t
002260:  6F 20 73 74 61 63 6B 20 61 6E 64 20 43 41 4C 4C    o stack and CALL
002270:  A0 70 65 72 66 6F 72 6D 20 6A 75 6D 70 20 74 6F    .perform jump to
002280:  A0 52 45 54 75 72 6E 20 66 72 6F 6D 20 4E 6F 6E    .RETurn from Non
002290:  2D 6D 61 44 52 73 6B 61 62 6C 65 20 69 6E 74 65    -maDRskable inte
0022A0:  72 72 75 70 74 3A 20 4E 4F 54 20 50 45 52 46 4F    rrupt: NOT PERFO
0022B0:  52 4D 45 44 20 42 59 20 53 49 4D 55 4C 41 54 4F    RMED BY SIMULATO
0022C0:  52 A0 52 45 54 75 72 6E 20 66 72 6F 6D 20 49 6E    R.RETurn from In
0022D0:  74 65 72 72 75 70 74 3A 20 4E 4F 54 20 50 45 52    terrupt: NOT PER
0022E0:  46 4F 52 4D 45 44 20 42 59 20 53 49 4D 55 4C 41    FORMED BY SIMULA
0022F0:  54 4F 52 A0 52 45 54 75 72 6E 20 61 64 64 72 65    TOR.RETurn addre
002300:  73 73 20 69 73 20 50 4F 50 70 65 64 20 66 72 6F    ss is POPped fro
002310:  6D 20 74 68 65 20 73 74 61 63 6B A0 73 65 61 72    m the stack.sear
002320:  63 68 20 66 72 6F 6D 20 28 48 4C 29 20 49 6E 63    ch from (HL) Inc
002330:  72 65 6D 65 6E 74 69 6E 67 20 42 43 20 62 79 74    rementing BC byt
002340:  65 73 20 66 6F 72 20 64 61 74 61 20 69 6E 20 41    es for data in A
002350:  63 63 75 6D 75 6C 61 74 6F 72 A0 63 6F 6D 70 61    ccumulator.compa
002360:  72 65 20 28 48 4C 29 20 77 69 74 68 20 41 2C 20    re (HL) with A, 
002370:  69 6E 63 72 65 6D 65 6E 74 20 48 4C 2C 20 64 65    increment HL, de
002380:  63 72 65 6D 65 6E 74 20 42 43 A0 73 65 61 72 63    crement BC.searc
002390:  68 20 66 72 6F E0 6F 6D 20 28 48 4C 29 20 44 65    h fro.om (HL) De
0023A0:  63 72 65 6D 65 6E 74 69 6E 67 20 42 43 20 62 79    crementing BC by
0023B0:  74 65 73 20 66 6F 72 20 64 61 74 61 20 69 6E 20    tes for data in 
0023C0:  41 63 63 75 6D 75 6C 61 74 6F 72 A0 63 6F 6D 70    Accumulator.comp
0023D0:  61 72 65 20 28 48 4C 29 20 77 69 74 68 20 41 2C    are (HL) with A,
0023E0:  20 64 65 63 72 65 6D 65 6E 74 20 48 4C 2C 20 61     decrement HL, a
0023F0:  6E 64 20 42 43 A0 69 6E 76 65 72 74 20 61 6C 6C    nd BC.invert all
002400:  20 62 69 74 73 20 69 6E 20 41 20 72 65 67 69 73     bits in A regis
002410:  74 65 72 2C 20 69 65 20 43 6F 6D 50 4C 69 6D 65    ter, ie ComPLime
002420:  6E 74 A0 61 63 63 75 6D 75 6C 61 74 6F 72 20 69    nt.accumulator i
002430:  73 20 43 6F 6D 50 61 72 65 64 20 77 69 74 68 A0    s ComPared with.
002440:  63 6F 6E 74 65 6E 74 73 20 6F 66 20 41 63 63 75    contents of Accu
002450:  6D 75 6C 61 74 6F 72 20 69 73 20 65 58 63 6C 75    mulator is eXclu
002460:  73 69 76 65 6C 79 20 4F 52 65 64 20 77 69 74 68    sively ORed with
002470:  A0 72 6F 74 61 74 65 20 41 63 63 75 6D 75 6C 61    .rotate Accumula
002480:  74 6F 72 20 4C 65 66 74 20 73 68 69 66 74 69 6E    tor Left shiftin
002490:  67 20 62 69 74 20 37 1E FB 20 69 6E 74 6F 20 43    g bit 7.. into C
0024A0:  61 72 72 79 A0 72 6F 74 61 74 65 20 41 63 63 75    arry.rotate Accu
0024B0:  6D 75 6C 61 74 6F 72 20 61 6E 64 20 63 61 72 72    mulator and carr
0024C0:  79 20 4C 65 66 74 A0 72 6F 74 61 74 65 20 41 63    y Left.rotate Ac
0024D0:  63 75 6D 75 6C 61 74 6F 72 20 52 69 67 68 74 2C    cumulator Right,
0024E0:  20 73 68 69 66 74 69 6E 67 20 62 69 74 20 30 20     shifting bit 0 
0024F0:  69 6E 74 6F 20 43 61 72 72 79 A0 72 6F 74 61 74    into Carry.rotat
002500:  65 20 61 63 63 75 6D 75 6C 61 74 6F 72 20 61 6E    e accumulator an
002510:  64 20 63 61 72 72 79 20 52 69 67 68 74 A0 72 6F    d carry Right.ro
002520:  74 61 74 65 20 4C 65 66 74 20 44 65 63 69 6D 61    tate Left Decima
002530:  6C 20 63 6F 6E 74 65 6E 74 73 20 6F 66 20 28 48    l contents of (H
002540:  4C 29 20 77 69 74 68 20 6C 6F 77 20 6E 69 62 62    L) with low nibb
002550:  6C 65 20 6F 66 20 41 63 63 75 6D 75 6C 61 74 6F    le of Accumulato
002560:  72 A0 72 6F 74 61 74 65 20 52 69 67 68 74 20 44    r.rotate Right D
002570:  65 63 69 6D 61 6C 20 63 6F 6E 74 65 6E 74 73 20    ecimal contents 
002580:  6F 66 20 28 48 4C 29 20 77 69 74 68 20 6C 6F 77    of (HL) with low
002590:  20 6E 69 62 62 6C 65 20 6F 4C 93 66 20 41 63 63     nibble oL.f Acc
0025A0:  75 6D 75 6C 61 74 6F 72 A0 63 68 61 6E 67 65 20    umulator.change 
0025B0:  49 6E 74 65 72 72 75 70 74 20 4D 6F 64 65 20 74    Interrupt Mode t
0025C0:  6F A0 72 65 53 54 61 72 74 20 61 74 20 61 64 64    o.reSTart at add
0025D0:  72 65 73 73 A0 69 4E 70 75 74 20 66 72 6F 6D 20    ress.iNput from 
0025E0:  70 6F 72 74 20 28 43 29 2C 20 69 6E 74 6F 20 62    port (C), into b
0025F0:  6C 6F 63 6B 20 66 72 6F 6D 20 28 48 4C 29 20 49    lock from (HL) I
002600:  6E 63 72 65 6D 65 6E 74 69 6E 67 20 48 4C 20 66    ncrementing HL f
002610:  6F 72 20 42 20 62 79 74 65 73 A0 69 4E 70 75 74    or B bytes.iNput
002620:  20 69 6E 74 6F 20 28 48 4C 29 20 66 72 6F 6D 20     into (HL) from 
002630:  70 6F 72 74 20 28 43 29 20 69 6E 63 72 65 6D 65    port (C) increme
002640:  6E 74 20 48 4C 2C 20 64 65 63 72 65 6D 65 6E 74    nt HL, decrement
002650:  20 42 A0 69 4E 70 75 74 20 66 72 6F 6D 20 70 6F     B.iNput from po
002660:  72 74 20 28 43 29 2C 20 69 6E 74 6F 20 62 6C 6F    rt (C), into blo
002670:  63 6B 20 66 72 6F 6D 20 28 48 4C 29 20 44 65 63    ck from (HL) Dec
002680:  72 65 6D 65 6E 74 69 6E 67 20 48 4C 20 66 6F 72    rementing HL for
002690:  20 42 20 62 79 74 65 73 A0 69 4E 03 25 70 75 74     B bytes.iN.%put
0026A0:  20 69 6E 74 6F 20 28 48 4C 29 20 66 72 6F 6D 20     into (HL) from 
0026B0:  70 6F 72 74 20 28 43 29 20 44 65 63 72 65 6D 65    port (C) Decreme
0026C0:  6E 74 20 48 4C 2C 20 64 65 63 72 65 6D 65 6E 74    nt HL, decrement
0026D0:  20 42 A0 69 6E 70 75 74 20 64 61 74 61 20 66 72     B.input data fr
0026E0:  6F 6D A0 6F 75 74 70 75 74 20 66 72 6F 6D 20 28    om.output from (
0026F0:  48 4C 29 20 74 6F 20 70 6F 72 74 20 28 43 29 20    HL) to port (C) 
002700:  69 6E 63 72 65 6D 65 6E 74 20 48 4C 2C 20 64 65    increment HL, de
002710:  63 72 65 6D 65 6E 74 20 42 A0 6F 75 54 70 75 74    crement B.ouTput
002720:  20 66 72 6F 6D 20 28 48 4C 29 20 74 6F 20 70 6F     from (HL) to po
002730:  72 74 20 28 43 29 20 62 6C 6F 63 6B 20 66 72 6F    rt (C) block fro
002740:  6D 20 28 48 4C 29 20 49 6E 63 72 65 6D 65 6E 74    m (HL) Increment
002750:  69 6E 67 20 66 6F 72 20 42 20 62 79 74 65 73 A0    ing for B bytes.
002760:  6F 55 54 70 75 74 20 66 72 6F 6D 20 28 48 4C 29    oUTput from (HL)
002770:  20 74 6F 20 70 6F 72 74 20 28 43 29 20 44 65 63     to port (C) Dec
002780:  72 65 6D 65 6E 74 20 48 4C 2C 20 64 65 63 72 65    rement HL, decre
002790:  6D 65 6E 74 20 42 A0 6F 75 54 70 75 74 B5 33 20    ment B.ouTput.3 
0027A0:  74 6F 20 70 6F 72 74 20 28 43 29 2C 20 66 72 6F    to port (C), fro
0027B0:  6D 20 62 6C 6F 63 6B 20 66 72 6F 6D 20 28 48 4C    m block from (HL
0027C0:  29 20 44 65 63 72 65 6D 65 6E 74 69 6E 67 20 48    ) Decrementing H
0027D0:  4C 20 66 6F 72 20 42 20 62 79 74 65 73 A0 6F 55    L for B bytes.oU
0027E0:  54 70 75 74 A0 64 69 73 61 62 6C 65 20 49 6E 74    Tput.disable Int
0027F0:  65 72 72 75 70 74 73 2E 20 4E 4F 54 20 50 45 52    errupts. NOT PER
002800:  46 4F 52 4D 45 44 20 42 59 20 53 49 4D 55 4C 41    FORMED BY SIMULA
002810:  54 4F 52 2E A0 65 6E 61 62 6C 65 20 49 6E 74 65    TOR..enable Inte
002820:  72 72 75 70 74 73 2E 20 4E 4F 54 20 50 45 52 46    rrupts. NOT PERF
002830:  4F 52 4D 45 44 20 42 59 20 53 49 4D 55 4C 41 54    ORMED BY SIMULAT
002840:  4F 52 2E A0 69 73 20 52 6F 74 61 74 65 64 20 4C    OR..is Rotated L
002850:  65 66 74 20 73 68 69 66 74 69 6E 67 20 62 69 74    eft shifting bit
002860:  20 37 20 69 6E 74 6F 20 43 61 72 72 79 A0 61 6E     7 into Carry.an
002870:  64 20 43 61 72 72 79 20 61 72 65 20 72 6F 74 61    d Carry are rota
002880:  74 65 64 20 4C 65 66 74 A0 69 73 20 52 6F 74 61    ted Left.is Rota
002890:  74 65 64 20 52 69 67 68 74 2C 20 73 68 69 66 C3    ted Right, shif.
0028A0:  F4 74 69 6E 67 20 62 69 74 20 30 20 69 6E 74 6F    .ting bit 0 into
0028B0:  20 43 61 72 72 79 A0 61 6E 64 20 43 61 72 72 79     Carry.and Carry
0028C0:  20 61 72 65 20 52 6F 74 61 74 65 64 20 52 69 67     are Rotated Rig
0028D0:  68 74 A0 69 73 20 53 68 69 66 74 65 64 20 4C 65    ht.is Shifted Le
0028E0:  66 74 20 41 72 69 74 68 6D 65 74 69 63 61 6C 6C    ft Arithmeticall
0028F0:  79 2C 20 30 20 65 6E 74 65 72 73 20 61 74 20 62    y, 0 enters at b
002900:  69 74 20 30 A0 69 73 20 53 68 69 66 74 65 64 20    it 0.is Shifted 
002910:  52 69 67 68 74 20 41 72 69 74 68 6D 65 74 69 63    Right Arithmetic
002920:  61 6C 6C 79 2C 20 73 69 67 6E 20 62 69 74 20 75    ally, sign bit u
002930:  6E 63 68 61 6E 67 65 64 A0 69 73 20 53 68 69 66    nchanged.is Shif
002940:  74 65 64 20 52 69 67 68 74 20 4C 6F 67 69 63 61    ted Right Logica
002950:  6C 6C 79 2C 20 30 20 69 73 20 73 68 69 66 74 65    lly, 0 is shifte
002960:  64 20 69 6E 74 6F 20 62 69 74 20 37 A0 A0 00 58    d into bit 7...X
002970:  00 00 00 DD CB 00 7E C8 21 CF 31 CB 8E DD CB 00    ......~.!.1.....
002980:  76 28 2E DD 6E 08 DD 66 09 DD E5 01 08 00 DD 21    v(..n..f.......!
002990:  F3 3B 7D DD BE 06 20 15 7C DD BE 07 20 0F DD E5    .;}... .|... ...
0029A0:  E1 53 9D DD E1 CD F1 32 3E 20 CD 45 1A 18 0B DD    .S.....2> .E....
0029B0:  09 18 E1 3E 07 83 5F 30 01 14 21 F0 45 DD CB 00    ...>.._0..!.E...
0029C0:  56 28 03 21 68 46 22 4D 32 CD 4C 32 CD F1 32 3E    V(.!hF"M2.L2..2>
0029D0:  20 CD 45 1A DD 7E 04 FE 7F C8 CD 5C 32 DD 7E 05     .E..~.....\2.~.
0029E0:  FE 7F C8 3E 2C CD 45 1A DD 7E 05 CD 5C 32 C9 21    ...>,.E..~..\2.!
0029F0:  F0 45 7D DD 86 03 6F 30 01 24 7E 23 66 6F C9 FE    .E}...o0.$~#fo..
002A00:  28 20 15 CD E6 32 21 CF 31 CB CE 3E 06 CD DE 32    ( ...2!.1..>...2
002A10:  CD 1D 33 3E 29 C3 45 1A FE 2A 28 E7 FE 02 20 11    ..3>).E..*(... .
002A20:  3E 06 21 CF 31 CB 4E 28 02 3E 07 CD DE 32 C3 1D    >.!.1.N(.>...2..
002A30:  33 FE 18 20 08 3E 06 CD DE 32 C3 31 33 FE 1E 28    3.. .>...2.13..(
002A40:  F4 FE 4A 20 0C 3E 28 CD 45 1A 3E 06 CD DE 32 18    ..J .>(.E.>...2.
002A50:  BF FE 1A 20 0A 3E 28 CD 45 1A CD 92 32 18 B4 FE    ... .>(.E...2...
002A60:  72 28 04 FE 74 20 09 DD 6E 01 DD 66 02 C3 F1 32    r(..t ..n..f...2
002A70:  FE 76 20 15 3E 28 CD 45 1A CD C4 32 3E 29 C3 45    .v .>(.E...2>).E
002A80:  1A 2A EC 3B 85 6F D0 24 C9 21 0B 45 4F 06 00 09    .*.;.o.$.!.EO...
002A90:  4E 23 66 69 7E CB 7F 20 06 CD 45 1A 23 18 F5 E6    N#fi~.. ..E.#...
002AA0:  7F CD 45 13 06 1A C9 3E 00 CD 0D 33 CD 0D 33 ED    ..E....>...3..3.
002AB0:  6F C9 ED 6F F5 C6 30 FE 3A 38 02 C6 07 CD 45 1A    o..o..0.:8....E.
002AC0:  F1 C9 3A CF 31 CB 47 28 05 6E 26 00 18 1A CD 02    ..:.1.G(.n&.....
002AD0:  33 3E 48 C3 45 1A 3A CF 31 CB 47 20 07 23 CD 02    3>H.E.:.1.G .#..
002AE0:  33 2B 18 EA 7E 23 66 6F DD E5 C5 D5 11 00 00 7B    3+..~#fo.......{
002AF0:  01 00 10 DD 21 A9 33 29 30 12 7B DD 86 00 27 5F    ....!.3)0.{...'_
002B00:  7A DD 8E 01 27 57 79 DD 8E 02 27 4F DD 23 DD 23    z...'Wy...'O.#.#
002B10:  DD 23 10 E3 ED 53 A6 33 32 A8 33 21 A8 33 06 03    .#...S.32.3!.3..
002B20:  3E 00 D1 C5 ED 6F C4 9A 33 ED 6F C4 9A 33 2B C1    >....o..3.o..3+.
002B30:  10 F1 CB 7F 20 05 3E 30 CD 45 1A C1 DD E1 C9 CB    .... .>0.E......
002B40:  FF F5 E6 0F C6 30 CD 45 1A F1 C9 00 00 00 68 27    .....0.E......h'
002B50:  03 84 63 01 92 81 00 96 40 00 48 20 00 24 10 00    ..c.....@.H .$..
002B60:  12 05 00 56 02 00 28 01 00 64 00 00 32 00 00 16    ...V..(..d..2...
002B70:  00 00 08 00 00 04 00 00 02 00 00 01 00 00 45 52    ..............ER
002B80:  52 4F 52 A0 CD 64 39 21 1F 3B 36 00 21 F3 3B 22    ROR..d9!.;6.!.;"
002B90:  1B 3B 21 73 3C 22 1D 3B 06 10 DD 21 20 3B C5 CD    .;!s<".;...! ;..
002BA0:  21 34 C1 10 F9 63 44 CD E6 12 DD 21 20 3B 06 10    !4...cD....! ;..
002BB0:  C5 CD 57 35 C1 10 F9 DD 36 00 00 2A CD 31 DD 75    ..W5....6..*.1.u
002BC0:  08 DD 74 09 CD A0 41 C9 DD 36 00 00 ED 5B EE 3B    ..t...A..6...[.;
002BD0:  1A FE 20 28 0E CD 3B 39 1A FE 20 21 9D 3A CA 03    .. (..;9.. !.:..
002BE0:  37 18 06 21 07 00 19 EB 1A 2A CD 31 DD 75 08 DD    7..!.....*.1.u..
002BF0:  74 09 FE 20 CA 5D 35 D5 21 CD 31 ED 5B D0 31 CD    t.. .]5.!.1.[.1.
002C00:  31 33 D1 21 F0 45 22 2E 39 06 3C CD FB 38 38 0A    13.!.E".9.<..88.
002C10:  FE 20 28 1B 21 EB 39 C3 03 37 21 68 46 22 2E 39    . (.!.9..7!hF".9
002C20:  06 0A CD FB 38 21 F9 39 DA 03 37 DD CB 00 D6 DD    ....8!.9..7.....
002C30:  71 03 13 1A FE 20 28 28 CD 0B 36 32 F1 3B 3A F0    q.... ((..62.;:.
002C40:  3B DD 77 04 1A FE 20 28 1F FE 2C 21 08 3A C2 03    ;.w... (..,!.:..
002C50:  37 13 CD 0B 36 32 F2 3B 3A F0 3B DD 77 05 18 10    7...62.;:.;.w...
002C60:  3E 7F DD 77 04 32 F1 3B 3E 7F 32 F2 3B DD 77 05    >..w.2.;>.2.;.w.
002C70:  DD 4E 03 21 F0 45 DD CB 00 56 28 03 21 68 46 22    .N.!.E...V(.!hF"
002C80:  2E 39 CD 2D 39 01 05 00 09 3A F1 3B BE 28 34 23    .9.-9....:.;.(4#
002C90:  23 23 23 7E FE 80 C2 E2 34 21 F1 3B CD 04 35 21    ###~....4!.;..5!
002CA0:  F2 3B CD 04 35 21 1B 9C 63 3A C3 03 37 7E FE 02    .;..5!..c:..7~..
002CB0:  0E 18 28 05 FE 4A C0 0E 1A 71 DD CB 00 E6 DD 36    ..(..J...q.....6
002CC0:  07 00 E1 18 AD 23 3A F2 3B BE 20 C6 23 7E DD 77    .....#:.;. .#~.w
002CD0:  0A 0E 00 FE CB 28 01 0C 23 7E DD 77 0B FE 30 28    .....(..#~.w..0(
002CE0:  01 0C 79 DD 4E 00 06 05 CB 09 CE 00 10 FA 5F 16    ..y.N........._.
002CF0:  00 2A CD 31 19 ED 5B D0 31 DD CB 00 FE C3 D3 35    .*.1..[.1......5
002D00:  DD CB 00 7E 20 06 ED 5B D0 31 18 73 CD 7F 39 ED    ...~ ..[.1.s..9.
002D10:  5B D0 31 2A CD 31 1E 08 DD CB 00 46 28 07 3E DD    [.1*.1.....F(.>.
002D20:  CD 5E 39 18 0B DD CB 00 4E 28 05 3E FD CD 5E 39    .^9.....N(.>..^9
002D30:  DD CB 00 56 28 1A 3E CB CD 5E 39 DD 7E 00 E6 03    ...V(.>..^9.~...
002D40:  28 0E DD 7E 06 CD 5E 39 DD 7E 0A CD 5E 39 18 2C    (..~..^9.~..^9.,
002D50:  DD 7E 0A FE CB 28 3F CD 5E 39 DD 7E 0B FE 30 28    .~...(?.^9.~..0(
002D60:  03 CD 5E 39 DD CB 00 5E 28 06 DD 7E 06 CD 5E 39    ..^9...^(..~..^9
002D70:  DD CB 00 66 28 06 DD 7E 07 CD 5E 39 22 CD 31 14    ...f(..~..^9".1.
002D80:  1E 01 ED 53 D0 31 11 0C 00 DD 19 2A EE 3B 11 17    ...S.1.....*.;..
002D90:  00 19 22 EE 3B C9 DD 7E 06 77 DD CB 00 66 28 0E    ..".;..~.w...f(.
002DA0:  DD 7E 07 23 E5 77 2B CD 31 48 C8 33 E1 23 18 CE    .~.#.w+.1H.3.#..
002DB0:  E5 CD 1D 33 18 F6 21 0B 45 22 2E 39 01 4E 03 DD    ...3..!.E".9.N..
002DC0:  7E 03 FE 54 28 13 01 5E 08 FE 56 28 0C DD CB 00    ~..T(..^..V(....
002DD0:  56 01 00 2F 20 03 01 00 27 CD FD 38 30 45 DD CB    V../ ...'..80E..
002DE0:  00 46 20 1E DD CB 00 4E 20 18 CD 1C 37 3A 19 3B    .F ....N ...7:.;
002DF0:  DD 77 06 CB 68 28 06 3A 1A 3B DD 77 07 79 32 F0    .w..h(.:.;.w.y2.
002E00:  3B C9 3A F1 3B FE 06 20 E1 CD 1C 37 CB 68 21 7C    ;.:.;.. ...7.h!|
002E10:  3A C2 03 37 3A 19 3B DD 77 07 DD CB 00 E6 79 32    :..7:.;.w.....y2
002E20:  F0 3B C9 FE 20 28 13 FE 2C 28 0F 79 FE 28 28 42    .;.. (..,(.y.((B
002E30:  FE 2A 28 38 EB CD 0A 39 18 A2 79 FE 38 28 26 FE    .*(8...9..y.8(&.
002E40:  3A 28 1B FE 24 28 0D FE 26 C0 CD EC 36 3E 04 DD    :(..$(..&...6>..
002E50:  CB 00 CE C9 CD EC 36 3E 04 DD CB 00 C6 C9 CD E1    ......6>........
002E60:  36 3E 06 18 EA CD E1 36 3E 06 18 ED DD CB 00 CE    6>.....6>.......
002E70:  18 04 DD CB 00 C6 01 07 00 CD 20 37 CB 68 21 2D    .......... 7.h!-
002E80:  3A 20 2B 3A 19 3B DD 77 06 3E 06 C9 DD 7E 03 FE    : +:.;.w.>...~..
002E90:  1C C8 21 AE 3A 18 17 DD 7E 03 FE 10 21 3C 3A 28    ..!.:...~...!<:(
002EA0:  0D FE 0C 21 3C 3A 28 06 DD 7E 04 60 53 FE 08 C0    ...!<:(..~.`S...
002EB0:  ED 7B 0E 3B ED 5B D0 31 1E 00 CD F1 32 11 00 12    .{.;.[.1....2...
002EC0:  21 BD 3A CD F1 32 C3 4B 12 06 00 0E 03 D5 1A FE    !.:..2.K........
002ED0:  28 28 1D FE 29 28 21 FE 20 28 45 FE 2C 28 41 CB    ((..)(!. (E.,(A.
002EE0:  61 C2 C2 37 FE 30 38 26 FE 3A 30 22 04 13 18 DE    a..7.08&.:0"....
002EF0:  CB 51 20 7B CB D1 18 F5 CB 51 28 73 CB D9 13 1A    .Q {.....Q(s....
002F00:  FE 20 28 1C FE 2C 28 18 21 08 3A C3 03 37 CB 81    . (..,(.!.:..7..
002F10:  FE 41 38 04 FE 47 38 D4 FE 48 20 53 CB E1 18 CD    .A8..G8..H S....
002F20:  78 FE 00 21 4E 3A CA 03 37 79 07 A9 E6 08 20 3F    x..!N:..7y.... ?
002F30:  E1 D5 1B 78 21 7C 3A CB 61 20 04 CB 41 20 0A FE    ...x!|:.a ..A ..
002F40:  05 D2 03 37 CD AC 38 18 08 FE 06 D2 03 37 CD 65    ...7..8......7.e
002F50:  38 41 D1 DD CB 00 DE CB 68 28 0C DD CB 00 E6 0E    8A......h(......
002F60:  1A CB 50 C0 0E 18 C9 0E 4A CB 50 C0 0E 02 C9 D1    ..P.....J.P.....
002F70:  DD 7E 03 FE 16 28 04 FE 18 20 0B CD 1F 38 3E 72    .~...(... ...8>r
002F80:  0E 1E CB C6 18 31 1A DD CB 00 E6 FE 28 28 10 CD    .....1......((..
002F90:  1F 38 1A FE 29 28 2F 3E 74 0E 18 CB 86 18 18 13    .8..)(/>t.......
002FA0:  3A CF 31 CB DF 32 CF 31 CD 1F 38 1A FE 36 07 29    :.1..2.1..8..6.)
002FB0:  20 16 13 3E 76 0E 1A CB 86 32 F0 3B DD CB 00 DE     ..>v....2.;....
002FC0:  79 23 23 22 1D 3B E1 C9 21 5D 3A C3 03 37 2A 1D    y##".;..!]:..7*.
002FD0:  3B DD 75 01 DD 74 02 06 07 DD CB 00 EE 1A FE 20    ;.u..t......... 
002FE0:  28 13 FE 2C 28 16 FE 29 28 12 77 13 23 10 EE 21    (..,(..)(.w.#..!
002FF0:  6D 3A C3 03 37 3A CF 31 CB 5F 20 09 05 C8 3E 20    m:..7:.1._ ...> 
003000:  77 23 10 FC C9 CB 9F 32 CF 31 05 C8 3E 20 77 23    w#.....2.1..> w#
003010:  13 10 FB C9 C5 DD E5 CB 59 28 01 1B CD F2 38 6F    ........Y(....8o
003020:  26 00 DD 21 0F 3B 18 15 CD F2 38 FE 00 28 0E C5    &..!.;....8..(..
003030:  DD 4E 00 DD 46 01 09 38 18 3D 20 FA C1 DD 23 DD    .N..F..8.= ...#.
003040:  23 1B 10 E4 DD E1 C1 22 19 3B 3E 00 BC C8 CB E9    #......".;>.....
003050:  C9 E1 E1 E1 E1 21 7C 3A C3 03 37 21 19 3B 36 00    .....!|:..7!.;6.
003060:  CB 59 28 01 1B CB 61 28 01 1B CD F2 38 ED 67 05    .Y(...a(....8.g.
003070:  28 21 1B CD F2 38 ED 67 05 28 1C 1B 23 36 00 CD    (!...8.g.(..#6..
003080:  F2 38 ED 67 05 28 13 1B CD F2 38 ED 67 05 28 0E    .8.g.(....8.g.(.
003090:  CB F9 C9 3E 00 ED 67 CB A9 C9 3E 00 ED 67 CB E9    ...>..g...>..g..
0030A0:  C9 1A D6 30 FE 0A D8 D6 07 C9 0E 00 CD 2D 39 A2    ...0.........-9.
0030B0:  A3 D5 CB 7E 20 17 1A BE 28 07 D1 0C 0C 10 EF 37    £..~ ...(......7
0030C0:  C9 23 13 CB 7E 20 06 1A BE 28 F6 18 ED CB BE 1A    .#..~ ...(......
0030D0:  BE CB FE 20 E5 13 79 32 F0 3B 1A E1 A7 C9 21 F0    ... ..y2.;....!.
0030E0:  45 7D 81 6F 30 01 24 7E 23 66 6F C9 2A 1B 3B EB    E}.o0.$~#fo.*.;.
0030F0:  01 06 00 ED B0 ED 4B CD 31 EB 2B CB FE 23 71 23    ......K.1.+..#q#
003100:  70 23 22 1B 3B 13 21 1F 3B 34 DD CB 00 F6 C9 77    p#".;.!.;4.....w
003110:  CD 02 33 23 C9 21 20 3B 11 21 3B 36 00 01 BF 00    ..3#.! ;.!;6....
003120:  ED B0 21 F3 3B 11 F4 3B 01 7F 00 36 00 ED B0 C9    ..!.;..;...6....
003130:  DD CB 00 6E C8 3A 1F 3B FE 00 21 8D 3A CA 03 37    ...n.:.;..!.:..7
003140:  DD 6E 01 DD 66 02 11 F3 3B 47 0E 06 C5 1A E6 7F    .n..f...;G......
003150:  BE 28 0F 01 08 00 EB 09 EB C1 10 F0 21 8D 3A C3    .(..........!.:.
003160:  03 37 D5 E5 13 23 0D 28 0A 1A E6 7F BE 28 F5 E1    .7...#.(.....(..
003170:  D1 18 E0 EB 1A 5E 23 56 CB 47 E1 E1 DD 75 01 DD    .....^#V.G...u..
003180:  74 02 E1 20 07 DD 73 06 DD 72 07 C9 DD 6E 08 DD    t.. ..s..r...n..
003190:  66 09 23 23 EB A7 ED 52 DD 75 06 C9 53 70 61 63    f.##...R.u..Spac
0031A0:  65 20 6D 69 73 73 69 6E 67 A0 49 6E 73 74 72 2E    e missing.Instr.
0031B0:  20 2C 31 75 6E 6B 6E 6F 77 6E A0 4D 69 73 73 69     ,1unknown.Missi
0031C0:  6E 67 20 73 70 61 63 65 20 6F 72 20 2C A0 45 72    ng space or ,.Er
0031D0:  72 6F 72 20 61 66 74 65 72 20 69 6E 73 74 2E A0    ror after inst..
0031E0:  4F 66 66 73 65 74 20 74 6F 6F 20 62 69 67 A0 43    Offset too big.C
0031F0:  61 6E 20 6F 6E 6C 79 20 41 44 44 20 49 58 2F 49    an only ADD IX/I
003200:  D9 4E 75 6D 62 65 72 20 6D 69 73 73 69 6E 67 A0    .Number missing.
003210:  42 72 61 63 6B 65 74 20 6D 69 73 73 69 6E 67 A0    Bracket missing.
003220:  4C 61 62 65 6C 20 74 6F 6F 20 6C 6F 6E 67 A0 4E    Label too long.N
003230:  75 6D 62 65 72 20 74 6F 6F 20 6C 61 72 67 65 A0    umber too large.
003240:  4C 61 62 65 6C 20 6E 6F 74 20 66 6F 75 6E 64 A0    Label not found.
003250:  4E 6F 20 44 45 46 42 2C 20 6F 72 20 44 45 46 57    No DEFB, or DEFW
003260:  A0 4F 66 66 73 65 74 20 6D 69 73 73 69 6E 67 A0    .Offset missing.
003270:  20 45 72 72 6F 72 20 20 66 6F 75 6E 64 20 20 64     Error  found  d
003280:  75 72 69 6E 67 20 20 61 73 73 65 6D 62 6C 79 2E    uring  assembly.
003290:  20 20 50 6C 65 61 73 65 63 6F 72 72 65 63 74 20      Pleasecorrect 
0032A0:  62 65 66 6F 72 65 20 72 75 6E 6E 69 6E 67 20 70    before running p
0032B0:  72 6F 67 7F D5 72 61 6D 2E 20 20 20 20 20 20 20    rog..ram.       
0032C0:  20 A0 A0 00 01 00 0A 00 64 00 E8 03 10 27 00 00     .......d....'..
0032D0:  F3 3B 73 3C 00 00 00 00 00 00 00 00 00 00 0F 00    .;s<............
0032E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0032F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003300:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003310:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003320:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003330:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003340:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003350:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003360:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003370:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003380:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003390:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0033A0:  00 20 3B 45 17 00 00 00 00 00 00 00 00 00 00 00    . ;E............
0033B0:  00 00 00 00 00 61 51 00 00 00 00 00 00 00 00 00    .....aQ.........
0033C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0033D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0033E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0033F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003400:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003410:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003420:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003430:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003440:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003450:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003460:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003470:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003480:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003490:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0034A0:  00 00 00 00 00 00 00 00 00 00 3E F0 32 91 1A 11    ..........>.2...
0034B0:  05 15 CD 29 3E 11 05 E1 63 17 CD 29 3E 21 BB 42    ...)>...c..)>!.B
0034C0:  36 00 11 05 16 21 43 42 0E 14 DD 21 20 3B 06 0F    6....!CB...! ;..
0034D0:  C5 7E E6 7F DD BE 04 28 42 DD BE 05 28 3D 01 0C    .~.....(B...(=..
0034E0:  00 DD 09 C1 10 EA 23 23 36 00 23 36 00 23 36 00    ......##6.#6.#6.
0034F0:  23 36 00 23 0D 20 D3 3E 19 BA 20 0E 3E 0F 32 91    #6.#. .>.. .>.2.
003500:  1A 21 35 44 11 00 12 CD F1 32 21 FE 0F 22 9B 42    .!5D.....2!..".B
003510:  21 BC 42 06 06 36 00 23 10 FB C9 4E 23 46 78 E6    !.B..6.#...N#Fx.
003520:  0F 83 FE 23 38 10 3E 16 BA 20 05 11 06 18 18 EE    ...#8.>.. ......
003530:  11 30 19 C1 18 B1 F5 78 07 07 47 E6 03 83 23 77    .0.....x..G...#w
003540:  23 72 23 36 00 23 36 00 E5 15 78 07 07 E6 03 83    #r#6.#6...x.....
003550:  5F CB B9 21 0B 45 06 00 09 4E 23 66 69 CD F1 32    _..!.E...N#fi..2
003560:  E1 F1 5F 14 C1 18 8C 3E 0F 32 91 1A 11 05 16 CD    .._....>.2......
003570:  29 3E 11 05 18 CD 29 3E DD 21 43 42 06 14 C5 3E    )>....)>.!CB...>
003580:  00 DD BE 03 28 1B DD 5E 02 DD 56 03 DD E5 E1 01    ....(..^..V.....
003590:  04 00 09 DD CB 00 7E 28 05 CD 31 33 18 03 CD 1D    ......~(..13....
0035A0:  33 01 06 00 DD 09 C1 10 D5 DD 21 BB 42 11 03 15    3.........!.B...
0035B0:  DD CB 00 46 CD 20 3E 11 03 25 94 16 DD CB 00 76    ...F. >..%.....v
0035C0:  CD 20 3E 11 03 17 DD CB 00 56 CD 20 3E 11 03 18    . >......V. >...
0035D0:  DD CB 00 7E CD 20 3E CD FE 41 C9 3E 30 28 01 3C    ...~. >..A.>0(.<
0035E0:  CD 45 1A C9 06 1E 3E 20 C5 CD 45 1A C1 10 F7 C9    .E....> ..E.....
0035F0:  DD 2A EC 3B DD 4E 03 21 85 44 DD CB 00 56 28 03    .*.;.N.!.D...V(.
003600:  21 F7 44 06 00 09 4E 23 66 69 E9 DD 7E 04 FE 1A    !.D...N#fi..~...
003610:  CA 21 3F DD 4E 06 DD 21 43 42 FE 06 CA 2D 3F FE    .!?.N..!CB...-?.
003620:  2C CA 3D 3F FE 2E CA 49 3F FE 28 CA 59 3F FE 2A    ,.=?...I?.(.Y?.*
003630:  CA 65 3F C3 6B 40 DD 7E 05 18 D8 CD 51 41 D2 1D    .e?.k@.~....QA..
003640:  41 2A 7D 42 FE 06 28 14 2A 8F 42 FE 38 28 0D 2A    A*}B..(.*.B.8(.*
003650:  95 42 FE 3A 28 06 DD 6E 06 DD 66 07 22 CD 31 C3    .B.:(..n..f.".1.
003660:  2A 41 CD 51 41 D2 1D 41 DD 5E 06 1C 1C 2A CD 31    *A.QA..A.^...*.1
003670:  16 00 CB 7B 28 01 15 19 22 CD 31 C3 2A 41 3A 4D    ...{(...".1.*A:M
003680:  42 3D 32 4D 42 32 84 42 CA 1D 41 18 DB CD 51 41    B=2MB2.B..A...QA
003690:  D2 1D 41 2A 9B 42 2B DD 7E 15 77 2B DD 7E 14 77    ..A*.B+.~.w+.~.w
0036A0:  22 9B 42 DD 6E 06 DD 66 07 22 CD 31 C3 2A 41 CD    ".B.n..f.".1.*A.
0036B0:  51 41 D2 1D 41 2A 9B 42 01 FE 0F 05 5A A7 ED 42    QA..A*.B....Z..B
0036C0:  28 11 2A 9B 42 4E 23 46 23 22 9B 42 ED 43 CD 31    (.*.BN#F#".B.C.1
0036D0:  C3 2A 41 21 95 43 11 00 12 CD F1 32 37 C9 DD 6E    .*A!.C.....27..n
0036E0:  06 DD 66 07 CD DF 3F C3 6B 40 DD 21 43 42 DD 6E    ..f...?.k@.!CB.n
0036F0:  3A DD 66 3B CD DF 3F C3 6B 40 DD 6E 40 DD 66 41    :.f;..?.k@.n@.fA
003700:  CD DF 3F C3 6B 40 DD 21 43 42 DD 6E 46 DD 66 47    ..?.k@.!CB.nF.fG
003710:  CD DF 3F C3 6B 40 2A 8F 42 06 00 09 CD DF 3F C3    ..?.k@*.B.....?.
003720:  6B 40 2A 95 42 06 00 09 CD DF 3F C3 6B 40 DD 21    k@*.B.....?.k@.!
003730:  43 42 DD 6E 46 DD 66 47 CD DF 3F DD 4E 40 DD 46    CB.nF.fG..?.N@.F
003740:  41 0B 09 CD DF 3F C3 6B 40 DD 21 43 42 DD 6E 46    A....?.k@.!CB.nF
003750:  DD 66 47 CD DF 3F DD 46 41 DD 4E 40 0B A7 ED 42    .fG..?.FA.N@...B
003760:  CD DF 3F C3 6B 40 DD 21 43 42 DD 6E 3A DD 66 3B    ..?.k@.!CB.n:.f;
003770:  CD DF 3F DD 4E 0A 0D 06 00 09 CD DF 3F C3 6B 40    ..?.N.......?.k@
003780:  DD 21 43 42 DD 6E 3A DD 66 3B CD DF 3F 06 00 DD    .!CB.n:.f;..?...
003790:  4E 0A 0D A7 ED 42 CD DF 3F C3 6B 40 DD 21 20 3B    N....B..?.k@.! ;
0037A0:  DD 7E 09 BC 20 2C 3E BF BD 38 27 06 0F 11 0C 00    .~.. ,>..8'.....
0037B0:  2C DD 7E 14 BD 30 09 DD 19 10 F6 DD 21 F5 7E 43    ,.~..0......!.~C
0037C0:  42 C9 DD CB 00 7E 28 F1 DD 7E 03 FE 72 30 EE 21    B....~(..~..r0.!
0037D0:  45 43 18 03 21 F5 42 11 00 12 CD F1 32 E1 37 C9    EC..!.B.....2.7.
0037E0:  DD 7E 05 FE 32 20 43 DD 21 43 42 DD 66 04 DD 6E    .~..2 C.!CB.f..n
0037F0:  77 DD 75 04 DD 74 77 DD 66 78 DD 6E 76 DD 75 78    w.u..tw.fx.nv.ux
003800:  DD 74 76 18 19 DD 21 43 42 06 06 21 BC 42 11 06    .tv...!CB..!.B..
003810:  00 DD 4E 0A 7E 71 DD 77 0A DD 19 23 10 F3 21 C1    ..N.~q.w...#..!.
003820:  40 06 05 36 00 23 10 FB 18 22 DD 2A EC 3B DD 6E    @..6.#...".*.;.n
003830:  08 DD 66 09 DD 7E 14 95 4F 06 00 11 C1 40 ED B0    ..f..~..O....@..
003840:  EB FE 05 28 07 0E 00 71 23 3C 18 F5 DD 21 43 42    ...(...q#<...!CB
003850:  DD 46 0A DD 4E 10 DD 56 16 DD 5E 1C 21 BB 42 6E    .F..N..V..^.!.Bn
003860:  E5 F1 DD 66 22 DD 6E 28 DD 7E 04 DD 2A 8F 42 F3    ...f".n(.~..*.B.
003870:  FD 22 EE 42 FD 2A 95 42 ED 73 EC 42 ED 7B 9B 42    .".B.*.B.s.B.{.B
003880:  00 00 00 00 00 ED 73 9B 42 ED 7B EC 42 FD 22 95    ......s.B.{.B.".
003890:  42 FD 2A EE 42 FB DD 22 8F 42 DD 21 43 42 DD 77    B.*.B..".B.!CB.w
0038A0:  04 DD 77 71 DD 70 0A DD 70 41 DD 71 10 DD 71 40    ..wq.p..pA.q..q@
0038B0:  0A DD 77 64 DD 72 16 DD 72 47 DD 73 1C DD 73 BB    ..wd.r..rG.s..s.
0038C0:  A2 46 1A DD 77 6A DD 74 22 DD 74 3B DD 75 28 DD    .F..wj.t".t;.u(.
0038D0:  75 3A 7E DD 77 5E F5 C1 DD 71 70 DD 71 78 DD 2A    u:~.w^...qp.qx.*
0038E0:  EC 3B DD 6E 14 DD 66 15 22 CD 31 2A 9B 42 3E C1    .;.n..f.".1*.B>.
0038F0:  BD 38 13 CD AE 3D 3E 0F 32 91 1A 21 E5 43 11 00    .8...=>.2..!.C..
003900:  12 CD F1 32 37 C9 3E 0F BC 20 E8 CD AE 3D CD A0    ...27.>.. ...=..
003910:  41 C9 3A BB 42 47 DD 7E 04 FE 0C 28 1E FE 22 28    A.:.BG.~...(.."(
003920:  20 FE 1C 28 24 FE 20 28 24 FE 36 28 24 FE 3E 28     ..($. ($.6($.>(
003930:  24 FE 40 28 24 FE 42 28 24 37 C9 CB 40 20 08 A7    $.@($.B($7..@ ..
003940:  C9 CB 40 28 02 A7 C9 37 C9 CB 70 18 F0 CB 70 18    ..@(...7..p...p.
003950:  F2 CB 78 18 EE CB 78 18 E4 CB 50 18 E6 CB 50 18    ..x...x...P...P.
003960:  DC 3E 0F 32 91 1A DD 21 20 3B 11 08 02 06 10 C5    .>.2...! ;......
003970:  DD 7E 03 FE 74 20 08 CD D9 41 CD 31 33 18 0A FE    .~..t ...A.13...
003980:  72 20 06 CD D9 41 CD 1D 33 FE 76 CC E8 41 1E 08    r ...A..3.v..A..
003990:  14 01 0C 00 DD 09 C1 10 D6 C9 21 F0 42 CD F1 32    ..........!.B..2
0039A0:  1E 08 DD 6E 08 DD 66 09 C9 06 08 DD 6E 08 DD 66    ...n..f.....n..f
0039B0:  09 3E 30 CB 06 CE 00 C5 CD 45 1A C1 10 F3 C9 2A    .>0......E.....*
0039C0:  9B D1 A9 42 11 F8 0F A7 ED 52 4D 21 F8 0F 30 05    ...B.....RM!..0.
0039D0:  2A 9B 42 0E 00 06 04 11 23 18 C5 79 FE 00 3E 0F    *.B.....#..y..>.
0039E0:  20 02 3E FF 32 91 1A E5 21 F0 42 D5 CD F1 32 D1     .>.2...!.B...2.
0039F0:  E1 E5 D5 CD 31 33 D1 15 E1 23 23 C1 0D 0D 10 DA    ....13...##.....
003A00:  3E F0 32 91 1A C9 00 14 00 00 00 00 0A 14 00 00    >.2.............
003A10:  00 00 0C 14 00 00 00 00 0E 14 00 00 00 00 10 14    ................
003A20:  00 00 00 00 12 14 00 00 00 00 14 14 00 00 00 00    ................
003A30:  44 14 00 00 00 00 46 14 00 00 00 00 84 16 00 00    D.....F.........
003A40:  00 00 96 16 00 00 00 00 88 16 00 00 00 00 A4 16    ................
003A50:  00 00 00 00 A6 16 00 00 00 00 B4 16 00 00 80 7D    ...............}
003A60:  06 45 00 00 00 00 2C 45 00 00 00 00 2E 45 00 00    .E....,E.....E..
003A70:  00 00 B0 16 00 00 00 00 B2 16 00 00 00 00 00 00    ................
003A80:  00 00 00 00 00 46 4C 41 47 53 20 20 20 20 20 52    .....FLAGS     R
003A90:  65 67 69 73 74 65 72 73 20 61 6E 64 20 43 6F 6E    egisters and Con
003AA0:  74 65 6E 74 73 20 20 20 20 20 53 54 41 43 CB 00    tents     STAC..
003AB0:  00 00 00 20 20 20 20 A0 20 59 6F 75 20 61 72 65    ...    . You are
003AC0:  20 61 62 AC 5F 6F 75 74 20 74 6F 20 61 66 66 65     ab._out to affe
003AD0:  63 74 20 6D 65 6D 6F 72 79 20 61 72 65 61 20 6E    ct memory area n
003AE0:  6F 74 61 6C 6C 6F 63 61 74 65 64 20 74 6F 20 79    otallocated to y
003AF0:  6F 75 2E 20 50 6C 65 61 73 65 20 65 64 69 74 20    ou. Please edit 
003B00:  70 72 6F 67 72 61 6D 2E 20 A0 20 59 6F 75 20 61    program. . You a
003B10:  72 65 20 61 62 6F 75 74 20 74 6F 20 77 72 69 74    re about to writ
003B20:  65 20 74 6F 20 6D 65 6D 6F 72 79 20 77 68 69 63    e to memory whic
003B30:  68 20 77 69 6C 6C 20 61 66 66 65 63 74 20 79 6F    h will affect yo
003B40:  75 72 20 70 72 6F 67 72 61 6D 2E 20 50 6C 65 61    ur program. Plea
003B50:  73 65 20 65 64 69 74 2E 20 A0 20 54 68 65 20 70    se edit. . The p
003B60:  72 6F 67 72 61 6D 20 68 61 73 20 62 65 65 6E 20    rogram has been 
003B70:  63 6F 6D 70 6C 65 74 65 64 2E 20 59 6F 75 20 6D    completed. You m
003B80:  61 79 45 44 49 54 20 6F 72 20 72 65 52 55 4E 2E    ayEDIT or reRUN.
003B90:  20 45 78 69 74 20 62 79 20 70 72 65 73 73 69 6E     Exit by pressin
003BA0:  67 20 45 53 43 2E 20 20 20 A0 20 54 68 65 20 73    g ESC.   . The s
003BB0:  74 61 63 6B 20 70 6F 69 6E 74 65 72 20 69 73 20    tack pointer is 
003BC0:  6F 75 74 73 69 99 40 64 65 20 61 6C 6C 6F 63 61    outsi.@de alloca
003BD0:  74 65 64 20 6D 65 6D 6F 72 79 20 61 72 65 61 2E    ted memory area.
003BE0:  20 50 6C 65 61 73 65 20 65 64 69 74 20 70 72 6F     Please edit pro
003BF0:  67 72 61 6D 2E 20 20 20 20 20 20 A0 20 54 68 65    gram.      . The
003C00:  72 65 20 61 72 65 20 74 6F 6F 20 6D 61 6E 79 20    re are too many 
003C10:  72 65 67 69 73 74 65 72 73 20 63 61 6C 6C 65 64    registers called
003C20:  20 75 70 2C 74 6F 20 64 69 73 70 6C 61 79 2E 20     up,to display. 
003C30:  50 72 6F 67 72 61 6D 20 77 69 6C 6C 20 52 55 4E    Program will RUN
003C40:  20 61 73 20 6E 6F 72 6D 61 6C 2E A0 71 3F 49 3F     as normal..q?I?
003C50:  8C 3F 49 3F 50 3E 6B 40 6B 40 6B 40 6B 40 50 3E    .?I?P>k@k@k@k@P>
003C60:  50 3E A7 3E C3 3E D2 3E 80 3E 1D 41 1D 41 F4 3E    P>.>.>.>.>.A.A.>
003C70:  6B 40 6B 40 6B 40 6B 40 6B 40 6B 40 6B 40 6B 40    k@k@k@k@k@k@k@k@
003C80:  6B 40 6B 40 6B 40 46 40 21 40 6B 40 6B 40 6B 40    k@k@k@F@!@k@k@k@
003C90:  6B 40 6B 40 6B 40 6B 40 6B 40 6B 40 50 3E 50 3E    k@k@k@k@k@k@P>P>
003CA0:  1D 41 1D 41 1D 41 1D 41 1D 41 1D 41 1D 41 1D 41    .A.A.A.A.A.A.A.A
003CB0:  1D 41 1D 41 1D 41 1D 41 1D 41 6B 40 1D 41 50 3E    .A.A.A.A.Ak@.AP>
003CC0:  50 3E 50 3E 50 3E 50 F3 D5 3E 50 3E 50 3E 6B 40    P>P>P>P..>P>P>k@
003CD0:  7B 3E 7B 3E 79 45 85 45 90 45 AF 45 92 45 7A 45    {>{>yE.E.E.E.EzE
003CE0:  7B 45 7C 45 7D 45 7F 45 83 45 94 45 96 45 B3 45    {E|E}E.E.E.E.E.E
003CF0:  81 45 BA 45 98 45 9A 45 9C 45 9E 45 BD 45 C1 45    .E.E.E.E.E.E.E.E
003D00:  C5 45 C9 45 A0 45 CD 45 A6 45 82 45 D0 45 D4 45    .E.E.E.E.E.E.E.E
003D10:  A2 45 84 45 A8 45 AA 45 86 45 87 45 AC 45 B7 45    .E.E.E.E.E.E.E.E
003D20:  7E 45 88 45 89 45 8A 45 8B 45 8C 45 8D 45 8E 45    ~E.E.E.E.E.E.E.E
003D30:  8F 45 D8 45 DB 45 DE 45 E1 45 E4 45 E7 45 EA 45    .E.E.E.E.E.E.E.E
003D40:  ED 45 C1 C2 C3 C4 C5 C6 C8 CC DA D0 CC CD CE C9    .E..............
003D50:  D2 B0 B1 B2 B3 B4 B5 B6 B7 48 CC 44 C5 42 C3 4E    .........H.D.B.N
003D60:  CE 4E DA 4E C3 49 D8 49 D9 41 C6 28 53 50 A9 53    .N.N.I.I.A.(SP.S
003D70:  D0 50 CF 50 C5 28 43 A9 28 48 4C A9 28 4E 4E A9    .P.P.(C.(HL.(NN.
003D80:  28 4E A9 44 49 D3 28 49 58 AB 28 49 59 AB 28 42    (N.DI.(IX.(IY.(B
003D90:  43 A9 28 44 45 A9 41 46 A7 28 49 58 A9 28 49 59    C.(DE.AF.(IX.(IY
003DA0:  A9 30 30 C8 30 38 C8 31 30 C8 31 38 C8 32 30 C8    .00.08.10.18.20.
003DB0:  32 38 C8 33 30 C8 33 38 C8 B2 4F A8 4F C6 4F BC    28.30.38..O.O.O.
003DC0:  4F 7C 46 02 48 3C 48 76 48 39 E0 A0 48 10 49 DA    O|F.H<HvH9..H.I.
003DD0:  48 46 49 8E 49 98 49 60 49 B6 50 AC 50 C2 49 EC    HFI.I.I`I.P.P.I.
003DE0:  49 02 4A DA 4F D0 4F EE 4F E4 4F 02 50 18 4A 42    I.J.O.O.O.O.P.JB
003DF0:  4A 6C 4A 96 4A 9E 4F C0 4A 0C 50 16 50 20 50 76    JlJ.J.O.J.P.P Pv
003E00:  4F 80 4F 8A 4F 94 4F F8 4F 2A 50 34 50 3E 50 3E    O.O.O.O.O*P4P>P>
003E10:  4F 50 4F 52 50 48 50 66 50 5C 50 EE 4E 70 50 7A    OPORPHPfP\P.NpPz
003E20:  50 84 50 8E 50 18 4F 98 50 A2 50 C0 50 CA 50 DE    P.P.P.O.P.P.P.P.
003E30:  50 D4 50 D2 4A F8 4A 1E 4B 44 4B 6A 4B 90 4B B6    P.P.J.J.KDKjK.K.
003E40:  4B DC 4B E2 4C E8 4D 4C C4 00 00 00 00 02 3E 30    K.K.L.ML......>0
003E50:  00 1A 3A 30 1A 00 32 30 00 06 7E 30 06 00 77 30    ..:0..20..~0..w0
003E60:  06 02 36 30 0A 02 06 30 0C 02 0E 30 0E 02 16 30    ..60...0...0...0
003E70:  10 02 1E 30 12 02 26 30 14 02 2E 30 04 18 21 30    ...0..&0...0..!0
003E80:  08 18 11 30 16 18 01 30 04 1A 2A 30 08 1A ED 5B    ...0...0..*0...[
003E90:  16 1A ED 4B 1A 04 22 30 1A 08 ED 53 1A 16 ED 43    ...K.."0...S...C
003EA0:  0A 06 46 30 06 0A 70 30 0C 06 4E 30 06 0C 71 30    ..F0..p0..N0..q0
003EB0:  0E 06 56 30 06 0E 72 30 10 06 5E 30 06 10 73 30    ..V0..r0..^0..s0
003EC0:  00 0A 78 30 00 0C 79 30 00 0E 7A EA F6 30 00 10    ..x0..y0..z..0..
003ED0:  7B 30 00 12 7C 30 00 14 7D 30 0A 00 47 30 0C 00    {0..|0..}0..G0..
003EE0:  4F 30 0E 00 57 30 10 00 5F 30 12 00 67 30 14 00    O0..W0.._0..g0..
003EF0:  6F 30 00 2C 0A 30 00 2E 1A 30 34 18 31 30 34 1A    o0.,.0...04.104.
003F00:  ED 7B 1A 34 ED 73 2C 00 02 30 2E 00 12 30 34 04    .{.4.s,..0...04.
003F10:  F9 30 0A 0C 41 30 0A 0E 42 30 0A 10 43 30 0A 12    .0..A0..B0..C0..
003F20:  44 30 0A 14 45 30 0C 0A 48 30 0C 0E 4A 30 0C 10    D0..E0..H0..J0..
003F30:  4B 30 0C 12 4C 30 0C 14 4D 30 0E 0A 50 30 0E 0C    K0..L0..M0..P0..
003F40:  51 30 0E 10 53 30 0E 12 54 30 0E 14 55 30 10 0A    Q0..S0..T0..U0..
003F50:  58 30 10 0C 59 30 10 0E 5A 30 10 12 5C 30 10 14    X0..Y0..Z0..\0..
003F60:  5D 30 12 0A 60 30 12 0C 61 30 12 0E 62 30 12 10    ]0..`0..a0..b0..
003F70:  63 30 12 14 65 30 14 0A 68 30 14 0C 69 30 14 0E    c0..e0..h0..i0..
003F80:  6A 30 14 10 6B 30 14 12 6C 30 14 06 6E 30 12 06    j0..k0..l0..n0..
003F90:  66 30 06 12 74 30 06 14 75 30 00 44 ED 57 44 00    f0..t0..u0.D.WD.
003FA0:  ED 47 00 46 ED 5F 46 00 ED 4F 00 00 7F 30 0A 0A    .G.F._F..O...0..
003FB0:  40 30 0C 0C 49 30 0E 0E 52 30 10 10 5B 30 12 12    @0..I0..R0..[0..
003FC0:  64 30 14 14 6D 30 04 1A ED 6B 1A 04 ED 07 CE 63    d0..m0...k.....c
003FD0:  80 41 44 C4 00 00 00 02 C6 30 00 0A 80 30 00 0C    .AD......0...0..
003FE0:  81 30 00 06 86 30 04 16 09 30 04 08 19 30 00 0E    .0...0...0...0..
003FF0:  82 30 00 10 83 30 00 14 85 30 00 12 84 30 00 00    .0...0...0...0..
004000:  87 30 04 04 29 30 04 34 39 30 80 41 44 C3 00 00    .0..)0.490.AD...
004010:  00 02 CE 30 00 06 8E 30 04 16 ED 4A 04 08 ED 5A    ...0...0...J...Z
004020:  00 0A 88 30 00 0C 89 30 00 0E 8A 30 00 10 8B 30    ...0...0...0...0
004030:  00 12 8C 30 00 14 8D 30 04 34 ED 7A 04 04 ED 6A    ...0...0.4.z...j
004040:  00 00 8F 30 80 53 55 C2 00 00 02 7F D6 30 06 7F    ...0.SU......0..
004050:  96 30 0A 7F 90 30 0C 7F 91 30 0E 7F 92 30 10 7F    .0...0...0...0..
004060:  93 30 14 7F 95 30 12 7F 94 30 00 7F 97 30 80 53    .0...0...0...0.S
004070:  42 C3 00 00 00 02 DE 30 00 06 9E 30 04 16 ED 42    B......0...0...B
004080:  04 08 ED 52 00 0A 98 30 00 0C 99 30 00 0E 9A 30    ...R...0...0...0
004090:  00 10 9B 30 00 12 9C 30 00 14 9D 30 04 34 ED 72    ...0...0...0.4.r
0040A0:  04 04 ED 62 00 00 9F 30 80 44 45 C3 00 00 00 7F    ...b...0.DE.....
0040B0:  3D 30 06 7F 35 30 04 7F 2B 30 0C 7F 0D 30 0E 7F    =0..50..+0...0..
0040C0:  15 30 10 7F 1D 30 14 7F 2D 30 12 7F 25 30 08 37    .0...0..-0..%0.7
0040D0:  5A 7F 1B 30 16 7F 0B 30 0A 7F 05 30 34 7F 3B 30    Z..0...0...04.;0
0040E0:  80 49 4E C3 00 00 00 7F 3C 30 06 7F 34 30 04 7F    .IN.....<0..40..
0040F0:  23 30 0A 7F 04 30 0C 7F 0C 30 0E 7F 14 30 10 7F    #0...0...0...0..
004100:  1C 30 12 7F 24 30 14 7F 2C 30 08 7F 13 30 16 7F    .0..$0..,0...0..
004110:  03 30 34 7F 33 30 80 4A D2 00 00 00 1E 7F 18 30    .04.30.J.......0
004120:  0C 1E 38 30 22 1E 30 30 1C 1E 28 30 20 1E 20 30    ..80".00..(0 . 0
004130:  80 4A D0 00 00 00 18 7F C3 30 20 18 C2 30 1C 18    .J.......0 ..0..
004140:  CA 30 22 18 D2 30 0C 18 DA 30 06 7F E9 30 36 18    .0"..0...0...06.
004150:  F2 30 3E 18 FA 30 40 18 E2 30 42 18 EA 30 80 44    .0>..0@..0B..0.D
004160:  4A 4E DA 00 1E 7F 10 30 80 43 41 4C CC 00 18 7F    JN.....0.CAL....
004170:  CD 30 22 18 D4 30 20 18 C4 30 1C 18 CC 30 0C 18    .0"..0 ..0...0..
004180:  DC 30 36 18 F4 30 3E 18 FC 30 40 18 E4 30 42 18    .06..0>..0@..0B.
004190:  EC 30 80 52 45 D4 00 00 7F 7F C9 30 1C 7F C8 30    .0.RE......0...0
0041A0:  20 7F C0 30 0C 7F D8 30 22 7F D0 30 36 7F F0 30     ..0...0"..06..0
0041B0:  3E 7F F8 30 40 7F E0 30 42 7F E8 30 80 50 55 53    >..0@..0B..0.PUS
0041C0:  C8 00 04 7F E5 30 08 7F D5 30 16 7F C5 30 30 7F    .....0...0...00.
0041D0:  F5 21 BC 30 80 50 4F D0 00 00 04 7F E1 30 08 7F    .!.0.PO......0..
0041E0:  D1 30 16 7F C1 30 30 7F F1 30 80 43 D0 00 00 00    .0...00..0.C....
0041F0:  02 7F FE 30 06 7F BE 30 0A 7F B8 30 0C 7F B9 30    ...0...0...0...0
004200:  0E 7F BA 30 10 7F BB 30 12 7F BC 30 14 7F BD 30    ...0...0...0...0
004210:  00 7F BF 30 80 4F D2 00 00 00 02 7F F6 30 06 7F    ...0.O.......0..
004220:  B6 30 0A 7F B0 30 0C 7F B1 30 0E 7F B2 30 10 7F    .0...0...0...0..
004230:  B3 30 12 7F B4 30 14 7F B5 30 00 7F B7 30 80 58    .0...0...0...0.X
004240:  4F D2 00 00 02 7F EE 30 06 7F AE 30 0A 7F A8 30    O......0...0...0
004250:  0C 7F A9 30 0E 7F AA 30 10 7F AB 30 12 7F AC 30    ...0...0...0...0
004260:  14 7F AD 30 00 7F AF 30 80 41 4E C4 00 00 02 7F    ...0...0.AN.....
004270:  E6 30 06 7F A6 30 0A 7F A0 30 0C 7F A1 30 0E 7F    .0...0...0...0..
004280:  A2 30 10 7F A3 30 12 7F A4 30 14 7F A5 30 00 7F    .0..£0...0...0..
004290:  A7 30 80 45 D8 00 00 00 08 04 EB 30 30 32 08 30    .0.E.......002.0
0042A0:  3C 04 E3 30 80 52 4C C3 00 00 0A 7F 00 30 0C 7F    <..0.RL......0..
0042B0:  01 30 0E 7F 02 30 10 7F 03 30 06 7F 06 30 14 7F    .0...0...0...0..
0042C0:  05 30 12 7F 04 30 00 7F 07 30 80 52 CC 00 00 00    .0...0...0.R....
0042D0:  0A 7F 10 6E 74 30 0C 7F 11 30 0E 7F 12 30 10 7F    ...nt0...0...0..
0042E0:  13 30 06 7F 16 30 14 7F 15 30 12 7F 14 30 00 7F    .0...0...0...0..
0042F0:  17 30 80 52 52 C3 00 00 0A 7F 08 30 0C 7F 09 30    .0.RR......0...0
004300:  0E 7F 0A 30 10 7F 0B 30 06 7F 0E 30 14 7F 0D 30    ...0...0...0...0
004310:  12 7F 0C 30 00 7F 0F 30 80 52 D2 00 00 00 0A 7F    ...0...0.R......
004320:  18 30 0C 7F 19 30 0E 7F 1A 30 10 7F 1B 30 06 7F    .0...0...0...0..
004330:  1E 30 14 7F 1D 30 12 7F 1C 30 00 7F 1F 30 80 53    .0...0...0...0.S
004340:  4C C1 00 00 00 7F 27 30 0A 7F 20 30 0C 7F 21 30    L.....'0.. 0..!0
004350:  0E 7F 22 30 10 7F 23 30 06 7F 26 30 14 7F 25 30    .."0..#0..&0..%0
004360:  12 7F 24 30 80 53 52 C1 00 00 00 7F 2F 30 0A 7F    ..$0.SR...../0..
004370:  28 30 0C 7F 29 30 0E 7F 2A 30 10 7F 2B 30 06 7F    (0..)0..*0..+0..
004380:  2E 30 14 7F 2D 30 12 7F 2C 30 80 53 52 CC 00 00    .0..-0..,0.SR...
004390:  00 7F 3F 30 0A 7F 38 30 0C 7F 39 30 0E 7F 3A 30    ..?0..80..90..:0
0043A0:  10 7F 3B 30 06 7F 3E 30 14 7F 3D 30 12 7F 3C 30    ..;0..>0..=0..<0
0043B0:  80 42 49 D4 00 00 4E 00 47 30 50 00 4F 30 52 00    .BI...N.G0P.O0R.
0043C0:  57 30 54 00 5F 30 56 00 67 30 58 00 6F 30 5A 00    W0T._0V.g0X.o0Z.
0043D0:  77 30 5C 00 7F B0 2F 30 4E 06 46 30 50 06 4E 30    w0\.../0N.F0P.N0
0043E0:  52 06 56 30 54 06 5E 30 56 06 66 30 58 06 6E 30    R.V0T.^0V.f0X.n0
0043F0:  5A 06 76 30 5C 06 7E 30 4E 0A 40 30 50 0A 48 30    Z.v0\.~0N.@0P.H0
004400:  52 0A 50 30 54 0A 58 30 56 0A 60 30 58 0A 68 30    R.P0T.X0V.`0X.h0
004410:  5A 0A 70 30 5C 0A 78 30 4E 0C 41 30 50 0C 49 30    Z.p0\.x0N.A0P.I0
004420:  52 0C 51 30 54 0C 59 30 56 0C 61 30 58 0C 69 30    R.Q0T.Y0V.a0X.i0
004430:  5A 0C 71 30 5C 0C 79 30 4E 0E 42 30 50 0E 4A 30    Z.q0\.y0N.B0P.J0
004440:  52 0E 52 30 54 0E 5A 30 56 0E 62 30 58 0E 6A 30    R.R0T.Z0V.b0X.j0
004450:  5A 0E 72 30 5C 0E 7A 30 4E 10 43 30 50 10 4B 30    Z.r0\.z0N.C0P.K0
004460:  52 10 53 30 54 10 5B 30 56 10 63 30 58 10 6B 30    R.S0T.[0V.c0X.k0
004470:  5A 10 73 30 5C 10 7B 30 4E 12 44 30 50 12 4C 30    Z.s0\.{0N.D0P.L0
004480:  52 12 54 30 54 12 5C 30 56 12 64 30 58 12 6C 30    R.T0T.\0V.d0X.l0
004490:  5A 12 74 30 5C 12 7C 30 4E 14 45 30 50 14 4D 30    Z.t0\.|0N.E0P.M0
0044A0:  52 14 55 30 54 14 5D 30 56 14 65 30 58 14 6D 30    R.U0T.]0V.e0X.m0
0044B0:  5A 14 75 30 5C 14 7D 30 80 53 45 D4 00 00 4E 00    Z.u0\.}0.SE...N.
0044C0:  C7 30 50 00 CF 30 52 00 D7 30 54 00 DF 30 56 00    .0P..0R..0T..0V.
0044D0:  E7 30 58 00 EF 30 5A 19 C9 00 F7 30 5C 00 FF 30    .0X..0Z....0\..0
0044E0:  4E 06 C6 30 50 06 CE 30 52 06 D6 30 54 06 DE 30    N..0P..0R..0T..0
0044F0:  56 06 E6 30 58 06 EE 30 5A 06 F6 30 5C 06 FE 30    V..0X..0Z..0\..0
004500:  4E 0A C0 30 50 0A C8 30 52 0A D0 30 54 0A D8 30    N..0P..0R..0T..0
004510:  56 0A E0 30 58 0A E8 30 5A 0A F0 30 5C 0A F8 30    V..0X..0Z..0\..0
004520:  4E 0C C1 30 50 0C C9 30 52 0C D1 30 54 0C D9 30    N..0P..0R..0T..0
004530:  56 0C E1 30 58 0C E9 30 5A 0C F1 30 5C 0C F9 30    V..0X..0Z..0\..0
004540:  4E 0E C2 30 50 0E CA 30 52 0E D2 30 54 0E DA 30    N..0P..0R..0T..0
004550:  56 0E E2 30 58 0E EA 30 5A 0E F2 30 5C 0E FA 30    V..0X..0Z..0\..0
004560:  4E 10 C3 30 50 10 CB 30 52 10 D3 30 54 10 DB 30    N..0P..0R..0T..0
004570:  56 10 E3 30 58 10 EB 30 5A 10 F3 30 5C 10 FB 30    V..0X..0Z..0\..0
004580:  4E 12 C4 30 50 12 CC 30 52 12 D4 30 54 12 DC 30    N..0P..0R..0T..0
004590:  56 12 E4 30 58 12 EC 30 5A 12 F4 30 5C 12 FC 30    V..0X..0Z..0\..0
0045A0:  4E 14 C5 30 50 14 CD 30 52 14 D5 30 54 14 DD 30    N..0P..0R..0T..0
0045B0:  56 14 E5 30 58 14 ED 30 5A 14 F5 30 5C 14 FD 30    V..0X..0Z..0\..0
0045C0:  80 52 45 D3 00 00 4E 00 87 30 50 00 8F 30 52 00    .RE...N..0P..0R.
0045D0:  97 30 54 00 9F 30 56 00 A7 88 13 30 58 00 AF 30    .0T..0V....0X..0
0045E0:  5A 00 B7 30 5C 00 BF 30 4E 06 86 30 50 06 8E 30    Z..0\..0N..0P..0
0045F0:  52 06 96 30 54 06 9E 30 56 06 A6 30 58 06 AE 30    R..0T..0V..0X..0
004600:  5A 06 B6 30 5C 06 BE 30 4E 0A 80 30 50 0A 88 30    Z..0\..0N..0P..0
004610:  52 0A 90 30 54 0A 98 30 56 0A A0 30 58 0A A8 30    R..0T..0V..0X..0
004620:  5A 0A B0 30 5C 0A B8 30 4E 0C 81 30 50 0C 89 30    Z..0\..0N..0P..0
004630:  52 0C 91 30 54 0C 99 30 56 0C A1 30 58 0C A9 30    R..0T..0V..0X..0
004640:  5A 0C B1 30 5C 0C B9 30 4E 0E 82 30 50 0E 8A 30    Z..0\..0N..0P..0
004650:  52 0E 92 30 54 0E 9A 30 56 0E A2 30 58 0E AA 30    R..0T..0V..0X..0
004660:  5A 0E B2 30 5C 0E BA 30 4E 10 83 30 50 10 8B 30    Z..0\..0N..0P..0
004670:  52 10 93 30 54 10 9B 30 56 10 A3 30 58 10 AB 30    R..0T..0V.£0X..0
004680:  5A 10 B3 30 5C 10 BB 30 4E 12 84 30 50 12 8C 30    Z..0\..0N..0P..0
004690:  52 12 94 30 54 12 9C 30 56 12 A4 30 58 12 AC 30    R..0T..0V..0X..0
0046A0:  5A 12 B4 30 5C 12 BC 30 4E 14 85 30 50 14 8D 30    Z..0\..0N..0P..0
0046B0:  52 14 95 30 54 14 9D 30 56 14 A5 30 58 14 AD 30    R..0T..0V..0X..0
0046C0:  5A 14 B5 30 5C 14 BD 30 80 49 CE 00 00 00 00 4A    Z..0\..0.I.....J
0046D0:  DB 30 00 48 ED 78 0A 48 ED 40 0E 25 09 48 ED 50    .0.H.x.H.@.%.H.P
0046E0:  10 48 ED 58 12 48 ED 60 14 48 ED 68 0C 48 ED 48    .H.X.H.`.H.h.H.H
0046F0:  4C 48 ED 70 80 4F 55 D4 00 00 4A 00 D3 30 48 00    LH.p.OU...J..0H.
004700:  ED 79 48 0A ED 41 48 0E ED 51 48 10 ED 59 48 12    .yH..AH..QH..YH.
004710:  ED 61 48 14 ED 69 48 0C ED 49 80 49 CD 00 00 00    .aH..iH..I.I....
004720:  4E 7F ED 46 50 7F ED 56 52 7F ED 5E 80 52 53 D4    N..FP..VR..^.RS.
004730:  00 00 5E 7F C7 30 60 7F CF 30 62 7F D7 30 64 7F    ..^..0`..0b..0d.
004740:  DF 30 66 7F E7 30 68 7F EF 30 6A 7F F7 30 6C 7F    .0f..0h..0j..0l.
004750:  FF 30 80 52 4C 43 C1 00 7F 7F 07 30 80 52 4C C1    .0.RLC.....0.RL.
004760:  00 00 7F 7F 17 30 80 52 52 43 C1 00 7F 7F 0F 30    .....0.RRC.....0
004770:  80 52 52 C1 00 00 7F 7F 1F 30 80 45 58 D8 00 00    .RR......0.EX...
004780:  7F 7F D9 30 80 4C 44 C9 00 00 7F 7F ED A0 80 4C    ...0.LD........L
004790:  44 49 D2 00 7F 7F ED B0 80 4C 44 C4 00 00 7F 7F    DI.......LD.....
0047A0:  ED A8 80 4C 44 44 D2 00 7F 7F ED B8 80 43 50 C9    ...LDD.......CP.
0047B0:  00 00 7F 7F ED A1 80 43 50 49 D2 00 7F 7F ED B1    .......CPI......
0047C0:  80 43 50 C4 00 00 7F 7F ED A9 80 43 50 44 D2 00    .CP........CPD..
0047D0:  7F 7F ED B9 80 44 41 C1 00 00 7F 7F 27 1A A8 30    .....DA.....'..0
0047E0:  80 43 50 CC 00 00 7F 7F 2F 30 80 4E 45 C7 00 00    .CP...../0.NE...
0047F0:  7F 7F ED 44 80 43 43 C6 00 00 7F 7F 3F 30 80 53    ...D.CC.....?0.S
004800:  43 C6 00 00 7F 7F 37 30 80 4E 4F D0 00 00 7F 7F    C.....70.NO.....
004810:  00 30 80 52 4C C4 00 00 7F 7F ED 6F 80 52 52 C4    .0.RL......o.RR.
004820:  00 00 7F 7F ED 67 80 49 4E C9 00 00 7F 7F ED A2    .....g.IN.......
004830:  80 49 4E 49 D2 00 7F 7F ED B2 80 49 4E C4 00 00    .INI.......IN...
004840:  7F 7F ED AA 80 49 4E 44 D2 00 7F 7F ED BA 80 4F    .....IND.......O
004850:  55 54 C9 00 7F 7F ED A3 80 4F 54 49 D2 00 7F 7F    UT.....£.OTI....
004860:  ED B3 80 4F 55 54 C4 00 7F 7F ED AB 80 4F 54 44    ...OUT.......OTD
004870:  D2 00 7F 7F ED BB 80 44 C9 00 00 00 7F 7F F3 30    .......D.......0
004880:  80 45 C9 00 00 00 7F 7F FB 30 80 52 45 54 C9 00    .E.......0.RET..
004890:  7F 7F ED 4D 80 52 45 54 CE 00 7F 7F ED 45 80 48    ...M.RET.....E.H
0048A0:  41 4C D4 00 7F 7F 76 30 80 44 45 46 C2 00 02 7F    AL....v0.DEF....
0048B0:  CB 30 80 42 49 CE 00 00 02 7F CB 30 80 44 45 46    .0.BI......0.DEF
0048C0:  D7 00 18 7F CB 30 80 CD CB 51 21 50 C0 22 0D 52    .....0...Q!P.".R
0048D0:  18 33 2A 04 58 CD AD 51 21 37 52 CD FC 51 CD E1    .3*.X..Q!7R..Q..
0048E0:  7B E7 51 CD 06 BB FE 20 CA 7C 51 FE 0D 20 F4 2A    {.Q.... .|Q.. .*
0048F0:  00 58 ED 4B 02 58 A7 ED 42 20 0C 21 5F 52 CD FC    .X.K.X..B .!_R..
004900:  51 CD D9 51 D8 18 53 DD 2A 00 58 DD 6E 00 DD 66    Q..Q..S.*.X.n..f
004910:  01 E5 DD E1 DD CB 00 46 20 40 DD 6E 01 DD 66 02    .......F @.n..f.
004920:  DD CB 00 4E 20 1E CD AD 51 21 0F 52 CD FC 51 3E    ...N ...Q!.R..Q>
004930:  42 CD 1E BB 20 24 CD 06 BB FE 20 20 F2 01 03 00    B... $....  ....
004940:  DD 09 18 D0 DD CB 00 56 3E 01 28 02 3E 00 32 CF    .......V>.(.>.2.
004950:  31 22 41 17 CD CB 51 CD B9 11 CD CB 51 2A 00 58    1"A...Q.....Q*.X
004960:  ED 4B 02 58 A7 ED 42 CA 9E 51 2A 0D 52 01 50 00    .K.X..B..Q*.R.P.
004970:  09 22 0D 52 2A 00 58 23 23 22 00 58 C3 F3 50 21    .".R*.X##".X..P!
004980:  08 58 22 00 58 21 A0 C0 22 0D 52 C3 F3 50 11 00    .X".X!..".R..P..
004990:  00 CD F1 32 3E 00 BB 28 07 3E 20 CD 45 1A 18 F4    ...2>..(.> .E...
0049A0:  CB 4E 23 28 EC 2B 3E 16 BA 30 EE C9 21 00 C0 11    .N#(.+>..0..!...
0049B0:  01 C0 01 FF 3F 36 0F ED B0 C9 CD 18 BB FE 79 37    ....?6........y7
0049C0:  C8 FE 6E 37 3F C8 18 F2 2A 0D 52 0E 08 06 50 7E    ..n7?...*.R...P~
0049D0:  ED 6F 23 10 FA 11 B0 07 19 0D 20 F1 C9 3E F0 32    .o#....... ..>.2
0049E0:  91 C6 41 1A 11 00 18 CD F1 32 3E 0F 32 91 1A C9    ..A......2>.2...
0049F0:  A0 C0 20 20 20 20 20 20 20 20 50 72 65 73 73 20    ..        Press 
004A00:  53 50 41 43 45 20 74 6F 20 63 6F 6E 74 69 6E 75    SPACE to continu
004A10:  65 2E 20 20 20 20 20 20 20 A0 20 50 72 65 73 73    e.       . Press
004A20:  20 53 50 41 43 45 20 74 6F 20 73 65 6C 65 63 74     SPACE to select
004A30:  20 26 20 45 4E 54 45 52 20 74 6F 20 73 74 61 72     & ENTER to star
004A40:  74 A0 20 50 6C 65 61 73 65 20 63 6F 6E 66 69 72    t. Please confir
004A50:  6D 20 6C 6F 61 64 69 6E 67 20 72 65 71 75 69 72    m loading requir
004A60:  65 64 20 20 20 20 59 2F 4E A0 00 00 00 00 00 00    ed    Y/N.......
004A70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004A80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004A90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004AA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004AB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004AC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004AD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004AE0:  00 00 00 A2 EC FF FF FF FF 11 06 09 57 04 A6 04    ............W...
004AF0:  8E 04 1B 09 FF 0F 08 FC 09 07 01 00 FC 04 00 00    ................
004B00:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004B90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004BF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 14 FE FF    ................
004C00:  FF FF FF 11 07 09 57 04 A6 04 89 04 14 09 08 10    ......W.........
004C10:  08 FC 09 AF 55 00 FB 06 58 26 58 05 83 27 58 2B    ....U...X&X..'X+
004C20:  58 32 58 39 58 3D 58 44 58 4B 58 52 58 62 58 69    X2X9X=XDXKXRXbXi
004C30:  58 79 58 80 58 90 58 97 58 9E 58 AB 58 00 00 15    XyX.X.X.X.X.X...
004C40:  82 01 00 10 85 00 BF 87 01 00 E3 89 00 DB 8B 01    ................
004C50:  00 AC 8C 01 00 84 8E 02 E5 8F 01 00 62 59 00 DD    ............bY..
004C60:  5B 01 00 B2 58 06 55 5C 01 00 F4 5C 00 96 5F 00    [...X.U\...\.._.
004C70:  04 61 00 2F 63 00 8D 64 01 00 F5 64 06 C5 65 01    .a./c..d...d..e.
004C80:  00 76 66 00 6D 67 00 40 69 00 FC 6A 00 F7 6C 01    .vf.mg.@i..j..l.
004C90:  00 D8 6D 06 6A 6E 01 00 16 6F 00 A6 70 00 05 73    ..m.jn...o..p..s
004CA0:  00 4F 75 00 72 77 01 00 DF 78 06 A4 79 01 00 60    .Ou.rw...x..y..`
004CB0:  7A 02 A6 7B 01 00 49 7C 00 1F 7E 00 7D 7F 00 C1    z..{..I|..~.}...
004CC0:  80 01 00 21 81 06 A5 81 01 20 20 20 20 20 20 45    ...!.....      E
004CD0:  58 41 4D 50 4C 45 53 20 4F 46 20 42 49 54 20 4D    XAMPLES OF BIT M
004CE0:  41 4E 49 50 55 4C 41 54 49 4F 4E A0 A0 20 54 68    ANIPULATION.. Th
004CF0:  65 20 66 6F 6C 6C 6F 77 69 6E 67 20 69 6C 6C 75    e following illu
004D00:  73 74 72 61 74 65 73 20 20 74 68 65 20 20 77 61    strates  the  wa
004D10:  79 20 20 69 6E 77 68 B2 91 69 63 68 20 20 53 45    y  inwh..ich  SE
004D20:  54 2C 20 52 45 53 2C 20 61 6E 64 20 20 42 49 54    T, RES, and  BIT
004D30:  20 63 61 6E 20 62 65 20 75 73 65 64 20 74 6F 6D     can be used tom
004D40:  61 6E 69 70 75 6C 61 74 65 20 69 6E 64 69 76 69    anipulate indivi
004D50:  64 75 61 6C 20 62 69 74 73 20 6F 66 20 61 20 72    dual bits of a r
004D60:  65 67 69 73 74 65 72 6F 72 20 6D 65 6D 6F 72 79    egisteror memory
004D70:  20 6C 6F 63 61 74 69 6F 6E 2E A3 20 20 20 20 20     location.£     
004D80:  20 20 20 20 20 20 20 42 49 54 20 4D 41 4E 49 50           BIT MANIP
004D90:  55 4C 41 54 49 4F 4E A0 A0 20 57 65 20 68 61 76    ULATION.. We hav
004DA0:  65 20 73 6F 20 66 61 72 20 74 72 65 61 74 65 64    e so far treated
004DB0:  20 20 69 6E 66 6F 72 6D 61 74 69 6F 6E 20 20 69      information  i
004DC0:  6E 74 68 65 20 66 6F 72 6D 20 6F 66 20 62 79 74    nthe form of byt
004DD0:  65 73 20 6F 72 20 77 6F 72 64 73 2E 20 54 68 65    es or words. The
004DE0:  20 5A 38 30 20 64 6F 65 73 61 6C 6C 6F 77 20 61     Z80 doesallow a
004DF0:  20 6E 75 6D 62 65 72 20 6F 66 20 6F 70 65 72 61     number of opera
004E00:  74 69 6F 6E 73 20 6F 6E 20 73 65 70 61 72 61 74    tions on separat
004E10:  65 6F 72 20 67 72 6F 75 70 E1 FC 73 20 6F 66 20    eor group..s of 
004E20:  62 69 74 73 20 77 69 74 68 69 6E 20 6F 6E 65 20    bits within one 
004E30:  62 79 74 65 A0 A0 20 41 6E 79 20 20 62 69 74 20    byte.. Any  bit 
004E40:  20 69 6E 20 20 20 61 20 20 72 65 67 69 73 74 65     in   a  registe
004E50:  72 2C 20 20 6F 72 20 20 6D 65 6D 6F 72 79 6C 6F    r,  or  memorylo
004E60:  63 61 74 69 6F 6E 20 75 73 69 6E 67 20 28 48 4C    cation using (HL
004E70:  29 2C 20 20 63 61 6E 20 20 62 65 20 20 53 45 54    ),  can  be  SET
004E80:  20 20 74 6F 20 61 22 31 22 2E 20 57 65 20 63 61      to a"1". We ca
004E90:  6E 20 61 6C 73 6F 20 52 45 53 65 74 20 61 6E 79    n also RESet any
004EA0:  20 62 69 74 20 74 6F 20 61 20 22 30 22 2E 54 6F     bit to a "0".To
004EB0:  20 20 74 65 73 74 20 20 74 68 65 20 20 20 73 74      test  the   st
004EC0:  61 74 65 20 20 6F 66 20 20 61 20 20 62 69 74 20    ate  of  a  bit 
004ED0:  20 69 6E 20 20 61 72 65 67 69 73 74 65 72 2C 20     in  aregister, 
004EE0:  6F 72 20 6D 65 6D 6F 72 79 20 6C 6F 63 61 74 69    or memory locati
004EF0:  6F 6E 2C 20 77 65 20 63 61 6E 20 75 73 65 74 68    on, we can useth
004F00:  65 20 69 6E 73 74 72 75 63 74 69 6F 6E 20 42 49    e instruction BI
004F10:  54 2E 20 49 6E 20 74 68 69 73 20 FF D5 69 6E 73    T. In this ..ins
004F20:  74 72 75 63 74 69 6F 6E 74 68 65 20 5A 65 72 6F    tructionthe Zero
004F30:  20 66 6C 61 67 20 69 73 20 73 65 74 20 69 66 20     flag is set if 
004F40:  74 68 65 20 20 61 70 70 72 6F 70 72 69 61 74 65    the  appropriate
004F50:  62 69 74 20 69 73 20 20 22 30 22 20 20 61 6E 64    bit is  "0"  and
004F60:  20 72 65 73 65 74 20 74 6F 20 61 20 20 22 30 22     reset to a  "0"
004F70:  20 20 69 66 20 74 68 65 61 70 70 72 6F 70 72 69      if theappropri
004F80:  61 74 65 20 20 62 69 74 20 20 69 73 20 22 31 22    ate  bit  is "1"
004F90:  2E 20 20 48 65 6E 63 65 20 77 65 20 20 63 61 6E    .  Hence we  can
004FA0:  70 72 6F 64 75 63 65 20 6F 75 72 20 6F 77 6E 20    produce our own 
004FB0:  66 6C 61 67 73 20 74 6F 20 69 6E 64 69 63 61 74    flags to indicat
004FC0:  65 20 65 76 65 6E 74 73 61 6E 64 20 74 68 65 6E    e eventsand then
004FD0:  20 20 61 63 74 20 20 75 70 6F 6E 20 20 74 68 65      act  upon  the
004FE0:  6D 20 20 6C 61 74 65 72 20 69 6E 20 20 6F 75 72    m  later in  our
004FF0:  70 72 6F 67 72 61 6D 73 2E A3 20 53 75 6D 6D 61    programs.£ Summa
005000:  72 79 20 2D 20 62 69 74 20 6D 61 6E 69 70 75 6C    ry - bit manipul
005010:  61 74 69 6F 6E A0 A0 53 45 54 20 4E 2C 07 69 72    ation..SET N,.ir
005020:  20 20 20 20 77 68 65 72 65 20 4E 20 69 73 20 74        where N is t
005030:  68 65 20 62 69 74 20 6E 75 6D 62 65 72 20 30 2D    he bit number 0-
005040:  37 53 45 54 20 4E 2C 28 48 4C 29 A0 A0 52 45 53    7SET N,(HL)..RES
005050:  20 4E 2C 72 A0 52 45 53 20 4E 2C 28 48 4C 29 A0     N,r.RES N,(HL).
005060:  A0 42 49 54 20 4E 2C 72 A0 42 49 54 20 4E 2C 28    .BIT N,r.BIT N,(
005070:  48 4C 29 A3 20 4C 44 20 48 4C 2C 53 54 4F 52 45    HL)£ LD HL,STORE
005080:  A0 20 20 53 45 54 20 36 2C 28 48 4C 29 A0 20 4C    .  SET 6,(HL). L
005090:  4F 4F 50 20 20 49 4E 43 20 28 48 4C 29 A0 20 20    OOP  INC (HL).  
0050A0:  42 49 54 20 32 2C 28 48 4C 29 A0 20 20 4A 52 20    BIT 2,(HL).  JR 
0050B0:  5A 2C 4C 4F 4F 50 A0 20 20 52 45 53 20 33 2C 28    Z,LOOP.  RES 3,(
0050C0:  48 4C 29 A0 20 20 4C 44 20 42 2C 35 A0 20 20 53    HL).  LD B,5.  S
0050D0:  45 54 20 37 2C 42 A0 20 20 52 45 53 20 32 2C 42    ET 7,B.  RES 2,B
0050E0:  A0 20 20 44 45 43 20 42 A0 20 20 42 49 54 20 35    .  DEC B.  BIT 5
0050F0:  2C 42 A0 20 20 52 45 54 20 5A A0 20 20 A0 20 53    ,B.  RET Z.  . S
005100:  54 4F 52 45 20 42 49 4E 20 31 36 A0 20 20 A0 20    TORE BIN 16.  . 
005110:  20 A0 20 20 20 20 20 20 20 20 20 20 4C 4F 47 E4     .          LOG.
005120:  9C 49 43 41 4C 20 49 4E 53 54 52 55 43 54 49 4F    .ICAL INSTRUCTIO
005130:  4E 53 A0 A0 20 54 68 65 72 65 20 20 61 72 65 20    NS.. There  are 
005140:  20 74 68 72 65 65 20 6C 6F 67 69 63 61 6C 20 20     three logical  
005150:  69 6E 73 74 72 75 63 74 69 6F 6E 73 61 76 61 69    instructionsavai
005160:  6C 61 62 6C 65 20 20 6F 6E 20 20 74 68 65 20 20    lable  on  the  
005170:  5A 38 30 2E 20 20 20 54 68 65 79 20 61 72 65 20    Z80.   They are 
005180:  20 61 6C 6C 70 65 72 66 6F 72 6D 65 64 20 20 6F     allperformed  o
005190:  6E 20 61 20 62 69 74 20 62 79 20 62 69 74 20 62    n a bit by bit b
0051A0:  61 73 69 73 20 62 65 74 77 65 65 6E 74 68 65 20    asis betweenthe 
0051B0:  41 63 63 75 6D 75 6C 61 74 6F 72 20 61 6E 64 20    Accumulator and 
0051C0:  61 20 20 6E 75 6D 62 65 72 2C 20 72 65 67 69 73    a  number, regis
0051D0:  74 65 72 2C 6F 72 20 69 6E 64 69 72 65 63 74 6C    ter,or indirectl
0051E0:  79 20 61 64 64 72 65 73 73 65 64 20 20 6D 65 6D    y addressed  mem
0051F0:  6F 72 79 20 6C 6F 63 61 74 69 6F 6E 28 48 4C 29    ory location(HL)
005200:  2E 20 20 54 68 65 20 20 20 72 65 73 75 6C 74 20    .  The   result 
005210:  20 20 69 73 20 20 6C 65 66 74 20 20 20 69 6E 20      is  left   in 
005220:  20 D4 1A 74 68 65 41 63 63 75 6D 75 6C 61 74 6F     ..theAccumulato
005230:  72 2E A0 A0 20 49 6E 20 74 68 65 20 41 4E 44 20    r... In the AND 
005240:  69 6E 73 74 72 75 63 74 69 6F 6E 2C 20 69 66 20    instruction, if 
005250:  61 20 62 69 74 20 69 6E 20 74 68 65 41 63 63 75    a bit in theAccu
005260:  6D 75 6C 61 74 6F 72 20 20 41 4E 44 20 20 6F 74    mulator  AND  ot
005270:  68 65 72 20 6E 75 6D 62 65 72 20 61 72 65 20 20    her number are  
005280:  22 31 22 2C 74 68 65 6E 20 74 68 65 20 63 6F 72    "1",then the cor
005290:  72 65 73 70 6F 6E 64 69 6E 67 20 62 69 74 20 69    responding bit i
0052A0:  6E 20 74 68 65 20 72 65 73 75 6C 74 77 69 6C 6C    n the resultwill
0052B0:  20 62 65 20 22 31 22 2E 20 49 66 20 6E 6F 74 20     be "1". If not 
0052C0:  69 74 20 77 69 6C 6C 20 62 65 20 22 30 22 A0 A0    it will be "0"..
0052D0:  20 69 2E 65 2E 20 20 20 20 20 20 30 31 31 30 31     i.e.      01101
0052E0:  31 30 30 A0 20 20 20 20 20 20 20 20 20 20 20 30    100.           0
0052F0:  31 30 31 30 31 31 30 20 20 20 41 4E 44 65 64 20    1010110   ANDed 
005300:  74 6F 67 65 74 68 65 72 A0 20 67 69 76 65 73 20    together. gives 
005310:  20 20 20 20 30 31 30 30 30 31 30 30 A0 A0 20 41        01000100.. A
005320:  73 20 77 27 B2 65 6C 6C 20 61 73 20 20 70 65 72    s w'.ell as  per
005330:  66 6F 72 6D 69 6E 67 20 20 41 4E 44 73 20 6F 6E    forming  ANDs on
005340:  20 6F 75 72 20 6F 77 6E 66 6C 61 67 73 2C 20 20     our ownflags,  
005350:  74 68 69 73 20 20 69 6E 73 74 72 75 63 74 69 6F    this  instructio
005360:  6E 20 20 69 73 20 20 75 73 65 66 75 6C 20 69 6E    n  is  useful in
005370:  6D 61 73 6B 69 6E 67 20 6F 66 66 20 61 72 65 61    masking off area
005380:  73 20 6F 66 20 77 6F 72 64 73 2C 20 6F 72 20 72    s of words, or r
005390:  65 73 65 74 74 69 6E 67 67 72 6F 75 70 73 20 6F    esettinggroups o
0053A0:  66 20 62 69 74 73 20 69 6E 20 74 68 65 20 41 63    f bits in the Ac
0053B0:  63 75 6D 75 6C 61 74 6F 72 2E A3 20 49 6E 20 20    cumulator.£ In  
0053C0:  74 68 65 20 4F 52 20 69 6E 73 74 72 75 63 74 69    the OR instructi
0053D0:  6F 6E 2C 20 69 66 20 61 20 62 69 74 20 69 6E 20    on, if a bit in 
0053E0:  74 68 65 41 63 63 75 6D 75 6C 61 74 6F 72 20 20    theAccumulator  
0053F0:  4F 52 20 69 6E 20 74 68 65 20 6F 74 68 65 72 20    OR in the other 
005400:  6E 75 6D 62 65 72 20 69 73 20 61 22 31 22 2C 20    number is a"1", 
005410:  74 68 65 20 63 6F 72 72 65 73 70 6F 6E 64 69 6E    the correspondin
005420:  67 20 62 69 74 A1 E3 20 69 6E 20 74 68 65 20 72    g bit.. in the r
005430:  65 73 75 6C 74 77 69 6C 6C 20 62 65 20 22 31 22    esultwill be "1"
005440:  2E 20 49 66 20 6E 6F 74 20 69 74 20 77 69 6C 6C    . If not it will
005450:  20 62 65 20 22 30 22 A0 A0 20 69 2E 65 2E 20 20     be "0".. i.e.  
005460:  20 20 20 20 30 31 31 30 31 31 30 30 A0 20 20 20        01101100.   
005470:  20 20 20 20 20 20 20 20 30 31 30 31 30 31 31 30            01010110
005480:  20 20 20 4F 52 65 64 20 74 6F 67 65 74 68 65 72       ORed together
005490:  A0 20 67 69 76 65 20 20 20 20 20 20 30 31 31 31    . give      0111
0054A0:  31 31 31 30 A0 A0 20 41 73 20 77 65 6C 6C 20 61    1110.. As well a
0054B0:  73 20 70 65 72 66 6F 72 6D 69 6E 67 20 20 4F 52    s performing  OR
0054C0:  20 6F 70 65 72 61 74 69 6F 6E 73 20 6F 6E 6F 75     operations onou
0054D0:  72 20 20 6F 77 6E 20 20 66 6C 61 67 73 2C 20 20    r  own  flags,  
0054E0:  20 74 68 69 73 20 20 69 6E 73 74 72 75 63 74 69     this  instructi
0054F0:  6F 6E 20 20 69 73 75 73 65 66 75 6C 20 69 6E 20    on  isuseful in 
005500:  53 45 54 74 69 6E 67 20 61 20 67 72 6F 75 70 20    SETting a group 
005510:  6F 66 20 62 69 74 73 20 69 6E 20 74 68 65 41 63    of bits in theAc
005520:  63 75 6D 75 6C 61 74 48 9C 6F 72 2E A3 20 49 6E    cumulatH.or.£ In
005530:  20 74 68 65 20 58 4F 52 20 20 28 65 58 63 6C 75     the XOR  (eXclu
005540:  73 69 76 65 20 4F 52 29 20 69 6E 73 74 72 75 63    sive OR) instruc
005550:  74 69 6F 6E 2C 69 66 20 74 68 65 20 20 62 69 74    tion,if the  bit
005560:  20 69 6E 20 74 68 65 20 20 41 63 63 75 6D 75 6C     in the  Accumul
005570:  61 74 6F 72 20 20 69 73 20 20 74 68 65 73 61 6D    ator  is  thesam
005580:  65 20 61 73 20 74 68 61 74 20 69 6E 20 74 68 65    e as that in the
005590:  20 20 6E 75 6D 62 65 72 20 2C 20 20 74 68 65 6E      number ,  then
0055A0:  20 20 74 68 65 63 6F 72 72 65 73 70 6F 6E 64 69      thecorrespondi
0055B0:  6E 67 20 20 62 69 74 20 69 6E 20 74 68 65 20 72    ng  bit in the r
0055C0:  65 73 75 6C 74 20 77 69 6C 6C 20 62 65 22 30 22    esult will be"0"
0055D0:  2E 20 20 49 66 20 74 68 65 79 20 61 72 65 20 20    .  If they are  
0055E0:  64 69 66 66 65 72 65 6E 74 20 69 74 20 20 77 69    different it  wi
0055F0:  6C 6C 20 62 65 22 31 22 2E 20 41 6E 6F 74 68 65    ll be"1". Anothe
005600:  72 20 77 61 79 20 6F 66 20 6C 6F 6F 6B 69 6E 67    r way of looking
005610:  20 61 74 20 20 74 68 65 20 20 58 4F 52 69 6E 73     at  the  XORins
005620:  74 72 75 63 74 69 6F 6E 20 A6 5D 69 73 20 20 69    truction .]is  i
005630:  66 20 20 6F 6E 65 20 20 4F 52 20 74 68 65 20 6F    f  one  OR the o
005640:  74 68 65 72 20 69 73 22 31 22 20 62 75 74 20 20    ther is"1" but  
005650:  4E 4F 54 20 20 62 6F 74 68 2C 20 20 74 68 65 20    NOT  both,  the 
005660:  20 61 6E 73 77 65 72 20 77 69 6C 6C 20 62 65 22     answer will be"
005670:  31 22 2E A0 A0 20 69 2E 65 2E 20 20 20 20 20 20    1"... i.e.      
005680:  30 31 31 30 31 31 30 30 A0 20 20 20 20 20 20 20    01101100.       
005690:  20 20 20 20 30 31 30 31 30 31 31 30 20 20 20 20        01010110    
0056A0:  58 4F 52 65 64 20 74 6F 67 65 74 68 65 72 A0 20    XORed together. 
0056B0:  67 69 76 65 20 20 20 20 20 20 30 30 31 31 31 30    give      001110
0056C0:  31 30 A0 A0 20 41 70 61 72 74 20 20 66 72 6F 6D    10.. Apart  from
0056D0:  20 20 70 65 72 66 6F 72 6D 69 6E 67 20 74 68 65      performing the
0056E0:  20 6C 6F 67 69 63 61 6C 20 58 4F 52 66 75 6E 63     logical XORfunc
0056F0:  74 69 6F 6E 20 20 6F 6E 20 20 6F 75 72 20 20 6F    tion  on  our  o
005700:  77 6E 20 20 66 6C 61 67 73 20 20 20 74 68 65 20    wn  flags   the 
005710:  20 58 4F 52 69 6E 73 74 72 75 63 74 69 6F 6E 20     XORinstruction 
005720:  20 20 69 73 20 20 75 73 65 66 75 FE 9C 6C 20 20      is  usefu..l  
005730:  20 69 6E 20 20 69 6E 76 65 72 74 69 6E 67 69 6E     in  invertingin
005740:  64 69 76 69 64 75 61 6C 20 6F 72 20 67 72 6F 75    dividual or grou
005750:  70 73 20 6F 66 20 62 69 74 73 2E A3 20 54 68 65    ps of bits.£ The
005760:  20 74 68 72 65 65 20 6C 6F 67 69 63 61 6C 20 69     three logical i
005770:  6E 73 74 72 75 63 74 69 6F 6E 73 20 41 4E 44 2C    nstructions AND,
005780:  20 4F 52 2C 61 6E 64 20 20 58 4F 52 20 20 61 66     OR,and  XOR  af
005790:  66 65 63 74 20 20 74 68 65 20 20 5A 65 72 6F 2C    fect  the  Zero,
0057A0:  20 20 53 69 67 6E 2C 20 20 61 6E 64 50 61 72 69      Sign,  andPari
0057B0:  74 79 20 66 6C 61 67 73 2E 20 54 68 65 20 43 61    ty flags. The Ca
0057C0:  72 72 79 20 66 6C 61 67 20 69 73 20 72 65 73 65    rry flag is rese
0057D0:  74 20 74 6F 22 30 22 20 69 6E 20 61 6C 6C 20 63    t to"0" in all c
0057E0:  61 73 65 73 2E 20 54 68 75 73 20 74 68 65 20 6C    ases. Thus the l
0057F0:  69 6D 69 74 61 74 69 6F 6E 20 6F 66 6E 6F 20 20    imitation ofno  
005800:  20 43 6C 65 61 72 20 20 43 61 72 72 79 20 20 69     Clear  Carry  i
005810:  6E 73 74 72 75 63 74 69 6F 6E 20 20 20 63 61 6E    nstruction   can
005820:  20 20 62 65 70 65 72 66 6F 72 6D 65 64 6C AF 20      beperformedl. 
005830:  62 79 20 61 20 6C 6F 67 69 63 61 6C 20 69 6E 73    by a logical ins
005840:  74 72 75 63 74 69 6F 6E 2E A0 A0 20 41 4E 44 20    truction... AND 
005850:  41 20 6F 72 20 4F 52 20 41 20 77 69 6C 6C 20 63    A or OR A will c
005860:  6C 65 61 72 20 74 68 65 20 63 61 72 72 79 20 66    lear the carry f
005870:  6C 61 67 61 6E 64 20 6E 6F 74 20 61 66 66 65 63    lagand not affec
005880:  74 20 61 6E 79 20 72 65 67 69 73 74 65 72 73 2E    t any registers.
005890:  20 58 4F 52 20 41 20 77 69 6C 6C 63 6C 65 61 72     XOR A willclear
0058A0:  20 43 61 72 72 79 20 61 6E 64 20 74 68 65 20 41     Carry and the A
0058B0:  63 63 75 6D 75 6C 61 74 6F 72 2E A3 20 53 75 6D    ccumulator.£ Sum
0058C0:  6D 61 72 79 20 2D 20 6C 6F 67 69 63 61 6C 20 69    mary - logical i
0058D0:  6E 73 74 72 75 63 74 69 6F 6E 73 A0 A0 20 41 4E    nstructions.. AN
0058E0:  44 20 6E A0 20 41 4E 44 20 72 A0 20 41 4E 44 20    D n. AND r. AND 
0058F0:  28 48 4C 29 A0 A0 20 4F 52 20 6E A0 20 4F 52 20    (HL).. OR n. OR 
005900:  72 A0 20 4F 52 20 28 48 4C 29 A0 A0 20 58 4F 52    r. OR (HL).. XOR
005910:  20 6E A0 20 58 4F 52 20 72 A0 20 58 4F 52 20 28     n. XOR r. XOR (
005920:  48 4C 29 A3 20 20 20 20 45 58 41 4D 50 4C 45 7B    HL)£    EXAMPLE{
005930:  6F 53 20 4F 46 20 4C 4F 47 49 43 41 4C 20 49 4E    oS OF LOGICAL IN
005940:  53 54 52 55 43 54 49 4F 4E 53 A0 A0 20 54 68 65    STRUCTIONS.. The
005950:  20 65 78 61 6D 70 6C 65 73 20 69 6C 6C 75 73 74     examples illust
005960:  72 61 74 65 20 20 74 68 65 20 20 6F 70 65 72 61    rate  the  opera
005970:  74 69 6F 6E 6F 66 20 20 74 68 65 20 20 6C 6F 67    tionof  the  log
005980:  69 63 20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73    ic  instructions
005990:  2E 20 20 54 68 65 20 70 75 70 69 6C 73 68 6F 75    .  The pupilshou
0059A0:  6C 64 20 20 20 74 65 73 74 20 20 20 68 69 73 2F    ld   test   his/
0059B0:  68 65 72 20 20 20 20 75 6E 64 65 72 73 74 61 6E    her    understan
0059C0:  64 69 6E 67 66 75 72 74 68 65 72 20 62 79 20 6D    dingfurther by m
0059D0:  6F 64 69 66 79 69 6E 67 20 74 68 65 20 63 6F 6E    odifying the con
0059E0:  74 65 6E 74 73 20 6F 66 20 74 68 65 33 20 73 74    tents of the3 st
0059F0:  6F 72 65 73 2E A3 20 4C 44 20 48 4C 2C 53 54 32    ores.£ LD HL,ST2
005A00:  A0 20 20 4C 44 20 41 2C 28 53 54 31 29 A0 20 20    .  LD A,(ST1).  
005A10:  41 4E 44 20 28 48 4C 29 A0 20 20 4C 44 20 28 53    AND (HL).  LD (S
005A20:  54 33 29 2C 41 A0 20 20 4C 44 20 41 2C 28 53 54    T3),A.  LD A,(ST
005A30:  31 92 E4 29 A0 20 20 4F 52 20 28 48 4C 29 A0 20    1..).  OR (HL). 
005A40:  20 4C 44 20 28 53 54 33 29 2C 41 A0 20 20 4C 44     LD (ST3),A.  LD
005A50:  20 41 2C 28 53 54 31 29 A0 20 20 58 4F 52 20 28     A,(ST1).  XOR (
005A60:  48 4C 29 A0 20 20 4C 44 20 28 53 54 33 29 2C 41    HL).  LD (ST3),A
005A70:  A0 20 20 52 45 54 A0 20 20 A0 20 53 54 31 20 20    .  RET.  . ST1  
005A80:  20 42 49 4E 20 36 35 48 A0 20 53 54 32 20 20 20     BIN 65H. ST2   
005A90:  42 49 4E 20 46 48 A0 20 53 54 33 20 20 20 42 49    BIN FH. ST3   BI
005AA0:  4E 20 30 48 A0 20 20 A0 20 20 20 20 20 20 20 20    N 0H.  .        
005AB0:  20 20 20 20 53 48 49 46 54 20 49 4E 53 54 52 55        SHIFT INSTRU
005AC0:  43 54 49 4F 4E 53 A0 A0 20 41 20 73 68 69 66 74    CTIONS.. A shift
005AD0:  20 69 6E 73 74 72 75 63 74 69 6F 6E 20 69 73 20     instruction is 
005AE0:  6F 6E 65 20 69 6E 20 77 68 69 63 68 20 74 68 65    one in which the
005AF0:  62 69 74 73 20 6F 66 20 20 61 20 20 72 65 67 69    bits of  a  regi
005B00:  73 74 65 72 20 6F 72 20 20 6D 65 6D 6F 72 79 20    ster or  memory 
005B10:  6C 6F 63 61 74 69 6F 6E 61 72 65 20 6D 6F 76 65    locationare move
005B20:  64 20 73 69 64 65 77 61 79 73 2C 20 6C 65 66 74    d sideways, left
005B30:  20 6F 72 C3 04 20 72 69 67 68 74 20 74 6F 20 74     or.. right to t
005B40:  68 65 61 64 6A 61 63 65 6E 74 20 62 69 74 2E 20    headjacent bit. 
005B50:  20 41 73 20 20 77 65 20 20 73 68 61 6C 6C 20 20     As  we  shall  
005B60:  73 65 65 2C 20 20 74 68 69 73 67 69 76 65 73 20    see,  thisgives 
005B70:  75 73 20 61 20 6D 65 61 6E 73 20 20 6F 66 20 64    us a means  of d
005B80:  69 76 69 73 69 6F 6E 20 61 73 20 77 65 6C 6C 20    ivision as well 
005B90:  61 73 6D 75 6C 74 69 70 6C 69 63 61 74 69 6F 6E    asmultiplication
005BA0:  2E A3 20 54 68 65 20 20 53 52 41 20 72 2C 20 20    .£ The  SRA r,  
005BB0:  61 6E 64 20 20 53 52 41 20 28 48 4C 29 20 69 6E    and  SRA (HL) in
005BC0:  73 74 72 75 63 74 69 6F 6E 73 73 68 69 66 74 20    structionsshift 
005BD0:  74 68 65 20 20 72 65 67 69 73 74 65 72 2F 6D 65    the  register/me
005BE0:  6D 6F 72 79 20 6C 6F 63 61 74 69 6F 6E 20 28 48    mory location (H
005BF0:  4C 29 72 69 67 68 74 2C 20 20 73 68 69 66 74 69    L)right,  shifti
005C00:  6E 67 20 20 62 69 74 20 30 20 20 69 6E 74 6F 20    ng  bit 0  into 
005C10:  20 74 68 65 20 43 61 72 72 79 66 6C 61 67 20 61     the Carryflag a
005C20:  6E 64 20 72 65 74 61 69 6E 69 6E 67 20 74 68 65    nd retaining the
005C30:  20 73 74 61 74 E1 59 65 20 6F 66 20 62 69 74 20     stat.Ye of bit 
005C40:  37 2E A0 A0 20 69 2E 65 2E 20 20 20 20 37 20 36    7... i.e.    7 6
005C50:  20 35 20 34 20 33 20 32 20 31 20 30 20 20 20 43     5 4 3 2 1 0   C
005C60:  A0 20 20 20 20 20 20 20 20 20 30 20 31 20 31 20    .         0 1 1 
005C70:  30 20 30 20 30 20 31 20 30 20 20 20 78 20 20 28    0 0 0 1 0   x  (
005C80:  39 38 20 64 65 63 2E 29 20 62 65 63 6F 6D 65 73    98 dec.) becomes
005C90:  20 20 30 20 30 20 31 20 31 20 30 20 30 20 30 20      0 0 1 1 0 0 0 
005CA0:  31 20 20 20 30 20 20 28 34 39 20 64 65 63 2E 29    1   0  (49 dec.)
005CB0:  20 A0 20 20 6F 72 20 20 20 20 20 31 20 31 20 31     .  or     1 1 1
005CC0:  20 30 20 30 20 30 20 31 20 30 20 20 20 78 20 20     0 0 0 1 0   x  
005CD0:  28 2D 33 30 20 64 65 63 2E 29 62 65 63 6F 6D 65    (-30 dec.)become
005CE0:  73 20 20 31 20 31 20 31 20 31 20 30 20 30 20 30    s  1 1 1 1 0 0 0
005CF0:  20 31 20 20 20 30 20 20 28 2D 31 35 20 64 65 63     1   0  (-15 dec
005D00:  2E 29 A0 20 48 65 6E 63 65 20 20 20 74 68 65 20    .). Hence   the 
005D10:  20 20 53 52 41 20 20 20 6F 72 20 20 20 20 53 68      SRA   or    Sh
005D20:  69 66 74 20 20 20 52 69 67 68 74 41 72 69 74 68    ift   RightArith
005D30:  6D 65 74 69 63 61 6C 38 80 6C 79 20 69 6E 73 74    metical8.ly inst
005D40:  72 75 63 74 69 6F 6E 20 64 69 76 69 64 65 73 20    ruction divides 
005D50:  20 62 6F 74 68 70 6F 73 69 74 69 76 65 20 61 6E     bothpositive an
005D60:  64 20 6E 65 67 61 74 69 76 65 20 6E 75 6D 62 65    d negative numbe
005D70:  72 73 20 62 79 20 32 2E A3 20 54 68 65 20 20 53    rs by 2.£ The  S
005D80:  52 4C 20 72 2C 20 20 61 6E 64 20 20 53 52 4C 20    RL r,  and  SRL 
005D90:  28 48 4C 29 20 69 6E 73 74 72 75 63 74 69 6F 6E    (HL) instruction
005DA0:  73 73 68 69 66 74 20 20 20 74 68 65 20 20 20 72    sshift   the   r
005DB0:  65 67 69 73 74 65 72 2F 6D 65 6D 6F 72 79 20 20    egister/memory  
005DC0:  20 6C 6F 63 61 74 69 6F 6E 63 6F 6E 74 65 6E 74     locationcontent
005DD0:  73 20 72 69 67 68 74 2C 20 73 68 69 66 74 69 6E    s right, shiftin
005DE0:  67 20 20 62 69 74 20 30 20 69 6E 74 6F 20 74 68    g  bit 0 into th
005DF0:  65 43 61 72 72 79 20 66 6C 61 67 20 61 6E 64 20    eCarry flag and 
005E00:  61 20 22 30 22 20 69 6E 74 6F 20 62 69 74 20 37    a "0" into bit 7
005E10:  2E A0 A0 20 69 2E 65 2E 20 20 20 20 37 20 36 20    ... i.e.    7 6 
005E20:  35 20 34 20 33 20 32 20 31 20 30 20 20 20 43 A0    5 4 3 2 1 0   C.
005E30:  20 20 20 20 20 20 20 20 20 46 35 31 20 30 20 31             F51 0 1
005E40:  20 31 20 30 20 31 20 31 20 31 20 20 20 78 20 20     1 0 1 1 1   x  
005E50:  28 31 38 33 20 64 65 63 2E 29 62 65 63 6F 6D 65    (183 dec.)become
005E60:  73 20 20 30 20 31 20 30 20 31 20 31 20 30 20 31    s  0 1 0 1 1 0 1
005E70:  20 31 20 20 20 31 20 20 28 39 31 20 64 65 63 2E     1   1  (91 dec.
005E80:  29 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    )               
005E90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
005EA0:  61 6E 64 20 43 61 72 72 79 20 A0 20 54 68 65 20    and Carry . The 
005EB0:  20 53 52 4C 20 20 20 6F 72 20 20 20 53 68 69 66     SRL   or   Shif
005EC0:  74 20 20 52 69 67 68 74 20 20 4C 6F 67 69 63 61    t  Right  Logica
005ED0:  6C 6C 79 69 6E 73 74 72 75 63 74 69 6F 6E 20 74    llyinstruction t
005EE0:  68 65 72 65 66 6F 72 65 20 64 69 76 69 64 65 73    herefore divides
005EF0:  20 61 20 70 6F 73 69 74 69 76 65 6E 75 6D 62 65     a positivenumbe
005F00:  72 20 62 79 20 32 2E 20 20 41 73 20 77 69 74 68    r by 2.  As with
005F10:  20 53 52 41 20 74 68 65 20 43 61 72 72 79 20 66     SRA the Carry f
005F20:  6C 61 67 69 6E 64 69 63 61 74 65 73 20 74 68 65    lagindicates the
005F30:  20 68 61 6C 66 2E A3 20 54 68 65 CC 71 20 20 53     half.£ The.q  S
005F40:  4C 41 20 72 2C 20 20 61 6E 64 20 20 53 4C 41 20    LA r,  and  SLA 
005F50:  28 48 4C 29 20 69 6E 73 74 72 75 63 74 69 6F 6E    (HL) instruction
005F60:  73 73 68 69 66 74 20 20 74 68 65 20 72 65 67 69    sshift  the regi
005F70:  73 74 65 72 2F 6D 65 6D 6F 72 79 20 63 6F 6E 74    ster/memory cont
005F80:  65 6E 74 73 20 6C 65 66 74 73 68 69 66 74 69 6E    ents leftshiftin
005F90:  67 20 61 20 22 30 22 20 69 6E 74 6F 20 62 69 74    g a "0" into bit
005FA0:  20 30 20 61 6E 64 20 62 69 74 20 37 20 69 6E 74     0 and bit 7 int
005FB0:  6F 74 68 65 20 43 61 72 72 79 20 66 6C 61 67 2E    othe Carry flag.
005FC0:  A0 A0 20 69 2E 65 2E 20 20 20 20 43 20 20 20 37    .. i.e.    C   7
005FD0:  20 36 20 35 20 34 20 33 20 32 20 31 20 30 A0 20     6 5 4 3 2 1 0. 
005FE0:  20 20 20 20 20 20 20 20 78 20 20 20 30 20 31 20            x   0 1 
005FF0:  31 20 30 20 30 20 30 20 31 20 30 20 20 28 39 38    1 0 0 0 1 0  (98
006000:  20 64 65 63 2E 29 A0 62 65 63 6F 6D 65 73 20 20     dec.).becomes  
006010:  30 20 20 20 31 20 31 20 30 20 30 20 30 20 31 20    0   1 1 0 0 0 1 
006020:  30 20 30 20 20 28 31 39 36 20 64 65 63 2E 29 A0    0 0  (196 dec.).
006030:  20 48 65 6E 63 65 20 74 68 65 20 72 65 D0 B3 73     Hence the re..s
006040:  75 6C 74 20 6F 66 20 74 68 65 20 69 6E 73 74 72    ult of the instr
006050:  75 63 74 69 6F 6E 20 53 4C 41 6F 72 20 20 20 53    uction SLAor   S
006060:  68 69 66 74 20 20 4C 65 66 74 20 20 41 72 69 74    hift  Left  Arit
006070:  68 6D 65 74 69 63 61 6C 6C 79 20 20 69 73 20 20    hmetically  is  
006080:  74 6F 6D 75 6C 74 69 70 6C 79 20 20 74 68 65 20    tomultiply  the 
006090:  20 70 6F 73 69 74 69 76 65 20 6E 75 6D 62 65 72     positive number
0060A0:  20 62 79 20 32 2E 20 54 68 65 43 61 72 72 79 20     by 2. TheCarry 
0060B0:  20 69 6E 64 69 63 61 74 65 73 20 20 61 20 20 72     indicates  a  r
0060C0:  65 73 75 6C 74 20 67 72 65 61 74 65 72 20 74 68    esult greater th
0060D0:  61 6E 32 35 35 2E A0 A0 41 6C 6C 20 74 68 65 73    an255...All thes
0060E0:  65 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20 20    e instructions  
0060F0:  61 66 66 65 63 74 20 20 6E 6F 74 20 6F 6E 6C 79    affect  not only
006100:  74 68 65 20 43 61 72 72 79 20 66 6C 61 67 2C 20    the Carry flag, 
006110:  20 62 75 74 20 74 68 65 20 5A 65 72 6F 2C 20 53     but the Zero, S
006120:  69 67 6E 2C 20 61 6E 64 50 61 72 69 74 79 20 66    ign, andParity f
006130:  6C 61 67 73 2E A3 20 53 75 6D 6D 61 72 79 20 E0    lags.£ Summary .
006140:  FA 2D 20 73 68 69 66 74 20 69 6E 73 74 72 75 63    .- shift instruc
006150:  74 69 6F 6E 73 A0 A0 20 53 52 41 20 72 20 20 64    tions.. SRA r  d
006160:  69 76 69 64 65 73 20 2B 76 65 20 61 6E 64 20 2D    ivides +ve and -
006170:  76 65 20 6E 75 6D 62 65 72 73 20 62 79 20 32 A0    ve numbers by 2.
006180:  20 53 52 41 20 28 48 4C 29 A0 A0 20 53 52 4C 20     SRA (HL).. SRL 
006190:  72 20 20 64 69 76 69 64 65 73 20 2B 76 65 20 6E    r  divides +ve n
0061A0:  75 6D 62 65 72 73 20 30 20 2D 20 32 35 35 20 62    umbers 0 - 255 b
0061B0:  79 20 32 A0 20 53 52 4C 20 28 48 4C 29 A0 A0 20    y 2. SRL (HL).. 
0061C0:  53 4C 41 20 72 20 20 6D 75 6C 74 69 70 6C 69 65    SLA r  multiplie
0061D0:  73 20 2B 76 65 20 61 6E 64 20 2D 76 65 20 6E 75    s +ve and -ve nu
0061E0:  6D 62 65 72 73 A0 20 20 20 20 20 20 20 20 20 20    mbers.          
0061F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006200:  20 20 20 20 20 20 20 20 20 20 62 79 20 32 A0 20              by 2. 
006210:  53 4C 41 20 28 48 4C 29 A3 20 20 20 20 45 58 41    SLA (HL)£    EXA
006220:  4D 50 4C 45 53 20 4F 46 20 53 48 49 46 54 20 49    MPLES OF SHIFT I
006230:  4E 53 54 52 55 43 54 49 4F 4E 53 A0 A0 20 54 68    NSTRUCTIONS.. Th
006240:  65 36 7F 20 20 20 74 68 72 65 65 20 20 20 73 68    e6.   three   sh
006250:  69 66 74 20 20 69 6E 73 74 72 75 63 74 69 6F 6E    ift  instruction
006260:  73 20 20 20 61 72 65 69 6C 6C 75 73 74 72 61 74    s   areillustrat
006270:  65 64 20 20 75 73 69 6E 67 20 61 20 66 69 78 65    ed  using a fixe
006280:  64 20 69 6E 69 74 69 61 6C 20 76 61 6C 75 65 69    d initial valuei
006290:  6E 20 74 68 65 20 6D 65 6D 6F 72 79 20 6C 6F 63    n the memory loc
0062A0:  61 74 69 6F 6E 20 53 54 4F 52 45 2E A3 20 4C 44    ation STORE.£ LD
0062B0:  20 48 4C 2C 53 54 4F 52 45 A0 20 20 4C 44 20 42     HL,STORE.  LD B
0062C0:  2C 35 A0 20 4C 4F 4F 50 31 20 53 52 41 20 28 48    ,5. LOOP1 SRA (H
0062D0:  4C 29 A0 20 20 44 4A 4E 5A 20 4C 4F 4F 50 31 A0    L).  DJNZ LOOP1.
0062E0:  20 20 4C 44 20 28 48 4C 29 2C 41 35 48 A0 20 20      LD (HL),A5H.  
0062F0:  4C 44 20 42 2C 35 A0 20 4C 4F 4F 50 32 20 53 4C    LD B,5. LOOP2 SL
006300:  41 20 28 48 4C 29 A0 20 20 44 4A 4E 5A 20 4C 4F    A (HL).  DJNZ LO
006310:  4F 50 32 A0 20 20 4C 44 20 42 2C 38 A0 20 4C 4F    OP2.  LD B,8. LO
006320:  4F 50 33 20 53 52 4C 20 28 48 4C 29 A0 20 20 44    OP3 SRL (HL).  D
006330:  4A 4E 5A 20 4C 4F 4F 50 33 A0 20 20 52 45 54 A0    JNZ LOOP3.  RET.
006340:  20 20 A0 A3 4D 20 53 54 4F 52 45 20 42 49 4E 20      .£M STORE BIN 
006350:  36 39 48 A0 20 20 A0 20 20 A0 20 20 20 20 20 20    69H.  .  .      
006360:  20 20 20 20 20 20 52 4F 54 41 54 45 20 49 4E 53          ROTATE INS
006370:  54 52 55 43 54 49 4F 4E 53 A0 A0 20 54 68 65 73    TRUCTIONS.. Thes
006380:  65 20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20    e  instructions 
006390:  61 72 65 20 73 68 69 66 74 20 69 6E 73 74 72 75    are shift instru
0063A0:  63 74 2D 69 6F 6E 73 20 69 6E 20 77 68 69 63 68    ct-ions in which
0063B0:  20 74 68 65 20 62 69 74 20 74 68 61 74 20 66 61     the bit that fa
0063C0:  6C 6C 73 20 6F 75 74 20 6F 6E 65 65 6E 64 20 6F    lls out oneend o
0063D0:  66 20 74 68 65 20 72 65 67 69 73 74 65 72 20 20    f the register  
0063E0:  6F 72 20 6D 65 6D 6F 72 79 20 20 6C 6F 63 61 74    or memory  locat
0063F0:  69 6F 6E 69 73 20 70 75 73 68 65 64 20 62 61 63    ionis pushed bac
006400:  6B 20 69 6E 74 6F 20 74 68 65 20 20 6F 74 68 65    k into the  othe
006410:  72 20 65 6E 64 2E 20 20 54 68 65 43 61 72 72 79    r end.  TheCarry
006420:  20 66 6C 61 67 20 20 65 69 74 68 65 72 20 20 66     flag  either  f
006430:  6F 72 6D 73 20 20 70 61 72 74 20 20 6F 66 20 20    orms  part  of  
006440:  74 68 65 6E 75 9C 85 6D 62 65 72 20 73 68 69 66    thenu..mber shif
006450:  74 65 64 2C 20 74 68 65 72 65 62 79 20 6D 61 6B    ted, thereby mak
006460:  69 6E 67 20 69 74 20 39 20 62 69 74 73 6C 6F 6E    ing it 9 bitslon
006470:  67 2C 20 6F 72 20 64 75 70 6C 69 63 61 74 65 73    g, or duplicates
006480:  20 74 68 65 20 73 74 61 74 65 20 6F 66 20 74 68     the state of th
006490:  65 20 62 69 74 74 68 61 74 20 66 65 6C 6C 20 6F    e bitthat fell o
0064A0:  75 74 20 6F 66 20 74 68 65 20 72 65 67 69 73 74    ut of the regist
0064B0:  65 72 2E 20 54 68 65 72 65 20 61 72 65 74 68 65    er. There arethe
0064C0:  72 65 66 6F 72 65 20 20 20 66 6F 75 72 20 20 20    refore   four   
0064D0:  64 69 66 66 65 72 65 6E 74 20 20 20 74 79 70 65    different   type
0064E0:  73 20 20 6F 66 72 6F 74 61 74 65 2E A3 20 52 4C    s  ofrotate.£ RL
0064F0:  43 20 72 2C 20 61 6E 64 20 52 4C 43 20 28 48 4C    C r, and RLC (HL
006500:  29 20 28 6E 61 6D 65 6C 79 20 52 6F 74 61 74 65    ) (namely Rotate
006510:  20 4C 65 66 74 43 61 72 72 79 20 64 75 70 6C 69     LeftCarry dupli
006520:  63 61 74 69 6E 67 20 29 2C 20 73 68 69 66 74 73    cating ), shifts
006530:  20 74 68 65 20 63 6F 6E 74 65 6E 74 73 6C 65 66     the contentslef
006540:  74 2C 20 62 69 74 20 D9 55 37 20 72 6F 74 61 74    t, bit .U7 rotat
006550:  69 6E 67 20 69 6E 74 6F 20 62 69 74 20 30 2C 20    ing into bit 0, 
006560:  61 6E 64 20 74 68 65 43 61 72 72 79 20 64 75 70    and theCarry dup
006570:  6C 69 63 61 74 69 6E 67 20 74 68 65 20 74 72 61    licating the tra
006580:  6E 73 66 65 72 72 65 64 20 62 69 74 2E A0 A0 20    nsferred bit... 
006590:  69 2E 65 2E 20 20 20 20 43 20 20 37 20 36 20 35    i.e.    C  7 6 5
0065A0:  20 34 20 33 20 32 20 31 20 30 A0 20 20 20 20 20     4 3 2 1 0.     
0065B0:  20 20 20 20 78 20 20 31 20 30 20 31 20 31 20 30        x  1 0 1 1 0
0065C0:  20 30 20 30 20 31 A0 62 65 63 6F 6D 65 73 20 20     0 0 1.becomes  
0065D0:  31 20 20 30 20 31 20 31 20 30 20 30 20 30 20 31    1  0 1 1 0 0 0 1
0065E0:  20 31 20 20 6F 6C 64 20 62 69 74 20 37 3D 31 A0     1  old bit 7=1.
0065F0:  20 52 4C 20 72 2C 20 61 6E 64 20 52 4C 20 28 48     RL r, and RL (H
006600:  4C 29 20 20 52 6F 74 61 74 65 20 4C 65 66 74 2C    L)  Rotate Left,
006610:  20 72 6F 74 61 74 65 73 74 68 65 20 20 72 65 67     rotatesthe  reg
006620:  69 73 74 65 72 2F 6D 65 6D 6F 72 79 20 6C 6F 63    ister/memory loc
006630:  61 74 69 6F 6E 20 20 77 69 74 68 20 20 74 68 65    ation  with  the
006640:  43 61 72 72 79 20 61 73 20 69 C2 61 20 39 74 68    Carry as i.a 9th
006650:  20 62 69 74 2C 20 6C 65 66 74 2E A0 A0 20 69 2E     bit, left... i.
006660:  65 2E 20 20 20 20 43 20 20 37 20 36 20 35 20 34    e.    C  7 6 5 4
006670:  20 33 20 32 20 31 20 30 A0 20 20 20 20 20 20 20     3 2 1 0.       
006680:  20 20 63 20 20 31 20 30 20 31 20 31 20 30 20 30      c  1 0 1 1 0 0
006690:  20 30 20 31 A0 62 65 63 6F 6D 65 73 20 20 31 20     0 1.becomes  1 
0066A0:  20 30 20 31 20 31 20 30 20 30 20 30 20 31 20 63     0 1 1 0 0 0 1 c
0066B0:  20 20 63 3D 6F 6C 64 20 43 61 72 72 79 A0 20 52      c=old Carry. R
0066C0:  4C 20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20    L  instructions 
0066D0:  63 61 6E 20 62 65 20 73 74 72 75 6E 67 20 74 6F    can be strung to
0066E0:  67 65 74 68 65 72 74 6F 20 6D 75 6C 74 69 70 6C    getherto multipl
0066F0:  79 20 20 61 6E 79 20 20 6C 65 6E 67 74 68 20 20    y  any  length  
006700:  6E 75 6D 62 65 72 20 20 62 79 20 20 32 2C 73 69    number  by  2,si
006710:  6E 63 65 20 74 68 65 20 20 43 61 72 72 79 20 20    nce the  Carry  
006720:  69 73 20 74 72 61 6E 73 66 65 72 72 65 64 20 62    is transferred b
006730:  65 74 77 65 65 6E 72 65 70 65 61 74 65 64 20 52    etweenrepeated R
006740:  4C 20 69 6E 73 74 72 75 63 74 69 FF C6 6F 6E 73    L instructi..ons
006750:  2E A3 20 52 52 43 20 72 2C 20 20 52 52 43 20 28    .£ RRC r,  RRC (
006760:  48 4C 29 20 20 69 6E 73 74 72 75 63 74 69 6F 6E    HL)  instruction
006770:  73 20 20 28 52 6F 74 61 74 65 52 69 67 68 74 20    s  (RotateRight 
006780:  43 61 72 72 79 20 62 65 69 6E 67 20 64 75 70 6C    Carry being dupl
006790:  69 63 61 74 65 64 29 20 69 73 20 73 69 6D 69 6C    icated) is simil
0067A0:  61 72 74 6F 20 74 68 65 20 20 52 4C 43 20 20 69    arto the  RLC  i
0067B0:  6E 73 74 72 75 63 74 69 6F 6E 20 20 62 75 74 20    nstruction  but 
0067C0:  69 73 20 61 20 72 69 67 68 74 73 68 69 66 74 2E    is a rightshift.
0067D0:  20 20 42 69 74 20 30 20 69 73 20 20 73 68 69 66      Bit 0 is  shif
0067E0:  74 65 64 20 69 6E 74 6F 20 62 69 74 20 37 20 61    ted into bit 7 a
0067F0:  6E 64 74 68 65 20 43 61 72 72 79 20 64 75 70 6C    ndthe Carry dupl
006800:  69 63 61 74 65 73 20 74 68 65 20 6F 6C 64 20 62    icates the old b
006810:  69 74 20 30 2E A0 A0 20 69 2E 65 2E 20 20 20 20    it 0... i.e.    
006820:  37 20 36 20 35 20 34 20 33 20 32 20 31 20 30 20    7 6 5 4 3 2 1 0 
006830:  20 43 A0 20 20 20 20 20 20 20 20 20 31 20 30 20     C.         1 0 
006840:  31 20 31 20 30 20 30 20 30 20 31 20 20 E3 CE 78    1 1 0 0 0 1  ..x
006850:  A0 62 65 63 6F 6D 65 73 20 20 31 20 31 20 30 20    .becomes  1 1 0 
006860:  31 20 31 20 30 20 30 20 30 20 20 31 20 20 6F 6C    1 1 0 0 0  1  ol
006870:  64 20 62 69 74 20 30 3D 31 A0 20 52 52 20 72 2C    d bit 0=1. RR r,
006880:  20 61 6E 64 20 52 52 20 28 48 4C 29 20 69 6E 73     and RR (HL) ins
006890:  74 72 75 63 74 69 6F 6E 73 20 28 20 52 6F 74 61    tructions ( Rota
0068A0:  74 65 52 69 67 68 74 20 29 20 69 73 20 73 69 6D    teRight ) is sim
0068B0:  69 6C 61 72 20 74 6F 20 52 4C 20 65 78 63 65 70    ilar to RL excep
0068C0:  74 20 74 68 61 74 20 74 68 65 73 68 69 66 74 20    t that theshift 
0068D0:  61 72 6F 75 6E 64 20 74 68 65 20 39 20 62 69 74    around the 9 bit
0068E0:  73 20 69 73 20 74 6F 20 74 68 65 20 72 69 67 68    s is to the righ
0068F0:  74 2E A0 20 69 2E 65 2E 20 20 20 20 37 20 36 20    t.. i.e.    7 6 
006900:  35 20 34 20 33 20 32 20 31 20 30 20 20 43 A0 20    5 4 3 2 1 0  C. 
006910:  20 20 20 20 20 20 20 20 31 20 30 20 31 20 31 20            1 0 1 1 
006920:  30 20 30 20 30 20 31 20 20 63 A0 62 65 63 6F 6D    0 0 0 1  c.becom
006930:  65 73 20 20 63 20 31 20 30 20 31 20 31 20 30 20    es  c 1 0 1 1 0 
006940:  30 20 30 20 20 31 20 20 63 3D 6F 6C 64 20 43 66    0 0  1  c=old Cf
006950:  6A 61 72 72 79 A0 20 52 52 20 69 6E 73 74 72 75    jarry. RR instru
006960:  63 74 69 6F 6E 73 20 63 61 6E 20 62 65 20 73 74    ctions can be st
006970:  72 75 6E 67 20 20 74 6F 67 65 74 68 65 72 74 6F    rung  togetherto
006980:  20 64 69 76 69 64 65 20 61 6E 79 20 6C 65 6E 67     divide any leng
006990:  74 68 20 6E 75 6D 62 65 72 20 62 79 20 32 2E A3    th number by 2.£
0069A0:  20 52 4C 43 20 61 6E 64 20 52 52 43 20 20 69 6E     RLC and RRC  in
0069B0:  73 74 72 75 63 74 69 6F 6E 73 20 61 72 65 20 75    structions are u
0069C0:  73 65 66 75 6C 20 69 6E 73 65 71 75 65 6E 74 69    seful insequenti
0069D0:  61 6C 6C 79 20 20 20 69 6E 74 65 72 72 6F 67 61    ally   interroga
0069E0:  74 69 6E 67 20 20 74 68 65 20 20 77 68 6F 6C 65    ting  the  whole
0069F0:  63 6F 6E 74 65 6E 74 73 20 6F 66 20 61 20 72 65    contents of a re
006A00:  67 69 73 74 65 72 20 77 69 74 68 6F 75 74 20 20    gister without  
006A10:  63 6F 72 72 75 70 74 2D 69 6E 67 20 69 74 73 20    corrupt-ing its 
006A20:  63 6F 6E 74 65 6E 74 73 2E A0 A0 20 41 6C 6C 20    contents... All 
006A30:  74 68 65 20 61 62 6F 76 65 20 72 6F 74 61 74 65    the above rotate
006A40:  20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20 20 52     instructions  R
006A50:  4C F7 97 43 2C 52 4C 2C 20 20 52 52 43 2C 20 61    L..C,RL,  RRC, a
006A60:  6E 64 20 20 52 52 20 20 6E 6F 74 20 20 6F 6E 6C    nd  RR  not  onl
006A70:  79 20 20 61 66 66 65 63 74 20 74 68 65 43 61 72    y  affect theCar
006A80:  72 79 20 66 6C 61 67 20 20 62 75 74 20 61 6C 73    ry flag  but als
006A90:  6F 20 20 74 68 65 20 5A 65 72 6F 2C 20 53 69 67    o  the Zero, Sig
006AA0:  6E 20 61 6E 64 50 61 72 69 74 79 20 20 20 66 6C    n andParity   fl
006AB0:  61 67 73 2C 20 20 61 73 20 20 20 68 61 76 65 20    ags,  as   have 
006AC0:  20 20 61 6C 6C 20 20 20 73 68 69 66 74 69 6E 73      all   shiftins
006AD0:  74 72 75 63 74 69 6F 6E 73 20 64 69 73 63 75 73    tructions discus
006AE0:  73 65 64 2E A0 A0 20 54 68 65 72 65 20 20 61 72    sed... There  ar
006AF0:  65 20 20 34 20 6F 74 68 65 72 20 72 6F 74 61 74    e  4 other rotat
006B00:  65 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 74 68    e instructionsth
006B10:  61 74 20 20 69 6E 76 6F 6C 76 65 20 74 68 65 20    at  involve the 
006B20:  41 63 63 75 6D 75 6C 61 74 6F 72 20 6F 6E 6C 79    Accumulator only
006B30:  2E 20 54 68 65 79 61 72 65 20 52 4C 43 41 2C 20    . Theyare RLCA, 
006B40:  20 52 4C 41 2C 20 20 52 52 43 41 2C 20 61 6E 64     RLA,  RRCA, and
006B50:  20 52 52 23 67 41 2E 20 54 68 65 79 20 61 72 65     RR#gA. They are
006B60:  69 64 65 6E 74 69 63 61 6C 20 74 6F 20 20 52 4C    identical to  RL
006B70:  43 20 41 2C 20 20 52 4C 20 41 2C 20 20 52 52 43    C A,  RL A,  RRC
006B80:  20 41 2C 20 20 61 6E 64 52 52 20 41 2C 20 62 75     A,  andRR A, bu
006B90:  74 20 6F 6E 6C 79 20 20 61 66 66 65 63 74 20 20    t only  affect  
006BA0:  74 68 65 20 20 43 61 72 72 79 20 66 6C 61 67 2C    the  Carry flag,
006BB0:  61 6E 64 20 61 72 65 20 74 77 69 63 65 20 61 73    and are twice as
006BC0:  20 66 61 73 74 2E A3 20 53 75 6D 6D 61 72 79 20     fast.£ Summary 
006BD0:  2D 20 72 6F 74 61 74 65 20 69 6E 73 74 72 75 63    - rotate instruc
006BE0:  74 69 6F 6E 73 A0 A0 20 52 4C 43 20 72 20 20 72    tions.. RLC r  r
006BF0:  6F 74 61 74 65 20 72 20 6C 65 66 74 2C 20 63 61    otate r left, ca
006C00:  72 72 79 20 20 64 75 70 6C 69 63 61 74 65 73 20    rry  duplicates 
006C10:  52 4C 43 20 28 48 4C 29 A0 20 52 4C 43 41 20 20    RLC (HL). RLCA  
006C20:  20 72 6F 74 61 74 65 20 41 20 6C 65 66 74 2C 20     rotate A left, 
006C30:  63 61 72 72 79 20 20 64 75 70 6C 69 63 61 74 65    carry  duplicate
006C40:  73 A0 20 52 4C 20 72 20 20 20 72 6F 74 61 74 65    s. RL r   rotate
006C50:  20 72 20 61 6E DB AF 64 20 63 61 72 72 79 20 6C     r an..d carry l
006C60:  65 66 74 A0 20 52 4C 20 28 48 4C 29 A0 20 52 4C    eft. RL (HL). RL
006C70:  41 20 20 20 20 72 6F 74 61 74 65 20 41 20 61 6E    A    rotate A an
006C80:  64 20 63 61 72 72 79 20 6C 65 66 74 A0 A0 20 52    d carry left.. R
006C90:  52 43 20 72 20 20 72 6F 74 61 74 65 20 72 20 72    RC r  rotate r r
006CA0:  69 67 68 74 2C 20 63 61 72 72 79 20 64 75 70 6C    ight, carry dupl
006CB0:  69 63 61 74 65 73 20 52 52 43 20 28 48 4C 29 A0    icates RRC (HL).
006CC0:  20 52 52 43 41 20 20 20 72 6F 74 61 74 65 20 41     RRCA   rotate A
006CD0:  20 72 69 67 68 74 2C 20 63 61 72 72 79 20 64 75     right, carry du
006CE0:  70 6C 69 63 61 74 65 73 A0 20 52 52 20 72 20 20    plicates. RR r  
006CF0:  20 72 6F 74 61 74 65 20 72 20 61 6E 64 20 43 61     rotate r and Ca
006D00:  72 72 79 20 72 69 67 68 74 A0 20 52 52 20 28 48    rry right. RR (H
006D10:  4C 29 A0 20 52 52 41 20 20 20 20 20 20 72 6F 74    L). RRA      rot
006D20:  61 74 65 20 41 20 61 6E 64 20 43 61 72 72 79 20    ate A and Carry 
006D30:  72 69 67 68 74 A3 20 20 20 20 45 58 41 4D 50 4C    right£    EXAMPL
006D40:  45 53 20 4F 46 20 52 4F 54 41 54 45 20 49 4E 53    ES OF ROTATE INS
006D50:  54 52 55 43 54 49 4F 1A CD 4E 53 A0 A0 20 54 68    TRUCTIO..NS.. Th
006D60:  65 73 65 20 65 78 61 6D 70 6C 65 73 20 69 6C 6C    ese examples ill
006D70:  75 73 74 72 61 74 65 20 74 68 65 20 6F 70 65 72    ustrate the oper
006D80:  61 74 69 6F 6E 6F 66 20 20 72 6F 74 61 74 65 20    ationof  rotate 
006D90:  20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 2E 20      instructions. 
006DA0:  20 20 4D 6F 64 69 66 79 20 20 74 68 65 69 6E 69      Modify  theini
006DB0:  74 69 61 6C 20 63 6F 6E 64 69 74 69 6F 6E 20 6F    tial condition o
006DC0:  66 20 74 68 65 20 6C 6F 63 61 74 69 6F 6E 20 20    f the location  
006DD0:  53 54 4F 52 45 74 6F 20 69 6E 76 65 73 74 69 67    STOREto investig
006DE0:  61 74 65 20 74 68 65 69 72 20 6F 70 65 72 61 74    ate their operat
006DF0:  69 6F 6E 20 66 75 72 74 68 65 72 2E A3 20 4C 44    ion further.£ LD
006E00:  20 48 4C 2C 53 54 4F 52 45 A0 20 20 4C 44 20 42     HL,STORE.  LD B
006E10:  2C 38 A0 20 4C 4F 4F 50 31 20 52 4C 43 20 28 48    ,8. LOOP1 RLC (H
006E20:  4C 29 A0 20 20 44 4A 4E 5A 20 4C 4F 4F 50 31 A0    L).  DJNZ LOOP1.
006E30:  20 20 4C 44 20 42 2C 38 A0 20 4C 4F 4F 50 32 20      LD B,8. LOOP2 
006E40:  52 4C 20 28 48 4C 29 A0 20 20 44 4A 4E 5A 20 4C    RL (HL).  DJNZ L
006E50:  4F 4F 50 32 A0 20 20 4C 44 A5 09 20 42 2C 38 A0    OOP2.  LD.. B,8.
006E60:  20 4C 4F 4F 50 33 20 52 52 43 20 28 48 4C 29 A0     LOOP3 RRC (HL).
006E70:  20 20 44 4A 4E 5A 20 4C 4F 4F 50 33 A0 20 20 4C      DJNZ LOOP3.  L
006E80:  44 20 42 2C 38 A0 20 4C 4F 4F 50 34 20 52 52 20    D B,8. LOOP4 RR 
006E90:  28 48 4C 29 A0 20 20 44 4A 4E 5A 20 4C 4F 4F 50    (HL).  DJNZ LOOP
006EA0:  34 A0 20 20 52 45 54 A0 20 53 54 4F 52 45 20 42    4.  RET. STORE B
006EB0:  49 4E 20 36 39 48 A0 20 20 20 A0 20 20 20 20 45    IN 69H.   .    E
006EC0:  58 41 4D 50 4C 45 20 55 53 49 4E 47 20 52 4F 54    XAMPLE USING ROT
006ED0:  41 54 45 20 41 4E 44 20 53 48 49 46 54 A0 A0 20    ATE AND SHIFT.. 
006EE0:  54 68 69 73 20 65 78 61 6D 70 6C 65 20 20 75 73    This example  us
006EF0:  65 73 20 20 73 68 69 66 74 73 20 20 61 6E 64 20    es  shifts  and 
006F00:  20 72 6F 74 61 74 65 69 6E 73 74 72 75 63 74 69     rotateinstructi
006F10:  6F 6E 73 20 20 74 6F 20 20 6D 75 6C 74 69 70 6C    ons  to  multipl
006F20:  79 20 20 74 77 6F 20 20 38 20 20 20 62 69 74 6E    y  two  8   bitn
006F30:  75 6D 62 65 72 73 20 74 6F 67 65 74 68 65 72 2E    umbers together.
006F40:  20 20 4F 6E 65 20 6E 75 6D 62 65 72 20 69 73 20      One number is 
006F50:  72 6F 74 61 74 65 64 74 6F 20 65 5C D2 78 61 6D    rotatedto e\.xam
006F60:  69 6E 65 20 20 65 61 63 68 20 62 69 74 20 69 6E    ine  each bit in
006F70:  20 74 75 72 6E 2E 20 20 54 68 65 20 6F 74 68 65     turn.  The othe
006F80:  72 6E 75 6D 62 65 72 20 69 73 20 61 6C 73 6F 20    rnumber is also 
006F90:  73 68 69 66 74 65 64 20 61 6E 64 20 20 61 64 64    shifted and  add
006FA0:  65 64 20 74 6F 20 74 68 65 74 6F 74 61 6C 20 69    ed to thetotal i
006FB0:  66 20 74 68 65 20 20 62 69 74 20 69 73 20 73 65    f the  bit is se
006FC0:  74 2E 20 54 68 69 73 20 6D 65 74 68 6F 64 20 69    t. This method i
006FD0:  73 66 61 72 20 71 75 69 63 6B 65 72 20 74 68 61    sfar quicker tha
006FE0:  6E 20 74 68 65 20 20 6D 65 74 68 6F 64 20 6F 66    n the  method of
006FF0:  20 72 65 70 65 61 74 65 64 61 64 64 69 74 69 6F     repeatedadditio
007000:  6E 2E A3 20 4C 44 20 48 4C 2C 30 A0 20 20 4C 44    n.£ LD HL,0.  LD
007010:  20 44 45 2C 28 4E 55 4D 32 29 A0 20 20 4C 44 20     DE,(NUM2).  LD 
007020:  41 2C 28 4E 55 4D 31 29 A0 20 4C 4F 4F 50 20 20    A,(NUM1). LOOP  
007030:  52 52 20 41 A0 20 20 4A 52 20 4E 43 2C 4A 50 31    RR A.  JR NC,JP1
007040:  A0 20 20 41 44 44 20 48 4C 2C 44 45 A0 20 4A 50    .  ADD HL,DE. JP
007050:  31 20 20 20 52 45 54 20 5A A0 20 20 53 C6 F7 4C    1   RET Z.  S..L
007060:  41 20 45 A0 20 20 52 4C 20 44 A0 20 20 4A 52 20    A E.  RL D.  JR 
007070:  4C 4F 4F 50 A0 20 20 A0 20 4E 55 4D 31 20 20 44    LOOP.  . NUM1  D
007080:  45 46 42 20 32 31 32 A0 20 4E 55 4D 32 20 20 44    EFB 212. NUM2  D
007090:  45 46 42 20 32 30 33 A0 20 20 44 45 46 42 20 30    EFB 203.  DEFB 0
0070A0:  A0 20 20 A0 20 20 A0 20 20 20 20 20 20 20 20 20    .  .  .         
0070B0:  20 20 20 20 20 20 44 45 43 49 4D 41 4C 20 52 4F          DECIMAL RO
0070C0:  54 41 54 45 A0 A0 20 54 68 65 20 20 5A 38 30 20    TATE.. The  Z80 
0070D0:  20 61 6C 6C 6F 77 73 20 20 75 73 20 74 6F 20 72     allows  us to r
0070E0:  6F 74 61 74 65 20 6C 65 66 74 20 61 6E 64 72 69    otate left andri
0070F0:  67 68 74 20 6E 69 62 62 6C 65 73 20 61 73 20 77    ght nibbles as w
007100:  65 6C 6C 20 61 73 20 62 69 74 73 2E A0 A0 20 52    ell as bits... R
007110:  4C 44 20 20 52 6F 74 61 74 65 73 20 74 68 65 20    LD  Rotates the 
007120:  44 65 63 69 6D 61 6C 20 6E 75 6D 62 65 72 20 4C    Decimal number L
007130:  65 66 74 A0 20 52 52 44 20 20 52 6F 74 61 74 65    eft. RRD  Rotate
007140:  73 20 74 68 65 20 44 65 63 69 6D 61 6C 20 6E 75    s the Decimal nu
007150:  6D 62 65 72 20 52 69 67 68 74 A0 A0 20 54 68 5B    mber Right.. Th[
007160:  20 65 20 20 20 62 65 73 74 20 20 20 77 61 79 20     e   best   way 
007170:  20 20 74 6F 20 20 20 64 65 73 63 72 69 62 65 20      to   describe 
007180:  20 74 68 65 73 65 6F 70 65 72 61 74 69 6F 6E 73     theseoperations
007190:  20 20 20 20 69 73 20 20 20 20 62 79 20 20 20 65        is    by   e
0071A0:  78 61 6D 70 6C 65 2E 20 20 20 42 6F 74 68 69 6E    xample.   Bothin
0071B0:  73 74 72 75 63 74 69 6F 6E 73 20 20 69 6E 76 6F    structions  invo
0071C0:  6C 76 65 20 20 74 68 65 20 20 41 63 63 75 6D 75    lve  the  Accumu
0071D0:  6C 61 74 6F 72 2C 61 6E 64 20 20 20 74 68 65 20    lator,and   the 
0071E0:  20 20 6D 65 6D 6F 72 79 20 20 6C 6F 63 61 74 69      memory  locati
0071F0:  6F 6E 20 20 28 48 4C 29 2E 20 20 54 68 65 65 78    on  (HL).  Theex
007200:  61 6D 70 6C 65 73 20 61 72 65 20 69 6E 20 20 42    amples are in  B
007210:  69 6E 61 72 79 20 43 6F 64 65 64 20 44 65 63 69    inary Coded Deci
007220:  6D 61 6C 20 6F 66 63 6F 75 72 73 65 2C 20 20 65    mal ofcourse,  e
007230:  61 63 68 20 64 69 67 69 74 20 74 61 6B 69 6E 67    ach digit taking
007240:  20 75 70 20 6F 6E 65 20 6E 69 62 62 6C 65 6F 72     up one nibbleor
007250:  20 20 66 6F 75 72 20 20 62 69 74 73 20 6F 66 20      four  bits of 
007260:  74 5F 6E 68 65 20 72 65 67 69 73 74 65 72 20 6F    t_nhe register o
007270:  72 20 6D 65 6D 6F 72 79 6C 6F 63 61 74 69 6F 6E    r memorylocation
007280:  2E A3 20 20 20 20 20 20 20 20 20 20 20 20 20 41    .£             A
007290:  20 61 66 74 65 72 20 20 20 28 48 4C 29 20 20 20     after   (HL)   
0072A0:  20 41 20 62 65 66 6F 72 65 20 A0 20 20 20 20 20     A before .     
0072B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0072C0:  20 20 35 20 34 20 20 20 20 20 20 20 20 78 20 33      5 4        x 3
0072D0:  A0 20 61 66 74 65 72 20 52 4C 44 20 20 20 20 20    . after RLD     
0072E0:  78 20 35 20 20 20 20 20 34 20 33 A0 A0 77 68 65    x 5     4 3..whe
0072F0:  72 65 20 20 78 20 69 73 20 61 6E 79 20 6E 75 6D    re  x is any num
007300:  62 65 72 20 61 6E 64 20 69 73 20 75 6E 61 66 66    ber and is unaff
007310:  65 63 74 65 64 62 79 20 74 68 65 20 69 6E 73 74    ectedby the inst
007320:  72 75 63 74 69 6F 6E 2E A0 A0 20 41 73 20 63 61    ruction... As ca
007330:  6E 20 62 65 20 20 73 65 65 6E 20 74 68 65 20 65    n be  seen the e
007340:  66 66 65 63 74 20 6F 66 20 73 74 72 69 6E 67 69    ffect of stringi
007350:  6E 67 74 6F 67 65 74 68 65 72 20 52 4C 44 20 69    ngtogether RLD i
007360:  6E 73 74 94 C0 72 75 63 74 69 6F 6E 73 20 69 73    nst..ructions is
007370:  20 74 6F 20 6D 75 6C 74 69 70 6C 79 61 20 20 64     to multiplya  d
007380:  65 63 69 6D 61 6C 20 20 6E 75 6D 62 65 72 20 20    ecimal  number  
007390:  62 79 20 20 31 30 2E 20 20 49 74 20 69 73 20 20    by  10.  It is  
0073A0:  61 6C 73 6F 75 73 65 66 75 6C 20 69 6E 20 69 73    alsouseful in is
0073B0:  6F 6C 61 74 69 6E 67 20 74 68 65 20 68 69 67 68    olating the high
0073C0:  20 64 69 67 69 74 20 20 66 72 6F 6D 74 68 65 20     digit  fromthe 
0073D0:  74 77 6F 20 64 69 67 69 74 20 6E 75 6D 62 65 72    two digit number
0073E0:  2E A3 20 20 20 20 20 20 20 20 20 20 20 20 20 41    .£             A
0073F0:  20 61 66 74 65 72 20 20 20 28 48 4C 29 20 20 20     after   (HL)   
007400:  20 41 20 62 65 66 6F 72 65 20 A0 20 20 20 20 20     A before .     
007410:  20 20 20 20 20 20 20 20 20 20 78 20 35 20 20 20              x 5   
007420:  20 20 34 20 33 A0 20 61 66 74 65 72 20 52 52 44      4 3. after RRD
007430:  20 20 20 20 20 20 20 20 20 20 20 20 20 35 20 34                 5 4
007440:  20 20 20 20 20 20 20 78 20 33 A0 A0 20 54 68 65           x 3.. The
007450:  20 20 52 52 44 20 20 69 6E 73 74 72 75 63 74 69      RRD  instructi
007460:  6F 6E 20 74 68 97 8A 65 72 65 66 6F 72 65 20 64    on th..erefore d
007470:  69 76 69 64 65 73 74 68 65 20 64 65 63 69 6D 61    ividesthe decima
007480:  6C 20 6E 75 6D 62 65 72 20 62 79 20 31 30 2E 20    l number by 10. 
007490:  49 74 20 63 61 6E 20 61 6C 73 6F 20 62 65 73 74    It can also best
0074A0:  72 75 6E 67 20 74 6F 67 65 74 68 65 72 20 74 6F    rung together to
0074B0:  20 64 69 76 69 64 65 20 61 6E 79 20 6C 65 6E 67     divide any leng
0074C0:  74 68 20 42 43 44 6E 75 6D 62 65 72 20 20 62 79    th BCDnumber  by
0074D0:  20 31 30 2E 20 20 54 68 65 20 6C 6F 77 20 64 69     10.  The low di
0074E0:  67 69 74 20 6F 66 20 74 68 65 20 74 77 6F 64 69    git of the twodi
0074F0:  67 69 74 20 20 64 65 63 69 6D 61 6C 20 6E 75 6D    git  decimal num
007500:  62 65 72 20 63 61 6E 20 62 65 20 69 73 6F 6C 61    ber can be isola
007510:  74 65 64 20 62 79 74 68 69 73 20 69 6E 73 74 72    ted bythis instr
007520:  75 63 74 69 6F 6E 2E A3 20 53 75 6D 6D 61 72 79    uction.£ Summary
007530:  20 2D 20 64 65 63 69 6D 61 6C 20 73 68 69 66 74     - decimal shift
007540:  73 A0 A0 52 4C 44 20 20 20 20 52 6F 74 61 74 65    s..RLD    Rotate
007550:  20 4C 65 66 74 20 44 65 63 69 6D 61 6C 20 20 28     Left Decimal  (
007560:  2A 31 30 29 A0 A0 52 BC 00 52 44 20 20 20 20 52    *10)..R..RD    R
007570:  6F 74 61 74 65 20 52 69 67 68 74 20 44 65 63 69    otate Right Deci
007580:  6D 61 6C 20 28 2F 31 30 29 A3 20 20 20 20 20 20    mal (/10)£      
007590:  45 58 41 4D 50 4C 45 53 20 4F 46 20 44 45 43 49    EXAMPLES OF DECI
0075A0:  4D 41 4C 20 52 4F 54 41 54 49 4F 4E A0 A0 20 54    MAL ROTATION.. T
0075B0:  68 65 73 65 20 20 20 20 20 65 78 61 6D 70 6C 65    hese     example
0075C0:  73 20 20 20 20 69 6C 6C 75 73 74 72 61 74 65 20    s    illustrate 
0075D0:  20 20 20 74 68 65 6D 75 6C 74 69 70 6C 69 63 61       themultiplica
0075E0:  74 69 6F 6E 20 20 20 61 6E 64 20 20 20 64 69 76    tion   and   div
0075F0:  69 73 69 6F 6E 20 20 6F 66 20 20 42 43 44 6E 75    ision  of  BCDnu
007600:  6D 62 65 72 73 20 62 79 20 74 65 6E 2E A3 20 4C    mbers by ten.£ L
007610:  44 20 48 4C 2C 53 54 4F 52 45 A0 20 20 4C 44 20    D HL,STORE.  LD 
007620:  41 2C 30 A0 20 20 52 4C 44 A0 20 20 49 4E 43 20    A,0.  RLD.  INC 
007630:  48 4C A0 20 20 52 4C 44 A0 20 20 A0 20 20 4C 44    HL.  RLD.  .  LD
007640:  20 41 2C 30 A0 20 20 52 52 44 A0 20 20 44 45 43     A,0.  RRD.  DEC
007650:  20 48 4C A0 20 20 52 52 44 A0 20 20 52 45 54 A0     HL.  RRD.  RET.
007660:  20 20 A0 20 20 A0 20 53 54 00 73 4F 52 45 20 44      .  . ST.sORE D
007670:  45 46 57 20 32 35 34 48 A0 20 20 A0 20 20 A0 20    EFW 254H.  .  . 
007680:  20 20 20 20 20 20 20 20 20 20 20 20 20 49 4E 54                 INT
007690:  52 4F 44 55 43 54 49 4F 4E A0 A0 20 54 68 69 73    RODUCTION.. This
0076A0:  20 20 67 72 6F 75 70 20 20 6F 66 20 6C 65 73 73      group  of less
0076B0:  6F 6E 73 20 77 69 6C 6C 20 20 69 6E 74 72 6F 64    ons will  introd
0076C0:  75 63 65 74 68 65 20 69 64 65 61 20 6F 66 20 62    ucethe idea of b
0076D0:  69 74 20 6D 61 6E 69 70 75 6C 61 74 69 6F 6E 20    it manipulation 
0076E0:  61 6E 64 20 69 74 73 20 75 73 65 69 6E 20 20 66    and its usein  f
0076F0:  6C 61 67 20 20 6F 70 65 72 61 74 69 6F 6E 73 20    lag  operations 
007700:  20 61 6E 64 20 20 69 6E 20 20 70 72 6F 64 75 63     and  in  produc
007710:  69 6E 67 66 61 73 74 65 72 20 6D 65 74 68 6F 64    ingfaster method
007720:  73 20 6F 66 20 6D 75 6C 74 69 70 6C 69 63 61 74    s of multiplicat
007730:  69 6F 6E 2E A0 A0 20 42 75 74 20 66 69 72 73 74    ion... But first
007740:  20 20 77 65 20 73 68 61 6C 6C 20 6C 6F 6F 6B 20      we shall look 
007750:  66 75 72 74 68 65 72 20 61 74 20 74 68 65 70 72    further at thepr
007760:  6F 63 65 73 73 6F 72 73 20 66 6C 80 34 61 67 73    ocessors fl.4ags
007770:  2E A3 20 20 20 20 20 20 20 20 20 20 20 20 20 4C    .£             L
007780:  45 53 53 4F 4E 53 20 20 31 38 20 2D 20 32 35 A0    ESSONS  18 - 25.
007790:  A0 20 31 38 2E 20 20 50 61 72 69 74 79 A0 20 31    . 18.  Parity. 1
0077A0:  39 2E 20 20 54 68 65 20 66 6C 61 67 20 72 65 67    9.  The flag reg
0077B0:  69 73 74 65 72 20 61 6E 64 20 41 46 A0 20 32 30    ister and AF. 20
0077C0:  2E 20 20 53 20 61 6E 64 20 50 2F 56 20 66 6C 61    .  S and P/V fla
0077D0:  67 73 20 69 6E 20 69 6E 73 74 72 75 63 74 69 6F    gs in instructio
0077E0:  6E 73 A0 20 20 20 20 20 20 20 20 20 20 20 20 20    ns.             
0077F0:  45 78 20 2D 20 73 69 67 6E 20 61 6E 64 20 70 61    Ex - sign and pa
007800:  72 69 74 79 20 66 6C 61 67 73 20 20 32 31 2E 20    rity flags  21. 
007810:  20 42 69 74 20 6D 61 6E 69 70 75 6C 61 74 69 6F     Bit manipulatio
007820:  6E A0 20 20 20 20 20 20 20 20 20 20 20 45 78 20    n.           Ex 
007830:  2D 20 62 69 74 20 6D 61 6E 69 70 75 6C 61 74 69    - bit manipulati
007840:  6F 6E A0 20 32 32 2E 20 20 4C 6F 67 69 63 61 6C    on. 22.  Logical
007850:  20 69 6E 73 74 72 75 63 74 69 6F 6E 73 A0 20 20     instructions.  
007860:  20 20 20 20 20 20 20 20 20 45 78 20 2D E4 CA 20             Ex -.. 
007870:  6C 6F 67 69 63 61 6C 20 69 6E 73 74 72 75 63 74    logical instruct
007880:  69 6F 6E 73 A0 20 32 33 2E 20 20 53 68 69 66 74    ions. 23.  Shift
007890:  20 69 6E 73 74 72 75 63 74 69 6F 6E 73 A0 20 20     instructions.  
0078A0:  20 20 20 20 20 20 20 20 20 45 78 20 2D 20 73 68             Ex - sh
0078B0:  69 66 74 20 69 6E 73 74 72 75 63 74 69 6F 6E 73    ift instructions
0078C0:  A0 20 32 34 2E 20 20 52 6F 74 61 74 65 20 69 6E    . 24.  Rotate in
0078D0:  73 74 72 75 63 74 69 6F 6E 73 A0 20 20 20 20 20    structions.     
0078E0:  20 20 20 20 20 20 45 78 20 2D 20 72 6F 74 61 74          Ex - rotat
0078F0:  65 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20 31    e instructions 1
007900:  A0 20 20 20 20 20 20 20 20 20 20 20 45 78 20 2D    .           Ex -
007910:  20 72 6F 74 61 74 65 20 69 6E 73 74 72 75 63 74     rotate instruct
007920:  69 6F 6E 73 20 32 A0 20 32 35 2E 20 20 44 65 63    ions 2. 25.  Dec
007930:  69 6D 61 6C 20 72 6F 74 61 74 69 6E 67 A0 20 20    imal rotating.  
007940:  20 20 20 20 20 20 20 20 20 45 78 20 2D 20 64 65             Ex - de
007950:  63 69 6D 61 6C 20 72 6F 74 61 74 69 6F 6E A0 20    cimal rotation. 
007960:  4C 6F 61 64 20 66 75 72 74 68 65 72 20 6C 65 1A    Load further le.
007970:  F9 73 73 6F 6E 73 20 66 72 6F 6D 20 74 61 70 65    .ssons from tape
007980:  A3 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    £               
007990:  20 20 50 41 52 49 54 59 A0 A0 20 57 68 65 6E 20      PARITY.. When 
0079A0:  64 61 74 61 20 69 73 20 74 72 61 6E 73 6D 69 74    data is transmit
0079B0:  74 65 64 20 66 72 6F 6D 20 6F 6E 65 20 70 6C 61    ted from one pla
0079C0:  63 65 74 6F 20 61 6E 6F 74 68 65 72 2C 20 69 74    ceto another, it
0079D0:  20 69 73 20 70 6F 73 73 69 62 6C 65 20 66 6F 72     is possible for
0079E0:  20 65 72 72 6F 72 73 20 74 6F 61 70 70 65 61 72     errors toappear
0079F0:  20 69 6E 20 74 68 65 20 72 65 63 65 69 76 65 64     in the received
007A00:  20 64 61 74 61 2E 20 50 61 72 69 74 79 20 69 73     data. Parity is
007A10:  20 61 73 69 6D 70 6C 65 20 77 61 79 20 6F 66 20     asimple way of 
007A20:  64 65 74 65 63 74 69 6E 67 20 73 69 6E 67 6C 65    detecting single
007A30:  20 65 72 72 6F 72 73 20 69 6E 64 61 74 61 2E 20     errors indata. 
007A40:  20 41 6E 20 61 64 64 69 74 69 6F 6E 61 6C 20 62     An additional b
007A50:  69 74 20 69 73 20 61 64 64 65 64 20 74 6F 20 74    it is added to t
007A60:  68 65 64 61 74 61 20 74 68 61 74 20 6D 61 6B 65    hedata that make
007A70:  73 49 F9 20 74 68 65 20 74 6F 74 61 6C 20 6E 75    sI. the total nu
007A80:  6D 62 65 72 20 6F 66 20 22 31 22 73 69 6E 20 74    mber of "1"sin t
007A90:  68 65 20 20 77 6F 72 64 20 20 61 6E 20 20 65 76    he  word  an  ev
007AA0:  65 6E 20 20 6E 75 6D 62 65 72 2E 20 20 20 49 66    en  number.   If
007AB0:  20 74 68 65 72 65 63 65 69 76 65 64 20 20 77 6F     thereceived  wo
007AC0:  72 64 20 20 64 6F 65 73 20 20 6E 6F 74 20 20 68    rd  does  not  h
007AD0:  61 76 65 20 20 61 6E 20 65 76 65 6E 6E 75 6D 62    ave  an evennumb
007AE0:  65 72 20 20 6F 66 20 22 31 22 73 20 69 6E 20 69    er  of "1"s in i
007AF0:  74 2C 20 74 68 65 6E 20 61 6E 20 65 72 72 6F 72    t, then an error
007B00:  20 68 61 73 6F 63 63 75 72 72 65 64 2E 20 20 20     hasoccurred.   
007B10:  49 6E 20 20 61 64 64 69 74 69 6F 6E 20 20 74 6F    In  addition  to
007B20:  20 20 74 68 69 73 20 20 65 76 65 6E 70 61 72 69      this  evenpari
007B30:  74 79 20 77 65 20 63 6F 75 6C 64 20 75 73 65 20    ty we could use 
007B40:  20 6F 64 64 20 20 70 61 72 69 74 79 2C 20 20 77     odd  parity,  w
007B50:  68 65 72 65 74 68 65 20 77 6F 72 64 20 69 73 20    herethe word is 
007B60:  6D 61 64 65 20 74 6F 20 68 61 76 65 20 20 61 6E    made to have  an
007B70:  20 20 6F 14 E9 64 64 20 6E 75 6D 62 65 72 6F 66      o..dd numberof
007B80:  20 22 31 22 73 20 69 6E 20 69 74 2E A0 A0 20 54     "1"s in it... T
007B90:  68 65 20 20 5A 38 30 20 20 68 61 73 20 61 20 66    he  Z80  has a f
007BA0:  6C 61 67 20 74 68 61 74 20 69 73 20 73 65 74 20    lag that is set 
007BB0:  69 66 20 74 68 65 6E 75 6D 62 65 72 20 6F 66 20    if thenumber of 
007BC0:  22 31 22 73 20 69 6E 20 61 20 6E 75 6D 62 65 72    "1"s in a number
007BD0:  20 69 73 20 65 76 65 6E 2E 20 54 68 69 73 66 6C     is even. Thisfl
007BE0:  61 67 20 20 69 73 20 69 6E 20 66 61 63 74 20 20    ag  is in fact  
007BF0:  74 68 65 20 20 73 61 6D 65 20 66 6C 61 67 20 20    the  same flag  
007C00:  61 73 20 74 68 65 6F 76 65 72 66 6C 6F 77 20 66    as theoverflow f
007C10:  6C 61 67 2E 20 20 49 74 20 20 69 73 20 20 74 65    lag.  It  is  te
007C20:  72 6D 65 64 20 20 74 68 65 20 20 50 2F 56 66 6C    rmed  the  P/Vfl
007C30:  61 67 2E A3 20 69 2E 65 2E A0 30 20 30 20 31 20    ag.£ i.e..0 0 1 
007C40:  31 20 30 20 31 20 30 20 30 20 20 20 70 61 72 69    1 0 1 0 0   pari
007C50:  74 79 20 66 6C 61 67 20 69 73 20 6E 6F 74 20 73    ty flag is not s
007C60:  65 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20    et              
007C70:  20 20 20 20 73 11 27 69 6E 63 65 20 20 6E 75 6D        s.'ince  num
007C80:  62 65 72 20 20 6F 66 20 22 31 22 73 20 20 20 20    ber  of "1"s    
007C90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73                  is
007CA0:  20 33 2E 20 20 20 69 2E 65 2E 20 6F 64 64 2E A0     3.   i.e. odd..
007CB0:  A0 30 20 31 20 30 20 30 20 30 20 31 20 31 20 31    .0 1 0 0 0 1 1 1
007CC0:  20 20 20 70 61 72 69 74 79 20 20 66 6C 61 67 20       parity  flag 
007CD0:  20 20 69 73 20 20 73 65 74 20 20 20 20 20 20 20      is  set       
007CE0:  20 20 20 20 20 20 20 20 20 20 20 73 69 6E 63 65               since
007CF0:  20 20 6E 75 6D 62 65 72 20 20 6F 66 20 22 31 22      number  of "1"
007D00:  73 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    s               
007D10:  20 20 20 69 73 20 34 2E 20 20 20 69 2E 65 2E 20       is 4.   i.e. 
007D20:  65 76 65 6E 2E A0 A0 20 54 68 65 20 20 69 6E 73    even... The  ins
007D30:  74 72 75 63 74 69 6F 6E 20 20 70 65 72 66 6F 72    truction  perfor
007D40:  6D 65 64 20 20 64 65 74 65 72 6D 69 6E 65 73 74    med  determinest
007D50:  68 65 20 6D 65 61 6E 69 6E 67 20 6F 66 20 74 68    he meaning of th
007D60:  65 20 50 2F 56 20 66 6C 61 67 2E A0 A0 20 4F 66    e P/V flag... Of
007D70:  20 20 61 6C 6C 20 20 77 24 74 68 65 20 69 6E 73      all  w$the ins
007D80:  74 72 75 63 74 69 6F 6E 73 20 20 64 65 73 63 72    tructions  descr
007D90:  69 62 65 64 20 74 6F 64 61 74 65 20 20 6F 6E 6C    ibed todate  onl
007DA0:  79 20 20 44 41 41 20 20 74 72 65 61 74 73 20 20    y  DAA  treats  
007DB0:  69 74 20 20 61 73 20 61 20 70 61 72 69 74 79 66    it  as a parityf
007DC0:  6C 61 67 2E 20 20 41 6C 6C 20 6F 74 68 65 72 73    lag.  All others
007DD0:  20 65 69 74 68 65 72 20 68 61 76 65 20 20 6E 6F     either have  no
007DE0:  20 65 66 66 65 63 74 6F 6E 20 69 74 20 20 6F 72     effecton it  or
007DF0:  20 75 73 65 20 69 74 20 61 73 20 20 61 6E 20 20     use it as  an  
007E00:  6F 76 65 72 66 6C 6F 77 20 20 66 6C 61 67 2E 41    overflow  flag.A
007E10:  6C 6C 20 73 75 62 73 65 71 75 65 6E 74 20 69 6E    ll subsequent in
007E20:  73 74 72 75 63 74 69 6F 6E 73 20 65 69 74 68 65    structions eithe
007E30:  72 20 20 68 61 76 65 6E 6F 20 65 66 66 65 63 74    r  haveno effect
007E40:  20 6F 6E 20 69 74 20 6F 72 20 75 73 65 20 69 74     on it or use it
007E50:  20 61 73 20 70 61 72 69 74 79 2E A3 20 54 48 45     as parity.£ THE
007E60:  20 46 4C 41 47 20 52 45 47 49 53 54 45 52 20 41     FLAG REGISTER A
007E70:  4E 44 20 41 46 20 52 45 47 19 B2 49 53 54 45 52    ND AF REG..ISTER
007E80:  20 50 41 49 52 A0 A0 20 57 65 20 20 68 61 76 65     PAIR.. We  have
007E90:  20 20 64 69 73 63 75 73 73 65 64 20 66 6C 61 67      discussed flag
007EA0:  73 20 61 73 20 69 6E 64 69 76 69 64 75 61 6C 62    s as individualb
007EB0:  69 74 73 2E 20 20 54 68 69 73 20 69 73 20 74 68    its.  This is th
007EC0:  65 20 77 61 79 20 74 68 65 79 20 61 72 65 20 6E    e way they are n
007ED0:  6F 72 6D 61 6C 6C 79 75 73 65 64 2E 20 20 20 54    ormallyused.   T
007EE0:  68 65 79 20 61 72 65 20 68 6F 77 65 76 65 72 20    hey are however 
007EF0:  61 63 74 75 61 6C 6C 79 20 73 74 6F 72 65 64 69    actually storedi
007F00:  6E 20 74 68 65 20 5A 38 30 20 69 6E 20 61 20 72    n the Z80 in a r
007F10:  65 67 69 73 74 65 72 2C 20 64 65 73 69 67 6E 61    egister, designa
007F20:  74 65 64 20 20 61 73 46 20 20 6F 72 20 20 66 6C    ted  asF  or  fl
007F30:  61 67 20 20 72 65 67 69 73 74 65 72 2E 20 20 54    ag  register.  T
007F40:  68 65 20 20 66 6C 61 67 73 20 20 20 61 72 65 61    he  flags   area
007F50:  72 72 61 6E 67 65 64 20 61 73 20 66 6F 6C 6C 6F    rranged as follo
007F60:  77 73 20 3A 2D A0 A0 20 20 20 62 69 74 20 20 30    ws :-..   bit  0
007F70:  20 20 20 20 20 20 43 20 20 20 20 7C 4A 43 61 72          C    |JCar
007F80:  72 79 A0 20 20 20 62 69 74 20 20 31 20 20 20 20    ry.   bit  1    
007F90:  20 20 4E 20 20 20 20 53 75 62 74 72 61 63 74 20      N    Subtract 
007FA0:  6C 61 73 74 A0 20 20 20 62 69 74 20 20 32 20 20    last.   bit  2  
007FB0:  20 20 20 50 2F 56 20 20 20 50 61 72 69 74 79 20       P/V   Parity 
007FC0:  61 6E 64 20 6F 76 65 72 66 6C 6F 77 A0 20 20 20    and overflow.   
007FD0:  62 69 74 20 20 33 20 20 20 20 20 20 20 20 20 20    bit  3          
007FE0:  20 4E 6F 74 20 75 73 65 64 A0 20 20 20 62 69 74     Not used.   bit
007FF0:  20 20 34 20 20 20 20 20 20 48 20 20 20 20 48 61      4      H    Ha
008000:  6C 66 20 63 61 72 72 79 A0 20 20 20 62 69 74 20    lf carry.   bit 
008010:  20 35 20 20 20 20 20 20 20 20 20 20 20 4E 6F 74     5           Not
008020:  20 75 73 65 64 A0 20 20 20 62 69 74 20 20 36 20     used.   bit  6 
008030:  20 20 20 20 20 5A 20 20 20 20 5A 65 72 6F A0 20         Z    Zero. 
008040:  20 20 62 69 74 20 20 37 20 20 20 20 20 20 53 20      bit  7      S 
008050:  20 20 20 53 69 67 6E A3 20 54 68 65 20 46 6C 61       Sign£ The Fla
008060:  67 20 20 72 65 67 69 73 74 65 72 20 20 73 6F 6D    g  register  som
008070:  65 74 69 6D 65 73 20 20 66 6F 72 6D 73 0A 31 20    etimes  forms.1 
008080:  20 61 72 65 67 69 73 74 65 72 20 20 70 61 69 72     aregister  pair
008090:  20 20 69 6E 20 20 63 6F 6E 6A 75 6E 63 74 69 6F      in  conjunctio
0080A0:  6E 20 77 69 74 68 20 74 68 65 41 63 63 75 6D 75    n with theAccumu
0080B0:  6C 61 74 6F 72 2E 20 54 68 69 73 20 70 61 69 72    lator. This pair
0080C0:  20 69 73 20 63 61 6C 6C 65 64 20 41 46 2E 20 54     is called AF. T
0080D0:  68 65 6F 6E 6C 79 20 69 6E 73 74 72 75 63 74 69    heonly instructi
0080E0:  6F 6E 73 20 20 70 72 65 76 69 6F 75 73 6C 79 20    ons  previously 
0080F0:  20 6D 65 6E 74 69 6F 6E 65 64 74 68 61 74 20 69     mentionedthat i
008100:  6E 76 6F 6C 76 65 20 74 68 69 73 20 72 65 67 69    nvolve this regi
008110:  73 74 65 72 20 70 61 69 72 20 61 72 65 20 50 55    ster pair are PU
008120:  53 48 61 6E 64 20 50 4F 50 2E A3 20 20 20 20 20    SHand POP.£     
008130:  53 20 61 6E 64 20 50 2F 56 20 46 4C 41 47 53 20    S and P/V FLAGS 
008140:  49 4E 20 49 4E 53 54 52 55 43 54 49 4F 4E 53 A0    IN INSTRUCTIONS.
008150:  A0 20 54 68 65 20 73 69 67 6E 20 20 61 6E 64 20    . The sign  and 
008160:  20 70 61 72 69 74 79 20 66 6C 61 67 73 20 63 61     parity flags ca
008170:  6E 20 62 65 20 75 73 65 64 69 6E 20 20 61 6C F4    n be usedin  al.
008180:  6A 6C 20 20 61 62 73 6F 6C 75 74 65 20 28 20 4E    jl  absolute ( N
008190:  4F 54 20 72 65 6C 61 74 69 76 65 29 20 6A 75 6D    OT relative) jum
0081A0:  70 73 2C 63 61 6C 6C 73 2C 20 61 6E 64 20 72 65    ps,calls, and re
0081B0:  74 75 72 6E 73 2E A0 A0 20 54 68 65 20 6E 6F 74    turns... The not
0081C0:  61 74 69 6F 6E 20 69 73 20 3A 2D A0 A0 20 4A 50    ation is :-.. JP
0081D0:  20 50 4F 2C 6E 6E 20 20 43 41 4C 4C 20 50 4F 2C     PO,nn  CALL PO,
0081E0:  6E 6E 20 20 52 45 54 20 50 4F A0 20 20 20 20 20    nn  RET PO.     
0081F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
008200:  20 20 20 20 20 20 50 61 72 69 74 79 20 6F 64 64          Parity odd
008210:  3D 30 20 A0 20 4A 50 20 50 45 2C 6E 6E 20 20 43    =0 . JP PE,nn  C
008220:  41 4C 4C 20 50 45 2C 6E 6E 20 20 52 45 54 20 50    ALL PE,nn  RET P
008230:  45 A0 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E.              
008240:  20 20 20 20 20 20 20 20 20 20 20 20 20 50 61 72                 Par
008250:  69 74 79 20 65 76 65 6E 3D 31 A0 A0 20 4A 50 20    ity even=1.. JP 
008260:  50 2C 6E 6E 20 20 20 43 41 4C 4C 20 50 2C 6E 6E    P,nn   CALL P,nn
008270:  20 20 20 52 45 54 20 50 20 20 20 53 69 67 6E 20       RET P   Sign 
008280:  2B 6B 43 76 65 A0 20 4A 50 20 4D 2C 6E 6E 20 20    +kCve. JP M,nn  
008290:  20 43 41 4C 4C 20 4D 2C 6E 6E 20 20 20 52 45 54     CALL M,nn   RET
0082A0:  20 4D 20 20 20 53 69 67 6E 20 2D 76 65 A0 A0 20     M   Sign -ve.. 
0082B0:  49 66 20 74 68 65 20 63 6F 6E 64 69 74 69 6F 6E    If the condition
0082C0:  20 69 73 20 6E 6F 74 20 6D 65 74 20 74 68 65 20     is not met the 
0082D0:  70 72 6F 67 72 61 6D 77 69 6C 6C 20 20 6E 6F 74    programwill  not
0082E0:  20 20 6A 75 6D 70 2C 20 20 63 61 6C 6C 20 61 20      jump,  call a 
0082F0:  20 73 75 62 72 6F 75 74 69 6E 65 2C 20 6F 72 72     subroutine, orr
008300:  65 74 75 72 6E 2E A3 20 20 20 20 20 20 20 20 45    eturn.£        E
008310:  58 41 4D 50 4C 45 20 4F 46 20 4A 55 4D 50 20 4F    XAMPLE OF JUMP O
008320:  4E 20 53 49 47 4E A0 A0 20 54 68 69 73 20 20 65    N SIGN.. This  e
008330:  78 61 6D 70 6C 65 20 20 69 73 20 61 20 73 69 6D    xample  is a sim
008340:  70 6C 65 20 20 70 72 6F 67 72 61 6D 20 20 74 6F    ple  program  to
008350:  69 6C 6C 75 73 74 72 61 74 65 20 20 4A 50 20 50    illustrate  JP P
008360:  2C 6E 6E 20 2C 20 61 6E 64 20 4A 50 20 4D 2C 6E    ,nn , and JP M,n
008370:  6E 3B 20 20 6A 75 6D 70 69 66 20 70 6F 73 69 74    n;  jumpif posit
008380:  69 76 65 68 3B 20 61 6E 64 20 6A 75 6D 70 20 69    iveh; and jump i
008390:  66 20 6D 69 6E 75 73 2E 20 4E 6F 74 65 20 74 68    f minus. Note th
0083A0:  61 74 74 68 65 20 20 63 61 72 72 79 20 20 69 73    atthe  carry  is
0083B0:  20 20 73 74 69 6C 6C 20 20 20 6F 70 65 72 61 74      still   operat
0083C0:  69 76 65 2C 20 20 20 61 6E 64 74 68 65 72 65 66    ive,   andtheref
0083D0:  6F 72 65 2C 20 69 66 20 79 6F 75 20 64 6F 20 6E    ore, if you do n
0083E0:  6F 74 20 63 6C 65 61 72 20 69 74 20 62 65 66 6F    ot clear it befo
0083F0:  72 65 41 44 43 20 20 61 6E 64 20 53 42 43 20 20    reADC  and SBC  
008400:  74 68 65 20 20 6C 61 74 65 72 20 6A 75 6D 70 20    the  later jump 
008410:  20 63 6F 75 6C 64 20 20 62 65 75 6E 65 78 70 65     could  beunexpe
008420:  63 74 65 64 2E 20 49 6E 20 74 68 69 73 20 65 78    cted. In this ex
008430:  61 6D 70 6C 65 20 74 68 65 20 63 61 72 72 79 20    ample the carry 
008440:  69 73 6E 6F 74 20 63 6C 65 61 72 65 64 2C 20 73    isnot cleared, s
008450:  6F 20 22 6C 6F 6F 6B 20 62 65 66 6F 72 65 20 79    o "look before y
008460:  6F 75 20 6C 65 61 70 22 2E A3 20 4C 44 20 48 4C    ou leap".£ LD HL
008470:  2C 35 32 A0 20 20 4C 44 20 44 45 2C 33 33 A0 20    ,52.  LD DE,33. 
008480:  20 4C 44 20 42 21 6F 43 2C 35 A0 20 4C 4F 4F 50     LD B!oC,5. LOOP
008490:  31 20 53 42 43 20 48 4C 2C 44 45 A0 20 20 4C 44    1 SBC HL,DE.  LD
0084A0:  20 28 4C 52 45 47 29 2C 48 4C A0 20 20 4A 50 20     (LREG),HL.  JP 
0084B0:  50 2C 4C 4F 4F 50 31 A0 20 4C 4F 4F 50 32 20 41    P,LOOP1. LOOP2 A
0084C0:  44 43 20 48 4C 2C 42 43 A0 20 20 4C 44 20 28 4C    DC HL,BC.  LD (L
0084D0:  52 45 47 29 2C 48 4C A0 20 20 4A 50 20 4D 2C 4C    REG),HL.  JP M,L
0084E0:  4F 4F 50 32 A0 20 20 52 45 54 20 5A A0 20 20 4A    OOP2.  RET Z.  J
0084F0:  52 20 4C 4F 4F 50 31 A0 20 20 A0 20 4C 52 45 47    R LOOP1.  . LREG
008500:  20 20 42 49 4E 20 30 A0 20 48 52 45 47 20 20 42      BIN 0. HREG  B
008510:  49 4E 20 30 A0 20 20 A0 20 20 A0 20 62 65 72 65    IN 0.  .  . bere
008520:  70 72 65 73 65 6E 74 65 64 20 62 79 20 43 39 42    presented by C9B
008530:  38 20 68 65 78 2E A0 A0 20 43 6F 6E 76 65 72 73    8 hex... Convers
008540:  69 6F 6E 20 20 6F 66 20 20 61 20 20 68 65 78 20    ion  of  a  hex 
008550:  20 6E 75 6D 62 65 72 20 20 74 6F 20 20 69 74 73     number  to  its
008560:  64 65 63 69 6D 61 6C 20 65 71 75 69 76 61 6C 65    decimal equivale
008570:  6E 74 20 66 6F 6C 6C 6F 77 73 20 74 68 65 20 20    nt follows the  
008580:  73 74 61 6E 64 61 72 90 0A 64 63 61 6C 63 75 6C    standar..dcalcul
008590:  61 74 69 6F 6E 2E A0 A0 69 2E 65 2E 20 20 42 38    ation...i.e.  B8
0085A0:  20 68 65 78 20 3D 20 28 42 20 68 65 78 29 2A 20     hex = (B hex)* 
0085B0:  31 36 2B 20 28 38 29 2A 20 31 A0 20 20 20 20 20    16+ (8)* 1.     
0085C0:  20 20 20 20 20 20 20 20 3D 20 31 31 2A 31 36 2B            = 11*16+
0085D0:  38 3D 31 38 34 A0 A0 20 41 6C 77 61 79 73 20 72    8=184.. Always r
0085E0:  65 6D 65 6D 62 65 72 20 74 68 61 74 20 61 20 68    emember that a h
0085F0:  65 78 20 6E 75 6D 62 65 72 20 68 61 73 20 61 62    ex number has ab
008600:  61 73 65 20 6F 66 20 31 36 20 64 65 63 69 6D 61    ase of 16 decima
008610:  6C 2C 20 61 20 64 65 63 69 6D 61 6C 20 6E 75 6D    l, a decimal num
008620:  62 65 72 20 68 61 73 61 20 62 61 73 65 20 6F 66    ber hasa base of
008630:  20 31 30 20 20 61 6E 64 20 61 20 62 69 6E 61 72     10  and a binar
008640:  79 20 6E 75 6D 62 65 72 20 61 20 62 61 73 65 62    y number a baseb
008650:  61 73 65 20 32 2E A3 20 20 20 20 45 58 41 4D 50    ase 2.£    EXAMP
008660:  4C 45 53 20 4F 46 20 48 45 58 41 44 45 43 49 4D    LES OF HEXADECIM
008670:  41 4C 20 4E 4F 54 41 54 49 4F 4E A0 A0 20 4E 6F    AL NOTATION.. No
008680:  77 20 20 74 68 61 74 20 20 1A 9B 68 65 78 20 6E    w  that  ..hex n
008690:  6F 74 61 74 69 6F 6E 20 68 61 73 20 62 65 65 6E    otation has been
0086A0:  20 69 6E 74 72 6F 2D 64 75 63 65 64 20 77 65 20     intro-duced we 
0086B0:  20 63 61 6E 20 64 69 73 63 75 73 73 20 20 68 6F     can discuss  ho
0086C0:  77 20 20 74 68 65 20 63 6F 6D 70 75 74 65 72 73    w  the computers
0086D0:  74 6F 72 65 73 20 20 70 72 6F 67 72 61 6D 73 20    tores  programs 
0086E0:  20 69 6E 20 20 6D 6F 72 65 20 20 64 65 74 61 69     in  more  detai
0086F0:  6C 2E 20 20 20 41 73 61 6C 72 65 61 64 79 20 20    l.   Asalready  
008700:  20 6D 65 6E 74 69 6F 6E 65 64 2C 20 20 74 68 65     mentioned,  the
008710:  20 20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 61       instructionsa
008720:  72 65 20 20 73 74 6F 72 65 64 20 20 20 6D 65 6D    re  stored   mem
008730:  6F 72 79 20 20 61 73 20 20 6E 75 6D 62 65 72 73    ory  as  numbers
008740:  2E 20 20 53 6F 6D 65 69 6E 73 74 72 75 63 74 69    .  Someinstructi
008750:  6F 6E 73 20 20 20 6F 6E 6C 79 20 20 20 72 65 71    ons   only   req
008760:  75 69 72 65 20 20 61 20 20 73 69 6E 67 6C 65 6E    uire  a  singlen
008770:  75 6D 62 65 72 2C 20 6F 74 68 65 72 73 20 72 65    umber, others re
008780:  71 75 69 72 65 20 6D 6F 72 65 2E EB 46 20 43 6F    quire more..F Co
008790:  6C 75 6D 6E 20 32 20 6F 6E 74 68 65 20 53 69 6D    lumn 2 onthe Sim
0087A0:  75 6C 61 74 6F 72 20 64 69 73 70 6C 61 79 20 73    ulator display s
0087B0:  68 6F 77 73 20 20 74 68 65 20 20 6D 65 6D 6F 72    hows  the  memor
0087C0:  79 63 6F 6E 74 65 6E 74 73 20 66 6F 72 20 74 68    ycontents for th
0087D0:  65 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20 69    e instructions i
0087E0:  6E 20 68 65 78 2E A0 A0 20 41 6C 6C 20 74 68 65    n hex... All the
0087F0:  20 20 6E 75 6D 62 65 72 73 20 20 75 73 65 64 20      numbers  used 
008800:  20 74 6F 20 20 64 65 73 63 72 69 62 65 20 61 6E     to  describe an
008810:  69 6E 73 74 72 75 63 74 69 6F 6E 20 61 72 65 20    instruction are 
008820:  20 67 69 76 65 6E 20 69 6E 20 73 65 71 75 65 6E     given in sequen
008830:  63 65 20 61 6C 6F 6E 67 74 68 65 20 6C 69 6E 65    ce alongthe line
008840:  2E 20 20 4E 6F 74 69 63 65 20 74 68 61 74 20 6E    .  Notice that n
008850:  75 6D 62 65 72 73 20 63 61 6C 6C 65 64 20 75 70    umbers called up
008860:  69 6E 20 61 6E 20 69 6E 73 74 72 75 63 74 69 6F    in an instructio
008870:  6E 20 61 70 70 65 61 72 20 74 6F 77 61 72 64 73    n appear towards
008880:  20 74 68 65 20 65 6E 64 6F 66 20 74 68 17 15 65     the endof th..e
008890:  20 73 74 72 69 6E 67 20 20 6F 66 20 20 6E 75 6D     string  of  num
0088A0:  62 65 72 73 2E 20 54 68 65 20 20 65 61 72 6C 69    bers. The  earli
0088B0:  65 72 6E 75 6D 62 65 72 73 20 20 20 20 64 65 74    ernumbers    det
0088C0:  65 72 6D 69 6E 65 20 20 20 20 74 68 65 20 20 20    ermine    the   
0088D0:  74 79 70 65 20 20 20 20 6F 66 69 6E 73 74 72 75    type    ofinstru
0088E0:  63 74 69 6F 6E 2E 20 53 69 6E 63 65 20 74 68 65    ction. Since the
0088F0:  20 20 74 6F 74 61 6C 20 20 6E 75 6D 62 65 72 20      total  number 
008900:  6F 66 69 6E 73 74 72 75 63 74 69 6F 6E 73 20 20    ofinstructions  
008910:  20 65 78 63 65 65 64 20 20 20 32 35 36 2C 20 20     exceed   256,  
008920:  61 20 20 20 70 72 65 66 69 78 6E 75 6D 62 65 72    a   prefixnumber
008930:  20 69 73 20 75 73 65 64 20 74 6F 20 20 70 72 6F     is used to  pro
008940:  64 75 63 65 20 6F 74 68 65 72 20 73 65 74 73 20    duce other sets 
008950:  6F 66 69 6E 73 74 72 75 63 74 69 6F 6E 73 2E 20    ofinstructions. 
008960:  54 68 65 20 70 72 65 66 69 78 65 73 20 79 6F 75    The prefixes you
008970:  20 77 69 6C 6C 20 66 69 6E 64 61 72 65 20 45 44     will findare ED
008980:  2C 20 43 42 2C 20 44 44 20 61 6E 64 20 46 44 9C    , CB, DD and FD.
008990:  FA 2E A3 20 4C 75 63 6B 69 6C 79 20 61 73 73 65    ..£ Luckily asse
0089A0:  6D 62 6C 65 72 73 20 74 61 6B 65 73 20 61 63 63    mblers takes acc
0089B0:  6F 75 6E 74 20 6F 66 20 61 6C 6C 74 68 65 73 65    ount of allthese
0089C0:  20 20 63 6F 6D 70 6C 65 78 69 74 69 65 73 2C 20      complexities, 
0089D0:  20 61 6E 64 20 20 79 6F 75 20 20 77 69 6C 6C 20     and  you  will 
0089E0:  6E 6F 74 6E 65 65 64 20 20 74 6F 20 20 6C 65 61    notneed  to  lea
0089F0:  72 6E 20 20 77 68 69 63 68 20 6E 75 6D 62 65 72    rn  which number
008A00:  73 20 72 65 70 72 65 73 65 6E 74 77 68 69 63 68    s representwhich
008A10:  20 69 6E 73 74 72 75 63 74 69 6F 6E 73 2E A0 A0     instructions...
008A20:  20 54 68 65 20 53 69 6D 75 6C 61 74 6F 72 20 20     The Simulator  
008A30:  63 61 6E 20 20 62 65 20 73 77 69 74 63 68 65 64    can  be switched
008A40:  20 62 65 74 77 65 65 6E 64 65 63 69 6D 61 6C 20     betweendecimal 
008A50:  20 20 61 6E 64 20 20 20 68 65 78 61 64 65 63 69      and   hexadeci
008A60:  6D 61 6C 20 20 64 69 73 70 6C 61 79 20 20 62 79    mal  display  by
008A70:  70 72 65 73 73 69 6E 67 20 73 68 69 66 74 20 20    pressing shift  
008A80:  22 54 22 2C 20 20 77 68 65 6E 20 61 20 70 72 6F    "T",  when a pro
008A90:  67 A5 E2 72 61 6D 20 20 69 73 6E 6F 74 20 72 75    g..ram  isnot ru
008AA0:  6E 6E 69 6E 67 2E A3 20 4C 44 20 41 2C 32 35 48    nning.£ LD A,25H
008AB0:  A0 20 20 41 44 44 20 41 2C 41 A0 20 20 44 41 41    .  ADD A,A.  DAA
008AC0:  A0 20 20 4C 44 20 48 4C 2C 34 35 38 39 48 A0 20    .  LD HL,4589H. 
008AD0:  20 4C 44 20 44 45 2C 33 38 31 32 48 A0 20 20 4C     LD DE,3812H.  L
008AE0:  44 20 41 2C 4C A0 20 20 53 55 42 20 45 A0 20 20    D A,L.  SUB E.  
008AF0:  44 41 41 A0 20 20 4C 44 20 4C 2C 41 A0 20 20 4C    DAA.  LD L,A.  L
008B00:  44 20 41 2C 48 A0 20 20 53 42 43 20 41 2C 44 A0    D A,H.  SBC A,D.
008B10:  20 20 44 41 41 A0 20 20 4C 44 20 48 2C 41 A0 20      DAA.  LD H,A. 
008B20:  20 52 45 54 A0 20 20 A0 20 20 A0 20 20 20 20 20     RET.  .  .     
008B30:  20 42 49 4E 41 52 59 20 43 4F 44 45 44 20 44 45     BINARY CODED DE
008B40:  43 49 4D 41 4C 20 4E 4F 54 41 54 49 4F 4E A0 A0    CIMAL NOTATION..
008B50:  20 57 65 20 20 77 6F 75 6C 64 20 20 73 74 69 6C     We  would  stil
008B60:  6C 20 20 6C 69 6B 65 20 20 74 6F 20 20 62 65 20    l  like  to  be 
008B70:  20 61 62 6C 65 20 74 6F 70 65 72 66 6F 72 6D 20     able toperform 
008B80:  63 61 6C 63 75 6C 61 74 69 6F 6E 73 20 20 6F 6E    calculations  on
008B90:  20 64 65 08 DC 63 69 6D 61 6C 20 6E 75 6D 62 65     de..cimal numbe
008BA0:  72 73 77 69 74 68 6F 75 74 20 20 68 61 76 69 6E    rswithout  havin
008BB0:  67 20 20 74 6F 20 63 6F 6E 76 65 72 74 20 74 6F    g  to convert to
008BC0:  20 62 69 6E 61 72 79 20 6F 72 68 65 78 61 64 65     binary orhexade
008BD0:  63 69 6D 61 6C 20 66 6F 72 6D 2E 20 48 65 78 69    cimal form. Hexi
008BE0:  64 65 63 69 6D 61 6C 20 66 6F 72 6D 20 68 6F 6C    decimal form hol
008BF0:  64 73 61 20 6B 65 79 20 74 6F 20 61 20 6D 65 74    dsa key to a met
008C00:  68 6F 64 20 6F 66 20 61 63 68 69 65 76 69 6E 67    hod of achieving
008C10:  20 74 68 69 73 2E A0 A0 20 54 68 65 20 20 68 65     this... The  he
008C20:  78 20 64 69 67 69 74 20 20 72 65 71 75 69 72 65    x digit  require
008C30:  73 20 20 61 64 6A 75 73 74 6D 65 6E 74 20 74 6F    s  adjustment to
008C40:  61 76 6F 69 64 20 74 68 65 20 64 69 67 69 74 73    avoid the digits
008C50:  20 20 41 2D 46 2E 20 20 41 64 64 69 6E 67 20 20      A-F.  Adding  
008C60:  36 20 74 6F 20 74 68 65 64 69 67 69 74 2C 20 69    6 to thedigit, i
008C70:  66 20 74 68 65 73 65 20 73 79 6D 62 6F 6C 73 20    f these symbols 
008C80:  61 70 70 65 61 72 2C 20 20 72 65 73 75 6C 74 73    appear,  results
008C90:  69 6E 20 63 6F B8 18 72 72 65 63 74 20 61 64 6A    in co..rrect adj
008CA0:  75 73 74 6D 65 6E 74 2E A0 A0 20 54 61 6B 65 20    ustment... Take 
008CB0:  20 74 68 65 20 20 68 65 78 20 20 6E 75 6D 62 65     the  hex  numbe
008CC0:  72 20 20 43 20 20 28 3D 20 31 32 20 64 65 63 2E    r  C  (= 12 dec.
008CD0:  29 2E 41 64 64 69 6E 67 20 20 36 20 20 67 69 76    ).Adding  6  giv
008CE0:  65 73 20 20 31 38 20 20 64 65 63 69 6D 61 6C 20    es  18  decimal 
008CF0:  6F 72 20 31 32 20 68 65 78 2E 48 65 6E 63 65 20    or 12 hex.Hence 
008D00:  74 68 65 20 68 65 78 20 6E 75 6D 62 65 72 20 6C    the hex number l
008D10:  6F 6F 6B 73 20 20 69 64 65 6E 74 69 63 61 6C 20    ooks  identical 
008D20:  74 6F 74 68 65 20 64 65 63 69 6D 61 6C 20 61 6E    tothe decimal an
008D30:  73 77 65 72 20 72 65 71 75 69 72 65 64 2E A3 20    swer required.£ 
008D40:  45 61 63 68 20 64 69 67 69 74 20 69 73 20 20 68    Each digit is  h
008D50:  65 6C 64 20 20 69 6E 20 20 34 20 20 62 69 74 73    eld  in  4  bits
008D60:  20 6F 66 20 74 68 65 72 65 67 69 73 74 65 72 2E     of theregister.
008D70:  20 20 20 54 68 65 73 65 20 20 34 20 20 62 69 74       These  4  bit
008D80:  73 20 61 72 65 20 63 61 6C 6C 65 64 20 20 61 6E    s are called  an
008D90:  69 62 62 6C 65 2C 20 D5 AB 74 68 65 20 77 68 6F    ibble, ..the who
008DA0:  6C 65 20 38 20 62 69 74 20 77 6F 72 64 20 69 73    le 8 bit word is
008DB0:  20 74 65 72 6D 65 64 20 61 62 79 74 65 2E 20 57     termed abyte. W
008DC0:  68 6F 20 73 61 69 64 20 70 72 6F 67 72 61 6D 6D    ho said programm
008DD0:  65 72 73 20 68 61 76 65 20 6E 6F 20 73 65 6E 73    ers have no sens
008DE0:  65 6F 66 20 68 75 6D 6F 75 72 3F A0 A0 20 54 68    eof humour?.. Th
008DF0:  69 73 20 20 70 72 65 73 65 6E 74 61 74 69 6F 6E    is  presentation
008E00:  20 20 69 73 20 20 74 65 72 6D 65 64 20 20 20 42      is  termed   B
008E10:  69 6E 61 72 79 43 6F 64 65 64 20 44 65 63 69 6D    inaryCoded Decim
008E20:  61 6C 20 6F 72 20 42 43 44 2E A0 A0 20 54 68 65    al or BCD... The
008E30:  20 20 20 5A 38 30 20 20 20 20 61 63 63 6F 6D 6D       Z80    accomm
008E40:  6F 64 61 74 65 73 20 20 20 74 68 65 20 20 20 61    odates   the   a
008E50:  62 6F 76 65 61 64 6A 75 73 74 6D 65 6E 74 2C 20    boveadjustment, 
008E60:  20 77 69 74 68 20 74 68 65 20 69 6E 73 74 72 75     with the instru
008E70:  63 74 69 6F 6E 20 20 20 44 41 41 2C 6F 72 20 20    ction   DAA,or  
008E80:  44 65 63 69 6D 61 6C 20 20 41 64 6A 75 73 74 20    Decimal  Adjust 
008E90:  20 41 63 63 75 6D 75 6C 61 B2 D6 74 6F 72 2E 20     Accumula..tor. 
008EA0:  20 20 54 68 69 73 69 6E 73 74 72 75 63 74 69 6F      Thisinstructio
008EB0:  6E 20 20 69 73 20 20 75 73 65 64 20 20 61 66 74    n  is  used  aft
008EC0:  65 72 20 20 61 6E 20 20 38 20 20 62 69 74 41 44    er  an  8  bitAD
008ED0:  44 2C 20 20 41 44 43 2C 20 20 53 55 42 2C 20 20    D,  ADC,  SUB,  
008EE0:  6F 72 20 20 53 42 43 20 20 74 6F 20 61 64 6A 75    or  SBC  to adju
008EF0:  73 74 20 74 68 65 41 63 63 75 6D 75 6C 61 74 6F    st theAccumulato
008F00:  72 20 63 6F 6E 74 65 6E 74 73 20 62 79 20 61 64    r contents by ad
008F10:  64 69 6E 67 20 36 20 20 74 6F 20 74 68 65 6E 69    ding 6  to theni
008F20:  62 62 6C 65 2C 20 20 69 66 20 65 69 74 68 65 72    bble,  if either
008F30:  20 20 6E 69 62 62 6C 65 20 69 6E 20 74 68 65 20      nibble in the 
008F40:  61 6E 73 77 65 72 69 73 20 61 62 6F 76 65 20 39    answeris above 9
008F50:  2E A3 20 54 6F 20 70 65 72 66 6F 72 6D 20 20 74    .£ To perform  t
008F60:  68 69 73 20 6F 70 65 72 61 74 69 6F 6E 20 74 68    his operation th
008F70:  65 20 5A 38 30 20 75 73 65 73 74 77 6F 20 66 75    e Z80 usestwo fu
008F80:  72 74 68 65 72 20 66 6C 61 67 73 2C 20 74 68 65    rther flags, the
008F90:  20 20 48 20 20 66 6C 61 67 20 28 43 8F 20 61 20      H  flag (C. a 
008FA0:  48 61 6C 66 63 61 72 72 79 20 20 62 65 74 77 65    Halfcarry  betwe
008FB0:  65 6E 20 20 6E 69 62 62 6C 65 73 20 29 2C 20 20    en  nibbles ),  
008FC0:  61 6E 64 20 20 4E 20 20 66 6C 61 67 28 73 75 62    and  N  flag(sub
008FD0:  74 72 61 63 74 20 20 69 6E 73 74 72 75 63 74 69    tract  instructi
008FE0:  6F 6E 20 20 70 65 72 66 6F 72 6D 65 64 20 6C 61    on  performed la
008FF0:  73 74 29 2E 53 69 6E 63 65 20 20 74 68 65 73 65    st).Since  these
009000:  20 20 66 6C 61 67 73 20 20 63 61 6E 6E 6F 74 20      flags  cannot 
009010:  62 65 20 74 65 73 74 65 64 20 61 73 70 61 72 74    be tested aspart
009020:  20 6F 66 20 61 20 63 6F 6E 64 69 74 69 6F 6E 61     of a conditiona
009030:  6C 20 6A 75 6D 70 20 65 74 63 2E 20 74 68 65 79    l jump etc. they
009040:  20 61 72 65 6F 66 20 6C 69 74 74 6C 65 20 75 73     areof little us
009050:  65 2E A3 20 20 20 20 20 45 58 41 4D 50 4C 45 53    e.£     EXAMPLES
009060:  20 4F 46 20 42 2E 43 2E 44 2E 20 4E 4F 54 41 54     OF B.C.D. NOTAT
009070:  49 4F 4E A0 A0 20 54 68 65 73 65 20 65 78 61 6D    ION.. These exam
009080:  70 6C 65 73 20 73 68 6F 77 20 73 69 6D 70 6C 65    ples show simple
009090:  20 61 64 64 69 74 69 6F 6E 20 61 6E 64 72 75 73     addition andrus
0090A0:  75 62 74 72 61 63 74 69 6F 6E 20 69 6E 20 20 42    ubtraction in  B
0090B0:  43 44 20 66 6F 72 6D 61 74 2E 20 20 52 65 6D 65    CD format.  Reme
0090C0:  6D 62 65 72 20 74 6F 6B 65 65 70 20 20 69 6E 20    mber tokeep  in 
0090D0:  20 20 48 65 78 20 20 64 69 73 70 6C 61 79 20 20      Hex  display  
0090E0:  20 6D 6F 64 65 20 20 20 6F 72 20 20 74 68 65 69     mode   or  thei
0090F0:  6C 6C 75 73 74 72 61 74 69 6F 6E 73 20 77 69 6C    llustrations wil
009100:  6C 20 6E 6F 74 20 61 70 70 65 61 72 20 69 6E 20    l not appear in 
009110:  42 43 44 2E A3 20 4C 44 20 41 2C 32 35 48 A0 20    BCD.£ LD A,25H. 
009120:  20 4C 44 20 48 4C 2C 53 54 4F 52 45 A0 20 20 4C     LD HL,STORE.  L
009130:  44 20 44 45 2C 32 34 36 38 48 A0 20 20 49 4E 43    D DE,2468H.  INC
009140:  20 28 48 4C 29 A0 20 20 52 45 54 A0 20 20 A0 20     (HL).  RET.  . 
009150:  20 42 49 4E 20 36 35 48 A0 20 20 42 49 4E 20 38     BIN 65H.  BIN 8
009160:  37 48 A0 20 20 42 49 4E 20 39 41 48 A0 20 20 42    7H.  BIN 9AH.  B
009170:  49 4E 20 44 46 48 A0 20 20 42 49 4E 20 46 46 48    IN DFH.  BIN FFH
009180:  A0 20 20 42 49 4E 20 36 34 48 A0 20 20 A0 20 53    .  BIN 64H.  . S
009190:  54 4F 52 45 20 44 45 46 42 20 36 34 A0 20 20 87    TORE DEFB 64.  .
0091A0:  C2 A0 20 20 A0 20 20 20 50 4F 53 49 54 49 56 45    ..  .   POSITIVE
0091B0:  20 41 4E 44 20 4E 45 47 41 54 49 56 45 20 4E 55     AND NEGATIVE NU
0091C0:  4D 42 45 52 20 4E 4F 54 41 54 49 4F 4E A0 A0 20    MBER NOTATION.. 
0091D0:  53 6F 20 66 61 72 20 77 65 20 68 61 76 65 20 6F    So far we have o
0091E0:  6E 6C 79 20 64 65 61 6C 74 20 77 69 74 68 20 70    nly dealt with p
0091F0:  6F 73 69 74 69 76 65 6E 75 6D 62 65 72 73 2E 20    ositivenumbers. 
009200:  20 49 66 20 77 65 20 68 61 64 20 74 61 6B 65 6E     If we had taken
009210:  20 20 36 20 20 66 72 6F 6D 20 20 35 20 77 65 77      6  from  5 wew
009220:  6F 75 6C 64 20 65 6E 64 20 20 75 70 20 77 69 74    ould end  up wit
009230:  68 20 20 74 68 65 20 61 6E 73 77 65 72 20 32 35    h  the answer 25
009240:  35 20 20 77 69 74 68 63 61 72 72 79 20 73 65 74    5  withcarry set
009250:  2E 20 54 68 65 72 65 20 69 73 20 61 6E 20 69 6E    . There is an in
009260:  74 65 72 70 72 65 74 61 74 69 6F 6E 20 6F 66 6E    terpretation ofn
009270:  75 6D 62 65 72 73 20 20 74 68 61 74 20 61 6C 6C    umbers  that all
009280:  6F 77 73 20 75 73 20 74 6F 20 63 6F 6E 73 69 64    ows us to consid
009290:  65 72 20 74 68 69 73 61 6E 73 77 65 72 20 61 73    er thisanswer as
0092A0:  20 B8 DF 74 68 65 20 6E 65 67 61 74 69 76 65 20     ..the negative 
0092B0:  6E 75 6D 62 65 72 20 2D 31 2E A0 A0 20 49 6E 20    number -1... In 
0092C0:  20 74 68 69 73 20 20 69 6E 74 65 72 70 72 65 74     this  interpret
0092D0:  61 74 69 6F 6E 20 20 2D 31 20 6D 75 73 74 20 65    ation  -1 must e
0092E0:  71 75 61 6C 32 35 35 20 6F 72 20 31 31 31 31 31    qual255 or 11111
0092F0:  31 31 31 2C 20 6F 72 20 74 68 65 20 70 72 6F 63    111, or the proc
009300:  65 73 73 6F 72 20 20 77 6F 75 6C 64 6E 6F 74 20    essor  wouldnot 
009310:  62 65 20 61 62 6C 65 20 74 6F 20 74 61 6B 65 20    be able to take 
009320:  20 36 20 20 66 72 6F 6D 20 20 35 20 20 61 6E 64     6  from  5  and
009330:  20 67 65 74 74 68 65 20 72 69 67 68 74 20 61 6E     getthe right an
009340:  73 77 65 72 2E 20 46 75 72 74 68 65 72 20 35 2D    swer. Further 5-
009350:  37 20 3D 2D 32 20 6F 72 20 32 35 34 6F 72 20 31    7 =-2 or 254or 1
009360:  31 31 31 31 31 31 30 2E 20 42 69 74 20 37 2C 20    1111110. Bit 7, 
009370:  74 68 65 20 6D 6F 73 74 20 73 69 67 6E 69 66 69    the most signifi
009380:  63 61 6E 74 62 69 74 2C 20 72 65 70 72 65 73 65    cantbit, represe
009390:  6E 74 73 20 20 74 68 65 20 73 69 67 6E 20 28 20    nts  the sign ( 
0093A0:  2B 20 6F 40 51 72 20 2D 20 29 20 20 6F 66 74 68    + o@Qr - )  ofth
0093B0:  65 20 6E 75 6D 62 65 72 2E 20 57 68 65 6E 20 62    e number. When b
0093C0:  69 74 20 37 20 69 73 20 22 31 22 20 74 68 65 20    it 7 is "1" the 
0093D0:  6E 75 6D 62 65 72 69 73 20 6E 65 67 61 74 69 76    numberis negativ
0093E0:  65 2C 20 20 61 6E 64 20 77 68 65 6E 20 22 30 22    e,  and when "0"
0093F0:  20 74 68 65 20 6E 75 6D 62 65 72 20 69 73 70 6F     the number ispo
009400:  73 69 74 69 76 65 2E A3 20 41 20 20 75 73 65 66    sitive.£ A  usef
009410:  75 6C 20 6F 70 65 72 61 74 69 6F 6E 20 77 6F 75    ul operation wou
009420:  6C 64 20 20 62 65 20 74 6F 20 6D 61 6B 65 20 61    ld  be to make a
009430:  70 6F 73 69 74 69 76 65 20 6E 75 6D 62 65 72 20    positive number 
009440:  6E 65 67 61 74 69 76 65 2E 20 43 68 61 6E 67 69    negative. Changi
009450:  6E 67 20 62 69 74 20 37 64 6F 65 73 20 20 6E 6F    ng bit 7does  no
009460:  74 20 20 64 6F 20 20 74 68 69 73 2E 20 20 54 61    t  do  this.  Ta
009470:  6B 65 20 74 68 65 20 20 70 6F 73 69 74 69 76 65    ke the  positive
009480:  6E 75 6D 62 65 72 20 20 32 20 6F 72 20 20 30 30    number  2 or  00
009490:  30 30 30 30 31 30 20 20 61 6E 64 20 69 74 73 20    000010  and its 
0094A0:  6E 65 67 61 74 9C 8E 69 76 65 65 71 75 69 76 61    negat..iveequiva
0094B0:  6C 65 6E 74 20 2D 32 20 20 6F 72 20 31 31 31 31    lent -2  or 1111
0094C0:  31 31 31 30 20 20 66 6F 72 20 65 78 61 6D 70 6C    1110  for exampl
0094D0:  65 2E 49 6E 76 65 72 74 69 6E 67 20 61 6C 6C 20    e.Inverting all 
0094E0:  62 69 74 73 20 6F 66 20 74 68 65 20 20 62 69 6E    bits of the  bin
0094F0:  61 72 79 20 6E 75 6D 62 65 72 6F 66 20 20 2B 32    ary numberof  +2
009500:  20 20 67 69 76 65 73 20 20 31 31 31 31 31 31 30      gives  1111110
009510:  31 2C 20 77 68 69 63 68 20 69 73 20 31 20 6C 65    1, which is 1 le
009520:  73 73 74 68 61 6E 20 74 68 61 74 20 20 66 6F 72    ssthan that  for
009530:  20 2D 32 2E A0 A0 48 65 6E 63 65 20 74 6F 20 6D     -2...Hence to m
009540:  61 6B 65 20 61 20 70 6F 73 69 74 69 76 65 20 6E    ake a positive n
009550:  75 6D 62 65 72 20 6E 65 67 61 74 69 76 65 77 65    umber negativewe
009560:  20 69 6E 76 65 72 74 20 61 6C 6C 20 69 74 73 20     invert all its 
009570:  62 69 6E 61 72 79 20 62 69 74 73 2C 20 20 6B 6E    binary bits,  kn
009580:  6F 77 6E 20 61 73 43 6F 6D 70 6C 69 6D 65 6E 74    own asCompliment
009590:  69 6E 67 2C 20 61 6E 64 20 61 64 64 20 20 31 2E    ing, and add  1.
0095A0:  20 20 54 68 65 20 6E 7A 68 6F 74 61 74 69 6F 6E      The nzhotation
0095B0:  69 73 20 67 65 6E 65 72 61 6C 6C 79 20 74 65 72    is generally ter
0095C0:  6D 65 64 20 32 73 20 63 6F 6D 70 6C 65 6D 65 6E    med 2s complemen
0095D0:  74 A3 69 2E 65 2E 20 20 20 20 20 20 20 20 20 30    t£i.e.         0
0095E0:  20 30 20 30 20 30 20 30 20 31 20 30 20 31 20 20     0 0 0 0 1 0 1  
0095F0:  20 20 2B 35 A0 20 20 20 20 69 6E 76 65 72 74 20      +5.    invert 
009600:  20 20 31 20 31 20 31 20 31 20 31 20 30 20 31 20      1 1 1 1 1 0 1 
009610:  30 A0 20 20 61 64 64 20 31 20 20 20 20 20 20 31    0.  add 1      1
009620:  20 31 20 31 20 31 20 31 20 30 20 31 20 31 20 20     1 1 1 1 0 1 1  
009630:  20 20 2D 35 A0 20 20 20 20 69 6E 76 65 72 74 20      -5.    invert 
009640:  20 20 30 20 30 20 30 20 30 20 30 20 31 20 30 20      0 0 0 0 0 1 0 
009650:  30 A0 20 20 61 64 64 20 31 20 20 20 20 20 20 30    0.  add 1      0
009660:  20 30 20 30 20 30 20 30 20 31 20 30 20 31 20 20     0 0 0 0 1 0 1  
009670:  20 20 2B 35 A0 A0 20 54 68 65 20 20 6F 70 65 72      +5.. The  oper
009680:  61 74 69 6F 6E 20 20 6C 75 63 6B 69 6C 79 20 20    ation  luckily  
009690:  61 6C 73 6F 20 20 6D 61 6B 65 73 20 20 61 6E 65    also  makes  ane
0096A0:  67 61 74 69 76 65 20 20 20 FF 60 6E 75 6D 62 65    gative   .`numbe
0096B0:  72 20 20 20 20 70 6F 73 69 74 69 76 65 2E 20 20    r    positive.  
0096C0:  20 41 20 20 76 65 72 79 69 6D 70 6F 72 74 61 6E     A  veryimportan
0096D0:  74 20 70 6F 69 6E 74 2E A0 A0 20 54 68 65 20 6C    t point... The l
0096E0:  61 72 67 65 73 74 20 70 6F 73 69 74 69 76 65 20    argest positive 
0096F0:  6E 75 6D 62 65 72 20 77 65 20 63 61 6E 20 68 6F    number we can ho
009700:  6C 64 69 6E 20 20 61 20 20 20 73 69 6E 67 6C 65    ldin  a   single
009710:  20 20 20 72 65 67 69 73 74 65 72 2C 20 20 75 73       register,  us
009720:  69 6E 67 20 20 20 74 68 69 73 6E 6F 74 61 74 69    ing   thisnotati
009730:  6F 6E 20 69 73 20 20 30 31 31 31 31 31 31 31 20    on is  01111111 
009740:  20 20 6F 72 20 20 31 32 37 20 20 61 6E 64 20 74      or  127  and t
009750:  68 65 6C 61 72 67 65 73 74 20 20 6E 65 67 61 74    helargest  negat
009760:  69 76 65 20 20 20 6E 75 6D 62 65 72 20 20 31 30    ive   number  10
009770:  30 30 30 30 30 30 20 20 6F 72 2D 31 32 38 2E A3    000000  or-128.£
009780:  20 54 68 65 20 20 5A 38 30 20 20 68 61 73 20 74     The  Z80  has t
009790:  77 6F 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20    wo instructions 
0097A0:  74 68 61 74 20 6D 61 79 62 65 20 A2 2D 75 73 65    that maybe .-use
0097B0:  64 20 66 6F 72 20 74 68 65 73 65 20 6F 70 65 72    d for these oper
0097C0:  61 74 69 6F 6E 73 A0 A0 20 43 50 4C 20 20 20 63    ations.. CPL   c
0097D0:  6F 6D 70 6C 65 6D 65 6E 74 73 20 20 20 20 6F 72    omplements    or
0097E0:  20 20 20 69 6E 76 65 72 74 73 20 20 20 74 68 65       inverts   the
0097F0:  20 20 20 20 20 20 20 63 6F 6E 74 65 6E 74 73 20           contents 
009800:  6F 66 20 74 68 65 20 41 63 63 75 6D 75 6C 61 74    of the Accumulat
009810:  6F 72 2E A0 A0 20 4E 45 47 20 20 20 6E 65 67 61    or... NEG   nega
009820:  74 65 73 2C 20 20 6F 72 20 6D 61 6B 65 73 20 20    tes,  or makes  
009830:  6E 65 67 61 74 69 76 65 2C 20 74 68 65 20 20 20    negative, the   
009840:  20 20 20 20 63 6F 6E 74 65 6E 74 73 20 20 6F 66        contents  of
009850:  20 20 74 68 65 20 20 41 63 63 75 6D 75 6C 61 74      the  Accumulat
009860:  6F 72 20 62 79 20 20 20 20 20 20 20 63 6F 6D 70    or by       comp
009870:  6C 65 6D 65 6E 74 69 6E 67 20 61 6E 64 20 61 64    lementing and ad
009880:  64 69 6E 67 20 31 20 69 6E 20 6F 6E 65 20 20 20    ding 1 in one   
009890:  20 20 20 20 6F 70 65 72 61 74 69 6F 6E 2E A0 A0        operation...
0098A0:  20 41 20 53 69 67 6E 20 66 6C 61 67 20 46 52 28     A Sign flag FR(
0098B0:  53 29 20 69 73 20 70 72 6F 76 69 64 65 64 20 6F    S) is provided o
0098C0:  6E 20 74 68 65 20 5A 38 30 2E 49 74 20 64 75 70    n the Z80.It dup
0098D0:  6C 69 63 61 74 65 73 20 20 74 68 65 20 73 69 67    licates  the sig
0098E0:  6E 20 28 20 62 69 74 20 37 20 29 20 6F 66 20 74    n ( bit 7 ) of t
0098F0:  68 65 61 6E 73 77 65 72 20 61 66 74 65 72 20 61    heanswer after a
009900:  6E 79 20 61 72 69 74 68 6D 65 74 69 63 20 6F 70    ny arithmetic op
009910:  65 72 61 74 69 6F 6E 20 6F 6E 74 68 65 20 41 63    eration onthe Ac
009920:  63 75 6D 75 6C 61 74 6F 72 2E 20 20 54 68 65 20    cumulator.  The 
009930:  20 73 69 67 6E 20 20 66 6C 61 67 20 69 73 20 22     sign  flag is "
009940:  30 22 66 6F 72 20 20 61 20 20 70 6F 73 69 74 69    0"for  a  positi
009950:  76 65 20 20 72 65 73 75 6C 74 20 20 61 6E 64 20    ve  result  and 
009960:  20 22 31 22 20 66 6F 72 20 61 6E 65 67 61 74 69     "1" for anegati
009970:  76 65 20 72 65 73 75 6C 74 2E A3 20 57 68 65 6E    ve result.£ When
009980:  20 70 65 72 66 6F 72 6D 69 6E 67 20 20 61 72 69     performing  ari
009990:  74 68 6D 65 74 69 63 20 20 6F 70 65 72 61 74 69    thmetic  operati
0099A0:  6F 6E 73 77 68 69 63 68 20 20 77 65 20 20 77 A4    onswhich  we  w.
0099B0:  87 69 73 68 20 20 74 6F 20 69 6E 74 65 72 70 72    .ish  to interpr
0099C0:  65 74 20 77 69 74 68 69 6E 20 74 68 65 72 61 6E    et within theran
0099D0:  67 65 20 20 2D 31 32 38 20 74 6F 20 2B 31 32 37    ge  -128 to +127
0099E0:  2C 20 74 68 65 20 43 61 72 72 79 20 20 66 6C 61    , the Carry  fla
0099F0:  67 20 20 6E 6F 6C 6F 6E 67 65 72 20 20 73 69 67    g  nolonger  sig
009A00:  6E 61 6C 73 20 20 61 6E 20 6F 75 74 20 6F 66 20    nals  an out of 
009A10:  72 61 6E 67 65 20 72 65 73 75 6C 74 2E 48 6F 77    range result.How
009A20:  65 76 65 72 20 61 6E 6F 74 68 65 72 20 66 6C 61    ever another fla
009A30:  67 2C 20 74 68 65 20 6F 76 65 72 66 6C 6F 77 20    g, the overflow 
009A40:  28 50 2F 56 29 66 6C 61 67 20 20 64 6F 65 73 2E    (P/V)flag  does.
009A50:  20 20 49 74 20 20 69 73 20 20 61 20 20 22 31 22      It  is  a  "1"
009A60:  20 77 68 65 6E 65 76 65 72 20 74 68 65 61 6E 73     whenever theans
009A70:  77 65 72 20 69 73 20 6F 75 74 73 69 64 65 20 74    wer is outside t
009A80:  68 65 20 72 61 6E 67 65 20 2D 31 32 38 20 74 6F    he range -128 to
009A90:  20 2B 31 32 37 61 6E 64 20 20 22 30 22 20 20 77     +127and  "0"  w
009AA0:  69 74 68 69 6E 20 20 20 74 68 65 20 20 20 72 61    ithin   the   ra
009AB0:  6E D5 E9 67 65 2E 20 20 20 49 74 20 20 69 73 65    n..ge.   It  ise
009AC0:  66 66 65 63 74 69 76 65 6C 79 20 20 61 20 20 63    ffectively  a  c
009AD0:  61 72 72 79 20 20 69 6E 74 6F 20 20 62 69 74 20    arry  into  bit 
009AE0:  37 20 77 68 69 63 68 77 6F 75 6C 64 20 6D 61 6B    7 whichwould mak
009AF0:  65 20 74 68 65 20 73 69 67 6E 20 62 69 74 20 69    e the sign bit i
009B00:  6E 63 6F 72 72 65 63 74 2E A3 20 54 68 65 72 65    ncorrect.£ There
009B10:  20 20 69 73 20 20 6E 6F 20 20 72 65 61 73 6F 6E      is  no  reason
009B20:  20 66 6F 72 20 73 74 69 63 6B 69 6E 67 20 74 6F     for sticking to
009B30:  20 38 62 69 74 73 20 20 75 73 69 6E 67 20 74 68     8bits  using th
009B40:  69 73 20 6D 65 74 68 6F 64 2E 20 20 53 6F 20 6C    is method.  So l
009B50:  6F 6E 67 20 61 73 20 74 68 65 6E 75 6D 62 65 72    ong as thenumber
009B60:  20 6F 66 20 20 62 69 74 73 20 69 73 20 20 73 75     of  bits is  su
009B70:  66 66 69 63 69 65 6E 74 20 20 61 6E 64 20 20 74    fficient  and  t
009B80:  68 65 6D 6F 73 74 20 20 73 69 67 6E 69 66 69 63    hemost  signific
009B90:  61 6E 74 20 20 62 69 74 20 20 69 73 20 20 74 61    ant  bit  is  ta
009BA0:  6B 65 6E 20 61 73 20 74 68 65 73 69 67 6E 20 20    ken as thesign  
009BB0:  62 69 74 03 EF 20 20 61 6E 79 20 73 69 7A 65 20    bit..  any size 
009BC0:  70 6F 73 69 74 69 76 65 20 6F 72 20 6E 65 67 61    positive or nega
009BD0:  74 69 76 65 6E 75 6D 62 65 72 20 63 61 6E 20 62    tivenumber can b
009BE0:  65 20 72 65 70 72 65 73 65 6E 74 65 64 2E A0 A0    e represented...
009BF0:  20 50 65 72 66 6F 72 6D 69 6E 67 20 61 20 73 69     Performing a si
009C00:  6D 69 6C 61 72 20 63 61 6C 63 75 6C 61 74 69 6F    milar calculatio
009C10:  6E 20 74 6F 20 74 68 65 61 62 6F 76 65 20 20 77    n to theabove  w
009C20:  65 20 63 61 6E 20 20 73 68 6F 77 20 74 68 61 74    e can  show that
009C30:  20 61 20 72 65 67 69 73 74 65 72 20 70 61 69 72     a register pair
009C40:  63 61 6E 20 20 72 65 70 72 65 73 65 6E 74 20 20    can  represent  
009C50:  61 20 20 6E 75 6D 62 65 72 20 20 69 6E 20 74 68    a  number  in th
009C60:  65 20 20 72 61 6E 67 65 2B 33 32 37 36 37 20 74    e  range+32767 t
009C70:  6F 20 2D 33 32 37 36 38 2E A0 A0 20 54 68 65 20    o -32768... The 
009C80:  20 53 69 67 6E 20 61 6E 64 20 20 6F 76 65 72 66     Sign and  overf
009C90:  6C 6F 77 20 20 66 6C 61 67 73 20 61 72 65 20 61    low  flags are a
009CA0:  6C 73 6F 6F 70 65 72 61 74 69 76 65 20 61 66 74    lsooperative aft
009CB0:  65 72 20 20 41 76 5B 44 43 20 61 6E 64 20 53 42    er  Av[DC and SB
009CC0:  43 20 69 6E 73 74 72 75 63 74 69 6F 6E 6F 6E 20    C instructionon 
009CD0:  74 68 65 20 48 4C 20 72 65 67 69 73 74 65 72 2E    the HL register.
009CE0:  20 49 74 20 72 65 66 6C 65 63 74 73 20 74 68 65     It reflects the
009CF0:  20 31 35 74 68 62 69 74 20 28 6F 72 20 62 69 74     15thbit (or bit
009D00:  20 37 20 6F 66 20 48 20 72 65 67 69 73 74 65 72     7 of H register
009D10:  29 20 2E A3 20 49 74 20 69 73 20 69 6D 70 6F 72    ) .£ It is impor
009D20:  74 61 6E 74 20 20 74 6F 20 20 72 65 6D 65 6D 62    tant  to  rememb
009D30:  65 72 20 20 74 68 61 74 20 74 68 65 5A 65 72 6F    er  that theZero
009D40:  2C 20 20 43 61 72 72 79 2C 20 20 53 69 67 6E 2C    ,  Carry,  Sign,
009D50:  20 61 6E 64 20 20 6F 76 65 72 66 6C 6F 77 20 66     and  overflow f
009D60:  6C 61 67 73 61 72 65 20 61 6C 77 61 79 73 20 6F    lagsare always o
009D70:  70 65 72 61 74 69 76 65 20 20 61 66 74 65 72 20    perative  after 
009D80:  20 61 6E 20 20 20 38 20 20 62 69 74 61 72 69 74     an   8  bitarit
009D90:  68 6D 65 74 69 63 20 20 69 6E 73 74 72 75 63 74    hmetic  instruct
009DA0:  69 6F 6E 20 20 20 6F 72 20 20 61 20 20 31 36 20    ion   or  a  16 
009DB0:  20 62 69 74 61 64 64 14 8F 69 74 69 6F 6E 20 20     bitadd..ition  
009DC0:  20 69 6E 76 6F 6C 76 69 6E 67 20 20 20 74 68 65     involving   the
009DD0:  20 20 43 61 72 72 79 2E 20 20 59 6F 75 72 69 6E      Carry.  Yourin
009DE0:  74 65 72 70 72 65 74 61 74 69 6F 6E 20 6F 66 20    terpretation of 
009DF0:  74 68 65 20 20 72 65 73 75 6C 74 20 64 65 74 65    the  result dete
009E00:  72 6D 69 6E 65 73 69 6E 20 20 20 77 68 69 63 68    rminesin   which
009E10:  20 20 20 66 6C 61 67 28 73 29 20 20 20 79 6F 75       flag(s)   you
009E20:  20 20 20 73 68 6F 75 6C 64 20 20 20 62 65 69 6E       should   bein
009E30:  74 65 72 65 73 74 65 64 20 69 6E 2E A3 20 20 20    terested in.£   
009E40:  20 45 58 41 4D 50 4C 45 53 20 4F 46 20 2B 56 45     EXAMPLES OF +VE
009E50:  20 41 4E 44 20 2D 56 45 20 4E 4F 54 41 54 49 4F     AND -VE NOTATIO
009E60:  4E A0 A0 20 41 6C 74 68 6F 75 67 68 20 20 74 68    N.. Although  th
009E70:  65 73 65 20 20 65 78 61 6D 70 6C 65 73 20 20 61    ese  examples  a
009E80:  70 70 65 61 72 20 74 6F 20 62 65 61 6C 6C 20 70    ppear to beall p
009E90:  6F 73 69 74 69 76 65 2C 20 74 68 65 79 20 63 61    ositive, they ca
009EA0:  6E 20 62 65 20 76 69 65 77 65 64 20 65 71 75 61    n be viewed equa
009EB0:  6C 6C 79 61 73 20 20 6E 65 65 25 67 61 74 69 76    llyas  nee%gativ
009EC0:  65 20 20 77 68 65 72 65 20 61 70 70 72 6F 70 72    e  where appropr
009ED0:  69 61 74 65 20 61 6E 64 20 20 74 68 65 53 69 67    iate and  theSig
009EE0:  6E 20 20 20 61 6E 64 20 20 20 6F 76 65 72 66 6C    n   and   overfl
009EF0:  6F 77 20 20 20 66 6C 61 67 73 20 20 20 6F 62 73    ow   flags   obs
009F00:  65 72 76 65 64 6F 70 65 72 61 74 69 6E 67 2E A0    ervedoperating..
009F10:  A0 20 52 65 6D 65 6D 62 65 72 20 20 61 20 20 20    . Remember  a   
009F20:  6E 75 6D 62 65 72 20 20 20 61 62 6F 76 65 20 20    number   above  
009F30:  20 31 32 38 20 20 20 69 73 6E 65 67 61 74 69 76     128   isnegativ
009F40:  65 2E 20 53 69 6E 63 65 20 61 6C 6C 20 74 68 65    e. Since all the
009F50:  20 6E 65 67 61 74 69 76 65 20 6E 75 6D 62 65 72     negative number
009F60:  73 69 6E 20 74 68 65 20 65 78 61 6D 70 6C 65 73    sin the examples
009F70:  20 61 72 65 20 73 6D 61 6C 6C 2C 20 20 74 68 65     are small,  the
009F80:  79 20 20 63 61 6E 20 62 65 73 65 65 6E 20 71 75    y  can beseen qu
009F90:  69 63 6B 6C 79 20 61 6E 64 20 73 69 6D 70 6C 79    ickly and simply
009FA0:  20 62 65 20 63 6F 6E 76 65 72 74 65 64 20 20 62     be converted  b
009FB0:  79 73 75 62 74 72 61 63 74 69 6E 7F 53 67 20 74    ysubtractin.Sg t
009FC0:  68 65 20 6E 75 6D 62 65 72 20 66 72 6F 6D 20 32    he number from 2
009FD0:  35 36 2E A0 A0 20 69 2E 65 2E 20 20 2D 32 20 20    56... i.e.  -2  
009FE0:  69 73 20 65 71 75 69 76 61 6C 65 6E 74 20 74 6F    is equivalent to
009FF0:  20 32 35 34 20 65 74 63 2E A3 20 4C 44 20 41 2C     254 etc.£ LD A,
00A000:  32 35 34 A0 20 20 4E 45 47 A0 20 20 4E 45 47 A0    254.  NEG.  NEG.
00A010:  20 20 41 44 44 20 41 2C 32 A0 20 20 49 4E 43 20      ADD A,2.  INC 
00A020:  41 A0 20 20 4C 44 20 48 4C 2C 32 A0 20 20 4C 44    A.  LD HL,2.  LD
00A030:  20 44 45 2C 46 46 46 45 48 A0 20 20 41 44 44 20     DE,FFFEH.  ADD 
00A040:  48 4C 2C 44 45 A0 20 20 43 50 4C A0 20 20 4C 44    HL,DE.  CPL.  LD
00A050:  20 48 4C 2C 53 54 4F 52 45 A0 20 20 4C 44 20 28     HL,STORE.  LD (
00A060:  48 4C 29 2C 37 46 48 A0 20 20 49 4E 43 20 28 48    HL),7FH.  INC (H
00A070:  4C 29 A0 20 20 52 45 54 A0 20 20 A0 20 53 54 4F    L).  RET.  . STO
00A080:  52 45 20 42 49 4E 20 30 A0 20 20 A0 20 38 38 12    RE BIN 0.  . 88.
00A090:  7C 90 28 24 22 38 38 90 7C 12 28 48 88 00 3C 18    |.($"88.|.(H..<.
00A0A0:  3C 3C 3C 18 00 3C FF FF 18 0C 18 30 18 18 3C 7E    <<<..<.....0..<~
00A0B0:  18 18 7E 3C 18 00 24 66 FF 66 24 00 00 2F 20 00    ..~<..$f.f$../ .
00A0C0:  C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9    ................
00A0D0:  C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 C9 00 FF 00 00 FF    ................
00A0E0:  00 00 00 84 FF FF 00 00 00 3F 88 80 03 00 00 FF    .........?......
00A0F0:  FF 00 00 00 00 00 00 FF FF 00 08 79 C8 FD 00 FF    ...........y....
00A100:  FF 00 00 FF FF 00 08 79 C8 FD 00 FF FF 00 00 FF    .......y........
00A110:  FF 00 08 79 C8 FD 00 FF FF 00 00 FF FF 00 00 FF    ...y............
00A120:  FF 00 00 00 02 79 C8 FD FF 00 00 FF FF 00 00 FF    .....y..........
00A130:  FF 00 00 FF FF 00 04 79 C8 FD 00 FF FF 00 00 FF    .......y........
00A140:  FF 00 00 FF DF 00 00 00 08 79 C8 FD FF 00 00 FF    .........y......
00A150:  FF 00 00 FF FF 00 00 FF FF 00 10 79 C8 FD 00 FF    ...........y....
00A160:  FF 00 00 32 00 76 65 20 22 54 45 58 54 32 22 2C    ...2.ve "TEXT2",
00A170:  42 2C 26 35 38 30 30 2C 26 35 35 30 30 20 00 00    B,&5800,&5500 ..
00A180:  54 45 52 22 00 61 00 64 00 30 30 31 00 00 37 39    TER".a.d.001..79
00A190:  2C 26 65 64 2C 26 37 38 2C 26 63 62 2C 26 34 37    ,&ed,&78,&cb,&47
00A1A0:  00 26 31 62 2C 26 37 61 2C 26 42 33 20 00 66 2C    .&1b,&7a,&B3 .f,
00A1B0:  26 30 00 FF FF 00 00 FF FF 00 00 FF FF 00 00 7B    &0.............{
00A1C0:  B8 FF FF FF FF                                     .....
RESULT OF SEARCH :
PRO=25   CHEA=0   COD=7   MUSI=0   COP=0   GRA=14   WRIT=1   198=1   199=0   STARTER=0   KBI=0   CAAV=0   L.TOURNIER=0  
  W,M/C TUTORooyW!!£FH2# 8!6or!#!!c!c!Cl"# N# wg ''O(#   New Generation Software
  1985BCv%'iV 78BC%&2 pp87PWCl q!Q8QQsYH!!0!"(!(!(! $!XU0 2P!(!2Q!FH2# 8  Do you
 wish to enter lessons   Y/N£       Loading has been stopped£       Please start
 tape recorder£          Loading lessons 1-9£         Loading lessons 10-17£    
     Loading lessons 18-25£         Loading lessons 26-35£            Loading er
ror£sYU3!2jE(fT R(B(Y2v*S1r8!2F r0S(E(#(50!2s3!K2*Pw#  ! 1!() # ""Po#  ,2!2! "nf
"1!"1!E"!"B121!3j! E!1"1!!1*AE (# v#+2!22 E ! 2nf22!22! 2nf2!/2 # ####&38ADDRESS
 MACHINE CODE    SOURCE CODE     ASSEMBLED CODE   LABELS  INSTRUCTIONS Cursor ke
ys, delete, and auto-repeat areas standard. ESC returns you to menu.  C clears a
ll ENTE tabs to next lineA assembles  SPAC tabs in label are Program has success
fully assembled.    Press Run, Edit, or ESC to exit.        Program counter has 
jumped to non-validaddress. EDIT or reRUN program.         You are trying to r0u
n code in allocatedstorage area. RET missing Please EDIT  Press R to run example
, E to  edit,and ESC to return to menu.              Program stopped. You may re
-RUN, EDIT  or press ESC to return to menu.         FLAGS    Registers and Conte
nts    STAC C  Z PV  S                                        zn!2CB(Y*C  64 5(N
(GK((9C(kA 88 a80 C  04 68y w0wx(6656566 666!EF6 oO!E(Gq!C!E2##!Cn,,go#og#g!1V(o
&)))%)r( (eoOw#wwwwwww999999w3w"3q33ww3ww3w333w33wwwwwwww3w3w333"33wwwwww33333ww
wfww33333x(33www33333wwwwwwww3ww3w3w33ww33"""33w333333333w33wwwwwww33333wwwww333
3333w3w33"333"333w33333w3ww333"U33333333Uwwww33 3w333"333ww3333ww33w3w333333333w
33333D333333333333333ww33wwwww333w3wwwwww3U3""3"w33"33333333"w3333333w3""333w333
3w2!1(0V   (!" "!!80( ! !!(T(((j(  !!! !!" "!! !!!""0!!#"!!#"!!/#"!(v(r(t(9(!!/#
"(((" !# " "!" ""8  E nf "!" "g" E(8(t(r(H(J(2(!" "(v(!/#"!" "!" "!" "(".E!z8 E 
,ON#fi1o(21 E#((E   #  (+  # E &8!3$8!13addressthe contents ofmemory locationthe
 numbertoF)))*r&&&&&&'W*p****-++'C'+++5,,,p','''(2(c(,-.-b-(£(--.'.....6/F////0F
0v0(000121d11+)4))#######$$$($3$#1$T$$y$$$$$$$$$%%%E%S%a%g%%%%%%%&&&$&)&.&3&8&&B
&H&N&T&Z&&f&l&accumulatorthe numberHL registerlocation (HL)DE registerB register
C registerif Carry flag iGs set,D registerE registerH registerL registerBC regis
terif Zero flag is set,NOT DEFINEDif Zero flag is not set,if Carry flag is not s
et,IX registerIY registerlocation (IX+offset)location (IY+offset)location (BC)lo
cation (DE)AF registersalternative AF registersStack Pointerif Sign flag is 0, i
e Positive,location (IX)location (IY)stackif Sign flag is 1, ie Minus,if P/V fla
g is nOt set,if P/V flag is sEt,Interrupt vector registerRefresh registerport wh
ose number is in Cport with above numberFlag register0 of1 of2 of3 of4 of5 of6 o
f7 of0000H0008H0010H0018H0020H0028H0030H0038His loaded withhas added to ithas ad
ded to it carry andThe Accumulator has subtracted from ithas taken from it carry
 andis INCremented by 1is DECremented by 1is PUSHed onto stack and SP decremente
d by 2is POPped from stack and SP incremented by 2Accumulator is logically ORed 
withAccumulator is logically ANDed withBC, DE, HL registers are all EXchanged wi
th the alternative setis EXchanqged withAccumulator is NEGated, ie made negative
carry flag is inverted, ie Compliment Carry Flagcarry flag is set, ie Set Carry 
Flagdecimal Adjust AccumulatorNo OPeration is performed, inspite of this it take
s .000001 secs to do itcomputer is HALTed until an interrupt comes to awake it a
gaintest BITSET bitRESet bitblock transfer (BC) bytes starting at (HL) to (DE) i
ncrementingtransfer (HL) to (DE), increment HL and DE, dec BC, reset PV flag if 
BC0block transfer (BC) bytes starting at (HL) to (DE) decrementingtransfer (HL) 
to (DE), decrement HL, DE, and BC, reset PV flag if BC0perform relative jump tod
ecrement B, if zero continue, if Not Zero perform relative jump topush the retur
n address to stack and CALLperform jump toRETurn from Non-maDRskable interrupt N
OT PERFORMED BY SIMULATORRETurn from Interrupt NOT PERFORMED BY SIMULATORRETurn 
address is POPped from the stacksearch from (HL) Incrementing BC bytes for data 
in Accumulatorcompare (HL) with A, increment HL, decrement BCsearch froom (HL) D
ecrementing BC bytes for data in Accumulatorcompare (HL) with A, decrement HL, a
nd BCinvert all bits in A register, ie ComPLimentaccumulator is ComPared withcon
tents of Accumulator is eXclusively ORed withrotate Accumulator Left shifting bi
t 7 into Carryrotate Accumulator and carry Leftrotate Accumulator Right, shiftin
g bit 0 into Carryrotate accumulator and carry Rightrotate Left Decimal contents
 of (HL) with low nibble of Accumulatorrotate Right Decimal contents of (HL) wit
h low nibble oLf Accumulatorchange Interrupt Mode toreSTart at addressiNput from
 port (C), into block from (HL) Incrementing HL for B bytesiNput into (HL) from 
port (C) increment HL, decrement BiNput from port (C), into block from (HL) Decr
ementing HL for B bytesiN%put into (HL) from port (C) Decrement HL, decrement Bi
nput data fromoutput from (HL) to port (C) increment HL, decrement BouTput from 
(HL) to port (C) block from (HL) Incrementing for B bytesoUTput from (HL) to por
t (C) Decrement HL, decrement BouTput3 to port (C), from block from (HL) Decreme
nting HL for B bytesoUTputdisable Interrupts. NOT PERFORMED BY SIMULATOR.enable 
Interrupts. NOT PERFORMED BY SIMULATOR.is Rotated Left shifting bit 7 into Carry
and Carry are rotated Leftis Rotated Right, shifting bit 0 into Carryand Carry a
re Rotated Rightis Shifted Left Arithmetically, 0 enters at bit 0is Shifted Righ
t Arithmetically, sign bit unchangedis Shifted Right Logically, 0 is shifted int
o bit 7X!1v(.nf!  S2 E0!EV(!hF"M2L22 E2,E2!Eo0$#fo( 2!123)E*( !1N(23 213(J (E2  
(E2r(t nf2v (E2)E*o$!EON#fi E#E 3 3oo08E1G(n&3HE1G #3+#fo!3)0'z'Wy'O###S323!3o3o
3+ 0E0Eh'cH $V(d2ERRORd9!6!"!s"! !4cD! W56*1utA6 (9 !7!*1ut 5!1113!E".988  (!97!
hF".9 8!97q ((62w (,!762ww22wN!EV(!hF".9-9(4####4!5!5!c7(Jq6# #w (#w0(yN*115 1s9
1*1F(9N(9V(9(9 9, (90(9(9f(9"1S1*"wf(#w+1H3#3!E".9NT(V(V/ '80EF N 7wh(wy2 7h!7wy
2 (,(y((B*(8 9y8(&($( &6666 7h!- +w!!( !(S12!2K(()(! (E,(Aa708&0"Q Q(s (,(!7A8G8
H Sx!N7y x!a A  787e8Ah(PJP( 8r1((8)(/t12186) v2y##"!7*ut (,()(w#!m71  w#21 w#Y(
8o&!8(NF8 ##"!7!6Y(a(8g(!8g(#68g(8g(gg0 -9£ (7# ( y2!Eo0$#fo*K1+#q#p#"!4w3#! !6!
6n!7nfG(!7# ( (#VGut srnf##RuSpace missingInstr. ,1unknownMissing space or ,Erro
r after inst.Offset too bigCan only ADD IX/INumber missingBracket missingLabel t
oo longNumber too largeLabel not foundNo DEFB, or DEFWOffset missing Error  foun
d  during  assembly.  Pleasecorrect before running program.         d's EaQ2)c)!
B6!CB! (B(##6#6#6#6#   2!5D2!"B!B6#N#Fx#8 0xG#w#r#6#6x!EN#fi22))!CB(V(133!BF %v 
V  A0(E E*N!DV(!DN#fi!N!CB-,.I(Y*ekQAA*B(*B8( *B(nf"1*AQAA*1("1*AMB2MB2BAQAA*B+w
+w"Bnf"1*AQAA*BZB(*BN#F#"BC1*A!C27nfk!CBnfknfAk!CBnFfGk*Bk*Bk!CBnFfGNFAk!CBnFfGF
ANBk!CBnfN  k!CBnfN  Bk!  ,8',0!CB(r0!EC!B272 C!CBfnwutwfxnvuxtv!CB!BN qw #!6#"*
nfO(q#!CBF NV!Bnf"n(*B"B*BsBBsBB"B*B"B!CBwwqp pAqq wdrrGssFwjt"tu(uwqpqx*nf"1*B8
2!C27 ABG("( ($ ($6($($($B($7 (7ppxxPP2! t A13 r A3vA!B2nfnf0E*BRM!0*B#y 2!B213#
#  2 DFE,E.EFLAGS     Registers and Contents     STAC     You are about to affec
t memory area notallocated to you. Please edit program.  You are about to write 
to memory which will affect your program. Please edit.  The program has been com
pleted. You mayEDIT or reRUN. Exit by pressing ESC.    The stack pointer is outs
ide allocated memory area. Please edit program.       There are too many registe
rs called up,to display. Program will RUN as normal.qIIPkkkkPPAAkkkkkkkkkkkF!kkk
kkkkkkPPAAAAAAAAAAAAAkAPPPPPPPkyEEEEEzEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEHDBNNNIIA(SPSPP(C(HL(NN(NDI(IX(IY(BC(DEAF(IX(IY0008101820283038OOOOFHHvH
9HIHFIIIIPPIIJOOOOPJBJlJJOJPP PvOOOOO*P4PPOPORPHPfPPNpPzPPPOPPPPPPJJKDKjKKKKLML0
0200w060 0000&0.0!000*0K"0SC F0 p0N0q0V0r00s0 x0y0z0000 G0O0W00g0o0, 0.041044s,0
.040 A0 B0 C0 D0 E0 H0J0K0L0M0 P0Q0S0T0U0 X0Y0Z000 0a0b0c0e0 h0i0j0k0l0n0f0t0u0D
WDGFFO0  0I0R00d0m0kcAD0 0000000000)0490AD00JZ 0000004zj0SU00 0000000SB00BR 0000
004rb0DE050+0 000-0%07Z00 040IN040#0 0000$0,000430J080"00(0  0J0 00"0006000B0DJN
0CAL0"0 0006000B0RE00 00"06000B0PUS0000!0PO00000C00 0000000O00 0000000XO00 00000
00AN00 000£0000E00200RL 00000000R nt00000000RR 00 000 000R 00000000SL'0  0!0"0#0
&0%0$0SR/0 (0)0*0+0.0-0,0SR0 809000000BING0PO0RW0T0Vg0Xo0Zw0/0NF0PN0RV0T0Vf0Xn0Z
v00N 0P H0R P0T X0V 0X h0Z p0 x0NA0PI0RQ0TY0Va0Xi0Zq0y0NB0PJ0RR0TZ0Vb0Xj0Zr0z0NC
0PK0RS0T0Vc0Xk0Zs00ND0PL0RT0T0Vd0Xl0Zt00NE0PM0RU0T0Ve0Xm0Zu00SEN0P0R0T0V0X0Z00N0
P0R0T0V0X0Z00N 0P 0R 0T 0V 0X 0Z 0 0N0P0R0T0V0X0Z00N0P0R0T0V0X0Z00N0P0R0T0V0X0Z0
0N0P0R0T0V0X0Z00N0P0R0T0V0X0Z00REN0P0R0T0V0X0Z00N0P0R0T0V0X0Z00N 0P 0R 0T 0V 0X 
0Z 0 0N0P0R0T0V0X0Z00N0P0R0T0V0X0Z00N0P0R0T0V£0X0Z00N0P0R0T0V0X0Z00N0P0R0T0V0X0Z
00IJ0Hx H%HPHXHHhHHLHpOUJ0HyH AHQHYHaHiHIINFPVRRS00b0d0f0h0j0l0RLC0RL0RRC0RR0EX0
LDLDILDLDDCPCPICPCPDDA'0CP/0NEDCC0SC70NO0RLoRRgININIININDOUT£OTIOUTOTDD0E0RETMRE
TEHALv0DEF0BI0DEF0Q!P" R3*XQ!7RQQ Q  *XKXB !RQQS*XnfF nfN Q!RQB $  V(21"AQQ*XKXB
Q* RP" R*X##"XP!X"X!" RP2( EN#(+0!6y7n7* RPo#  2A22        Press SPACE to contin
ue.        Press SPACE to select & ENTER to start Please confirm loading require
d    Y/NWWUX&X'X+X2X9XXDXKXRXbXiXyXXXXXXbYXUa/cddevfmgijlmjnopsOurwxyzI!      EX
AMPLES OF BIT MANIPULATION The following illustrates  the  way  inwhich  SET, RE
S, and  BIT can be used tomanipulate individual bits of a registeror memory loca
tion.£            BIT MANIPULATION We have so far treated  information  inthe fo
rm of bytes or words. The Z80 doesallow a number of operations on separateor gro
ups of bits within one byte Any  bit  in   a  register,  or  memorylocation usin
g (HL),  can  be  SET  to a"1". We can also RESet any bit to a "0".To  test  the
   state  of  a  bit  in  aregister, or memory location, we can usethe instructi
on BIT. In this instructionthe Zero flag is set if the  appropriatebit is  "0"  
and reset to a  "0"  if theappropriate  bit  is "1".  Hence we  canproduce our o
wn flags to indicate eventsand then  act  upon  them  later in  ourprograms.£ Su
mmary - bit manipulationSET N,ir    where N is the bit number 0-7SET N,(HL)RES N
,rRES N,(HL)BIT N,rBIT N,(HL)£ LD HL,STORE  SET 6,(HL) LOOP  INC (HL)  BIT 2,(HL
)  JR Z,LOOP  RES 3,(HL)  LD B,5  SET 7,B  RES 2,B  DEC B  BIT 5,B  RET Z   STOR
E BIN 16              LOGICAL INSTRUCTIONS There  are  three logical  instructio
nsavailable  on  the  Z80.   They are  allperformed  on a bit by bit basis betwe
enthe Accumulator and a  number, register,or indirectly addressed  memory locati
on(HL).  The   result   is  left   in  theAccumulator. In the AND instruction, i
f a bit in theAccumulator  AND  other number are  "1",then the corresponding bit
 in the resultwill be "1". If not it will be "0" i.e.      01101100           01
010110   ANDed together gives     01000100 As w'ell as  performing  ANDs on our 
ownflags,  this  instruction  is  useful inmasking off areas of words, or resett
inggroups of bits in the Accumulator.£ In  the OR instruction, if a bit in theAc
cumulator  OR in the other number is a"1", the corresponding bit in the resultwi
ll be "1". If not it will be "0" i.e.      01101100           01010110   ORed to
gether give      01111110 As well as performing  OR operations onour  own  flags
,   this  instruction  isuseful in SETting a group of bits in theAccumulatHor.£ 
In the XOR  (eXclusive OR) instruction,if the  bit in the  Accumulator  is  thes
ame as that in the  number ,  then  thecorresponding  bit in the result will be"
0".  If they are  different it  will be"1". Another way of looking at  the  XORi
nstruction is  if  one  OR the other is"1" but  NOT  both,  the  answer will be"
1". i.e.      01101100           01010110    XORed together give      00111010 A
part  from  performing the logical XORfunction  on  our  own  flags   the  XORin
struction   is  useful   in  invertingindividual or groups of bits.£ The three l
ogical instructions AND, OR,and  XOR  affect  the  Zero,  Sign,  andParity flags
. The Carry flag is reset to"0" in all cases. Thus the limitation ofno   Clear  
Carry  instruction   can  beperformedl by a logical instruction. AND A or OR A w
ill clear the carry flagand not affect any registers. XOR A willclear Carry and 
the Accumulator.£ Summary - logical instructions AND n AND r AND (HL) OR n OR r 
OR (HL) XOR n XOR r XOR (HL)£    EXAMPLEoS OF LOGICAL INSTRUCTIONS The examples 
illustrate  the  operationof  the  logic  instructions.  The pupilshould   test 
  his/her    understandingfurther by modifying the contents of the3 stores.£ LD 
HL,ST2  LD A,(ST1)  AND (HL)  LD (ST3),A  LD A,(ST1)  OR (HL)  LD (ST3),A  LD A,
(ST1)  XOR (HL)  LD (ST3),A  RET   ST1   BIN 65H ST2   BIN FH ST3   BIN 0H      
        SHIFT INSTRUCTIONS A shift instruction is one in which thebits of  a  re
gister or  memory locationare moved sideways, left or right to theadjacent bit. 
 As  we  shall  see,  thisgives us a means  of division as well asmultiplication
.£ The  SRA r,  and  SRA (HL) instructionsshift the  register/memory location (H
L)right,  shifting  bit 0  into  the Carryflag and retaining the statYe of bit 7
. i.e.    7 6 5 4 3 2 1 0   C         0 1 1 0 0 0 1 0   x  (98 dec.) becomes  0 
0 1 1 0 0 0 1   0  (49 dec.)   or     1 1 1 0 0 0 1 0   x  (-30 dec.)becomes  1 
1 1 1 0 0 0 1   0  (-15 dec.) Hence   the   SRA   or    Shift   RightArithmetica
l8ly instruction divides  bothpositive and negative numbers by 2.£ The  SRL r,  
and  SRL (HL) instructionsshift   the   register/memory   locationcontents right
, shifting  bit 0 into theCarry flag and a "0" into bit 7. i.e.    7 6 5 4 3 2 1
 0   C         F51 0 1 1 0 1 1 1   x  (183 dec.)becomes  0 1 0 1 1 0 1 1   1  (9
1 dec.)                               and Carry  The  SRL   or   Shift  Right  L
ogicallyinstruction therefore divides a positivenumber by 2.  As with SRA the Ca
rry flagindicates the half.£ Theq  SLA r,  and  SLA (HL) instructionsshift  the 
register/memory contents leftshifting a "0" into bit 0 and bit 7 intothe Carry f
lag. i.e.    C   7 6 5 4 3 2 1 0         x   0 1 1 0 0 0 1 0  (98 dec.)becomes  
0   1 1 0 0 0 1 0 0  (196 dec.) Hence the result of the instruction SLAor   Shif
t  Left  Arithmetically  is  tomultiply  the  positive number by 2. TheCarry  in
dicates  a  result greater than255.All these instructions  affect  not onlythe C
arry flag,  but the Zero, Sign, andParity flags.£ Summary - shift instructions S
RA r  divides +ve and -ve numbers by 2 SRA (HL) SRL r  divides +ve numbers 0 - 2
55 by 2 SRL (HL) SLA r  multiplies +ve and -ve numbers                          
          by 2 SLA (HL)£    EXAMPLES OF SHIFT INSTRUCTIONS The6   three   shift 
 instructions   areillustrated  using a fixed initial valuein the memory locatio
n STORE.£ LD HL,STORE  LD B,5 LOOP1 SRA (HL)  DJNZ LOOP1  LD (HL),A5H  LD B,5 LO
OP2 SLA (HL)  DJNZ LOOP2  LD B,8 LOOP3 SRL (HL)  DJNZ LOOP3  RET  £M STORE BIN 6
9H                ROTATE INSTRUCTIONS These  instructions are shift instruct-ion
s in which the bit that falls out oneend of the register  or memory  locationis 
pushed back into the  other end.  TheCarry flag  either  forms  part  of  thenum
ber shifted, thereby making it 9 bitslong, or duplicates the state of the bittha
t fell out of the register. There aretherefore   four   different   types  ofrot
ate.£ RLC r, and RLC (HL) (namely Rotate LeftCarry duplicating ), shifts the con
tentsleft, bit U7 rotating into bit 0, and theCarry duplicating the transferred 
bit. i.e.    C  7 6 5 4 3 2 1 0         x  1 0 1 1 0 0 0 1becomes  1  0 1 1 0 0 
0 1 1  old bit 71 RL r, and RL (HL)  Rotate Left, rotatesthe  register/memory lo
cation  with  theCarry as ia 9th bit, left. i.e.    C  7 6 5 4 3 2 1 0         c
  1 0 1 1 0 0 0 1becomes  1  0 1 1 0 0 0 1 c  cold Carry RL  instructions can be
 strung togetherto multiply  any  length  number  by  2,since the  Carry  is tra
nsferred betweenrepeated RL instructions.£ RRC r,  RRC (HL)  instructions  (Rota
teRight Carry being duplicated) is similarto the  RLC  instruction  but is a rig
htshift.  Bit 0 is  shifted into bit 7 andthe Carry duplicates the old bit 0. i.
e.    7 6 5 4 3 2 1 0  C         1 0 1 1 0 0 0 1  xbecomes  1 1 0 1 1 0 0 0  1  
old bit 01 RR r, and RR (HL) instructions ( RotateRight ) is similar to RL excep
t that theshift around the 9 bits is to the right. i.e.    7 6 5 4 3 2 1 0  C   
      1 0 1 1 0 0 0 1  cbecomes  c 1 0 1 1 0 0 0  1  cold Cfjarry RR instruction
s can be strung  togetherto divide any length number by 2.£ RLC and RRC  instruc
tions are useful insequentially   interrogating  the  wholecontents of a registe
r without  corrupt-ing its contents. All the above rotate instructions  RLC,RL, 
 RRC, and  RR  not  only  affect theCarry flag  but also  the Zero, Sign andPari
ty   flags,  as   have   all   shiftinstructions discussed. There  are  4 other 
rotate instructionsthat  involve the Accumulator only. Theyare RLCA,  RLA,  RRCA
, and RR#gA. They areidentical to  RLC A,  RL A,  RRC A,  andRR A, but only  aff
ect  the  Carry flag,and are twice as fast.£ Summary - rotate instructions RLC r
  rotate r left, carry  duplicates RLC (HL) RLCA   rotate A left, carry  duplica
tes RL r   rotate r and carry left RL (HL) RLA    rotate A and carry left RRC r 
 rotate r right, carry duplicates RRC (HL) RRCA   rotate A right, carry duplicat
es RR r   rotate r and Carry right RR (HL) RRA      rotate A and Carry right£   
 EXAMPLES OF ROTATE INSTRUCTIONS These examples illustrate the operationof  rota
te   instructions.   Modify  theinitial condition of the location  STOREto inves
tigate their operation further.£ LD HL,STORE  LD B,8 LOOP1 RLC (HL)  DJNZ LOOP1 
 LD B,8 LOOP2 RL (HL)  DJNZ LOOP2  LD B,8 LOOP3 RRC (HL)  DJNZ LOOP3  LD B,8 LOO
P4 RR (HL)  DJNZ LOOP4  RET STORE BIN 69H       EXAMPLE USING ROTATE AND SHIFT T
his example  uses  shifts  and  rotateinstructions  to  multiply  two  8   bitnu
mbers together.  One number is rotatedto examine  each bit in turn.  The othernu
mber is also shifted and  added to thetotal if the  bit is set. This method isfa
r quicker than the  method of repeatedaddition.£ LD HL,0  LD DE,(NUM2)  LD A,(NU
M1) LOOP  RR A  JR NC,JP1  ADD HL,DE JP1   RET Z  SLA E  RL D  JR LOOP   NUM1  D
EFB 212 NUM2  DEFB 203  DEFB 0                   DECIMAL ROTATE The  Z80  allows
  us to rotate left andright nibbles as well as bits. RLD  Rotates the Decimal n
umber Left RRD  Rotates the Decimal number Right Th e   best   way   to   descri
be  theseoperations    is    by   example.   Bothinstructions  involve  the  Acc
umulator,and   the   memory  location  (HL).  Theexamples are in  Binary Coded D
ecimal ofcourse,  each digit taking up one nibbleor  four  bits of tnhe register
 or memorylocation.£             A after   (HL)    A before                     
   5 4        x 3 after RLD     x 5     4 3where  x is any number and is unaffec
tedby the instruction. As can be  seen the effect of stringingtogether RLD instr
uctions is to multiplya  decimal  number  by  10.  It is  alsouseful in isolatin
g the high digit  fromthe two digit number.£             A after   (HL)    A bef
ore                x 5     4 3 after RRD             5 4       x 3 The  RRD  ins
truction therefore dividesthe decimal number by 10. It can also bestrung togethe
r to divide any length BCDnumber  by 10.  The low digit of the twodigit  decimal
 number can be isolated bythis instruction.£ Summary - decimal shiftsRLD    Rota
te Left Decimal  (*10)RRD    Rotate Right Decimal (/10)£      EXAMPLES OF DECIMA
L ROTATION These     examples    illustrate    themultiplication   and   divisio
n  of  BCDnumbers by ten.£ LD HL,STORE  LD A,0  RLD  INC HL  RLD    LD A,0  RRD 
 DEC HL  RRD  RET     STsORE DEFW 254H                  INTRODUCTION This  group
  of lessons will  introducethe idea of bit manipulation and its usein  flag  op
erations  and  in  producingfaster methods of multiplication. But first  we shal
l look further at theprocessors fl4ags.£             LESSONS  18 - 25 18.  Parit
y 19.  The flag register and AF 20.  S and P/V flags in instructions            
 Ex - sign and parity flags  21.  Bit manipulation           Ex - bit manipulati
on 22.  Logical instructions           Ex - logical instructions 23.  Shift inst
ructions           Ex - shift instructions 24.  Rotate instructions           Ex
 - rotate instructions 1           Ex - rotate instructions 2 25.  Decimal rotat
ing           Ex - decimal rotation Load further lessons from tape£             
    PARITY When data is transmitted from one placeto another, it is possible for
 errors toappear in the received data. Parity is asimple way of detecting single
 errors indata.  An additional bit is added to thedata that makesI the total num
ber of "1"sin the  word  an  even  number.   If thereceived  word  does  not  ha
ve  an evennumber  of "1"s in it, then an error hasoccurred.   In  addition  to 
 this  evenparity we could use  odd  parity,  wherethe word is made to have  an 
 odd numberof "1"s in it. The  Z80  has a flag that is set if thenumber of "1"s 
in a number is even. Thisflag  is in fact  the  same flag  as theoverflow flag. 
 It  is  termed  the  P/Vflag.£ i.e.0 0 1 1 0 1 0 0   parity flag is not set    
              s'ince  number  of "1"s                  is 3.   i.e. odd.0 1 0 0 
0 1 1 1   parity  flag   is  set                  since  number  of "1"s        
          is 4.   i.e. even. The  instruction  performed  determinesthe meaning 
of the P/V flag. Of  all  w$the instructions  described todate  only  DAA  treat
s  it  as a parityflag.  All others either have  no effecton it  or use it as  a
n  overflow  flag.All subsequent instructions either  haveno effect on it or use
 it as parity.£ THE FLAG REGISTER AND AF REGISTER PAIR We  have  discussed flags
 as individualbits.  This is the way they are normallyused.   They are however a
ctually storedin the Z80 in a register, designated  asF  or  flag  register.  Th
e  flags   arearranged as follows -   bit  0      C    JCarry   bit  1      N   
 Subtract last   bit  2     P/V   Parity and overflow   bit  3           Not use
d   bit  4      H    Half carry   bit  5           Not used   bit  6      Z    Z
ero   bit  7      S    Sign£ The Flag  register  sometimes  forms 1  aregister  
pair  in  conjunction with theAccumulator. This pair is called AF. Theonly instr
uctions  previously  mentionedthat involve this register pair are PUSHand POP.£ 
    S and P/V FLAGS IN INSTRUCTIONS The sign  and  parity flags can be usedin  a
ljl  absolute ( NOT relative) jumps,calls, and returns. The notation is - JP PO,
nn  CALL PO,nn  RET PO                           Parity odd0  JP PE,nn  CALL PE,
nn  RET PE                           Parity even1 JP P,nn   CALL P,nn   RET P   
Sign +kCve JP M,nn   CALL M,nn   RET M   Sign -ve If the condition is not met th
e programwill  not  jump,  call a  subroutine, orreturn.£        EXAMPLE OF JUMP
 ON SIGN This  example  is a simple  program  toillustrate  JP P,nn , and JP M,n
n  jumpif positiveh and jump if minus. Note thatthe  carry  is  still   operativ
e,   andtherefore, if you do not clear it beforeADC  and SBC  the  later jump  c
ould  beunexpected. In this example the carry isnot cleared, so "look before you
 leap".£ LD HL,52  LD DE,33  LD B!oC,5 LOOP1 SBC HL,DE  LD (LREG),HL  JP P,LOOP1
 LOOP2 ADC HL,BC  LD (LREG),HL  JP M,LOOP2  RET Z  JR LOOP1   LREG  BIN 0 HREG  
BIN 0     berepresented by C9B8 hex. Conversion  of  a  hex  number  to  itsdeci
mal equivalent follows the  standar dcalculation.i.e.  B8 hex  (B hex)* 16+ (8)*
 1              11*16+8184 Always remember that a hex number has abase of 16 dec
imal, a decimal number hasa base of 10  and a binary number a basebase 2.£    EX
AMPLES OF HEXADECIMAL NOTATION Now  that  hex notation has been intro-duced we  
can discuss  how  the computerstores  programs  in  more  detail.   Asalready   
mentioned,  the   instructionsare  stored   memory  as  numbers.  Someinstructio
ns   only   require  a  singlenumber, others require more.F Column 2 onthe Simul
ator display shows  the  memorycontents for the instructions in hex. All the  nu
mbers  used  to  describe aninstruction are  given in sequence alongthe line.  N
otice that numbers called upin an instruction appear towards the endof the strin
g  of  numbers. The  earliernumbers    determine    the   type    ofinstruction.
 Since the  total  number ofinstructions   exceed   256,  a   prefixnumber is us
ed to  produce other sets ofinstructions. The prefixes you will findare ED, CB, 
DD and FD.£ Luckily assemblers takes account of allthese  complexities,  and  yo
u  will notneed  to  learn  which numbers representwhich instructions. The Simul
ator  can  be switched betweendecimal   and   hexadecimal  display  bypressing s
hift  "T",  when a program  isnot running.£ LD A,25H  ADD A,A  DAA  LD HL,4589H 
 LD DE,3812H  LD A,L  SUB E  DAA  LD L,A  LD A,H  SBC A,D  DAA  LD H,A  RET     
     BINARY CODED DECIMAL NOTATION We  would  still  like  to  be  able toperfor
m calculations  on decimal numberswithout  having  to convert to binary orhexade
cimal form. Hexidecimal form holdsa key to a method of achieving this. The  hex 
digit  requires  adjustment toavoid the digits  A-F.  Adding  6 to thedigit, if 
these symbols appear,  resultsin correct adjustment. Take  the  hex  number  C  
( 12 dec.).Adding  6  gives  18  decimal or 12 hex.Hence the hex number looks  i
dentical tothe decimal answer required.£ Each digit is  held  in  4  bits of the
register.   These  4  bits are called  anibble, the whole 8 bit word is termed a
byte. Who said programmers have no senseof humour This  presentation  is  termed
   BinaryCoded Decimal or BCD. The   Z80    accommodates   the   aboveadjustment
,  with the instruction   DAA,or  Decimal  Adjust  Accumulator.   Thisinstructio
n  is  used  after  an  8  bitADD,  ADC,  SUB,  or  SBC  to adjust theAccumulato
r contents by adding 6  to thenibble,  if either  nibble in the answeris above 9
.£ To perform  this operation the Z80 usestwo further flags, the  H  flag (C a H
alfcarry  between  nibbles ),  and  N  flag(subtract  instruction  performed las
t).Since  these  flags  cannot be tested aspart of a conditional jump etc. they 
areof little use.£     EXAMPLES OF B.C.D. NOTATION These examples show simple ad
dition andrusubtraction in  BCD format.  Remember tokeep  in   Hex  display   mo
de   or  theillustrations will not appear in BCD.£ LD A,25H  LD HL,STORE  LD DE,
2468H  INC (HL)  RET    BIN 65H  BIN 87H  BIN 9AH  BIN DFH  BIN FFH  BIN 64H   S
TORE DEFB 64       POSITIVE AND NEGATIVE NUMBER NOTATION So far we have only dea
lt with positivenumbers.  If we had taken  6  from  5 wewould end  up with  the 
answer 255  withcarry set. There is an interpretation ofnumbers  that allows us 
to consider thisanswer as the negative number -1. In  this  interpretation  -1 m
ust equal255 or 11111111, or the processor  wouldnot be able to take  6  from  5
  and getthe right answer. Further 5-7 -2 or 254or 11111110. Bit 7, the most sig
nificantbit, represents  the sign ( + oQr - )  ofthe number. When bit 7 is "1" t
he numberis negative,  and when "0" the number ispositive.£ A  useful operation 
would  be to make apositive number negative. Changing bit 7does  not  do  this. 
 Take the  positivenumber  2 or  00000010  and its negativeequivalent -2  or 111
11110  for example.Inverting all bits of the  binary numberof  +2  gives  111111
01, which is 1 lessthan that  for -2.Hence to make a positive number negativewe 
invert all its binary bits,  known asComplimenting, and add  1.  The nzhotationi
s generally termed 2s complement£i.e.         0 0 0 0 0 1 0 1    +5    invert   
1 1 1 1 1 0 1 0  add 1      1 1 1 1 1 0 1 1    -5    invert   0 0 0 0 0 1 0 0  a
dd 1      0 0 0 0 0 1 0 1    +5 The  operation  luckily  also  makes  anegative 
  number    positive.   A  veryimportant point. The largest positive number we c
an holdin  a   single   register,  using   thisnotation is  01111111   or  127  
and thelargest  negative   number  10000000  or-128.£ The  Z80  has two instruct
ions that maybe -used for these operations CPL   complements    or   inverts   t
he       contents of the Accumulator. NEG   negates,  or makes  negative, the   
    contents  of  the  Accumulator by       complementing and adding 1 in one   
    operation. A Sign flag FR(S) is provided on the Z80.It duplicates  the sign 
( bit 7 ) of theanswer after any arithmetic operation onthe Accumulator.  The  s
ign  flag is "0"for  a  positive  result  and  "1" for anegative result.£ When p
erforming  arithmetic  operationswhich  we  wish  to interpret within therange  
-128 to +127, the Carry  flag  nolonger  signals  an out of range result.However
 another flag, the overflow (P/V)flag  does.  It  is  a  "1" whenever theanswer 
is outside the range -128 to +127and  "0"  within   the   range.   It  iseffecti
vely  a  carry  into  bit 7 whichwould make the sign bit incorrect.£ There  is  
no  reason for sticking to 8bits  using this method.  So long as thenumber of  b
its is  sufficient  and  themost  significant  bit  is  taken as thesign  bit  a
ny size positive or negativenumber can be represented. Performing a similar calc
ulation to theabove  we can  show that a register paircan  represent  a  number 
 in the  range+32767 to -32768. The  Sign and  overflow  flags are alsooperative
 after  AvDC and SBC instructionon the HL register. It reflects the 15thbit (or 
bit 7 of H register) .£ It is important  to  remember  that theZero,  Carry,  Si
gn, and  overflow flagsare always operative  after  an   8  bitarithmetic  instr
uction   or  a  16  bitaddition   involving   the  Carry.  Yourinterpretation of
 the  result determinesin   which   flag(s)   you   should   beinterested in.£  
  EXAMPLES OF +VE AND -VE NOTATION Although  these  examples  appear to beall po
sitive, they can be viewed equallyas  nee%gative  where appropriate and  theSign
   and   overflow   flags   observedoperating. Remember  a   number   above   12
8   isnegative. Since all the negative numbersin the examples are small,  they  
can beseen quickly and simply be converted  bysubtractinSg the number from 256. 
i.e.  -2  is equivalent to 254 etc.£ LD A,254  NEG  NEG  ADD A,2  INC A  LD HL,2
  LD DE,FFFEH  ADD HL,DE  CPL  LD HL,STORE  LD (HL),7FH  INC (HL)  RET   STORE B
IN 0   88($"88(H0$ff$/ yyyyyyy2ve "TEXT2",B,&5800,&5500 TER"ad00179,&ed,&78,&cb,
&47&1b,&7a,&B3 f,&0
Tous droits réservés. Reproduction sans autorisation interdite. © Kukulcan