Firmware Guide (UK) (Disk 1 face 2) (19xx) [UTILITAIRE].dsk
HexaDumpAscii only
000000:  45 58 54 45 4E 44 45 44 20 43 50 43 20 44 53 4B    EXTENDED CPC DSK
000010:  20 46 69 6C 65 0D 0A 44 69 73 6B 2D 49 6E 66 6F     File..Disk-Info
000020:  0D 0A 53 41 4D 64 69 73 6B 31 32 30 34 31 37 00    ..SAMdisk120417.
000030:  28 01 00 00 13 13 13 13 13 13 13 13 13 13 13 13    (...............
000040:  13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13    ................
000050:  13 13 13 13 13 13 13 13 13 13 13 13 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:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
000110:  00 00 00 00 02 09 50 E5 00 00 C1 02 00 00 00 02    ......P.........
000120:  00 00 C2 02 00 00 00 02 00 00 C3 02 00 00 00 02    ................
000130:  00 00 C4 02 00 00 00 02 00 00 C5 02 00 00 00 02    ................
000140:  00 00 C6 02 00 00 00 02 00 00 C7 02 00 00 00 02    ................
000150:  00 00 C8 02 00 00 00 02 00 00 C9 02 00 00 00 02    ................
000160:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000170:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000180:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000190:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0001F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000200:  00 43 48 41 50 2D 31 30 20 D0 31 20 00 00 00 80    .CHAP-10 .1 ....
000210:  1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C    ... !"#$%&'()*+,
000220:  00 43 48 41 50 2D 31 30 20 D0 31 20 01 00 00 02    .CHAP-10 .1 ....
000230:  2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    -...............
000240:  00 43 48 41 50 2D 31 30 20 D0 32 20 00 00 00 80    .CHAP-10 .2 ....
000250:  2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D    ./0123456789:;<=
000260:  00 43 48 41 50 2D 31 30 20 D0 32 20 01 00 00 05    .CHAP-10 .2 ....
000270:  3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    >...............
000280:  00 43 48 41 50 2D 31 31 20 A0 20 20 00 00 00 54    .CHAP-11 .  ...T
000290:  3F 40 41 42 43 44 45 46 47 48 49 00 00 00 00 00    ?@ABCDEFGHI.....
0002A0:  00 43 48 41 50 2D 31 32 20 A0 20 20 00 00 00 51    .CHAP-12 .  ...Q
0002B0:  4A 4B 4C 4D 4E 4F 50 51 52 53 54 00 00 00 00 00    JKLMNOPQRST.....
0002C0:  00 43 48 41 50 2D 31 33 20 A0 20 20 00 00 00 47    .CHAP-13 .  ...G
0002D0:  55 56 57 58 59 5A 5B 5C 5D 00 00 00 00 00 00 00    UVWXYZ[\].......
0002E0:  00 43 48 41 50 2D 31 34 20 D0 31 20 00 00 00 80    .CHAP-14 .1 ....
0002F0:  5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D    ^_`abcdefghijklm
000300:  00 43 48 41 50 2D 31 34 20 D0 32 20 00 00 00 7D    .CHAP-14 .2 ...}
000310:  6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D    nopqrstuvwxyz{|}
000320:  00 43 48 41 50 2D 31 34 20 D0 33 20 00 00 00 27    .CHAP-14 .3 ...'
000330:  7E 7F 80 81 82 00 00 00 00 00 00 00 00 00 00 00    ~...............
000340:  00 43 48 41 50 2D 31 35 20 D0 31 20 00 00 00 7F    .CHAP-15 .1 ....
000350:  83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92    ................
000360:  00 43 48 41 50 2D 31 35 20 D0 32 20 00 00 00 80    .CHAP-15 .2 ....
000370:  93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2    ................
000380:  00 43 48 41 50 2D 31 35 20 D0 32 20 01 00 00 03    .CHAP-15 .2 ....
000390:  A3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    £...............
0003A0:  00 43 48 41 50 2D 31 35 20 D0 33 20 00 00 00 71    .CHAP-15 .3 ...q
0003B0:  A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 00    ................
0003C0:  00 43 48 41 50 2D 39 20 20 D0 31 20 00 00 00 80    .CHAP-9  .1 ....
0003D0:  02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11    ................
0003E0:  00 43 48 41 50 2D 39 20 20 D0 31 20 01 00 00 01    .CHAP-9  .1 ....
0003F0:  12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
000400:  00 43 48 41 50 2D 39 20 20 D0 32 20 00 00 00 4E    .CHAP-9  .2 ...N
000410:  13 14 15 16 17 18 19 1A 1B 1C 00 00 00 00 00 00    ................
000420:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000430:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000440:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000450:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000460:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000470:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000480:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000490:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0004F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000500:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000510:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000520:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000530:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000540:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000550:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000560:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000570:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000580:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000590:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0005F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000600:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000610:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000620:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000630:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000640:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000650:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000660:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000670:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000680:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000690:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0006F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000700:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000710:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000720:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000730:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000740:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000750:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000760:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000770:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000780:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000790:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0007F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000800:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000810:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000820:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000830:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000840:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000850:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000860:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000870:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000880:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000890:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0008F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000900:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000910:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000920:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000930:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000940:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000950:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000960:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000970:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000980:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000990:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0009F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
000A00:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
000A10:  20 20 20 39 20 41 4D 53 44 4F 53 0D 0A 0D 0A 20       9 AMSDOS.... 
000A20:  20 20 20 20 20 20 41 4D 53 44 4F 53 20 69 73 20          AMSDOS is 
000A30:  61 20 64 69 73 63 20 6F 70 65 72 61 74 69 6E 67    a disc operating
000A40:  20 73 79 73 74 65 6D 20 75 73 65 64 20 20 77 69     system used  wi
000A50:  74 68 20 20 61 6C 6C 20 20 74 68 65 20 20 43 50    th  all  the  CP
000A60:  43 20 20 72 61 6E 67 65 20 20 6F 66 0D 0A 20 20    C  range  of..  
000A70:  20 20 20 20 20 63 6F 6D 70 75 74 65 72 2C 20 6F         computer, o
000A80:  66 20 63 6F 75 72 73 65 2C 20 69 6E 20 74 68 65    f course, in the
000A90:  20 63 61 73 65 20 6F 66 20 20 74 68 65 20 20 34     case of  the  4
000AA0:  36 34 20 20 74 68 65 20 20 44 44 49 2D 31 20 20    64  the  DDI-1  
000AB0:  68 61 73 20 20 74 6F 20 20 62 65 0D 0A 20 20 20    has  to  be..   
000AC0:  20 20 20 20 66 69 74 74 65 64 2E 20 41 4D 53 44        fitted. AMSD
000AD0:  4F 53 20 65 6E 61 62 6C 65 73 20 70 72 6F 67 72    OS enables progr
000AE0:  61 6D 73 20 74 6F 20 62 65 20 61 63 63 65 73 73    ams to be access
000AF0:  20 64 69 73 63 20 66 69 6C 65 73 20 69 6E 20 20     disc files in  
000B00:  61 20 20 73 69 6D 69 6C 61 72 0D 0A 20 20 20 20    a  similar..    
000B10:  20 20 20 6D 61 6E 6E 65 72 20 74 6F 20 63 61 73       manner to cas
000B20:  73 65 74 74 65 20 66 69 6C 65 73 2C 20 69 6E 64    sette files, ind
000B30:  65 65 64 20 65 78 69 73 74 69 6E 67 20 70 72 6F    eed existing pro
000B40:  67 72 61 6D 73 20 77 68 69 63 68 20 63 75 72 72    grams which curr
000B50:  65 6E 74 6C 79 20 75 73 65 0D 0A 20 20 20 20 20    ently use..     
000B60:  20 20 74 68 65 20 63 61 73 73 65 74 74 65 20 73      the cassette s
000B70:  68 6F 75 6C 64 20 62 65 20 61 62 6C 65 20 74 6F    hould be able to
000B80:  20 20 75 73 65 20 20 64 69 73 63 20 20 66 69 6C      use  disc  fil
000B90:  65 73 20 20 77 69 74 68 20 20 6C 69 74 74 6C 65    es  with  little
000BA0:  20 20 6F 72 20 20 6E 6F 0D 0A 20 20 20 20 20 20      or  no..      
000BB0:  20 6D 6F 64 69 66 69 63 61 74 69 6F 6E 2E 20 54     modification. T
000BC0:  68 65 20 6D 61 69 6E 20 73 6F 75 72 63 65 20 6F    he main source o
000BD0:  66 20 69 6E 63 6F 6D 70 61 74 61 62 69 6C 69 74    f incompatabilit
000BE0:  79 20 20 77 69 6C 6C 20 20 62 65 20 20 66 69 6C    y  will  be  fil
000BF0:  65 6E 61 6D 65 73 2C 0D 0A 20 20 20 20 20 20 20    enames,..       
000C00:  41 4D 53 44 4F 53 20 66 69 6C 65 6E 61 6D 65 73    AMSDOS filenames
000C10:  20 6D 75 73 74 20 63 6F 6E 66 6F 72 6D 20 74 6F     must conform to
000C20:  20 43 50 2F 4D 20 73 74 61 6E 64 61 72 64 73 20     CP/M standards 
000C30:  62 75 74 20 63 61 73 73 65 74 74 65 20 66 69 6C    but cassette fil
000C40:  65 6E 61 6D 65 73 0D 0A 20 20 20 20 20 20 20 61    enames..       a
000C50:  72 65 20 66 61 72 20 6C 65 73 73 20 72 65 73 74    re far less rest
000C60:  72 69 63 74 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20    ricted.......   
000C70:  20 20 20 20 41 4D 53 44 4F 53 20 68 61 73 20 62        AMSDOS has b
000C80:  65 65 6E 20 64 65 73 69 67 6E 65 64 20 74 6F 20    een designed to 
000C90:  63 6F 6D 70 6C 65 6D 65 6E 74 20 43 50 2F 4D 2C    complement CP/M,
000CA0:  20 6E 6F 74 20 74 6F 20 63 6F 6D 70 65 74 65 20     not to compete 
000CB0:  20 77 69 74 68 20 20 69 74 2E 0D 0A 20 20 20 20     with  it...    
000CC0:  20 20 20 54 68 65 79 20 73 68 61 72 65 20 74 68       They share th
000CD0:  65 20 73 61 6D 65 20 66 69 6C 65 20 73 74 72 75    e same file stru
000CE0:  63 74 75 72 65 20 61 6E 64 20 63 61 6E 20 72 65    cture and can re
000CF0:  61 64 20 61 6E 64 20 77 72 69 74 65 20 65 61 63    ad and write eac
000D00:  68 20 6F 74 68 65 72 27 73 0D 0A 20 20 20 20 20    h other's..     
000D10:  20 20 66 69 6C 65 73 2E 0D 0A 0D 0A 20 20 20 20      files.....    
000D20:  20 20 20 41 4D 53 44 4F 53 20 72 65 73 69 64 65       AMSDOS reside
000D30:  73 20 69 6E 20 74 68 65 20 73 61 6D 65 20 52 4F    s in the same RO
000D40:  4D 20 61 73 20 74 68 65 20 43 50 2F 4D 20 42 49    M as the CP/M BI
000D50:  4F 53 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    OS.......       
000D60:  39 2E 31 20 46 65 61 74 75 72 65 73 2E 0D 0A 0D    9.1 Features....
000D70:  0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 44 4F 53    ...       AMSDOS
000D80:  20 70 72 6F 76 69 64 65 73 20 74 68 65 20 66 6F     provides the fo
000D90:  6C 6C 6F 77 69 6E 67 20 66 61 63 69 6C 69 74 69    llowing faciliti
000DA0:  65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    es:....         
000DB0:  20 20 20 20 20 20 20 53 77 69 74 63 68 69 6E 67           Switching
000DC0:  20 74 68 65 20 63 61 73 73 65 74 74 65 20 69 6E     the cassette in
000DD0:  70 75 74 20 61 6E 64 20 6F 75 74 70 75 74 20 73    put and output s
000DE0:  74 72 65 61 6D 73 20 74 6F 20 20 61 6E 64 20 20    treams to  and  
000DF0:  66 72 6F 6D 0D 0A 20 20 20 20 20 20 20 20 20 20    from..          
000E00:  20 20 20 20 20 20 64 69 73 63 2E 20 53 6F 20 74          disc. So t
000E10:  68 61 74 20 61 6C 6C 20 74 68 65 20 66 61 63 69    hat all the faci
000E20:  6C 69 74 69 65 73 20 61 76 61 69 6C 61 62 6C 65    lities available
000E30:  20 20 6F 6E 20 20 74 68 65 20 20 63 61 73 73 65      on  the  casse
000E40:  74 74 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    tte..           
000E50:  20 20 20 20 20 62 65 63 6F 6D 65 20 61 76 61 69         become avai
000E60:  6C 61 62 6C 65 20 6F 6E 20 64 69 73 63 2E 0D 0A    lable on disc...
000E70:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
000E80:  20 20 44 69 73 70 6C 61 79 69 6E 67 20 74 68 65      Displaying the
000E90:  20 64 69 73 63 20 64 69 72 65 63 74 6F 72 79 2E     disc directory.
000EA0:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
000EB0:  20 20 20 20 45 72 61 73 69 6E 67 20 64 69 73 63        Erasing disc
000EC0:  20 66 69 6C 65 73 2E 0D 0A 0D 0A 20 20 20 20 20     files.....     
000ED0:  20 20 20 20 20 20 20 20 20 20 20 52 65 6E 61 6D               Renam
000EE0:  69 6E 67 20 64 69 73 63 20 66 69 6C 65 73 2E 0D    ing disc files..
000EF0:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
000F00:  20 20 20 53 65 6C 65 63 74 69 6E 67 20 74 68 65       Selecting the
000F10:  20 64 65 66 61 75 6C 74 20 64 72 69 76 65 20 61     default drive a
000F20:  6E 64 20 75 73 65 72 2E 0D 0A 0D 0A 0D 0A 0D 0A    nd user.........
000F30:  20 20 20 20 20 20 20 57 68 65 6E 65 76 65 72 20           Whenever 
000F40:  41 4D 53 44 4F 53 20 63 72 65 61 74 65 73 20 61    AMSDOS creates a
000F50:  20 6E 65 77 20 66 69 6C 65 20 69 74 20 69 73 20     new file it is 
000F60:  61 6C 77 61 79 73 20 67 69 76 65 6E 20 61 20 20    always given a  
000F70:  6E 61 6D 65 20 20 77 69 74 68 20 20 61 0D 0A 20    name  with  a.. 
000F80:  20 20 20 20 20 20 74 79 70 65 20 70 61 72 74 20          type part 
000F90:  6F 66 20 2E 24 24 24 20 72 65 67 61 72 64 6C 65    of .$$$ regardle
000FA0:  73 73 20 6F 66 20 74 68 65 20 20 67 69 76 65 6E    ss of the  given
000FB0:  20 20 6E 61 6D 65 2E 20 20 57 68 65 6E 20 20 74      name.  When  t
000FC0:  68 65 20 20 66 69 6C 65 20 20 69 73 0D 0A 20 20    he  file  is..  
000FD0:  20 20 20 20 20 63 6C 6F 73 65 64 20 61 6E 79 20         closed any 
000FE0:  70 72 65 76 69 6F 75 73 20 76 65 72 73 69 6F 6E    previous version
000FF0:  20 6F 66 20 74 68 65 20 66 69 6C 65 20 69 73 20     of the file is 
001000:  72 65 6E 61 6D 65 64 20 77 69 74 68 20 20 61 20    renamed with  a 
001010:  20 2E 42 41 4B 20 20 74 79 70 65 0D 0A 20 20 20     .BAK  type..   
001020:  20 20 20 20 70 61 72 74 20 61 6E 64 20 74 68 65        part and the
001030:  20 6E 65 77 20 76 65 72 73 69 6F 6E 20 69 73 20     new version is 
001040:  72 65 6E 61 6D 65 64 20 66 72 6F 6D 20 2E 24 24    renamed from .$$
001050:  24 20 74 6F 20 69 74 73 20 70 72 6F 70 65 72 20    $ to its proper 
001060:  6E 61 6D 65 2E 20 20 41 6E 79 0D 0A 20 20 20 20    name.  Any..    
001070:  20 20 20 65 78 69 73 74 69 6E 67 20 2E 42 41 4B       existing .BAK
001080:  20 76 65 72 73 69 6F 6E 20 69 73 20 64 65 6C 65     version is dele
001090:  74 65 64 2E 20 54 68 69 73 20 67 69 76 65 73 20    ted. This gives 
0010A0:  61 6E 20 20 61 75 74 6F 6D 61 74 69 63 20 20 6F    an  automatic  o
0010B0:  6E 65 20 20 6C 65 76 65 6C 0D 0A 20 20 20 20 20    ne  level..     
0010C0:  20 20 66 69 6C 65 20 62 61 63 6B 2D 75 70 2E 0D      file back-up..
0010D0:  0A 0D 0A 20 20 20 20 20 20 20 46 6F 72 20 65 78    ...       For ex
0010E0:  61 6D 70 6C 65 2C 20 69 66 20 74 68 65 20 64 69    ample, if the di
0010F0:  73 63 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20    sc contains the 
001100:  66 69 6C 65 73 20 46 52 45 44 2E 42 41 53 20 61    files FRED.BAS a
001110:  6E 64 20 46 52 45 44 2E 42 41 4B 20 20 61 6E 64    nd FRED.BAK  and
001120:  0D 0A 20 20 20 20 20 20 20 74 68 65 20 75 73 65    ..       the use
001130:  72 20 6F 70 65 6E 73 20 61 20 66 69 6C 65 20 63    r opens a file c
001140:  61 6C 6C 65 64 20 46 52 45 44 2E 42 41 53 20 74    alled FRED.BAS t
001150:  68 65 20 41 4D 53 44 4F 53 20 20 77 69 6C 6C 20    he AMSDOS  will 
001160:  20 63 72 65 61 74 65 20 20 61 20 20 6E 65 77 0D     create  a  new.
001170:  0A 20 20 20 20 20 20 20 66 69 6C 65 20 63 61 6C    .       file cal
001180:  6C 65 64 20 46 52 45 44 2E 24 24 24 2E 20 57 68    led FRED.$$$. Wh
001190:  65 6E 20 74 68 65 20 66 69 6C 65 20 69 73 20 63    en the file is c
0011A0:  6C 6F 73 65 64 20 74 68 65 20 65 78 69 73 74 69    losed the existi
0011B0:  6E 67 20 46 52 45 44 2E 42 41 4B 20 69 73 0D 0A    ng FRED.BAK is..
0011C0:  20 20 20 20 20 20 20 64 65 6C 65 74 65 64 2C 20           deleted, 
0011D0:  46 52 45 44 2E 42 41 53 20 69 73 20 72 65 6E 61    FRED.BAS is rena
0011E0:  6D 65 64 20 74 6F 20 46 52 45 44 2E 42 41 4B 20    med to FRED.BAK 
0011F0:  61 6E 64 20 46 52 45 44 2E 24 24 24 20 69 73 20    and FRED.$$$ is 
001200:  74 68 65 6E 20 20 72 65 6E 61 6D 65 64 0D 0A 20    then  renamed.. 
001210:  20 20 20 20 20 20 74 6F 20 46 52 45 44 2E 42 41          to FRED.BA
001220:  53 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 6C    S.....       All
001230:  20 41 4D 53 44 4F 53 20 66 61 63 69 6C 69 74 69     AMSDOS faciliti
001240:  65 73 20 20 61 72 65 20 20 69 6D 70 6C 65 6D 65    es  are  impleme
001250:  6E 74 65 64 20 20 65 69 74 68 65 72 20 20 62 79    nted  either  by
001260:  20 20 69 6E 74 65 72 63 65 70 74 69 6E 67 20 20      intercepting  
001270:  74 68 65 0D 0A 20 20 20 20 20 20 20 63 61 73 73    the..       cass
001280:  65 74 74 65 20 66 69 72 6D 77 61 72 65 20 63 61    ette firmware ca
001290:  6C 6C 73 20 6F 72 20 62 79 20 65 78 74 65 72 6E    lls or by extern
0012A0:  61 6C 20 63 6F 6D 6D 61 6E 64 73 2E 0D 0A 0D 0A    al commands.....
0012B0:  0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44    ..       AMSTRAD
0012C0:  20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38     CPC464/664/6128
0012D0:  20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20     FIRMWARE       
0012E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0012F0:  20 20 20 20 20 20 20 70 61 67 65 20 39 2E 31 0D           page 9.1.
001300:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
001310:  20 20 20 20 54 68 65 20 69 6E 74 65 72 63 65 70        The intercep
001320:  74 65 64 20 66 69 72 6D 77 61 72 65 20 63 61 6C    ted firmware cal
001330:  6C 73 20 61 72 65 3A 0D 0A 0D 0A 0D 0A 20 20 20    ls are:......   
001340:  20 20 20 20 20 20 20 20 20 20 20 20 20 43 41 53                 CAS
001350:  20 49 4E 20 4F 50 45 4E 0D 0A 20 20 20 20 20 20     IN OPEN..      
001360:  20 20 20 20 20 20 20 20 20 20 43 41 53 20 49 4E              CAS IN
001370:  20 43 48 41 52 0D 0A 20 20 20 20 20 20 20 20 20     CHAR..         
001380:  20 20 20 20 20 20 20 43 41 53 20 49 4E 20 44 49           CAS IN DI
001390:  52 45 43 54 0D 0A 20 20 20 20 20 20 20 20 20 20    RECT..          
0013A0:  20 20 20 20 20 20 43 41 53 20 52 45 54 55 52 4E          CAS RETURN
0013B0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0013C0:  20 20 43 41 53 20 54 45 53 54 20 45 4F 46 0D 0A      CAS TEST EOF..
0013D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0013E0:  43 41 53 20 49 4E 20 43 4C 4F 53 45 0D 0A 20 20    CAS IN CLOSE..  
0013F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 41                  CA
001400:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
001410:  01 00 00 00 02 09 50 E5 01 00 C1 02 00 00 00 02    ......P.........
001420:  01 00 C2 02 00 00 00 02 01 00 C3 02 00 00 00 02    ................
001430:  01 00 C4 02 00 00 00 02 01 00 C5 02 00 00 00 02    ................
001440:  01 00 C6 02 00 00 00 02 01 00 C7 02 00 00 00 02    ................
001450:  01 00 C8 02 00 00 00 02 01 00 C9 02 00 00 00 02    ................
001460:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001470:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001480:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001490:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0014F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
001500:  53 20 49 4E 20 41 42 41 4E 44 4F 4E 0D 0A 20 20    S IN ABANDON..  
001510:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 41                  CA
001520:  53 20 4F 55 54 20 4F 50 45 4E 0D 0A 0D 0A 20 20    S OUT OPEN....  
001530:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 41                  CA
001540:  53 20 4F 55 54 20 43 48 41 52 0D 0A 20 20 20 20    S OUT CHAR..    
001550:  20 20 20 20 20 20 20 20 20 20 20 20 43 41 53 20                CAS 
001560:  4F 55 54 20 44 49 52 45 43 54 0D 0A 20 20 20 20    OUT DIRECT..    
001570:  20 20 20 20 20 20 20 20 20 20 20 20 43 41 53 20                CAS 
001580:  4F 55 54 20 43 4C 4F 53 45 0D 0A 20 20 20 20 20    OUT CLOSE..     
001590:  20 20 20 20 20 20 20 20 20 20 20 43 41 53 20 4F               CAS O
0015A0:  55 54 20 41 42 41 4E 44 4F 4E 0D 0A 20 20 20 20    UT ABANDON..    
0015B0:  20 20 20 20 20 20 20 20 20 20 20 20 43 41 53 20                CAS 
0015C0:  4F 55 54 20 43 41 54 41 4C 4F 47 0D 0A 0D 0A 0D    OUT CATALOG.....
0015D0:  0A 20 20 20 20 20 20 20 54 68 65 20 72 65 6D 61    .       The rema
0015E0:  69 6E 69 6E 67 20 63 61 73 73 65 74 74 65 20 66    ining cassette f
0015F0:  69 72 6D 77 61 72 65 20 63 61 6C 6C 73 20 61 72    irmware calls ar
001600:  65 20 6E 6F 74 20 69 6E 74 65 72 63 65 70 74 65    e not intercepte
001610:  64 20 20 61 6E 64 20 20 72 65 6D 61 69 6E 0D 0A    d  and  remain..
001620:  20 20 20 20 20 20 20 75 6E 61 66 66 65 63 74 65           unaffecte
001630:  64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 46    d.......       F
001640:  75 6C 6C 20 64 65 73 63 72 69 70 74 69 6F 6E 73    ull descriptions
001650:  20 6F 66 20 62 6F 74 68 20 74 68 65 20 74 61 70     of both the tap
001660:  65 20 61 6E 64 20 64 69 73 63 20 76 65 72 73 69    e and disc versi
001670:  6F 6E 73 20 6F 66 20 74 68 65 73 65 20 72 6F 75    ons of these rou
001680:  74 69 6E 65 73 0D 0A 20 20 20 20 20 20 20 61 72    tines..       ar
001690:  65 20 67 69 76 65 6E 20 69 6E 20 73 65 63 74 69    e given in secti
0016A0:  6F 6E 20 31 35 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    on 15.......    
0016B0:  20 20 20 54 68 65 20 41 4D 53 44 4F 53 20 65 78       The AMSDOS ex
0016C0:  74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 73 20    ternal commands 
0016D0:  61 72 65 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    are:......      
0016E0:  20 20 20 20 20 20 20 20 20 20 41 20 20 20 20 20              A     
0016F0:  20 20 20 20 53 65 6C 65 63 74 73 20 64 65 66 61        Selects defa
001700:  75 6C 74 20 64 72 69 76 65 20 41 3A 0D 0A 20 20    ult drive A:..  
001710:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 42 20                  B 
001720:  20 20 20 20 20 20 20 20 53 65 6C 65 63 74 73 20            Selects 
001730:  64 65 66 61 75 6C 74 20 64 72 69 76 65 20 42 3A    default drive B:
001740:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
001750:  20 20 43 50 4D 20 20 20 20 20 20 20 43 6F 6C 64      CPM       Cold
001760:  20 62 6F 6F 74 20 43 50 2F 4D 0D 0A 20 20 20 20     boot CP/M..    
001770:  20 20 20 20 20 20 20 20 20 20 20 20 44 49 52 20                DIR 
001780:  20 20 20 20 20 20 44 69 73 70 6C 61 79 20 64 69          Display di
001790:  73 63 20 64 69 72 65 63 74 6F 72 79 0D 0A 20 20    sc directory..  
0017A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 49                  DI
0017B0:  53 43 20 20 20 20 20 20 52 65 64 69 72 65 63 74    SC      Redirect
0017C0:  20 63 61 73 73 65 74 74 65 20 72 6F 75 74 69 6E     cassette routin
0017D0:  65 73 20 74 6F 20 64 69 73 63 0D 0A 20 20 20 20    es to disc..    
0017E0:  20 20 20 20 20 20 20 20 20 20 20 20 44 49 53 43                DISC
0017F0:  2E 49 4E 20 20 20 52 65 64 69 72 65 63 74 20 63    .IN   Redirect c
001800:  61 73 73 65 74 74 65 20 69 6E 70 75 74 20 72 6F    assette input ro
001810:  75 74 69 6E 65 73 20 74 6F 20 64 69 73 63 0D 0A    utines to disc..
001820:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
001830:  44 49 53 43 2E 4F 55 54 20 20 52 65 64 69 72 65    DISC.OUT  Redire
001840:  63 74 20 63 61 73 73 65 74 74 65 20 6F 75 74 70    ct cassette outp
001850:  75 74 20 72 6F 75 74 69 6E 65 73 20 74 6F 20 64    ut routines to d
001860:  69 73 63 0D 0A 20 20 20 20 20 20 20 20 20 20 20    isc..           
001870:  20 20 20 20 20 44 52 49 56 45 20 20 20 20 20 53         DRIVE     S
001880:  65 6C 65 63 74 20 64 65 66 61 75 6C 74 20 64 72    elect default dr
001890:  69 76 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ive..           
0018A0:  20 20 20 20 20 45 52 41 20 20 20 20 20 20 20 45         ERA       E
0018B0:  72 61 73 65 20 66 69 6C 65 73 0D 0A 20 20 20 20    rase files..    
0018C0:  20 20 20 20 20 20 20 20 20 20 20 20 52 45 4E 20                REN 
0018D0:  20 20 20 20 20 20 52 65 6E 61 6D 65 20 66 69 6C          Rename fil
0018E0:  65 73 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    es..            
0018F0:  20 20 20 20 54 41 50 45 20 20 20 20 20 20 52 65        TAPE      Re
001900:  64 69 72 65 63 74 20 63 61 73 73 65 74 74 65 20    direct cassette 
001910:  72 6F 75 74 69 6E 65 73 20 74 6F 20 63 61 73 73    routines to cass
001920:  65 74 74 65 0D 0A 20 20 20 20 20 20 20 20 20 20    ette..          
001930:  20 20 20 20 20 20 54 41 50 45 2E 49 4E 20 20 20          TAPE.IN   
001940:  52 65 64 69 72 65 63 74 20 63 61 73 73 65 74 74    Redirect cassett
001950:  65 20 69 6E 70 75 74 20 72 6F 75 74 69 6E 65 73    e input routines
001960:  20 74 6F 20 63 61 73 73 65 74 74 65 0D 0A 20 20     to cassette..  
001970:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 41                  TA
001980:  50 45 2E 4F 55 54 20 20 52 65 64 69 72 65 63 74    PE.OUT  Redirect
001990:  20 63 61 73 73 65 74 74 65 20 6F 75 74 70 75 74     cassette output
0019A0:  20 72 6F 75 74 69 6E 65 73 20 74 6F 20 63 61 73     routines to cas
0019B0:  73 65 74 74 65 0D 0A 20 20 20 20 20 20 20 20 20    sette..         
0019C0:  20 20 20 20 20 20 20 55 53 45 52 20 20 20 20 20           USER     
0019D0:  20 53 65 6C 65 63 74 20 64 65 66 61 75 6C 74 20     Select default 
0019E0:  75 73 65 72 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    user..........  
0019F0:  20 20 20 20 20 46 72 6F 6D 20 42 41 53 49 43 20         From BASIC 
001A00:  61 6C 6C 20 74 68 65 73 65 20 63 6F 6D 6D 61 6E    all these comman
001A10:  64 73 20 6D 75 73 74 20 62 65 20 70 72 65 63 65    ds must be prece
001A20:  64 65 64 20 62 79 20 61 20 27 7C 27 2E 0D 0A 0D    ded by a '|'....
001A30:  0A 0D 0A 20 20 20 20 20 20 20 53 6F 6D 65 20 6F    ...       Some o
001A40:  66 20 74 68 65 73 65 20 63 6F 6D 6D 61 6E 64 73    f these commands
001A50:  20 72 65 71 75 69 72 65 20 70 61 72 61 6D 65 74     require paramet
001A60:  65 72 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ers.......      
001A70:  20 46 75 6C 6C 20 64 65 73 63 72 69 70 74 69 6F     Full descriptio
001A80:  6E 73 20 6F 66 20 74 68 65 73 65 20 65 78 74 65    ns of these exte
001A90:  72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 73 20 61 72    rnal commands ar
001AA0:  65 20 67 69 76 65 6E 20 69 6E 20 73 65 63 74 69    e given in secti
001AB0:  6F 6E 20 32 30 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    on 20...........
001AC0:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
001AD0:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
001AE0:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
001AF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
001B00:  20 20 20 20 20 70 61 67 65 20 39 2E 32 0D 0A 0D         page 9.2...
001B10:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
001B20:  20 20 39 2E 32 20 46 69 6C 65 6E 61 6D 65 73 0D      9.2 Filenames.
001B30:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 44    .....       AMSD
001B40:  4F 53 20 66 69 6C 65 6E 61 6D 65 73 20 61 72 65    OS filenames are
001B50:  20 75 70 77 61 72 64 73 20 63 6F 6D 70 61 74 69     upwards compati
001B60:  62 6C 65 20 77 69 74 68 20 43 50 2F 4D 20 20 66    ble with CP/M  f
001B70:  69 6C 65 6E 61 6D 65 73 2E 20 20 42 75 74 20 20    ilenames.  But  
001B80:  69 73 0D 0A 20 20 20 20 20 20 20 61 64 64 69 74    is..       addit
001B90:  69 6F 6E 20 74 68 65 20 75 73 65 72 20 6E 75 6D    ion the user num
001BA0:  62 65 72 20 6D 61 79 20 61 6C 73 6F 20 20 62 65    ber may also  be
001BB0:  20 20 73 70 65 63 69 66 69 65 64 20 20 61 6E 64      specified  and
001BC0:  20 20 6E 6F 6E 2D 73 69 67 6E 69 66 69 63 61 6E      non-significan
001BD0:  74 0D 0A 20 20 20 20 20 20 20 73 70 61 63 65 73    t..       spaces
001BE0:  20 61 72 65 20 70 65 72 6D 69 74 74 65 64 20 62     are permitted b
001BF0:  65 66 6F 72 65 20 20 61 6E 64 20 20 61 66 74 65    efore  and  afte
001C00:  72 20 20 74 68 65 20 20 6E 61 6D 65 20 20 61 6E    r  the  name  an
001C10:  64 20 20 61 6E 79 20 20 65 6D 62 65 64 64 65 64    d  any  embedded
001C20:  0D 0A 20 20 20 20 20 20 20 70 75 6E 63 74 75 61    ..       punctua
001C30:  74 69 6F 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    tion.......     
001C40:  20 20 45 78 61 6D 70 6C 65 73 3A 0D 0A 0D 0A 0D      Examples:.....
001C50:  0A 20 20 20 20 20 20 20 20 20 20 20 41 4E 41 4D    .           ANAM
001C60:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
001C70:  44 65 66 61 75 6C 74 20 75 73 65 72 2C 20 64 72    Default user, dr
001C80:  69 76 65 2C 20 61 6E 64 20 74 79 70 65 0D 0A 20    ive, and type.. 
001C90:  20 20 20 20 20 20 20 20 20 20 31 30 3A 57 4F 4D              10:WOM
001CA0:  42 41 54 2E 54 58 54 20 20 20 20 20 20 20 44 65    BAT.TXT       De
001CB0:  66 61 75 6C 74 20 64 72 69 76 65 2C 20 61 6E 64    fault drive, and
001CC0:  20 75 73 65 72 20 6E 75 6D 62 65 72 20 31 30 0D     user number 10.
001CD0:  0A 20 20 20 20 20 20 20 20 20 20 20 32 41 3A 57    .           2A:W
001CE0:  4F 4D 42 41 54 2E 54 58 54 20 20 20 20 20 20 20    OMBAT.TXT       
001CF0:  55 73 65 72 20 32 2C 20 6F 6E 20 44 72 69 76 65    User 2, on Drive
001D00:  20 41 3A 0D 0A 20 20 20 20 20 20 20 20 20 20 20     A:..           
001D10:  2A 2E 2A 20 20 20 20 20 20 20 20 20 20 20 20 20    *.*             
001D20:  20 20 20 20 44 65 66 61 75 6C 74 20 64 72 69 76        Default driv
001D30:  65 2C 20 75 73 65 72 2C 20 61 6E 64 20 61 6C 6C    e, user, and all
001D40:  20 66 69 6C 65 73 0D 0A 20 20 20 20 20 20 20 20     files..        
001D50:  20 20 20 35 42 20 3A 20 50 4F 53 53 55 4D 20 2E       5B : POSSUM .
001D60:  20 24 24 24 20 20 20 41 20 6E 61 6D 65 20 77 69     $$$   A name wi
001D70:  74 68 20 6E 6F 6E 2D 73 69 67 6E 69 66 69 63 61    th non-significa
001D80:  6E 74 20 73 70 61 63 65 73 0D 0A 20 20 20 20 20    nt spaces..     
001D90:  20 20 20 20 20 20 61 3A 61 61 72 64 3F 61 72 6B          a:aard?ark
001DA0:  20 20 20 20 20 20 20 20 20 20 4C 6F 77 65 72 63              Lowerc
001DB0:  61 73 65 2C 20 41 4D 53 44 4F 53 20 77 69 6C 6C    ase, AMSDOS will
001DC0:  20 63 6F 6E 76 65 72 74 20 74 6F 20 75 70 70 65     convert to uppe
001DD0:  72 63 61 73 65 0D 0A 0D 0A 0D 0A 20 20 20 20 20    rcase......     
001DE0:  20 20 49 66 20 67 69 76 65 6E 2C 20 74 68 65 20      If given, the 
001DF0:  75 73 65 72 20 6E 75 6D 62 65 72 20 6D 75 73 74    user number must
001E00:  20 62 65 20 69 6E 20 74 68 65 20 72 61 6E 67 65     be in the range
001E10:  20 30 2E 2E 31 35 2C 20 74 68 65 20 64 72 69 76     0..15, the driv
001E20:  65 20 6C 65 74 74 65 72 0D 0A 20 20 20 20 20 20    e letter..      
001E30:  20 6D 75 73 74 20 62 65 20 41 20 6F 72 20 42 2E     must be A or B.
001E40:  20 49 66 20 65 69 74 68 65 72 20 74 68 65 20 75     If either the u
001E50:  73 65 72 20 6F 72 20 74 68 65 20 64 72 69 76 65    ser or the drive
001E60:  20 69 73 20 67 69 76 65 6E 20 74 68 65 79 20 6D     is given they m
001E70:  75 73 74 20 20 62 65 0D 0A 20 20 20 20 20 20 20    ust  be..       
001E80:  66 6F 6C 6C 6F 77 65 64 20 62 79 20 61 20 63 6F    followed by a co
001E90:  6C 6F 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    lon.......      
001EA0:  20 54 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20 63     The following c
001EB0:  68 61 72 61 63 74 65 72 73 20 6D 61 79 20 62 65    haracters may be
001EC0:  20 75 73 65 64 20 69 6E 20 74 68 65 20 6E 61 6D     used in the nam
001ED0:  65 20 61 6E 64 20 74 79 70 65 20 70 61 72 74 73    e and type parts
001EE0:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    :....           
001EF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 61 2D 7A                 a-z
001F00:  20 41 2D 5A 20 30 2D 39 20 21 20 22 20 23 20 24     A-Z 0-9 ! " # $
001F10:  20 26 20 27 20 2B 20 2D 20 40 20 5E 20 27 20 7D     & ' + - @ ^ ' }
001F20:  20 7B 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6E 79     {....       Any
001F30:  20 6F 74 68 65 72 20 63 68 61 72 61 63 74 65 72     other character
001F40:  73 20 77 69 6C 6C 20 63 61 75 73 65 20 74 68 65    s will cause the
001F50:  20 63 6F 6D 6D 61 6E 64 73 20 74 6F 20 66 61 69     commands to fai
001F60:  6C 20 77 69 74 68 20 74 68 65 20 6D 65 73 73 61    l with the messa
001F70:  67 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ge:....         
001F80:  20 20 20 20 20 20 20 42 41 44 20 43 4F 4D 4D 41           BAD COMMA
001F90:  4E 44 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ND....       The
001FA0:  20 63 68 61 72 61 63 74 65 72 73 20 27 3F 27 20     characters '?' 
001FB0:  61 6E 64 20 27 2A 27 20 61 72 65 20 77 69 6C 64    and '*' are wild
001FC0:  63 61 72 64 73 2C 20 74 68 61 74 20 69 73 2C 20    cards, that is, 
001FD0:  77 68 65 6E 20 70 6C 61 63 65 64 20 20 77 69 74    when placed  wit
001FE0:  68 69 6E 0D 0A 20 20 20 20 20 20 20 61 20 66 69    hin..       a fi
001FF0:  6C 65 6E 61 6D 65 20 6F 72 20 74 79 70 65 20 69    lename or type i
002000:  74 20 77 69 6C 6C 20 62 65 20 69 6E 74 65 72 70    t will be interp
002010:  72 65 74 65 64 20 61 73 20 20 27 61 6E 79 20 20    reted as  'any  
002020:  76 61 6C 69 64 20 20 63 68 61 72 61 63 74 65 72    valid  character
002030:  27 2E 0D 0A 20 20 20 20 20 20 20 46 6F 72 20 65    '...       For e
002040:  78 61 6D 70 6C 65 20 69 66 20 74 68 65 20 66 69    xample if the fi
002050:  6C 65 6E 61 6D 65 20 27 47 3F 3F 45 3F 3F 2E 42    lename 'G??E??.B
002060:  2A 27 20 77 61 73 20 75 73 65 64 20 69 6E 20 74    *' was used in t
002070:  68 65 20 20 7C 44 49 52 20 20 63 6F 6D 6D 61 6E    he  |DIR  comman
002080:  64 0D 0A 20 20 20 20 20 20 20 74 68 65 6E 20 74    d..       then t
002090:  68 65 20 66 69 6C 65 73 20 27 47 41 4D 45 31 2E    he files 'GAME1.
0020A0:  42 41 53 27 20 27 47 41 4D 45 31 2E 42 41 4B 27    BAS' 'GAME1.BAK'
0020B0:  20 27 47 41 4D 45 32 39 2E 42 41 53 27 20 20 61     'GAME29.BAS'  a
0020C0:  6E 64 20 20 27 47 52 45 45 54 2E 42 41 53 27 2C    nd  'GREET.BAS',
0020D0:  0D 0A 20 20 20 20 20 20 20 61 6E 64 20 61 6E 79    ..       and any
0020E0:  20 6D 61 74 63 68 69 6E 67 20 63 6F 6D 62 69 6E     matching combin
0020F0:  61 74 69 6F 6E 73 2C 20 77 6F 75 6C 64 20 62 65    ations, would be
002100:  20 64 69 73 70 6C 61 79 65 64 20 69 6E 20 74 68     displayed in th
002110:  65 20 64 69 72 65 63 74 6F 72 79 2E 0D 0A 0D 0A    e directory.....
002120:  0D 0A 20 20 20 20 20 20 20 57 68 65 6E 20 70 61    ..       When pa
002130:  73 73 69 6E 67 20 20 61 20 20 66 69 6C 65 6E 61    ssing  a  filena
002140:  6D 65 2C 20 20 41 4D 53 44 4F 53 20 20 73 68 69    me,  AMSDOS  shi
002150:  66 74 73 20 20 6C 6F 77 65 72 20 20 63 61 73 65    fts  lower  case
002160:  20 20 6C 65 74 74 65 72 73 20 20 69 6E 74 6F 0D      letters  into.
002170:  0A 20 20 20 20 20 20 20 75 70 70 65 72 63 61 73    .       uppercas
002180:  65 20 61 6E 64 20 72 65 6D 6F 76 65 73 20 62 69    e and removes bi
002190:  74 20 37 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49    t 7.....       I
0021A0:  66 20 74 68 65 20 75 73 65 72 20 6F 72 20 64 72    f the user or dr
0021B0:  69 76 65 20 69 73 20 6F 6D 69 74 74 65 64 20 74    ive is omitted t
0021C0:  68 65 6E 20 74 68 65 20 63 75 72 72 65 6E 74 20    hen the current 
0021D0:  20 64 65 66 61 75 6C 74 20 20 76 61 6C 75 65 73     default  values
0021E0:  20 20 61 72 65 0D 0A 20 20 20 20 20 20 20 61 73      are..       as
0021F0:  73 75 6D 65 64 2E 20 54 68 65 73 65 20 64 65 66    sumed. These def
002200:  61 75 6C 74 73 20 6D 61 79 20 62 65 20 73 65 74    aults may be set
002210:  20 62 79 20 74 68 65 20 75 73 65 72 2E 0D 0A 0D     by the user....
002220:  0A 20 20 20 20 20 20 20 49 66 20 74 68 65 20 74    .       If the t
002230:  79 70 65 20 70 61 72 74 20 69 73 20 6F 6D 69 74    ype part is omit
002240:  74 65 64 20 74 68 65 6E 20 20 61 20 20 64 65 66    ted then  a  def
002250:  61 75 6C 74 20 20 74 79 70 65 20 20 69 73 20 20    ault  type  is  
002260:  61 73 73 75 6D 65 64 2E 20 20 54 68 69 73 0D 0A    assumed.  This..
002270:  20 20 20 20 20 20 20 64 65 70 65 6E 64 73 20 6F           depends o
002280:  6E 20 74 68 65 20 63 6F 6E 74 65 78 74 20 69 6E    n the context in
002290:  20 77 68 69 63 68 20 74 68 65 20 6E 61 6D 65 20     which the name 
0022A0:  69 73 20 62 65 69 6E 67 20 75 73 65 64 2C 20 62    is being used, b
0022B0:  75 74 20 75 73 75 61 6C 6C 79 20 20 61 0D 0A 20    ut usually  a.. 
0022C0:  20 20 20 20 20 20 64 65 66 61 75 6C 74 20 74 79          default ty
0022D0:  70 65 20 70 61 72 74 20 6F 66 20 74 68 72 65 65    pe part of three
0022E0:  20 73 70 61 63 65 73 20 69 73 20 61 73 73 75 6D     spaces is assum
0022F0:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 39 2E    ed.....       9.
002300:  33 20 46 69 6C 65 20 48 65 61 64 65 72 73 0D 0A    3 File Headers..
002310:  0D 0A 20 20 20 20 20 20 20 43 61 73 73 65 74 74    ..       Cassett
002320:  65 20 66 69 6C 65 73 20 61 72 65 20 20 73 75 62    e files are  sub
002330:  64 69 76 69 64 65 64 20 20 69 6E 74 6F 20 20 32    divided  into  2
002340:  4B 20 20 62 6C 6F 63 6B 73 2C 20 20 65 61 63 68    K  blocks,  each
002350:  20 20 6F 66 20 20 77 68 69 63 68 20 20 69 73 0D      of  which  is.
002360:  0A 20 20 20 20 20 20 20 70 72 65 63 65 64 65 64    .       preceded
002370:  20 62 79 20 68 65 61 64 65 72 2E 20 43 50 2F 4D     by header. CP/M
002380:  20 66 69 6C 65 73 20 64 6F 20 6E 6F 74 20 68 61     files do not ha
002390:  76 65 20 68 65 61 64 65 72 73 2E 20 41 4D 53 44    ve headers. AMSD
0023A0:  4F 53 20 66 69 6C 65 73 20 20 6D 61 79 2C 0D 0A    OS files  may,..
0023B0:  20 20 20 20 20 20 20 6F 72 20 6D 61 79 20 6E 6F           or may no
0023C0:  74 20 68 61 76 65 20 61 20 68 65 61 64 65 72 20    t have a header 
0023D0:  64 65 70 65 6E 64 69 6E 67 20 6F 6E 20 74 68 65    depending on the
0023E0:  20 63 6F 6E 74 65 6E 74 73 20 6F 66 20 74 68 65     contents of the
0023F0:  20 20 66 69 6C 65 2E 20 20 54 68 69 73 0D 0A 20      file.  This.. 
002400:  20 20 20 20 20 20 77 69 6C 6C 20 6E 6F 74 20 63          will not c
002410:  61 75 73 65 20 70 72 6F 62 6C 65 6D 73 20 66 6F    ause problems fo
002420:  72 20 70 72 6F 67 72 61 6D 73 20 77 72 69 74 74    r programs writt
002430:  65 6E 20 69 6E 20 42 41 53 49 43 20 20 62 75 74    en in BASIC  but
002440:  20 20 69 74 20 20 69 73 20 20 61 6E 0D 0A 20 20      it  is  an..  
002450:  20 20 20 20 20 69 6D 70 6F 72 74 61 6E 74 20 64         important d
002460:  69 66 66 65 72 65 6E 63 65 20 62 65 74 77 65 65    ifference betwee
002470:  6E 20 63 61 73 73 65 74 74 65 20 61 6E 64 20 64    n cassette and d
002480:  69 73 63 20 66 69 6C 65 73 2E 0D 0A 0D 0A 0D 0A    isc files.......
002490:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
0024A0:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
0024B0:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
0024C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0024D0:  20 20 20 20 20 70 61 67 65 20 39 2E 33 0D 0A 0D         page 9.3...
0024E0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
0024F0:  20 20 55 6E 70 72 6F 74 65 63 74 65 64 20 41 53      Unprotected AS
002500:  43 49 49 20 66 69 6C 65 73 20 64 6F 20 6E 6F 20    CII files do no 
002510:  68 61 76 65 20 68 65 61 64 65 72 2E 20 41 6C 6C    have header. All
002520:  20 6F 74 68 65 72 20 41 4D 53 44 4F 53 20 66 69     other AMSDOS fi
002530:  6C 65 73 20 68 61 76 65 0D 0A 20 20 20 20 20 20    les have..      
002540:  20 61 20 73 69 6E 67 6C 65 20 68 65 61 64 65 72     a single header
002550:  20 69 6E 20 74 68 65 20 66 69 72 73 74 20 31 32     in the first 12
002560:  38 20 62 79 74 65 73 20 6F 66 20 74 68 65 20 66    8 bytes of the f
002570:  69 6C 65 2C 20 74 68 65 20 68 65 61 64 65 72 20    ile, the header 
002580:  72 65 63 6F 72 64 2E 0D 0A 20 20 20 20 20 20 20    record...       
002590:  54 68 65 73 65 20 68 65 61 64 65 72 73 20 61 72    These headers ar
0025A0:  65 20 64 65 74 65 63 74 65 64 20 62 79 20 63 68    e detected by ch
0025B0:  65 63 6B 73 75 6D 6D 69 6E 67 20 74 68 65 20 66    ecksumming the f
0025C0:  69 72 73 74 20 36 37 20 62 79 74 65 73 20 20 6F    irst 67 bytes  o
0025D0:  66 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 72    f  the..       r
0025E0:  65 63 6F 72 64 2E 20 49 66 20 74 68 65 20 63 68    ecord. If the ch
0025F0:  65 63 6B 73 75 6D 20 69 73 20 61 73 20 65 78 70    ecksum is as exp
002600:  65 63 74 65 64 20 74 68 65 6E 20 61 20 68 65 61    ected then a hea
002610:  64 65 72 20 20 69 73 20 20 70 72 65 73 65 6E 74    der  is  present
002620:  2C 20 20 69 66 0D 0A 20 20 20 20 20 20 20 6E 6F    ,  if..       no
002630:  74 20 74 68 65 6E 20 74 68 65 72 65 20 69 73 20    t then there is 
002640:  6E 6F 20 68 65 61 64 65 72 2E 20 54 68 75 73 20    no header. Thus 
002650:  69 74 20 20 69 73 20 20 70 6F 73 73 69 62 6C 65    it  is  possible
002660:  2C 20 20 74 68 6F 75 67 68 20 20 75 6E 6C 69 6B    ,  though  unlik
002670:  65 6C 79 2C 0D 0A 20 20 20 20 20 20 20 74 68 61    ely,..       tha
002680:  74 20 61 20 66 69 6C 65 20 77 69 74 68 6F 75 74    t a file without
002690:  20 61 20 68 65 61 64 65 72 20 63 6F 75 6C 64 20     a header could 
0026A0:  62 65 20 6D 69 73 74 61 6B 65 6E 20 66 6F 72 20    be mistaken for 
0026B0:  6F 6E 65 20 77 69 74 68 20 61 20 68 65 61 64 65    one with a heade
0026C0:  72 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    r.......       T
0026D0:  68 65 20 66 6F 72 6D 61 74 20 6F 66 20 74 68 65    he format of the
0026E0:  20 68 65 61 64 65 72 20 72 65 63 6F 72 64 20 69     header record i
0026F0:  73 20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D 0A 0D    s as follows:...
002700:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
002710:  02 00 00 00 02 09 50 E5 02 00 C1 02 00 00 00 02    ......P.........
002720:  02 00 C2 02 00 00 00 02 02 00 C3 02 00 00 00 02    ................
002730:  02 00 C4 02 00 00 00 02 02 00 C5 02 00 00 00 02    ................
002740:  02 00 C6 02 00 00 00 02 02 00 C7 02 00 00 00 02    ................
002750:  02 00 C8 02 00 00 00 02 02 00 C9 02 00 00 00 02    ................
002760:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
002770:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
002780:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
002790:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0027F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
002800:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 42    ...            B
002810:  79 74 65 73 20 20 20 30 2E 2E 36 33 20 20 20 20    ytes   0..63    
002820:  20 20 20 43 61 73 73 65 74 74 65 2F 44 69 73 63       Cassette/Disc
002830:  20 68 65 61 64 65 72 20 28 73 65 65 20 62 65 6C     header (see bel
002840:  6F 77 29 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ow)......       
002850:  20 20 20 20 20 20 20 20 20 20 20 20 20 36 34 2E                 64.
002860:  2E 36 36 20 20 20 20 20 20 4C 65 6E 67 74 68 20    .66      Length 
002870:  6F 66 20 74 68 65 20 66 69 6C 65 20 69 6E 20 20    of the file in  
002880:  62 79 74 65 73 2C 20 20 65 78 63 6C 75 64 69 6E    bytes,  excludin
002890:  67 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 20    g  the..        
0028A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0028B0:  20 20 20 20 20 20 20 20 68 65 61 64 65 72 20 20            header  
0028C0:  20 72 65 63 6F 72 64 2E 20 20 20 32 34 20 20 20     record.   24   
0028D0:  62 69 74 20 20 20 6E 75 6D 62 65 72 2C 20 20 20    bit   number,   
0028E0:  6C 65 61 73 74 0D 0A 20 20 20 20 20 20 20 20 20    least..         
0028F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002900:  20 20 20 20 20 20 20 73 69 67 6E 69 66 69 63 61           significa
002910:  6E 74 20 62 79 74 65 20 69 6E 20 6C 6F 77 65 73    nt byte in lowes
002920:  74 20 61 64 64 72 65 73 73 0D 0A 0D 0A 0D 0A 20    t address...... 
002930:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002940:  20 20 20 36 37 2E 2E 36 38 20 20 20 20 20 20 53       67..68      S
002950:  69 78 74 65 65 6E 20 62 69 74 20 63 68 65 63 6B    ixteen bit check
002960:  73 75 6D 2C 20 73 75 6D 20 6F 66 20 62 79 74 65    sum, sum of byte
002970:  73 20 30 2E 2E 36 36 0D 0A 0D 0A 0D 0A 20 20 20    s 0..66......   
002980:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002990:  20 36 39 2E 2E 31 32 37 20 20 20 20 20 55 6E 64     69..127     Und
0029A0:  65 66 69 6E 65 64 0D 0A 0D 0A 0D 0A 20 20 20 20    efined......    
0029B0:  20 20 20 54 68 65 20 75 73 65 20 74 68 61 74 20       The use that 
0029C0:  74 68 65 20 63 61 73 73 65 74 74 65 20 6D 61 6E    the cassette man
0029D0:  61 67 65 72 20 6D 61 6B 65 73 20 6F 66 20 74 68    ager makes of th
0029E0:  65 20 68 65 61 64 65 72 20 69 73 20 64 65 73 63    e header is desc
0029F0:  72 69 62 65 64 20 20 69 6E 0D 0A 20 20 20 20 20    ribed  in..     
002A00:  20 20 73 65 63 74 69 6F 6E 20 38 2E 34 2E 20 41      section 8.4. A
002A10:  4D 53 44 4F 53 20 75 73 65 73 20 74 68 65 20 68    MSDOS uses the h
002A20:  65 61 64 65 72 20 61 73 20 66 6F 6C 6C 6F 77 73    eader as follows
002A30:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    :......         
002A40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002A50:  20 42 79 74 65 73 0D 0A 0D 0A 0D 0A 20 20 20 20     Bytes......    
002A60:  20 20 20 46 69 6C 65 6E 61 6D 65 20 20 20 20 20       Filename     
002A70:  20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20          0         
002A80:  55 73 65 72 20 6E 75 6D 62 65 72 2C 20 23 30 30    User number, #00
002A90:  2E 2E 23 46 46 0D 0A 20 20 20 20 20 20 20 20 20    ..#FF..         
002AA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002AB0:  20 31 2E 2E 2E 38 20 20 20 20 20 4E 61 6D 65 20     1...8     Name 
002AC0:  70 61 72 74 2C 20 70 61 64 64 65 64 20 77 69 74    part, padded wit
002AD0:  68 20 73 70 61 63 65 73 0D 0A 20 20 20 20 20 20    h spaces..      
002AE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002AF0:  20 20 20 20 39 2E 2E 2E 31 31 20 20 20 20 54 79        9...11    Ty
002B00:  70 65 20 70 61 72 74 2C 20 70 61 64 64 65 64 20    pe part, padded 
002B10:  77 69 74 68 20 73 70 61 63 65 73 0D 0A 20 20 20    with spaces..   
002B20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002B30:  20 20 20 20 20 20 20 31 32 2E 2E 2E 31 35 20 20           12...15  
002B40:  20 23 30 30 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20     #00......      
002B50:  20 42 6C 6F 63 6B 20 6E 75 6D 62 65 72 20 20 20     Block number   
002B60:  20 20 20 20 31 36 20 20 20 20 20 20 20 20 4E 6F        16        No
002B70:  74 20 75 73 65 64 2C 20 73 65 74 20 74 6F 20 30    t used, set to 0
002B80:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4C 61 73    ......       Las
002B90:  74 20 62 6C 6F 63 6B 20 20 20 20 20 20 20 20 20    t block         
002BA0:  31 37 20 20 20 20 20 20 20 20 4E 6F 74 20 75 73    17        Not us
002BB0:  65 64 2C 20 73 65 74 20 74 6F 20 30 0D 0A 0D 0A    ed, set to 0....
002BC0:  20 20 20 20 20 20 20 46 69 6C 65 20 74 79 70 65           File type
002BD0:  20 20 20 20 20 20 20 20 20 20 31 38 20 20 20 20              18    
002BE0:  20 20 20 20 41 73 20 70 65 72 20 63 61 73 73 65        As per casse
002BF0:  74 74 65 0D 0A 0D 0A 20 20 20 20 20 20 20 44 61    tte....       Da
002C00:  74 61 20 6C 65 6E 67 74 68 20 20 20 20 20 20 20    ta length       
002C10:  20 31 39 2E 2E 2E 32 30 20 20 20 41 73 20 70 65     19...20   As pe
002C20:  72 20 63 61 73 73 65 74 74 65 0D 0A 0D 0A 20 20    r cassette....  
002C30:  20 20 20 20 20 44 61 74 61 20 6C 6F 63 61 74 69         Data locati
002C40:  6F 6E 20 20 20 20 20 20 32 31 2E 2E 2E 32 32 20    on      21...22 
002C50:  20 20 41 73 20 70 65 72 20 63 61 73 73 65 74 74      As per cassett
002C60:  65 0D 0A 0D 0A 20 20 20 20 20 20 20 46 69 72 73    e....       Firs
002C70:  74 20 62 6C 6F 63 6B 20 20 20 20 20 20 20 20 32    t block        2
002C80:  33 20 20 20 20 20 20 20 20 53 65 74 20 74 6F 20    3        Set to 
002C90:  23 46 46 2C 20 6F 6E 6C 79 20 75 73 65 64 20 66    #FF, only used f
002CA0:  6F 72 20 6F 75 74 70 75 74 20 66 69 6C 65 73 0D    or output files.
002CB0:  0A 0D 0A 20 20 20 20 20 20 20 4C 6F 67 69 63 61    ...       Logica
002CC0:  6C 20 6C 65 6E 67 74 68 20 20 20 20 20 32 34 2E    l length     24.
002CD0:  2E 2E 32 35 20 20 20 41 73 20 70 65 72 20 63 61    ..25   As per ca
002CE0:  73 73 65 74 74 65 0D 0A 0D 0A 20 20 20 20 20 20    ssette....      
002CF0:  20 45 6E 74 72 79 20 61 64 64 72 65 73 73 20 20     Entry address  
002D00:  20 20 20 20 32 36 2E 2E 2E 32 37 20 20 20 41 73        26...27   As
002D10:  20 70 65 72 20 63 61 73 73 65 74 74 65 0D 0A 0D     per cassette...
002D20:  0A 20 20 20 20 20 20 20 55 6E 61 6C 6C 6F 63 61    .       Unalloca
002D30:  74 65 64 20 20 20 20 20 20 20 20 32 38 2E 2E 2E    ted        28...
002D40:  36 33 20 20 20 41 73 20 70 65 72 20 63 61 73 73    63   As per cass
002D50:  65 74 74 65 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ette........    
002D60:  20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34 36       AMSTRAD CPC46
002D70:  34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57    4/664/6128 FIRMW
002D80:  41 52 45 20 20 20 20 20 20 20 20 20 20 20 20 20    ARE             
002D90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002DA0:  20 70 61 67 65 20 39 2E 34 0D 0A 0D 0A 0D 0A 0D     page 9.4.......
002DB0:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57 68    .......       Wh
002DC0:  65 6E 20 61 20 66 69 6C 65 20 77 69 74 68 6F 75    en a file withou
002DD0:  74 20 61 20 68 65 61 64 65 72 20 69 73 20 6F 70    t a header is op
002DE0:  65 6E 65 64 20 66 6F 72 20 20 69 6E 70 75 74 20    ened for  input 
002DF0:  20 61 20 20 66 61 6B 65 20 20 68 65 61 64 65 72     a  fake  header
002E00:  20 20 69 73 0D 0A 20 20 20 20 20 20 20 63 6F 6E      is..       con
002E10:  73 74 72 75 63 74 65 64 20 69 6E 20 73 74 6F 72    structed in stor
002E20:  65 20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D 0A 0D    e as follows:...
002E30:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
002E40:  20 20 20 20 20 20 20 20 20 20 20 20 20 42 79 74                 Byt
002E50:  65 73 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 46    es......       F
002E60:  69 6C 65 6E 61 6D 65 20 20 20 20 20 20 20 20 20    ilename         
002E70:  20 20 30 20 20 20 20 20 20 20 20 20 55 73 65 72      0         User
002E80:  20 6E 75 6D 62 65 72 2C 20 23 30 30 2E 2E 23 46     number, #00..#F
002E90:  46 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    F..             
002EA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 31 2E 2E                 1..
002EB0:  38 20 20 20 20 20 20 4E 61 6D 65 20 70 61 72 74    8      Name part
002EC0:  2C 20 70 61 64 64 65 64 20 77 69 74 68 20 73 70    , padded with sp
002ED0:  61 63 65 73 0D 0A 20 20 20 20 20 20 20 20 20 20    aces..          
002EE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002EF0:  39 2E 2E 31 31 20 20 20 20 20 54 79 70 65 20 70    9..11     Type p
002F00:  61 72 74 2C 20 70 61 64 64 65 64 20 77 69 74 68    art, padded with
002F10:  20 73 70 61 63 65 73 0D 0A 20 20 20 20 20 20 20     spaces..       
002F20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
002F30:  20 20 20 31 32 2E 2E 31 35 20 20 20 20 23 30 30       12..15    #00
002F40:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 46 69 6C    ......       Fil
002F50:  65 20 74 79 70 65 20 20 20 20 20 20 20 20 20 20    e type          
002F60:  31 38 20 20 20 20 20 20 20 20 23 31 36 2C 20 75    18        #16, u
002F70:  6E 70 72 6F 74 65 63 74 65 64 20 41 53 43 49 49    nprotected ASCII
002F80:  20 76 65 72 73 69 6F 6E 20 31 0D 0A 20 20 20 20     version 1..    
002F90:  20 20 20 44 61 74 61 20 6C 6F 63 61 74 69 6F 6E       Data location
002FA0:  20 20 20 20 20 20 31 39 2E 2E 32 30 20 20 20 20          19..20    
002FB0:  41 64 64 72 65 73 73 20 6F 66 20 32 4B 20 62 75    Address of 2K bu
002FC0:  66 66 65 72 0D 0A 20 20 20 20 20 20 20 46 69 72    ffer..       Fir
002FD0:  73 74 20 62 6C 6F 63 6B 20 20 20 20 20 20 20 20    st block        
002FE0:  32 33 20 20 20 20 20 20 20 20 23 46 46 0D 0A 0D    23        #FF...
002FF0:  0A 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F 74    ...       All ot
003000:  68 65 72 20 66 69 65 6C 64 73 20 61 72 65 20 73    her fields are s
003010:  65 74 20 74 6F 20 7A 65 72 6F 2E 0D 0A 0D 0A 0D    et to zero......
003020:  0A 20 20 20 20 20 20 20 39 2E 34 20 44 69 73 63    .       9.4 Disc
003030:  20 4F 72 67 61 6E 69 73 61 74 69 6F 6E 0D 0A 0D     Organisation...
003040:  0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 44 4F 53    ...       AMSDOS
003050:  20 61 6E 64 20 74 68 65 20 43 50 2F 4D 20 32 2E     and the CP/M 2.
003060:  32 20 42 49 4F 53 20 73 75 70 70 6F 72 74 20 20    2 BIOS support  
003070:  74 68 72 65 65 20 20 64 69 66 66 65 72 65 6E 74    three  different
003080:  20 20 64 69 73 63 20 20 66 6F 72 6D 61 74 73 3A      disc  formats:
003090:  0D 0A 20 20 20 20 20 20 20 53 59 53 54 45 4D 20    ..       SYSTEM 
0030A0:  66 6F 72 6D 61 74 2C 20 44 41 54 41 20 4F 4E 4C    format, DATA ONL
0030B0:  59 20 66 6F 72 6D 61 74 2C 20 61 6E 64 20 49 42    Y format, and IB
0030C0:  4D 20 66 6F 72 6D 61 74 2E 20 54 68 65 20 20 43    M format. The  C
0030D0:  50 2F 4D 20 20 50 6C 75 73 20 20 42 49 4F 53 0D    P/M  Plus  BIOS.
0030E0:  0A 20 20 20 20 20 20 20 73 75 70 70 6F 72 74 73    .       supports
0030F0:  20 74 68 65 20 53 59 53 54 45 4D 20 61 6E 64 20     the SYSTEM and 
003100:  44 41 54 41 20 66 6F 72 6D 61 74 73 20 62 75 74    DATA formats but
003110:  20 6E 6F 74 20 49 42 4D 20 66 6F 72 6D 61 74 2E     not IBM format.
003120:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
003130:  20 42 49 4F 53 20 61 75 74 6F 6D 61 74 69 63 61     BIOS automatica
003140:  6C 6C 79 20 64 65 74 65 63 74 73 20 74 68 65 20    lly detects the 
003150:  66 6F 72 6D 61 74 20 6F 66 20 61 20 64 69 73 63    format of a disc
003160:  2E 20 55 6E 64 65 72 20 20 43 50 2F 4D 20 20 74    . Under  CP/M  t
003170:  68 69 73 0D 0A 20 20 20 20 20 20 20 6F 63 63 75    his..       occu
003180:  72 73 20 66 6F 72 20 64 72 69 76 65 20 41 20 61    rs for drive A a
003190:  74 20 61 20 77 61 72 6D 20 62 6F 6F 74 20 61 6E    t a warm boot an
0031A0:  64 20 66 6F 72 20 64 72 69 76 65 20 42 20 74 68    d for drive B th
0031B0:  65 20 66 69 72 73 74 20 74 69 6D 65 20 69 74 20    e first time it 
0031C0:  69 73 0D 0A 20 20 20 20 20 20 20 61 63 63 65 73    is..       acces
0031D0:  73 65 64 2E 20 55 6E 64 65 72 20 41 4D 53 44 4F    sed. Under AMSDO
0031E0:  53 20 74 68 69 73 20 6F 63 63 75 72 73 20 65 61    S this occurs ea
0031F0:  63 68 20 74 69 6D 65 20 61 20 64 69 73 63 20 77    ch time a disc w
003200:  69 74 68 20 6E 6F 20 6F 70 65 6E 20 66 69 6C 65    ith no open file
003210:  73 0D 0A 20 20 20 20 20 20 20 69 73 20 61 63 63    s..       is acc
003220:  65 73 73 65 64 2E 20 54 6F 20 70 65 72 6D 69 74    essed. To permit
003230:  20 74 68 69 73 20 61 75 74 6F 6D 61 74 69 63 20     this automatic 
003240:  64 65 74 65 63 74 69 6F 6E 20 65 61 63 68 20 66    detection each f
003250:  6F 72 6D 61 74 20 68 61 73 20 75 6E 69 71 75 65    ormat has unique
003260:  0D 0A 20 20 20 20 20 20 20 73 65 63 74 6F 72 20    ..       sector 
003270:  6E 75 6D 62 65 72 73 20 61 73 20 64 65 74 61 69    numbers as detai
003280:  6C 65 64 20 62 65 6C 6F 77 2E 0D 0A 0D 0A 0D 0A    led below.......
003290:  20 20 20 20 20 20 20 33 20 69 6E 63 68 20 64 69           3 inch di
0032A0:  73 63 73 20 61 72 65 20 64 6F 75 62 6C 65 20 73    scs are double s
0032B0:  69 64 65 64 2C 20 62 75 74 20 6F 6E 6C 79 20 6F    ided, but only o
0032C0:  6E 65 20 73 69 64 65 20 6D 61 79 20 62 65 20 61    ne side may be a
0032D0:  63 63 65 73 73 65 64 20 61 74 20 20 61 0D 0A 20    ccessed at  a.. 
0032E0:  20 20 20 20 20 20 74 69 6D 65 20 64 65 70 65 6E          time depen
0032F0:  64 69 6E 67 20 6F 6E 20 77 68 69 63 68 20 77 61    ding on which wa
003300:  79 20 72 6F 75 6E 64 20 74 68 65 20 75 73 65 72    y round the user
003310:  20 69 6E 73 65 72 74 73 20 74 68 65 20 64 69 73     inserts the dis
003320:  63 2E 20 54 68 65 72 65 20 20 6D 79 0D 0A 20 20    c. There  my..  
003330:  20 20 20 20 20 62 65 20 64 69 66 66 65 72 65 6E         be differen
003340:  74 20 66 6F 72 6D 61 74 73 20 6F 6E 20 74 68 65    t formats on the
003350:  20 74 77 6F 20 73 69 64 65 73 2E 0D 0A 0D 0A 0D     two sides......
003360:  0A 20 20 20 20 20 20 20 43 6F 6D 6D 6F 6E 20 54    .       Common T
003370:  6F 20 41 6C 6C 20 46 6F 72 6D 61 74 73 0D 0A 0D    o All Formats...
003380:  0A 0D 0A 20 20 20 20 20 20 20 53 69 6E 67 6C 65    ...       Single
003390:  20 73 69 64 65 64 20 28 74 68 65 20 74 77 6F 20     sided (the two 
0033A0:  73 69 64 65 73 20 6F 66 20 61 20 33 20 69 6E 63    sides of a 3 inc
0033B0:  68 20 64 69 73 63 20 61 72 65 20 74 72 65 61 74    h disc are treat
0033C0:  65 64 20 73 65 70 61 72 61 74 65 6C 79 29 2E 0D    ed separately)..
0033D0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 35 31 32 20    .....       512 
0033E0:  62 79 74 65 20 70 68 79 73 69 63 61 6C 20 73 65    byte physical se
0033F0:  63 74 6F 72 20 73 69 7A 65 2E 0D 0A 0D 0A 0D 0A    ctor size.......
003400:  20 20 20 20 20 20 20 34 30 20 74 72 61 63 6B 20           40 track 
003410:  6E 75 6D 62 65 72 65 64 20 30 20 74 6F 20 33 39    numbered 0 to 39
003420:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 30    .......       10
003430:  32 34 20 62 79 74 65 20 43 50 2F 4D 20 62 6C 6F    24 byte CP/M blo
003440:  63 6B 20 73 69 7A 65 2E 0D 0A 0D 0A 0D 0A 20 20    ck size.......  
003450:  20 20 20 20 20 36 34 20 64 69 72 65 63 74 6F 72         64 director
003460:  79 20 65 6E 74 72 69 65 73 2E 0D 0A 0D 0A 0D 0A    y entries.......
003470:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
003480:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
003490:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
0034A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0034B0:  20 20 20 20 20 70 61 67 65 20 39 2E 35 0D 0A 0D         page 9.5...
0034C0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
0034D0:  20 20 53 79 73 74 65 6D 20 46 6F 72 6D 61 74 0D      System Format.
0034E0:  0A 0D 0A 20 20 20 20 20 20 20 39 20 73 65 63 74    ...       9 sect
0034F0:  6F 72 73 20 70 65 72 20 74 72 61 63 6B 20 6E 75    ors per track nu
003500:  6D 62 65 72 65 64 20 23 34 31 20 74 6F 20 23 34    mbered #41 to #4
003510:  39 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 32 20 72    9.....       2 r
003520:  65 73 65 72 76 65 64 20 74 72 61 63 6B 73 2E 0D    eserved tracks..
003530:  0A 0D 0A 20 20 20 20 20 20 20 32 20 74 6F 20 31    ...       2 to 1
003540:  20 73 65 63 74 6F 72 20 69 6E 74 65 72 6C 65 61     sector interlea
003550:  76 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    ve.....       Th
003560:  65 20 73 79 73 74 65 6D 20 66 6F 72 6D 61 74 20    e system format 
003570:  69 73 20 74 68 65 20 6D 61 69 6E 20 20 66 6F 72    is the main  for
003580:  6D 61 74 20 20 73 75 70 70 6F 72 74 65 64 2C 20    mat  supported, 
003590:  20 43 50 2F 4D 20 20 63 61 6E 20 20 6F 6E 6C 79     CP/M  can  only
0035A0:  20 20 62 65 0D 0A 20 20 20 20 20 20 20 6C 6F 61      be..       loa
0035B0:  64 65 64 20 28 43 6F 6C 64 20 42 6F 6F 74 29 20    ded (Cold Boot) 
0035C0:  66 72 6F 6D 20 61 20 73 79 73 74 65 6D 20 66 6F    from a system fo
0035D0:  72 6D 61 74 20 64 69 73 63 2E 20 43 50 2F 4D 20    rmat disc. CP/M 
0035E0:  32 2E 32 20 61 6C 73 6F 20 72 65 71 75 69 72 65    2.2 also require
0035F0:  73 20 61 0D 0A 20 20 20 20 20 20 20 73 79 73 74    s a..       syst
003600:  65 6D 20 66 6F 72 6D 61 74 20 64 69 73 63 20 74    em format disc t
003610:  6F 20 77 61 72 6D 20 62 6F 6F 74 2E 20 20 54 68    o warm boot.  Th
003620:  65 20 20 72 65 73 65 72 76 65 64 20 20 74 72 61    e  reserved  tra
003630:  63 6B 73 20 20 61 72 65 20 20 75 73 65 64 20 20    cks  are  used  
003640:  61 73 0D 0A 20 20 20 20 20 20 20 66 6F 6C 6C 6F    as..       follo
003650:  77 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ws:....         
003660:  20 20 20 20 20 20 20 54 72 61 63 6B 20 30 20 73           Track 0 s
003670:  65 63 74 6F 72 20 23 34 31 3A 20 20 20 20 20 20    ector #41:      
003680:  20 20 20 20 20 62 6F 6F 74 20 73 65 63 74 6F 72         boot sector
003690:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
0036A0:  20 20 20 20 20 54 72 61 63 6B 20 30 20 73 65 63         Track 0 sec
0036B0:  74 6F 72 20 23 34 32 3A 20 20 20 20 20 20 20 20    tor #42:        
0036C0:  20 20 20 63 6F 6E 66 69 67 75 72 61 74 69 6F 6E       configuration
0036D0:  20 73 65 63 74 6F 72 2E 0D 0A 0D 0A 20 20 20 20     sector.....    
0036E0:  20 20 20 20 20 20 20 20 20 20 20 20 54 72 61 63                Trac
0036F0:  6B 20 30 20 73 65 63 74 6F 72 73 20 23 34 33 2E    k 0 sectors #43.
003700:  2E 23 34 37 3A 20 20 20 20 20 75 6E 75 73 65 64    .#47:     unused
003710:  5C 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    \....           
003720:  20 20 20 20 20 54 72 61 63 6B 20 30 20 73 65 63         Track 0 sec
003730:  74 6F 72 73 20 23 34 38 2E 2E 23 34 39 3A 20 20    tors #48..#49:  
003740:  20 20 20 61 6E 64 0D 0A 20 20 20 20 20 20 20 20       and..        
003750:  20 20 20 20 20 20 20 20 54 72 61 63 6B 20 31 20            Track 1 
003760:  73 65 63 74 6F 72 73 20 23 34 31 2E 2E 23 34 39    sectors #41..#49
003770:  3A 20 20 20 20 20 43 43 50 20 61 6E 64 20 42 49    :     CCP and BI
003780:  4F 53 0D 0A 0D 0A 20 20 20 20 20 20 20 43 50 2F    OS....       CP/
003790:  4D 20 50 6C 75 73 20 6F 6E 6C 79 20 75 73 65 73    M Plus only uses
0037A0:  20 54 72 61 63 6B 20 30 20 73 65 63 74 6F 72 20     Track 0 sector 
0037B0:  23 34 31 20 61 73 20 61 20 62 6F 6F 74 20 73 65    #41 as a boot se
0037C0:  63 74 6F 72 0D 0A 20 20 20 20 20 20 20 54 72 61    ctor..       Tra
0037D0:  63 6B 20 30 20 73 65 63 74 6F 72 20 23 34 32 2E    ck 0 sector #42.
0037E0:  2E 2E 23 34 39 20 61 6E 64 20 54 72 61 63 6B 20    ..#49 and Track 
0037F0:  31 20 61 72 65 20 75 6E 75 73 65 64 2E 0D 0A 0D    1 are unused....
003800:  0A 20 20 20 20 20 20 20 4E 6F 74 65 3A 20 41 6E    .       Note: An
003810:  6F 74 68 65 72 20 66 6F 72 6D 61 74 20 63 61 6C    other format cal
003820:  6C 65 64 20 27 56 45 4E 44 4F 52 27 20 66 6F 72    led 'VENDOR' for
003830:  6D 61 74 20 69 73 20 61 20 20 73 70 65 63 69 61    mat is a  specia
003840:  6C 20 20 76 65 72 73 69 6F 6E 20 20 6F 66 0D 0A    l  version  of..
003850:  20 20 20 20 20 20 20 73 79 73 74 65 6D 20 66 6F           system fo
003860:  72 6D 61 74 20 77 68 69 63 68 20 64 6F 65 73 20    rmat which does 
003870:  6E 6F 74 20 63 6F 6E 74 61 69 6E 20 61 6E 79 20    not contain any 
003880:  73 6F 66 74 77 61 72 65 20 6F 6E 20 74 68 65 20    software on the 
003890:  74 77 6F 20 20 72 65 73 65 72 76 65 64 0D 0A 20    two  reserved.. 
0038A0:  20 20 20 20 20 20 74 72 61 63 6B 73 2E 20 49 74          tracks. It
0038B0:  20 69 73 20 69 6E 74 65 6E 64 65 64 20 66 6F 72     is intended for
0038C0:  20 75 73 65 20 69 6E 20 73 6F 66 74 77 61 72 65     use in software
0038D0:  20 64 69 73 74 72 69 62 75 74 69 6F 6E 2E 0D 0A     distribution...
0038E0:  0D 0A 20 20 20 20 20 20 20 44 61 74 61 20 4F 6E    ..       Data On
0038F0:  6C 79 20 46 6F 72 6D 61 74 0D 0A 0D 0A 20 20 20    ly Format....   
003900:  20 20 20 20 39 20 73 65 63 74 6F 72 73 20 70 65        9 sectors pe
003910:  72 20 74 72 61 63 6B 20 6E 75 6D 62 65 72 65 64    r track numbered
003920:  20 23 43 31 20 74 6F 20 23 43 39 2E 0D 0A 0D 0A     #C1 to #C9.....
003930:  20 20 20 20 20 20 20 30 20 72 65 73 65 72 76 65           0 reserve
003940:  64 20 74 72 61 63 6B 73 2E 0D 0A 0D 0A 20 20 20    d tracks.....   
003950:  20 20 20 20 32 20 74 6F 20 31 20 73 65 63 74 6F        2 to 1 secto
003960:  72 20 69 6E 74 65 72 6C 65 61 76 65 2E 0D 0A 0D    r interleave....
003970:  0A 20 20 20 20 20 20 20 54 68 69 73 20 66 6F 72    .       This for
003980:  6D 61 74 20 69 73 20 6E 6F 74 20 72 65 63 6F 6D    mat is not recom
003990:  6D 65 6E 64 65 64 20 66 6F 72 20 75 73 65 20 77    mended for use w
0039A0:  69 74 68 20 43 50 2F 4D 20 32 2E 32 20 73 69 6E    ith CP/M 2.2 sin
0039B0:  63 65 20 69 74 20 20 69 73 20 20 6E 6F 74 0D 0A    ce it  is  not..
0039C0:  20 20 20 20 20 20 20 70 6F 73 73 69 62 6C 65 20           possible 
0039D0:  74 6F 20 27 77 61 72 6D 20 62 6F 6F 74 27 20 66    to 'warm boot' f
0039E0:  72 6F 6D 20 69 74 2E 20 48 6F 77 65 76 65 72 2C    rom it. However,
0039F0:  20 62 65 63 61 75 73 65 20 74 68 65 72 65 20 20     because there  
003A00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
003A10:  03 00 00 00 02 09 50 E5 03 00 C1 02 00 00 00 02    ......P.........
003A20:  03 00 C2 02 00 00 00 02 03 00 C3 02 00 00 00 02    ................
003A30:  03 00 C4 02 00 00 00 02 03 00 C5 02 00 00 00 02    ................
003A40:  03 00 C6 02 00 00 00 02 03 00 C7 02 00 00 00 02    ................
003A50:  03 00 C8 02 00 00 00 02 03 00 C9 02 00 00 00 02    ................
003A60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003A70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003A80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003A90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003AF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
003B00:  69 73 20 20 61 20 20 6C 69 74 74 6C 65 0D 0A 20    is  a  little.. 
003B10:  20 20 20 20 20 20 6D 6F 72 65 20 64 69 73 63 20          more disc 
003B20:  73 70 61 63 65 20 61 76 61 69 6C 61 62 6C 65 20    space available 
003B30:  69 74 20 69 73 20 75 73 65 66 75 6C 20 66 6F 72    it is useful for
003B40:  20 41 4D 53 44 4F 53 20 6F 72 20 43 50 2F 4D 20     AMSDOS or CP/M 
003B50:  50 6C 75 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    Plus.....       
003B60:  49 42 4D 20 46 6F 72 6D 61 74 0D 0A 0D 0A 20 20    IBM Format....  
003B70:  20 20 20 20 20 38 20 73 65 63 74 6F 72 73 20 70         8 sectors p
003B80:  65 72 20 74 72 61 63 6B 20 6E 75 6D 62 65 72 65    er track numbere
003B90:  64 20 31 20 74 6F 20 38 0D 0A 0D 0A 20 20 20 20    d 1 to 8....    
003BA0:  20 20 20 31 20 72 65 73 65 72 76 65 64 20 74 72       1 reserved tr
003BB0:  61 63 6B 0D 0A 0D 0A 20 20 20 20 20 20 20 6E 6F    ack....       no
003BC0:  20 73 65 63 74 6F 72 20 69 6E 74 65 72 6C 65 61     sector interlea
003BD0:  76 65 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    ve......       T
003BE0:  68 69 73 20 66 6F 72 6D 61 74 20 69 73 20 6C 6F    his format is lo
003BF0:  67 69 63 61 6C 6C 79 20 74 68 65 20 73 61 6D 65    gically the same
003C00:  20 61 73 20 74 68 65 20 73 69 6E 67 6C 65 2D 73     as the single-s
003C10:  69 64 65 64 20 66 6F 72 6D 61 74 20 20 75 73 65    ided format  use
003C20:  64 20 20 62 79 0D 0A 20 20 20 20 20 20 20 43 50    d  by..       CP
003C30:  2F 4D 20 6F 6E 20 74 68 65 20 49 42 4D 20 50 43    /M on the IBM PC
003C40:  2E 20 49 74 20 69 73 20 69 6E 74 65 6E 64 65 64    . It is intended
003C50:  20 20 66 6F 72 20 20 73 70 65 63 69 61 6C 69 73      for  specialis
003C60:  74 20 20 75 73 65 20 20 61 6E 64 20 20 69 73 20    t  use  and  is 
003C70:  20 6E 6F 74 0D 0A 20 20 20 20 20 20 20 6F 74 68     not..       oth
003C80:  65 72 77 69 73 65 20 72 65 63 6F 6D 6D 65 6E 64    erwise recommend
003C90:  65 64 20 61 73 20 69 74 20 69 73 20 6E 6F 74 20    ed as it is not 
003CA0:  70 6F 73 73 69 62 6C 65 20 74 6F 20 27 77 61 72    possible to 'war
003CB0:  6D 20 62 6F 6F 74 27 20 66 72 6F 6D 20 69 74 2E    m boot' from it.
003CC0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
003CD0:  20 20 20 20 20 41 4D 53 54 52 41 44 20 34 36 34         AMSTRAD 464
003CE0:  2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41    /664/6128 FIRMWA
003CF0:  52 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20    RE              
003D00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
003D10:  20 20 20 70 61 67 65 20 39 2E 36 0D 0A 0D 0A 0D       page 9.6.....
003D20:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
003D30:  39 2E 35 20 42 6F 6F 74 20 53 65 63 74 6F 72 0D    9.5 Boot Sector.
003D40:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 6E 20 6F    .....       In o
003D50:  72 64 65 72 20 74 68 61 74 20 6E 6F 6E 2D 43 50    rder that non-CP
003D60:  2F 4D 20 73 79 73 74 65 6D 73 20 6D 61 79 20 62    /M systems may b
003D70:  65 20 69 6D 70 6C 65 6D 65 6E 74 65 64 20 61 74    e implemented at
003D80:  20 61 20 6C 61 74 65 72 20 64 61 74 65 20 20 74     a later date  t
003D90:  68 65 0D 0A 20 20 20 20 20 20 20 42 49 4F 53 20    he..       BIOS 
003DA0:  69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 20 69    initialization i
003DB0:  73 20 70 65 72 66 6F 72 6D 65 64 2C 20 69 6E 20    s performed, in 
003DC0:  70 61 72 74 2C 20 62 79 20 61 20 62 6F 6F 74 20    part, by a boot 
003DD0:  70 72 6F 67 72 61 6D 20 77 68 69 63 68 20 20 69    program which  i
003DE0:  73 0D 0A 20 20 20 20 20 20 20 72 65 61 64 20 66    s..       read f
003DF0:  72 6F 6D 20 74 68 65 20 64 69 73 63 20 62 65 66    rom the disc bef
003E00:  6F 72 65 20 61 74 74 65 6D 70 74 69 6E 67 20 74    ore attempting t
003E10:  6F 20 6C 6F 61 64 20 20 43 50 2F 4D 2E 20 20 49    o load  CP/M.  I
003E20:  6E 20 20 74 68 65 20 20 6E 6F 6E 2D 43 50 2F 4D    n  the  non-CP/M
003E30:  0D 0A 20 20 20 20 20 20 20 63 61 73 65 20 74 68    ..       case th
003E40:  65 20 62 6F 6F 74 20 70 72 6F 67 72 61 6D 20 77    e boot program w
003E50:  6F 75 6C 64 20 6E 6F 74 20 6A 75 6D 70 20 74 6F    ould not jump to
003E60:  20 74 68 65 20 77 61 72 6D 20 62 6F 6F 74 20 72     the warm boot r
003E70:  6F 75 74 69 6E 65 20 20 62 75 74 20 20 67 6F 0D    outine  but  go.
003E80:  0A 20 20 20 20 20 20 20 6F 6E 20 69 74 73 20 6F    .       on its o
003E90:  77 6E 20 77 61 79 2C 20 75 73 69 6E 67 20 74 68    wn way, using th
003EA0:  65 20 42 49 4F 53 20 61 6E 64 20 66 69 72 6D 77    e BIOS and firmw
003EB0:  61 72 65 20 72 6F 75 74 69 6E 65 73 20 61 73 20    are routines as 
003EC0:  64 65 73 69 72 65 64 2E 0D 0A 0D 0A 0D 0A 20 20    desired.......  
003ED0:  20 20 20 20 20 54 68 65 20 62 6F 6F 74 20 70 72         The boot pr
003EE0:  6F 67 72 61 6D 20 69 73 20 69 6E 20 74 68 65 20    ogram is in the 
003EF0:  62 6F 6F 74 20 20 73 65 63 74 6F 72 20 20 77 68    boot  sector  wh
003F00:  69 63 68 20 20 69 73 20 20 74 68 65 20 20 66 69    ich  is  the  fi
003F10:  72 73 74 20 20 73 65 63 74 6F 72 0D 0A 20 20 20    rst  sector..   
003F20:  20 20 20 20 28 73 65 63 74 6F 72 20 23 34 31 29        (sector #41)
003F30:  20 6F 6E 20 74 72 61 63 6B 20 30 2E 0D 0A 0D 0A     on track 0.....
003F40:  20 20 20 20 20 20 20 44 75 72 69 6E 67 20 61 20           During a 
003F50:  63 6F 6C 64 20 62 6F 6F 74 20 74 68 65 20 42 49    cold boot the BI
003F60:  4F 53 20 69 73 20 69 6E 69 74 69 61 6C 69 7A 65    OS is initialize
003F70:  64 20 69 6E 74 6F 20 61 20 6D 69 6E 69 6D 75 6D    d into a minimum
003F80:  20 73 74 61 74 65 20 62 65 66 6F 72 65 0D 0A 20     state before.. 
003F90:  20 20 20 20 20 20 6C 6F 61 64 69 6E 67 20 61 6E          loading an
003FA0:  64 20 65 78 65 63 75 74 69 6E 67 20 74 68 65 20    d executing the 
003FB0:  62 6F 6F 74 20 70 72 6F 67 72 61 6D 2E 20 54 68    boot program. Th
003FC0:  69 73 20 73 74 61 74 65 20 69 73 20 61 73 20 66    is state is as f
003FD0:  6F 6C 6C 6F 77 73 2E 0D 0A 0D 0A 0D 0A 20 20 20    ollows.......   
003FE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 41 6C 6C                 All
003FF0:  20 72 6F 75 74 69 6E 65 73 20 69 6E 20 74 68 65     routines in the
004000:  20 52 4F 4D 20 63 6F 70 79 20 6F 66 20 74 68 65     ROM copy of the
004010:  20 42 49 4F 53 20 20 6A 75 6D 70 62 6C 6F 63 6B     BIOS  jumpblock
004020:  20 20 61 6C 6C 20 20 74 68 65 0D 0A 20 20 20 20      all  the..    
004030:  20 20 20 20 20 20 20 20 20 20 20 20 72 6F 75 74                rout
004040:  69 6E 65 73 20 69 6E 20 74 68 65 20 65 78 74 65    ines in the exte
004050:  6E 64 65 64 20 6A 75 6D 70 62 6C 6F 63 6B 20 61    nded jumpblock a
004060:  72 65 20 61 76 61 69 6C 61 62 6C 65 2E 0D 0A 0D    re available....
004070:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
004080:  20 41 6C 74 65 72 6E 61 74 65 20 61 6E 64 20 49     Alternate and I
004090:  59 20 72 65 67 69 73 74 65 72 20 73 61 76 69 6E    Y register savin
0040A0:  67 20 69 73 20 65 6E 61 62 6C 65 64 2E 0D 0A 0D    g is enabled....
0040B0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
0040C0:  20 49 6E 74 65 72 72 75 70 74 73 20 61 72 65 20     Interrupts are 
0040D0:  69 6E 64 69 72 65 63 74 65 64 20 76 69 61 20 74    indirected via t
0040E0:  68 65 20 42 49 4F 53 20 61 6E 64 20 72 75 6E 20    he BIOS and run 
0040F0:  6F 6E 20 74 68 65 20 20 42 49 4F 53 27 73 0D 0A    on the  BIOS's..
004100:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
004110:  73 74 61 63 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20    stack.....      
004120:  20 20 20 20 20 20 20 20 20 20 44 69 73 63 20 6D              Disc m
004130:  65 73 73 61 67 65 73 20 61 72 65 20 65 6E 61 62    essages are enab
004140:  6C 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    led.....        
004150:  20 20 20 20 20 20 20 20 54 68 65 20 69 6E 69 74            The init
004160:  69 61 6C 20 63 6F 6D 6D 61 6E 64 20 62 75 66 66    ial command buff
004170:  65 72 20 69 73 20 65 6D 70 74 79 2E 0D 0A 0D 0A    er is empty.....
004180:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
004190:  54 68 65 20 20 49 4F 42 59 54 45 20 20 61 74 20    The  IOBYTE  at 
0041A0:  20 23 30 30 30 33 20 20 69 73 20 20 69 6E 69 74     #0003  is  init
0041B0:  69 61 6C 69 7A 65 64 20 20 74 6F 20 20 23 38 31    ialized  to  #81
0041C0:  20 20 28 4C 53 54 3A 3D 4C 50 54 3A 2C 0D 0A 20      (LST:=LPT:,.. 
0041D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50                   P
0041E0:  55 4E 3A 3D 54 54 59 3A 2C 20 52 44 52 3A 3D 54    UN:=TTY:, RDR:=T
0041F0:  54 59 3A 2C 20 43 4F 4E 3A 3D 43 52 54 3A 29 2E    TY:, CON:=CRT:).
004200:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
004210:  20 20 20 20 54 68 65 20 63 75 72 72 65 6E 74 20        The current 
004220:  64 72 69 76 65 20 61 74 20 23 30 30 30 34 20 69    drive at #0004 i
004230:  73 20 69 6E 69 74 69 61 6C 69 7A 65 64 20 74 6F    s initialized to
004240:  20 23 30 30 2E 0D 0A 0D 0A 20 20 20 20 20 20 20     #00.....       
004250:  20 20 20 20 20 20 20 20 20 54 68 65 20 73 65 72             The ser
004260:  69 61 6C 20 69 6E 74 65 72 66 61 63 65 20 69 73    ial interface is
004270:  20 6E 6F 74 20 69 6E 69 74 69 61 6C 69 7A 65 64     not initialized
004280:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
004290:  20 20 20 20 20 54 68 65 20 43 43 50 20 61 6E 64         The CCP and
0042A0:  20 42 44 4F 53 20 61 72 65 20 6E 6F 74 20 69 6E     BDOS are not in
0042B0:  20 73 74 6F 72 65 2E 0D 0A 0D 0A 20 20 20 20 20     store.....     
0042C0:  20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 43               The C
0042D0:  50 2F 4D 20 6A 75 6D 70 73 20 61 74 20 23 30 30    P/M jumps at #00
0042E0:  30 30 20 61 6E 64 20 23 30 30 30 35 20 61 72 65    00 and #0005 are
0042F0:  20 6E 6F 74 20 69 6E 69 74 69 61 6C 69 7A 65 64     not initialized
004300:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    .......       Th
004310:  65 20 62 6F 6F 74 20 73 65 63 74 6F 72 20 69 73    e boot sector is
004320:  20 72 65 61 64 20 61 6E 64 20 6C 6F 61 64 65 64     read and loaded
004330:  20 69 6E 74 6F 20 20 73 74 6F 72 65 20 20 61 74     into  store  at
004340:  20 20 23 30 31 30 30 3B 20 20 74 68 65 20 20 73      #0100;  the  s
004350:  74 61 63 6B 0D 0A 20 20 20 20 20 20 20 70 6F 69    tack..       poi
004360:  6E 74 65 72 20 69 73 20 69 6E 69 74 69 61 6C 69    nter is initiali
004370:  7A 65 64 20 74 6F 20 61 20 76 61 6C 75 65 20 69    zed to a value i
004380:  6D 6D 65 64 69 61 74 65 6C 79 20 62 65 6C 6F 77    mmediately below
004390:  20 20 74 68 65 20 20 42 49 4F 53 27 73 20 20 64      the  BIOS's  d
0043A0:  61 74 61 0D 0A 20 20 20 20 20 20 20 28 23 41 44    ata..       (#AD
0043B0:  33 33 20 69 73 20 6E 6F 72 6D 61 6C 29 20 61 72    33 is normal) ar
0043C0:  65 61 20 61 6E 64 20 74 68 65 20 62 6F 6F 74 20    ea and the boot 
0043D0:  70 72 6F 67 72 61 6D 20 69 73 20 65 6E 74 65 72    program is enter
0043E0:  65 64 20 61 74 20 20 23 30 31 30 30 2E 20 20 54    ed at  #0100.  T
0043F0:  68 65 0D 0A 20 20 20 20 20 20 20 62 6F 6F 74 20    he..       boot 
004400:  70 72 6F 67 72 61 6D 20 6D 61 79 20 75 73 65 20    program may use 
004410:  73 74 6F 72 65 20 66 72 6F 6D 20 23 30 31 30 30    store from #0100
004420:  20 75 70 77 61 72 64 73 20 20 75 6E 74 69 6C 20     upwards  until 
004430:  20 69 74 20 20 72 65 61 63 68 65 73 20 20 74 68     it  reaches  th
004440:  65 0D 0A 20 20 20 20 20 20 20 73 74 61 63 6B 2E    e..       stack.
004450:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 6F 20    ......       To 
004460:  72 75 6E 20 43 50 2F 4D 20 74 68 65 20 62 6F 6F    run CP/M the boo
004470:  74 20 70 72 6F 67 72 61 6D 20 6D 75 73 74 2C 20    t program must, 
004480:  61 74 20 6C 65 61 73 74 2C 20 6A 75 6D 70 20 20    at least, jump  
004490:  74 6F 20 20 74 68 65 20 20 77 61 72 6D 20 20 62    to  the  warm  b
0044A0:  6F 6F 74 0D 0A 20 20 20 20 20 20 20 65 6E 74 72    oot..       entr
0044B0:  79 20 69 6E 20 74 68 65 20 52 4F 4D 20 6A 75 6D    y in the ROM jum
0044C0:  70 62 6C 6F 63 6B 2E 0D 0A 0D 0A 20 20 20 20 20    pblock.....     
0044D0:  20 20 54 68 65 20 62 6F 6F 74 20 70 72 6F 67 72      The boot progr
0044E0:  61 6D 20 66 6F 72 20 43 50 2F 4D 20 32 2E 32 20    am for CP/M 2.2 
0044F0:  6C 6F 61 64 73 20 61 6E 64 20 6F 62 65 79 73 20    loads and obeys 
004500:  74 68 65 20 63 6F 6E 66 69 67 75 72 61 74 69 6F    the configuratio
004510:  6E 20 73 65 63 74 6F 72 0D 0A 20 20 20 20 20 20    n sector..      
004520:  20 61 6E 64 20 74 68 65 6E 20 77 61 72 6D 20 62     and then warm b
004530:  6F 6F 74 73 20 43 50 2F 4D 2E 0D 0A 0D 0A 20 20    oots CP/M.....  
004540:  20 20 20 20 20 54 68 65 20 62 6F 6F 74 20 70 72         The boot pr
004550:  6F 67 72 61 6D 20 66 6F 72 20 43 50 2F 4D 20 50    ogram for CP/M P
004560:  6C 75 73 20 73 65 61 72 63 68 65 73 20 66 6F 72    lus searches for
004570:  2C 20 6C 6F 61 64 73 20 61 6E 64 20 65 78 65 63    , loads and exec
004580:  75 74 65 73 20 61 20 66 69 6C 65 0D 0A 20 20 20    utes a file..   
004590:  20 20 20 20 77 69 74 68 20 74 68 65 20 74 79 70        with the typ
0045A0:  65 20 70 61 72 74 20 2E 45 4D 53 2E 0D 0A 0D 0A    e part .EMS.....
0045B0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
0045C0:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
0045D0:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
0045E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0045F0:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 39 2E             page 9.
004600:  37 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    7.............. 
004610:  20 20 20 20 20 20 54 68 65 20 62 6F 6F 74 20 70          The boot p
004620:  72 6F 67 72 61 6D 20 68 61 73 20 74 68 65 20 66    rogram has the f
004630:  6F 6C 6C 6F 77 69 6E 67 20 69 6E 74 65 72 66 61    ollowing interfa
004640:  63 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E    ce:....       En
004650:  74 72 79 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    try:....        
004660:  20 20 20 20 20 20 20 20 53 50 3D 68 69 67 68 65            SP=highe
004670:  73 74 20 61 64 64 72 65 73 73 20 61 76 61 69 6C    st address avail
004680:  61 62 6C 65 2B 31 20 28 61 20 67 6F 6F 64 20 70    able+1 (a good p
004690:  6C 61 63 65 20 66 6F 72 20 74 68 65 20 73 74 61    lace for the sta
0046A0:  63 6B 29 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ck)..           
0046B0:  20 20 20 20 20 42 43 3D 61 64 64 72 65 73 73 20         BC=address 
0046C0:  6F 66 20 52 4F 4D 20 63 6F 70 79 20 6F 66 20 42    of ROM copy of B
0046D0:  49 4F 53 20 6A 75 6D 70 62 6C 6F 63 6B 20 28 42    IOS jumpblock (B
0046E0:  4F 4F 54 29 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    OOT)......      
0046F0:  20 45 78 69 74 3A 0D 0A 0D 0A 20 20 20 20 20 20     Exit:....      
004700:  20 20 20 20 20 20 20 20 20 20 54 6F 20 72 75 6E              To run
004710:  20 43 50 2F 4D 20 74 68 65 20 70 72 6F 67 72 61     CP/M the progra
004720:  6D 20 73 68 6F 75 6C 64 20 6A 75 6D 70 20 74 68    m should jump th
004730:  65 20 74 68 65 20 20 57 42 4F 4F 54 20 20 65 6E    e the  WBOOT  en
004740:  74 72 79 20 20 69 6E 0D 0A 20 20 20 20 20 20 20    try  in..       
004750:  20 20 20 20 20 20 20 20 20 74 68 65 20 61 62 6F             the abo
004760:  76 65 20 6A 75 6D 70 62 6C 6F 63 6B 0D 0A 0D 0A    ve jumpblock....
004770:  20 20 20 20 20 20 20 54 68 65 20 52 4F 4D 20 63           The ROM c
004780:  6F 70 79 20 6F 66 20 74 68 65 20 42 49 4F 53 20    opy of the BIOS 
004790:  6A 75 6D 70 62 6C 6F 63 6B 20 73 68 6F 75 6C 64    jumpblock should
0047A0:  20 6E 6F 74 20 20 62 65 20 20 75 73 65 64 20 20     not  be  used  
0047B0:  61 74 20 20 61 6E 79 20 20 74 69 6D 65 0D 0A 20    at  any  time.. 
0047C0:  20 20 20 20 20 20 28 69 6E 64 65 65 64 2C 20 6F          (indeed, o
0047D0:  6E 6C 79 20 74 68 65 20 62 6F 6F 74 20 70 72 6F    nly the boot pro
0047E0:  67 72 61 6D 20 6B 6E 6F 77 73 20 77 68 65 72 65    gram knows where
0047F0:  20 69 74 20 69 73 29 2E 0D 0A 0D 0A 20 20 20 20     it is).....    
004800:  20 20 20 39 2E 36 20 41 4D 53 44 4F 53 20 4D 65       9.6 AMSDOS Me
004810:  73 73 61 67 65 73 0D 0A 0D 0A 20 20 20 20 20 20    ssages....      
004820:  20 41 4D 53 44 4F 53 20 75 73 65 73 20 74 68 65     AMSDOS uses the
004830:  20 43 50 2F 4D 20 32 2E 32 20 42 49 4F 53 20 69     CP/M 2.2 BIOS i
004840:  6E 20 6F 72 64 65 72 20 74 68 65 20 61 63 63 65    n order the acce
004850:  73 73 20 74 68 65 20 64 69 73 63 2E 20 20 54 68    ss the disc.  Th
004860:  75 73 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20    us  the..       
004870:  42 49 4F 53 20 6D 65 73 73 61 67 65 73 20 77 69    BIOS messages wi
004880:  6C 6C 20 62 65 20 64 69 73 70 6C 61 79 65 64 20    ll be displayed 
004890:  69 6E 20 74 68 65 20 65 76 65 6E 74 20 6F 66 20    in the event of 
0048A0:  20 61 20 20 64 69 73 63 20 20 65 72 72 6F 72 2E     a  disc  error.
0048B0:  20 20 54 68 69 73 0D 0A 20 20 20 20 20 20 20 73      This..       s
0048C0:  65 63 74 69 6F 6E 20 65 78 70 6C 61 69 6E 73 20    ection explains 
0048D0:  74 68 65 20 6D 65 61 6E 69 6E 67 20 6F 66 20 74    the meaning of t
0048E0:  68 65 20 41 4D 53 44 4F 53 20 6D 65 73 73 61 67    he AMSDOS messag
0048F0:  65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49 6E    es.....       In
004900:  20 74 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20 3C     the following <
004910:  64 72 69 76 65 3E 20 6D 65 61 6E 73 20 41 20 6F    drive> means A o
004920:  72 20 20 42 2C 20 20 3C 66 69 6C 65 6E 61 6D 65    r  B,  <filename
004930:  3E 20 20 6D 65 61 6E 73 20 20 61 6E 20 20 41 4D    >  means  an  AM
004940:  53 44 4F 53 0D 0A 20 20 20 20 20 20 20 66 69 6C    SDOS..       fil
004950:  65 6E 61 6D 65 2E 0D 0A 0D 0A 20 20 20 20 20 20    ename.....      
004960:  20 20 20 20 20 20 20 20 20 20 42 61 64 20 63 6F              Bad co
004970:  6D 6D 61 6E 64 0D 0A 0D 0A 20 20 20 20 20 20 20    mmand....       
004980:  54 68 65 72 65 20 69 73 20 61 20 73 79 6E 74 61    There is a synta
004990:  78 20 65 72 72 6F 72 20 69 6E 20 61 20 63 6F 6D    x error in a com
0049A0:  6D 61 6E 64 20 6F 72 20 66 69 6C 65 6E 61 6D 65    mand or filename
0049B0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
0049C0:  20 20 20 20 20 3C 66 69 6C 65 6E 61 6D 65 3E 20         <filename> 
0049D0:  61 6C 72 65 61 64 79 20 65 78 69 73 74 73 0D 0A    already exists..
0049E0:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 75 73 65    ..       The use
0049F0:  72 20 69 73 20 74 72 79 69 6E 67 20 74 6F 20 72    r is trying to r
004A00:  65 6E 61 6D 65 20 61 20 66 69 6C 65 20 74 6F 20    ename a file to 
004A10:  61 20 6E 61 6D 65 20 77 68 69 63 68 20 69 73 20    a name which is 
004A20:  61 6C 72 65 61 64 79 20 69 6E 20 75 73 65 2E 0D    already in use..
004A30:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
004A40:  20 20 20 3C 66 69 6C 65 6E 61 6D 65 3E 20 6E 6F       <filename> no
004A50:  74 20 66 6F 75 6E 64 0D 0A 0D 0A 20 20 20 20 20    t found....     
004A60:  20 20 54 68 65 20 75 73 65 72 20 69 73 20 74 72      The user is tr
004A70:  79 69 6E 67 20 74 6F 20 6F 70 65 6E 20 66 6F 72    ying to open for
004A80:  20 69 6E 70 75 74 2C 20 65 72 61 73 65 20 6F 72     input, erase or
004A90:  20 72 65 6E 61 6D 65 20 61 20 66 69 6C 65 20 74     rename a file t
004AA0:  68 61 74 20 64 6F 65 73 0D 0A 20 20 20 20 20 20    hat does..      
004AB0:  20 6E 6F 74 20 65 78 69 73 74 2E 0D 0A 0D 0A 20     not exist..... 
004AC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44                   D
004AD0:  72 69 76 65 20 3C 64 72 69 76 65 3E 3A 20 64 69    rive <drive>: di
004AE0:  72 65 63 74 6F 72 79 20 66 75 6C 6C 0D 0A 0D 0A    rectory full....
004AF0:  20 20 20 20 20 20 20 54 68 65 72 65 20 69 73 20           There is 
004B00:  6E 6F 20 6D 6F 72 65 20 66 72 65 65 20 64 69 72    no more free dir
004B10:  65 63 74 6F 72 79 20 20 65 6E 74 72 69 65 73 20    ectory  entries 
004B20:  20 28 36 34 20 20 64 69 72 65 63 74 6F 72 79 20     (64  directory 
004B30:  20 65 6E 74 72 69 65 73 20 20 70 65 72 0D 0A 20     entries  per.. 
004B40:  20 20 20 20 20 20 64 69 73 63 29 2E 0D 0A 0D 0A          disc).....
004B50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
004B60:  44 72 69 76 65 20 3C 64 72 69 76 65 3E 3A 20 64    Drive <drive>: d
004B70:  69 73 63 20 66 75 6C 6C 0D 0A 0D 0A 20 20 20 20    isc full....    
004B80:  20 20 20 54 68 65 72 65 20 69 73 20 6E 6F 20 6D       There is no m
004B90:  6F 72 65 20 66 72 65 65 20 64 69 73 63 20 62 6C    ore free disc bl
004BA0:  6F 63 6B 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    ocks.....       
004BB0:  20 20 20 20 20 20 20 20 20 44 72 69 76 65 20 3C             Drive <
004BC0:  64 72 69 76 65 3E 3A 20 64 69 73 63 20 63 68 61    drive>: disc cha
004BD0:  6E 67 65 64 2C 20 63 6C 6F 73 69 6E 67 20 3C 66    nged, closing <f
004BE0:  69 6C 65 6E 61 6D 65 3E 0D 0A 0D 0A 20 20 20 20    ilename>....    
004BF0:  20 20 20 54 68 65 20 75 73 65 72 20 68 61 73 20       The user has 
004C00:  63 68 61 6E 67 65 64 20 74 68 65 20 64 69 73 63    changed the disc
004C10:  20 77 68 69 6C 65 20 66 69 6C 65 73 20 77 65 72     while files wer
004C20:  65 20 73 74 69 6C 6C 20 6F 70 65 6E 20 6F 6E 20    e still open on 
004C30:  69 74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    it.....         
004C40:  20 20 20 20 20 20 20 3C 66 69 6C 65 6E 61 6D 65           <filename
004C50:  3E 20 69 73 20 72 65 61 64 20 6F 6E 6C 79 0D 0A    > is read only..
004C60:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 75 73 65    ..       The use
004C70:  72 20 69 73 20 20 74 72 79 69 6E 67 20 20 74 6F    r is  trying  to
004C80:  20 20 65 72 61 73 65 20 20 6F 72 20 20 72 65 6E      erase  or  ren
004C90:  61 6D 65 20 20 61 20 20 66 69 6C 65 20 20 77 68    ame  a  file  wh
004CA0:  69 63 68 20 20 69 73 20 20 6D 61 72 6B 65 64 0D    ich  is  marked.
004CB0:  0A 20 20 20 20 20 20 20 72 65 61 64 2D 6F 6E 6C    .       read-onl
004CC0:  79 2E 20 4D 61 79 20 61 6C 73 6F 20 62 65 20 63    y. May also be c
004CD0:  61 75 73 65 64 20 62 79 20 63 6C 6F 73 69 6E 67    aused by closing
004CE0:  20 61 20 66 69 6C 65 20 77 68 65 6E 20 65 78 69     a file when exi
004CF0:  73 74 69 6E 67 20 20 76 65 72 73 69 6F 6E 0D 0A    sting  version..
004D00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
004D10:  04 00 00 00 02 09 50 E5 04 00 C1 02 00 00 00 02    ......P.........
004D20:  04 00 C2 02 00 00 00 02 04 00 C3 02 00 00 00 02    ................
004D30:  04 00 C4 02 00 00 00 02 04 00 C5 02 00 00 00 02    ................
004D40:  04 00 C6 02 00 00 00 02 04 00 C7 02 00 00 00 02    ................
004D50:  04 00 C8 02 00 00 00 02 04 00 C9 02 00 00 00 02    ................
004D60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004D70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004D80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004D90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004DF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
004E00:  20 20 20 20 20 20 20 6F 66 20 74 68 65 20 66 69           of the fi
004E10:  6C 65 20 69 73 20 72 65 61 64 2D 6F 6E 6C 79 2E    le is read-only.
004E20:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
004E30:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
004E40:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
004E50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
004E60:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
004E70:  65 20 39 2E 38 0D 0A 1A 74 65 72 2C 20 6F 66 20    e 9.8...ter, of 
004E80:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004E90:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004EA0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004EB0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004EC0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004ED0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004EE0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004EF0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F00:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F10:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F20:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F30:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F40:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F50:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F60:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F70:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F80:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004F90:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FA0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FB0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FC0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FD0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FE0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
004FF0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005000:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005010:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005020:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005030:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005040:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005050:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005060:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005070:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005080:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005090:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0050F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005100:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005110:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005120:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005130:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005140:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005150:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005160:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005170:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005180:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005190:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0051F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
005200:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
005210:  20 20 20 39 2E 37 20 42 49 4F 53 20 46 61 63 69       9.7 BIOS Faci
005220:  6C 69 74 69 65 73 20 41 76 61 69 6C 61 62 6C 65    lities Available
005230:  20 74 6F 20 41 4D 53 44 4F 53 0D 0A 0D 0A 20 20     to AMSDOS....  
005240:  20 20 20 20 20 41 4D 53 44 4F 53 20 75 73 65 73         AMSDOS uses
005250:  20 74 68 65 20 43 50 2F 4D 20 42 49 4F 53 20 32     the CP/M BIOS 2
005260:  2E 32 20 74 6F 20 61 63 63 65 73 73 20 74 68 65    .2 to access the
005270:  20 20 64 69 73 63 2E 20 20 49 6E 20 20 6F 72 64      disc.  In  ord
005280:  65 72 20 20 74 68 61 74 20 20 61 0D 0A 20 20 20    er  that  a..   
005290:  20 20 20 20 70 72 6F 67 72 61 6D 20 72 75 6E 6E        program runn
0052A0:  69 6E 67 20 75 6E 64 65 72 20 41 4D 53 44 4F 53    ing under AMSDOS
0052B0:  20 6D 61 79 20 61 63 63 65 73 73 20 74 68 65 20     may access the 
0052C0:  64 69 73 63 20 64 69 72 65 63 74 6C 79 20 6E 69    disc directly ni
0052D0:  6E 65 20 6F 66 20 20 74 68 65 0D 0A 20 20 20 20    ne of  the..    
0052E0:  20 20 20 42 49 4F 53 20 65 78 74 65 6E 64 65 64       BIOS extended
0052F0:  20 6A 75 6D 70 62 6C 6F 63 6B 20 20 72 6F 75 74     jumpblock  rout
005300:  69 6E 65 73 20 20 61 72 65 20 20 61 76 61 69 6C    ines  are  avail
005310:  61 62 6C 65 2E 20 20 54 68 65 20 20 72 6F 75 74    able.  The  rout
005320:  69 6E 65 73 20 20 61 72 65 0D 0A 20 20 20 20 20    ines  are..     
005330:  20 20 61 63 63 65 73 73 65 64 20 61 73 20 65 78      accessed as ex
005340:  74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 73 2E    ternal commands.
005350:  20 41 6E 20 65 78 61 6D 70 6C 65 20 6F 66 20 75     An example of u
005360:  73 69 6E 67 20 74 68 65 73 65 20 20 63 6F 6D 6D    sing these  comm
005370:  61 6E 64 73 20 20 69 73 0D 0A 20 20 20 20 20 20    ands  is..      
005380:  20 67 69 76 65 6E 20 69 6E 20 73 65 63 74 69 6F     given in sectio
005390:  6E 20 31 30 2E 36 2E 0D 0A 0D 0A 20 20 20 20 20    n 10.6.....     
0053A0:  20 20 4E 6F 74 65 3A 20 54 68 65 20 42 49 4F 53      Note: The BIOS
0053B0:  20 65 78 74 65 6E 64 65 64 20 6A 75 6D 70 62 6C     extended jumpbl
0053C0:  6F 63 6B 20 69 74 73 65 6C 66 20 69 73 20 6E 6F    ock itself is no
0053D0:  74 20 61 76 61 69 6C 61 62 6C 65 2C 20 20 69 6E    t available,  in
0053E0:  64 65 65 64 20 20 69 74 0D 0A 0D 0A 20 20 20 20    deed  it....    
0053F0:  20 20 20 64 6F 65 73 20 6E 6F 74 20 65 78 69 73       does not exis
005400:  74 20 69 6E 20 74 68 65 20 41 4D 53 44 4F 53 20    t in the AMSDOS 
005410:  65 6E 76 69 72 6F 6E 6D 65 6E 74 2E 0D 0A 0D 0A    environment.....
005420:  20 20 20 20 20 20 20 54 68 65 20 42 49 4F 53 20           The BIOS 
005430:  72 6F 75 74 69 6E 65 73 20 61 76 61 69 6C 61 62    routines availab
005440:  6C 65 20 61 6E 64 20 74 68 65 69 72 20 63 6F 6D    le and their com
005450:  6D 61 6E 64 20 6E 61 6D 65 73 20 61 72 65 20 61    mand names are a
005460:  73 20 66 6F 6C 6C 6F 77 73 3A 0D 0A 0D 0A 20 20    s follows:....  
005470:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 45                  SE
005480:  54 20 4D 45 53 53 41 47 45 20 20 20 20 20 20 20    T MESSAGE       
005490:  20 20 20 20 20 20 20 20 20 20 20 20 43 74 72 6C                Ctrl
0054A0:  20 28 23 30 31 29 0D 0A 20 20 20 20 20 20 20 20     (#01)..        
0054B0:  20 20 20 20 20 20 20 20 53 45 54 55 50 20 44 49            SETUP DI
0054C0:  53 43 20 20 20 20 20 20 20 20 20 20 20 20 20 20    SC              
0054D0:  20 20 20 20 20 20 43 74 72 6C 20 28 23 30 32 29          Ctrl (#02)
0054E0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0054F0:  20 20 53 45 4C 45 43 54 20 46 4F 52 4D 41 54 20      SELECT FORMAT 
005500:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
005510:  43 74 72 6C 20 28 23 30 33 29 0D 0A 20 20 20 20    Ctrl (#03)..    
005520:  20 20 20 20 20 20 20 20 20 20 20 20 52 45 41 44                READ
005530:  20 53 45 43 54 4F 52 20 20 20 20 20 20 20 20 20     SECTOR         
005540:  20 20 20 20 20 20 20 20 20 20 43 74 72 6C 20 28              Ctrl (
005550:  23 30 34 29 0D 0A 20 20 20 20 20 20 20 20 20 20    #04)..          
005560:  20 20 20 20 20 20 57 52 49 54 45 20 53 45 43 54          WRITE SECT
005570:  4F 52 20 20 20 20 20 20 20 20 20 20 20 20 20 20    OR              
005580:  20 20 20 20 43 74 72 6C 20 28 23 30 35 29 0D 0A        Ctrl (#05)..
005590:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0055A0:  46 4F 52 4D 41 54 20 54 52 41 43 4B 20 20 20 20    FORMAT TRACK    
0055B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 74                  Ct
0055C0:  72 6C 20 28 23 30 36 29 0D 0A 20 20 20 20 20 20    rl (#06)..      
0055D0:  20 20 20 20 20 20 20 20 20 20 4D 4F 56 45 20 54              MOVE T
0055E0:  52 41 43 4B 20 20 20 20 20 20 20 20 20 20 20 20    RACK            
0055F0:  20 20 20 20 20 20 20 20 43 74 72 6C 20 28 23 30            Ctrl (#0
005600:  37 29 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    7)..            
005610:  20 20 20 20 47 45 54 20 44 52 20 53 54 41 54 55        GET DR STATU
005620:  53 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    S               
005630:  20 20 43 74 72 6C 20 28 23 30 38 29 0D 0A 20 20      Ctrl (#08)..  
005640:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 45                  SE
005650:  54 20 52 45 54 52 59 20 43 4F 55 4E 54 20 20 20    T RETRY COUNT   
005660:  20 20 20 20 20 20 20 20 20 20 20 20 43 74 72 6C                Ctrl
005670:  20 28 23 30 39 29 0D 0A 0D 0A 20 20 20 20 20 20     (#09)....      
005680:  20 54 68 65 73 65 20 72 6F 75 74 69 6E 65 73 20     These routines 
005690:  61 72 65 20 64 65 73 63 72 69 62 65 64 20 69 6E    are described in
0056A0:  20 73 65 63 74 69 6F 6E 20 31 39 2E 0D 0A 0D 0A     section 19.....
0056B0:  20 20 20 20 20 20 20 54 68 65 20 77 6F 72 64 20           The word 
0056C0:  61 74 20 23 42 45 34 30 20 63 6F 6E 74 61 69 6E    at #BE40 contain
0056D0:  73 20 74 68 65 20 61 64 64 72 65 73 73 20 6F 66    s the address of
0056E0:  20 74 68 65 20 20 64 69 73 63 20 20 70 61 72 61     the  disc  para
0056F0:  6D 65 74 65 72 20 20 68 65 61 64 65 72 0D 0A 20    meter  header.. 
005700:  20 20 20 20 20 20 76 65 63 74 6F 72 2E 20 44 69          vector. Di
005710:  73 63 20 70 61 72 61 6D 65 74 65 72 20 68 65 61    sc parameter hea
005720:  64 65 72 73 20 61 6E 64 20 65 78 74 65 6E 64 65    ders and extende
005730:  64 20 64 69 73 63 20 70 61 72 61 6D 65 74 65 72    d disc parameter
005740:  20 62 6C 6F 63 6B 73 20 20 6D 61 79 0D 0A 20 20     blocks  may..  
005750:  20 20 20 20 20 62 65 20 70 61 74 63 68 65 64 20         be patched 
005760:  61 73 20 72 65 71 75 69 72 65 64 20 28 73 65 65    as required (see
005770:  20 73 65 63 74 69 6F 6E 20 39 2E 38 29 2E 0D 0A     section 9.8)...
005780:  0D 0A 0D 0A 20 20 20 20 20 20 20 4F 6E 6C 79 20    ....       Only 
005790:  74 68 65 20 42 49 4F 53 20 66 61 63 69 6C 69 74    the BIOS facilit
0057A0:  69 65 73 20 6D 65 6E 74 69 6F 6E 65 64 20 68 65    ies mentioned he
0057B0:  72 65 20 6D 61 79 20 62 65 20 20 75 73 65 64 20    re may be  used 
0057C0:  20 66 72 6F 6D 20 20 61 20 20 70 72 6F 67 72 61     from  a  progra
0057D0:  6D 0D 0A 20 20 20 20 20 20 20 72 75 6E 6E 69 6E    m..       runnin
0057E0:  67 20 75 6E 64 65 72 20 41 4D 53 44 4F 53 2E 0D    g under AMSDOS..
0057F0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 39 2E 38 20    .....       9.8 
005800:  53 74 6F 72 65 20 72 65 71 75 69 72 65 6D 65 6E    Store requiremen
005810:  74 73 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57    ts......       W
005820:  68 65 6E 20 69 6E 69 74 69 61 6C 69 7A 65 64 20    hen initialized 
005830:  41 4D 53 44 4F 53 20 72 65 73 65 72 76 65 73 20    AMSDOS reserves 
005840:  23 35 30 30 20 62 79 74 65 73 20 6F 66 20 6D 65    #500 bytes of me
005850:  6D 6F 72 79 20 66 72 6F 6D 20 74 68 65 20 20 6D    mory from the  m
005860:  65 6D 6F 72 79 0D 0A 20 20 20 20 20 20 20 70 6F    emory..       po
005870:  6F 6C 20 61 6E 64 20 74 68 65 20 6B 65 72 6E 65    ol and the kerne
005880:  6C 20 20 72 65 73 65 72 76 65 73 20 20 61 6E 6F    l  reserves  ano
005890:  74 68 65 72 20 20 34 20 20 66 6F 72 20 20 69 74    ther  4  for  it
0058A0:  73 20 20 65 78 74 65 72 6E 61 6C 20 20 63 6F 6D    s  external  com
0058B0:  6D 61 6E 64 0D 0A 20 20 20 20 20 20 20 63 68 61    mand..       cha
0058C0:  69 6E 69 6E 67 20 69 6E 66 6F 72 6D 61 74 69 6F    ining informatio
0058D0:  6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57    n.......       W
0058E0:  68 65 6E 20 6C 6F 61 64 69 6E 67 20 61 20 6D 61    hen loading a ma
0058F0:  63 68 69 6E 65 20 63 6F 64 65 20 70 72 6F 67 72    chine code progr
005900:  61 6D 20 66 72 6F 6D 20 64 69 73 63 20 20 69 6E    am from disc  in
005910:  74 6F 20 20 73 74 6F 72 65 20 20 75 73 69 6E 67    to  store  using
005920:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 41 4D      the..       AM
005930:  53 44 4F 53 20 72 6F 75 74 69 6E 65 20 43 41 53    SDOS routine CAS
005940:  20 49 4E 20 44 49 52 45 43 54 20 69 74 20 69 73     IN DIRECT it is
005950:  20 69 6D 70 6F 72 74 61 6E 74 20 74 68 61 74 20     important that 
005960:  20 41 4D 53 44 4F 53 27 73 20 20 76 61 72 69 61     AMSDOS's  varia
005970:  62 6C 65 73 0D 0A 20 20 20 20 20 20 20 61 72 65    bles..       are
005980:  20 6E 6F 74 20 6F 76 65 72 77 72 69 74 74 65 6E     not overwritten
005990:  2E 20 54 68 69 73 20 70 72 65 73 65 6E 74 73 20    . This presents 
0059A0:  61 20 70 72 6F 62 6C 65 6D 20 73 69 6E 63 65 20    a problem since 
0059B0:  69 6E 20 20 67 65 6E 65 72 61 6C 20 20 69 74 20    in  general  it 
0059C0:  20 69 73 0D 0A 20 20 20 20 20 20 20 6E 6F 74 20     is..       not 
0059D0:  70 6F 73 73 69 62 6C 65 20 74 6F 20 64 69 73 63    possible to disc
0059E0:  6F 76 65 72 20 77 68 65 72 65 20 74 68 65 73 65    over where these
0059F0:  20 76 61 72 69 61 62 6C 65 73 20 61 72 65 21 20     variables are! 
005A00:  20 54 68 69 73 20 20 69 73 20 20 62 65 63 61 75     This  is  becau
005A10:  73 65 0D 0A 20 20 20 20 20 20 20 76 61 72 69 61    se..       varia
005A20:  62 6C 65 73 20 66 6F 72 20 65 78 70 61 6E 73 69    bles for expansi
005A30:  6F 6E 20 52 4F 4D 73 20 61 72 65 20 61 6C 6C 6F    on ROMs are allo
005A40:  63 61 74 65 64 20 64 79 6E 61 6D 69 63 61 6C 6C    cated dynamicall
005A50:  79 2E 20 4E 6F 74 65 20 74 68 61 74 20 74 68 69    y. Note that thi
005A60:  73 0D 0A 20 20 20 20 20 20 20 70 72 6F 62 6C 65    s..       proble
005A70:  6D 20 64 6F 65 73 20 6E 6F 74 20 61 72 69 73 65    m does not arise
005A80:  20 20 77 68 65 6E 20 20 6C 6F 61 64 69 6E 67 20      when  loading 
005A90:  20 66 72 6F 6D 20 20 74 68 65 20 20 63 61 73 73     from  the  cass
005AA0:  65 74 74 65 20 20 73 69 6E 63 65 20 20 74 68 65    ette  since  the
005AB0:  0D 0A 20 20 20 20 20 20 20 63 61 73 73 65 74 74    ..       cassett
005AC0:  65 20 6D 61 6E 61 67 65 72 27 73 20 76 61 72 69    e manager's vari
005AD0:  61 62 6C 65 73 20 61 72 65 20 69 6E 20 74 68 65    ables are in the
005AE0:  20 66 69 72 6D 77 61 72 65 20 76 61 72 69 61 62     firmware variab
005AF0:  6C 65 20 61 72 65 61 2E 0D 0A 0D 0A 0D 0A 20 20    le area.......  
005B00:  20 20 20 20 20 41 4D 53 44 4F 53 20 72 65 73 65         AMSDOS rese
005B10:  72 76 65 73 20 73 74 6F 72 65 20 66 72 6F 6D 20    rves store from 
005B20:  74 68 65 20 74 6F 70 20 6F 66 20 20 6D 65 6D 6F    the top of  memo
005B30:  72 79 20 20 70 6F 6F 6C 20 20 73 6F 20 20 74 68    ry  pool  so  th
005B40:  65 20 20 73 69 6D 70 6C 65 73 74 0D 0A 20 20 20    e  simplest..   
005B50:  20 20 20 20 73 6F 6C 75 74 69 6F 6E 20 69 73 20        solution is 
005B60:  74 6F 20 61 6C 77 61 79 73 20 6C 6F 61 64 20 6D    to always load m
005B70:  61 63 68 69 6E 65 20 63 6F 64 65 20 70 72 6F 67    achine code prog
005B80:  72 61 6D 73 20 69 6E 74 6F 20 20 74 68 65 20 20    rams into  the  
005B90:  62 6F 74 74 6F 6D 20 20 6F 66 0D 0A 20 20 20 20    bottom  of..    
005BA0:  20 20 20 73 74 6F 72 65 2E 20 54 68 65 20 70 72       store. The pr
005BB0:  6F 67 72 61 6D 20 63 61 6E 20 74 68 65 6E 20 72    ogram can then r
005BC0:  65 6C 6F 63 61 74 65 20 69 74 73 65 6C 66 20 74    elocate itself t
005BD0:  6F 20 20 61 20 20 68 69 67 68 65 72 20 20 61 64    o  a  higher  ad
005BE0:  64 72 65 73 73 20 20 69 66 0D 0A 20 20 20 20 20    dress  if..     
005BF0:  20 20 72 65 71 75 69 72 65 64 2E 0D 0A 0D 0A 0D      required......
005C00:  0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41    ...       AMSTRA
005C10:  44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32    D CPC464/664/612
005C20:  38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20    8 FIRMWARE      
005C30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
005C40:  20 20 20 20 20 20 20 20 70 61 67 65 20 39 2E 39            page 9.9
005C50:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
005C60:  20 20 20 20 20 41 6C 74 65 72 6E 61 74 69 76 65         Alternative
005C70:  6C 79 20 74 68 65 20 6D 61 63 68 69 6E 65 20 63    ly the machine c
005C80:  6F 64 65 20 70 72 6F 67 72 61 6D 20 63 6F 75 6C    ode program coul
005C90:  64 20 62 65 20 6C 6F 61 64 65 64 20 69 6E 20 74    d be loaded in t
005CA0:  77 6F 20 20 73 74 61 67 65 73 3A 0D 0A 20 20 20    wo  stages:..   
005CB0:  20 20 20 20 66 69 72 73 74 20 6C 6F 61 64 20 61        first load a
005CC0:  6E 64 20 72 75 6E 20 61 20 73 6D 61 6C 6C 20 6C    nd run a small l
005CD0:  6F 61 64 65 72 20 69 6E 20 74 68 65 20 62 6F 74    oader in the bot
005CE0:  74 6F 6D 20 6F 66 20 73 74 6F 72 65 2E 20 20 54    tom of store.  T
005CF0:  68 65 20 20 61 63 74 69 6F 6E 0D 0A 20 20 20 20    he  action..    
005D00:  20 20 20 6F 66 20 4D 43 20 42 4F 4F 54 20 50 52       of MC BOOT PR
005D10:  4F 47 52 41 4D 20 77 69 6C 6C 20 68 61 76 65 20    OGRAM will have 
005D20:  73 68 75 74 20 64 6F 77 6E 20 61 6C 6C 20 52 53    shut down all RS
005D30:  58 73 20 20 61 6E 64 20 20 65 78 74 65 6E 73 69    Xs  and  extensi
005D40:  6F 6E 20 20 52 4F 4D 73 2E 0D 0A 20 20 20 20 20    on  ROMs...     
005D50:  20 20 54 68 65 20 6C 6F 61 64 65 72 20 70 72 6F      The loader pro
005D60:  67 72 61 6D 20 73 68 6F 75 6C 64 20 6E 6F 77 20    gram should now 
005D70:  69 6E 69 74 69 61 6C 69 7A 65 20 41 4D 53 44 4F    initialize AMSDO
005D80:  53 20 20 75 73 69 6E 67 20 20 4B 4C 20 20 49 4E    S  using  KL  IN
005D90:  49 54 20 20 42 41 43 4B 0D 0A 20 20 20 20 20 20    IT  BACK..      
005DA0:  20 74 68 75 73 20 66 6F 72 63 69 6E 67 20 41 4D     thus forcing AM
005DB0:  53 44 4F 53 20 76 61 72 69 61 62 6C 65 73 20 74    SDOS variables t
005DC0:  6F 20 62 65 20 77 68 65 72 65 76 65 72 20 79 6F    o be wherever yo
005DD0:  75 20 73 6F 20 77 69 73 68 2E 20 20 54 68 65 20    u so wish.  The 
005DE0:  20 6C 6F 61 64 65 72 0D 0A 20 20 20 20 20 20 20     loader..       
005DF0:  63 61 6E 20 6E 6F 77 20 6C 6F 61 64 20 74 68 65    can now load the
005E00:  20 6D 61 63 68 69 6E 65 20 63 6F 64 65 20 70 72     machine code pr
005E10:  6F 67 72 61 6D 20 75 73 69 6E 67 20 74 68 65 20    ogram using the 
005E20:  41 4D 53 44 4F 53 20 72 6F 75 74 69 6E 65 73 20    AMSDOS routines 
005E30:  43 41 53 20 49 4E 0D 0A 20 20 20 20 20 20 20 4F    CAS IN..       O
005E40:  50 45 4E 2C 20 43 41 53 20 49 4E 20 44 49 52 45    PEN, CAS IN DIRE
005E50:  43 54 2C 20 61 6E 64 20 43 41 53 20 49 4E 20 43    CT, and CAS IN C
005E60:  4C 4F 53 45 20 74 6F 67 65 74 68 65 72 20 77 69    LOSE together wi
005E70:  74 68 20 4D 43 20 53 54 41 52 54 20 50 52 4F 47    th MC START PROG
005E80:  52 41 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49    RAM.....       I
005E90:  6E 20 6F 72 64 65 72 20 74 6F 20 69 6E 69 74 69    n order to initi
005EA0:  61 6C 69 7A 65 20 41 4D 53 44 4F 53 20 75 73 69    alize AMSDOS usi
005EB0:  6E 67 20 4B 4C 20 49 4E 49 54 20 42 41 43 4B 2C    ng KL INIT BACK,
005EC0:  20 41 4D 53 44 4F 53 27 73 20 52 4F 4D 20 20 6E     AMSDOS's ROM  n
005ED0:  75 6D 62 65 72 0D 0A 20 20 20 20 20 20 20 69 73    umber..       is
005EE0:  20 72 65 71 75 69 72 65 64 2E 20 54 6F 20 64 65     required. To de
005EF0:  74 65 72 6D 69 6E 65 20 41 4D 53 44 4F 53 27 73    termine AMSDOS's
005F00:  20 52 4F 4D 20 20 6E 75 6D 62 65 72 20 20 6C 6F     ROM  number  lo
005F10:  6F 6B 20 20 61 74 20 20 61 6E 79 20 20 6F 66 20    ok  at  any  of 
005F20:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 69 6E 74     the..       int
005F30:  65 72 63 65 70 74 65 64 20 20 63 61 73 73 65 74    ercepted  casset
005F40:  74 65 20 20 6A 75 6D 70 62 6C 6F 63 6B 20 20 65    te  jumpblock  e
005F50:  6E 74 72 69 65 73 20 20 77 69 74 68 20 20 74 68    ntries  with  th
005F60:  65 20 20 20 44 49 53 43 20 20 20 72 6F 75 74 69    e   DISC   routi
005F70:  6E 65 73 0D 0A 20 20 20 20 20 20 20 73 65 6C 65    nes..       sele
005F80:  63 74 65 64 2E 20 45 61 63 68 20 65 6E 74 72 79    cted. Each entry
005F90:  20 69 73 20 61 20 66 61 72 20 63 61 6C 6C 2C 20     is a far call, 
005FA0:  74 68 65 20 61 64 64 72 65 73 73 20 70 61 72 74    the address part
005FB0:  20 6F 66 20 20 77 68 69 63 68 20 20 70 6F 69 6E     of  which  poin
005FC0:  74 73 0D 0A 20 20 20 20 20 20 20 61 74 20 61 20    ts..       at a 
005FD0:  74 68 72 65 65 20 62 79 74 65 20 66 61 72 20 61    three byte far a
005FE0:  64 64 72 65 73 73 2C 20 74 68 65 20 74 68 69 72    ddress, the thir
005FF0:  64 20 70 61 72 74 20 6F 66 20 74 68 65 20 66 61    d part of the fa
006000:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
006010:  05 00 00 00 02 09 50 E5 05 00 C1 02 00 00 00 02    ......P.........
006020:  05 00 C2 02 00 00 00 02 05 00 C3 02 00 00 00 02    ................
006030:  05 00 C4 02 00 00 00 02 05 00 C5 02 00 00 00 02    ................
006040:  05 00 C6 02 00 00 00 02 05 00 C7 02 00 00 00 02    ................
006050:  05 00 C8 02 00 00 00 02 05 00 C9 02 00 00 00 02    ................
006060:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
006070:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
006080:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
006090:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0060F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
006100:  72 20 61 64 64 72 65 73 73 20 69 73 20 20 74 68    r address is  th
006110:  65 0D 0A 20 20 20 20 20 20 20 52 4F 4D 20 6E 75    e..       ROM nu
006120:  6D 62 65 72 2E 20 4F 62 76 69 6F 75 73 6C 79 20    mber. Obviously 
006130:  74 68 69 73 20 73 68 6F 75 6C 64 20 62 65 20 64    this should be d
006140:  6F 6E 65 20 62 65 66 6F 72 65 20 41 4D 53 44 4F    one before AMSDO
006150:  53 20 69 73 20 73 68 75 74 20 64 6F 6E 65 2E 0D    S is shut done..
006160:  0A 0D 0A 20 20 20 20 20 20 20 45 78 69 73 74 69    ...       Existi
006170:  6E 67 20 6D 61 63 68 69 6E 65 20 63 6F 64 65 20    ng machine code 
006180:  70 72 6F 67 72 61 6D 73 2C 20 64 65 76 65 6C 6F    programs, develo
006190:  70 65 64 20 6F 6E 20 63 61 73 73 65 74 74 65 20    ped on cassette 
0061A0:  73 79 73 74 65 6D 73 20 20 77 69 74 68 6F 75 74    systems  without
0061B0:  0D 0A 0D 0A 20 20 20 20 20 20 20 61 6E 79 20 65    ....       any e
0061C0:  78 70 61 6E 73 69 6F 6E 20 52 4F 4D 73 2C 20 66    xpansion ROMs, f
0061D0:  72 65 71 75 65 6E 74 6C 79 20 6F 6E 6C 79 20 75    requently only u
0061E0:  73 65 20 73 74 6F 72 65 20 74 6F 20 20 23 41 42    se store to  #AB
0061F0:  46 46 20 20 69 6E 20 20 6F 72 64 65 72 20 20 74    FF  in  order  t
006200:  6F 0D 0A 20 20 20 20 20 20 20 61 76 6F 69 64 20    o..       avoid 
006210:  42 41 53 49 43 73 20 76 61 72 69 61 62 6C 65 73    BASICs variables
006220:  2E 20 54 68 65 73 65 20 63 61 6E 20 65 61 73 69    . These can easi
006230:  6C 79 20 62 65 20 6D 6F 64 69 66 69 65 64 20 20    ly be modified  
006240:  74 6F 20 20 75 73 65 20 20 41 4D 53 44 4F 53 2E    to  use  AMSDOS.
006250:  0D 0A 20 20 20 20 20 20 20 57 72 69 74 65 20 73    ..       Write s
006260:  6F 6D 65 20 6D 61 63 68 69 6E 65 20 63 6F 64 65    ome machine code
006270:  20 74 6F 20 20 69 6E 69 74 69 61 6C 69 7A 65 20     to  initialize 
006280:  20 41 4D 53 44 4F 53 20 20 75 73 69 6E 67 20 20     AMSDOS  using  
006290:  4B 4C 20 20 49 4E 49 54 20 20 42 41 43 4B 2E 0D    KL  INIT  BACK..
0062A0:  0A 20 20 20 20 20 20 20 41 4D 53 44 4F 53 20 77    .       AMSDOS w
0062B0:  69 6C 6C 20 72 65 73 65 72 76 65 20 52 41 4D 20    ill reserve RAM 
0062C0:  64 6F 77 6E 20 74 6F 20 23 41 42 46 43 2C 20 61    down to #ABFC, a
0062D0:  6C 6D 6F 73 74 20 20 74 68 65 20 20 73 61 6D 65    lmost  the  same
0062E0:  20 20 61 73 20 20 75 73 65 64 20 20 62 79 0D 0A      as  used  by..
0062F0:  20 20 20 20 20 20 20 42 41 53 49 43 2E 0D 0A 0D           BASIC....
006300:  0A 20 20 20 20 20 20 20 39 2E 39 20 45 78 74 65    .       9.9 Exte
006310:  6E 64 65 64 20 44 69 73 63 20 50 61 72 61 6D 65    nded Disc Parame
006320:  74 65 72 20 42 6C 6F 63 6B 73 0D 0A 0D 0A 20 20    ter Blocks....  
006330:  20 20 20 20 20 49 6E 20 20 6F 72 64 65 72 20 20         In  order  
006340:  74 6F 20 20 66 61 63 69 6C 69 74 61 74 65 20 20    to  facilitate  
006350:  72 65 61 64 69 6E 67 20 20 61 6E 64 20 20 77 72    reading  and  wr
006360:  69 74 69 6E 67 20 20 27 66 6F 72 65 69 67 6E 27    iting  'foreign'
006370:  20 20 64 69 73 63 73 20 20 6F 66 0D 0A 20 20 20      discs  of..   
006380:  20 20 20 20 64 69 66 66 65 72 69 6E 67 20 66 6F        differing fo
006390:  72 6D 61 74 73 2C 20 61 6C 6C 20 74 68 65 20 70    rmats, all the p
0063A0:  61 72 61 6D 65 74 65 72 73 20 63 6F 6E 63 65 72    arameters concer
0063B0:  6E 69 6E 67 20 61 20 64 72 69 76 65 20 61 72 65    ning a drive are
0063C0:  20 20 6B 65 70 74 20 20 69 6E 0D 0A 20 20 20 20      kept  in..    
0063D0:  20 20 20 52 41 4D 20 69 6E 20 61 6E 20 65 78 74       RAM in an ext
0063E0:  65 6E 64 65 64 20 43 50 2F 4D 20 64 69 73 63 20    ended CP/M disc 
0063F0:  70 61 72 61 6D 65 74 65 72 20 62 6C 6F 63 6B 20    parameter block 
006400:  28 58 50 42 29 2E 20 20 54 68 65 20 20 6B 6E 6F    (XPB).  The  kno
006410:  77 6C 65 64 67 61 62 6C 65 0D 0A 20 20 20 20 20    wledgable..     
006420:  20 20 75 73 65 72 20 6D 61 79 20 70 61 74 63 68      user may patch
006430:  20 61 6E 20 58 50 42 2E 0D 0A 0D 0A 0D 0A 20 20     an XPB.......  
006440:  20 20 20 20 20 54 68 65 72 65 20 61 72 65 20 74         There are t
006450:  77 6F 20 58 50 42 73 2C 20 6F 6E 65 20 70 65 72    wo XPBs, one per
006460:  20 64 72 69 76 65 2E 0D 0A 0D 0A 0D 0A 20 20 20     drive.......   
006470:  20 20 20 20 58 50 42 20 73 74 72 75 63 74 75 72        XPB structur
006480:  65 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 62    e:......       b
006490:  79 74 65 73 20 30 2E 2E 2E 31 34 3A 20 20 20 20    ytes 0...14:    
0064A0:  20 20 20 73 74 61 6E 64 61 72 64 20 43 50 2F 4D       standard CP/M
0064B0:  20 32 2E 32 20 44 50 42 20 28 73 65 65 20 62 65     2.2 DPB (see be
0064C0:  6C 6F 77 29 2E 0D 0A 20 20 20 20 20 20 20 62 79    low)...       by
0064D0:  74 65 20 20 31 35 3A 20 20 20 20 20 20 20 20 20    te  15:         
0064E0:  20 20 66 69 72 73 74 20 73 65 63 74 6F 72 20 6E      first sector n
0064F0:  75 6D 62 65 72 2E 0D 0A 20 20 20 20 20 20 20 20    umber...        
006500:  20 20 20 20 20 31 36 3A 20 20 20 20 20 20 20 20         16:        
006510:  20 20 20 6E 75 6D 62 65 72 20 6F 66 20 73 65 63       number of sec
006520:  74 6F 72 73 20 70 65 72 20 74 72 61 63 6B 2E 0D    tors per track..
006530:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 31 37    .             17
006540:  3A 20 20 20 20 20 20 20 20 20 20 20 67 61 70 20    :           gap 
006550:  6C 65 6E 67 74 68 20 28 72 65 61 64 2F 77 72 69    length (read/wri
006560:  74 65 29 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    te)...          
006570:  20 20 20 31 38 3A 20 20 20 20 20 20 20 20 20 20       18:          
006580:  20 67 61 70 20 6C 65 6E 67 74 68 20 28 66 6F 72     gap length (for
006590:  6D 61 74 29 2E 0D 0A 20 20 20 20 20 20 20 20 20    mat)...         
0065A0:  20 20 20 20 31 39 3A 20 20 20 20 20 20 20 20 20        19:         
0065B0:  20 20 66 69 6C 6C 65 72 20 62 79 74 65 20 66 6F      filler byte fo
0065C0:  72 20 66 6F 72 6D 61 74 74 69 6E 67 2E 0D 0A 20    r formatting... 
0065D0:  20 20 20 20 20 20 20 20 20 20 20 20 32 30 3A 20                20: 
0065E0:  20 20 20 20 20 20 20 20 20 20 6C 6F 67 28 32 29              log(2)
0065F0:  28 73 65 63 74 6F 72 20 73 69 7A 65 29 2D 37 2C    (sector size)-7,
006600:  27 4E 27 20 66 6F 72 20 75 50 44 37 36 35 41 2E    'N' for uPD765A.
006610:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 32    ..             2
006620:  31 3A 20 20 20 20 20 20 20 20 20 20 20 73 65 63    1:           sec
006630:  74 6F 72 20 73 69 7A 65 2F 31 32 38 0D 0A 20 20    tor size/128..  
006640:  20 20 20 20 20 20 20 20 20 20 20 32 32 3A 20 20               22:  
006650:  20 20 20 20 20 20 20 20 20 72 65 73 65 72 76 65             reserve
006660:  64 3A 20 63 75 72 72 65 6E 74 20 74 72 61 63 6B    d: current track
006670:  20 28 73 65 74 20 62 79 20 42 49 4F 53 29 2E 0D     (set by BIOS)..
006680:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 32 33    .             23
006690:  3A 20 20 20 20 20 20 20 20 20 20 20 72 65 73 65    :           rese
0066A0:  72 76 65 64 3A 20 23 30 30 2D 2D 3E 6E 6F 74 20    rved: #00-->not 
0066B0:  61 6C 69 67 6E 65 64 2C 20 23 46 46 2D 2D 3E 61    aligned, #FF-->a
0066C0:  6C 69 67 6E 65 64 20 28 73 65 74 20 62 79 0D 0A    ligned (set by..
0066D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0066E0:  20 20 20 20 20 20 20 20 20 20 20 42 49 4F 53 29               BIOS)
0066F0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 32    ..             2
006700:  34 3A 20 20 20 20 20 20 20 20 20 20 20 23 30 30    4:           #00
006710:  2D 2D 3E 61 75 74 6F 2D 73 65 6C 65 63 74 20 66    -->auto-select f
006720:  6F 72 6D 61 74 2C 20 23 46 46 2D 2D 3E 64 6F 6E    ormat, #FF-->don
006730:  27 74 20 20 61 75 74 6F 2D 73 65 6C 65 63 74 0D    't  auto-select.
006740:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
006750:  20 20 20 20 20 20 20 20 20 20 20 20 66 6F 72 6D                form
006760:  61 74 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    at.......       
006770:  54 68 65 20 58 50 42 20 66 6F 72 20 61 20 64 72    The XPB for a dr
006780:  69 76 65 20 6D 61 79 20 62 65 20 20 66 6F 75 6E    ive may be  foun
006790:  64 20 20 62 79 20 20 61 63 63 65 73 73 69 6E 67    d  by  accessing
0067A0:  20 20 74 68 65 20 20 44 69 73 63 20 20 50 61 72      the  Disc  Par
0067B0:  61 6D 65 74 65 72 0D 0A 20 20 20 20 20 20 20 48    ameter..       H
0067C0:  65 61 64 65 72 20 28 44 50 48 29 20 76 65 63 74    eader (DPH) vect
0067D0:  6F 72 2E 20 54 68 65 20 66 69 72 73 74 20 77 6F    or. The first wo
0067E0:  72 64 20 6F 66 20 74 68 65 20 44 50 48 20 69 73    rd of the DPH is
0067F0:  20 74 68 65 20 61 64 64 72 65 73 73 20 20 6F 66     the address  of
006800:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 58 50      the..       XP
006810:  42 20 66 6F 72 20 64 72 69 76 65 20 41 2C 20 74    B for drive A, t
006820:  68 65 20 73 65 63 6F 6E 64 20 77 6F 72 64 20 69    he second word i
006830:  73 20 74 68 65 20 61 64 64 72 65 73 73 20 6F 66    s the address of
006840:  20 74 68 65 20 58 50 42 20 20 66 6F 72 20 20 64     the XPB  for  d
006850:  72 69 76 65 0D 0A 20 20 20 20 20 20 20 42 2E 20    rive..       B. 
006860:  54 68 65 20 61 64 64 72 65 73 73 20 6F 66 20 74    The address of t
006870:  68 65 20 44 50 48 20 69 73 20 73 74 6F 72 65 64    he DPH is stored
006880:  20 61 74 20 6C 6F 63 61 74 69 6F 6E 20 23 42 45     at location #BE
006890:  34 30 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    40.........     
0068A0:  20 20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34      AMSTRAD CPC464
0068B0:  2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41    /664/6128 FIRMWA
0068C0:  52 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20    RE              
0068D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70                   p
0068E0:  61 67 65 20 39 2E 31 30 0D 0A 0D 0A 0D 0A 0D 0A    age 9.10........
0068F0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
006900:  20 76 61 6C 75 65 73 20 73 74 6F 72 65 64 20 69     values stored i
006910:  6E 20 74 68 65 20 73 74 61 6E 64 61 72 64 20 43    n the standard C
006920:  50 2F 4D 20 32 2E 32 20 44 50 42 20 28 44 69 73    P/M 2.2 DPB (Dis
006930:  63 20 50 61 72 61 6D 65 74 65 72 20 20 42 6C 6F    c Parameter  Blo
006940:  63 6B 29 0D 0A 20 20 20 20 20 20 20 61 72 65 20    ck)..       are 
006950:  6F 66 74 65 6E 20 64 65 72 69 76 65 64 20 66 72    often derived fr
006960:  6F 6D 20 74 68 65 20 64 61 74 61 20 62 6C 6F 63    om the data bloc
006970:  6B 20 61 6C 6C 6F 63 61 74 69 6F 6E 20 73 69 7A    k allocation siz
006980:  65 2C 20 42 4C 53 2C 20 20 77 68 69 63 68 20 20    e, BLS,  which  
006990:  69 73 0D 0A 20 20 20 20 20 20 20 74 68 65 20 6E    is..       the n
0069A0:  75 6D 62 65 72 20 6F 66 20 62 79 74 65 73 20 69    umber of bytes i
0069B0:  6E 20 61 20 62 6C 6F 63 6B 20 61 6E 64 20 77 68    n a block and wh
0069C0:  69 63 68 20 6D 61 79 20 62 65 20 31 30 32 34 2C    ich may be 1024,
0069D0:  20 32 30 34 38 2C 20 34 30 39 36 2C 20 38 31 39     2048, 4096, 819
0069E0:  32 0D 0A 20 20 20 20 20 20 20 6F 72 20 31 36 33    2..       or 163
0069F0:  38 34 2E 20 54 68 65 20 76 61 6C 75 65 20 6F 66    84. The value of
006A00:  20 42 4C 53 20 69 73 20 6E 6F 74 20 73 74 6F 72     BLS is not stor
006A10:  65 64 20 69 6E 20 74 68 65 20 20 44 50 42 20 20    ed in the  DPB  
006A20:  62 75 74 20 20 69 74 20 20 6D 61 79 20 20 62 65    but  it  may  be
006A30:  0D 0A 20 20 20 20 20 20 20 64 65 64 75 63 65 64    ..       deduced
006A40:  20 66 72 6F 6D 20 74 68 65 20 20 76 61 6C 75 65     from the  value
006A50:  73 20 20 73 74 6F 72 65 64 20 20 74 68 65 72 65    s  stored  there
006A60:  2E 20 20 43 50 2F 4D 20 20 70 6C 75 73 20 20 68    .  CP/M  plus  h
006A70:  61 73 20 20 61 20 20 73 6C 69 67 68 74 6C 79 0D    as  a  slightly.
006A80:  0A 20 20 20 20 20 20 20 64 69 66 66 65 72 65 6E    .       differen
006A90:  74 20 44 50 42 2E 20 54 68 65 20 43 50 2F 4D 20    t DPB. The CP/M 
006AA0:  32 2E 32 20 44 50 42 20 69 73 20 6C 61 69 64 20    2.2 DPB is laid 
006AB0:  6F 75 74 20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D    out as follows:.
006AC0:  0A 0D 0A 20 20 20 20 20 20 20 62 79 74 65 73 20    ...       bytes 
006AD0:  20 20 20 30 2E 2E 31 20 20 28 53 50 54 29 3A 20       0..1  (SPT): 
006AE0:  20 54 6F 74 61 6C 20 6E 75 6D 62 65 72 20 6F 66     Total number of
006AF0:  20 31 32 38 20 62 79 74 65 20 72 65 63 6F 72 64     128 byte record
006B00:  73 20 6F 6E 20 65 61 63 68 20 74 72 61 63 6B 2E    s on each track.
006B10:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
006B20:  20 20 20 20 20 32 20 20 28 42 53 48 29 3A 20 20         2  (BSH):  
006B30:  6C 6F 67 28 32 29 42 4C 53 2D 37 2E 0D 0A 20 20    log(2)BLS-7...  
006B40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006B50:  20 33 20 20 28 42 4C 4D 29 3A 20 20 42 4C 53 2F     3  (BLM):  BLS/
006B60:  31 32 38 2D 31 2E 0D 0A 20 20 20 20 20 20 20 20    128-1...        
006B70:  20 20 20 20 20 20 20 20 20 20 20 34 20 20 28 45               4  (E
006B80:  58 4D 29 3A 20 20 49 66 20 44 53 4D 3C 32 35 36    XM):  If DSM<256
006B90:  20 74 68 65 6E 20 42 4C 53 2F 31 30 32 34 2D 31     then BLS/1024-1
006BA0:  20 65 6C 73 65 20 42 4C 53 2F 32 30 34 38 2D 31     else BLS/2048-1
006BB0:  2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
006BC0:  20 20 20 35 2E 2E 36 20 20 28 44 53 4D 29 3A 20       5..6  (DSM): 
006BD0:  20 54 6F 74 61 6C 20 73 69 7A 65 20 6F 66 20 64     Total size of d
006BE0:  69 73 63 20 62 6C 6F 63 6B 73 20 65 78 63 6C 75    isc blocks exclu
006BF0:  64 69 6E 67 20 61 6E 79 0D 0A 20 20 20 20 20 20    ding any..      
006C00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006C10:  20 20 20 20 20 20 20 20 72 65 73 65 72 76 65 64            reserved
006C20:  20 74 72 61 63 6B 73 2E 0D 0A 20 20 20 20 20 20     tracks...      
006C30:  20 20 20 20 20 20 20 20 20 20 37 2E 2E 38 20 20              7..8  
006C40:  28 44 52 4D 29 3A 20 20 54 6F 74 61 6C 20 6E 75    (DRM):  Total nu
006C50:  6D 62 65 72 20 6F 66 20 64 69 72 65 63 74 6F 72    mber of director
006C60:  79 20 65 6E 74 72 69 65 73 20 2D 31 2E 0D 0A 20    y entries -1... 
006C70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 39 2E                  9.
006C80:  2E 31 30 20 28 41 4C 30 2F 31 29 3A 20 42 69 74    .10 (AL0/1): Bit
006C90:  20 73 69 67 6E 69 66 69 63 61 6E 74 20 72 65 70     significant rep
006CA0:  72 65 73 65 6E 74 61 74 69 6F 6E 20 6F 66 20 6E    resentation of n
006CB0:  75 6D 62 65 72 20 6F 66 0D 0A 20 20 20 20 20 20    umber of..      
006CC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006CD0:  20 20 20 20 20 20 20 20 64 69 72 65 63 74 6F 72            director
006CE0:  79 20 62 6C 6F 63 6B 73 20 28 23 30 30 38 30 2D    y blocks (#0080-
006CF0:  2D 3E 31 2C 20 23 30 30 43 30 2D 2D 3E 32 20 65    ->1, #00C0-->2 e
006D00:  74 63 29 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    tc)...          
006D10:  20 20 20 20 31 31 2E 2E 31 32 20 20 28 43 4B 53        11..12  (CKS
006D20:  29 3A 20 20 4C 65 6E 67 74 68 20 6F 66 20 63 68    ):  Length of ch
006D30:  65 63 6B 73 75 6D 20 76 65 63 74 6F 72 2E 20 4E    ecksum vector. N
006D40:  6F 72 6D 61 6C 6C 79 20 44 52 4D 2F 34 2B 31 20    ormally DRM/4+1 
006D50:  62 75 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20    but..           
006D60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006D70:  20 20 20 69 66 20 63 68 65 63 6B 73 75 6D 6D 69       if checksummi
006D80:  6E 67 20 69 73 20 6E 6F 74 20 72 65 71 75 69 72    ng is not requir
006D90:  65 64 20 74 68 65 6E 20 30 2E 0D 0A 20 20 20 20    ed then 0...    
006DA0:  20 20 20 20 20 20 20 20 20 20 31 33 2E 2E 31 34              13..14
006DB0:  20 20 28 4F 46 46 29 3A 20 20 4E 75 6D 62 65 72      (OFF):  Number
006DC0:  20 6F 66 20 72 65 73 65 72 76 65 64 20 74 72 61     of reserved tra
006DD0:  63 6B 73 2E 20 54 68 69 73 20 69 73 20 61 6C 73    cks. This is als
006DE0:  6F 20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20    o the..         
006DF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
006E00:  20 20 20 20 20 74 72 61 63 6B 20 6F 6E 20 77 68         track on wh
006E10:  69 63 68 20 74 68 65 20 64 69 72 65 63 74 6F 72    ich the director
006E20:  79 20 73 74 61 72 74 73 2E 0D 0A 0D 0A 20 20 20    y starts.....   
006E30:  20 20 20 20 54 68 65 20 58 50 42 73 20 66 6F 72        The XPBs for
006E40:  20 74 68 65 20 64 69 66 66 65 72 65 6E 74 20 66     the different f
006E50:  6F 72 6D 61 74 73 20 61 72 65 20 69 6E 69 74 69    ormats are initi
006E60:  61 6C 69 7A 65 64 20 61 73 20 66 6F 6C 6C 6F 77    alized as follow
006E70:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 53 79 73    s:....       Sys
006E80:  74 65 6D 20 66 6F 72 6D 61 74 0D 0A 0D 0A 20 20    tem format....  
006E90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 33 36                  36
006EA0:  20 20 20 20 20 20 20 20 72 65 63 6F 72 64 73 20            records 
006EB0:  70 65 72 20 74 72 61 63 6B 0D 0A 20 20 20 20 20    per track..     
006EC0:  20 20 20 20 20 20 20 20 20 20 20 33 20 20 20 20               3    
006ED0:  20 20 20 20 20 62 6C 6F 63 6B 20 73 68 69 66 74         block shift
006EE0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
006EF0:  20 20 37 20 20 20 20 20 20 20 20 20 62 6C 6F 63      7         bloc
006F00:  6B 20 6D 61 73 6B 0D 0A 20 20 20 20 20 20 20 20    k mask..        
006F10:  20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 20            0       
006F20:  20 20 65 78 74 65 6E 74 20 6D 61 73 6B 0D 0A 20      extent mask.. 
006F30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 31                   1
006F40:  37 30 20 20 20 20 20 20 20 6E 75 6D 62 65 72 20    70       number 
006F50:  6F 66 20 62 6C 6F 63 6B 73 2D 31 0D 0A 20 20 20    of blocks-1..   
006F60:  20 20 20 20 20 20 20 20 20 20 20 20 20 36 33 20                 63 
006F70:  20 20 20 20 20 20 20 6E 75 6D 62 65 72 20 6F 66           number of
006F80:  20 64 69 72 65 63 74 6F 72 79 20 65 6E 74 72 69     directory entri
006F90:  65 73 2D 31 0D 0A 20 20 20 20 20 20 20 20 20 20    es-1..          
006FA0:  20 20 20 20 20 20 23 30 30 43 30 20 20 20 20 20          #00C0     
006FB0:  32 20 64 69 72 65 63 74 6F 72 79 20 62 6C 6F 63    2 directory bloc
006FC0:  6B 73 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ks..            
006FD0:  20 20 20 20 31 36 20 20 20 20 20 20 20 20 73 69        16        si
006FE0:  7A 65 20 6F 66 20 63 68 65 63 6B 73 75 6D 20 76    ze of checksum v
006FF0:  65 63 74 6F 72 0D 0A 20 20 20 20 20 20 20 20 20    ector..         
007000:  20 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20           2        
007010:  20 72 65 73 65 72 76 65 64 20 74 72 61 63 6B 73     reserved tracks
007020:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
007030:  20 20 23 34 31 20 20 20 20 20 20 20 66 69 72 73      #41       firs
007040:  74 20 73 65 63 74 6F 72 20 6E 75 6D 62 65 72 0D    t sector number.
007050:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
007060:  20 39 20 20 20 20 20 20 20 20 20 73 65 63 74 6F     9         secto
007070:  72 73 20 70 65 72 20 74 72 61 63 6B 0D 0A 20 20    rs per track..  
007080:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 34 32                  42
007090:  20 20 20 20 20 20 20 20 67 61 70 20 6C 65 6E 67            gap leng
0070A0:  74 68 20 28 72 65 61 64 2F 77 72 69 74 65 29 0D    th (read/write).
0070B0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
0070C0:  20 38 32 20 20 20 20 20 20 20 20 67 61 70 20 6C     82        gap l
0070D0:  65 6E 67 74 68 20 28 66 6F 72 6D 61 74 29 0D 0A    ength (format)..
0070E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0070F0:  23 45 35 20 20 20 20 20 20 20 66 69 6C 6C 65 72    #E5       filler
007100:  20 62 79 74 65 0D 0A 20 20 20 20 20 20 20 20 20     byte..         
007110:  20 20 20 20 20 20 20 32 20 20 20 20 20 20 20 20           2        
007120:  20 6C 6F 67 28 32 29 28 73 65 63 74 6F 72 20 73     log(2)(sector s
007130:  69 7A 65 29 2D 37 0D 0A 20 20 20 20 20 20 20 20    ize)-7..        
007140:  20 20 20 20 20 20 20 20 34 20 20 20 20 20 20 20            4       
007150:  20 20 72 65 63 6F 72 64 73 20 70 65 72 20 74 72      records per tr
007160:  61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ack..           
007170:  20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 63         0         c
007180:  75 72 72 65 6E 74 20 74 72 61 63 6B 0D 0A 20 20    urrent track..  
007190:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20                  0 
0071A0:  20 20 20 20 20 20 20 20 6E 6F 74 20 61 6C 69 67            not alig
0071B0:  6E 65 64 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ned..           
0071C0:  20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 64         0         d
0071D0:  6F 20 61 75 74 6F 20 73 65 6C 65 63 74 20 66 6F    o auto select fo
0071E0:  72 6D 61 74 0D 0A 0D 0A 20 20 20 20 20 20 20 44    rmat....       D
0071F0:  61 74 61 20 6F 6E 6C 79 20 66 6F 72 6D 61 74 0D    ata only format.
007200:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
007210:  20 20 20 33 36 20 20 20 20 20 20 20 20 72 65 63       36        rec
007220:  6F 72 64 73 20 70 65 72 20 74 72 61 63 6B 0D 0A    ords per track..
007230:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
007240:  33 20 20 20 20 20 20 20 20 20 62 6C 6F 63 6B 20    3         block 
007250:  73 68 69 66 74 0D 0A 20 20 20 20 20 20 20 20 20    shift..         
007260:  20 20 20 20 20 20 20 37 20 20 20 20 20 20 20 20           7        
007270:  20 62 6C 6F 63 6B 20 6D 61 73 6B 0D 0A 20 20 20     block mask..   
007280:  20 20 20 20 20 20 20 20 20 20 20 20 20 30 20 20                 0  
007290:  20 20 20 20 20 20 20 65 78 74 65 6E 74 20 6D 61           extent ma
0072A0:  73 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    sk..            
0072B0:  20 20 20 20 31 37 39 20 20 20 20 20 20 20 6E 75        179       nu
0072C0:  6D 62 65 72 20 6F 66 20 62 6C 6F 63 6B 73 2D 31    mber of blocks-1
0072D0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0072E0:  20 20 36 33 20 20 20 20 20 20 20 20 6E 75 6D 62      63        numb
0072F0:  65 72 20 6F 66 20 64 69 72 65 63 74 6F 72 79 20    er of directory 
007300:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
007310:  06 00 00 00 02 09 50 E5 06 00 C1 02 00 00 00 02    ......P.........
007320:  06 00 C2 02 00 00 00 02 06 00 C3 02 00 00 00 02    ................
007330:  06 00 C4 02 00 00 00 02 06 00 C5 02 00 00 00 02    ................
007340:  06 00 C6 02 00 00 00 02 06 00 C7 02 00 00 00 02    ................
007350:  06 00 C8 02 00 00 00 02 06 00 C9 02 00 00 00 02    ................
007360:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
007370:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
007380:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
007390:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0073F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
007400:  65 6E 74 72 69 65 73 2D 31 0D 0A 20 20 20 20 20    entries-1..     
007410:  20 20 20 20 20 20 20 20 20 20 20 23 30 30 43 30               #00C0
007420:  20 20 20 20 20 32 20 64 69 72 65 63 74 6F 72 79         2 directory
007430:  20 62 6C 6F 63 6B 73 0D 0A 20 20 20 20 20 20 20     blocks..       
007440:  20 20 20 20 20 20 20 20 20 31 36 20 20 20 20 20             16     
007450:  20 20 20 73 69 7A 65 20 6F 66 20 63 68 65 63 6B       size of check
007460:  73 75 6D 20 76 65 63 74 6F 72 0D 0A 20 20 20 20    sum vector..    
007470:  20 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20                0   
007480:  20 20 20 20 20 20 72 65 73 65 72 76 65 64 20 74          reserved t
007490:  72 61 63 6B 73 0D 0A 20 20 20 20 20 20 20 20 20    racks..         
0074A0:  20 20 20 20 20 20 20 23 43 31 20 20 20 20 20 20           #C1      
0074B0:  20 66 69 72 73 74 20 73 65 63 74 6F 72 20 6E 75     first sector nu
0074C0:  6D 62 65 72 0D 0A 20 20 20 20 20 20 20 20 20 20    mber..          
0074D0:  20 20 20 20 20 20 39 20 20 20 20 20 20 20 20 20          9         
0074E0:  73 65 63 74 6F 72 73 20 70 65 72 20 74 72 61 63    sectors per trac
0074F0:  6B 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54    k....       AMST
007500:  52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36    RAD CPC464/664/6
007510:  31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20    128 FIRMWARE    
007520:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
007530:  70 61 67 65 20 39 2E 31 32 20 28 70 61 72 74 20    page 9.12 (part 
007540:  31 29 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    1)..............
007550:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
007560:  34 32 20 20 20 20 20 20 20 20 67 61 70 20 6C 65    42        gap le
007570:  6E 67 74 68 20 28 72 65 61 64 2F 77 72 69 74 65    ngth (read/write
007580:  29 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    )..             
007590:  20 20 20 38 32 20 20 20 20 20 20 20 20 67 61 70       82        gap
0075A0:  20 6C 65 6E 67 74 68 20 28 66 6F 72 6D 61 74 29     length (format)
0075B0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0075C0:  20 20 23 45 35 20 20 20 20 20 20 20 66 69 6C 6C      #E5       fill
0075D0:  65 72 20 62 79 74 65 0D 0A 20 20 20 20 20 20 20    er byte..       
0075E0:  20 20 20 20 20 20 20 20 20 32 20 20 20 20 20 20             2      
0075F0:  20 20 20 6C 6F 67 28 32 29 28 73 65 63 74 6F 72       log(2)(sector
007600:  20 73 69 7A 65 29 2D 37 0D 0A 20 20 20 20 20 20     size)-7..      
007610:  20 20 20 20 20 20 20 20 20 20 34 20 20 20 20 20              4     
007620:  20 20 20 20 72 65 63 6F 72 64 73 20 70 65 72 20        records per 
007630:  74 72 61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20    track..         
007640:  20 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20           0        
007650:  20 63 75 72 72 65 6E 74 20 74 72 61 63 6B 0D 0A     current track..
007660:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
007670:  30 20 20 20 20 20 20 20 20 20 6E 6F 74 20 61 6C    0         not al
007680:  69 67 6E 65 64 0D 0A 20 20 20 20 20 20 20 20 20    igned..         
007690:  20 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20           0        
0076A0:  20 64 6F 20 61 75 74 6F 2D 73 65 6C 65 63 74 20     do auto-select 
0076B0:  66 6F 72 6D 61 74 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    format..........
0076C0:  20 20 20 20 20 20 20 49 42 4D 20 46 6F 72 6D 61           IBM Forma
0076D0:  74 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    t....           
0076E0:  20 20 20 20 20 33 32 20 20 20 20 20 20 20 20 72         32        r
0076F0:  65 63 6F 72 64 73 20 70 65 72 20 74 72 61 63 6B    ecords per track
007700:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
007710:  20 20 33 20 20 20 20 20 20 20 20 20 62 6C 6F 63      3         bloc
007720:  6B 20 73 68 69 66 74 0D 0A 20 20 20 20 20 20 20    k shift..       
007730:  20 20 20 20 20 20 20 20 20 37 20 20 20 20 20 20             7      
007740:  20 20 20 62 6C 6F 63 6B 20 6D 61 73 6B 0D 0A 20       block mask.. 
007750:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30                   0
007760:  20 20 20 20 20 20 20 20 20 65 78 74 65 6E 74 20             extent 
007770:  6D 61 73 6B 0D 0A 20 20 20 20 20 20 20 20 20 20    mask..          
007780:  20 20 20 20 20 20 31 35 35 20 20 20 20 20 20 20          155       
007790:  6E 75 6D 62 65 72 20 6F 66 20 62 6C 6F 63 6B 73    number of blocks
0077A0:  2D 31 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    -1..            
0077B0:  20 20 20 20 36 33 20 20 20 20 20 20 20 20 6E 75        63        nu
0077C0:  6D 62 65 72 20 6F 66 20 64 69 72 65 63 74 6F 72    mber of director
0077D0:  79 20 65 6E 74 72 69 65 73 2D 31 0D 0A 20 20 20    y entries-1..   
0077E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 23 30 30                 #00
0077F0:  43 30 20 20 20 20 20 32 20 64 69 72 65 63 74 6F    C0     2 directo
007800:  72 79 20 62 6C 6F 63 6B 73 0D 0A 20 20 20 20 20    ry blocks..     
007810:  20 20 20 20 20 20 20 20 20 20 20 31 36 20 20 20               16   
007820:  20 20 20 20 20 73 69 7A 65 20 6F 66 20 63 68 65         size of che
007830:  63 6B 73 75 6D 20 76 65 63 74 6F 72 0D 0A 20 20    cksum vector..  
007840:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 31 20                  1 
007850:  20 20 20 20 20 20 20 20 72 65 73 65 72 76 65 64            reserved
007860:  20 74 72 61 63 6B 73 0D 0A 20 20 20 20 20 20 20     tracks..       
007870:  20 20 20 20 20 20 20 20 20 23 30 31 20 20 20 20             #01    
007880:  20 20 20 66 69 72 73 74 20 73 65 63 74 6F 72 20       first sector 
007890:  6E 75 6D 62 65 72 0D 0A 20 20 20 20 20 20 20 20    number..        
0078A0:  20 20 20 20 20 20 20 20 38 20 20 20 20 20 20 20            8       
0078B0:  20 20 73 65 63 74 6F 72 73 20 70 65 72 20 74 72      sectors per tr
0078C0:  61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ack..           
0078D0:  20 20 20 20 20 34 32 20 20 20 20 20 20 20 20 67         42        g
0078E0:  61 70 20 6C 65 6E 67 74 68 20 28 72 65 61 64 2F    ap length (read/
0078F0:  77 72 69 74 65 29 0D 0A 20 20 20 20 20 20 20 20    write)..        
007900:  20 20 20 20 20 20 20 20 38 30 20 20 20 20 20 20            80      
007910:  20 20 67 61 70 20 6C 65 6E 67 74 68 20 28 66 6F      gap length (fo
007920:  72 6D 61 74 29 0D 0A 20 20 20 20 20 20 20 20 20    rmat)..         
007930:  20 20 20 20 20 20 20 23 45 35 20 20 20 20 20 20           #E5      
007940:  20 66 69 6C 6C 65 72 20 62 79 74 65 0D 0A 20 20     filler byte..  
007950:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 32 20                  2 
007960:  20 20 20 20 20 20 20 20 6C 6F 67 28 32 29 28 73            log(2)(s
007970:  65 63 74 6F 72 20 73 69 7A 65 29 2D 37 0D 0A 20    ector size)-7.. 
007980:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 34                   4
007990:  20 20 20 20 20 20 20 20 20 72 65 63 6F 72 64 73             records
0079A0:  20 70 65 72 20 74 72 61 63 6B 0D 0A 20 20 20 20     per track..    
0079B0:  20 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20                0   
0079C0:  20 20 20 20 20 20 63 75 72 72 65 6E 74 20 74 72          current tr
0079D0:  61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ack..           
0079E0:  20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 6E         0         n
0079F0:  6F 74 20 61 6C 69 67 6E 65 64 0D 0A 20 20 20 20    ot aligned..    
007A00:  20 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20                0   
007A10:  20 20 20 20 20 20 64 6F 20 61 75 74 6F 20 73 65          do auto se
007A20:  6C 65 63 74 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    lect............
007A30:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
007A40:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
007A50:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
007A60:  20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F     AMSTRAD CPC464/
007A70:  36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52    664/6128 FIRMWAR
007A80:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
007A90:  20 20 20 20 20 70 61 67 65 20 39 2E 31 32 20 28         page 9.12 (
007AA0:  70 61 72 74 20 32 29 0D 0A 1A 4F 53 20 69 73 20    part 2)...OS is 
007AB0:  61 20 64 69 73 63 20 6F 70 65 72 61 74 69 6E 67    a disc operating
007AC0:  20 73 79 73 74 65 6D 20 75 73 65 64 20 20 77 69     system used  wi
007AD0:  74 68 20 20 61 6C 6C 20 20 74 68 65 20 20 43 50    th  all  the  CP
007AE0:  43 20 20 72 61 6E 67 65 20 20 6F 66 0D 0A 20 20    C  range  of..  
007AF0:  20 20 20 20 20 63 6F 6D 70 75 74 65 72 2C 20 6F         computer, o
007B00:  20 20 20 20 20 20 20 20 38 30 20 20 20 20 20 20            80      
007B10:  20 20 67 61 70 20 6C 65 6E 67 74 68 20 28 66 6F      gap length (fo
007B20:  72 6D 61 74 29 0D 0A 20 20 20 20 20 20 20 20 20    rmat)..         
007B30:  20 20 20 20 20 20 20 23 45 35 20 20 20 20 20 20           #E5      
007B40:  20 66 69 6C 6C 65 72 20 62 79 74 65 0D 0A 20 20     filler byte..  
007B50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 32 20                  2 
007B60:  20 20 20 20 20 20 20 20 6C 6F 67 28 32 29 28 73            log(2)(s
007B70:  65 63 74 6F 72 20 73 69 7A 65 29 2D 37 0D 0A 20    ector size)-7.. 
007B80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 34                   4
007B90:  20 20 20 20 20 20 20 20 20 72 65 63 6F 72 64 73             records
007BA0:  20 70 65 72 20 74 72 61 63 6B 0D 0A 20 20 20 20     per track..    
007BB0:  20 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20                0   
007BC0:  20 20 20 20 20 20 63 75 72 72 65 6E 74 20 74 72          current tr
007BD0:  61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ack..           
007BE0:  20 20 20 20 20 30 20 20 20 20 20 20 20 20 20 6E         0         n
007BF0:  6F 74 20 61 6C 69 67 6E 65 64 0D 0A 20 20 20 20    ot aligned..    
007C00:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
007C10:  30 20 45 78 70 61 6E 73 69 6F 6E 20 52 4F 4D 73    0 Expansion ROMs
007C20:  2C 20 52 65 73 69 64 65 6E 74 20 53 79 73 74 65    , Resident Syste
007C30:  6D 20 45 78 74 65 6E 73 69 6F 6E 73 20 61 6E 64    m Extensions and
007C40:  20 52 41 4D 20 50 72 6F 67 72 61 6D 73 2E 0D 0A     RAM Programs...
007C50:  0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 73    ....       The s
007C60:  79 73 74 65 6D 20 63 61 6E 20 61 64 64 72 65 73    ystem can addres
007C70:  73 20 75 70 20 74 6F 20 32 35 32 20 65 78 70 61    s up to 252 expa
007C80:  6E 73 69 6F 6E 20 52 4F 4D 73 2C 20 6D 61 70 70    nsion ROMs, mapp
007C90:  65 64 20 6F 76 65 72 20 20 74 68 65 20 20 74 6F    ed over  the  to
007CA0:  70 0D 0A 20 20 20 20 20 20 20 31 36 4B 20 6F 66    p..       16K of
007CB0:  20 6D 65 6D 6F 72 79 2C 20 73 74 61 72 74 69 6E     memory, startin
007CC0:  67 20 61 74 20 23 43 30 30 30 2E 20 54 68 65 20    g at #C000. The 
007CD0:  4B 65 72 6E 65 6C 20 73 75 70 70 6F 72 74 73 20    Kernel supports 
007CE0:  74 77 6F 20 76 61 72 69 65 74 69 65 73 20 6F 66    two varieties of
007CF0:  0D 0A 20 20 20 20 20 20 20 65 78 70 61 6E 73 69    ..       expansi
007D00:  6F 6E 20 52 4F 4D 2C 20 66 6F 72 65 67 72 6F 75    on ROM, foregrou
007D10:  6E 64 20 61 6E 64 20 62 61 63 6B 67 72 6F 75 6E    nd and backgroun
007D20:  64 2E 20 41 20 72 65 73 69 64 65 6E 74 20 73 79    d. A resident sy
007D30:  73 74 65 6D 20 20 65 78 74 65 6E 73 69 6F 6E 0D    stem  extension.
007D40:  0A 20 20 20 20 20 20 20 28 52 53 58 29 20 69 73    .       (RSX) is
007D50:  20 73 69 6D 69 6C 61 72 20 69 6E 20 75 73 65 20     similar in use 
007D60:  74 6F 20 61 20 62 61 63 6B 67 72 6F 75 6E 64 20    to a background 
007D70:  52 4F 4D 2C 20 62 75 74 20 6D 75 73 74 20 62 65    ROM, but must be
007D80:  20 20 6C 6F 61 64 65 64 20 20 69 6E 74 6F 0D 0A      loaded  into..
007D90:  20 20 20 20 20 20 20 52 41 4D 20 62 65 66 6F 72           RAM befor
007DA0:  65 20 69 74 20 63 61 6E 20 62 65 20 75 73 65 64    e it can be used
007DB0:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20    .......       A 
007DC0:  66 6F 72 65 67 72 6F 75 6E 64 20 52 4F 4D 20 63    foreground ROM c
007DD0:  6F 6E 74 61 69 6E 73 20 6F 6E 65 20 6F 72 20 6D    ontains one or m
007DE0:  6F 72 65 20 70 72 6F 67 72 61 6D 73 2C 20 6F 6E    ore programs, on
007DF0:  6C 79 20 6F 6E 65 20 6F 66 20 77 68 69 63 68 20    ly one of which 
007E00:  20 6D 61 79 0D 0A 20 20 20 20 20 20 20 62 65 20     may..       be 
007E10:  72 75 6E 6E 69 6E 67 20 61 74 20 6F 6E 65 20 74    running at one t
007E20:  69 6D 65 2E 20 54 68 65 20 6F 6E 2D 62 6F 61 72    ime. The on-boar
007E30:  64 20 42 41 53 49 43 20 69 73 20 74 68 65 20 20    d BASIC is the  
007E40:  64 65 66 61 75 6C 74 20 20 66 6F 72 65 67 72 6F    default  foregro
007E50:  75 6E 64 0D 0A 20 20 20 20 20 20 20 70 72 6F 67    und..       prog
007E60:  72 61 6D 2E 20 4F 74 68 65 72 20 70 6F 73 73 69    ram. Other possi
007E70:  62 6C 65 20 66 6F 72 65 67 72 6F 75 6E 64 20 70    ble foreground p
007E80:  72 6F 67 72 61 6D 73 20 61 72 65 3A 0D 0A 0D 0A    rograms are:....
007E90:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
007EA0:  20 20 2D 20 6F 74 68 65 72 20 73 79 73 74 65 6D      - other system
007EB0:  73 2C 20 73 75 63 68 20 61 73 20 46 4F 52 54 48    s, such as FORTH
007EC0:  20 6F 72 20 43 50 2F 4D 2E 0D 0A 20 20 20 20 20     or CP/M...     
007ED0:  20 20 20 20 20 20 20 20 20 20 20 2D 20 61 70 70               - app
007EE0:  6C 69 63 61 74 69 6F 6E 73 2C 20 73 75 63 68 20    lications, such 
007EF0:  61 73 20 61 20 57 6F 72 64 20 50 72 6F 63 65 73    as a Word Proces
007F00:  73 6F 72 20 6F 72 20 53 70 72 65 61 64 20 53 68    sor or Spread Sh
007F10:  65 65 74 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    eet...          
007F20:  20 20 20 20 20 20 2D 20 74 6F 6F 6C 73 2C 20 73          - tools, s
007F30:  75 63 68 20 61 73 20 61 6E 20 41 73 73 65 6D 62    uch as an Assemb
007F40:  6C 65 72 20 6F 72 20 44 65 62 75 67 67 65 72 2E    ler or Debugger.
007F50:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20 52    ......       A R
007F60:  41 4D 20 70 72 6F 67 72 61 6D 2C 20 6F 6E 63 65    AM program, once
007F70:  20 6C 6F 61 64 65 64 2C 20 74 61 6B 65 73 20 6F     loaded, takes o
007F80:  76 65 72 20 74 68 65 20 6D 61 63 68 69 6E 65 20    ver the machine 
007F90:  69 6E 20 20 6D 75 63 68 20 20 74 68 65 20 20 73    in  much  the  s
007FA0:  61 6D 65 0D 0A 20 20 20 20 20 20 20 77 61 79 20    ame..       way 
007FB0:  61 73 20 61 20 66 6F 72 65 67 72 6F 75 6E 64 20    as a foreground 
007FC0:  52 4F 4D 20 70 72 6F 67 72 61 6D 2E 20 47 61 6D    ROM program. Gam
007FD0:  65 73 20 77 69 6C 6C 20 67 65 6E 65 72 61 6C 6C    es will generall
007FE0:  79 20 62 65 20 52 41 4D 20 70 72 6F 67 72 61 6D    y be RAM program
007FF0:  73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    s.......       T
008000:  68 65 72 65 20 6D 61 79 20 62 65 20 75 70 20 74    here may be up t
008010:  6F 20 31 36 20 62 61 63 6B 67 72 6F 75 6E 64 20    o 16 background 
008020:  52 4F 4D 73 2C 20 65 61 63 68 20 20 6F 66 20 20    ROMs, each  of  
008030:  77 68 69 63 68 20 20 70 72 6F 76 69 64 65 73 20    which  provides 
008040:  20 73 6F 6D 65 0D 0A 20 20 20 20 20 20 20 73 6F     some..       so
008050:  72 74 20 6F 66 20 73 65 72 76 69 63 65 20 69 6E    rt of service in
008060:  64 65 70 65 6E 64 65 6E 74 20 6F 66 20 74 68 65    dependent of the
008070:  20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67     foreground prog
008080:  72 61 6D 2E 20 49 74 20 69 73 20 20 65 78 70 65    ram. It is  expe
008090:  63 74 65 64 0D 0A 20 20 20 20 20 20 20 74 68 61    cted..       tha
0080A0:  74 20 65 78 70 61 6E 73 69 6F 6E 20 70 65 72 69    t expansion peri
0080B0:  70 68 65 72 61 6C 73 20 77 69 6C 6C 20 65 61 63    pherals will eac
0080C0:  68 20 68 61 76 65 20 61 6E 20 61 73 73 6F 63 69    h have an associ
0080D0:  61 74 65 64 20 62 61 63 6B 67 72 6F 75 6E 64 20    ated background 
0080E0:  52 4F 4D 0D 0A 20 20 20 20 20 20 20 63 6F 6E 74    ROM..       cont
0080F0:  61 69 6E 69 6E 67 20 20 73 75 69 74 61 62 6C 65    aining  suitable
008100:  20 20 73 75 70 70 6F 72 74 20 20 72 6F 75 74 69      support  routi
008110:  6E 65 73 2E 20 20 4F 74 68 65 72 20 20 62 61 63    nes.  Other  bac
008120:  6B 67 72 6F 75 6E 64 20 20 52 4F 4D 73 20 20 6D    kground  ROMs  m
008130:  61 79 0D 0A 20 20 20 20 20 20 20 61 75 67 6D 65    ay..       augme
008140:  6E 74 20 74 68 65 20 65 78 69 73 74 69 6E 67 20    nt the existing 
008150:  20 6D 61 63 68 69 6E 65 20 20 73 6F 66 74 77 61     machine  softwa
008160:  72 65 3B 20 20 66 6F 72 20 20 65 78 61 6D 70 6C    re;  for  exampl
008170:  65 2C 20 20 62 79 20 20 70 72 6F 76 69 64 69 6E    e,  by  providin
008180:  67 0D 0A 20 20 20 20 20 20 20 66 75 72 74 68 65    g..       furthe
008190:  72 20 67 72 61 70 68 69 63 73 20 66 75 6E 63 74    r graphics funct
0081A0:  69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions.......     
0081B0:  20 20 41 20 72 65 73 69 64 65 6E 74 20 73 79 73      A resident sys
0081C0:  74 65 6D 20 65 78 74 65 6E 73 69 6F 6E 20 28 52    tem extension (R
0081D0:  53 58 29 2C 20 6F 6E 63 65 20 6C 6F 61 64 65 64    SX), once loaded
0081E0:  2C 20 70 72 6F 76 69 64 65 73 20 73 6F 6D 65 20    , provides some 
0081F0:  73 6F 72 74 20 20 6F 66 0D 0A 20 20 20 20 20 20    sort  of..      
008200:  20 73 65 72 76 69 63 65 20 69 6E 20 74 68 65 20     service in the 
008210:  73 61 6D 65 20 77 61 79 20 20 61 73 20 20 61 20    same way  as  a 
008220:  20 62 61 63 6B 67 72 6F 75 6E 64 20 20 52 4F 4D     background  ROM
008230:  2E 20 20 41 6E 20 20 52 53 58 20 20 6D 69 67 68    .  An  RSX  migh
008240:  74 2C 20 20 66 6F 72 0D 0A 20 20 20 20 20 20 20    t,  for..       
008250:  65 78 61 6D 70 6C 65 2C 20 70 72 6F 76 69 64 65    example, provide
008260:  20 73 70 65 63 69 61 6C 20 73 75 70 70 6F 72 74     special support
008270:  20 66 6F 72 20 61 20 67 69 76 65 6E 20 70 72 69     for a given pri
008280:  6E 74 65 72 20 20 2D 20 20 77 68 65 72 65 20 20    nter  -  where  
008290:  69 74 20 20 69 73 0D 0A 20 20 20 20 20 20 20 6D    it  is..       m
0082A0:  6F 72 65 20 65 63 6F 6E 6F 6D 69 63 61 6C 20 74    ore economical t
0082B0:  6F 20 70 72 6F 76 69 64 65 20 74 68 65 20 73 6F    o provide the so
0082C0:  66 74 77 61 72 65 20 6F 6E 20 63 61 73 73 65 74    ftware on casset
0082D0:  74 65 20 72 61 74 68 65 72 20 74 68 61 6E 20 69    te rather than i
0082E0:  6E 20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 28 6F    n ROM..       (o
0082F0:  72 20 50 52 4F 4D 29 2E 0D 0A 0D 0A 0D 0A 20 20    r PROM).......  
008300:  20 20 20 20 20 31 30 2E 31 20 52 4F 4D 20 41 64         10.1 ROM Ad
008310:  64 72 65 73 73 69 6E 67 2E 0D 0A 0D 0A 0D 0A 20    dressing....... 
008320:  20 20 20 20 20 20 45 78 70 61 6E 73 69 6F 6E 20          Expansion 
008330:  52 4F 4D 73 20 68 61 76 65 20 52 4F 4D 20 61 64    ROMs have ROM ad
008340:  64 72 65 73 73 20 69 6E 20 74 68 65 20 72 61 6E    dress in the ran
008350:  67 65 20 30 2E 2E 32 35 31 2E 20 54 6F 20 73 65    ge 0..251. To se
008360:  6C 65 63 74 20 61 20 67 69 76 65 6E 0D 0A 20 20    lect a given..  
008370:  20 20 20 20 20 52 4F 4D 20 74 68 65 20 4B 65 72         ROM the Ker
008380:  6E 65 6C 20 73 65 74 73 20 69 74 73 20 52 4F 4D    nel sets its ROM
008390:  20 61 64 64 72 65 73 73 20 62 79 20 77 72 69 74     address by writ
0083A0:  69 6E 67 20 74 6F 20 49 2F 4F 20 20 61 64 64 72    ing to I/O  addr
0083B0:  65 73 73 20 20 23 44 46 30 30 2E 0D 0A 20 20 20    ess  #DF00...   
0083C0:  20 20 20 20 49 66 20 61 20 52 4F 4D 20 69 73 20        If a ROM is 
0083D0:  66 69 74 74 65 64 20 61 74 20 74 68 65 20 61 64    fitted at the ad
0083E0:  64 72 65 73 73 20 20 73 65 6C 65 63 74 65 64 2C    dress  selected,
0083F0:  20 20 74 68 65 6E 20 20 61 6C 6C 20 20 66 75 72      then  all  fur
008400:  74 68 65 72 20 20 72 65 61 64 0D 0A 20 20 20 20    ther  read..    
008410:  20 20 20 61 63 63 65 73 73 65 73 20 74 6F 20 74       accesses to t
008420:  68 65 20 74 6F 70 20 31 36 4B 20 6F 66 20 6D 65    he top 16K of me
008430:  6D 6F 72 79 20 77 69 6C 6C 20 72 65 74 75 72 6E    mory will return
008440:  20 64 61 74 61 20 66 72 6F 6D 20 74 68 65 20 20     data from the  
008450:  65 78 70 61 6E 73 69 6F 6E 0D 0A 20 20 20 20 20    expansion..     
008460:  20 20 52 4F 4D 2E 20 49 66 20 6E 6F 20 52 4F 4D      ROM. If no ROM
008470:  20 69 73 20 66 69 74 74 65 64 20 61 74 20 74 68     is fitted at th
008480:  65 20 63 75 72 72 65 6E 74 6C 79 20 20 73 65 6C    e currently  sel
008490:  65 63 74 65 64 20 20 52 4F 4D 20 20 61 64 64 72    ected  ROM  addr
0084A0:  65 73 73 20 20 74 68 65 0D 0A 20 20 20 20 20 20    ess  the..      
0084B0:  20 63 6F 6E 74 65 6E 74 73 20 6F 66 20 74 68 65     contents of the
0084C0:  20 6F 6E 2D 62 6F 61 72 64 20 52 4F 4D 20 61 72     on-board ROM ar
0084D0:  65 20 72 65 74 75 72 6E 65 64 2E 0D 0A 0D 0A 0D    e returned......
0084E0:  0A 20 20 20 20 20 20 20 57 68 65 6E 20 74 68 65    .       When the
0084F0:  20 6D 61 63 68 69 6E 65 20 20 69 73 20 20 66 69     machine  is  fi
008500:  72 73 74 20 20 74 75 72 6E 65 64 20 20 6F 6E 20    rst  turned  on 
008510:  20 52 4F 4D 20 20 30 20 20 69 73 20 20 73 65 6C     ROM  0  is  sel
008520:  65 63 74 65 64 20 20 61 73 20 20 74 68 65 0D 0A    ected  as  the..
008530:  20 20 20 20 20 20 20 66 6F 72 65 67 72 6F 75 6E           foregroun
008540:  64 20 70 72 6F 67 72 61 6D 2E 20 49 66 20 6E 6F    d program. If no
008550:  20 65 78 70 61 6E 73 69 6F 6E 20 52 4F 4D 20 69     expansion ROM i
008560:  73 20 66 69 74 74 65 64 20 61 74 20 20 52 4F 4D    s fitted at  ROM
008570:  20 20 61 64 64 72 65 73 73 20 20 30 2C 0D 0A 20      address  0,.. 
008580:  20 20 20 20 20 20 74 68 65 20 6F 6E 2D 62 6F 61          the on-boa
008590:  72 64 20 52 4F 4D 20 69 73 20 75 73 65 64 2C 20    rd ROM is used, 
0085A0:  61 6E 64 20 42 41 53 49 43 20 69 73 20 65 6E 74    and BASIC is ent
0085B0:  65 72 65 64 2E 20 49 66 20 61 6E 20 65 78 70 61    ered. If an expa
0085C0:  6E 73 69 6F 6E 20 52 4F 4D 20 69 73 0D 0A 20 20    nsion ROM is..  
0085D0:  20 20 20 20 20 66 69 74 74 65 64 20 61 74 20 52         fitted at R
0085E0:  4F 4D 20 61 64 64 72 65 73 73 20 30 20 69 74 20    OM address 0 it 
0085F0:  74 61 6B 65 73 20 70 72 65 63 65 64 65 6E 63 65    takes precedence
008600:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
008610:  07 00 00 00 02 09 50 E5 07 00 C1 02 00 00 00 02    ......P.........
008620:  07 00 C2 02 00 00 00 02 07 00 C3 02 00 00 00 02    ................
008630:  07 00 C4 02 00 00 00 02 07 00 C5 02 00 00 00 02    ................
008640:  07 00 C6 02 00 00 00 02 07 00 C7 02 00 00 00 02    ................
008650:  07 00 C8 02 00 00 00 02 07 00 C9 02 00 00 00 02    ................
008660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
008670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
008680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
008690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0086F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
008700:  20 6F 76 65 72 20 74 68 65 20 6F 6E 2D 62 6F 61     over the on-boa
008710:  72 64 20 52 4F 4D 2E 0D 0A 0D 0A 0D 0A 0D 0A 20    rd ROM......... 
008720:  20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50          AMSTRAD CP
008730:  43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49    C464/664/6128 FI
008740:  52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20    RMWARE          
008750:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
008760:  20 20 20 70 61 67 65 20 31 30 2E 31 0D 0A 0D 0A       page 10.1....
008770:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
008780:  20 49 6E 20 56 31 2E 30 20 66 69 72 6D 77 61 72     In V1.0 firmwar
008790:  65 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D    e background ROM
0087A0:  73 20 6D 75 73 74 20 62 65 20 66 69 74 74 65 64    s must be fitted
0087B0:  20 61 74 20 20 52 4F 4D 20 20 61 64 64 72 65 73     at  ROM  addres
0087C0:  73 65 73 20 20 69 6E 0D 0A 20 20 20 20 20 20 20    ses  in..       
0087D0:  74 68 65 20 72 61 6E 67 65 20 31 2E 2E 2E 37 2E    the range 1...7.
0087E0:  20 46 6F 72 65 67 72 6F 75 6E 64 20 52 4F 4D 73     Foreground ROMs
0087F0:  20 6D 75 73 74 20 62 65 20 20 66 69 74 74 65 64     must be  fitted
008800:  20 20 73 6F 20 20 74 68 61 74 20 20 74 68 65 72      so  that  ther
008810:  65 20 20 61 72 65 0D 0A 20 20 20 20 20 20 20 63    e  are..       c
008820:  6F 6E 74 69 67 75 6F 75 73 20 52 4F 4D 73 20 66    ontiguous ROMs f
008830:  72 6F 6D 20 61 64 64 72 65 73 73 20 31 2E 20 57    rom address 1. W
008840:  68 65 6E 20 73 65 61 72 63 68 69 6E 67 20 66 6F    hen searching fo
008850:  72 20 20 61 20 20 66 6F 72 65 67 72 6F 75 6E 64    r  a  foreground
008860:  20 20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 74 68      ROM..       th
008870:  65 20 6B 65 72 6E 65 6C 20 73 74 61 72 74 73 20    e kernel starts 
008880:  61 74 20 61 64 64 72 65 73 73 20 30 20 20 61 6E    at address 0  an
008890:  64 20 20 77 6F 72 6B 73 20 20 75 70 77 61 72 64    d  works  upward
0088A0:  73 20 20 75 6E 74 69 6C 20 20 74 68 65 20 20 66    s  until  the  f
0088B0:  69 72 73 74 0D 0A 20 20 20 20 20 20 20 61 64 64    irst..       add
0088C0:  72 65 73 73 20 67 72 65 61 74 65 72 20 74 68 61    ress greater tha
0088D0:  6E 20 30 20 69 66 20 66 6F 75 6E 64 2E 0D 0A 0D    n 0 if found....
0088E0:  0A 20 20 20 20 20 20 20 49 6E 20 56 31 2E 31 20    .       In V1.1 
0088F0:  66 69 72 6D 77 61 72 65 20 62 61 63 6B 67 72 6F    firmware backgro
008900:  75 6E 64 20 52 4F 4D 73 20 6D 61 79 20 62 65 20    und ROMs may be 
008910:  66 69 74 74 65 64 20 61 74 20 52 4F 4D 20 61 64    fitted at ROM ad
008920:  64 72 65 73 73 65 73 20 69 6E 20 74 68 65 0D 0A    dresses in the..
008930:  20 20 20 20 20 20 20 72 61 6E 67 65 20 30 2E 2E           range 0..
008940:  2E 31 35 2E 20 46 6F 72 65 67 72 6F 75 6E 64 20    .15. Foreground 
008950:  52 4F 4D 73 20 6D 75 73 74 20 62 65 20 66 69 74    ROMs must be fit
008960:  74 65 64 20 63 6F 6E 74 69 67 75 6F 75 73 6C 79    ted contiguously
008970:  20 66 72 6F 6D 20 61 64 64 72 65 73 73 0D 0A 20     from address.. 
008980:  20 20 20 20 20 20 31 36 20 6F 72 20 61 74 20 61          16 or at a
008990:  6E 79 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F    ny background RO
0089A0:  4D 20 61 64 64 72 65 73 73 2E 20 57 68 65 6E 20    M address. When 
0089B0:  73 65 61 72 63 68 69 6E 67 20 66 6F 72 20 20 61    searching for  a
0089C0:  20 20 66 6F 72 65 67 72 6F 75 6E 64 0D 0A 20 20      foreground..  
0089D0:  20 20 20 20 20 52 4F 4D 20 74 68 65 20 6B 65 72         ROM the ker
0089E0:  6E 65 6C 20 73 74 61 72 74 73 20 61 74 20 61 64    nel starts at ad
0089F0:  64 72 65 73 73 20 30 20 61 6E 64 20 77 6F 72 6B    dress 0 and work
008A00:  73 20 75 70 77 61 72 64 73 20 75 6E 74 69 6C 20    s upwards until 
008A10:  20 74 68 65 20 20 66 69 72 73 74 0D 0A 20 20 20     the  first..   
008A20:  20 20 20 20 75 6E 75 73 65 64 20 61 64 64 72 65        unused addre
008A30:  73 73 20 67 72 65 61 74 65 72 20 74 68 61 6E 20    ss greater than 
008A40:  31 35 20 69 73 20 66 6F 75 6E 64 2E 0D 0A 0D 0A    15 is found.....
008A50:  20 20 20 20 20 20 20 49 6E 20 65 69 74 68 65 72           In either
008A60:  20 63 61 73 65 20 69 66 20 61 6E 20 65 78 70 61     case if an expa
008A70:  6E 73 69 6F 6E 20 52 4F 4D 20 30 20 69 73 20 66    nsion ROM 0 is f
008A80:  69 74 74 65 64 20 74 68 65 20 20 6F 6E 2D 62 6F    itted the  on-bo
008A90:  61 72 64 20 20 52 4F 4D 20 20 63 61 6E 0D 0A 20    ard  ROM  can.. 
008AA0:  20 20 20 20 20 20 73 74 69 6C 6C 20 62 65 20 61          still be a
008AB0:  63 63 65 73 73 65 64 20 61 74 20 74 68 65 20 66    ccessed at the f
008AC0:  69 72 73 74 20 75 6E 75 73 65 64 20 52 4F 4D 20    irst unused ROM 
008AD0:  61 64 64 72 65 73 73 2E 0D 0A 0D 0A 20 20 20 20    address.....    
008AE0:  20 20 20 54 68 65 20 4B 65 72 6E 65 6C 20 20 73       The Kernel  s
008AF0:  75 70 70 6F 72 74 73 20 20 61 20 20 27 66 61 72    upports  a  'far
008B00:  20 20 61 64 64 72 65 73 73 27 20 20 77 68 69 63      address'  whic
008B10:  68 20 20 6D 79 20 20 62 65 20 20 75 73 65 64 20    h  my  be  used 
008B20:  20 74 6F 20 20 63 61 6C 6C 0D 0A 20 20 20 20 20     to  call..     
008B30:  20 20 73 75 62 72 6F 75 74 69 6E 65 73 20 69 6E      subroutines in
008B40:  20 65 78 70 61 6E 73 69 6F 6E 20 52 4F 4D 73 2E     expansion ROMs.
008B50:  20 54 68 65 20 20 27 66 61 72 20 20 61 64 64 72     The  'far  addr
008B60:  65 73 73 27 20 20 69 73 20 20 61 20 20 74 68 72    ess'  is  a  thr
008B70:  65 65 20 20 62 79 74 65 0D 0A 20 20 20 20 20 20    ee  byte..      
008B80:  20 6F 62 6A 65 63 74 2C 20 74 68 65 20 6C 61 73     object, the las
008B90:  74 20 62 79 74 65 20 6F 66 20 77 68 69 63 68 20    t byte of which 
008BA0:  69 73 20 20 61 20 20 52 4F 4D 20 20 73 65 6C 65    is  a  ROM  sele
008BB0:  63 74 20 20 6E 75 6D 62 65 72 2E 20 20 53 69 6E    ct  number.  Sin
008BC0:  63 65 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20    ce  the..       
008BD0:  61 72 72 61 6E 67 65 6D 65 6E 74 20 6F 66 20 52    arrangement of R
008BE0:  4F 4D 73 20 69 6E 20 61 6E 20 65 78 70 61 6E 73    OMs in an expans
008BF0:  69 6F 6E 20 63 61 72 64 20 69 73 20 71 75 69 74    ion card is quit
008C00:  65 20 20 61 72 62 69 74 72 61 72 79 20 20 74 68    e  arbitrary  th
008C10:  65 20 20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 73    e  ROM..       s
008C20:  65 6C 65 63 74 20 70 61 72 74 20 6F 66 20 74 68    elect part of th
008C30:  65 20 27 66 61 72 20 61 64 64 72 65 73 73 27 20    e 'far address' 
008C40:  6D 75 73 74 20 62 65 20 65 73 74 61 62 6C 69 73    must be establis
008C50:  68 65 64 20 61 74 20 72 75 6E 20 74 69 6D 65 2E    hed at run time.
008C60:  20 20 54 68 65 0D 0A 20 20 20 20 20 20 20 27 73      The..       's
008C70:  69 64 65 77 61 79 73 27 20 52 4F 4D 20 61 64 64    ideways' ROM add
008C80:  72 65 73 73 69 6E 67 20 66 61 63 69 6C 69 74 79    ressing facility
008C90:  20 20 61 6C 6C 6F 77 73 20 20 61 20 20 66 6F 72      allows  a  for
008CA0:  65 67 72 6F 75 6E 64 20 20 70 72 6F 67 72 61 6D    eground  program
008CB0:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 6F 63 63      to..       occ
008CC0:  75 70 79 20 75 70 20 74 6F 20 20 66 6F 75 72 20    upy up to  four 
008CD0:  20 63 6F 6E 74 69 67 75 6F 75 73 20 20 52 4F 4D     contiguous  ROM
008CE0:  20 20 73 65 6C 65 63 74 20 20 61 64 64 72 65 73      select  addres
008CF0:  73 65 73 2C 20 20 61 6E 64 20 20 73 75 70 70 6F    ses,  and  suppo
008D00:  72 74 73 0D 0A 20 20 20 20 20 20 20 73 75 62 72    rts..       subr
008D10:  6F 75 74 69 6E 65 20 63 61 6C 6C 73 20 62 65 74    outine calls bet
008D20:  77 65 65 6E 20 74 68 65 20 52 4F 4D 73 20 77 69    ween the ROMs wi
008D30:  74 68 6F 75 74 20 20 72 65 71 75 69 72 69 6E 67    thout  requiring
008D40:  20 20 74 68 65 20 20 70 72 6F 67 72 61 6D 20 20      the  program  
008D50:  74 6F 0D 0A 20 20 20 20 20 20 20 6B 6E 6F 77 20    to..       know 
008D60:  74 68 65 20 61 63 74 75 61 6C 20 52 4F 4D 20 61    the actual ROM a
008D70:  64 64 72 65 73 73 20 6F 66 20 61 6E 79 20 6F 66    ddress of any of
008D80:  20 74 68 65 6D 2E 0D 0A 0D 0A 20 20 20 20 20 20     them.....      
008D90:  20 31 30 2E 32 20 54 68 65 20 46 6F 72 6D 61 74     10.2 The Format
008DA0:  20 6F 66 20 61 6E 20 45 78 70 61 6E 73 69 6F 6E     of an Expansion
008DB0:  20 52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20     ROM.....       
008DC0:  41 6E 20 65 78 70 61 6E 73 69 6F 6E 20 52 4F 4D    An expansion ROM
008DD0:  20 6D 61 79 20 62 65 20 75 70 20 74 6F 20 31 36     may be up to 16
008DE0:  4B 20 62 79 74 65 73 20 6C 6F 6E 67 2C 20 74 68    K bytes long, th
008DF0:  65 20 66 69 72 73 74 20 62 79 74 65 20 62 65 69    e first byte bei
008E00:  6E 67 20 20 61 74 0D 0A 20 20 20 20 20 20 20 61    ng  at..       a
008E10:  64 64 72 65 73 73 20 23 43 30 30 30 2E 20 54 68    ddress #C000. Th
008E20:  65 20 66 69 72 73 74 20 66 65 77 20 62 79 74 65    e first few byte
008E30:  73 20 6F 66 20 74 68 65 20 52 4F 4D 20 61 72 65    s of the ROM are
008E40:  20 74 68 65 20 27 52 4F 4D 20 50 72 65 66 69 78     the 'ROM Prefix
008E50:  27 20 61 6E 64 0D 0A 20 20 20 20 20 20 20 6D 75    ' and..       mu
008E60:  73 74 20 74 61 6B 65 20 74 68 65 20 66 6F 72 6D    st take the form
008E70:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    :....           
008E80:  20 20 20 20 20 42 79 74 65 20 30 20 3A 20 20 52         Byte 0 :  R
008E90:  4F 4D 20 74 79 70 65 2E 0D 0A 20 20 20 20 20 20    OM type...      
008EA0:  20 20 20 20 20 20 20 20 20 20 42 79 74 65 20 31              Byte 1
008EB0:  20 3A 20 20 52 4F 4D 20 4D 61 72 6B 20 4E 75 6D     :  ROM Mark Num
008EC0:  62 65 72 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    ber...          
008ED0:  20 20 20 20 20 20 42 79 74 65 20 32 20 3A 20 20          Byte 2 :  
008EE0:  52 4F 4D 20 56 65 72 73 69 6F 6E 20 4E 75 6D 62    ROM Version Numb
008EF0:  65 72 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20    er...           
008F00:  20 20 20 20 20 42 79 74 65 20 33 20 3A 20 20 52         Byte 3 :  R
008F10:  4F 4D 20 4D 6F 64 69 66 69 63 61 74 69 6F 6E 20    OM Modification 
008F20:  4C 65 76 65 6C 2E 0D 0A 20 20 20 20 20 20 20 20    Level...        
008F30:  20 20 20 20 20 20 20 20 42 79 74 65 20 34 20 3A            Byte 4 :
008F40:  20 20 45 78 74 65 72 6E 61 6C 20 43 6F 6D 6D 61      External Comma
008F50:  6E 64 20 54 61 62 6C 65 2E 0D 0A 0D 0A 20 20 20    nd Table.....   
008F60:  20 20 20 20 54 68 65 20 52 4F 4D 20 74 79 70 65        The ROM type
008F70:  20 73 70 65 63 69 66 69 65 73 20 77 68 61 74 20     specifies what 
008F80:  73 6F 72 74 20 6F 66 20 52 4F 4D 20 74 68 69 73    sort of ROM this
008F90:  20 20 69 73 20 20 61 6E 64 20 20 6D 75 73 74 20      is  and  must 
008FA0:  20 74 61 6B 65 20 20 74 68 65 0D 0A 20 20 20 20     take  the..    
008FB0:  20 20 20 66 6F 6C 6C 6F 77 69 6E 67 20 76 61 6C       following val
008FC0:  75 65 73 3A 0D 0A 20 20 20 20 20 20 20 20 20 20    ues:..          
008FD0:  20 20 20 20 20 20 30 3A 20 20 20 46 6F 72 65 67          0:   Foreg
008FE0:  72 6F 75 6E 64 20 52 4F 4D 2E 0D 0A 20 20 20 20    round ROM...    
008FF0:  20 20 20 20 20 20 20 20 20 20 20 20 31 3A 20 20                1:  
009000:  20 42 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 2E     Background ROM.
009010:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
009020:  20 20 32 3A 20 20 20 45 78 74 65 6E 73 69 6F 6E      2:   Extension
009030:  20 52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20     ROM.....       
009040:  54 68 65 20 6F 6E 2D 62 6F 61 72 64 20 52 4F 4D    The on-board ROM
009050:  20 6D 75 73 74 20 62 65 20 75 6E 69 71 75 65 20     must be unique 
009060:  69 6E 20 68 61 76 69 6E 67 20 62 69 74 20 37 20    in having bit 7 
009070:  6F 66 20 74 68 65 20 74 79 70 65 20 20 62 79 74    of the type  byt
009080:  65 20 20 73 65 74 0D 0A 20 20 20 20 20 20 20 28    e  set..       (
009090:  74 68 75 73 20 69 74 73 20 74 79 70 65 20 62 79    thus its type by
0090A0:  74 65 20 69 73 20 23 38 30 29 2E 20 54 68 69 73    te is #80). This
0090B0:  20 6D 61 72 6B 65 72 20 69 73 20 75 73 65 64 20     marker is used 
0090C0:  74 6F 20 64 65 74 65 63 74 20 74 68 65 20 65 6E    to detect the en
0090D0:  64 20 20 6F 66 0D 0A 20 20 20 20 20 20 20 66 6F    d  of..       fo
0090E0:  72 65 67 72 6F 75 6E 64 20 52 4F 4D 73 2E 20 49    reground ROMs. I
0090F0:  66 20 61 20 66 6F 72 65 67 72 6F 75 6E 64 20 70    f a foreground p
009100:  72 6F 67 72 61 6D 20 77 69 6C 6C 20 6E 6F 74 20    rogram will not 
009110:  66 69 74 20 20 69 6E 74 6F 20 20 61 20 20 73 69    fit  into  a  si
009120:  6E 67 6C 65 0D 0A 20 20 20 20 20 20 20 52 4F 4D    ngle..       ROM
009130:  20 74 68 65 6E 20 74 68 65 20 65 78 74 72 61 20     then the extra 
009140:  52 4F 4D 73 20 72 65 71 75 69 72 65 64 20 73 68    ROMs required sh
009150:  6F 75 6C 64 20 62 65 20 6D 61 72 6B 65 64 20 61    ould be marked a
009160:  73 20 65 78 74 65 6E 73 69 6F 6E 20 52 4F 4D 73    s extension ROMs
009170:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
009180:  6D 61 72 6B 20 6E 75 6D 62 65 72 2C 20 76 65 72    mark number, ver
009190:  73 69 6F 6E 20 6E 75 6D 62 65 72 20 61 6E 64 20    sion number and 
0091A0:  6D 6F 64 69 66 69 63 61 74 69 6F 6E 20 6C 65 76    modification lev
0091B0:  65 6C 20 6D 61 79 20 62 65 20 20 73 65 74 20 20    el may be  set  
0091C0:  74 6F 0D 0A 20 20 20 20 20 20 20 61 6E 79 20 76    to..       any v
0091D0:  61 6C 75 65 73 20 72 65 71 75 69 72 65 64 2E 0D    alues required..
0091E0:  0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 65 78    ...       The ex
0091F0:  74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 20 74    ternal command t
009200:  61 62 6C 65 20 63 6F 6D 70 72 69 73 65 73 20 61    able comprises a
009210:  20 6C 69 73 74 20 6F 66 20 20 63 6F 6D 6D 61 6E     list of  comman
009220:  64 20 20 6E 61 6D 65 73 20 20 61 6E 64 20 20 61    d  names  and  a
009230:  0D 0A 20 20 20 20 20 20 20 6A 75 6D 70 62 6C 6F    ..       jumpblo
009240:  63 6B 2E 20 45 61 63 68 20 63 6F 6D 6D 61 6E 64    ck. Each command
009250:  20 6E 61 6D 65 20 69 73 20 69 6D 70 6C 69 63 69     name is implici
009260:  74 6C 79 20 61 73 73 6F 63 69 61 74 65 64 20 20    tly associated  
009270:  77 69 74 68 20 20 74 68 65 20 20 73 61 6D 65 0D    with  the  same.
009280:  0A 20 20 20 20 20 20 20 6E 75 6D 62 65 72 65 64    .       numbered
009290:  20 65 6E 74 72 79 20 69 6E 20 74 68 65 20 6A 75     entry in the ju
0092A0:  6D 70 62 6C 6F 63 6B 2E 20 54 68 65 20 74 61 62    mpblock. The tab
0092B0:  6C 65 20 74 61 6B 65 73 20 74 68 65 20 66 6F 72    le takes the for
0092C0:  6D 3A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    m:..            
0092D0:  20 20 20 20 42 79 74 65 73 20 30 2E 2E 31 20 20        Bytes 0..1  
0092E0:  3A 41 64 64 72 65 73 73 20 6F 66 20 63 6F 6D 6D    :Address of comm
0092F0:  61 6E 64 20 6E 61 6D 65 20 74 61 62 6C 65 0D 0A    and name table..
009300:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009310:  42 79 74 65 73 20 32 2E 2E 34 20 20 3A 4A 75 6D    Bytes 2..4  :Jum
009320:  70 62 6C 6F 63 6B 20 65 6E 74 72 79 20 30 0D 0A    pblock entry 0..
009330:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009340:  42 79 74 65 73 20 35 2E 2E 37 20 20 3A 4A 75 6D    Bytes 5..7  :Jum
009350:  70 62 6C 6F 63 6B 20 65 6E 74 72 79 20 31 0D 0A    pblock entry 1..
009360:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009370:  2E 2E 2E 65 74 63 20 3A 2E 2E 2E 65 74 63 0D 0A    ...etc :...etc..
009380:  0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44    ..       AMSTRAD
009390:  20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38     CPC464/664/6128
0093A0:  20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20     FIRMWARE       
0093B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0093C0:  20 20 20 20 20 20 70 61 67 65 20 31 30 2E 32 0D          page 10.2.
0093D0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
0093E0:  20 20 20 20 54 68 65 20 63 6F 6D 6D 61 6E 64 20        The command 
0093F0:  6E 61 6D 65 20 74 61 62 6C 65 20 69 73 20 61 20    name table is a 
009400:  6C 69 73 74 20 6F 66 20 6E 61 6D 65 73 2C 20 65    list of names, e
009410:  61 63 68 20 6F 66 20 77 68 69 63 68 20 6D 61 79    ach of which may
009420:  20 62 65 20 75 70 20 20 74 6F 0D 0A 20 20 20 20     be up  to..    
009430:  20 20 20 31 36 20 63 68 61 72 61 63 74 65 72 73       16 characters
009440:  20 6C 6F 6E 67 2E 20 54 68 65 20 6C 61 73 74 20     long. The last 
009450:  63 68 61 72 61 63 74 65 72 20 6F 66 20 65 61 63    character of eac
009460:  68 20 6E 61 6D 65 20 6D 75 73 74 20 20 68 61 76    h name must  hav
009470:  65 20 20 62 69 74 20 20 37 0D 0A 20 20 20 20 20    e  bit  7..     
009480:  20 20 73 65 74 20 62 75 74 20 6E 6F 20 6F 74 68      set but no oth
009490:  65 72 20 63 68 61 72 61 63 74 65 72 20 6D 61 79    er character may
0094A0:  2E 20 54 68 65 20 74 61 62 6C 65 20 20 69 73 20    . The table  is 
0094B0:  20 74 65 72 6D 69 6E 61 74 65 64 20 20 62 79 20     terminated  by 
0094C0:  20 61 20 20 6E 75 6C 6C 0D 0A 20 20 20 20 20 20     a  null..      
0094D0:  20 28 63 68 61 72 61 63 74 65 72 20 30 29 20 61     (character 0) a
0094E0:  66 74 65 72 20 74 68 65 20 6C 61 73 74 20 63 68    fter the last ch
0094F0:  61 72 61 63 74 65 72 20 6F 66 20 74 68 65 20 6C    aracter of the l
009500:  61 73 74 20 20 6E 61 6D 65 2E 20 20 41 70 61 72    ast  name.  Apar
009510:  74 20 20 66 72 6F 6D 0D 0A 20 20 20 20 20 20 20    t  from..       
009520:  74 68 65 20 66 61 63 74 20 74 68 61 74 20 61 6C    the fact that al
009530:  6C 20 63 68 61 72 61 63 74 65 72 73 20 6D 75 73    l characters mus
009540:  74 20 62 65 20 69 6E 20 74 68 65 20 72 61 6E 67    t be in the rang
009550:  65 20 30 2E 2E 31 32 37 20 61 6E 64 20 74 68 61    e 0..127 and tha
009560:  74 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 66    t  the..       f
009570:  69 72 73 74 20 63 68 61 72 61 63 74 65 72 20 6D    irst character m
009580:  61 79 20 6E 6F 74 20 62 65 20 61 20 6E 75 6C 6C    ay not be a null
009590:  2C 20 74 68 65 72 65 20 61 72 65 20 6E 6F 20 20    , there are no  
0095A0:  72 65 73 74 72 69 63 74 69 6F 6E 73 20 20 6F 6E    restrictions  on
0095B0:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 63 68      the..       ch
0095C0:  61 72 61 63 74 65 72 73 20 69 6E 20 63 6F 6D 6D    aracters in comm
0095D0:  61 6E 64 20 6E 61 6D 65 73 2E 20 48 6F 77 65 76    and names. Howev
0095E0:  65 72 2C 20 20 69 66 20 20 75 6E 73 75 69 74 61    er,  if  unsuita
0095F0:  62 6C 65 20 20 63 68 61 72 61 63 74 65 72 73 20    ble  characters 
009600:  20 61 72 65 0D 0A 20 20 20 20 20 20 20 63 68 6F     are..       cho
009610:  73 65 6E 20 69 74 20 6D 61 79 20 70 72 6F 76 65    sen it may prove
009620:  20 69 6D 70 6F 73 73 69 62 6C 65 20 66 6F 72 20     impossible for 
009630:  70 72 6F 67 72 61 6D 73 20 73 75 63 68 20 61 73    programs such as
009640:  20 20 42 41 53 49 43 20 20 74 6F 20 20 61 63 63      BASIC  to  acc
009650:  65 73 73 0D 0A 20 20 20 20 20 20 20 74 68 65 20    ess..       the 
009660:  63 6F 6D 6D 61 6E 64 73 2E 20 42 41 53 49 43 20    commands. BASIC 
009670:  65 78 70 65 63 74 73 20 61 6C 70 68 61 62 65 74    expects alphabet
009680:  69 63 20 63 68 61 72 61 63 74 65 72 73 20 69 6E    ic characters in
009690:  20 74 68 65 20 20 63 6F 6D 6D 61 6E 64 6E 61 6D     the  commandnam
0096A0:  65 73 0D 0A 20 20 20 20 20 20 20 74 6F 20 62 65    es..       to be
0096B0:  20 69 6E 20 75 70 70 65 72 20 63 61 73 65 20 61     in upper case a
0096C0:  6E 64 20 77 69 6C 6C 20 6E 6F 74 20 61 6C 6C 6F    nd will not allo
0096D0:  77 20 63 68 61 72 61 63 74 65 72 73 20 73 75 63    w characters suc
0096E0:  68 20 61 73 20 61 20 73 70 61 63 65 20 6F 72 0D    h as a space or.
0096F0:  0A 20 20 20 20 20 20 20 63 6F 6D 6D 61 20 69 6E    .       comma in
009700:  20 74 68 65 20 63 6F 6D 6D 61 6E 64 20 6E 61 6D     the command nam
009710:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    e.....       The
009720:  20 52 4F 4D 20 70 72 65 66 69 78 20 66 6F 72 20     ROM prefix for 
009730:  74 68 65 20 6F 6E 2D 62 6F 61 72 64 20 52 4F 4D    the on-board ROM
009740:  20 69 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20     is:....        
009750:  20 20 20 20 20 20 20 20 20 20 20 20 4F 52 47 20                ORG 
009760:  23 43 30 30 30 20 20 20 20 20 20 20 20 20 20 20    #C000           
009770:  3B 53 74 61 72 74 20 6F 66 20 74 68 65 20 52 4F    ;Start of the RO
009780:  4D 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    M....           
009790:  20 20 20 20 20 20 20 20 20 44 45 46 42 20 23 38             DEFB #8
0097A0:  30 2B 30 20 20 20 20 20 20 20 20 20 20 3B 4F 6E    0+0          ;On
0097B0:  20 62 6F 61 72 64 20 52 4F 4D 2C 20 46 6F 72 65     board ROM, Fore
0097C0:  67 72 6F 75 6E 64 0D 0A 20 20 20 20 20 20 20 20    ground..        
0097D0:  20 20 20 20 20 20 20 20 20 20 20 20 44 45 46 42                DEFB
0097E0:  20 31 20 20 20 20 20 20 20 20 20 20 20 20 20 20     1              
0097F0:  3B 4D 61 72 6B 20 31 0D 0A 20 20 20 20 20 20 20    ;Mark 1..       
009800:  20 20 20 20 20 20 20 20 20 20 20 20 20 44 45 46                 DEF
009810:  42 20 30 20 20 20 20 20 20 20 20 20 20 20 20 20    B 0             
009820:  20 3B 56 65 72 73 69 6F 6E 20 30 0D 0A 20 20 20     ;Version 0..   
009830:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009840:  20 44 45 46 42 20 30 20 20 20 20 20 20 20 20 20     DEFB 0         
009850:  20 20 20 20 20 3B 4D 6F 64 69 66 69 63 61 74 69         ;Modificati
009860:  6F 6E 20 30 0D 0A 0D 0A 20 20 20 20 20 20 20 20    on 0....        
009870:  20 20 20 20 20 20 20 20 20 20 20 20 44 45 46 57                DEFW
009880:  20 4E 41 4D 45 5F 54 41 42 4C 45 20 20 20 20 20     NAME_TABLE     
009890:  3B 41 64 64 72 65 73 73 20 6F 66 20 6E 61 6D 65    ;Address of name
0098A0:  20 74 61 62 6C 65 2E 0D 0A 0D 0A 20 20 20 20 20     table.....     
0098B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A                   J
0098C0:  50 20 53 54 41 52 54 5F 42 41 53 49 43 20 20 20    P START_BASIC   
0098D0:  20 20 20 3B 54 68 65 20 6F 6E 6C 79 20 65 6E 74       ;The only ent
0098E0:  72 79 20 69 6E 20 74 68 65 20 6A 75 6D 70 62 6C    ry in the jumpbl
0098F0:  6F 63 6B 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 41    ock....       NA
009900:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
009910:  08 00 00 00 02 09 50 E5 08 00 C1 02 00 00 00 02    ......P.........
009920:  08 00 C2 02 00 00 00 02 08 00 C3 02 00 00 00 02    ................
009930:  08 00 C4 02 00 00 00 02 08 00 C5 02 00 00 00 02    ................
009940:  08 00 C6 02 00 00 00 02 08 00 C7 02 00 00 00 02    ................
009950:  08 00 C8 02 00 00 00 02 08 00 C9 02 00 00 00 02    ................
009960:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
009970:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
009980:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
009990:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0099F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
009A00:  4D 45 5F 54 41 42 4C 45 3A 20 20 44 45 46 42 20    ME_TABLE:  DEFB 
009A10:  27 42 41 53 49 27 2C 27 43 27 2B 23 38 30 20 3B    'BASI','C'+#80 ;
009A20:  54 68 65 20 6F 6E 6C 79 20 63 6F 6D 6D 61 6E 64    The only command
009A30:  20 6E 61 6D 65 0D 0A 20 20 20 20 20 20 20 20 20     name..         
009A40:  20 20 20 20 20 20 20 20 20 20 20 44 45 46 42 20               DEFB 
009A50:  30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B    0              ;
009A60:  45 6E 64 20 6F 66 20 74 61 62 6C 65 20 6D 61 72    End of table mar
009A70:  6B 65 72 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ker......       
009A80:  54 68 65 20 52 4F 4D 20 70 72 65 66 69 78 20 66    The ROM prefix f
009A90:  6F 72 20 61 20 73 65 72 69 61 6C 20 49 2F 4F 20    or a serial I/O 
009AA0:  63 61 72 64 20 6D 69 67 68 74 20 62 65 3A 0D 0A    card might be:..
009AB0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
009AC0:  20 20 20 20 20 20 4F 52 47 20 23 43 30 30 30 20          ORG #C000 
009AD0:  20 20 20 20 20 20 20 20 20 20 3B 53 74 61 72 74              ;Start
009AE0:  20 6F 66 20 52 4F 4D 0D 0A 0D 0A 20 20 20 20 20     of ROM....     
009AF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44                   D
009B00:  45 46 42 20 31 20 20 20 20 20 20 20 20 20 20 20    EFB 1           
009B10:  20 20 20 3B 42 61 63 6B 67 72 6F 75 6E 64 20 52       ;Background R
009B20:  4F 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    OM..            
009B30:  20 20 20 20 20 20 20 20 44 45 46 42 20 30 20 20            DEFB 0  
009B40:  20 20 20 20 20 20 20 20 20 20 20 20 3B 4D 61 72                ;Mar
009B50:  6B 20 30 0D 0A 20 20 20 20 20 20 20 20 20 20 20    k 0..           
009B60:  20 20 20 20 20 20 20 20 20 44 45 46 42 20 35 20             DEFB 5 
009B70:  20 20 20 20 20 20 20 20 20 20 20 20 20 3B 56 65                 ;Ve
009B80:  72 73 69 6F 6E 20 35 0D 0A 20 20 20 20 20 20 20    rsion 5..       
009B90:  20 20 20 20 20 20 20 20 20 20 20 20 20 44 45 46                 DEF
009BA0:  42 20 30 20 20 20 20 20 20 20 20 20 20 20 20 20    B 0             
009BB0:  20 3B 4D 6F 64 69 66 69 63 61 74 69 6F 6E 20 30     ;Modification 0
009BC0:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
009BD0:  20 20 20 20 20 20 20 20 44 45 46 57 20 4E 41 4D            DEFW NAM
009BE0:  45 5F 54 41 42 4C 45 20 20 20 20 20 3B 41 64 64    E_TABLE     ;Add
009BF0:  72 65 73 73 20 6F 66 20 6E 61 6D 65 20 74 61 62    ress of name tab
009C00:  6C 65 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    le....          
009C10:  20 20 20 20 20 20 20 20 20 20 4A 50 20 45 4D 53              JP EMS
009C20:  5F 45 4E 54 52 59 20 20 20 20 20 20 20 20 3B 30    _ENTRY        ;0
009C30:  20 42 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 20     Background ROM 
009C40:  70 6F 77 65 72 2D 75 70 20 65 6E 74 72 79 0D 0A    power-up entry..
009C50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009C60:  20 20 20 20 4A 50 20 52 45 53 45 54 20 20 20 20        JP RESET    
009C70:  20 20 20 20 20 20 20 20 3B 31 0D 0A 20 20 20 20            ;1..    
009C80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009C90:  4A 50 20 53 45 54 5F 42 41 55 44 5F 52 41 54 45    JP SET_BAUD_RATE
009CA0:  20 20 20 20 3B 32 0D 0A 20 20 20 20 20 20 20 20        ;2..        
009CB0:  20 20 20 20 20 20 20 20 20 20 20 20 4A 50 20 47                JP G
009CC0:  45 54 5F 43 48 41 52 41 43 54 45 52 20 20 20 20    ET_CHARACTER    
009CD0:  3B 33 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ;3..            
009CE0:  20 20 20 20 20 20 20 20 4A 50 20 50 55 54 5F 43            JP PUT_C
009CF0:  48 41 52 41 43 54 45 52 20 20 20 20 3B 34 0D 0A    HARACTER    ;4..
009D00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009D10:  20 20 20 20 20 20 20 2E 2E 2E 65 74 63 0D 0A 0D           ...etc...
009D20:  0A 20 20 20 20 20 20 20 4E 41 4D 45 5F 54 41 42    .       NAME_TAB
009D30:  4C 45 3A 20 20 44 45 46 42 20 27 53 49 4F 20 44    LE:  DEFB 'SIO D
009D40:  52 49 56 45 27 2C 27 52 27 2B 23 38 30 20 20 20    RIVE','R'+#80   
009D50:  20 20 20 20 20 20 20 20 20 3B 30 0D 0A 20 20 20             ;0..   
009D60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009D70:  20 44 45 46 42 20 27 53 49 4F 2E 52 45 53 45 27     DEFB 'SIO.RESE'
009D80:  2C 27 54 27 2B 23 38 30 20 20 20 20 20 20 20 20    ,'T'+#80        
009D90:  20 20 20 20 20 3B 31 0D 0A 20 20 20 20 20 20 20         ;1..       
009DA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 44 45 46                 DEF
009DB0:  42 20 27 53 49 4F 2E 53 45 54 2E 42 41 55 27 2C    B 'SIO.SET.BAU',
009DC0:  27 44 27 2B 23 38 30 20 20 20 20 20 20 20 20 20    'D'+#80         
009DD0:  20 3B 32 0D 0A 20 20 20 20 20 20 20 20 20 20 20     ;2..           
009DE0:  20 20 20 20 20 20 20 20 20 44 45 46 42 20 27 53             DEFB 'S
009DF0:  49 4F 2E 47 45 54 2E 43 48 41 27 2C 27 52 27 2B    IO.GET.CHA','R'+
009E00:  23 38 30 20 20 20 20 20 20 20 20 20 20 3B 33 0D    #80          ;3.
009E10:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
009E20:  20 20 20 20 20 44 45 46 42 20 27 53 49 4F 2E 50         DEFB 'SIO.P
009E30:  55 54 2E 43 48 41 27 2C 27 52 27 2B 23 38 30 20    UT.CHA','R'+#80 
009E40:  20 20 20 20 20 20 20 20 20 3B 34 0D 0A 20 20 20             ;4..   
009E50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009E60:  20 20 20 20 20 20 20 2E 2E 2E 65 74 63 0D 0A 20           ...etc.. 
009E70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009E80:  20 20 20 44 45 46 42 20 30 20 20 20 20 20 20 20       DEFB 0       
009E90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009EA0:  20 20 20 20 20 20 20 3B 45 6E 64 20 6F 66 20 74           ;End of t
009EB0:  61 62 6C 65 20 6D 61 72 6B 65 72 0D 0A 0D 0A 0D    able marker.....
009EC0:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    .......       AM
009ED0:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
009EE0:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
009EF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
009F00:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
009F10:  31 30 2E 33 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    10.3............
009F20:  0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 20 74 68    ..       Note th
009F30:  61 74 20 74 68 65 20 63 6F 6D 6D 61 6E 64 20 6E    at the command n
009F40:  61 6D 65 20 74 61 62 6C 65 20 65 6E 74 72 79 20    ame table entry 
009F50:  66 6F 72 20 74 68 65 20 70 6F 77 65 72 2D 75 70    for the power-up
009F60:  20 65 6E 74 72 79 20 69 6E 63 6C 75 64 65 73 0D     entry includes.
009F70:  0A 20 20 20 20 20 20 20 61 20 73 70 61 63 65 2E    .       a space.
009F80:  20 54 68 69 73 20 69 73 20 73 74 69 6C 6C 20 61     This is still a
009F90:  20 6C 65 67 61 6C 20 6E 61 6D 65 20 62 75 74 20     legal name but 
009FA0:  74 68 65 20 42 41 53 49 43 20 77 69 6C 6C 20 6E    the BASIC will n
009FB0:  65 76 65 72 20 20 62 65 20 20 61 62 6C 65 0D 0A    ever  be  able..
009FC0:  20 20 20 20 20 20 20 74 6F 20 67 65 6E 65 72 61           to genera
009FD0:  74 65 20 69 74 20 62 65 63 61 75 73 65 20 6F 66    te it because of
009FE0:  20 74 68 65 20 77 61 79 20 69 74 20 75 73 65 73     the way it uses
009FF0:  20 73 70 61 63 65 73 2E 20 42 65 63 61 75 73 65     spaces. Because
00A000:  20 42 41 53 49 43 20 63 61 6E 6E 6F 74 0D 0A 20     BASIC cannot.. 
00A010:  20 20 20 20 20 20 67 65 6E 65 72 61 74 65 20 74          generate t
00A020:  68 65 20 6E 61 6D 65 20 69 74 20 69 73 20 69 6D    he name it is im
00A030:  70 6F 73 73 69 62 6C 65 20 20 66 6F 72 20 20 61    possible  for  a
00A040:  20 20 42 41 53 49 43 20 20 75 73 65 72 20 20 74      BASIC  user  t
00A050:  6F 20 20 63 61 6C 6C 20 20 74 68 65 0D 0A 20 20    o  call  the..  
00A060:  20 20 20 20 20 70 6F 77 65 72 2D 75 70 20 65 6E         power-up en
00A070:  74 72 79 20 62 79 20 6D 69 73 74 61 6B 65 20 28    try by mistake (
00A080:  73 65 65 20 73 65 63 74 69 6F 6E 20 31 30 2E 34    see section 10.4
00A090:  29 0D 0A 0D 0A 20 20 20 20 20 20 20 31 30 2E 33    )....       10.3
00A0A0:  20 46 6F 72 65 67 72 6F 75 6E 64 20 52 4F 4D 73     Foreground ROMs
00A0B0:  20 61 6E 64 20 52 41 4D 20 50 72 6F 67 72 61 6D     and RAM Program
00A0C0:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 61 63    s.....       Eac
00A0D0:  68 20 6F 66 20 74 68 65 20 65 6E 74 72 69 65 73    h of the entries
00A0E0:  20 74 6F 20 74 68 65 20 66 6F 72 65 67 72 6F 75     to the foregrou
00A0F0:  6E 64 20 52 4F 4D 20 69 73 20 65 78 70 65 63 74    nd ROM is expect
00A100:  65 64 20 74 6F 20 20 72 65 70 72 65 73 65 6E 74    ed to  represent
00A110:  20 20 61 0D 0A 20 20 20 20 20 20 20 73 65 70 61      a..       sepa
00A120:  72 61 74 65 20 70 72 6F 67 72 61 6D 2C 20 77 68    rate program, wh
00A130:  6F 73 65 20 6E 61 6D 65 20 69 73 20 67 69 76 65    ose name is give
00A140:  6E 20 62 79 20 74 68 65 20 20 63 6F 72 72 65 73    n by the  corres
00A150:  70 6F 6E 64 69 6E 67 20 20 65 6E 74 72 79 20 20    ponding  entry  
00A160:  69 6E 0D 0A 20 20 20 20 20 20 20 74 68 65 20 6E    in..       the n
00A170:  61 6D 65 20 74 61 62 6C 65 2E 20 54 68 65 20 66    ame table. The f
00A180:  69 72 73 74 20 65 6E 74 72 79 20 6F 66 20 52 4F    irst entry of RO
00A190:  4D 20 30 20 69 73 20 74 68 65 20 64 65 66 61 75    M 0 is the defau
00A1A0:  6C 74 20 70 6F 77 65 72 2D 75 70 20 65 6E 74 72    lt power-up entr
00A1B0:  79 0D 0A 20 20 20 20 20 20 20 70 6F 69 6E 74 20    y..       point 
00A1C0:  61 74 20 74 68 65 20 65 6E 64 20 6F 66 20 45 4D    at the end of EM
00A1D0:  53 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4F 6E 63    S.....       Onc
00A1E0:  65 20 61 20 52 41 4D 20 20 70 72 6F 67 72 61 6D    e a RAM  program
00A1F0:  20 20 68 61 73 20 20 62 65 65 6E 20 20 6C 6F 61      has  been  loa
00A200:  64 65 64 20 20 69 74 20 20 69 73 20 20 74 72 65    ded  it  is  tre
00A210:  61 74 65 64 20 20 6D 75 63 68 20 20 6C 69 6B 65    ated  much  like
00A220:  20 20 61 0D 0A 20 20 20 20 20 20 20 66 6F 72 65      a..       fore
00A230:  67 72 6F 75 6E 64 20 52 4F 4D 2C 20 65 78 63 65    ground ROM, exce
00A240:  70 74 20 74 68 61 74 20 69 74 20 64 6F 65 73 20    pt that it does 
00A250:  6E 6F 74 20 68 61 76 65 20 61 20 20 52 4F 4D 20    not have a  ROM 
00A260:  20 70 72 65 66 69 78 2C 20 20 61 6E 64 20 20 74     prefix,  and  t
00A270:  68 65 0D 0A 20 20 20 20 20 20 20 72 65 71 75 69    he..       requi
00A280:  72 65 64 20 65 6E 74 72 79 20 70 6F 69 6E 74 20    red entry point 
00A290:  69 73 20 64 65 74 65 72 6D 69 6E 65 64 20 73 65    is determined se
00A2A0:  70 61 72 61 74 65 6C 79 2E 0D 0A 0D 0A 20 20 20    parately.....   
00A2B0:  20 20 20 20 4A 75 73 74 20 62 65 66 6F 72 65 20        Just before 
00A2C0:  61 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F    a foreground pro
00A2D0:  67 72 61 6D 20 69 73 20 65 6E 74 65 72 65 64 20    gram is entered 
00A2E0:  74 68 65 20 6D 61 63 68 69 6E 65 20 20 69 73 20    the machine  is 
00A2F0:  20 72 65 73 65 74 20 20 74 6F 0D 0A 20 20 20 20     reset  to..    
00A300:  20 20 20 69 74 73 20 45 4D 53 20 73 74 61 74 65       its EMS state
00A310:  3B 20 20 69 2E 65 2E 20 20 61 6C 6C 20 20 74 68    ;  i.e.  all  th
00A320:  65 20 20 68 61 72 64 77 61 72 65 20 20 61 6E 64    e  hardware  and
00A330:  20 20 61 6C 6C 20 20 74 68 65 20 20 66 69 72 6D      all  the  firm
00A340:  77 61 72 65 20 20 61 72 65 0D 0A 20 20 20 20 20    ware  are..     
00A350:  20 20 69 6E 69 74 69 61 6C 69 7A 65 64 2E 20 54      initialized. T
00A360:  68 65 20 65 6E 76 69 72 6F 6E 6D 65 6E 74 20 61    he environment a
00A370:  6E 64 20 65 6E 74 72 79 20 63 6F 6E 64 69 74 69    nd entry conditi
00A380:  6F 6E 73 20 61 72 65 20 61 73 20 66 6F 6C 6C 6F    ons are as follo
00A390:  77 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4D 65    ws:....       Me
00A3A0:  6D 6F 72 79 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    mory:....       
00A3B0:  20 20 20 53 65 63 74 69 6F 6E 20 32 20 64 65 73       Section 2 des
00A3C0:  63 72 69 62 65 73 20 74 68 65 20 6D 65 6D 6F 72    cribes the memor
00A3D0:  79 20 6C 61 79 6F 75 74 20 6F 66 20 74 68 65 20    y layout of the 
00A3E0:  73 79 73 74 65 6D 2E 20 54 68 72 65 65 20 61 72    system. Three ar
00A3F0:  65 61 73 20 6F 66 0D 0A 20 20 20 20 20 20 20 20    eas of..        
00A400:  20 20 6D 65 6D 6F 72 79 20 61 72 65 20 61 76 61      memory are ava
00A410:  69 6C 61 62 6C 65 20 74 6F 20 74 68 65 20 70 72    ilable to the pr
00A420:  6F 67 72 61 6D 2E 0D 0A 0D 0A 20 20 20 20 20 20    ogram.....      
00A430:  20 20 20 20 31 2E 20 54 68 65 20 53 74 61 74 69        1. The Stati
00A440:  63 20 56 61 72 69 61 62 6C 65 20 41 72 65 61 2E    c Variable Area.
00A450:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 54 68    ....          Th
00A460:  65 20 61 72 65 61 20 66 72 6F 6D 20 23 41 43 30    e area from #AC0
00A470:  30 20 74 6F 20 23 42 30 46 46 20 69 6E 63 6C 75    0 to #B0FF inclu
00A480:  73 69 76 65 20 69 73 20 72 65 73 65 72 76 65 64    sive is reserved
00A490:  20 66 6F 72 20 75 73 65 20 20 62 79 20 20 74 68     for use  by  th
00A4A0:  65 0D 0A 20 20 20 20 20 20 20 20 20 20 66 6F 72    e..          for
00A4B0:  65 67 72 6F 75 6E 64 20 70 72 6F 67 72 61 6D 20    eground program 
00A4C0:  2D 20 61 6C 74 68 6F 75 67 68 20 20 69 74 20 20    - although  it  
00A4D0:  6D 61 79 20 20 75 73 65 20 20 6D 6F 72 65 20 20    may  use  more  
00A4E0:  6F 72 20 20 6C 65 73 73 20 20 61 73 20 20 69 74    or  less  as  it
00A4F0:  0D 0A 20 20 20 20 20 20 20 20 20 20 72 65 71 75    ..          requ
00A500:  69 72 65 73 2E 20 49 74 20 69 73 20 61 6C 73 6F    ires. It is also
00A510:  20 70 6F 73 73 69 62 6C 65 20 74 6F 20 72 65 73     possible to res
00A520:  65 72 76 65 20 20 61 20 20 66 6F 72 65 67 72 6F    erve  a  foregro
00A530:  75 6E 64 20 20 64 61 74 61 20 20 61 72 65 61 0D    und  data  area.
00A540:  0A 20 20 20 20 20 20 20 20 20 20 73 74 61 72 74    .          start
00A550:  69 6E 67 20 61 74 20 23 30 30 34 30 20 69 66 20    ing at #0040 if 
00A560:  74 68 69 73 20 69 73 20 72 65 71 75 69 72 65 64    this is required
00A570:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 32    .....          2
00A580:  2E 20 54 68 65 20 53 74 61 63 6B 2E 0D 0A 0D 0A    . The Stack.....
00A590:  20 20 20 20 20 20 20 20 20 20 54 68 65 20 68 61              The ha
00A5A0:  72 64 77 61 72 65 20 73 74 61 63 6B 20 69 73 20    rdware stack is 
00A5B0:  73 65 74 20 74 6F 20 61 6E 20 61 72 65 61 20 69    set to an area i
00A5C0:  6D 6D 65 64 69 61 74 65 6C 79 20 62 65 6C 6F 77    mmediately below
00A5D0:  20 23 43 30 30 30 20 20 77 68 69 63 68 0D 0A 20     #C000  which.. 
00A5E0:  20 20 20 20 20 20 20 20 20 69 73 20 61 74 20 6C             is at l
00A5F0:  65 61 73 74 20 32 35 36 20 62 79 74 65 73 20 6C    east 256 bytes l
00A600:  6F 6E 67 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ong.....        
00A610:  20 20 33 2E 20 54 68 65 20 4D 61 69 6E 20 4D 65      3. The Main Me
00A620:  6D 6F 72 79 20 50 6F 6F 6C 2E 0D 0A 0D 0A 20 20    mory Pool.....  
00A630:  20 20 20 20 20 20 20 20 4D 6F 73 74 20 6F 66 20            Most of 
00A640:  74 68 65 20 72 65 73 74 20 6F 66 20 6D 65 6D 6F    the rest of memo
00A650:  72 79 20 77 69 6C 6C 20 20 62 65 20 20 61 76 61    ry will  be  ava
00A660:  69 6C 61 62 6C 65 20 20 74 6F 20 20 74 68 65 20    ilable  to  the 
00A670:  20 66 6F 72 65 67 72 6F 75 6E 64 0D 0A 20 20 20     foreground..   
00A680:  20 20 20 20 20 20 20 70 72 6F 67 72 61 6D 2C 20           program, 
00A690:  64 65 70 65 6E 64 69 6E 67 20 6F 6E 20 77 68 61    depending on wha
00A6A0:  74 20 6D 65 6D 6F 72 79 20 69 73 20 74 61 6B 65    t memory is take
00A6B0:  6E 20 62 79 20 61 6E 79 20 20 62 61 63 6B 67 72    n by any  backgr
00A6C0:  6F 75 6E 64 20 20 52 4F 4D 73 0D 0A 20 20 20 20    ound  ROMs..    
00A6D0:  20 20 20 20 20 20 77 68 69 63 68 20 74 68 65 20          which the 
00A6E0:  66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67 72    foreground progr
00A6F0:  61 6D 20 63 68 6F 6F 73 65 73 20 74 6F 20 69 6E    am chooses to in
00A700:  69 74 69 61 6C 69 7A 65 2E 0D 0A 0D 0A 0D 0A 20    itialize....... 
00A710:  20 20 20 20 20 20 52 65 67 69 73 74 65 72 73 3A          Registers:
00A720:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ......          
00A730:  54 68 65 20 62 61 73 65 20 61 6E 64 20 6C 69 6D    The base and lim
00A740:  69 74 20 6F 66 20 74 68 65 20 20 66 72 65 65 20    it of the  free 
00A750:  20 6D 65 6D 6F 72 79 20 20 61 72 65 61 20 20 61     memory  area  a
00A760:  72 65 20 20 70 61 73 73 65 64 20 20 74 6F 20 20    re  passed  to  
00A770:  74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 70    the..          p
00A780:  72 6F 67 72 61 6D 20 69 6E 20 72 65 67 69 73 74    rogram in regist
00A790:  65 72 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ers.......      
00A7A0:  20 20 20 20 42 43 20 3D 20 41 64 64 72 65 73 73        BC = Address
00A7B0:  20 6F 66 20 74 68 65 20 68 69 67 68 65 73 74 20     of the highest 
00A7C0:  75 73 61 62 6C 65 20 62 79 74 65 20 69 6E 20 6D    usable byte in m
00A7D0:  65 6D 6F 72 79 2E 20 28 23 42 30 46 46 29 0D 0A    emory. (#B0FF)..
00A7E0:  20 20 20 20 20 20 20 20 20 20 44 45 20 3D 20 41              DE = A
00A7F0:  64 64 72 65 73 73 20 6F 66 20 74 68 65 20 6C 6F    ddress of the lo
00A800:  77 65 73 74 20 75 73 61 62 6C 65 20 62 79 74 65    west usable byte
00A810:  20 69 6E 20 74 68 65 20 6D 65 6D 6F 72 79 20 70     in the memory p
00A820:  6F 6F 6C 2E 20 28 23 30 30 34 30 29 0D 0A 20 20    ool. (#0040)..  
00A830:  20 20 20 20 20 20 20 20 48 4C 20 3D 20 41 64 64            HL = Add
00A840:  72 65 73 73 20 6F 66 20 74 68 65 20 68 69 67 68    ress of the high
00A850:  65 73 74 20 62 79 74 65 20 69 6E 20 74 68 65 20    est byte in the 
00A860:  6D 65 6D 6F 72 79 20 70 6F 6F 6C 2E 20 28 23 41    memory pool. (#A
00A870:  42 46 46 29 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    BFF)..........  
00A880:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
00A890:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
00A8A0:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
00A8B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00A8C0:  20 20 70 61 67 65 20 31 30 2E 34 0D 0A 0D 0A 0D      page 10.4.....
00A8D0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
00A8E0:  4E 6F 74 65 20 74 68 61 74 20 74 68 65 20 70 72    Note that the pr
00A8F0:  6F 67 72 61 6D 20 69 73 20 66 72 65 65 20 74 6F    ogram is free to
00A900:  20 75 73 65 20 61 6E 79 20 6D 65 6D 6F 72 79 20     use any memory 
00A910:  20 62 65 74 77 65 65 6E 20 20 74 68 65 20 20 61     between  the  a
00A920:  64 64 72 65 73 73 0D 0A 20 20 20 20 20 20 20 67    ddress..       g
00A930:  69 76 65 6E 20 69 6E 20 44 45 20 61 6E 64 20 74    iven in DE and t
00A940:  68 65 20 61 64 64 72 65 73 73 20 69 6E 20 42 43    he address in BC
00A950:  20 69 6E 63 6C 75 73 69 76 65 20 28 69 2E 65 2E     inclusive (i.e.
00A960:  20 23 30 30 34 30 20 74 6F 20 23 42 30 46 46 29     #0040 to #B0FF)
00A970:  2E 20 54 68 65 0D 0A 20 20 20 20 20 20 20 63 6F    . The..       co
00A980:  6E 74 65 6E 74 73 20 6F 66 20 48 4C 20 72 65 66    ntents of HL ref
00A990:  6C 65 63 74 20 74 68 65 20 73 74 61 6E 64 61 72    lect the standar
00A9A0:  64 20 61 6C 6C 6F 63 61 74 69 6F 6E 20 66 6F 72    d allocation for
00A9B0:  20 20 73 74 61 74 69 63 20 20 76 61 72 69 61 62      static  variab
00A9C0:  6C 65 73 3B 0D 0A 20 20 20 20 20 20 20 74 68 65    les;..       the
00A9D0:  20 70 72 6F 67 72 61 6D 20 69 73 20 66 72 65 65     program is free
00A9E0:  20 74 6F 20 75 73 65 20 6D 6F 72 65 2C 20 6F 72     to use more, or
00A9F0:  20 6C 65 73 73 2C 20 61 73 20 74 68 65 20 6D 6F     less, as the mo
00AA00:  6F 64 20 74 61 6B 65 73 20 69 74 2E 20 41 6C 73    od takes it. Als
00AA10:  6F 20 61 0D 0A 20 20 20 20 20 20 20 66 6F 72 65    o a..       fore
00AA20:  67 72 6F 75 6E 64 20 64 61 74 61 20 61 72 65 61    ground data area
00AA30:  20 6D 61 79 20 62 65 20 72 65 73 65 72 76 65 64     may be reserved
00AA40:  20 61 74 20 74 68 65 20 62 6F 74 74 6F 6D 20 6F     at the bottom o
00AA50:  66 20 73 74 6F 72 65 20 20 61 73 20 20 77 65 6C    f store  as  wel
00AA60:  6C 2E 0D 0A 20 20 20 20 20 20 20 54 68 65 20 70    l...       The p
00AA70:  72 6F 67 72 61 6D 20 73 68 6F 75 6C 64 20 73 65    rogram should se
00AA80:  74 20 48 4C 20 61 6E 64 20 44 45 20 74 6F 20 72    t HL and DE to r
00AA90:  65 66 6C 65 63 74 20 74 68 65 20 61 72 65 61 20    eflect the area 
00AAA0:  69 74 20 69 73 20 20 75 73 69 6E 67 20 20 66 6F    it is  using  fo
00AAB0:  72 0D 0A 20 20 20 20 20 20 20 76 61 72 69 61 62    r..       variab
00AAC0:  6C 65 73 20 62 65 66 6F 72 65 20 69 6E 69 74 69    les before initi
00AAD0:  61 6C 69 7A 69 6E 67 20 61 6E 79 20 62 61 63 6B    alizing any back
00AAE0:  67 72 6F 75 6E 64 20 52 4F 4D 73 20 28 73 65 65    ground ROMs (see
00AAF0:  20 62 65 6C 6F 77 29 2E 0D 0A 0D 0A 20 20 20 20     below).....    
00AB00:  20 20 20 53 50 20 69 73 20 73 65 74 20 74 6F 20       SP is set to 
00AB10:  74 68 65 20 6D 61 63 68 69 6E 65 20 70 72 6F 76    the machine prov
00AB20:  69 64 65 64 20 61 72 65 61 20 23 43 30 30 30 2E    ided area #C000.
00AB30:  20 54 68 65 20 70 72 6F 67 72 61 6D 20 20 63 61     The program  ca
00AB40:  6E 20 20 64 65 70 65 6E 64 0D 0A 20 20 20 20 20    n  depend..     
00AB50:  20 20 6F 6E 20 61 74 20 6C 65 61 73 74 20 32 35      on at least 25
00AB60:  36 20 62 79 74 65 73 20 6F 66 20 73 74 61 63 6B    6 bytes of stack
00AB70:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
00AB80:  63 6F 6E 74 65 6E 74 73 20 6F 66 20 74 68 65 20    contents of the 
00AB90:  6F 74 68 65 72 20 72 65 67 69 73 74 65 72 73 20    other registers 
00ABA0:  69 73 20 69 6E 64 65 74 65 72 6D 69 6E 61 74 65    is indeterminate
00ABB0:  2E 20 20 4E 6F 74 65 20 20 74 68 61 74 20 20 74    .  Note  that  t
00ABC0:  68 65 0D 0A 20 20 20 20 20 20 20 61 6C 74 65 72    he..       alter
00ABD0:  6E 61 74 65 20 72 65 67 69 73 74 65 72 20 73 65    nate register se
00ABE0:  74 20 28 41 46 27 20 42 43 27 20 44 45 27 20 20    t (AF' BC' DE'  
00ABF0:  48 4C 27 29 20 20 69 73 20 20 6E 6F 74 20 20 61    HL')  is  not  a
00AC00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
00AC10:  09 00 00 00 02 09 50 E5 09 00 C1 02 00 00 00 02    ......P.........
00AC20:  09 00 C2 02 00 00 00 02 09 00 C3 02 00 00 00 02    ................
00AC30:  09 00 C4 02 00 00 00 02 09 00 C5 02 00 00 00 02    ................
00AC40:  09 00 C6 02 00 00 00 02 09 00 C7 02 00 00 00 02    ................
00AC50:  09 00 C8 02 00 00 00 02 09 00 C9 02 00 00 00 02    ................
00AC60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00AC70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00AC80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00AC90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00ACF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00AD00:  76 61 69 6C 61 62 6C 65 20 20 74 6F 20 20 74 68    vailable  to  th
00AD10:  65 0D 0A 20 20 20 20 20 20 20 70 72 6F 67 72 61    e..       progra
00AD20:  6D 2E 20 28 42 75 74 20 73 65 65 20 41 70 70 65    m. (But see Appe
00AD30:  6E 64 69 78 20 58 49 29 2E 0D 0A 0D 0A 20 20 20    ndix XI).....   
00AD40:  20 20 20 20 52 4F 4D 20 73 65 6C 65 63 74 20 73        ROM select s
00AD50:  74 61 74 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    tate:....       
00AD60:  20 20 20 20 20 20 20 20 20 46 6F 72 20 52 4F 4D             For ROM
00AD70:  20 70 72 6F 67 72 61 6D 73 3A 20 20 20 20 20 20     programs:      
00AD80:  20 54 68 65 20 66 6F 72 65 67 72 6F 75 6E 64 20     The foreground 
00AD90:  52 4F 4D 20 69 73 20 73 65 6C 65 63 74 65 64 2E    ROM is selected.
00ADA0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
00ADB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00ADC0:  20 20 20 20 20 20 20 20 20 20 54 68 65 20 75 70              The up
00ADD0:  70 65 72 20 52 4F 4D 20 69 73 20 65 6E 61 62 6C    per ROM is enabl
00ADE0:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ed.....         
00ADF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AE00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54                   T
00AE10:  68 65 20 6C 6F 77 65 72 20 52 4F 4D 20 69 73 20    he lower ROM is 
00AE20:  64 69 73 61 62 6C 65 64 2E 0D 0A 0D 0A 20 20 20    disabled.....   
00AE30:  20 20 20 20 20 20 20 20 20 20 20 20 20 46 6F 72                 For
00AE40:  20 52 41 4D 20 70 72 6F 67 72 61 6D 73 3A 20 20     RAM programs:  
00AE50:  20 20 20 20 20 4E 6F 20 52 4F 4D 20 69 73 20 73         No ROM is s
00AE60:  65 6C 65 63 74 65 64 2E 0D 0A 20 20 20 20 20 20    elected...      
00AE70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AE80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AE90:  20 20 54 68 65 20 75 70 70 65 72 20 52 4F 4D 20      The upper ROM 
00AEA0:  69 73 20 64 69 73 61 62 6C 65 64 0D 0A 20 20 20    is disabled..   
00AEB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AEC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AED0:  20 20 20 20 20 54 68 65 20 6C 6F 77 65 72 20 52         The lower R
00AEE0:  4F 4D 20 69 73 20 64 69 73 61 62 6C 65 64 2E 0D    OM is disabled..
00AEF0:  0A 0D 0A 20 20 20 20 20 20 20 47 65 6E 65 72 61    ...       Genera
00AF00:  6C 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    l:....          
00AF10:  20 20 20 20 20 20 49 6E 74 65 72 72 75 70 74 73          Interrupts
00AF20:  20 61 72 65 20 65 6E 61 62 6C 65 64 2E 0D 0A 0D     are enabled....
00AF30:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
00AF40:  20 41 6C 6C 20 68 61 72 64 77 61 72 65 20 20 61     All hardware  a
00AF50:  6E 64 20 20 66 69 72 6D 77 61 72 65 20 20 69 73    nd  firmware  is
00AF60:  20 20 69 6E 20 20 69 74 73 20 20 69 6E 69 74 69      in  its  initi
00AF70:  61 6C 20 20 73 74 61 74 65 2E 20 20 49 6E 0D 0A    al  state.  In..
00AF80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00AF90:  70 61 72 74 69 63 75 6C 61 72 20 61 6E 79 20 65    particular any e
00AFA0:  78 70 61 6E 73 69 6F 6E 20 64 65 76 69 63 65 73    xpansion devices
00AFB0:  20 66 69 74 74 65 64 20 68 61 76 65 20 62 65 65     fitted have bee
00AFC0:  6E 20 72 65 73 65 74 2C 20 20 62 75 74 0D 0A 20    n reset,  but.. 
00AFD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6E                   n
00AFE0:  6F 74 20 79 65 74 20 69 6E 69 74 69 61 6C 69 7A    ot yet initializ
00AFF0:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49 74    ed.....       It
00B000:  20 69 73 20 20 74 68 65 20 20 66 6F 72 65 67 72     is  the  foregr
00B010:  6F 75 6E 64 20 20 70 72 6F 67 72 61 6D 27 73 20    ound  program's 
00B020:  20 72 65 73 70 6F 6E 73 69 62 69 6C 69 74 79 20     responsibility 
00B030:  20 74 6F 20 20 69 6E 69 74 69 61 6C 69 7A 65 20     to  initialize 
00B040:  20 61 6E 79 0D 0A 20 20 20 20 20 20 20 62 61 63     any..       bac
00B050:  6B 67 72 6F 75 6E 64 20 52 4F 4D 73 20 72 65 71    kground ROMs req
00B060:  75 69 72 65 64 20 61 6E 64 20 74 6F 20 6C 6F 61    uired and to loa
00B070:  64 20 20 61 6E 64 20 20 69 6E 69 74 69 61 6C 69    d  and  initiali
00B080:  7A 65 20 20 61 6E 79 20 20 52 53 58 73 2E 20 20    ze  any  RSXs.  
00B090:  54 68 65 0D 0A 20 20 20 20 20 20 20 4B 65 72 6E    The..       Kern
00B0A0:  65 6C 20 65 6E 74 72 79 20 27 4B 4C 20 52 4F 4D    el entry 'KL ROM
00B0B0:  20 57 41 4C 4B 27 20 6C 6F 6F 6B 73 20 66 6F 72     WALK' looks for
00B0C0:  20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 73     background ROMs
00B0D0:  20 20 61 6E 64 20 20 69 6E 69 74 69 61 6C 69 7A      and  initializ
00B0E0:  65 73 0D 0A 20 20 20 20 20 20 20 61 6E 79 20 74    es..       any t
00B0F0:  68 61 74 20 69 74 20 66 69 6E 64 73 2E 20 54 68    hat it finds. Th
00B100:  65 20 4B 65 72 6E 65 6C 20 65 6E 74 72 79 20 27    e Kernel entry '
00B110:  4B 4C 20 49 4E 49 54 20 42 41 43 4B 27 20 77 69    KL INIT BACK' wi
00B120:  6C 6C 20 20 69 6E 69 74 69 61 6C 69 7A 65 20 20    ll  initialize  
00B130:  61 0D 0A 20 20 20 20 20 20 20 70 61 72 74 69 63    a..       partic
00B140:  75 6C 61 72 20 62 61 63 6B 67 72 6F 75 6E 64 20    ular background 
00B150:  52 4F 4D 2E 20 54 68 65 73 65 20 65 6E 74 72 69    ROM. These entri
00B160:  65 73 20 6D 75 73 74 20 62 65 20 70 61 73 73 65    es must be passe
00B170:  64 20 74 68 65 20 20 61 64 64 72 65 73 73 65 73    d the  addresses
00B180:  0D 0A 20 20 20 20 20 20 20 6F 66 20 74 68 65 20    ..       of the 
00B190:  6C 6F 77 65 73 74 20 61 6E 64 20 68 69 67 68 65    lowest and highe
00B1A0:  73 74 20 62 79 74 65 73 20 69 6E 20 74 68 65 20    st bytes in the 
00B1B0:  6D 65 6D 6F 72 79 20 70 6F 6F 6C 20 77 68 69 63    memory pool whic
00B1C0:  68 20 20 69 73 20 20 77 68 79 20 20 74 68 65 0D    h  is  why  the.
00B1D0:  0A 20 20 20 20 20 20 20 66 6F 72 65 67 72 6F 75    .       foregrou
00B1E0:  6E 64 20 70 72 6F 67 72 61 6D 20 6D 75 73 74 20    nd program must 
00B1F0:  72 65 73 65 72 76 65 20 69 74 73 20 66 69 78 65    reserve its fixe
00B200:  64 20 64 61 74 61 20 61 72 65 61 20 62 65 66 6F    d data area befo
00B210:  72 65 20 77 69 6E 64 69 6E 67 20 20 75 70 0D 0A    re winding  up..
00B220:  20 20 20 20 20 20 20 74 68 65 20 62 61 63 6B 67           the backg
00B230:  72 6F 75 6E 64 20 52 4F 4D 73 2E 20 54 68 65 20    round ROMs. The 
00B240:  62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 73 20    background ROMs 
00B250:  6D 61 79 20 61 6C 6C 6F 63 61 74 65 20 6D 65 6D    may allocate mem
00B260:  6F 72 79 20 66 6F 72 20 74 68 65 69 72 0D 0A 20    ory for their.. 
00B270:  20 20 20 20 20 20 6F 77 6E 20 75 73 65 20 62 79          own use by
00B280:  20 6D 6F 76 69 6E 67 20 20 65 69 74 68 65 72 20     moving  either 
00B290:  20 6F 72 20 20 62 6F 74 68 20 20 62 6F 75 6E 64     or  both  bound
00B2A0:  61 72 69 65 73 2E 20 20 49 66 2C 20 20 74 68 65    aries.  If,  the
00B2B0:  72 65 66 6F 72 65 2C 20 20 74 68 65 0D 0A 20 20    refore,  the..  
00B2C0:  20 20 20 20 20 66 6F 72 65 67 72 6F 75 6E 64 20         foreground 
00B2D0:  70 72 6F 67 72 61 6D 20 64 6F 65 73 20 61 6C 6C    program does all
00B2E0:  6F 77 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F    ow background RO
00B2F0:  4D 73 20 74 6F 20 66 75 6E 63 74 69 6F 6E 20 69    Ms to function i
00B300:  74 20 6D 75 73 74 20 63 6F 70 65 0D 0A 20 20 20    t must cope..   
00B310:  20 20 20 20 77 69 74 68 20 61 20 6D 65 6D 6F 72        with a memor
00B320:  79 20 70 6F 6F 6C 20 20 77 68 69 6C 73 74 20 20    y pool  whilst  
00B330:  62 6F 75 6E 64 73 20 20 61 72 65 20 20 6E 6F 74    bounds  are  not
00B340:  20 20 66 69 78 65 64 20 20 75 6E 74 69 6C 20 20      fixed  until  
00B350:  61 66 74 65 72 20 20 61 6C 6C 0D 0A 20 20 20 20    after  all..    
00B360:  20 20 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F       background RO
00B370:  4D 73 20 68 61 76 65 20 62 65 65 6E 20 69 6E 69    Ms have been ini
00B380:  74 69 61 6C 69 7A 65 64 2E 20 4E 6F 74 65 20 74    tialized. Note t
00B390:  68 61 74 20 74 68 65 20 6C 6F 63 61 74 69 6F 6E    hat the location
00B3A0:  20 20 6F 66 20 20 74 68 65 0D 0A 20 20 20 20 20      of  the..     
00B3B0:  20 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F      foreground pro
00B3C0:  67 72 61 6D 27 73 20 64 61 74 61 20 61 72 65 61    gram's data area
00B3D0:  73 20 61 72 65 20 66 69 78 65 64 20 77 68 69 6C    s are fixed whil
00B3E0:  73 74 20 61 20 62 61 63 6B 67 72 6F 75 6E 64 20    st a background 
00B3F0:  20 70 72 6F 67 72 61 6D 0D 0A 20 20 20 20 20 20     program..      
00B400:  20 6D 75 73 74 20 64 65 61 6C 20 77 69 74 68 20     must deal with 
00B410:  76 61 72 69 61 62 6C 65 20 64 61 74 61 20 61 72    variable data ar
00B420:  65 61 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49    eas.....       I
00B430:  66 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D    f background ROM
00B440:  73 20 61 72 65 20 6E 6F 74 20 69 6E 69 74 69 61    s are not initia
00B450:  6C 69 7A 65 64 20 74 68 65 6E 20 74 68 65 20 20    lized then the  
00B460:  6D 65 6D 6F 72 79 20 20 6D 61 70 20 20 69 73 20    memory  map  is 
00B470:  20 76 65 72 79 0D 0A 20 20 20 20 20 20 20 73 69     very..       si
00B480:  6D 70 6C 65 2C 20 62 75 74 20 73 69 6E 63 65 20    mple, but since 
00B490:  64 69 73 63 73 2C 20 6C 69 67 68 74 20 70 65 6E    discs, light pen
00B4A0:  73 2C 20 65 74 63 20 61 72 65 20 6C 69 6B 65 6C    s, etc are likel
00B4B0:  79 20 74 6F 20 75 73 65 20 20 62 61 63 6B 67 72    y to use  backgr
00B4C0:  6F 75 6E 64 0D 0A 20 20 20 20 20 20 20 52 4F 4D    ound..       ROM
00B4D0:  73 20 20 66 6F 72 20 20 73 75 70 70 6F 72 74 20    s  for  support 
00B4E0:  20 73 6F 66 74 77 61 72 65 20 20 69 74 20 20 69     software  it  i
00B4F0:  73 20 20 72 61 74 68 65 72 20 20 6C 69 6D 69 74    s  rather  limit
00B500:  69 6E 67 20 20 6E 6F 74 20 20 74 6F 20 20 61 6C    ing  not  to  al
00B510:  6C 6F 77 0D 0A 20 20 20 20 20 20 20 62 61 63 6B    low..       back
00B520:  67 72 6F 75 6E 64 20 52 4F 4D 73 20 65 76 65 6E    ground ROMs even
00B530:  20 66 6F 72 20 61 6E 20 61 70 70 61 72 65 6E 74     for an apparent
00B540:  6C 79 20 27 64 65 64 69 63 61 74 65 64 27 20 67    ly 'dedicated' g
00B550:  61 6D 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54    ame.....       T
00B560:  68 65 20 6F 6E 2D 62 6F 61 72 64 20 42 41 53 49    he on-board BASI
00B570:  43 20 69 6E 69 74 69 61 6C 69 7A 65 73 20 61 6C    C initializes al
00B580:  6C 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D    l background ROM
00B590:  73 20 61 74 20 20 45 4D 53 2E 20 20 54 68 65 20    s at  EMS.  The 
00B5A0:  20 75 73 65 72 0D 0A 20 20 20 20 20 20 20 63 68     user..       ch
00B5B0:  6F 6F 73 65 73 20 77 68 65 74 68 65 72 20 74 6F    ooses whether to
00B5C0:  20 6C 6F 61 64 20 61 6E 79 20 52 53 58 73 20 66     load any RSXs f
00B5D0:  72 6F 6D 20 74 61 70 65 2E 0D 0A 0D 0A 0D 0A 0D    rom tape........
00B5E0:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
00B5F0:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
00B600:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
00B610:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00B620:  20 20 20 70 61 67 65 20 31 30 2E 35 0D 0A 0D 0A       page 10.5....
00B630:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
00B640:  20 31 30 2E 34 20 42 61 63 6B 67 72 6F 75 6E 64     10.4 Background
00B650:  20 52 4F 4D 73 2E 0D 0A 0D 0A 20 20 20 20 20 20     ROMs.....      
00B660:  20 42 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 73     Background ROMs
00B670:  20 20 6C 69 65 20 20 64 6F 72 6D 61 6E 74 20 20      lie  dormant  
00B680:  75 6E 74 69 6C 20 20 69 6E 69 74 69 61 6C 69 7A    until  initializ
00B690:  65 64 20 20 62 79 20 20 74 68 65 20 20 66 6F 72    ed  by  the  for
00B6A0:  65 67 72 6F 75 6E 64 0D 0A 20 20 20 20 20 20 20    eground..       
00B6B0:  70 72 6F 67 72 61 6D 2E 20 44 75 72 69 6E 67 20    program. During 
00B6C0:  69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 20 74    initialization t
00B6D0:  68 65 20 62 61 63 6B 67 72 6F 75 6E 64 20 20 73    he background  s
00B6E0:  6F 66 74 77 61 72 65 20 20 6D 61 79 20 20 61 6C    oftware  may  al
00B6F0:  6C 6F 63 61 74 65 0D 0A 20 20 20 20 20 20 20 69    locate..       i
00B700:  74 73 65 6C 66 20 73 6F 6D 65 20 6D 65 6D 6F 72    tself some memor
00B710:  79 20 61 6E 64 20 69 6E 69 74 69 61 6C 69 7A 65    y and initialize
00B720:  20 61 6E 79 20 20 64 61 74 61 20 20 73 74 72 75     any  data  stru
00B730:  63 74 75 72 65 73 20 20 61 6E 20 20 68 61 72 64    ctures  an  hard
00B740:  77 61 72 65 2E 0D 0A 20 20 20 20 20 20 20 50 72    ware...       Pr
00B750:  6F 76 69 64 69 6E 67 20 74 68 65 20 69 6E 69 74    oviding the init
00B760:  69 61 6C 69 7A 61 74 69 6F 6E 20 69 73 20 73 75    ialization is su
00B770:  63 63 65 73 73 66 75 6C 20 74 68 65 20 4B 65 72    ccessful the Ker
00B780:  6E 65 6C 20 70 6C 61 63 65 73 20 20 74 68 65 20    nel places  the 
00B790:  20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 6F 6E 20     ROM..       on 
00B7A0:  74 68 65 20 6C 69 73 74 20 6F 66 20 70 6F 73 73    the list of poss
00B7B0:  69 62 6C 65 20 74 61 6B 65 72 73 20 66 6F 72 20    ible takers for 
00B7C0:  65 78 74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64    external command
00B7D0:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    s.....       The
00B7E0:  20 66 69 72 73 74 20 65 6E 74 72 79 20 69 6E 20     first entry in 
00B7F0:  61 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D    a background ROM
00B800:  27 73 20 6A 75 6D 70 62 6C 6F 63 6B 20 69 73 20    's jumpblock is 
00B810:  20 69 74 20 20 69 6E 69 74 69 61 6C 69 7A 61 74     it  initializat
00B820:  69 6F 6E 0D 0A 20 20 20 20 20 20 20 72 6F 75 74    ion..       rout
00B830:  69 6E 65 2E 20 54 68 69 73 20 72 6F 75 74 69 6E    ine. This routin
00B840:  65 20 6D 75 73 74 20 6F 6E 6C 79 20 62 65 20 63    e must only be c
00B850:  61 6C 6C 65 64 20 62 79 20 74 68 65 20 66 69 72    alled by the fir
00B860:  6D 77 61 72 65 20 77 68 65 6E 20 74 68 65 20 52    mware when the R
00B870:  4F 4D 0D 0A 20 20 20 20 20 20 20 69 73 20 69 6E    OM..       is in
00B880:  69 74 69 61 6C 69 7A 65 64 20 69 74 20 69 73 20    itialized it is 
00B890:  6E 6F 74 20 6D 65 61 6E 74 20 66 6F 72 20 74 68    not meant for th
00B8A0:  65 20 75 73 65 72 20 74 6F 20 63 61 6C 6C 2E 20    e user to call. 
00B8B0:  20 54 72 69 63 6B 73 20 20 73 75 63 68 20 20 61     Tricks  such  a
00B8C0:  73 0D 0A 20 20 20 20 20 20 20 69 6E 63 6C 75 64    s..       includ
00B8D0:  69 6E 67 20 61 20 73 70 61 63 65 20 69 6E 20 20    ing a space in  
00B8E0:  74 68 65 20 20 6E 61 6D 65 20 20 6D 61 6B 65 73    the  name  makes
00B8F0:  20 20 69 74 20 20 69 6D 70 6F 73 73 69 62 6C 65      it  impossible
00B900:  20 20 66 6F 72 20 20 42 41 53 49 43 20 20 74 6F      for  BASIC  to
00B910:  0D 0A 20 20 20 20 20 20 20 67 65 6E 65 72 61 74    ..       generat
00B920:  65 20 74 68 65 20 63 6F 72 72 65 63 74 20 6E 61    e the correct na
00B930:  6D 65 20 61 6E 64 20 68 65 6E 63 65 20 69 6D 70    me and hence imp
00B940:  6F 73 73 69 62 6C 65 20 66 6F 72 20 20 61 20 20    ossible for  a  
00B950:  42 41 53 49 43 20 20 75 73 65 72 20 20 74 6F 0D    BASIC  user  to.
00B960:  0A 20 20 20 20 20 20 20 63 61 6C 6C 20 74 68 65    .       call the
00B970:  20 65 6E 74 72 79 2E 20 54 68 65 20 65 6E 74 72     entry. The entr
00B980:  79 20 61 6E 64 20 65 78 69 74 20 63 6F 6E 64 69    y and exit condi
00B990:  74 69 6F 6E 73 20 66 6F 72 20 20 74 68 65 20 20    tions for  the  
00B9A0:  69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 0D 0A    initialization..
00B9B0:  20 20 20 20 20 20 20 72 6F 75 74 69 6E 65 20 61           routine a
00B9C0:  72 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E    re:....       En
00B9D0:  74 72 79 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    try:....        
00B9E0:  20 20 44 45 20 63 6F 6E 74 61 69 6E 73 20 74 68      DE contains th
00B9F0:  65 20 61 64 64 72 65 73 73 20 6F 66 20 74 68 65    e address of the
00BA00:  20 6C 6F 77 65 73 74 20 62 79 74 65 20 69 6E 20     lowest byte in 
00BA10:  74 68 65 20 6D 65 6D 6F 72 79 20 70 6F 6F 6C 2E    the memory pool.
00BA20:  0D 0A 20 20 20 20 20 20 20 20 20 20 48 4C 20 63    ..          HL c
00BA30:  6F 6E 74 61 69 6E 73 20 74 68 65 20 61 64 64 72    ontains the addr
00BA40:  65 73 73 20 6F 66 20 74 68 65 20 68 69 67 68 65    ess of the highe
00BA50:  73 74 20 62 79 74 65 20 69 6E 20 74 68 65 20 6D    st byte in the m
00BA60:  65 6D 6F 72 79 20 70 6F 6F 6C 2E 0D 0A 0D 0A 20    emory pool..... 
00BA70:  20 20 20 20 20 20 45 78 69 74 3A 0D 0A 0D 0A 20          Exit:.... 
00BA80:  20 20 20 20 20 20 20 20 20 49 66 20 74 68 65 20             If the 
00BA90:  69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 20 77    initialization w
00BAA0:  61 73 20 73 75 63 63 65 73 73 66 75 6C 0D 0A 0D    as successful...
00BAB0:  0A 20 20 20 20 20 20 20 20 20 20 43 61 72 72 79    .          Carry
00BAC0:  20 74 72 75 65 2E 0D 0A 20 20 20 20 20 20 20 20     true...        
00BAD0:  20 20 44 45 20 63 6F 6E 74 61 69 6E 73 20 74 68      DE contains th
00BAE0:  65 20 6E 65 77 20 61 64 64 72 65 73 73 20 6F 66    e new address of
00BAF0:  20 74 68 65 20 6C 6F 77 65 73 74 20 62 79 74 65     the lowest byte
00BB00:  20 69 6E 20 74 68 65 20 6D 65 6D 6F 72 79 20 70     in the memory p
00BB10:  6F 6F 6C 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    ool...          
00BB20:  48 4C 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20    HL contains the 
00BB30:  6E 65 77 20 61 64 64 72 65 73 73 20 6F 66 20 74    new address of t
00BB40:  68 65 20 68 69 67 68 65 73 74 20 62 79 74 65 20    he highest byte 
00BB50:  69 6E 20 74 68 65 20 6D 65 6D 6F 72 79 20 70 6F    in the memory po
00BB60:  6F 6C 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ol.....         
00BB70:  20 49 66 20 74 68 65 20 69 6E 69 74 69 61 6C 69     If the initiali
00BB80:  7A 61 74 69 6F 6E 20 66 61 69 6C 65 64 3A 0D 0A    zation failed:..
00BB90:  0D 0A 20 20 20 20 20 20 20 20 20 20 43 61 72 72    ..          Carr
00BBA0:  79 20 66 61 6C 73 65 2E 0D 0A 20 20 20 20 20 20    y false...      
00BBB0:  20 20 20 20 44 45 20 61 6E 64 20 48 4C 20 70 72        DE and HL pr
00BBC0:  65 73 65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20 20    eserved.....    
00BBD0:  20 20 20 20 20 20 41 6C 77 61 79 73 3A 0D 0A 0D          Always:...
00BBE0:  0A 20 20 20 20 20 20 20 20 20 20 41 2C 20 42 43    .          A, BC
00BBF0:  20 61 6E 64 20 6F 74 68 65 72 20 66 6C 61 67 73     and other flags
00BC00:  20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20     corrupt...     
00BC10:  20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20 72         All other r
00BC20:  65 67 69 73 74 65 72 73 20 70 72 65 73 65 72 76    egisters preserv
00BC30:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F    ed.....       No
00BC40:  74 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    tes:....       T
00BC50:  68 65 20 75 70 70 65 72 20 52 4F 4D 20 69 73 20    he upper ROM is 
00BC60:  65 6E 61 62 6C 65 64 20 61 6E 64 20 73 65 6C 65    enabled and sele
00BC70:  63 74 65 64 2E 0D 0A 20 20 20 20 20 20 20 54 68    cted...       Th
00BC80:  65 20 6C 6F 77 65 72 20 52 4F 4D 20 69 73 20 64    e lower ROM is d
00BC90:  69 73 61 62 6C 65 64 2E 0D 0A 0D 0A 20 20 20 20    isabled.....    
00BCA0:  20 20 20 54 68 65 20 72 6F 75 74 69 6E 65 20 6D       The routine m
00BCB0:  61 79 20 6E 6F 74 20 75 73 65 20 74 68 65 20 61    ay not use the a
00BCC0:  6C 74 65 72 6E 61 74 65 20 72 65 67 69 73 74 65    lternate registe
00BCD0:  72 20 73 65 74 2E 0D 0A 0D 0A 20 20 20 20 20 20    r set.....      
00BCE0:  20 54 68 65 20 52 4F 4D 20 6D 61 79 20 61 6C 6C     The ROM may all
00BCF0:  6F 63 61 74 65 20 69 74 73 65 6C 66 20 6D 65 6D    ocate itself mem
00BD00:  6F 72 79 20 65 69 74 68 65 72 20 61 74 20 74 68    ory either at th
00BD10:  65 20 74 6F 70 20 6F 72 20 74 68 65 20 62 6F 74    e top or the bot
00BD20:  74 6F 6D 20 20 6F 66 0D 0A 20 20 20 20 20 20 20    tom  of..       
00BD30:  74 68 65 20 6D 65 6D 6F 72 79 20 70 6F 6F 6C 20    the memory pool 
00BD40:  28 6F 72 20 62 6F 74 68 29 2C 20 73 69 6D 70 6C    (or both), simpl
00BD50:  79 20 62 79 20 63 68 61 6E 67 69 6E 67 20 74 68    y by changing th
00BD60:  65 20 61 70 70 72 6F 70 72 69 61 74 65 20 72 65    e appropriate re
00BD70:  67 69 73 74 65 72 0D 0A 20 20 20 20 20 20 20 61    gister..       a
00BD80:  6E 64 20 72 65 74 75 72 6E 69 6E 67 20 74 68 65    nd returning the
00BD90:  20 6E 65 77 20 76 61 6C 75 65 2E 20 46 6F 72 20     new value. For 
00BDA0:  65 78 61 6D 70 6C 65 2C 20 74 6F 20 72 65 73 65    example, to rese
00BDB0:  72 76 65 20 32 35 36 20 20 62 79 74 65 73 20 20    rve 256  bytes  
00BDC0:  67 69 76 65 6E 0D 0A 20 20 20 20 20 20 20 61 6E    given..       an
00BDD0:  20 61 64 64 72 65 73 73 20 6F 66 20 23 41 42 37     address of #AB7
00BDE0:  46 20 61 73 20 74 68 65 20 74 6F 70 20 6F 66 20    F as the top of 
00BDF0:  74 68 65 20 70 6F 6F 6C 20 74 68 65 20 70 72 6F    the pool the pro
00BE00:  67 72 61 6D 20 77 6F 75 6C 64 20 20 73 75 62 74    gram would  subt
00BE10:  72 61 63 74 0D 0A 20 20 20 20 20 20 20 32 35 36    ract..       256
00BE20:  20 66 72 6F 6D 20 48 4C 20 67 69 76 69 6E 67 20     from HL giving 
00BE30:  61 20 6E 65 77 20 74 6F 70 20 20 6F 66 20 20 70    a new top  of  p
00BE40:  6F 6F 6C 20 20 61 64 64 72 65 73 73 20 20 6F 66    ool  address  of
00BE50:  20 20 23 41 41 37 46 2E 20 20 54 68 65 20 20 61      #AA7F.  The  a
00BE60:  72 65 61 0D 0A 20 20 20 20 20 20 20 70 72 65 73    rea..       pres
00BE70:  65 72 76 65 64 20 77 6F 75 6C 64 20 62 65 20 66    erved would be f
00BE80:  72 6F 6D 20 23 41 41 38 30 20 74 6F 20 23 41 42    rom #AA80 to #AB
00BE90:  37 46 20 69 6E 63 6C 75 73 69 76 65 2E 0D 0A 0D    7F inclusive....
00BEA0:  0A 20 20 20 20 20 20 20 54 68 65 20 63 61 72 72    .       The carr
00BEB0:  79 20 66 61 6C 73 65 20 72 65 74 75 72 6E 20 69    y false return i
00BEC0:  73 20 6F 6E 6C 79 20 72 65 63 6F 67 6E 69 7A 65    s only recognize
00BED0:  64 20 69 6E 20 56 31 2E 31 20 20 66 69 72 6D 77    d in V1.1  firmw
00BEE0:  61 72 65 2E 20 20 49 6E 20 20 56 31 2E 30 0D 0A    are.  In  V1.0..
00BEF0:  20 20 20 20 20 20 20 66 69 72 6D 77 61 72 65 20           firmware 
00BF00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
00BF10:  0A 00 00 00 02 09 50 E5 0A 00 C1 02 00 00 00 02    ......P.........
00BF20:  0A 00 C2 02 00 00 00 02 0A 00 C3 02 00 00 00 02    ................
00BF30:  0A 00 C4 02 00 00 00 02 0A 00 C5 02 00 00 00 02    ................
00BF40:  0A 00 C6 02 00 00 00 02 0A 00 C7 02 00 00 00 02    ................
00BF50:  0A 00 C8 02 00 00 00 02 0A 00 C9 02 00 00 00 02    ................
00BF60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BF70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BF80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BF90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00BFF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00C000:  74 68 69 73 20 77 69 6C 6C 20 62 65 20 74 72 65    this will be tre
00C010:  61 74 65 64 20 61 73 20 69 66 20 63 61 72 72 79    ated as if carry
00C020:  20 77 61 73 20 72 65 74 75 72 6E 65 64 20 74 72     was returned tr
00C030:  75 65 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    ue...........   
00C040:  20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34        AMSTRAD CPC4
00C050:  36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D    64/664/6128 FIRM
00C060:  57 41 52 45 20 20 20 20 20 20 20 20 20 20 20 20    WARE            
00C070:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00C080:  20 70 61 67 65 20 31 30 2E 36 0D 0A 1A FF 00 FF     page 10.6......
00C090:  65 20 31 30 2E 38 0D 0A 1A 4F 4D 73 2C 20 52 65    e 10.8...OMs, Re
00C0A0:  73 69 64 65 6E 74 20 53 79 73 74 65 6D 20 45 78    sident System Ex
00C0B0:  74 65 6E 73 69 6F 6E 73 20 61 6E 64 20 52 41 4D    tensions and RAM
00C0C0:  20 50 72 6F 67 72 61 6D 73 2E 0D 0A 0D 0A 0D 0A     Programs.......
00C0D0:  20 20 20 20 20 20 20 54 68 65 20 73 79 73 74 65           The syste
00C0E0:  6D 20 63 61 6E 20 61 64 64 72 65 73 73 20 75 70    m can address up
00C0F0:  20 74 6F 20 32 35 32 20 65 78 70 61 6E 73 69 6F     to 252 expansio
00C100:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C110:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C120:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C130:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C140:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C150:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C160:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C170:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C180:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C190:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C1F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C200:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C210:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C220:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C230:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C240:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C250:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C260:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C270:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C280:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C290:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C2F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C300:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C310:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C320:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C330:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C340:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C350:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C360:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C370:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C380:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C390:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C3F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
00C400:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
00C410:  20 20 20 57 68 65 6E 20 74 68 65 20 69 6E 69 74       When the init
00C420:  69 61 6C 69 7A 61 74 69 6F 6E 20 72 6F 75 74 69    ialization routi
00C430:  6E 65 20 72 65 74 75 72 6E 73 2C 20 74 68 65 20    ne returns, the 
00C440:  4B 65 72 6E 65 6C 20 73 74 6F 72 65 73 20 74 68    Kernel stores th
00C450:  65 20 61 64 64 72 65 73 73 0D 0A 20 20 20 20 20    e address..     
00C460:  20 20 6F 66 20 74 68 65 20 62 61 73 65 20 6F 66      of the base of
00C470:  20 74 68 65 20 75 70 70 65 72 20 61 72 65 61 20     the upper area 
00C480:  77 68 69 63 68 20 74 68 65 20 52 4F 4D 20 68 61    which the ROM ha
00C490:  73 20 61 6C 6C 6F 63 61 74 65 64 20 69 74 73 65    s allocated itse
00C4A0:  6C 66 20 28 69 2E 65 2E 0D 0A 20 20 20 20 20 20    lf (i.e...      
00C4B0:  20 48 4C 2B 31 29 2E 20 57 68 65 6E 65 76 65 72     HL+1). Whenever
00C4C0:  20 61 6E 20 65 6E 74 72 79 20 69 6E 20 74 68 65     an entry in the
00C4D0:  20 52 4F 4D 20 69 73 20 63 61 6C 6C 65 64 20 74     ROM is called t
00C4E0:  68 69 73 20 61 64 64 72 65 73 73 20 20 69 73 20    his address  is 
00C4F0:  20 70 61 73 73 65 64 0D 0A 20 20 20 20 20 20 20     passed..       
00C500:  69 6E 20 74 68 65 20 49 59 20 69 6E 64 65 78 20    in the IY index 
00C510:  72 65 67 69 73 74 65 72 2E 20 54 68 69 73 20 61    register. This a
00C520:  6C 6C 6F 77 73 20 74 68 65 20 52 4F 4D 20 72 6F    llows the ROM ro
00C530:  75 74 69 6E 65 20 20 74 6F 20 20 61 63 63 65 73    utine  to  acces
00C540:  73 20 20 69 74 73 0D 0A 20 20 20 20 20 20 20 75    s  its..       u
00C550:  70 70 65 72 20 76 61 72 69 61 62 6C 65 20 20 61    pper variable  a
00C560:  72 65 61 20 20 65 61 73 69 6C 79 20 20 65 6E 6F    rea  easily  eno
00C570:  75 67 68 20 20 65 76 65 6E 20 20 74 68 6F 75 67    ugh  even  thoug
00C580:  68 20 20 69 74 20 20 77 61 73 20 20 61 6C 6C 6F    h  it  was  allo
00C590:  63 61 74 65 64 0D 0A 20 20 20 20 20 20 20 64 79    cated..       dy
00C5A0:  6E 61 6D 69 63 61 6C 6C 79 2E 20 41 63 63 65 73    namically. Acces
00C5B0:  73 20 74 6F 20 61 6E 79 20 6C 6F 77 65 72 20 76    s to any lower v
00C5C0:  61 72 69 61 62 6C 65 20 20 61 72 65 61 20 20 73    ariable  area  s
00C5D0:  68 6F 75 6C 64 20 20 62 65 20 20 64 6F 6E 65 20    hould  be  done 
00C5E0:  20 76 69 61 0D 0A 20 20 20 20 20 20 20 70 6F 69     via..       poi
00C5F0:  6E 74 65 72 73 20 69 6E 20 74 68 65 20 75 70 70    nters in the upp
00C600:  65 72 20 61 72 65 61 2E 20 53 69 6E 63 65 20 62    er area. Since b
00C610:  61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 73 20 64    ackground ROMs d
00C620:  6F 20 6E 6F 74 20 75 73 65 20 20 61 62 73 6F 6C    o not use  absol
00C630:  75 74 65 0D 0A 20 20 20 20 20 20 20 61 72 65 61    ute..       area
00C640:  73 20 6F 66 20 6D 65 6D 6F 72 79 2C 20 70 72 6F    s of memory, pro
00C650:  62 6C 65 6D 73 20 6F 66 20 62 61 63 6B 67 72 6F    blems of backgro
00C660:  75 6E 64 20 52 4F 4D 73 20 63 6C 61 73 68 69 6E    und ROMs clashin
00C670:  67 20 77 69 74 68 20 65 61 63 68 20 20 6F 74 68    g with each  oth
00C680:  65 72 0D 0A 20 20 20 20 20 20 20 6F 72 20 20 77    er..       or  w
00C690:  69 74 68 20 20 74 68 65 20 20 66 6F 72 65 67 72    ith  the  foregr
00C6A0:  6F 75 6E 64 20 20 70 72 6F 67 72 61 6D 20 20 77    ound  program  w
00C6B0:  69 6C 6C 20 20 6E 65 76 65 72 20 20 61 72 69 73    ill  never  aris
00C6C0:  65 2E 20 20 4E 6F 74 65 20 20 74 68 61 74 20 20    e.  Note  that  
00C6D0:  61 0D 0A 20 20 20 20 20 20 20 62 61 63 6B 67 72    a..       backgr
00C6E0:  6F 75 6E 64 20 52 4F 4D 20 69 73 20 76 65 72 79    ound ROM is very
00C6F0:  20 6C 69 6B 65 6C 79 20 74 6F 20 65 78 70 65 63     likely to expec
00C700:  74 20 74 68 61 74 20 69 74 73 20 75 70 70 65 72    t that its upper
00C710:  20 64 61 74 61 20 61 72 65 61 20 20 6C 69 65 73     data area  lies
00C720:  0D 0A 20 20 20 20 20 20 20 61 62 6F 76 65 20 23    ..       above #
00C730:  30 30 34 30 20 73 6F 20 74 68 61 74 20 69 74 20    0040 so that it 
00C740:  69 73 20 61 63 63 65 73 73 69 62 6C 65 20 69 72    is accessible ir
00C750:  72 65 73 70 65 63 74 69 76 65 20 6F 66 20 77 68    respective of wh
00C760:  65 74 68 65 72 20 74 68 65 20 6C 6F 77 65 72 0D    ether the lower.
00C770:  0A 20 20 20 20 20 20 20 52 4F 4D 20 69 73 20 65    .       ROM is e
00C780:  6E 61 62 6C 65 64 20 6F 72 20 6E 6F 74 2E 0D 0A    nabled or not...
00C790:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 66 20    ......       If 
00C7A0:  74 68 65 20 69 6E 69 74 69 61 6C 69 7A 61 74 69    the initializati
00C7B0:  6F 6E 20 69 73 20 73 75 63 63 65 73 73 66 75 6C    on is successful
00C7C0:  20 74 68 65 6E 20 74 68 65 20 4B 65 72 6E 65 6C     then the Kernel
00C7D0:  20 20 61 6C 73 6F 20 20 70 6C 61 63 65 73 20 20      also  places  
00C7E0:  74 68 65 0D 0A 20 20 20 20 20 20 20 52 4F 4D 20    the..       ROM 
00C7F0:  6F 6E 20 69 74 73 20 6C 69 73 74 20 6F 66 20 70    on its list of p
00C800:  6F 73 73 69 62 6C 65 20 68 61 6E 64 6C 65 72 73    ossible handlers
00C810:  20 6F 66 20 65 78 74 65 72 6E 61 6C 20 63 6F 6D     of external com
00C820:  6D 61 6E 64 73 20 28 73 65 65 20 62 65 6C 6F 77    mands (see below
00C830:  29 2E 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 20    )...       Note 
00C840:  74 68 61 74 20 77 68 65 6E 20 74 68 65 20 6C 69    that when the li
00C850:  73 74 20 69 73 20 73 63 61 6E 6E 65 64 20 66 6F    st is scanned fo
00C860:  72 20 65 78 74 65 72 6E 61 6C 20 20 63 6F 6D 6D    r external  comm
00C870:  61 6E 64 73 20 20 74 68 65 20 20 6C 61 74 65 73    ands  the  lates
00C880:  74 0D 0A 20 20 20 20 20 20 20 61 64 64 69 74 69    t..       additi
00C890:  6F 6E 20 69 73 20 74 72 69 65 64 20 66 69 72 73    on is tried firs
00C8A0:  74 2E 20 54 68 65 20 65 6E 74 72 79 20 4B 4C 20    t. The entry KL 
00C8B0:  52 4F 4D 20 57 41 4C 4B 20 70 72 6F 63 65 73 73    ROM WALK process
00C8C0:  65 73 20 74 68 65 20 20 52 4F 4D 73 20 20 69 6E    es the  ROMs  in
00C8D0:  0D 0A 20 20 20 20 20 20 20 72 65 76 65 72 73 65    ..       reverse
00C8E0:  20 61 64 64 72 65 73 73 20 6F 72 64 65 72 20 28     address order (
00C8F0:  31 35 2C 20 31 34 2C 20 2E 2E 2E 30 29 2C 20 69    15, 14, ...0), i
00C900:  67 6E 6F 72 69 6E 67 20 61 6E 79 20 67 61 70 73    gnoring any gaps
00C910:  20 6F 66 20 20 66 6F 72 65 67 72 6F 75 6E 64 0D     of  foreground.
00C920:  0A 20 20 20 20 20 20 20 52 4F 4D 73 2C 20 74 68    .       ROMs, th
00C930:  75 73 20 74 68 65 20 52 4F 4D 73 20 77 69 6C 6C    us the ROMs will
00C940:  20 62 65 20 73 65 61 72 63 68 65 64 20 69 6E 20     be searched in 
00C950:  74 68 65 20 6F 72 64 65 72 20 30 2C 20 31 2C 20    the order 0, 1, 
00C960:  2E 2E 2E 31 35 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ...15.........  
00C970:  20 20 20 20 20 31 30 2E 35 20 52 65 73 69 64 65         10.5 Reside
00C980:  6E 74 20 53 79 73 74 65 6D 20 45 78 74 65 6E 73    nt System Extens
00C990:  69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    ions.........   
00C9A0:  20 20 20 20 41 6E 20 52 53 58 20 69 73 20 73 69        An RSX is si
00C9B0:  6D 69 6C 61 72 20 74 6F 20 61 20 62 61 63 6B 67    milar to a backg
00C9C0:  72 6F 75 6E 64 20 52 4F 4D 2E 20 52 65 73 70 6F    round ROM. Respo
00C9D0:  6E 73 69 62 69 6C 69 74 79 20 66 6F 72 20 20 6C    nsibility for  l
00C9E0:  6F 61 64 69 6E 67 20 20 61 6E 0D 0A 20 20 20 20    oading  an..    
00C9F0:  20 20 20 52 53 58 20 61 6E 64 20 70 72 6F 76 69       RSX and provi
00CA00:  64 69 6E 67 20 69 74 20 77 69 74 68 20 6D 65 6D    ding it with mem
00CA10:  6F 72 79 20 6C 69 65 73 20 77 69 74 68 20 74 68    ory lies with th
00CA20:  65 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F    e foreground pro
00CA30:  67 72 61 6D 2E 20 20 54 6F 0D 0A 20 20 20 20 20    gram.  To..     
00CA40:  20 20 66 69 74 20 69 6E 20 77 69 74 68 20 74 68      fit in with th
00CA50:  65 20 64 79 6E 61 6D 69 63 20 61 6C 6C 6F 63 61    e dynamic alloca
00CA60:  74 69 6F 6E 20 6F 66 20 6D 65 6D 6F 72 79 20 74    tion of memory t
00CA70:  6F 20 62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D    o background ROM
00CA80:  73 20 69 74 20 20 69 73 0D 0A 20 20 20 20 20 20    s it  is..      
00CA90:  20 72 65 63 6F 6D 6D 65 6E 64 65 64 20 74 68 61     recommended tha
00CAA0:  74 20 52 53 58 73 20 73 68 6F 75 6C 64 20 62 65    t RSXs should be
00CAB0:  20 70 6F 73 69 74 69 6F 6E 20 69 6E 64 65 70 65     position indepe
00CAC0:  6E 64 65 6E 74 20 6F 72 20 72 65 6C 6F 63 61 74    ndent or relocat
00CAD0:  65 64 20 77 68 65 6E 0D 0A 20 20 20 20 20 20 20    ed when..       
00CAE0:  6C 6F 61 64 65 64 2E 20 41 6E 20 52 53 58 20 63    loaded. An RSX c
00CAF0:  6F 75 6C 64 20 62 65 20 72 65 6C 6F 63 61 74 65    ould be relocate
00CB00:  64 20 62 79 20 20 77 72 69 74 69 6E 67 20 20 61    d by  writing  a
00CB10:  20 20 73 68 6F 72 74 20 42 41 53 49 43 20 27 6C      short BASIC 'l
00CB20:  6F 61 64 65 72 27 0D 0A 20 20 20 20 20 20 20 70    oader'..       p
00CB30:  72 6F 67 72 61 6D 20 77 68 69 63 68 20 72 65 61    rogram which rea
00CB40:  64 73 20 74 68 65 20 52 53 58 20 69 6E 20 61 20    ds the RSX in a 
00CB50:  66 6F 72 6D 61 74 20 77 68 69 63 68 20 6D 61 79    format which may
00CB60:  20 62 65 20 72 65 6C 6F 63 61 74 65 64 20 20 65     be relocated  e
00CB70:  61 73 69 6C 79 0D 0A 20 20 20 20 20 20 20 61 6E    asily..       an
00CB80:  64 20 50 4F 4B 45 73 20 69 6E 74 6F 20 73 74 6F    d POKEs into sto
00CB90:  72 65 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    re.........     
00CBA0:  20 20 4F 6E 63 65 20 61 6E 20 52 53 58 20 69 73      Once an RSX is
00CBB0:  20 6C 6F 61 64 20 69 74 20 6D 61 79 20 62 65 20     load it may be 
00CBC0:  70 6C 61 63 65 64 20 6F 6E 20 74 68 65 20 6C 69    placed on the li
00CBD0:  73 74 20 6F 66 20 70 6F 73 73 69 62 6C 65 20 20    st of possible  
00CBE0:  68 61 6E 64 6C 65 72 73 0D 0A 20 20 20 20 20 20    handlers..      
00CBF0:  20 6F 66 20 65 78 74 65 72 6E 61 6C 20 63 6F 6D     of external com
00CC00:  6D 61 6E 64 73 20 28 73 65 65 20 66 6F 6C 6C 6F    mands (see follo
00CC10:  77 69 6E 67 20 20 70 61 67 65 29 20 20 62 79 20    wing  page)  by 
00CC20:  20 63 61 6C 6C 69 6E 67 20 20 4B 4C 20 20 4C 4F     calling  KL  LO
00CC30:  47 20 20 45 58 54 2C 0D 0A 20 20 20 20 20 20 20    G  EXT,..       
00CC40:  70 61 73 73 69 6E 67 20 69 74 20 74 68 65 20 61    passing it the a
00CC50:  64 64 72 65 73 73 20 6F 66 20 74 68 65 20 52 53    ddress of the RS
00CC60:  58 73 20 65 78 74 65 72 6E 61 6C 20 63 6F 6D 6D    Xs external comm
00CC70:  61 6E 64 20 74 61 62 6C 65 20 61 6E 64 20 20 61    and table and  a
00CC80:  20 20 66 6F 75 72 0D 0A 20 20 20 20 20 20 20 62      four..       b
00CC90:  79 74 65 20 62 6C 6F 63 6B 20 6F 66 20 6D 65 6D    yte block of mem
00CCA0:  6F 72 79 20 28 69 6E 20 74 68 65 20 63 65 6E 74    ory (in the cent
00CCB0:  72 61 6C 20 33 32 4B 20 6F 66 20 52 41 4D 29 20    ral 32K of RAM) 
00CCC0:  66 6F 72 20 74 68 65 20 4B 65 72 6E 65 6C 27 73    for the Kernel's
00CCD0:  20 75 73 65 2E 0D 0A 20 20 20 20 20 20 20 54 68     use...       Th
00CCE0:  65 20 66 6F 72 6D 61 74 20 6F 66 20 74 68 65 20    e format of the 
00CCF0:  74 61 62 6C 65 20 69 73 20 65 78 61 63 74 6C 79    table is exactly
00CD00:  20 74 68 65 20 73 61 6D 65 20 61 73 20 66 6F 72     the same as for
00CD10:  20 20 61 20 20 62 61 63 6B 67 72 6F 75 6E 64 20      a  background 
00CD20:  20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 28 73 65     ROM..       (se
00CD30:  65 20 73 65 63 74 69 6F 6E 20 31 30 2E 32 29 2E    e section 10.2).
00CD40:  20 54 68 65 20 6F 6E 6C 79 20 64 69 66 66 65 72     The only differ
00CD50:  65 6E 63 65 20 69 73 20 69 6E 20 20 74 68 65 20    ence is in  the 
00CD60:  20 69 6E 74 65 72 70 72 65 74 61 74 69 6F 6E 20     interpretation 
00CD70:  20 6F 66 0D 0A 20 20 20 20 20 20 20 74 68 65 20     of..       the 
00CD80:  20 74 61 62 6C 65 20 20 2D 20 20 74 68 65 20 20     table  -  the  
00CD90:  66 69 72 73 74 20 20 65 6E 74 72 79 20 20 69 6E    first  entry  in
00CDA0:  20 20 74 68 65 20 20 6A 75 6D 70 62 6C 6F 63 6B      the  jumpblock
00CDB0:  20 20 69 73 20 20 6E 6F 74 20 20 20 63 61 6C 6C      is  not   call
00CDC0:  65 64 0D 0A 20 20 20 20 20 20 20 61 75 74 6F 6D    ed..       autom
00CDD0:  61 74 69 63 61 6C 6C 79 20 20 62 79 20 20 74 68    atically  by  th
00CDE0:  65 20 20 4B 65 72 6E 65 6C 20 20 61 6E 64 20 20    e  Kernel  and  
00CDF0:  74 68 75 73 20 20 6E 65 65 64 20 20 6E 6F 74 20    thus  need  not 
00CE00:  20 62 65 20 20 20 74 68 65 20 20 20 52 53 58 27     be   the   RSX'
00CE10:  73 0D 0A 20 20 20 20 20 20 20 69 6E 69 74 69 61    s..       initia
00CE20:  6C 69 7A 61 74 69 6F 6E 20 72 6F 75 74 69 6E 65    lization routine
00CE30:  2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
00CE40:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
00CE50:  20 20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34      AMSTRAD CPC464
00CE60:  2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41    /664/6128 FIRMWA
00CE70:  52 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20    RE              
00CE80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70                   p
00CE90:  61 67 65 20 31 30 2E 37 0D 0A 0D 0A 0D 0A 0D 0A    age 10.7........
00CEA0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 46 6F 72    ......       For
00CEB0:  20 65 78 61 6D 70 6C 65 2C 20 74 68 65 20 77 61     example, the wa
00CEC0:  79 20 74 6F 20 61 64 64 20 61 6E 20 65 78 74 65    y to add an exte
00CED0:  72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 20 74 61 62    rnal command tab
00CEE0:  6C 65 20 66 6F 72 20 20 61 20 20 67 72 61 70 68    le for  a  graph
00CEF0:  69 63 73 0D 0A 20 20 20 20 20 20 20 65 78 74 65    ics..       exte
00CF00:  6E 73 69 6F 6E 20 66 6F 72 20 42 41 53 49 43 20    nsion for BASIC 
00CF10:  6D 69 67 68 74 20 62 65 3A 0D 0A 0D 0A 20 20 20    might be:....   
00CF20:  20 20 20 20 49 4E 49 54 49 41 4C 49 5A 45 3A 20        INITIALIZE: 
00CF30:  20 20 20 20 20 20 20 4C 44 20 48 4C 2C 57 4F 52           LD HL,WOR
00CF40:  4B 5F 53 50 41 43 45 20 20 20 20 20 20 20 20 20    K_SPACE         
00CF50:  3B 52 53 58 20 70 6F 77 65 72 2D 75 70 20 52 6F    ;RSX power-up Ro
00CF60:  75 74 69 6E 65 0D 0A 20 20 20 20 20 20 20 20 20    utine..         
00CF70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00CF80:  20 4C 44 20 42 43 2C 52 53 58 5F 54 41 42 4C 45     LD BC,RSX_TABLE
00CF90:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
00CFA0:  20 20 20 20 20 20 20 20 20 20 20 20 4A 50 20 4B                JP K
00CFB0:  4C 5F 4C 4F 47 5F 45 58 54 0D 0A 0D 0A 20 20 20    L_LOG_EXT....   
00CFC0:  20 20 20 20 57 4F 52 4B 5F 53 50 41 43 45 3A 20        WORK_SPACE: 
00CFD0:  20 20 20 20 20 20 20 44 45 46 53 20 34 20 20 20           DEFS 4   
00CFE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00CFF0:  3B 41 72 65 61 20 66 6F 72 20 4B 65 72 6E 65 6C    ;Area for Kernel
00D000:  20 74 6F 20 75 73 65 0D 0A 0D 0A 20 20 20 20 20     to use....     
00D010:  20 20 52 53 58 5F 54 41 42 4C 45 3A 20 20 20 20      RSX_TABLE:    
00D020:  20 20 20 20 20 44 45 46 57 20 4E 41 4D 45 5F 54         DEFW NAME_T
00D030:  41 42 4C 45 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ABLE....        
00D040:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00D050:  20 20 4A 50 20 44 52 41 57 5F 43 49 52 43 4C 45      JP DRAW_CIRCLE
00D060:  20 20 20 20 20 20 20 20 20 20 20 3B 30 0D 0A 20               ;0.. 
00D070:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00D080:  20 20 20 20 20 20 20 20 20 4A 50 20 44 52 41 57             JP DRAW
00D090:  5F 54 52 49 41 4E 47 4C 45 20 20 20 20 20 20 20    _TRIANGLE       
00D0A0:  20 20 3B 31 0D 0A 20 20 20 20 20 20 20 20 20 20      ;1..          
00D0B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00D0C0:  4A 50 20 46 49 4C 4C 5F 41 52 45 41 20 20 20 20    JP FILL_AREA    
00D0D0:  20 20 20 20 20 20 20 20 20 3B 32 0D 0A 0D 0A 20             ;2.... 
00D0E0:  20 20 20 20 20 20 4E 41 4D 45 5F 54 41 42 4C 45          NAME_TABLE
00D0F0:  20 20 20 20 20 20 20 20 20 44 45 46 42 20 27 43             DEFB 'C
00D100:  49 52 43 4C 27 2C 27 45 27 2B 23 38 30 20 20 20    IRCL','E'+#80   
00D110:  20 20 3B 30 0D 0A 20 20 20 20 20 20 20 20 20 20      ;0..          
00D120:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00D130:  44 45 46 42 20 27 54 52 49 41 4E 47 4C 27 2C 27    DEFB 'TRIANGL','
00D140:  45 27 2B 23 38 30 20 20 20 3B 31 0D 0A 20 20 20    E'+#80   ;1..   
00D150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00D160:  20 20 20 20 20 20 20 44 45 46 42 20 27 46 49 4C           DEFB 'FIL
00D170:  27 2C 27 4C 27 2B 23 38 30 20 20 20 20 20 20 20    ','L'+#80       
00D180:  3B 32 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ;2..            
00D190:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 44 45                  DE
00D1A0:  46 42 20 23 30 30 0D 0A 0D 0A 20 20 20 20 20 20    FB #00....      
00D1B0:  20 4E 6F 74 65 20 74 68 61 74 20 77 68 65 6E 20     Note that when 
00D1C0:  74 68 65 20 6C 69 73 74 20 69 73 20 73 63 61 6E    the list is scan
00D1D0:  6E 65 64 20 66 6F 72 20 20 65 78 74 65 72 6E 61    ned for  externa
00D1E0:  6C 20 20 63 6F 6D 6D 61 6E 64 73 20 20 74 68 65    l  commands  the
00D1F0:  20 6C 61 74 65 73 74 0D 0A 20 20 20 20 20 20 20     latest..       
00D200:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
00D210:  0B 00 00 00 02 09 50 E5 0B 00 C1 02 00 00 00 02    ......P.........
00D220:  0B 00 C2 02 00 00 00 02 0B 00 C3 02 00 00 00 02    ................
00D230:  0B 00 C4 02 00 00 00 02 0B 00 C5 02 00 00 00 02    ................
00D240:  0B 00 C6 02 00 00 00 02 0B 00 C7 02 00 00 00 02    ................
00D250:  0B 00 C8 02 00 00 00 02 0B 00 C9 02 00 00 00 02    ................
00D260:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D270:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D280:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D290:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D2F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00D300:  61 64 64 69 74 69 6F 6E 20 69 73 20 74 72 69 65    addition is trie
00D310:  64 20 66 69 72 73 74 2E 20 53 69 6E 63 65 20 52    d first. Since R
00D320:  53 58 27 73 20 77 69 6C 6C 2C 20 69 6E 20 67 65    SX's will, in ge
00D330:  6E 65 72 61 6C 2C 20 62 65 20 6C 6F 61 64 65 64    neral, be loaded
00D340:  20 61 66 74 65 72 0D 0A 20 20 20 20 20 20 20 62     after..       b
00D350:  61 63 6B 67 72 6F 75 6E 64 20 20 52 4F 4D 73 20    ackground  ROMs 
00D360:  20 68 61 76 65 20 20 62 65 65 6E 20 20 69 6E 69     have  been  ini
00D370:  74 69 61 6C 69 7A 65 64 2C 20 20 52 53 58 20 20    tialized,  RSX  
00D380:  63 6F 6D 6D 61 6E 64 73 20 20 77 69 6C 6C 20 20    commands  will  
00D390:  20 74 61 6B 65 0D 0A 20 20 20 20 20 20 20 70 72     take..       pr
00D3A0:  65 63 65 64 65 6E 63 65 20 20 6F 76 65 72 20 20    ecedence  over  
00D3B0:  74 68 6F 73 65 20 20 69 6E 20 20 62 61 63 6B 67    those  in  backg
00D3C0:  72 6F 75 6E 64 20 20 52 4F 4D 73 2E 20 20 54 68    round  ROMs.  Th
00D3D0:  65 20 20 65 6E 74 72 79 20 20 61 6E 64 20 20 20    e  entry  and   
00D3E0:  65 78 69 74 0D 0A 20 20 20 20 20 20 20 63 6F 6E    exit..       con
00D3F0:  64 69 74 69 6F 6E 73 20 66 6F 72 20 20 65 78 74    ditions for  ext
00D400:  65 72 6E 61 6C 20 20 63 6F 6D 6D 61 6E 64 73 20    ernal  commands 
00D410:  20 61 72 65 20 20 64 69 73 63 75 73 73 65 64 20     are  discussed 
00D420:  20 69 6E 20 20 74 68 65 20 20 66 6F 6C 6C 6F 77     in  the  follow
00D430:  69 6E 67 0D 0A 20 20 20 20 20 20 20 73 65 63 74    ing..       sect
00D440:  69 6F 6E 20 28 73 65 63 74 69 6F 6E 20 31 30 2E    ion (section 10.
00D450:  36 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 30    6).....       10
00D460:  2E 36 20 45 78 74 65 72 6E 61 6C 20 43 6F 6D 6D    .6 External Comm
00D470:  61 6E 64 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    ands.....       
00D480:  4F 6E 63 65 20 74 68 65 20 66 6F 72 65 67 72 6F    Once the foregro
00D490:  75 6E 64 20 70 72 6F 67 72 61 6D 20 20 68 61 73    und program  has
00D4A0:  20 20 64 65 63 69 64 65 64 20 20 74 68 61 74 20      decided  that 
00D4B0:  20 69 74 20 20 68 61 73 20 20 61 6E 20 20 65 78     it  has  an  ex
00D4C0:  74 65 72 6E 61 6C 0D 0A 20 20 20 20 20 20 20 63    ternal..       c
00D4D0:  6F 6D 6D 61 6E 64 20 6F 6E 20 69 74 73 20 68 61    ommand on its ha
00D4E0:  6E 64 73 20 69 74 20 73 68 6F 75 6C 64 20 63 61    nds it should ca
00D4F0:  6C 6C 20 74 68 65 20 4B 65 72 6E 65 6C 20 65 6E    ll the Kernel en
00D500:  74 72 79 20 4B 4C 20 46 49 4E 44 20 20 43 4F 4D    try KL FIND  COM
00D510:  4D 41 4E 44 2C 0D 0A 20 20 20 20 20 20 20 70 61    MAND,..       pa
00D520:  73 73 69 6E 67 20 74 6F 20 69 74 20 61 20 73 74    ssing to it a st
00D530:  72 69 6E 67 20 67 69 76 69 6E 67 20 74 68 65 20    ring giving the 
00D540:  63 6F 6D 6D 61 6E 64 20 20 6E 61 6D 65 2E 20 20    command  name.  
00D550:  54 68 69 73 20 20 72 6F 75 74 69 6E 65 20 20 66    This  routine  f
00D560:  69 72 73 74 0D 0A 20 20 20 20 20 20 20 61 74 74    irst..       att
00D570:  65 6D 70 74 73 20 74 6F 20 66 69 6E 64 20 61 6E    empts to find an
00D580:  20 52 53 58 20 6F 72 20 61 20 62 61 63 6B 67 72     RSX or a backgr
00D590:  6F 75 6E 64 20 20 52 4F 4D 20 20 77 68 6F 73 65    ound  ROM  whose
00D5A0:  20 20 65 78 74 65 72 6E 61 6C 20 20 63 6F 6D 6D      external  comm
00D5B0:  61 6E 64 0D 0A 20 20 20 20 20 20 20 74 61 62 6C    and..       tabl
00D5C0:  65 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 63    e contains the c
00D5D0:  6F 6D 6D 61 6E 64 2E 20 4F 6E 6C 79 20 74 68 6F    ommand. Only tho
00D5E0:  73 65 20 52 53 58 73 20 61 6E 64 20 52 4F 4D 73    se RSXs and ROMs
00D5F0:  20 77 68 69 63 68 20 20 68 61 76 65 20 20 62 65     which  have  be
00D600:  65 6E 0D 0A 20 20 20 20 20 20 20 73 75 69 74 61    en..       suita
00D610:  62 6C 79 20 69 6E 69 74 69 61 6C 69 7A 65 64 20    bly initialized 
00D620:  61 72 65 20 74 61 6B 65 6E 20 69 6E 74 6F 20 63    are taken into c
00D630:  6F 6E 73 69 64 65 72 61 74 69 6F 6E 2E 20 49 66    onsideration. If
00D640:  20 74 68 65 20 20 63 6F 6D 6D 61 6E 64 20 20 69     the  command  i
00D650:  73 0D 0A 20 20 20 20 20 20 20 66 6F 75 6E 64 20    s..       found 
00D660:  74 68 65 6E 20 74 68 65 20 27 66 61 72 20 61 64    then the 'far ad
00D670:  64 72 65 73 73 27 20 6F 66 20 74 68 65 20 63 6F    dress' of the co
00D680:  72 72 65 73 70 6F 6E 64 69 6E 67 20 6A 75 6D 70    rresponding jump
00D690:  62 6C 6F 63 6B 20 20 65 6E 74 72 79 20 20 69 73    block  entry  is
00D6A0:  0D 0A 20 20 20 20 20 20 20 72 65 74 75 72 6E 65    ..       returne
00D6B0:  64 20 28 73 65 65 20 73 65 63 74 69 6F 6E 20 32    d (see section 2
00D6C0:  2E 33 29 2E 20 49 66 20 74 68 65 20 63 6F 6D 6D    .3). If the comm
00D6D0:  61 6E 64 20 69 73 20 6E 6F 74 20 20 66 6F 75 6E    and is not  foun
00D6E0:  64 20 20 74 68 65 20 20 72 6F 75 74 69 6E 65 0D    d  the  routine.
00D6F0:  0A 20 20 20 20 20 20 20 73 74 61 72 74 73 20 61    .       starts a
00D700:  74 20 52 4F 4D 20 30 20 61 6E 64 20 73 65 61 72    t ROM 0 and sear
00D710:  63 68 65 73 20 20 66 6F 72 20 20 61 20 20 66 6F    ches  for  a  fo
00D720:  72 65 67 72 6F 75 6E 64 20 20 52 4F 4D 20 20 77    reground  ROM  w
00D730:  68 6F 73 65 20 20 65 78 74 65 72 6E 61 6C 0D 0A    hose  external..
00D740:  20 20 20 20 20 20 20 63 6F 6D 6D 61 6E 64 20 74           command t
00D750:  61 62 6C 65 20 63 6F 6E 74 61 69 6E 73 20 74 68    able contains th
00D760:  65 20 63 6F 6D 6D 61 6E 64 2E 20 49 66 20 61 20    e command. If a 
00D770:  66 6F 72 65 67 72 6F 75 6E 64 20 52 4F 4D 20 69    foreground ROM i
00D780:  73 20 20 66 6F 75 6E 64 2C 74 68 65 6E 0D 0A 20    s  found,then.. 
00D790:  20 20 20 20 20 20 74 68 65 20 73 79 73 74 65 6D          the system
00D7A0:  20 72 65 73 65 74 73 20 61 6E 64 20 65 6E 74 65     resets and ente
00D7B0:  72 73 20 74 68 65 20 61 70 70 72 6F 70 72 69 61    rs the appropria
00D7C0:  74 65 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72    te foreground pr
00D7D0:  6F 67 72 61 6D 2E 20 49 66 20 6E 6F 0D 0A 20 20    ogram. If no..  
00D7E0:  20 20 20 20 20 6D 61 74 63 68 20 66 6F 72 20 74         match for t
00D7F0:  68 65 20 63 6F 6D 6D 61 6E 64 20 63 61 6E 20 62    he command can b
00D800:  65 20 66 6F 75 6E 64 20 61 20 66 61 69 6C 75 72    e found a failur
00D810:  65 20 69 6E 64 69 63 61 74 69 6F 6E 20 69 73 20    e indication is 
00D820:  72 65 74 75 72 6E 65 64 2E 0D 0A 0D 0A 20 20 20    returned.....   
00D830:  20 20 20 20 4E 6F 74 65 20 74 68 61 74 20 74 68        Note that th
00D840:  65 20 65 78 74 65 72 6E 61 6C 20 63 6F 6D 6D 61    e external comma
00D850:  6E 64 20 6D 65 63 68 61 6E 69 73 6D 20 61 6C 6C    nd mechanism all
00D860:  6F 77 73 20 62 6F 74 68 20 20 66 6F 72 20 20 66    ows both  for  f
00D870:  69 6E 64 69 6E 67 20 20 6F 66 0D 0A 20 20 20 20    inding  of..    
00D880:  20 20 20 62 61 63 6B 67 72 6F 75 6E 64 20 61 6E       background an
00D890:  64 20 52 53 58 20 72 6F 75 74 69 6E 65 73 2C 20    d RSX routines, 
00D8A0:  61 6E 64 20 66 6F 72 20 73 77 69 74 63 68 69 6E    and for switchin
00D8B0:  67 20 6F 66 20 66 6F 72 65 67 72 6F 75 6E 64 20    g of foreground 
00D8C0:  70 72 6F 67 72 61 6D 73 2E 0D 0A 20 20 20 20 20    programs...     
00D8D0:  20 20 4E 6F 74 65 20 61 6C 73 6F 20 74 68 61 74      Note also that
00D8E0:  20 74 68 65 20 66 69 72 73 74 20 63 6F 6D 6D 61     the first comma
00D8F0:  6E 64 20 6E 61 6D 65 20 69 6E 20 61 20 62 61 63    nd name in a bac
00D900:  6B 67 72 6F 75 6E 64 20 52 4F 4D 20 20 63 6F 72    kground ROM  cor
00D910:  72 65 73 70 6F 6E 64 73 0D 0A 20 20 20 20 20 20    responds..      
00D920:  20 74 6F 20 74 68 65 20 69 6D 70 6C 69 63 69 74     to the implicit
00D930:  20 69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 20     initialization 
00D940:  65 6E 74 72 79 2C 20 61 6E 64 20 73 68 6F 75 6C    entry, and shoul
00D950:  64 20 20 6E 6F 74 20 20 62 65 20 20 75 73 65 64    d  not  be  used
00D960:  20 20 61 73 20 20 61 0D 0A 20 20 20 20 20 20 20      as  a..       
00D970:  63 6F 6D 6D 61 6E 64 2E 0D 0A 0D 0A 20 20 20 20    command.....    
00D980:  20 20 20 54 68 65 20 66 69 72 73 74 20 74 69 6D       The first tim
00D990:  65 20 61 20 62 61 63 6B 67 72 6F 75 6E 64 20 20    e a background  
00D9A0:  6F 72 20 20 52 53 58 20 20 72 6F 75 74 69 6E 65    or  RSX  routine
00D9B0:  20 20 69 73 20 20 75 73 65 64 20 20 74 68 65 20      is  used  the 
00D9C0:  20 65 78 74 65 72 6E 61 6C 0D 0A 20 20 20 20 20     external..     
00D9D0:  20 20 63 6F 6D 6D 61 6E 64 20 6D 65 63 68 61 6E      command mechan
00D9E0:  69 73 6D 20 73 68 6F 75 6C 64 20 62 65 20 75 73    ism should be us
00D9F0:  65 64 20 74 6F 20 65 73 74 61 62 6C 69 73 68 20    ed to establish 
00DA00:  69 74 73 20 20 6A 75 6D 70 62 6C 6F 63 6B 20 20    its  jumpblock  
00DA10:  61 64 64 72 65 73 73 2E 0D 0A 20 20 20 20 20 20    address...      
00DA20:  20 54 68 69 73 20 6D 61 79 20 74 68 65 6E 20 62     This may then b
00DA30:  65 20 73 74 6F 72 65 64 20 61 6E 64 20 75 73 65    e stored and use
00DA40:  64 20 64 69 72 65 63 74 6C 79 20 66 6F 72 20 73    d directly for s
00DA50:  75 62 73 65 71 75 65 6E 74 20 63 61 6C 6C 73 20    ubsequent calls 
00DA60:  6F 66 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20    of  the..       
00DA70:  72 6F 75 74 69 6E 65 2E 20 49 74 20 69 73 20 66    routine. It is f
00DA80:  6F 6F 6C 69 73 68 20 74 6F 20 61 73 73 75 6D 65    oolish to assume
00DA90:  20 74 68 61 74 20 61 20 70 61 72 74 69 63 75 6C     that a particul
00DAA0:  61 72 20 62 61 63 6B 67 72 6F 75 6E 64 20 20 52    ar background  R
00DAB0:  4F 4D 20 20 69 73 0D 0A 20 20 20 20 20 20 20 61    OM  is..       a
00DAC0:  6C 77 61 79 73 20 70 6C 75 67 67 65 64 20 69 6E    lways plugged in
00DAD0:  74 6F 20 74 68 65 20 73 61 6D 65 20 73 6F 63 6B    to the same sock
00DAE0:  65 74 20 20 6F 72 20 20 74 68 61 74 20 20 61 20    et  or  that  a 
00DAF0:  20 72 65 6C 6F 63 61 74 61 62 6C 65 20 20 52 53     relocatable  RS
00DB00:  58 20 20 69 73 0D 0A 20 20 20 20 20 20 20 61 6C    X  is..       al
00DB10:  77 61 79 73 20 6C 6F 63 61 74 65 64 20 61 74 20    ways located at 
00DB20:  74 68 65 20 73 61 6D 65 20 61 64 64 72 65 73 73    the same address
00DB30:  2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
00DB40:  20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34        AMSTRAD CPC4
00DB50:  36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D    64/664/6128 FIRM
00DB60:  57 41 52 45 20 20 20 20 20 20 20 20 20 20 20 20    WARE            
00DB70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00DB80:  20 70 61 67 65 20 31 30 2E 38 0D 0A 0D 0A 0D 0A     page 10.8......
00DB90:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    ........       T
00DBA0:  68 65 20 66 69 72 73 74 20 74 69 6D 65 20 61 20    he first time a 
00DBB0:  62 61 63 6B 67 72 6F 75 6E 64 20 20 6F 72 20 20    background  or  
00DBC0:  52 53 58 20 20 72 6F 75 74 69 6E 65 20 20 69 73    RSX  routine  is
00DBD0:  20 20 75 73 65 64 20 20 74 68 65 20 20 65 78 74      used  the  ext
00DBE0:  65 72 6E 61 6C 0D 0A 20 20 20 20 20 20 20 63 6F    ernal..       co
00DBF0:  6D 6D 61 6E 64 20 6D 65 63 68 61 6E 69 73 6D 20    mmand mechanism 
00DC00:  73 68 6F 75 6C 64 20 62 65 20 75 73 65 64 20 74    should be used t
00DC10:  6F 20 65 73 74 61 62 6C 69 73 68 20 69 74 73 20    o establish its 
00DC20:  20 6A 75 6D 70 62 6C 6F 63 6B 20 20 61 64 64 72     jumpblock  addr
00DC30:  65 73 73 2E 0D 0A 20 20 20 20 20 20 20 54 68 69    ess...       Thi
00DC40:  73 20 6D 61 79 20 74 68 65 6E 20 62 65 20 73 74    s may then be st
00DC50:  6F 72 65 64 20 61 6E 64 20 75 73 65 64 20 64 69    ored and used di
00DC60:  72 65 63 74 6C 79 20 66 6F 72 20 73 75 62 73 65    rectly for subse
00DC70:  71 75 65 6E 74 20 63 61 6C 6C 73 20 6F 66 20 20    quent calls of  
00DC80:  74 68 65 0D 0A 20 20 20 20 20 20 20 72 6F 75 74    the..       rout
00DC90:  69 6E 65 2E 20 49 74 20 69 73 20 66 6F 6F 6C 69    ine. It is fooli
00DCA0:  73 68 20 74 6F 20 61 73 73 75 6D 65 20 74 68 61    sh to assume tha
00DCB0:  74 20 61 20 70 61 72 74 69 63 75 6C 61 72 20 62    t a particular b
00DCC0:  61 63 6B 67 72 6F 75 6E 64 20 20 52 4F 4D 20 20    ackground  ROM  
00DCD0:  69 73 0D 0A 20 20 20 20 20 20 20 61 6C 77 61 79    is..       alway
00DCE0:  73 20 70 6C 75 67 67 65 64 20 69 6E 74 6F 20 74    s plugged into t
00DCF0:  68 65 20 73 61 6D 65 20 73 6F 63 6B 65 74 20 20    he same socket  
00DD00:  6F 72 20 20 74 68 61 74 20 20 61 20 20 72 65 6C    or  that  a  rel
00DD10:  6F 63 61 74 61 62 6C 65 20 20 52 53 58 20 20 69    ocatable  RSX  i
00DD20:  73 0D 0A 20 20 20 20 20 20 20 61 6C 77 61 79 73    s..       always
00DD30:  20 6C 6F 63 61 74 65 64 20 61 74 20 74 68 65 20     located at the 
00DD40:  73 61 6D 65 20 61 64 64 72 65 73 73 2E 0D 0A 0D    same address....
00DD50:  0A 20 20 20 20 20 20 20 49 74 20 69 73 20 74 68    .       It is th
00DD60:  65 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F    e foreground pro
00DD70:  67 72 61 6D 27 73 20 72 65 73 70 6F 6E 73 69 62    gram's responsib
00DD80:  69 6C 69 74 79 20 74 6F 20 69 6E 76 6F 6B 65 20    ility to invoke 
00DD90:  20 74 68 65 20 20 65 78 74 65 72 6E 61 6C 0D 0A     the  external..
00DDA0:  20 20 20 20 20 20 20 63 6F 6D 6D 61 6E 64 20 6F           command o
00DDB0:  6E 63 65 20 69 74 73 20 61 64 64 72 65 73 73 20    nce its address 
00DDC0:  68 61 73 20 62 65 65 6E 20 66 6F 75 6E 64 2C 20    has been found, 
00DDD0:  61 6E 64 20 74 6F 20 70 61 73 73 20 69 74 73 20    and to pass its 
00DDE0:  70 61 72 61 6D 65 74 65 72 73 20 69 6E 0D 0A 20    parameters in.. 
00DDF0:  20 20 20 20 20 20 61 20 73 75 69 74 61 62 6C 65          a suitable
00DE00:  20 66 6F 72 6D 2E 20 42 41 53 49 43 20 69 6E 20     form. BASIC in 
00DE10:  74 68 65 20 6F 6E 2D 62 6F 61 72 64 20 52 4F 4D    the on-board ROM
00DE20:  20 66 75 6E 63 74 69 6F 6E 73 20 61 73 20 20 66     functions as  f
00DE30:  6F 6C 6C 6F 77 73 2C 20 20 61 6E 64 0D 0A 20 20    ollows,  and..  
00DE40:  20 20 20 20 20 73 68 6F 75 6C 64 20 73 65 72 76         should serv
00DE50:  65 20 61 73 20 61 20 6D 6F 64 65 6C 20 66 6F 72    e as a model for
00DE60:  20 6F 74 68 65 72 20 66 6F 72 65 67 72 6F 75 6E     other foregroun
00DE70:  64 20 70 72 6F 67 72 61 6D 73 20 69 66 20 6F 6E    d programs if on
00DE80:  6C 79 20 74 6F 20 61 6C 6C 6F 77 0D 0A 20 20 20    ly to allow..   
00DE90:  20 20 20 20 63 6F 6D 6D 6F 6E 20 75 73 65 20 6F        common use o
00DEA0:  66 20 63 6F 6D 6D 61 6E 64 73 20 62 79 20 6F 74    f commands by ot
00DEB0:  68 65 72 20 73 79 73 74 65 6D 73 3A 0D 0A 0D 0A    her systems:....
00DEC0:  20 20 20 20 20 20 20 20 20 20 20 41 6E 20 65 78               An ex
00DED0:  74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 20 69    ternal command i
00DEE0:  73 20 69 64 65 6E 74 69 66 69 65 64 20 62 79 20    s identified by 
00DEF0:  61 20 76 65 72 74 69 63 61 6C 20 62 61 72 20 28    a vertical bar (
00DF00:  27 7C 27 29 20 66 6F 6C 6C 6F 77 65 64 0D 0A 20    '|') followed.. 
00DF10:  20 20 20 20 20 20 20 20 20 20 62 79 20 74 68 65              by the
00DF20:  20 63 6F 6D 6D 61 6E 64 20 6E 61 6D 65 2C 20 6F     command name, o
00DF30:  70 74 69 6F 6E 61 6C 6C 79 20 66 6F 6C 6C 6F 77    ptionally follow
00DF40:  65 64 20 62 79 20 61 20 6C 69 73 74 20 6F 66 20    ed by a list of 
00DF50:  20 70 61 72 61 6D 65 74 65 72 73 2E 0D 0A 20 20     parameters...  
00DF60:  20 20 20 20 20 20 20 20 20 54 68 65 20 62 61 72             The bar
00DF70:  20 64 6F 65 73 20 6E 6F 74 20 66 6F 72 6D 20 70     does not form p
00DF80:  61 72 74 20 6F 66 20 74 68 65 20 63 6F 6D 6D 61    art of the comma
00DF90:  6E 64 20 6E 61 6D 65 2E 20 54 68 65 20 20 63 6F    nd name. The  co
00DFA0:  6D 6D 61 6E 64 20 20 6E 61 6D 65 0D 0A 20 20 20    mmand  name..   
00DFB0:  20 20 20 20 20 20 20 20 6D 75 73 74 20 63 6F 6E            must con
00DFC0:  73 69 73 74 20 6F 66 20 61 6C 70 68 61 62 65 74    sist of alphabet
00DFD0:  69 63 20 20 63 68 61 72 61 63 74 65 72 73 20 20    ic  characters  
00DFE0:  28 77 68 69 63 68 20 20 61 72 65 20 20 63 6F 6E    (which  are  con
00DFF0:  76 65 72 74 65 64 20 20 74 6F 0D 0A 20 20 20 20    verted  to..    
00E000:  20 20 20 20 20 20 20 75 70 70 65 72 20 63 61 73           upper cas
00E010:  65 29 2C 20 6E 75 6D 65 72 69 63 20 63 68 61 72    e), numeric char
00E020:  61 63 74 65 72 73 20 6F 72 20 64 6F 74 73 2E 0D    acters or dots..
00E030:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 50 61    ...           Pa
00E040:  72 61 6D 65 74 65 72 73 20 61 72 65 20 70 61 73    rameters are pas
00E050:  73 65 64 20 62 79 20 76 61 6C 75 65 2C 20 74 68    sed by value, th
00E060:  61 74 20 69 73 20 65 61 63 68 20 70 61 72 61 6D    at is each param
00E070:  65 74 65 72 20 20 6D 61 79 20 20 62 65 20 20 61    eter  may  be  a
00E080:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 6E 75 6D    ..           num
00E090:  65 72 69 63 20 65 78 70 72 65 73 73 69 6F 6E 2C    eric expression,
00E0A0:  20 74 68 65 20 63 61 6C 63 75 6C 61 74 65 64 20     the calculated 
00E0B0:  76 61 6C 75 65 20 6F 66 20 77 68 69 63 68 20 69    value of which i
00E0C0:  73 20 70 61 73 73 65 64 2C 20 6F 72 20 61 6E 0D    s passed, or an.
00E0D0:  0A 20 20 20 20 20 20 20 20 20 20 20 61 64 64 72    .           addr
00E0E0:  65 73 73 2E 20 54 68 65 20 6E 75 6D 62 65 72 20    ess. The number 
00E0F0:  61 6E 64 20 74 79 70 65 20 6F 66 20 70 61 72 61    and type of para
00E100:  6D 65 74 65 72 73 20 6D 75 73 74 20 62 65 20 61    meters must be a
00E110:  67 72 65 65 64 20 20 62 65 74 77 65 65 6E 0D 0A    greed  between..
00E120:  20 20 20 20 20 20 20 20 20 20 20 74 68 65 20 42               the B
00E130:  41 53 49 43 20 70 72 6F 67 72 61 6D 20 20 61 6E    ASIC program  an
00E140:  64 20 20 74 68 65 20 20 63 6F 6D 6D 61 6E 64 20    d  the  command 
00E150:  20 62 65 63 61 75 73 65 20 20 42 41 53 49 43 20     because  BASIC 
00E160:  20 70 65 72 66 6F 72 6D 73 20 20 6E 6F 0D 0A 20     performs  no.. 
00E170:  20 20 20 20 20 20 20 20 20 20 63 68 65 63 6B 69              checki
00E180:  6E 67 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ng.....         
00E190:  20 20 45 61 63 68 20 70 61 72 61 6D 65 74 65 72      Each parameter
00E1A0:  20 70 61 73 73 65 64 20 69 73 20 61 20 74 77 6F     passed is a two
00E1B0:  20 62 79 74 65 20 6E 75 6D 62 65 72 2C 20 20 77     byte number,  w
00E1C0:  68 6F 73 65 20 20 69 6E 74 65 72 70 72 65 74 61    hose  interpreta
00E1D0:  74 69 6F 6E 0D 0A 20 20 20 20 20 20 20 20 20 20    tion..          
00E1E0:  20 64 65 70 65 6E 64 73 20 6F 6E 20 69 74 73 20     depends on its 
00E1F0:  74 79 70 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    type:....       
00E200:  20 20 20 20 49 6E 74 65 67 65 72 20 65 78 70 72        Integer expr
00E210:  65 73 73 69 6F 6E 3A 20 20 20 20 20 20 74 77 6F    ession:      two
00E220:  27 73 20 63 6F 6D 70 6C 65 6D 65 6E 74 20 20 76    's complement  v
00E230:  61 6C 75 65 20 20 6F 66 20 20 74 68 65 20 20 49    alue  of  the  I
00E240:  6E 74 65 67 65 72 0D 0A 20 20 20 20 20 20 20 20    nteger..        
00E250:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00E260:  20 20 20 20 20 20 20 20 20 20 20 20 72 65 73 75                resu
00E270:  6C 74 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20    lt...           
00E280:  52 65 61 6C 20 65 78 70 72 65 73 73 69 6F 6E 3A    Real expression:
00E290:  20 20 20 20 20 20 20 20 20 74 68 65 20 20 52 65             the  Re
00E2A0:  61 6C 20 20 72 65 73 75 6C 74 20 20 66 6F 72 63    al  result  forc
00E2B0:  65 64 20 20 20 74 6F 20 20 20 55 6E 73 69 67 6E    ed   to   Unsign
00E2C0:  65 64 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ed..            
00E2D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00E2E0:  20 20 20 20 20 20 20 20 49 6E 74 65 67 65 72 2E            Integer.
00E2F0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 56 61 72    ..           Var
00E300:  69 61 62 6C 65 20 72 65 66 65 72 65 6E 63 65 3A    iable reference:
00E310:  20 20 20 20 20 20 61 64 64 72 65 73 73 20 6F 66          address of
00E320:  20 74 68 65 20 76 61 6C 75 65 20 6F 66 20 61 20     the value of a 
00E330:  76 61 72 69 61 62 6C 65 20 28 66 6F 72 20 61 0D    variable (for a.
00E340:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
00E350:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00E360:  20 20 20 20 20 73 74 72 69 6E 67 20 20 74 68 69         string  thi
00E370:  73 20 20 69 73 20 20 74 68 65 20 20 61 64 64 72    s  is  the  addr
00E380:  65 73 73 20 20 20 6F 66 20 20 20 74 68 65 0D 0A    ess   of   the..
00E390:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00E3A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00E3B0:  20 20 20 20 64 65 73 63 72 69 70 74 6F 72 29 2E        descriptor).
00E3C0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 41 20 73    ..           A s
00E3D0:  74 72 69 6E 67 20 64 65 73 63 72 69 70 74 6F 72    tring descriptor
00E3E0:  20 69 73 20 74 68 72 65 65 20 20 62 79 74 65 73     is three  bytes
00E3F0:  20 20 6C 6F 6E 67 2E 20 20 42 79 74 65 20 20 30      long.  Byte  0
00E400:  20 20 63 6F 6E 74 61 69 6E 73 20 20 74 68 65 0D      contains  the.
00E410:  0A 20 20 20 20 20 20 20 20 20 20 20 6C 65 6E 67    .           leng
00E420:  74 68 20 6F 66 20 74 68 65 20 73 74 72 69 6E 67    th of the string
00E430:  2E 20 42 79 74 65 73 20 31 20 61 6E 64 20 32 20    . Bytes 1 and 2 
00E440:  63 6F 6E 74 61 69 6E 20 74 68 65 20 61 64 64 72    contain the addr
00E450:  65 73 73 20 77 68 65 72 65 20 20 74 68 65 0D 0A    ess where  the..
00E460:  20 20 20 20 20 20 20 20 20 20 20 73 74 72 69 6E               strin
00E470:  67 20 69 73 20 73 74 6F 72 65 64 2E 20 49 66 20    g is stored. If 
00E480:  74 68 65 20 73 74 72 69 6E 67 20 6C 65 6E 67 74    the string lengt
00E490:  68 20 69 73 20 30 20 74 68 65 6E 20 20 74 68 65    h is 0 then  the
00E4A0:  20 20 61 64 64 72 65 73 73 20 20 6F 66 0D 0A 20      address  of.. 
00E4B0:  20 20 20 20 20 20 20 20 20 20 74 68 65 20 20 73              the  s
00E4C0:  74 72 69 6E 67 20 20 69 73 20 20 6D 65 61 6E 69    tring  is  meani
00E4D0:  6E 67 6C 65 73 73 2E 20 20 53 74 72 69 6E 67 20    ngless.  String 
00E4E0:  20 76 61 72 69 61 62 6C 65 73 20 20 6D 61 79 20     variables  may 
00E4F0:  20 62 65 20 20 63 68 61 6E 67 65 64 0D 0A 20 20     be  changed..  
00E500:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
00E510:  0C 00 00 00 02 09 50 E5 0C 00 C1 02 00 00 00 02    ......P.........
00E520:  0C 00 C2 02 00 00 00 02 0C 00 C3 02 00 00 00 02    ................
00E530:  0C 00 C4 02 00 00 00 02 0C 00 C5 02 00 00 00 02    ................
00E540:  0C 00 C6 02 00 00 00 02 0C 00 C7 02 00 00 00 02    ................
00E550:  0C 00 C8 02 00 00 00 02 0C 00 C9 02 00 00 00 02    ................
00E560:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E570:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E580:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E590:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E5F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00E600:  20 20 20 20 20 20 20 20 20 70 72 6F 76 69 64 69             providi
00E610:  6E 67 20 74 68 61 74 20 74 68 65 20 73 74 72 69    ng that the stri
00E620:  6E 67 20 64 65 73 63 72 69 70 74 6F 72 20 69 73    ng descriptor is
00E630:  20 6E 6F 74 20 61 6C 74 65 72 65 64 20 69 6E 20     not altered in 
00E640:  61 6E 79 20 77 61 79 2E 0D 0A 0D 0A 20 20 20 20    any way.....    
00E650:  20 20 20 45 6E 74 72 79 3A 0D 0A 20 20 20 20 20       Entry:..     
00E660:  20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73          A contains
00E670:  20 74 68 65 20 6E 75 6D 62 65 72 20 6F 66 20 70     the number of p
00E680:  61 72 61 6D 65 74 65 72 73 2E 0D 0A 20 20 20 20    arameters...    
00E690:  20 20 20 20 20 20 20 49 58 20 63 6F 6E 74 61 69           IX contai
00E6A0:  6E 73 20 74 68 65 20 61 64 64 72 65 73 73 20 6F    ns the address o
00E6B0:  66 20 74 68 65 20 70 61 72 61 6D 65 74 65 72 73    f the parameters
00E6C0:  2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 49 59    ...           IY
00E6D0:  20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 61 64     contains the ad
00E6E0:  64 72 65 73 73 20 6F 66 20 20 74 68 65 20 20 52    dress of  the  R
00E6F0:  4F 4D 27 73 20 20 75 70 70 65 72 20 20 64 61 74    OM's  upper  dat
00E700:  61 20 20 61 72 65 61 20 20 69 66 20 20 74 68 65    a  area  if  the
00E710:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 63 6F 6D    ..           com
00E720:  6D 61 6E 64 20 77 61 73 20 66 6F 75 6E 64 20 69    mand was found i
00E730:  6E 20 61 20 62 61 63 6B 67 72 6F 75 6E 64 20 52    n a background R
00E740:  4F 4D 2E 20 49 66 20 74 68 65 20 63 6F 6D 6D 61    OM. If the comma
00E750:  6E 64 20 77 61 73 20 66 6F 75 6E 64 20 69 6E 0D    nd was found in.
00E760:  0A 20 20 20 20 20 20 20 20 20 20 20 61 6E 20 52    .           an R
00E770:  53 58 27 73 20 65 78 74 65 72 6E 61 6C 20 63 6F    SX's external co
00E780:  6D 6D 61 6E 64 20 74 61 62 6C 65 20 74 68 65 6E    mmand table then
00E790:  20 49 59 20 69 73 20 75 6E 64 65 66 69 6E 65 64     IY is undefined
00E7A0:  2E 0D 0A 20 20 20 20 20 20 20 45 78 69 74 3A 0D    ...       Exit:.
00E7B0:  0A 20 20 20 20 20 20 20 20 20 20 20 41 46 2C 42    .           AF,B
00E7C0:  43 2C 44 45 2C 48 4C 2C 49 58 20 61 6E 64 20 49    C,DE,HL,IX and I
00E7D0:  59 20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20    Y corrupt...    
00E7E0:  20 20 20 20 20 20 20 41 6C 74 65 72 6E 61 74 65           Alternate
00E7F0:  20 72 65 67 69 73 74 65 72 20 73 65 74 20 75 6E     register set un
00E800:  74 6F 75 63 68 65 64 2E 0D 0A 20 20 20 20 20 20    touched...      
00E810:  20 4E 6F 74 65 73 3A 0D 0A 20 20 20 20 20 20 20     Notes:..       
00E820:  20 20 20 20 49 6E 64 65 78 20 72 65 67 69 73 74        Index regist
00E830:  65 72 20 49 58 20 63 6F 6E 74 61 69 6E 73 20 74    er IX contains t
00E840:  68 65 20 61 64 64 72 65 73 73 20 6F 66 20 74 68    he address of th
00E850:  65 20 70 61 72 61 6D 65 74 65 72 73 2E 20 49 66    e parameters. If
00E860:  20 74 68 65 72 65 0D 0A 20 20 20 20 20 20 20 20     there..        
00E870:  20 20 20 61 72 65 20 6E 6F 20 70 61 72 61 6D 65       are no parame
00E880:  74 65 72 73 20 74 68 65 6E 20 74 68 65 20 69 74    ters then the it
00E890:  68 20 70 61 72 61 6D 65 74 65 72 20 69 73 20 61    h parameter is a
00E8A0:  74 20 6F 66 66 73 65 74 20 28 6E 2D 69 29 78 32    t offset (n-i)x2
00E8B0:  20 66 72 6F 6D 0D 0A 20 20 20 20 20 20 20 20 20     from..         
00E8C0:  20 20 74 68 65 20 69 6E 64 65 78 20 72 65 67 69      the index regi
00E8D0:  73 74 65 72 20 61 64 64 72 65 73 73 20 2D 20 20    ster address -  
00E8E0:  73 6F 20 20 74 68 65 20 20 31 73 74 20 20 70 61    so  the  1st  pa
00E8F0:  72 61 6D 65 74 65 72 20 20 69 73 20 20 61 74 20    rameter  is  at 
00E900:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20     the..          
00E910:  20 6C 61 72 67 65 73 74 20 6F 66 66 73 65 74 2C     largest offset,
00E920:  20 61 6E 64 20 74 68 65 20 6C 61 73 74 20 70 61     and the last pa
00E930:  72 61 6D 65 74 65 72 20 69 73 20 70 6F 69 6E 74    rameter is point
00E940:  65 64 20 74 6F 20 62 79 20 49 58 2E 0D 0A 0D 0A    ed to by IX.....
00E950:  20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 49               The I
00E960:  59 20 72 65 67 69 73 74 65 72 20 69 73 20 73 65    Y register is se
00E970:  74 20 62 79 20 74 68 65 20 4B 65 72 6E 65 6C 20    t by the Kernel 
00E980:  61 6E 64 20 6E 6F 74 20 62 79 20 42 41 53 49 43    and not by BASIC
00E990:  2E 20 54 68 65 20 20 41 20 20 61 6E 64 0D 0A 20    . The  A  and.. 
00E9A0:  20 20 20 20 20 20 20 20 20 20 49 58 20 72 65 67              IX reg
00E9B0:  69 73 74 65 72 73 20 61 6E 64 20 74 68 65 20 70    isters and the p
00E9C0:  61 72 61 6D 65 74 65 72 20 61 72 65 61 20 61 72    arameter area ar
00E9D0:  65 20 73 65 74 20 62 79 20 42 41 53 49 43 2E 0D    e set by BASIC..
00E9E0:  0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41    ...       AMSTRA
00E9F0:  44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32    D CPC464/664/612
00EA00:  38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20    8 FIRMWARE      
00EA10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00EA20:  20 20 20 20 20 20 20 70 61 67 65 20 31 30 2E 39           page 10.9
00EA30:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
00EA40:  20 20 20 20 20 31 30 2E 37 20 45 78 61 6D 70 6C         10.7 Exampl
00EA50:  65 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    es.......       
00EA60:  61 29 20 41 20 73 69 6D 70 6C 65 20 65 78 74 65    a) A simple exte
00EA70:  72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 2E 0D 0A 0D    rnal command....
00EA80:  0A 0D 0A 20 20 20 20 20 20 20 54 68 69 73 20 65    ...       This e
00EA90:  78 61 6D 70 6C 65 20 75 73 65 73 20 74 68 65 20    xample uses the 
00EAA0:  42 49 4F 53 20 72 6F 75 74 69 6E 65 20 53 45 54    BIOS routine SET
00EAB0:  20 4D 45 53 53 41 47 45 20 74 68 61 74 20 69 73     MESSAGE that is
00EAC0:  20 61 76 61 69 6C 61 62 6C 65 20 61 73 20 61 6E     available as an
00EAD0:  0D 0A 20 20 20 20 20 20 20 65 78 74 65 72 6E 61    ..       externa
00EAE0:  6C 20 63 6F 6D 6D 61 6E 64 20 75 6E 64 65 72 20    l command under 
00EAF0:  41 4D 53 44 4F 53 2E 20 53 45 54 20 4D 45 53 53    AMSDOS. SET MESS
00EB00:  41 47 45 20 74 75 72 6E 73 20 6F 6E 20 6F 72 20    AGE turns on or 
00EB10:  20 6F 66 66 20 20 74 68 65 20 20 64 69 73 63 0D     off  the  disc.
00EB20:  0A 20 20 20 20 20 20 20 65 72 72 6F 72 20 6D 65    .       error me
00EB30:  73 73 61 67 65 73 20 61 6E 64 20 68 61 73 20 74    ssages and has t
00EB40:  68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20 69 6E 74    he following int
00EB50:  65 72 66 61 63 65 3A 0D 0A 0D 0A 0D 0A 20 20 20    erface:......   
00EB60:  20 20 20 20 20 20 20 20 53 45 54 20 4D 45 53 53            SET MESS
00EB70:  41 47 45 20 20 20 20 20 20 20 20 20 20 20 20 20    AGE             
00EB80:  20 20 20 20 20 20 20 20 20 20 20 43 6F 6D 6D 61               Comma
00EB90:  6E 64 20 6E 61 6D 65 3A 43 6F 6E 74 72 6F 6C 20    nd name:Control 
00EBA0:  41 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    A......         
00EBB0:  20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74 69 6F      Entry conditio
00EBC0:  6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ns:......       
00EBD0:  20 20 20 20 20 20 20 20 20 41 20 3D 20 23 30 30             A = #00
00EBE0:  20 3D 3E 20 20 54 75 72 6E 20 64 69 73 63 20 65     =>  Turn disc e
00EBF0:  72 72 6F 72 20 6D 65 73 73 61 67 65 73 20 6F 6E    rror messages on
00EC00:  2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
00EC10:  20 20 20 41 20 3D 20 23 46 46 20 3D 3E 20 20 54       A = #FF =>  T
00EC20:  75 72 6E 20 64 69 73 63 20 65 72 72 6F 72 20 6D    urn disc error m
00EC30:  65 73 73 61 67 65 73 20 6F 66 66 2E 0D 0A 0D 0A    essages off.....
00EC40:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 45 78 69    ..           Exi
00EC50:  74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    t conditions:...
00EC60:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
00EC70:  20 20 20 41 20 3D 20 50 72 65 76 69 6F 73 20 73       A = Previos s
00EC80:  74 61 74 65 2E 0D 0A 20 20 20 20 20 20 20 20 20    tate...         
00EC90:  20 20 20 20 20 20 20 48 4C 20 61 6E 64 20 66 6C           HL and fl
00ECA0:  61 67 73 20 63 6F 72 72 75 70 74 2E 0D 0A 0D 0A    ags corrupt.....
00ECB0:  0D 0A 20 20 20 20 20 20 20 42 65 66 6F 72 65 20    ..       Before 
00ECC0:  69 74 20 69 73 20 70 6F 73 73 69 62 6C 65 20 74    it is possible t
00ECD0:  6F 20 75 73 65 20 74 68 65 20 65 78 74 65 72 6E    o use the extern
00ECE0:  61 6C 20 63 6F 6D 6D 61 6E 64 20 69 74 20 69 73    al command it is
00ECF0:  20 20 6E 65 63 65 73 73 61 72 79 20 20 74 6F 0D      necessary  to.
00ED00:  0A 20 20 20 20 20 20 20 65 73 74 61 62 6C 69 73    .       establis
00ED10:  68 20 74 68 65 20 73 74 6F 72 65 20 61 6E 64 20    h the store and 
00ED20:  66 61 72 20 20 61 64 64 72 65 73 73 20 20 6F 66    far  address  of
00ED30:  20 20 74 68 65 20 20 72 6F 75 74 69 6E 65 2E 20      the  routine. 
00ED40:  20 54 68 69 73 20 20 6D 61 79 20 20 62 65 0D 0A     This  may  be..
00ED50:  20 20 20 20 20 20 20 70 65 72 66 6F 72 6D 65 64           performed
00ED60:  20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D 0A 0D 0A     as follows:....
00ED70:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
00ED80:  20 20 4C 44 20 48 4C 2C 43 4D 44 5F 4E 41 4D 45      LD HL,CMD_NAME
00ED90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00EDA0:  3B 50 6F 69 6E 74 65 72 20 74 6F 20 63 6F 6D 6D    ;Pointer to comm
00EDB0:  61 6E 64 20 6E 61 6D 65 0D 0A 20 20 20 20 20 20    and name..      
00EDC0:  20 20 20 20 20 20 20 20 20 20 43 41 4C 4C 20 4B              CALL K
00EDD0:  4C 5F 46 49 4E 44 5F 43 4F 4D 4D 41 4E 44 20 20    L_FIND_COMMAND  
00EDE0:  20 20 20 20 20 20 20 20 3B 41 73 6B 20 4B 65 72            ;Ask Ker
00EDF0:  6E 65 6C 20 77 68 65 72 65 20 69 74 20 69 73 0D    nel where it is.
00EE00:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
00EE10:  20 4A 52 20 4E 43 2C 45 52 52 4F 52 5F 52 4F 55     JR NC,ERROR_ROU
00EE20:  54 49 4E 45 20 20 20 20 20 20 20 20 20 20 20 3B    TINE           ;
00EE30:  43 6F 6D 6D 61 6E 64 20 6E 6F 74 20 66 6F 75 6E    Command not foun
00EE40:  64 20 65 72 72 6F 72 0D 0A 20 20 20 20 20 20 20    d error..       
00EE50:  3B 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ;..             
00EE60:  20 20 20 4C 44 20 28 43 4D 44 5F 46 41 52 5F 41       LD (CMD_FAR_A
00EE70:  44 44 52 45 53 53 2B 30 29 2C 48 4C 20 20 20 20    DDRESS+0),HL    
00EE80:  20 3B 53 74 6F 72 65 20 61 64 64 72 65 73 73 0D     ;Store address.
00EE90:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
00EEA0:  20 4C 44 20 41 2C 43 0D 0A 20 20 20 20 20 20 20     LD A,C..       
00EEB0:  20 20 20 20 20 20 20 20 20 4C 44 20 28 43 4D 44             LD (CMD
00EEC0:  5F 46 41 52 5F 41 44 44 52 45 53 53 2B 32 29 2C    _FAR_ADDRESS+2),
00EED0:  41 20 20 20 20 20 20 53 74 6F 72 65 20 52 4F 4D    A      Store ROM
00EEE0:  20 6E 75 6D 62 65 72 0D 0A 0D 0A 20 20 20 20 20     number....     
00EEF0:  20 20 43 4D 44 5F 4E 41 4D 45 3A 20 20 20 20 20      CMD_NAME:     
00EF00:  20 20 20 20 20 44 45 46 42 20 23 30 31 2B 23 38         DEFB #01+#8
00EF10:  30 20 20 20 20 20 20 20 20 3B 43 6F 6E 74 72 6F    0        ;Contro
00EF20:  6C 20 41 20 3D 20 23 30 31 0D 0A 20 20 20 20 20    l A = #01..     
00EF30:  20 20 43 4D 44 5F 46 41 52 5F 41 44 44 52 45 53      CMD_FAR_ADDRES
00EF40:  53 20 20 20 20 44 45 46 53 20 33 20 20 20 20 20    S    DEFS 3     
00EF50:  20 20 20 20 20 20 20 20 20 3B 41 72 65 61 20 66             ;Area f
00EF60:  6F 72 20 73 74 6F 72 69 6E 67 20 66 61 72 20 61    or storing far a
00EF70:  64 64 72 65 73 73 0D 0A 0D 0A 0D 0A 20 20 20 20    ddress......    
00EF80:  20 20 20 48 61 76 69 6E 67 20 66 6F 75 6E 64 20       Having found 
00EF90:  74 68 65 20 66 61 72 20 61 64 64 72 65 73 73 20    the far address 
00EFA0:  6F 66 20 74 68 65 20 72 6F 75 74 69 6E 65 20 69    of the routine i
00EFB0:  74 20 63 61 6E 20 6E 6F 77 20 62 65 20 63 61 6C    t can now be cal
00EFC0:  6C 65 64 2E 20 20 46 6F 72 0D 0A 20 20 20 20 20    led.  For..     
00EFD0:  20 20 65 78 61 6D 70 6C 65 3A 0D 0A 0D 0A 0D 0A      example:......
00EFE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00EFF0:  4C 44 20 41 2C 30 20 20 20 20 20 20 20 20 20 20    LD A,0          
00F000:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B 45                  ;E
00F010:  6E 61 62 6C 65 20 6D 65 73 73 61 67 65 73 0D 0A    nable messages..
00F020:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F030:  52 53 54 20 33 20 20 20 20 20 20 20 20 20 20 20    RST 3           
00F040:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B 46                  ;F
00F050:  61 72 20 43 41 4C 4C 0D 0A 20 20 20 20 20 20 20    ar CALL..       
00F060:  20 20 20 20 20 20 20 20 20 44 45 46 57 20 43 4D             DEFW CM
00F070:  44 5F 46 41 52 5F 41 44 44 52 45 53 53 20 20 20    D_FAR_ADDRESS   
00F080:  20 20 20 20 20 20 20 3B 50 6F 69 6E 74 65 72 20           ;Pointer 
00F090:  74 6F 20 66 61 72 20 61 64 64 72 65 73 73 0D 0A    to far address..
00F0A0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
00F0B0:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
00F0C0:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
00F0D0:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
00F0E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F0F0:  20 70 61 67 65 20 31 30 2E 31 30 0D 0A 0D 0A 0D     page 10.10.....
00F100:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
00F110:  62 29 20 41 20 63 6F 6D 70 6C 65 78 20 65 78 74    b) A complex ext
00F120:  65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 0D 0A 0D    ernal command...
00F130:  0A 0D 0A 20 20 20 20 20 20 20 54 68 69 73 20 65    ...       This e
00F140:  78 61 6D 70 6C 65 20 75 73 65 73 20 74 68 65 20    xample uses the 
00F150:  49 4E 43 48 41 52 20 65 78 74 65 72 6E 61 6C 20    INCHAR external 
00F160:  63 6F 6D 6D 61 6E 64 20 70 72 6F 76 69 64 65 64    command provided
00F170:  20 62 79 20 20 74 68 65 20 20 73 65 72 69 61 6C     by  the  serial
00F180:  0D 0A 20 20 20 20 20 20 20 69 6E 74 65 72 66 61    ..       interfa
00F190:  63 65 2E 20 49 4E 43 48 41 52 20 72 65 61 64 73    ce. INCHAR reads
00F1A0:  20 61 20 63 68 61 72 61 63 74 65 72 20 66 72 6F     a character fro
00F1B0:  6D 20 74 68 65 20 53 65 72 69 61 6C 20 49 6E 74    m the Serial Int
00F1C0:  65 72 66 61 63 65 20 61 6E 64 20 20 68 61 73 0D    erface and  has.
00F1D0:  0A 20 20 20 20 20 20 20 74 68 65 20 66 6F 6C 6C    .       the foll
00F1E0:  6F 77 69 6E 67 20 69 6E 74 65 72 66 61 63 65 3A    owing interface:
00F1F0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ......          
00F200:  20 49 4E 43 48 41 52 20 20 20 20 20 20 20 20 20     INCHAR         
00F210:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F220:  20 20 20 20 43 6F 6D 6D 61 6E 64 20 6E 61 6D 65        Command name
00F230:  3A 49 4E 43 48 41 52 0D 0A 0D 0A 0D 0A 20 20 20    :INCHAR......   
00F240:  20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74        Entry condit
00F250:  69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions:......     
00F260:  20 20 20 20 20 20 20 20 20 20 20 41 20 3D 20 4E               A = N
00F270:  75 6D 62 65 72 20 6F 66 20 70 61 72 61 6D 65 74    umber of paramet
00F280:  65 72 73 20 28 73 68 6F 75 6C 64 20 62 65 20 32    ers (should be 2
00F290:  29 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    )...            
00F2A0:  20 20 20 20 49 58 20 3D 20 41 64 64 72 65 73 73        IX = Address
00F2B0:  20 6F 66 20 70 61 72 61 6D 65 74 65 72 20 62 6C     of parameter bl
00F2C0:  6F 63 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ock.....        
00F2D0:  20 20 20 20 20 20 20 20 49 58 2B 32 20 3D 20 41            IX+2 = A
00F2E0:  64 64 72 65 73 73 20 74 6F 20 73 74 6F 72 65 20    ddress to store 
00F2F0:  73 74 61 74 75 73 2F 0D 0A 20 20 20 20 20 20 20    status/..       
00F300:  20 20 20 20 20 20 20 20 20 49 58 2B 30 20 3D 20             IX+0 = 
00F310:  41 64 64 72 65 73 73 20 74 6F 20 73 74 6F 72 65    Address to store
00F320:  20 63 68 61 72 61 63 74 65 72 20 72 65 61 64 2E     character read.
00F330:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69    ......       Exi
00F340:  74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    t conditions:...
00F350:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
00F360:  20 20 20 41 46 2C 42 43 2C 44 45 2C 48 4C 2C 49       AF,BC,DE,HL,I
00F370:  58 20 61 6E 64 20 49 59 20 63 6F 72 72 75 70 74    X and IY corrupt
00F380:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 42 65    .......       Be
00F390:  66 6F 72 65 20 69 74 20 69 73 20 70 6F 73 73 69    fore it is possi
00F3A0:  62 6C 65 20 74 6F 20 75 73 65 20 74 68 65 20 65    ble to use the e
00F3B0:  78 74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 20    xternal command 
00F3C0:  69 74 20 69 73 20 20 6E 65 63 65 73 73 61 72 79    it is  necessary
00F3D0:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 65 73 74      to..       est
00F3E0:  61 62 6C 69 73 68 20 61 6E 64 20 73 74 6F 72 65    ablish and store
00F3F0:  20 74 68 65 20 66 61 72 20 20 61 64 64 72 65 73     the far  addres
00F400:  73 20 20 6F 66 20 20 74 68 65 20 20 72 6F 75 74    s  of  the  rout
00F410:  69 6E 65 2E 20 20 54 68 69 73 20 20 6D 61 79 20    ine.  This  may 
00F420:  20 62 65 0D 0A 20 20 20 20 20 20 20 70 65 72 66     be..       perf
00F430:  6F 72 6D 65 64 20 61 73 20 66 6F 6C 6C 6F 77 73    ormed as follows
00F440:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    :......         
00F450:  20 20 20 20 20 20 20 4C 44 20 48 4C 2C 43 4D 44           LD HL,CMD
00F460:  5F 54 41 42 4C 45 20 20 20 20 20 20 20 20 20 20    _TABLE          
00F470:  20 20 20 20 20 3B 50 6F 69 6E 74 65 72 20 74 6F         ;Pointer to
00F480:  20 63 6F 6D 6D 61 6E 64 20 6E 61 6D 65 0D 0A 20     command name.. 
00F490:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43                   C
00F4A0:  41 4C 4C 20 4B 4C 5F 46 49 4E 44 5F 43 4F 4D 4D    ALL KL_FIND_COMM
00F4B0:  41 4E 44 20 20 20 20 20 20 20 20 20 20 3B 41 73    AND          ;As
00F4C0:  6B 20 4B 65 72 6E 65 6C 20 77 68 65 72 65 20 69    k Kernel where i
00F4D0:  74 20 69 73 0D 0A 20 20 20 20 20 20 20 20 20 20    t is..          
00F4E0:  20 20 20 20 20 20 4A 52 20 4E 43 2C 45 52 52 4F          JR NC,ERRO
00F4F0:  52 5F 52 4F 55 54 49 4E 45 20 20 20 20 20 20 20    R_ROUTINE       
00F500:  20 20 20 20 3B 43 6F 6D 6D 61 6E 64 20 6E 6F 74        ;Command not
00F510:  20 66 6F 75 6E 64 20 65 72 72 6F 72 0D 0A 20 20     found error..  
00F520:  20 20 20 20 20 3B 0D 0A 20 20 20 20 20 20 20 20         ;..        
00F530:  20 20 20 20 20 20 20 20 4C 44 20 28 43 4D 44 5F            LD (CMD_
00F540:  46 41 52 5F 41 44 44 52 45 53 53 2B 30 29 2C 48    FAR_ADDRESS+0),H
00F550:  4C 20 20 20 20 20 3B 53 74 6F 72 65 20 61 64 64    L     ;Store add
00F560:  72 65 73 73 0D 0A 20 20 20 20 20 20 20 20 20 20    ress..          
00F570:  20 20 20 20 20 20 4C 44 20 41 2C 43 0D 0A 20 20          LD A,C..  
00F580:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 4C 44                  LD
00F590:  20 28 43 4D 44 5F 46 41 52 5F 41 44 44 52 45 53     (CMD_FAR_ADDRES
00F5A0:  53 2B 32 29 2C 41 20 20 20 20 20 20 3B 53 74 6F    S+2),A      ;Sto
00F5B0:  72 65 20 52 4F 4D 20 6E 75 6D 62 65 72 0D 0A 0D    re ROM number...
00F5C0:  0A 20 20 20 20 20 20 20 43 4D 44 5F 4E 41 4D 45    .       CMD_NAME
00F5D0:  3A 20 20 20 20 20 20 20 20 20 20 44 45 46 42 20    :          DEFB 
00F5E0:  27 49 4E 43 48 41 27 2C 27 52 27 2B 23 38 30 0D    'INCHA','R'+#80.
00F5F0:  0A 20 20 20 20 20 20 20 43 4D 44 5F 46 41 52 5F    .       CMD_FAR_
00F600:  41 44 44 52 45 53 53 3A 20 20 20 44 45 46 53 20    ADDRESS:   DEFS 
00F610:  33 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B    3              ;
00F620:  41 72 65 61 20 66 6F 72 20 73 74 6F 72 69 6E 67    Area for storing
00F630:  20 66 61 72 20 61 64 64 72 65 73 73 0D 0A 0D 0A     far address....
00F640:  20 20 20 20 20 20 20 48 61 76 69 6E 67 20 66 6F           Having fo
00F650:  75 6E 64 20 74 68 65 20 66 61 72 20 61 64 64 72    und the far addr
00F660:  65 73 73 20 6F 66 20 74 68 65 20 72 6F 75 74 69    ess of the routi
00F670:  6E 65 20 69 74 20 63 61 6E 20 6E 6F 77 20 62 65    ne it can now be
00F680:  20 63 61 6C 6C 65 64 2E 20 20 46 6F 72 0D 0A 20     called.  For.. 
00F690:  20 20 20 20 20 20 65 78 61 6D 70 6C 65 3A 0D 0A          example:..
00F6A0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
00F6B0:  20 20 4C 44 20 41 2C 32 20 20 20 20 20 20 20 20      LD A,2        
00F6C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F6D0:  3B 32 20 70 61 72 61 6D 65 74 65 72 73 0D 0A 20    ;2 parameters.. 
00F6E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4C                   L
00F6F0:  44 20 49 58 2C 50 41 52 41 4D 5F 42 4C 4F 43 4B    D IX,PARAM_BLOCK
00F700:  20 20 20 20 20 20 20 20 20 20 20 20 20 3B 41 64                 ;Ad
00F710:  64 72 65 73 73 20 6F 66 20 70 61 72 61 6D 65 74    dress of paramet
00F720:  65 72 20 62 6C 6F 63 6B 0D 0A 20 20 20 20 20 20    er block..      
00F730:  20 20 20 20 20 20 20 20 20 20 52 53 54 20 33 20              RST 3 
00F740:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F750:  20 20 20 20 20 20 20 20 3B 46 41 52 20 43 41 4C            ;FAR CAL
00F760:  4C 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    L..             
00F770:  20 20 20 44 45 46 57 20 43 4D 44 5F 46 41 52 5F       DEFW CMD_FAR_
00F780:  41 44 44 52 45 53 53 20 20 20 20 20 20 20 20 20    ADDRESS         
00F790:  20 3B 50 6F 69 6E 74 65 72 20 74 6F 20 66 61 72     ;Pointer to far
00F7A0:  20 61 64 64 72 65 73 73 0D 0A 20 20 20 20 20 20     address..      
00F7B0:  20 20 20 20 20 20 20 20 20 20 4C 44 20 48 4C 2C              LD HL,
00F7C0:  28 53 54 41 54 55 53 29 20 20 20 20 20 20 20 20    (STATUS)        
00F7D0:  20 20 20 20 20 20 20 20 3B 48 4C 3D 53 65 72 69            ;HL=Seri
00F7E0:  61 6C 20 49 6E 74 65 72 66 61 63 65 20 73 74 61    al Interface sta
00F7F0:  74 75 73 0D 0A 20 20 20 20 20 20 20 20 20 20 20    tus..           
00F800:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
00F810:  0D 00 00 00 02 09 50 E5 0D 00 C1 02 00 00 00 02    ......P.........
00F820:  0D 00 C2 02 00 00 00 02 0D 00 C3 02 00 00 00 02    ................
00F830:  0D 00 C4 02 00 00 00 02 0D 00 C5 02 00 00 00 02    ................
00F840:  0D 00 C6 02 00 00 00 02 0D 00 C7 02 00 00 00 02    ................
00F850:  0D 00 C8 02 00 00 00 02 0D 00 C9 02 00 00 00 02    ................
00F860:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F870:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F880:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F890:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F8F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00F900:  20 20 20 20 20 4C 44 20 41 2C 28 43 48 41 52 29         LD A,(CHAR)
00F910:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F920:  20 20 20 3B 41 3D 43 68 61 72 61 63 74 65 72 20       ;A=Character 
00F930:  72 65 61 64 20 28 69 66 20 61 6E 79 29 0D 0A 0D    read (if any)...
00F940:  0A 20 20 20 20 20 20 20 50 41 52 41 4D 5F 42 4C    .       PARAM_BL
00F950:  4F 43 4B 20 20 20 20 20 20 20 20 44 45 46 57 20    OCK        DEFW 
00F960:  53 54 41 54 55 53 20 20 20 20 20 20 20 20 20 3B    STATUS         ;
00F970:  46 69 72 73 74 20 70 61 72 61 6D 65 74 65 72 20    First parameter 
00F980:  69 73 20 73 74 61 74 75 73 0D 0A 20 20 20 20 20    is status..     
00F990:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00F9A0:  20 20 20 20 20 44 45 46 57 20 43 48 41 52 20 20         DEFW CHAR  
00F9B0:  20 20 20 20 20 20 20 20 20 3B 53 65 63 6F 6E 64             ;Second
00F9C0:  20 70 61 72 61 6D 65 74 65 72 20 69 73 20 63 68     parameter is ch
00F9D0:  61 72 61 63 74 65 72 0D 0A 20 20 20 20 20 20 20    aracter..       
00F9E0:  3B 0D 0A 20 20 20 20 20 20 20 53 54 41 54 55 53    ;..       STATUS
00F9F0:  3A 20 20 20 20 20 20 20 20 20 20 20 20 44 45 46    :            DEF
00FA00:  57 20 23 30 30 30 30 0D 0A 20 20 20 20 20 20 20    W #0000..       
00FA10:  43 48 41 52 3A 20 20 20 20 20 20 20 20 20 20 20    CHAR:           
00FA20:  20 20 20 44 45 46 57 20 23 30 30 30 30 0D 0A 0D       DEFW #0000...
00FA30:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
00FA40:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
00FA50:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
00FA60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FA70:  20 20 20 20 70 61 67 65 20 31 30 2E 31 31 0D 0A        page 10.11..
00FA80:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
00FA90:  20 20 20 63 29 20 50 61 73 73 69 6E 67 20 64 69       c) Passing di
00FAA0:  66 66 65 72 65 6E 74 20 74 79 70 65 73 20 6F 66    fferent types of
00FAB0:  20 70 61 72 61 6D 65 74 65 72 0D 0A 0D 0A 0D 0A     parameter......
00FAC0:  20 20 20 20 20 20 20 54 68 69 73 20 65 78 6D 70           This exmp
00FAD0:  6C 65 20 75 73 65 73 20 61 6E 20 69 6E 76 65 6E    le uses an inven
00FAE0:  74 65 64 20 65 78 74 65 72 6E 61 6C 20 63 6F 6D    ted external com
00FAF0:  6D 61 6E 64 20 77 68 69 63 68 20 74 61 6B 65 73    mand which takes
00FB00:  20 61 20 73 74 72 69 6E 67 20 20 6F 66 0D 0A 20     a string  of.. 
00FB10:  20 20 20 20 20 20 63 68 61 72 61 63 74 65 72 73          characters
00FB20:  2C 20 6C 6F 6F 6B 73 20 74 68 65 73 65 20 75 70    , looks these up
00FB30:  20 69 6E 20 61 6E 20 69 6E 64 65 78 20 61 6E 64     in an index and
00FB40:  20 72 65 74 75 72 6E 73 20 61 20 72 65 66 65 72     returns a refer
00FB50:  65 6E 63 65 20 6E 75 6D 62 65 72 2E 0D 0A 20 20    ence number...  
00FB60:  20 20 20 20 20 54 68 65 20 65 78 74 65 72 6E 61         The externa
00FB70:  6C 20 63 6F 6D 6D 61 6E 64 20 69 73 20 61 73 73    l command is ass
00FB80:  75 6D 65 64 20 74 6F 20 62 65 20 64 65 73 69 67    umed to be desig
00FB90:  6E 65 64 20 74 6F 20 62 65 20 63 61 6C 6C 65 64    ned to be called
00FBA0:  20 66 72 6F 6D 20 42 41 53 49 43 0D 0A 20 20 20     from BASIC..   
00FBB0:  20 20 20 20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D        as follows:.
00FBC0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
00FBD0:  20 20 20 20 20 7C 52 45 46 4E 55 4D 2C 40 43 48         |REFNUM,@CH
00FBE0:  41 52 54 52 49 4E 47 24 2C 49 4E 44 45 58 4E 55    ARTRING$,INDEXNU
00FBF0:  4D 2C 40 52 45 46 4E 55 4D 0D 0A 0D 0A 0D 0A 20    M,@REFNUM...... 
00FC00:  20 20 20 20 20 20 69 2E 65 2E 20 54 68 65 20 66          i.e. The f
00FC10:  69 72 73 74 20 70 61 72 61 6D 65 74 65 72 20 69    irst parameter i
00FC20:  73 20 61 20 73 74 72 69 6E 67 20 28 77 68 6F 73    s a string (whos
00FC30:  65 20 61 64 64 72 65 73 73 20 69 73 20 20 70 61    e address is  pa
00FC40:  73 73 65 64 29 20 20 77 68 69 63 68 0D 0A 20 20    ssed)  which..  
00FC50:  20 20 20 20 20 69 73 20 74 6F 20 62 65 20 6C 6F         is to be lo
00FC60:  6F 6B 65 64 20 75 70 2E 20 54 68 65 20 73 65 63    oked up. The sec
00FC70:  6F 6E 64 20 70 61 72 61 6D 65 74 65 72 20 69 73    ond parameter is
00FC80:  20 61 20 6E 75 6D 62 65 72 20 73 70 65 63 69 66     a number specif
00FC90:  79 69 6E 67 20 20 77 68 69 63 68 0D 0A 20 20 20    ying  which..   
00FCA0:  20 20 20 20 69 6E 64 65 78 20 74 6F 20 75 73 65        index to use
00FCB0:  2C 20 61 6E 64 20 74 68 65 20 74 68 69 72 64 20    , and the third 
00FCC0:  70 61 72 61 6D 65 74 65 72 20 69 73 20 61 20 76    parameter is a v
00FCD0:  61 72 69 61 62 6C 65 20 28 77 68 6F 73 65 20 61    ariable (whose a
00FCE0:  64 64 72 65 73 73 20 20 69 73 0D 0A 20 20 20 20    ddress  is..    
00FCF0:  20 20 20 70 61 73 73 65 64 29 20 77 68 69 63 68       passed) which
00FD00:  20 69 73 20 74 6F 20 62 65 20 73 65 74 20 74 6F     is to be set to
00FD10:  20 74 68 65 20 72 65 71 75 69 72 65 64 20 72 65     the required re
00FD20:  66 65 72 65 6E 63 65 20 6E 75 6D 62 65 72 2E 0D    ference number..
00FD30:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
00FD40:  66 61 72 20 61 64 64 72 65 73 73 20 6F 66 20 74    far address of t
00FD50:  68 65 20 72 6F 75 74 69 6E 65 20 63 61 6E 20 62    he routine can b
00FD60:  65 20 65 73 74 61 62 6C 69 73 68 65 64 20 69 6E    e established in
00FD70:  20 74 68 65 20 73 61 6D 65 20 20 77 61 79 20 20     the same  way  
00FD80:  61 73 0D 0A 20 20 20 20 20 20 20 77 61 73 20 64    as..       was d
00FD90:  65 73 63 72 69 62 65 64 20 69 6E 20 74 68 65 20    escribed in the 
00FDA0:  70 72 65 76 69 6F 75 73 20 74 77 6F 20 65 78 61    previous two exa
00FDB0:  6D 70 6C 65 73 2E 20 54 6F 20 63 61 6C 6C 20 74    mples. To call t
00FDC0:  68 69 73 20 72 6F 75 74 69 6E 65 20 20 66 72 6F    his routine  fro
00FDD0:  6D 0D 0A 20 20 20 20 20 20 20 61 20 6D 61 63 68    m..       a mach
00FDE0:  69 6E 65 20 63 6F 64 65 20 70 72 6F 67 72 61 6D    ine code program
00FDF0:  20 69 74 20 69 73 20 6E 65 63 65 73 73 61 72 79     it is necessary
00FE00:  20 74 6F 20 73 65 74 20 75 70 20 74 68 65 20 20     to set up the  
00FE10:  70 61 72 61 6D 65 74 65 72 20 20 62 6C 6F 63 6B    parameter  block
00FE20:  0D 0A 20 20 20 20 20 20 20 61 6E 64 20 61 20 73    ..       and a s
00FE30:  74 72 69 6E 67 20 64 65 73 63 72 69 70 74 6F 72    tring descriptor
00FE40:  2E 20 54 68 65 20 66 6F 6C 6C 6F 77 69 6E 67 20    . The following 
00FE50:  73 75 62 72 6F 75 74 69 6E 65 20 64 6F 65 73 20    subroutine does 
00FE60:  74 68 69 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    this:......     
00FE70:  20 20 47 45 54 5F 52 45 46 5F 4E 55 4D 3A 20 20      GET_REF_NUM:  
00FE80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FE90:  20 20 20 20 20 20 20 20 20 3B 45 6E 74 72 79 3A             ;Entry:
00FEA0:  20 48 4C 3D 41 64 64 72 65 73 73 20 6F 66 20 73     HL=Address of s
00FEB0:  74 72 69 6E 67 2E 0D 0A 20 20 20 20 20 20 20 20    tring...        
00FEC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FED0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FEE0:  20 20 20 20 20 20 3B 20 20 20 20 20 20 20 41 20          ;       A 
00FEF0:  3D 4C 65 6E 67 74 68 20 6F 66 20 73 74 72 69 6E    =Length of strin
00FF00:  67 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    g...            
00FF10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FF20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FF30:  20 20 3B 20 20 20 20 20 20 20 44 45 3D 49 6E 64      ;       DE=Ind
00FF40:  65 78 20 6E 75 6D 62 65 72 2E 0D 0A 20 20 20 20    ex number...    
00FF50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FF60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FF70:  20 20 20 20 20 20 20 20 20 20 3B 45 78 69 74 3A              ;Exit:
00FF80:  20 20 48 4C 3D 52 65 66 65 72 65 6E 63 65 20 6E      HL=Reference n
00FF90:  75 6D 62 65 72 2E 0D 0A 20 20 20 20 20 20 20 20    umber...        
00FFA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FFB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
00FFC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 46                  AF
00FFD0:  2C 42 43 2C 44 45 2C 49 58 2C 49 59 20 63 6F 72    ,BC,DE,IX,IY cor
00FFE0:  72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 20 20    rupt...         
00FFF0:  20 20 20 20 20 20 20 4C 44 20 28 53 54 52 5F 44           LD (STR_D
010000:  45 53 43 52 49 50 54 4F 52 2B 30 29 2C 41 20 20    ESCRIPTOR+0),A  
010010:  20 20 20 20 20 3B 53 74 6F 72 65 20 6C 65 6E 67         ;Store leng
010020:  74 68 20 6F 66 20 73 74 72 69 6E 67 2E 0D 0A 0D    th of string....
010030:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
010040:  20 4C 44 20 28 53 54 52 5F 44 45 53 43 52 49 50     LD (STR_DESCRIP
010050:  54 4F 52 2B 31 29 2C 48 4C 20 20 20 20 20 20 3B    TOR+1),HL      ;
010060:  53 74 6F 72 65 20 61 64 64 72 65 73 73 20 6F 66    Store address of
010070:  20 73 74 72 69 6E 67 0D 0A 20 20 20 20 20 20 20     string..       
010080:  20 20 20 20 20 20 20 20 20 4C 44 20 28 50 41 52             LD (PAR
010090:  41 4D 5F 42 4C 4F 43 4B 2B 32 29 2C 44 45 20 20    AM_BLOCK+2),DE  
0100A0:  20 20 20 20 20 20 20 3B 53 74 6F 72 65 20 69 6E           ;Store in
0100B0:  64 65 78 20 6E 75 6D 62 65 72 0D 0A 20 20 20 20    dex number..    
0100C0:  20 20 20 3B 0D 0A 20 20 20 20 20 20 20 20 20 20       ;..          
0100D0:  20 20 20 20 20 20 4C 44 20 41 2C 33 20 20 20 20          LD A,3    
0100E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0100F0:  20 20 20 20 3B 33 20 70 61 72 61 6D 65 74 65 72        ;3 parameter
010100:  73 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    s..             
010110:  20 20 20 4C 44 20 49 58 2C 50 41 52 41 4D 5F 42       LD IX,PARAM_B
010120:  4C 4F 43 4B 20 20 20 20 20 20 20 20 20 20 20 20    LOCK            
010130:  20 3B 41 64 64 72 65 73 73 20 6F 66 20 70 61 72     ;Address of par
010140:  61 6D 65 74 65 72 20 62 6C 6F 63 6B 0D 0A 20 20    ameter block..  
010150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 52 53                  RS
010160:  54 20 33 20 20 20 20 20 20 20 20 20 20 20 20 20    T 3             
010170:  20 20 20 20 20 20 20 20 20 20 20 20 3B 46 41 52                ;FAR
010180:  20 43 41 4C 4C 0D 0A 20 20 20 20 20 20 20 20 20     CALL..         
010190:  20 20 20 20 20 20 20 44 45 46 57 20 43 4D 44 5F           DEFW CMD_
0101A0:  46 41 52 5F 41 44 44 52 45 53 53 20 20 20 20 20    FAR_ADDRESS     
0101B0:  20 20 20 20 20 3B 50 6F 69 6E 74 65 72 20 74 6F         ;Pointer to
0101C0:  20 66 61 72 20 61 64 64 72 65 73 73 0D 0A 20 20     far address..  
0101D0:  20 20 20 20 20 3B 0D 0A 20 20 20 20 20 20 20 20         ;..        
0101E0:  20 20 20 20 20 20 20 20 4C 44 20 48 4C 2C 52 45            LD HL,RE
0101F0:  46 5F 4E 55 4D 20 20 20 20 20 20 20 20 20 20 20    F_NUM           
010200:  20 20 20 20 20 20 3B 48 4C 3D 52 65 66 65 72 65          ;HL=Refere
010210:  6E 63 65 20 6E 75 6D 62 65 72 0D 0A 20 20 20 20    nce number..    
010220:  20 20 20 20 20 20 20 20 20 20 20 20 52 45 54 0D                RET.
010230:  0A 0D 0A 20 20 20 20 20 20 20 50 41 52 41 4D 5F    ...       PARAM_
010240:  42 4C 4F 43 4B 3A 20 20 20 20 20 20 20 44 45 46    BLOCK:       DEF
010250:  57 20 53 54 52 5F 44 45 53 43 52 49 50 54 4F 52    W STR_DESCRIPTOR
010260:  20 3B 46 69 72 73 74 20 70 61 72 61 6D 61 74 65     ;First paramate
010270:  72 20 69 73 20 61 64 64 72 65 73 73 20 6F 66 0D    r is address of.
010280:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
010290:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0102A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B                   ;
0102B0:  73 74 72 69 6E 67 20 64 65 73 72 69 70 74 6F 72    string desriptor
0102C0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0102D0:  20 20 20 20 20 20 20 20 20 20 20 20 44 45 46 57                DEFW
0102E0:  20 20 23 30 30 30 30 20 20 20 20 20 20 20 20 20      #0000         
0102F0:  3B 53 65 63 6F 6E 64 20 20 70 61 72 61 6D 65 74    ;Second  paramet
010300:  65 72 20 20 69 73 20 20 69 6E 64 65 78 0D 0A 20    er  is  index.. 
010310:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010320:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010330:  20 20 20 20 20 20 20 20 20 20 20 20 20 3B 6E 75                 ;nu
010340:  6D 62 65 72 0D 0A 20 20 20 20 20 20 20 20 20 20    mber..          
010350:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010360:  44 45 46 57 20 52 45 46 4E 55 4D 20 20 20 20 20    DEFW REFNUM     
010370:  20 20 20 20 3B 54 68 69 72 64 20 70 61 72 61 6D        ;Third param
010380:  65 74 65 72 20 69 73 20 61 64 64 72 65 73 73 20    eter is address 
010390:  6F 66 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    of..            
0103A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0103B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0103C0:  20 20 3B 73 74 6F 72 65 20 66 6F 72 20 72 65 66      ;store for ref
0103D0:  65 72 65 6E 63 65 20 6E 75 6D 62 65 72 0D 0A 20    erence number.. 
0103E0:  20 20 20 20 20 20 3B 0D 0A 20 20 20 20 20 20 20          ;..       
0103F0:  53 54 52 5F 44 45 53 43 52 49 50 54 4F 52 20 20    STR_DESCRIPTOR  
010400:  20 20 20 44 45 46 42 20 23 30 30 20 20 20 20 20       DEFB #00     
010410:  20 20 20 20 20 20 20 3B 4C 65 6E 67 74 68 0D 0A           ;Length..
010420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010430:  20 20 20 20 20 20 20 20 20 20 44 45 46 57 20 23              DEFW #
010440:  30 30 30 30 20 20 20 20 20 20 20 20 20 20 3B 41    0000          ;A
010450:  64 64 72 65 73 73 0D 0A 20 20 20 20 20 20 20 3B    ddress..       ;
010460:  0D 0A 20 20 20 20 20 20 20 52 45 46 4E 55 4D 20    ..       REFNUM 
010470:  20 20 20 20 20 20 20 20 20 20 20 20 44 45 46 57                DEFW
010480:  20 23 30 30 30 30 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A     #0000..........
010490:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
0104A0:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
0104B0:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
0104C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0104D0:  20 20 20 20 20 20 20 70 61 67 65 20 31 30 2E 31           page 10.1
0104E0:  32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    2.............. 
0104F0:  20 20 20 20 20 20 54 68 65 20 65 78 74 65 72 6E          The extern
010500:  61 6C 20 63 6F 6D 6D 61 6E 64 20 72 6F 75 74 69    al command routi
010510:  6E 65 20 74 68 61 74 20 69 73 20 62 65 69 6E 67    ne that is being
010520:  20 20 63 61 6C 6C 65 64 20 20 68 61 73 20 20 74      called  has  t
010530:  6F 20 20 70 69 63 6B 20 20 74 68 65 0D 0A 20 20    o  pick  the..  
010540:  20 20 20 20 20 70 61 72 61 6D 65 74 65 72 73 20         parameters 
010550:  6F 75 74 20 6F 66 20 74 68 65 20 70 72 61 6D 65    out of the prame
010560:  74 65 72 20 62 6C 6F 63 6B 20 61 6E 64 20 69 74    ter block and it
010570:  20 6D 69 67 68 74 20 77 6F 72 6B 20 61 73 20 66     might work as f
010580:  6F 6C 6C 6F 77 73 3A 0D 0A 0D 0A 0D 0A 0D 0A 20    ollows:........ 
010590:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4C                   L
0105A0:  44 20 4C 2C 28 49 58 2B 30 29 0D 0A 20 20 20 20    D L,(IX+0)..    
0105B0:  20 20 20 20 20 20 20 20 20 20 20 20 4C 44 20 48                LD H
0105C0:  2C 28 49 58 2B 31 29 20 20 20 20 20 20 20 20 20    ,(IX+1)         
0105D0:  20 20 20 20 20 20 20 20 20 20 3B 48 4C 3D 41 64              ;HL=Ad
0105E0:  64 72 65 73 73 20 6F 66 20 73 74 72 69 6E 67 0D    dress of string.
0105F0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
010600:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010610:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B                   ;
010620:  64 65 73 63 72 69 70 74 6F 72 0D 0A 20 20 20 20    descriptor..    
010630:  20 20 20 3B 0D 0A 20 20 20 20 20 20 20 20 20 20       ;..          
010640:  20 20 20 20 20 20 4C 44 20 41 2C 28 48 4C 29 0D          LD A,(HL).
010650:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
010660:  20 49 4E 43 20 48 4C 20 20 20 20 20 20 20 20 20     INC HL         
010670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3B                   ;
010680:  41 3D 4C 65 6E 67 74 68 20 6F 66 20 74 68 65 20    A=Length of the 
010690:  73 74 72 69 6E 67 0D 0A 0D 0A 20 20 20 20 20 20    string....      
0106A0:  20 20 20 20 20 20 20 20 20 20 4C 44 20 45 2C 28              LD E,(
0106B0:  48 4C 29 0D 0A 20 20 20 20 20 20 20 20 20 20 20    HL)..           
0106C0:  20 20 20 20 20 49 4E 43 20 48 4C 0D 0A 20 20 20         INC HL..   
0106D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 4C 44 20                 LD 
0106E0:  44 2C 28 48 4C 29 0D 0A 20 20 20 20 20 20 20 20    D,(HL)..        
0106F0:  20 20 20 20 20 20 20 20 45 58 20 48 4C 2C 44 45            EX HL,DE
010700:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010710:  20 20 20 20 20 20 3B 48 4C 3D 41 64 64 72 65 73          ;HL=Addres
010720:  73 20 6F 66 20 73 74 72 69 6E 67 2E 0D 0A 20 20    s of string...  
010730:  20 20 20 20 20 3B 0D 0A 20 20 20 20 20 20 20 20         ;..        
010740:  20 20 20 20 20 20 20 20 4C 44 20 45 2C 28 49 58            LD E,(IX
010750:  2B 32 29 0D 0A 20 20 20 20 20 20 20 20 20 20 20    +2)..           
010760:  20 20 20 20 20 4C 44 20 44 2C 28 49 58 2B 33 29         LD D,(IX+3)
010770:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010780:  20 20 20 3B 44 45 3D 49 6E 64 65 78 20 6E 75 6D       ;DE=Index num
010790:  62 65 72 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ber....         
0107A0:  20 20 20 20 20 20 20 2E 2E 2E 20 20 20 20 20 20           ...      
0107B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0107C0:  20 20 20 20 20 3B 4C 6F 6F 6B 20 75 70 20 73 74         ;Look up st
0107D0:  72 69 6E 67 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ring....        
0107E0:  20 20 20 20 20 20 20 20 4C 44 20 28 49 58 2B 34            LD (IX+4
0107F0:  29 2C 4C 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ),L..           
010800:  20 20 20 20 20 4C 44 20 28 49 58 2B 35 29 2C 48         LD (IX+5),H
010810:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010820:  20 20 20 3B 53 74 6F 72 65 20 72 65 73 75 6C 74       ;Store result
010830:  69 6E 67 20 72 65 66 65 72 65 6E 63 65 0D 0A 20    ing reference.. 
010840:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52                   R
010850:  45 54 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ET              
010860:  20 20 20 20 20 20 20 20 20 20 20 20 20 3B 6E 75                 ;nu
010870:  6D 62 65 72 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    mber............
010880:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
010890:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
0108A0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
0108B0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
0108C0:  20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F     AMSTRAD CPC464/
0108D0:  36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52    664/6128 FIRMWAR
0108E0:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
0108F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
010900:  65 20 31 30 2E 31 33 0D 0A 1A 24 24 24 FF 00 FF    e 10.13...$$$...
010910:  68 65 6E 20 74 68 65 20 69 6E 69 74 69 61 6C 69    hen the initiali
010920:  7A 61 74 69 6F 6E 20 72 6F 75 74 69 6E 65 20 72    zation routine r
010930:  65 74 75 72 6E 73 2C 20 74 68 65 20 4B 65 72 6E    eturns, the Kern
010940:  65 6C 20 73 74 6F 72 65 73 20 74 68 65 20 61 64    el stores the ad
010950:  64 72 65 73 73 0D 0A 20 20 20 20 20 20 20 6F 66    dress..       of
010960:  20 74 68 65 20 62 61 73 65 20 6F 66 20 74 68 65     the base of the
010970:  20 75 70 70 65 72 20 61 72 65 61 20 77 68 69 63     upper area whic
010980:  20 20 20 3B 44 45 3D 49 6E 64 65 78 20 6E 75 6D       ;DE=Index num
010990:  62 65 72 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ber....         
0109A0:  20 20 20 20 20 20 20 2E 2E 2E 20 20 20 20 20 20           ...      
0109B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0109C0:  20 20 20 20 20 3B 4C 6F 6F 6B 20 75 70 20 73 74         ;Look up st
0109D0:  72 69 6E 67 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ring....        
0109E0:  20 20 20 20 20 20 20 20 4C 44 20 28 49 58 2B 34            LD (IX+4
0109F0:  29 2C 4C 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ),L..           
010A00:  20 20 20 20 20 4C 44 20 28 49 58 2B 35 29 2C 48         LD (IX+5),H
010A10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
010A20:  20 20 20 3B 53 74 6F 72 65 20 72 65 73 75 6C 74       ;Store result
010A30:  69 6E 67 20 72 65 66 65 72 65 6E 63 65 0D 0A 20    ing reference.. 
010A40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52                   R
010A50:  45 54 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ET              
010A60:  20 20 20 20 20 20 20 20 20 20 20 20 20 3B 6E 75                 ;nu
010A70:  6D 62 65 72 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    mber............
010A80:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
010A90:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
010AA0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
010AB0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
010AC0:  20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F     AMSTRAD CPC464/
010AD0:  36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52    664/6128 FIRMWAR
010AE0:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
010AF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
010B00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
010B10:  0E 00 00 00 02 09 50 E5 0E 00 C1 02 00 00 00 02    ......P.........
010B20:  0E 00 C2 02 00 00 00 02 0E 00 C3 02 00 00 00 02    ................
010B30:  0E 00 C4 02 00 00 00 02 0E 00 C5 02 00 00 00 02    ................
010B40:  0E 00 C6 02 00 00 00 02 0E 00 C7 02 00 00 00 02    ................
010B50:  0E 00 C8 02 00 00 00 02 0E 00 C9 02 00 00 00 02    ................
010B60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010B70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010B80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010B90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010BF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
010C00:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
010C10:  31 20 49 6E 74 65 72 72 75 70 74 73 2E 0D 0A 0D    1 Interrupts....
010C20:  0A 20 20 20 20 20 20 20 54 68 65 72 65 20 69 73    .       There is
010C30:  20 6F 6E 6C 79 20 6F 6E 65 20 73 6F 75 72 63 65     only one source
010C40:  20 20 6F 66 20 20 69 6E 74 65 72 72 75 70 74 73      of  interrupts
010C50:  20 20 69 6E 20 20 61 6E 20 20 75 6E 65 78 70 61      in  an  unexpa
010C60:  6E 64 65 64 20 20 6D 61 63 68 69 6E 65 2C 0D 0A    nded  machine,..
010C70:  20 20 20 20 20 20 20 6E 61 6D 65 6C 79 20 20 61           namely  a
010C80:  20 20 72 65 67 75 6C 61 72 20 20 74 69 6D 65 20      regular  time 
010C90:  20 69 6E 74 65 72 72 75 70 74 2E 20 20 45 78 70     interrupt.  Exp
010CA0:  61 6E 73 69 6F 6E 20 20 62 6F 61 72 64 73 20 20    ansion  boards  
010CB0:  6D 61 79 20 20 67 65 6E 65 72 61 74 65 0D 0A 20    may  generate.. 
010CC0:  20 20 20 20 20 20 69 6E 74 65 72 72 75 70 74 73          interrupts
010CD0:  2C 20 62 75 74 20 73 75 69 74 61 62 6C 65 20 73    , but suitable s
010CE0:  6F 66 74 77 61 72 65 20 6D 75 73 74 20 62 65 20    oftware must be 
010CF0:  70 72 6F 76 69 64 65 64 20 74 6F 20 20 64 65 61    provided to  dea
010D00:  6C 20 20 77 69 74 68 20 20 74 68 65 0D 0A 20 20    l  with  the..  
010D10:  20 20 20 20 20 65 78 74 72 61 20 69 6E 74 65 72         extra inter
010D20:  72 75 70 74 73 2E 0D 0A 0D 0A 20 20 20 20 20 20    rupts.....      
010D30:  20 54 68 65 20 73 79 73 74 65 6D 20 72 75 6E 73     The system runs
010D40:  20 77 69 74 68 20 69 6E 74 65 72 72 75 70 74 73     with interrupts
010D50:  20 20 65 6E 61 62 6C 65 64 20 20 6D 6F 73 74 20      enabled  most 
010D60:  20 6F 66 20 20 74 68 65 20 20 74 69 6D 65 2E 20     of  the  time. 
010D70:  20 49 74 20 20 69 73 0D 0A 20 20 20 20 20 20 20     It  is..       
010D80:  69 6E 61 64 76 69 73 61 62 6C 65 20 74 6F 20 64    inadvisable to d
010D90:  69 73 61 62 6C 65 20 69 6E 74 65 72 72 75 70 74    isable interrupt
010DA0:  73 20 66 6F 72 20 61 20 70 72 6F 6C 6F 6E 67 65    s for a prolonge
010DB0:  64 20 70 65 72 69 6F 64 20 20 69 66 20 20 74 68    d period  if  th
010DC0:  69 73 20 20 69 73 0D 0A 20 20 20 20 20 20 20 61    is  is..       a
010DD0:  76 6F 69 64 61 62 6C 65 20 62 65 63 61 75 73 65    voidable because
010DE0:  20 74 68 65 20 74 69 6D 65 20 69 6E 74 65 72 72     the time interr
010DF0:  75 70 74 73 20 77 69 6C 6C 20 62 65 20 6D 69 73    upts will be mis
010E00:  73 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    sed.......      
010E10:  20 41 20 6E 75 6D 62 65 72 20 6F 66 20 66 69 72     A number of fir
010E20:  6D 77 61 72 65 20 72 6F 75 74 69 6E 65 73 20 65    mware routines e
010E30:  6E 61 62 6C 65 20 69 6E 74 65 72 72 75 70 74 73    nable interrupts
010E40:  20 61 6E 64 20 74 68 69 73 20 20 69 73 20 20 72     and this  is  r
010E50:  65 6D 61 72 6B 65 64 0D 0A 20 20 20 20 20 20 20    emarked..       
010E60:  75 70 6F 6E 20 69 6E 20 74 68 65 69 72 20 64 65    upon in their de
010E70:  73 63 72 69 70 74 69 6F 6E 73 2E 20 49 6E 20 70    scriptions. In p
010E80:  61 72 74 69 63 75 6C 61 72 20 74 68 65 20 6B 65    articular the ke
010E90:  72 6E 65 6C 20 72 6F 75 74 69 6E 65 73 20 20 64    rnel routines  d
010EA0:  65 61 6C 69 6E 67 0D 0A 20 20 20 20 20 20 20 77    ealing..       w
010EB0:  69 74 68 20 52 4F 4D 73 20 61 6E 64 20 74 68 65    ith ROMs and the
010EC0:  20 20 72 65 73 74 61 72 74 20 20 69 6E 73 74 72      restart  instr
010ED0:  75 63 74 69 6F 6E 73 20 20 28 20 20 65 67 2E 20    uctions  (  eg. 
010EE0:  20 4C 4F 57 20 20 4A 55 4D 50 20 20 29 20 20 65     LOW  JUMP  )  e
010EF0:  6E 61 62 6C 65 0D 0A 20 20 20 20 20 20 20 69 6E    nable..       in
010F00:  74 65 72 72 75 70 74 73 2E 0D 0A 0D 0A 0D 0A 20    terrupts....... 
010F10:  20 20 20 20 20 20 31 31 2E 31 20 20 20 54 68 65          11.1   The
010F20:  20 54 69 6D 65 20 49 6E 74 65 72 72 75 70 74 2E     Time Interrupt.
010F30:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
010F40:  20 74 69 6D 65 20 69 6E 74 65 72 72 75 70 74 20     time interrupt 
010F50:  6F 63 63 75 72 73 20 72 6F 75 67 68 6C 79 20 6F    occurs roughly o
010F60:  6E 63 65 20 65 76 65 72 79 20 31 2F 33 30 30 74    nce every 1/300t
010F70:  68 20 6F 66 20 61 20 20 73 65 63 6F 6E 64 2E 20    h of a  second. 
010F80:  20 4F 6E 0D 0A 20 20 20 20 20 20 20 6D 61 63 68     On..       mach
010F90:  69 6E 65 73 20 77 69 74 68 20 50 41 4C 20 6D 6F    ines with PAL mo
010FA0:  6E 69 74 6F 72 73 20 28 61 73 20 69 6E 20 74 68    nitors (as in th
010FB0:  65 20 55 4B 20 29 20 6F 72 20 53 45 43 41 4D 20    e UK ) or SECAM 
010FC0:  6D 6F 6E 69 74 6F 72 73 20 28 20 20 61 73 20 20    monitors (  as  
010FD0:  69 6E 0D 0A 20 20 20 20 20 20 20 46 72 61 6E 63    in..       Franc
010FE0:  65 20 29 20 74 68 65 20 74 69 6D 65 72 20 69 73    e ) the timer is
010FF0:  20 73 79 6E 63 68 72 6F 6E 69 73 65 64 20 20 77     synchronised  w
011000:  69 74 68 20 20 66 72 61 6D 65 20 20 66 6C 79 62    ith  frame  flyb
011010:  61 63 6B 20 20 65 76 65 72 79 20 20 73 69 78 74    ack  every  sixt
011020:  68 0D 0A 20 20 20 20 20 20 20 74 69 63 6B 2E 20    h..       tick. 
011030:  4F 6E 20 6D 61 63 68 69 6E 65 73 20 75 73 69 6E    On machines usin
011040:  67 20 4E 54 53 43 20 6D 6F 6E 69 74 6F 72 73 20    g NTSC monitors 
011050:  28 20 61 73 20 69 6E 20 74 68 65 20 55 53 20 29    ( as in the US )
011060:  20 20 74 68 65 20 20 74 69 6D 65 72 20 20 69 73      the  timer  is
011070:  0D 0A 20 20 20 20 20 20 20 73 79 6E 63 68 72 6F    ..       synchro
011080:  6E 69 73 65 64 20 77 69 74 68 20 66 72 61 6D 65    nised with frame
011090:  20 66 6C 79 62 61 63 6B 20 65 76 65 72 79 20 66     flyback every f
0110A0:  69 66 74 68 20 74 69 63 6B 2E 20 54 68 65 20 20    ifth tick. The  
0110B0:  74 69 6D 65 20 20 69 6E 74 65 72 72 75 70 74 0D    time  interrupt.
0110C0:  0A 20 20 20 20 20 20 20 69 73 20 70 72 6F 63 65    .       is proce
0110D0:  73 73 65 64 20 62 79 20 74 68 65 20 4B 65 72 6E    ssed by the Kern
0110E0:  65 6C 20 61 6E 64 20 70 72 65 73 65 6E 74 65 64    el and presented
0110F0:  20 74 6F 20 74 68 65 20 72 65 73 74 20 6F 66 20     to the rest of 
011100:  74 68 65 20 73 79 73 74 65 6D 20 20 69 6E 0D 0A    the system  in..
011110:  20 20 20 20 20 20 20 61 20 6E 75 6D 62 65 72 20           a number 
011120:  6F 66 20 77 61 79 73 20 3A 0D 0A 0D 0A 0D 0A 0D    of ways :.......
011130:  0A 20 20 20 20 20 20 20 61 2E 20 46 61 73 74 20    .       a. Fast 
011140:  54 69 63 6B 65 72 20 49 6E 74 65 72 72 75 70 74    Ticker Interrupt
011150:  73 2E 20 20 20 20 20 20 20 20 20 20 20 20 20 20    s.              
011160:  50 65 72 69 6F 64 20 3D 20 31 2F 33 30 30 74 68    Period = 1/300th
011170:  20 6F 66 20 61 20 73 65 63 6F 6E 64 2E 0D 0A 0D     of a second....
011180:  0A 0D 0A 20 20 20 20 20 20 20 46 6F 72 20 61 20    ...       For a 
011190:  68 69 67 68 20 72 65 73 6F 6C 75 74 69 6F 6E 20    high resolution 
0111A0:  6F 72 20 76 65 72 79 20 73 68 6F 72 74 20 70 65    or very short pe
0111B0:  72 69 6F 64 20 74 69 6D 69 6E 67 20 28 20 6E 6F    riod timing ( no
0111C0:  74 20 20 69 6E 74 65 6E 64 65 64 20 20 66 6F 72    t  intended  for
0111D0:  0D 0A 20 20 20 20 20 20 20 67 65 6E 65 72 61 6C    ..       general
0111E0:  20 75 73 65 20 29 2E 0D 0A 0D 0A 0D 0A 20 20 20     use ).......   
0111F0:  20 20 20 20 62 2E 20 53 6F 75 6E 64 20 47 65 6E        b. Sound Gen
011200:  65 72 61 74 69 6F 6E 20 49 6E 74 65 72 72 75 70    eration Interrup
011210:  74 2E 20 20 20 20 20 20 20 20 20 20 50 65 72 69    t.          Peri
011220:  6F 64 20 3D 20 31 2F 31 4F 4F 74 68 20 6F 66 20    od = 1/1OOth of 
011230:  61 20 73 65 63 6F 6E 64 2E 0D 0A 0D 0A 0D 0A 20    a second....... 
011240:  20 20 20 20 20 20 54 68 69 73 20 69 6E 74 65 72          This inter
011250:  72 75 70 74 20 64 72 69 76 65 73 20 74 68 65 20    rupt drives the 
011260:  73 6F 75 6E 64 20 67 65 6E 65 72 61 74 69 6F 6E    sound generation
011270:  20 66 69 72 6D 77 61 72 65 2C 20 62 75 74 20 69     firmware, but i
011280:  73 20 20 6F 74 68 65 72 77 69 73 65 0D 0A 20 20    s  otherwise..  
011290:  20 20 20 20 20 6E 6F 74 20 76 69 73 69 62 6C 65         not visible
0112A0:  20 74 6F 20 74 68 65 20 73 79 73 74 65 6D 2E 0D     to the system..
0112B0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 63 2E 20 46    .....       c. F
0112C0:  72 61 6D 65 20 46 6C 79 62 61 63 6B 20 49 6E 74    rame Flyback Int
0112D0:  65 72 72 75 70 74 2E 20 20 20 20 20 20 20 20 20    errupt.         
0112E0:  20 20 20 20 50 65 72 69 6F 64 20 3D 20 31 2F 35        Period = 1/5
0112F0:  30 74 68 20 6F 72 20 36 30 74 68 20 6F 66 20 61    0th or 60th of a
011300:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
011310:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
011320:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
011330:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73                   s
011340:  65 63 6F 6E 64 2E 0D 0A 0D 0A 20 20 20 20 20 20    econd.....      
011350:  20 46 6F 72 20 61 63 74 69 6F 6E 73 20 77 68 69     For actions whi
011360:  63 68 20 6D 75 73 74 20 74 61 6B 65 20 70 6C 61    ch must take pla
011370:  63 65 20 64 75 72 69 6E 67 20 66 72 61 6D 65 20    ce during frame 
011380:  66 6C 79 62 61 63 6B 2E 20 20 49 6E 6B 20 20 66    flyback.  Ink  f
011390:  6C 61 73 68 69 6E 67 0D 0A 20 20 20 20 20 20 20    lashing..       
0113A0:  69 73 20 70 65 72 66 6F 72 6D 65 64 20 64 75 72    is performed dur
0113B0:  69 6E 67 20 61 20 66 72 61 6D 65 20 66 6C 79 62    ing a frame flyb
0113C0:  61 63 6B 20 69 6E 74 65 72 72 75 70 74 2C 20 66    ack interrupt, f
0113D0:  6F 72 20 65 78 61 6D 70 6C 65 2E 0D 0A 0D 0A 20    or example..... 
0113E0:  20 20 20 20 20 20 64 2E 20 54 69 63 6B 65 72 20          d. Ticker 
0113F0:  49 6E 74 65 72 72 75 70 74 2E 20 20 20 20 20 20    Interrupt.      
011400:  20 20 20 20 20 20 20 20 20 20 20 20 20 50 65 72                 Per
011410:  69 6F 64 20 3D 20 31 2F 35 30 74 68 20 6F 66 20    iod = 1/50th of 
011420:  61 20 73 65 63 6F 6E 64 2E 0D 0A 0D 0A 20 20 20    a second.....   
011430:  20 20 20 20 54 68 69 73 20 69 73 20 74 68 65 20        This is the 
011440:  67 65 6E 65 72 61 6C 20 70 75 72 70 6F 73 65 20    general purpose 
011450:  74 69 63 6B 65 72 20 69 6E 74 65 72 72 75 70 74    ticker interrupt
011460:  2E 20 54 68 65 20 6B 65 79 62 6F 61 72 64 20 69    . The keyboard i
011470:  73 20 20 73 63 61 6E 6E 65 64 0D 0A 20 20 20 20    s  scanned..    
011480:  20 20 20 61 74 20 74 68 65 20 73 74 61 72 74 20       at the start 
011490:  6F 66 20 65 61 63 68 20 74 69 63 6B 65 72 20 69    of each ticker i
0114A0:  6E 74 65 72 72 75 70 74 2E 0D 0A 0D 0A 0D 0A 20    nterrupt....... 
0114B0:  20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50          AMSTRAD CP
0114C0:  43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49    C464/664/6128 FI
0114D0:  52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20    RMWARE          
0114E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0114F0:  20 20 20 70 61 67 65 20 31 31 2E 31 0D 0A 0D 0A       page 11.1....
011500:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
011510:  20 65 2E 20 53 79 73 74 65 6D 20 43 6C 6F 63 6B     e. System Clock
011520:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 72    .....       Ther
011530:  65 20 69 73 20 61 20 74 69 6D 65 72 20 74 68 61    e is a timer tha
011540:  74 20 63 6F 75 6E 74 73 20 66 61 73 74 20 74 69    t counts fast ti
011550:  63 6B 73 20 69 65 2E 20 31 2F 33 30 30 74 68 73    cks ie. 1/300ths
011560:  20 6F 66 20 61 20 73 65 63 6F 6E 64 2E 20 54 68     of a second. Th
011570:  69 73 0D 0A 20 20 20 20 20 20 20 63 61 6E 20 62    is..       can b
011580:  65 20 75 73 65 64 20 74 6F 20 6D 65 61 73 75 72    e used to measur
011590:  65 20 65 6C 61 70 73 65 64 20 74 69 6D 65 20 77    e elapsed time w
0115A0:  69 74 68 6F 75 74 20 73 65 74 74 69 6E 67 20 20    ithout setting  
0115B0:  75 70 20 20 61 20 20 72 65 6C 61 74 69 76 65 6C    up  a  relativel
0115C0:  79 0D 0A 20 20 20 20 20 20 20 65 78 70 65 6E 73    y..       expens
0115D0:  69 76 65 20 66 61 73 74 20 74 69 63 6B 20 65 76    ive fast tick ev
0115E0:  65 6E 74 2E 20 54 68 65 20 74 69 6D 65 72 20 69    ent. The timer i
0115F0:  73 20 72 65 61 64 20 62 79 20 63 61 6C 6C 69 6E    s read by callin
011600:  67 20 4B 4C 20 54 49 4D 45 20 50 4C 45 41 53 45    g KL TIME PLEASE
011610:  0D 0A 20 20 20 20 20 20 20 61 6E 64 20 6D 61 79    ..       and may
011620:  20 62 65 20 73 65 74 20 62 79 20 63 61 6C 6C 69     be set by calli
011630:  6E 67 20 4B 4C 20 54 49 4D 45 20 53 45 54 2E 0D    ng KL TIME SET..
011640:  0A 0D 0A 20 20 20 20 20 20 20 31 31 2E 32 20 45    ...       11.2 E
011650:  78 74 65 72 6E 61 6C 20 49 6E 74 65 72 72 75 70    xternal Interrup
011660:  74 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    ts.....       Th
011670:  65 20 5A 38 30 20 69 73 20 72 75 6E 20 20 69 6E    e Z80 is run  in
011680:  20 20 69 6E 74 65 72 72 75 70 74 20 20 6D 6F 64      interrupt  mod
011690:  65 20 20 31 2E 20 20 57 68 69 63 68 20 20 69 73    e  1.  Which  is
0116A0:  20 20 74 6F 20 20 73 61 79 20 20 74 68 61 74 20      to  say  that 
0116B0:  20 61 6C 6C 0D 0A 20 20 20 20 20 20 20 69 6E 74     all..       int
0116C0:  65 72 72 75 70 74 73 20 63 61 75 73 65 20 20 61    errupts cause  a
0116D0:  6E 20 20 52 53 54 37 20 20 74 6F 20 20 62 65 20    n  RST7  to  be 
0116E0:  20 65 78 65 63 75 74 65 64 20 20 62 79 20 20 74     executed  by  t
0116F0:  68 65 20 20 70 72 6F 63 65 73 73 6F 72 2E 20 20    he  processor.  
011700:  54 68 65 0D 0A 20 20 20 20 20 20 20 69 6E 74 65    The..       inte
011710:  72 72 75 70 74 20 68 61 6E 64 6C 69 6E 67 20 63    rrupt handling c
011720:  6F 64 65 20 69 6E 20 74 68 65 20 4B 65 72 6E 65    ode in the Kerne
011730:  6C 20 63 61 6E 20 64 69 73 74 69 6E 67 75 69 73    l can distinguis
011740:  68 20 62 65 74 77 65 65 6E 20 74 68 65 20 74 69    h between the ti
011750:  6D 65 0D 0A 20 20 20 20 20 20 20 69 6E 74 65 72    me..       inter
011760:  72 75 70 74 20 61 6E 64 20 61 6E 20 65 78 74 65    rupt and an exte
011770:  72 6E 61 6C 20 20 69 6E 74 65 72 72 75 70 74 2E    rnal  interrupt.
011780:  20 20 49 74 20 20 64 6F 65 73 20 20 74 68 69 73      It  does  this
011790:  20 20 62 79 20 20 72 65 2D 65 6E 61 62 6C 69 6E      by  re-enablin
0117A0:  67 0D 0A 20 20 20 20 20 20 20 69 6E 74 65 72 72    g..       interr
0117B0:  75 70 74 73 20 69 6E 73 69 64 65 20 74 68 65 20    upts inside the 
0117C0:  69 6E 74 65 72 72 75 70 74 20 72 6F 75 74 69 6E    interrupt routin
0117D0:  65 2E 20 49 66 20 74 68 65 20 69 6E 74 65 72 72    e. If the interr
0117E0:  75 70 74 20 72 65 70 65 61 74 73 20 74 68 65 6E    upt repeats then
0117F0:  0D 0A 20 20 20 20 20 20 20 69 74 20 69 73 20 61    ..       it is a
011800:  73 73 75 6D 65 64 20 74 6F 20 62 65 20 61 6E 20    ssumed to be an 
011810:  65 78 74 65 72 6E 61 6C 20 69 6E 74 65 72 72 75    external interru
011820:  70 74 2C 20 6F 74 68 65 72 77 69 73 65 20 69 74    pt, otherwise it
011830:  20 69 73 20 74 61 6B 65 6E 20 74 6F 20 62 65 0D     is taken to be.
011840:  0A 20 20 20 20 20 20 20 61 20 74 69 6D 65 20 69    .       a time i
011850:  6E 74 65 72 72 75 70 74 2E 20 4E 6F 74 65 20 74    nterrupt. Note t
011860:  68 61 74 20 74 68 69 73 20 72 65 71 75 69 72 65    hat this require
011870:  73 20 74 68 61 74 20 74 68 65 20 73 6F 75 72 63    s that the sourc
011880:  65 20 6F 66 20 20 65 78 74 65 72 6E 61 6C 0D 0A    e of  external..
011890:  20 20 20 20 20 20 20 69 6E 74 65 72 72 75 70 74           interrupt
0118A0:  73 20 73 68 6F 75 6C 64 20 6E 6F 74 20 63 6C 65    s should not cle
0118B0:  61 72 20 74 68 65 20 69 6E 74 65 72 72 75 70 74    ar the interrupt
0118C0:  20 63 6F 6E 64 69 74 69 6F 6E 20 75 6E 74 69 6C     condition until
0118D0:  20 74 68 65 20 73 6F 66 74 77 61 72 65 0D 0A 20     the software.. 
0118E0:  20 20 20 20 20 20 72 65 73 65 74 73 20 69 74 2E          resets it.
0118F0:  20 55 6E 6C 65 73 73 20 73 70 65 63 69 61 6C 20     Unless special 
011900:  61 63 74 69 6F 6E 20 69 73 20 74 61 6B 65 6E 20    action is taken 
011910:  69 6E 20 68 61 72 64 77 61 72 65 2C 20 5A 38 30    in hardware, Z80
011920:  20 20 70 65 72 69 70 68 65 72 61 6C 0D 0A 20 20      peripheral..  
011930:  20 20 20 20 20 63 68 69 70 73 20 77 69 6C 6C 20         chips will 
011940:  6E 6F 74 20 6F 62 65 79 20 74 68 69 73 20 72 65    not obey this re
011950:  71 75 69 72 65 6D 65 6E 74 2E 20 49 6E 20 73 75    quirement. In su
011960:  63 68 20 20 63 61 73 65 73 20 20 74 68 65 20 20    ch  cases  the  
011970:  72 65 63 6F 6D 6D 65 6E 64 65 64 0D 0A 20 20 20    recommended..   
011980:  20 20 20 20 63 6F 75 72 73 65 20 6F 66 20 61 63        course of ac
011990:  74 69 6F 6E 20 69 73 20 64 65 73 63 72 69 62 65    tion is describe
0119A0:  64 20 69 6E 20 41 70 70 65 6E 64 69 78 20 58 49    d in Appendix XI
0119B0:  49 49 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 42 65    II.....       Be
0119C0:  66 6F 72 65 20 61 6E 20 65 78 74 65 72 6E 61 6C    fore an external
0119D0:  20 69 6E 74 65 72 72 75 70 74 20 69 73 20 65 6E     interrupt is en
0119E0:  61 62 6C 65 64 20 69 74 73 20 69 6E 74 65 72 72    abled its interr
0119F0:  75 70 74 20 68 61 6E 64 6C 65 72 20 6D 75 73 74    upt handler must
011A00:  20 20 62 65 0D 0A 20 20 20 20 20 20 20 27 20 69      be..       ' i
011A10:  6E 73 74 61 6C 6C 65 64 20 27 2E 20 54 68 69 73    nstalled '. This
011A20:  20 69 73 20 64 6F 6E 65 20 62 79 20 63 6F 70 79     is done by copy
011A30:  69 6E 67 20 74 68 65 20 35 20 62 79 74 65 73 20    ing the 5 bytes 
011A40:  61 74 20 61 64 64 72 65 73 73 20 23 30 30 33 42    at address #003B
011A50:  20 74 6F 0D 0A 20 20 20 20 20 20 20 61 20 6E 65     to..       a ne
011A60:  77 20 20 6C 6F 63 61 74 69 6F 6E 20 20 61 6E 64    w  location  and
011A70:  20 20 72 65 70 6C 61 63 69 6E 67 20 20 74 68 65      replacing  the
011A80:  6D 20 20 62 79 20 20 73 75 69 74 61 62 6C 65 20    m  by  suitable 
011A90:  20 63 6F 64 65 20 20 28 20 20 70 72 6F 62 61 62     code  (  probab
011AA0:  6C 79 0D 0A 20 20 20 20 20 20 20 69 6E 63 6C 75    ly..       inclu
011AB0:  64 69 6E 67 20 61 20 6A 75 6D 70 20 29 2E 20 57    ding a jump ). W
011AC0:  68 65 6E 20 74 68 65 20 4B 65 72 6E 65 6C 20 64    hen the Kernel d
011AD0:  65 74 65 63 74 73 20 61 6E 20 65 78 74 65 72 6E    etects an extern
011AE0:  61 6C 20 20 69 6E 74 65 72 72 75 70 74 20 20 69    al  interrupt  i
011AF0:  74 0D 0A 20 20 20 20 20 20 20 63 61 6C 6C 73 20    t..       calls 
011B00:  61 64 64 72 65 73 73 20 23 30 30 33 42 20 69 6E    address #003B in
011B10:  20 52 41 4D 20 74 6F 20 70 72 6F 63 65 73 73 20     RAM to process 
011B20:  74 68 65 20 69 6E 74 65 72 72 75 70 74 2E 0D 0A    the interrupt...
011B30:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
011B40:  20 45 6E 74 72 79 3A 0D 0A 0D 0A 20 20 20 20 20     Entry:....     
011B50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
011B60:  4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73 2E 0D 0A    No conditions...
011B70:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
011B80:  20 45 78 69 74 3A 0D 0A 0D 0A 20 20 20 20 20 20     Exit:....      
011B90:  20 20 20 20 20 20 20 20 20 20 20 20 20 41 46 2C                 AF,
011BA0:  20 42 43 2C 44 45 20 61 6E 64 20 48 4C 20 63 6F     BC,DE and HL co
011BB0:  72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 20    rrupt...        
011BC0:  20 20 20 20 20 20 20 20 20 20 20 41 6C 6C 20 6F               All o
011BD0:  74 68 65 72 20 72 65 67 69 73 74 65 72 73 20 70    ther registers p
011BE0:  72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20    reserved.....   
011BF0:  20 20 20 20 20 20 20 20 20 20 20 20 4E 6F 74 65                Note
011C00:  73 3A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    s:..            
011C10:  20 20 20 20 20 20 20 49 6E 74 65 72 72 75 70 74           Interrupt
011C20:  73 20 61 72 65 20 64 69 73 61 62 6C 65 64 20 61    s are disabled a
011C30:  6E 64 20 6D 75 73 74 20 72 65 6D 61 69 6E 20 64    nd must remain d
011C40:  69 73 61 62 6C 65 64 2E 0D 0A 20 20 20 20 20 20    isabled...      
011C50:  20 20 20 20 20 20 20 20 20 20 20 20 20 54 68 65                 The
011C60:  20 6C 6F 77 65 72 20 52 4F 4D 20 69 73 20 64 69     lower ROM is di
011C70:  73 61 62 6C 65 64 2E 0D 0A 20 20 20 20 20 20 20    sabled...       
011C80:  20 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20                The 
011C90:  75 70 70 65 72 20 52 4F 4D 20 73 65 6C 65 63 74    upper ROM select
011CA0:  20 61 6E 64 20 73 74 61 74 65 20 61 72 65 20 69     and state are i
011CB0:  6E 64 65 74 65 72 6D 69 6E 61 74 65 2E 0D 0A 20    ndeterminate... 
011CC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
011CD0:  20 20 54 68 65 20 61 6C 74 65 72 6E 61 74 65 20      The alternate 
011CE0:  72 65 67 69 73 74 65 72 20 73 65 74 20 6D 75 73    register set mus
011CF0:  74 20 6E 6F 74 20 62 65 20 74 6F 75 63 68 65 64    t not be touched
011D00:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
011D10:  69 6E 74 65 72 72 75 70 74 20 72 6F 75 74 69 6E    interrupt routin
011D20:  65 20 6D 75 73 74 20 65 73 74 61 62 6C 69 73 68    e must establish
011D30:  20 77 68 65 74 68 65 72 20 20 69 74 20 20 63 61     whether  it  ca
011D40:  6E 20 20 64 65 61 6C 20 20 77 69 74 68 20 20 74    n  deal  with  t
011D50:  68 65 0D 0A 20 20 20 20 20 20 20 69 6E 74 65 72    he..       inter
011D60:  72 75 70 74 2C 20 61 6E 64 20 69 66 20 73 6F 20    rupt, and if so 
011D70:  69 74 20 6D 75 73 74 20 61 74 20 6C 65 61 73 74    it must at least
011D80:  20 63 6C 65 61 72 20 69 74 2E 20 49 66 20 20 74     clear it. If  t
011D90:  68 65 20 20 69 6E 74 65 72 72 75 70 74 20 20 69    he  interrupt  i
011DA0:  73 0D 0A 20 20 20 20 20 20 20 6E 6F 74 20 74 68    s..       not th
011DB0:  65 20 72 65 73 70 6F 6E 73 69 62 69 6C 69 74 79    e responsibility
011DC0:  20 6F 66 20 74 68 65 20 72 6F 75 74 69 6E 65 20     of the routine 
011DD0:  74 68 65 6E 20 69 74 20 73 68 6F 75 6C 64 20 6A    then it should j
011DE0:  75 6D 70 20 74 6F 20 74 68 65 20 20 63 6F 70 79    ump to the  copy
011DF0:  0D 0A 20 20 20 20 20 20 20 6F 66 20 74 68 65 20    ..       of the 
011E00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
011E10:  0F 00 00 00 02 09 50 E5 0F 00 C1 02 00 00 00 02    ......P.........
011E20:  0F 00 C2 02 00 00 00 02 0F 00 C3 02 00 00 00 02    ................
011E30:  0F 00 C4 02 00 00 00 02 0F 00 C5 02 00 00 00 02    ................
011E40:  0F 00 C6 02 00 00 00 02 0F 00 C7 02 00 00 00 02    ................
011E50:  0F 00 C8 02 00 00 00 02 0F 00 C9 02 00 00 00 02    ................
011E60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011E70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011E80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011E90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011EA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011EB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011EC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011ED0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011EE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011EF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
011F00:  62 79 74 65 73 20 74 61 6B 65 6E 20 66 72 6F 6D    bytes taken from
011F10:  20 6C 6F 63 61 74 69 6F 6E 20 23 30 30 33 42 20     location #003B 
011F20:  77 68 69 63 68 20 6D 61 79 20 62 65 20 63 6F 6D    which may be com
011F30:  70 65 74 65 6E 74 20 74 6F 20 20 64 65 61 6C 0D    petent to  deal.
011F40:  0A 20 20 20 20 20 20 20 77 69 74 68 20 74 68 65    .       with the
011F50:  20 69 6E 74 65 72 72 75 70 74 2E 20 54 68 69 73     interrupt. This
011F60:  20 72 65 71 75 69 72 65 73 20 74 68 65 20 63 6F     requires the co
011F70:  64 65 20 70 61 74 63 68 65 64 20 61 74 20 20 6C    de patched at  l
011F80:  6F 63 61 74 69 6F 6E 20 20 23 30 30 33 42 0D 0A    ocation  #003B..
011F90:  20 20 20 20 20 20 20 74 6F 20 62 65 20 70 6F 73           to be pos
011FA0:  69 74 69 6F 6E 20 69 6E 64 65 70 65 6E 64 65 6E    ition independen
011FB0:  74 20 69 6E 20 63 61 73 65 20 61 20 73 65 63 6F    t in case a seco
011FC0:  6E 64 20 65 78 74 65 72 6E 61 6C 20 69 6E 74 65    nd external inte
011FD0:  72 72 75 70 74 20 68 61 6E 64 6C 65 72 0D 0A 20    rrupt handler.. 
011FE0:  20 20 20 20 20 20 69 73 20 69 6E 73 74 61 6C 6C          is install
011FF0:  65 64 2E 20 54 68 65 20 63 6F 64 65 20 70 75 74    ed. The code put
012000:  20 61 74 20 23 30 30 33 42 20 61 74 20 45 4D 53     at #003B at EMS
012010:  20 69 73 20 70 6F 73 69 74 69 6F 6E 20 20 69 6E     is position  in
012020:  64 65 70 65 6E 64 65 6E 74 20 20 2D 0D 0A 20 20    dependent  -..  
012030:  20 20 20 20 20 69 74 20 6D 65 72 65 6C 79 20 72         it merely r
012040:  65 74 75 72 6E 73 2E 0D 0A 0D 0A 20 20 20 20 20    eturns.....     
012050:  20 20 4E 6F 74 65 20 74 68 61 74 20 69 6E 74 65      Note that inte
012060:  72 72 75 70 74 20 68 61 6E 64 6C 69 6E 67 20 63    rrupt handling c
012070:  6F 64 65 20 6D 75 73 74 20 62 65 20 20 69 6E 20    ode must be  in 
012080:  20 52 41 4D 20 20 73 6F 6D 65 77 68 65 72 65 20     RAM  somewhere 
012090:  20 62 65 74 77 65 65 6E 0D 0A 20 20 20 20 20 20     between..      
0120A0:  20 23 30 30 34 30 20 61 6E 64 20 23 42 46 46 46     #0040 and #BFFF
0120B0:  2E 20 49 6E 74 65 72 72 75 70 74 20 68 61 6E 64    . Interrupt hand
0120C0:  6C 65 72 73 20 73 68 6F 75 6C 64 20 62 65 20 61    lers should be a
0120D0:  73 20 73 68 6F 72 74 20 61 73 20 70 6F 73 73 69    s short as possi
0120E0:  62 6C 65 2E 20 49 66 0D 0A 20 20 20 20 20 20 20    ble. If..       
0120F0:  61 6E 20 69 6E 74 65 72 72 75 70 74 20 72 65 71    an interrupt req
012100:  75 69 72 65 73 20 61 20 6C 6F 74 20 6F 66 20 20    uires a lot of  
012110:  70 72 6F 63 65 73 73 69 6E 67 20 20 62 65 79 6F    processing  beyo
012120:  6E 64 20 20 74 68 61 74 20 20 72 65 71 75 69 72    nd  that  requir
012130:  65 64 20 20 74 6F 0D 0A 20 20 20 20 20 20 20 63    ed  to..       c
012140:  6C 65 61 72 20 69 74 2C 20 74 68 65 6E 20 74 68    lear it, then th
012150:  65 20 69 6E 74 65 72 72 75 70 74 20 73 68 6F 75    e interrupt shou
012160:  6C 64 20 6B 69 63 6B 20 20 61 6E 20 20 65 76 65    ld kick  an  eve
012170:  6E 74 20 20 74 6F 20 20 64 6F 20 20 74 68 65 20    nt  to  do  the 
012180:  20 77 6F 72 6B 0D 0A 20 20 20 20 20 20 20 6F 75     work..       ou
012190:  74 73 69 64 65 20 74 68 65 20 69 6E 74 65 72 72    tside the interr
0121A0:  75 70 74 20 70 61 74 68 2E 0D 0A 0D 0A 0D 0A 0D    upt path........
0121B0:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
0121C0:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
0121D0:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
0121E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0121F0:  20 20 20 20 20 70 61 67 65 20 31 31 2E 32 0D 0A         page 11.2..
012200:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
012210:  20 20 20 31 31 2E 33 20 4E 6F 6E 6D 61 73 6B 61       11.3 Nonmaska
012220:  62 6C 65 20 49 6E 74 65 72 72 75 70 74 73 2E 0D    ble Interrupts..
012230:  0A 0D 0A 20 20 20 20 20 20 20 54 68 65 72 65 20    ...       There 
012240:  69 73 20 6E 6F 20 70 72 6F 76 69 73 69 6F 6E 20    is no provision 
012250:  66 6F 72 20 68 61 6E 64 6C 69 6E 67 20 61 20 6E    for handling a n
012260:  6F 6E 6D 61 73 6B 61 62 6C 65 20 20 69 6E 74 65    onmaskable  inte
012270:  72 72 75 70 74 20 20 28 4E 4D 49 29 20 20 69 6E    rrupt  (NMI)  in
012280:  0D 0A 20 20 20 20 20 20 20 74 68 65 20 66 69 72    ..       the fir
012290:  6D 77 61 72 65 20 28 64 65 73 70 69 74 65 20 74    mware (despite t
0122A0:  68 65 20 66 61 63 74 20 74 68 61 74 20 4E 4D 49    he fact that NMI
0122B0:  20 69 73 20 61 76 61 69 6C 61 62 6C 65 20 6F 6E     is available on
0122C0:  20 20 74 68 65 20 20 65 78 74 65 72 6E 61 6C 0D      the  external.
0122D0:  0A 20 20 20 20 20 20 20 62 75 73 20 63 6F 6E 6E    .       bus conn
0122E0:  65 63 74 6F 72 29 2E 20 56 61 72 69 6F 75 73 20    ector). Various 
0122F0:  66 69 72 6D 77 61 72 65 20 20 72 6F 75 74 69 6E    firmware  routin
012300:  65 73 20 20 28 6E 6F 74 61 62 6C 79 20 20 74 68    es  (notably  th
012310:  6F 73 65 20 20 63 6F 6E 6E 65 63 74 65 64 0D 0A    ose  connected..
012320:  20 20 20 20 20 20 20 77 69 74 68 20 64 72 69 76           with driv
012330:  69 6E 67 20 74 68 65 20 43 65 6E 74 72 6F 6E 69    ing the Centroni
012340:  63 73 20 70 6F 72 74 2C 20 74 68 65 20 50 50 49    cs port, the PPI
012350:  20 74 6F 20 61 63 63 65 73 73 20 74 68 65 20 73     to access the s
012360:  6F 75 6E 64 20 63 68 69 70 20 61 6E 64 0D 0A 20    ound chip and.. 
012370:  20 20 20 20 20 20 6B 65 79 62 6F 61 72 64 2C 20          keyboard, 
012380:  61 6E 64 20 74 68 65 20 63 61 73 73 65 74 74 65    and the cassette
012390:  29 20 77 69 6C 6C 20 68 61 76 65 20 74 69 6D 69    ) will have timi
0123A0:  6E 67 20 63 6F 6E 73 74 72 61 69 6E 74 73 20 20    ng constraints  
0123B0:  76 69 6F 6C 61 74 65 64 20 20 69 66 0D 0A 20 20    violated  if..  
0123C0:  20 20 20 20 20 4E 4D 49 73 20 6F 63 63 75 72 20         NMIs occur 
0123D0:  77 68 69 6C 73 74 20 74 68 65 79 20 61 72 65 20    whilst they are 
0123E0:  61 63 74 69 76 65 2E 20 49 74 20 69 73 20 72 65    active. It is re
0123F0:  63 6F 6D 6D 65 6E 64 65 64 20 74 68 61 74 20 20    commended that  
012400:  4E 4D 49 20 20 73 68 6F 75 6C 64 0D 0A 20 20 20    NMI  should..   
012410:  20 20 20 20 6E 6F 74 20 62 65 20 75 73 65 64 2E        not be used.
012420:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 31 2E 34 20    ....       11.4 
012430:  49 6E 74 65 72 72 75 70 74 73 20 61 6E 64 20 45    Interrupts and E
012440:  76 65 6E 74 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    vents.......    
012450:  20 20 20 41 73 20 61 20 67 65 6E 65 72 61 6C 20       As a general 
012460:  72 75 6C 65 20 68 61 72 64 77 61 72 65 20 69 6E    rule hardware in
012470:  74 65 72 72 75 70 74 73 20 73 68 6F 75 6C 64 20    terrupts should 
012480:  62 65 20 74 72 61 6E 73 66 6F 72 6D 65 64 20 69    be transformed i
012490:  6E 74 6F 20 74 68 65 69 72 0D 0A 20 20 20 20 20    nto their..     
0124A0:  20 20 73 6F 66 74 77 61 72 65 20 65 71 75 69 76      software equiv
0124B0:  61 6C 65 6E 74 73 2C 20 27 65 76 65 6E 74 73 27    alents, 'events'
0124C0:  2C 20 61 73 20 73 6F 6F 6E 20 61 73 20 70 6F 73    , as soon as pos
0124D0:  73 69 62 6C 65 2E 20 54 68 65 20 20 68 61 6E 64    sible. The  hand
0124E0:  6C 69 6E 67 20 20 6F 66 0D 0A 20 20 20 20 20 20    ling  of..      
0124F0:  20 65 76 65 6E 74 73 20 69 73 20 6D 6F 72 65 20     events is more 
012500:  66 6C 65 78 69 62 6C 65 20 74 68 61 6E 20 74 68    flexible than th
012510:  65 20 68 61 6E 64 6C 69 6E 67 20 6F 66 20 68 61    e handling of ha
012520:  72 64 77 61 72 65 20 69 6E 74 65 72 72 75 70 74    rdware interrupt
012530:  73 20 2D 20 66 6F 72 0D 0A 20 20 20 20 20 20 20    s - for..       
012540:  65 78 61 6D 70 6C 65 20 74 68 65 72 65 20 61 72    example there ar
012550:  65 20 6E 6F 20 72 65 73 74 72 69 63 74 69 6F 6E    e no restriction
012560:  73 20 6F 6E 20 77 68 65 72 65 20 65 76 65 6E 74    s on where event
012570:  20 72 6F 75 74 69 6E 65 73 20 6D 61 79 20 20 72     routines may  r
012580:  65 73 69 64 65 2C 0D 0A 20 20 20 20 20 20 20 6F    eside,..       o
012590:  72 20 6F 6E 20 69 6E 74 65 72 72 75 70 74 20 65    r on interrupt e
0125A0:  6E 61 62 6C 69 6E 67 2E 0D 0A 0D 0A 20 20 20 20    nabling.....    
0125B0:  20 20 20 45 76 65 6E 74 73 20 61 72 65 20 64 65       Events are de
0125C0:  73 63 72 69 62 65 64 20 62 79 20 61 6E 20 65 76    scribed by an ev
0125D0:  65 6E 74 20 62 6C 6F 63 6B 2E 20 54 68 69 73 20    ent block. This 
0125E0:  62 6C 6F 63 6B 20 63 6F 6E 74 61 69 6E 73 20 74    block contains t
0125F0:  68 65 20 20 65 76 65 6E 74 0D 0A 20 20 20 20 20    he  event..     
012600:  20 20 63 6C 61 73 73 2C 20 74 68 65 20 65 76 65      class, the eve
012610:  6E 74 20 63 6F 75 6E 74 20 61 6E 64 20 61 6E 20    nt count and an 
012620:  65 76 65 6E 74 20 72 6F 75 74 69 6E 65 20 20 61    event routine  a
012630:  64 64 72 65 73 73 2E 20 20 57 68 65 6E 20 20 61    ddress.  When  a
012640:  6E 20 20 65 76 65 6E 74 0D 0A 20 20 20 20 20 20    n  event..      
012650:  20 6F 63 63 75 72 73 20 74 68 65 20 65 76 65 6E     occurs the even
012660:  74 20 62 6C 6F 63 6B 20 69 73 20 27 6B 69 63 6B    t block is 'kick
012670:  65 64 27 20 61 6E 64 20 74 68 65 20 20 4B 65 72    ed' and the  Ker
012680:  6E 65 6C 20 20 61 72 72 61 6E 67 65 73 20 20 66    nel  arranges  f
012690:  6F 72 20 20 74 68 65 0D 0A 20 20 20 20 20 20 20    or  the..       
0126A0:  65 76 65 6E 74 20 72 6F 75 74 69 6E 65 20 74 6F    event routine to
0126B0:  20 62 65 20 63 61 6C 6C 65 64 20 6F 6E 63 65 20     be called once 
0126C0:  66 6F 72 20 65 61 63 68 20 6B 69 63 6B 20 20 28    for each kick  (
0126D0:  74 68 65 20 20 6E 75 6D 62 65 72 20 20 6F 66 20    the  number  of 
0126E0:  20 6B 69 63 6B 73 0D 0A 20 20 20 20 20 20 20 6F     kicks..       o
0126F0:  75 74 73 74 61 6E 64 69 6E 67 20 69 73 20 6B 65    utstanding is ke
012700:  70 74 20 69 6E 20 74 68 65 20 65 76 65 6E 74 20    pt in the event 
012710:  62 6C 6F 63 6B 29 2E 20 20 54 68 65 20 20 65 76    block).  The  ev
012720:  65 6E 74 20 20 72 6F 75 74 69 6E 65 20 20 69 73    ent  routine  is
012730:  20 20 6E 6F 74 0D 0A 20 20 20 20 20 20 20 6E 65      not..       ne
012740:  63 65 73 73 61 72 69 6C 79 20 63 61 6C 6C 65 64    cessarily called
012750:  20 69 6D 6D 65 64 69 61 74 65 6C 79 2E 20 57 68     immediately. Wh
012760:  65 6E 20 74 68 65 20 65 76 65 6E 74 20 72 6F 75    en the event rou
012770:  74 69 6E 65 20 69 73 20 61 63 74 75 61 6C 6C 79    tine is actually
012780:  20 72 75 6E 0D 0A 20 20 20 20 20 20 20 64 65 70     run..       dep
012790:  65 6E 64 73 20 6F 6E 20 74 68 65 20 65 76 65 6E    ends on the even
0127A0:  74 20 63 6C 61 73 73 20 61 73 20 66 6F 6C 6C 6F    t class as follo
0127B0:  77 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ws:....         
0127C0:  20 20 61 2E 20 45 78 70 72 65 73 73 20 41 73 79      a. Express Asy
0127D0:  6E 63 68 72 6F 6E 6F 75 73 20 45 76 65 6E 74 73    nchronous Events
0127E0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
0127F0:  54 68 69 73 20 69 73 20 61 6E 20 75 6E 75 73 75    This is an unusu
012800:  61 6C 20 63 6C 61 73 73 20 6F 66 20 65 76 65 6E    al class of even
012810:  74 2E 20 20 54 68 65 20 20 65 76 65 6E 20 20 72    t.  The  even  r
012820:  6F 75 74 69 6E 65 20 20 69 73 20 20 63 61 6C 6C    outine  is  call
012830:  65 64 0D 0A 20 20 20 20 20 20 20 20 20 20 20 69    ed..           i
012840:  6D 6D 65 64 69 61 74 65 6C 79 20 64 75 72 69 6E    mmediately durin
012850:  67 20 20 69 6E 74 65 72 72 75 70 74 20 20 70 72    g  interrupt  pr
012860:  6F 63 65 73 73 69 6E 67 2E 20 20 54 68 65 20 20    ocessing.  The  
012870:  72 6F 75 74 69 6E 65 20 20 6D 75 73 74 20 20 62    routine  must  b
012880:  65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 61 63    e..           ac
012890:  63 65 73 73 69 62 6C 65 20 62 79 20 74 68 65 20    cessible by the 
0128A0:  69 6E 74 65 72 72 75 70 74 20 63 6F 64 65 2C 20    interrupt code, 
0128B0:  69 74 20 6D 61 79 20 20 6E 6F 74 20 20 65 6E 61    it may  not  ena
0128C0:  62 6C 65 20 20 69 6E 74 65 72 72 75 70 74 73 2C    ble  interrupts,
0128D0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 63 6F 72    ..           cor
0128E0:  72 75 70 74 20 74 68 65 20 49 58 20 61 6E 64 20    rupt the IX and 
0128F0:  49 59 20 72 65 67 69 73 74 65 72 73 20 6F 72 20    IY registers or 
012900:  75 73 65 20 74 68 65 20 61 6C 74 65 72 6E 61 74    use the alternat
012910:  65 20 72 65 67 69 73 74 65 72 20 73 65 74 2E 0D    e register set..
012920:  0A 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20    .           The 
012930:  72 6F 75 74 69 6E 65 20 73 68 6F 75 6C 64 20 62    routine should b
012940:  65 20 61 73 20 73 68 6F 72 74 20 61 73 20 70 6F    e as short as po
012950:  73 73 69 62 6C 65 2E 0D 0A 0D 0A 20 20 20 20 20    ssible.....     
012960:  20 20 20 20 20 20 62 2E 20 4E 6F 72 6D 61 6C 20          b. Normal 
012970:  41 73 79 6E 63 68 72 6F 6E 6F 75 73 20 45 76 65    Asynchronous Eve
012980:  6E 74 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    nts.....        
012990:  20 20 20 54 68 69 73 20 69 73 20 74 68 65 20 6D       This is the m
0129A0:  6F 73 74 20 66 6C 65 78 69 62 6C 65 20 73 6F 72    ost flexible sor
0129B0:  74 20 6F 66 20 65 76 65 6E 74 2E 20 57 68 65 6E    t of event. When
0129C0:  20 74 68 65 20 65 76 65 6E 74 20 69 73 20 20 6B     the event is  k
0129D0:  69 63 6B 65 64 0D 0A 20 20 20 20 20 20 20 20 20    icked..         
0129E0:  20 20 74 68 65 20 65 76 65 6E 74 20 72 6F 75 74      the event rout
0129F0:  69 6E 65 20 69 73 20 6E 6F 74 20 63 61 6C 6C 65    ine is not calle
012A00:  64 2C 20 62 75 74 20 74 68 65 20 65 76 65 6E 74    d, but the event
012A10:  20 62 6C 6F 63 6B 20 69 73 20 70 6C 61 63 65 64     block is placed
012A20:  20 20 6F 6E 0D 0A 20 20 20 20 20 20 20 20 20 20      on..          
012A30:  20 74 68 65 20 69 6E 74 65 72 72 75 70 74 20 65     the interrupt e
012A40:  76 65 6E 74 20 70 65 6E 64 69 6E 67 20 71 75 65    vent pending que
012A50:  75 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ue.....         
012A60:  20 20 4F 6E 63 65 20 74 68 65 20 63 75 72 72 65      Once the curre
012A70:  6E 74 20 69 6E 74 65 72 72 75 70 74 20 68 61 73    nt interrupt has
012A80:  20 62 65 65 6E 20 20 70 72 6F 63 65 73 73 65 64     been  processed
012A90:  2C 20 20 6A 75 73 74 20 20 62 65 66 6F 72 65 20    ,  just  before 
012AA0:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20     the..          
012AB0:  20 4B 65 72 6E 65 6C 20 20 72 65 74 75 72 6E 73     Kernel  returns
012AC0:  20 20 66 72 6F 6D 20 20 74 68 65 20 20 69 6E 74      from  the  int
012AD0:  65 72 72 75 70 74 20 20 70 61 74 68 2C 20 20 61    errupt  path,  a
012AE0:  6E 79 20 20 65 76 65 6E 74 73 20 20 6F 6E 20 20    ny  events  on  
012AF0:  74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    the..           
012B00:  69 6E 74 65 72 72 75 70 74 20 65 76 65 6E 74 20    interrupt event 
012B10:  70 65 6E 64 69 6E 67 20 71 75 65 75 65 20 61 72    pending queue ar
012B20:  65 20 70 72 6F 63 65 73 73 65 64 2E 20 57 68 69    e processed. Whi
012B30:  6C 65 20 74 68 65 20 65 76 65 6E 74 73 20 20 61    le the events  a
012B40:  72 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 62    re..           b
012B50:  65 69 6E 67 20 70 72 6F 63 65 73 73 65 64 20 74    eing processed t
012B60:  68 65 20 73 79 73 74 65 6D 20 69 73 20 72 75 6E    he system is run
012B70:  6E 69 6E 67 20 77 69 74 68 20 69 6E 74 65 72 72    ning with interr
012B80:  75 70 74 73 20 65 6E 61 62 6C 65 64 20 20 61 6E    upts enabled  an
012B90:  64 0D 0A 20 20 20 20 20 20 20 20 20 20 20 6D 61    d..           ma
012BA0:  79 20 62 65 20 72 65 67 61 72 64 65 64 20 61 73    y be regarded as
012BB0:  20 6E 6F 20 6C 6F 6E 67 65 72 20 62 65 69 6E 67     no longer being
012BC0:  20 69 6E 20 74 68 65 20 69 6E 74 65 72 72 75 70     in the interrup
012BD0:  74 20 20 70 61 74 68 2E 20 20 49 74 20 20 69 73    t  path.  It  is
012BE0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 75 73 69    ..           usi
012BF0:  6E 67 20 69 74 73 20 6F 77 6E 20 73 74 61 63 6B    ng its own stack
012C00:  20 20 72 61 74 68 65 72 20 20 74 68 61 6E 20 20      rather  than  
012C10:  74 68 65 20 20 6D 61 69 6E 20 20 73 79 73 74 65    the  main  syste
012C20:  6D 20 20 73 74 61 63 6B 2E 20 20 54 68 69 73 0D    m  stack.  This.
012C30:  0A 20 20 20 20 20 20 20 20 20 20 20 70 72 69 76    .           priv
012C40:  61 74 65 20 73 74 61 63 6B 20 69 73 20 31 32 38    ate stack is 128
012C50:  20 62 79 74 65 73 20 6C 6F 6E 67 2E 0D 0A 0D 0A     bytes long.....
012C60:  20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 61               The a
012C70:  73 79 6E 63 68 72 6F 6E 6F 75 73 20 65 76 65 6E    synchronous even
012C80:  74 20 72 6F 75 74 69 6E 65 20 69 73 2C 20 74 68    t routine is, th
012C90:  65 72 65 66 6F 72 65 2C 20 63 61 6C 6C 65 64 20    erefore, called 
012CA0:  73 68 6F 72 74 6C 79 20 61 66 74 65 72 0D 0A 20    shortly after.. 
012CB0:  20 20 20 20 20 20 20 20 20 20 74 68 65 20 65 76              the ev
012CC0:  65 6E 74 20 69 73 20 6B 69 63 6B 65 64 20 61 6E    ent is kicked an
012CD0:  64 20 69 73 20 6E 6F 74 20 72 65 73 74 72 69 63    d is not restric
012CE0:  74 65 64 20 69 6E 20 77 68 61 74 20 20 69 74 20    ted in what  it 
012CF0:  20 6D 61 79 20 20 64 6F 20 20 6F 72 0D 0A 20 20     may  do  or..  
012D00:  20 20 20 20 20 20 20 20 20 77 68 65 72 65 20 69             where i
012D10:  74 20 6D 61 79 20 62 65 20 6C 6F 63 61 74 65 64    t may be located
012D20:  2E 20 54 68 65 20 65 76 65 6E 74 20 72 6F 75 74    . The event rout
012D30:  69 6E 65 20 6D 61 79 20 74 61 6B 65 20 61 73 20    ine may take as 
012D40:  6C 6F 6E 67 20 74 6F 20 72 75 6E 0D 0A 20 20 20    long to run..   
012D50:  20 20 20 20 20 20 20 20 61 73 20 69 73 20 6E 65            as is ne
012D60:  65 64 65 64 2E 20 41 6E 79 20 66 75 72 74 68 65    eded. Any furthe
012D70:  72 20 6B 69 63 6B 73 20 72 65 63 65 69 76 65 64    r kicks received
012D80:  20 64 75 72 69 6E 67 20 74 68 65 20 74 69 6D 65     during the time
012D90:  20 74 68 61 74 20 20 74 68 65 0D 0A 20 20 20 20     that  the..    
012DA0:  20 20 20 20 20 20 20 65 76 65 6E 74 20 72 6F 75           event rou
012DB0:  74 69 6E 65 20 69 73 20 72 75 6E 6E 69 6E 67 20    tine is running 
012DC0:  77 69 6C 6C 20 62 65 20 61 64 64 65 64 20 74 6F    will be added to
012DD0:  20 74 68 65 20 65 76 65 6E 74 20 63 6F 75 6E 74     the event count
012DE0:  20 61 6E 64 20 77 69 6C 6C 0D 0A 20 20 20 20 20     and will..     
012DF0:  20 20 20 20 20 20 62 65 20 70 72 6F 63 65 73 73          be process
012E00:  65 64 20 62 65 66 6F 72 65 20 72 65 74 75 72 6E    ed before return
012E10:  69 6E 67 20 74 6F 20 74 68 65 20 69 6E 74 65 72    ing to the inter
012E20:  72 75 70 74 20 70 72 6F 67 72 61 6D 2E 0D 0A 0D    rupt program....
012E30:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    .......       AM
012E40:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
012E50:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
012E60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
012E70:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
012E80:  31 31 2E 33 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    11.3............
012E90:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 63 2E 20    ..           c. 
012EA0:  53 79 6E 63 68 72 6F 6E 6F 75 73 20 45 76 65 6E    Synchronous Even
012EB0:  74 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ts.......       
012EC0:  20 20 20 20 53 79 6E 63 68 72 6F 6E 6F 75 73 20        Synchronous 
012ED0:  65 76 65 6E 74 73 20 61 72 65 20 71 75 65 75 65    events are queue
012EE0:  64 20 6F 6E 20 20 74 68 65 20 20 73 79 6E 63 68    d on  the  synch
012EF0:  72 6F 6E 6F 75 73 20 20 65 76 65 6E 74 20 20 70    ronous  event  p
012F00:  65 6E 64 69 6E 67 0D 0A 20 20 20 20 20 20 20 20    ending..        
012F10:  20 20 20 71 75 65 75 65 2E 20 54 68 65 79 20 61       queue. They a
012F20:  72 65 20 6E 6F 74 20 70 72 6F 63 65 73 73 65 64    re not processed
012F30:  20 75 6E 74 69 6C 20 74 68 65 20 66 6F 72 65 67     until the foreg
012F40:  72 6F 75 6E 64 20 70 72 6F 67 72 61 6D 20 20 61    round program  a
012F50:  6C 6C 6F 77 73 0D 0A 20 20 20 20 20 20 20 20 20    llows..         
012F60:  20 20 74 68 65 20 20 71 75 65 75 65 20 20 74 6F      the  queue  to
012F70:  20 20 62 65 20 20 70 72 6F 63 65 73 73 65 64 2E      be  processed.
012F80:  20 20 54 68 69 73 20 20 63 61 6E 20 20 62 65 20      This  can  be 
012F90:  20 75 73 65 64 20 20 20 74 6F 20 20 20 63 6F 6E     used   to   con
012FA0:  74 72 6F 6C 0D 0A 20 20 20 20 20 20 20 20 20 20    trol..          
012FB0:  20 69 6E 74 65 72 61 63 74 69 6F 6E 73 20 62 65     interactions be
012FC0:  74 77 65 65 6E 20 64 69 66 66 65 72 65 6E 74 20    tween different 
012FD0:  70 61 72 74 73 20 6F 66 20 70 72 6F 67 72 61 6D    parts of program
012FE0:  73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    s.......       1
012FF0:  31 2E 35 20 49 6E 74 65 72 72 75 70 74 20 51 75    1.5 Interrupt Qu
013000:  65 75 65 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    eues.......     
013010:  20 20 54 68 65 20 76 61 72 69 6F 75 73 20 74 69      The various ti
013020:  6D 65 20 69 6E 74 65 72 72 75 70 74 73 20 20 70    me interrupts  p
013030:  72 6F 76 69 64 65 20 20 74 68 72 65 65 20 20 73    rovide  three  s
013040:  6F 75 72 63 65 73 20 20 6F 66 20 20 27 6B 69 63    ources  of  'kic
013050:  6B 73 27 20 20 66 6F 72 0D 0A 20 20 20 20 20 20    ks'  for..      
013060:  20 65 76 65 6E 74 73 2E 20 54 68 65 20 65 76 65     events. The eve
013070:  6E 74 73 20 74 6F 20 62 65 20 6B 69 63 6B 65 64    nts to be kicked
013080:  20 77 68 65 6E 20 65 61 63 68 20 6F 66 20 74 68     when each of th
013090:  65 20 69 6E 74 65 72 72 75 70 74 73 20 6F 63 63    e interrupts occ
0130A0:  75 72 20 20 61 72 65 0D 0A 20 20 20 20 20 20 20    ur  are..       
0130B0:  73 74 6F 72 65 64 20 6F 6E 20 71 75 65 75 65 73    stored on queues
0130C0:  2C 20 6F 6E 65 20 20 71 75 65 75 65 20 20 66 6F    , one  queue  fo
0130D0:  72 20 20 65 61 63 68 20 20 73 6F 75 72 63 65 20    r  each  source 
0130E0:  20 6F 66 20 20 6B 69 63 6B 73 2E 20 20 54 68 65     of  kicks.  The
0130F0:  20 20 75 73 65 72 0D 0A 20 20 20 20 20 20 20 70      user..       p
013100:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
013110:  10 00 00 00 02 09 50 E5 10 00 C1 02 00 00 00 02    ......P.........
013120:  10 00 C2 02 00 00 00 02 10 00 C3 02 00 00 00 02    ................
013130:  10 00 C4 02 00 00 00 02 10 00 C5 02 00 00 00 02    ................
013140:  10 00 C6 02 00 00 00 02 10 00 C7 02 00 00 00 02    ................
013150:  10 00 C8 02 00 00 00 02 10 00 C9 02 00 00 00 02    ................
013160:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
013170:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
013180:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
013190:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0131F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
013200:  72 6F 76 69 64 65 73 20 61 6E 20 61 72 65 61 20    rovides an area 
013210:  74 6F 20 73 74 6F 72 65 20 66 6F 72 20 74 68 65    to store for the
013220:  20 4B 65 72 6E 65 6C 27 73 20 75 73 65 2E 20 54     Kernel's use. T
013230:  68 65 20 73 69 7A 65 20 6F 66 20 20 74 68 65 20    he size of  the 
013240:  20 61 72 65 61 0D 0A 20 20 20 20 20 20 20 64 65     area..       de
013250:  70 65 6E 64 73 20 6F 6E 20 77 68 69 63 68 20 71    pends on which q
013260:  75 65 75 65 20 69 74 20 69 73 20 66 6F 72 2E 20    ueue it is for. 
013270:  54 68 65 20 6C 61 73 74 20 37 20 62 79 74 65 73    The last 7 bytes
013280:  20 20 6F 66 20 20 74 68 65 20 20 61 72 65 61 20      of  the  area 
013290:  20 61 72 65 0D 0A 20 20 20 20 20 20 20 61 6C 77     are..       alw
0132A0:  61 79 73 20 61 6E 20 65 76 65 6E 74 20 62 6C 6F    ays an event blo
0132B0:  63 6B 20 77 68 69 63 68 20 74 68 65 20 75 73 65    ck which the use
0132C0:  72 20 73 68 6F 75 6C 64 20 69 6E 69 74 69 61 6C    r should initial
0132D0:  69 7A 65 20 20 61 70 70 72 6F 70 72 69 61 74 65    ize  appropriate
0132E0:  6C 79 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ly.......       
0132F0:  41 70 70 65 6E 64 69 78 20 58 20 64 65 73 63 72    Appendix X descr
013300:  69 62 65 73 20 74 68 65 20 6C 61 79 6F 75 74 20    ibes the layout 
013310:  6F 66 20 74 68 65 73 65 20 62 6C 6F 63 6B 73 20    of these blocks 
013320:  69 6E 20 67 72 65 61 74 65 72 20 64 65 74 61 69    in greater detai
013330:  6C 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    l.......        
013340:  20 20 20 61 2E 20 46 61 73 74 20 54 69 63 6B 65       a. Fast Ticke
013350:  72 20 45 76 65 6E 74 73 2E 0D 0A 0D 0A 0D 0A 20    r Events....... 
013360:  20 20 20 20 20 20 20 20 20 20 45 76 65 6E 74 73              Events
013370:  20 6F 6E 20 74 68 65 20 66 61 73 74 20 74 69 63     on the fast tic
013380:  6B 65 72 20 71 75 65 75 65 20 61 72 65 20 27 6B    ker queue are 'k
013390:  69 63 6B 65 64 27 20 6F 6E 20 65 61 63 68 20 20    icked' on each  
0133A0:  66 61 73 74 20 20 74 69 63 6B 65 72 0D 0A 20 20    fast  ticker..  
0133B0:  20 20 20 20 20 20 20 20 20 69 6E 74 65 72 72 75             interru
0133C0:  70 74 2C 20 69 2E 65 2E 20 65 76 65 72 79 20 31    pt, i.e. every 1
0133D0:  2F 33 30 30 74 68 20 6F 66 20 61 20 73 65 63 6F    /300th of a seco
0133E0:  6E 64 2E 20 41 20 66 61 73 74 20 74 69 63 6B 65    nd. A fast ticke
0133F0:  72 20 62 6C 6F 63 6B 20 20 69 73 0D 0A 20 20 20    r block  is..   
013400:  20 20 20 20 20 20 20 20 39 20 62 79 74 65 73 20            9 bytes 
013410:  6C 6F 6E 67 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    long.......     
013420:  20 20 20 20 20 20 62 2E 20 54 69 63 6B 65 72 20          b. Ticker 
013430:  45 76 65 6E 74 73 2E 0D 0A 0D 0A 0D 0A 20 20 20    Events.......   
013440:  20 20 20 20 20 20 20 20 45 61 63 68 20 65 76 65            Each eve
013450:  6E 74 20 6F 6E 20 74 68 65 20 74 69 63 6B 65 72    nt on the ticker
013460:  20 71 75 65 75 65 20 69 73 20 61 73 73 6F 63 69     queue is associ
013470:  61 74 65 64 20 20 77 69 74 68 20 20 61 20 20 74    ated  with  a  t
013480:  69 6D 65 72 2E 20 20 54 68 65 0D 0A 20 20 20 20    imer.  The..    
013490:  20 20 20 20 20 20 20 74 69 6D 65 72 20 6D 61 79           timer may
0134A0:  20 62 65 20 61 20 27 6F 6E 65 20 73 68 6F 74 27     be a 'one shot'
0134B0:  2C 20 77 68 69 63 68 20 67 6F 65 73 20 6F 66 66    , which goes off
0134C0:  20 20 6F 6E 63 65 2C 20 20 6F 72 20 20 61 20 20      once,  or  a  
0134D0:  72 65 70 65 61 74 65 72 2C 0D 0A 20 20 20 20 20    repeater,..     
0134E0:  20 20 20 20 20 20 77 68 69 63 68 20 67 6F 65 73          which goes
0134F0:  20 6F 66 66 20 70 65 72 69 6F 64 69 63 61 6C 6C     off periodicall
013500:  79 2E 20 54 68 65 20 74 69 6D 65 72 20 63 6F 75    y. The timer cou
013510:  6E 74 73 20 20 74 69 63 6B 65 72 20 20 69 6E 74    nts  ticker  int
013520:  65 72 72 75 70 74 73 2C 0D 0A 20 20 20 20 20 20    errupts,..      
013530:  20 20 20 20 20 69 2E 65 2E 20 31 2F 35 30 74 68         i.e. 1/50th
013540:  73 20 6F 66 20 61 20 73 65 63 6F 6E 64 2C 20 61    s of a second, a
013550:  6E 64 20 77 68 65 6E 20 20 73 75 66 66 69 63 69    nd when  suffici
013560:  65 6E 74 20 20 68 61 76 65 20 20 6F 63 63 75 72    ent  have  occur
013570:  72 65 64 20 20 69 74 0D 0A 20 20 20 20 20 20 20    red  it..       
013580:  20 20 20 20 67 6F 65 73 20 6F 66 66 2E 20 45 61        goes off. Ea
013590:  63 68 20 74 69 6D 65 20 74 68 65 20 74 69 6D 65    ch time the time
0135A0:  72 20 61 73 73 6F 63 69 61 74 65 64 20 77 69 74    r associated wit
0135B0:  68 20 61 6E 20 20 65 76 65 6E 74 20 20 67 6F 65    h an  event  goe
0135C0:  73 20 20 6F 66 66 0D 0A 20 20 20 20 20 20 20 20    s  off..        
0135D0:  20 20 20 74 68 65 20 65 76 65 6E 74 20 69 73 20       the event is 
0135E0:  6B 69 63 6B 65 64 2E 20 41 20 74 69 63 6B 65 72    kicked. A ticker
0135F0:  20 62 6C 6F 63 6B 20 69 73 20 31 33 20 62 79 74     block is 13 byt
013600:  65 73 20 6C 6F 6E 67 2E 0D 0A 0D 0A 0D 0A 20 20    es long.......  
013610:  20 20 20 20 20 20 20 20 20 63 2E 20 46 72 61 6D             c. Fram
013620:  65 20 46 6C 79 62 61 63 6B 20 45 76 65 6E 74 73    e Flyback Events
013630:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    .......         
013640:  20 20 45 76 65 6E 74 73 20 6F 6E 20 74 68 65 20      Events on the 
013650:  66 72 61 6D 65 20 66 6C 79 62 61 63 6B 20 71 75    frame flyback qu
013660:  65 75 65 20 61 72 65 20 6B 69 63 6B 65 64 20 6F    eue are kicked o
013670:  6E 20 65 61 63 68 20 66 72 61 6D 65 20 66 6C 79    n each frame fly
013680:  62 61 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20    back..          
013690:  20 69 6E 74 65 72 72 75 70 74 2C 20 69 2E 65 2E     interrupt, i.e.
0136A0:  20 31 2F 35 30 74 68 20 6F 66 20 61 20 73 65 63     1/50th of a sec
0136B0:  6F 6E 64 20 6F 6E 20 50 41 4C 20 6F 72 20 20 53    ond on PAL or  S
0136C0:  45 43 41 4D 20 20 6D 61 63 68 69 6E 65 73 20 20    ECAM  machines  
0136D0:  61 6E 64 0D 0A 20 20 20 20 20 20 20 20 20 20 20    and..           
0136E0:  65 76 65 72 79 20 31 2F 36 30 74 68 20 6F 66 20    every 1/60th of 
0136F0:  61 20 73 65 63 6F 6E 64 20 6F 6E 20 4E 54 53 43    a second on NTSC
013700:  20 6D 61 63 68 69 6E 65 73 2E 20 41 20 66 72 61     machines. A fra
013710:  6D 65 20 20 66 6C 79 62 61 63 6B 20 20 62 6C 6F    me  flyback  blo
013720:  63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20 69    ck..           i
013730:  73 20 39 20 62 79 74 65 73 20 6C 6F 6E 67 2E 0D    s 9 bytes long..
013740:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
013750:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54    .....       AMST
013760:  52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36    RAD CPC464/664/6
013770:  31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20    128 FIRMWARE    
013780:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
013790:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 31             page 11
0137A0:  2E 34 0D 0A 1A 68 65 72 65 20 69 73 20 6F 6E 6C    .4...here is onl
0137B0:  79 20 6F 6E 65 20 73 6F 75 72 63 65 20 20 6F 66    y one source  of
0137C0:  20 20 69 6E 74 65 72 72 75 70 74 73 20 20 69 6E      interrupts  in
0137D0:  20 20 61 6E 20 20 75 6E 65 78 70 61 6E 64 65 64      an  unexpanded
0137E0:  20 20 6D 61 63 68 69 6E 65 2C 0D 0A 20 20 20 20      machine,..    
0137F0:  20 20 20 6E 61 6D 65 6C 79 20 20 61 20 20 72 65       namely  a  re
013800:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013810:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013820:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013830:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013840:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013850:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013860:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013870:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013880:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013890:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0138F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013900:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013910:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013920:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013930:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013940:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013950:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013960:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013970:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013980:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013990:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0139F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
013A00:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
013A10:  32 20 45 76 65 6E 74 73 2E 0D 0A 0D 0A 0D 0A 20    2 Events....... 
013A20:  20 20 20 20 20 20 54 68 65 20 65 76 65 6E 20 6D          The even m
013A30:  65 63 68 61 6E 69 73 6D 20 69 73 20 70 72 69 6D    echanism is prim
013A40:  61 72 69 6C 79 20 70 72 6F 76 69 64 65 64 20 62    arily provided b
013A50:  79 20 74 68 65 20 4B 65 72 6E 65 6C 20 74 6F 20    y the Kernel to 
013A60:  73 75 70 70 6F 72 74 20 20 74 68 65 0D 0A 20 20    support  the..  
013A70:  20 20 20 20 20 68 61 6E 64 6C 69 6E 67 20 20 6F         handling  o
013A80:  66 20 20 69 6E 74 65 72 72 75 70 74 73 20 20 61    f  interrupts  a
013A90:  6E 64 20 20 6F 74 68 65 72 20 20 65 78 74 65 72    nd  other  exter
013AA0:  6E 61 6C 20 20 65 76 65 6E 74 73 2E 20 20 48 6F    nal  events.  Ho
013AB0:  77 65 76 65 72 2C 20 20 74 68 65 0D 0A 20 20 20    wever,  the..   
013AC0:  20 20 20 20 6D 65 63 68 61 6E 69 73 6D 20 6D 61        mechanism ma
013AD0:  79 20 61 6C 73 6F 20 62 65 20 75 73 65 64 20 74    y also be used t
013AE0:  6F 20 68 61 6E 64 6C 65 20 69 6E 74 65 72 6E 61    o handle interna
013AF0:  6C 20 20 65 76 65 6E 74 73 20 20 69 6E 20 20 63    l  events  in  c
013B00:  6F 6D 70 6C 69 63 61 74 65 64 0D 0A 20 20 20 20    omplicated..    
013B10:  20 20 20 70 72 6F 67 72 61 6D 73 20 20 28 73 75       programs  (su
013B20:  63 68 20 20 61 73 20 20 61 20 20 73 69 6D 75 6C    ch  as  a  simul
013B30:  61 74 69 6F 6E 2C 20 20 66 6F 72 20 20 20 65 78    ation,  for   ex
013B40:  61 6D 70 6C 65 29 2E 20 20 20 41 6E 20 20 20 65    ample).   An   e
013B50:  76 65 6E 74 20 20 20 69 73 0D 0A 20 20 20 20 20    vent   is..     
013B60:  20 20 63 68 61 72 61 63 74 65 72 69 73 65 64 20      characterised 
013B70:  62 79 20 74 68 65 20 66 6F 6C 6C 6F 77 69 6E 67    by the following
013B80:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    :......         
013B90:  20 20 61 2E 20 45 76 65 6E 74 20 43 6C 61 73 73      a. Event Class
013BA0:  20 28 73 65 65 20 73 65 63 74 69 6F 6E 20 31 32     (see section 12
013BB0:  2E 31 29 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .1)......       
013BC0:  20 20 20 20 45 76 65 6E 74 73 20 6D 61 79 20 62        Events may b
013BD0:  65 20 73 79 6E 63 68 72 6F 6E 6F 75 73 20 6F 72    e synchronous or
013BE0:  20 61 73 79 6E 63 68 72 6F 6E 6F 75 73 2C 20 65     asynchronous, e
013BF0:  78 70 72 65 73 73 20 6F 72 20 6E 6F 72 6D 61 6C    xpress or normal
013C00:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    .......         
013C10:  20 20 62 2E 20 45 76 65 6E 74 20 50 72 69 6F 72      b. Event Prior
013C20:  69 74 79 20 28 73 65 65 20 73 65 63 74 69 6F 6E    ity (see section
013C30:  20 31 32 2E 31 29 0D 0A 0D 0A 0D 0A 20 20 20 20     12.1)......    
013C40:  20 20 20 20 20 20 20 53 79 6E 63 68 72 6F 6E 6F           Synchrono
013C50:  75 73 20 65 76 65 6E 74 73 20 68 61 76 65 20 61    us events have a
013C60:  6E 20 61 73 73 6F 63 69 61 74 65 64 20 70 72 69    n associated pri
013C70:  6F 72 69 74 79 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    ority.......    
013C80:  20 20 20 20 20 20 20 63 2E 20 45 76 65 6E 74 20           c. Event 
013C90:  43 6F 75 6E 74 20 28 73 65 65 20 73 65 63 74 69    Count (see secti
013CA0:  6F 6E 20 31 32 2E 32 29 0D 0A 0D 0A 0D 0A 20 20    on 12.2)......  
013CB0:  20 20 20 20 20 20 20 20 20 45 61 63 68 20 74 69             Each ti
013CC0:  6D 65 20 61 6E 20 65 76 65 6E 74 20 6F 63 63 75    me an event occu
013CD0:  72 73 20 74 68 65 20 63 6F 75 6E 74 20 69 73 20    rs the count is 
013CE0:  69 6E 63 72 65 6D 65 6E 74 65 64 2E 0D 0A 20 20    incremented...  
013CF0:  20 20 20 20 20 20 20 20 20 45 61 63 68 20 74 69             Each ti
013D00:  6D 65 20 61 6E 20 65 76 65 6E 74 20 69 73 20 70    me an event is p
013D10:  72 6F 63 65 73 73 65 64 20 74 68 65 20 63 6F 75    rocessed the cou
013D20:  6E 74 20 69 73 20 64 65 63 72 65 6D 65 6E 74 65    nt is decremente
013D30:  64 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 54    d...           T
013D40:  68 65 20 65 76 65 6E 74 20 6D 61 79 20 62 65 20    he event may be 
013D50:  64 69 73 61 72 6D 65 64 20 62 79 20 73 65 74 74    disarmed by sett
013D60:  69 6E 67 20 74 68 65 20 63 6F 75 6E 74 20 6E 65    ing the count ne
013D70:  67 61 74 69 76 65 2E 0D 0A 0D 0A 20 20 20 20 20    gative.....     
013D80:  20 20 20 20 20 20 64 2E 20 45 76 65 6E 74 20 52          d. Event R
013D90:  6F 75 74 69 6E 65 2E 20 28 73 65 65 20 73 65 63    outine. (see sec
013DA0:  74 69 6F 6E 20 31 32 2E 33 29 0D 0A 0D 0A 20 20    tion 12.3)....  
013DB0:  20 20 20 20 20 20 20 20 20 54 68 65 20 61 64 64             The add
013DC0:  72 65 73 73 20 6F 66 20 74 68 65 20 72 6F 75 74    ress of the rout
013DD0:  69 6E 65 20 77 68 69 63 68 20 69 73 20 63 61 6C    ine which is cal
013DE0:  6C 65 64 20 74 6F 20 70 72 6F 63 65 73 73 20 74    led to process t
013DF0:  68 65 20 65 76 65 6E 74 2E 0D 0A 0D 0A 0D 0A 20    he event....... 
013E00:  20 20 20 20 20 20 41 6E 20 65 76 65 6E 74 20 61          An event a
013E10:  70 70 65 61 72 73 20 74 6F 20 74 68 65 20 4B 65    ppears to the Ke
013E20:  72 6E 65 6C 20 61 73 20 61 20 64 61 74 61 20 62    rnel as a data b
013E30:  6C 6F 63 6B 20 20 63 6F 6E 74 61 69 6E 69 6E 67    lock  containing
013E40:  20 20 74 68 65 20 20 61 62 6F 76 65 0D 0A 20 20      the  above..  
013E50:  20 20 20 20 20 76 61 6C 75 65 73 20 28 73 65 65         values (see
013E60:  20 41 70 70 65 6E 64 69 78 20 58 20 66 6F 72 20     Appendix X for 
013E70:  74 68 65 20 65 78 61 63 74 20 6C 61 79 6F 75 74    the exact layout
013E80:  20 6F 66 20 61 6E 20 20 65 76 65 6E 74 20 20 62     of an  event  b
013E90:  6C 6F 63 6B 29 2E 20 20 54 68 65 0D 0A 20 20 20    lock).  The..   
013EA0:  20 20 20 20 62 6C 6F 63 6B 20 6D 75 73 74 20 62        block must b
013EB0:  65 20 69 6E 20 74 68 65 20 63 65 6E 74 72 61 6C    e in the central
013EC0:  20 33 32 4B 20 62 79 74 65 73 20 6F 66 20 6D 65     32K bytes of me
013ED0:  6D 6F 72 79 2C 20 73 6F 20 74 68 61 74 20 20 74    mory, so that  t
013EE0:  68 65 20 20 4B 65 72 6E 65 6C 0D 0A 20 20 20 20    he  Kernel..    
013EF0:  20 20 20 63 61 6E 20 61 63 63 65 73 73 20 69 74       can access it
013F00:  20 77 69 74 68 6F 75 74 20 77 6F 72 72 79 69 6E     without worryin
013F10:  67 20 61 62 6F 75 74 20 74 68 65 20 52 4F 4D 20    g about the ROM 
013F20:  65 6E 61 62 6C 65 20 73 74 61 74 65 2E 0D 0A 0D    enable state....
013F30:  0A 20 20 20 20 20 20 20 57 68 65 6E 20 61 6E 20    .       When an 
013F40:  65 76 65 6E 74 20 6F 63 63 75 72 73 20 74 68 65    event occurs the
013F50:  20 61 73 73 6F 63 69 61 74 65 64 20 65 76 65 6E     associated even
013F60:  74 20 62 6C 6F 63 6B 20 69 73 20 6B 69 63 6B 65    t block is kicke
013F70:  64 20 20 62 79 20 20 63 61 6C 6C 69 6E 67 0D 0A    d  by  calling..
013F80:  20 20 20 20 20 20 20 4B 4C 20 45 56 45 4E 54 2E           KL EVENT.
013F90:  20 49 66 20 74 68 65 20 65 76 65 6E 74 20 63 6F     If the event co
013FA0:  75 6E 74 20 20 69 73 20 20 6E 65 67 61 74 69 76    unt  is  negativ
013FB0:  65 2C 20 20 74 68 65 20 20 27 6B 69 63 6B 27 20    e,  the  'kick' 
013FC0:  20 69 73 20 20 69 67 6E 6F 72 65 64 2C 0D 0A 20     is  ignored,.. 
013FD0:  20 20 20 20 20 20 6F 74 68 65 72 77 69 73 65 20          otherwise 
013FE0:  74 68 65 20 65 76 65 6E 74 20 63 6F 75 6E 74 20    the event count 
013FF0:  69 73 20 69 6E 63 72 65 6D 65 6E 74 65 64 20 28    is incremented (
014000:  75 70 20 74 6F 20 61 20 6D 61 78 69 6D 75 6D 20    up to a maximum 
014010:  6F 66 20 31 32 37 29 20 20 61 6E 64 0D 0A 20 20    of 127)  and..  
014020:  20 20 20 20 20 74 68 65 20 65 76 65 6E 74 20 72         the event r
014030:  6F 75 74 69 6E 65 20 77 69 6C 6C 20 20 62 65 20    outine will  be 
014040:  20 63 61 6C 6C 65 64 20 20 61 74 20 20 73 6F 6D     called  at  som
014050:  65 20 20 74 69 6D 65 20 20 69 6E 20 20 74 68 65    e  time  in  the
014060:  20 20 66 75 74 75 72 65 20 20 2D 0D 0A 20 20 20      future  -..   
014070:  20 20 20 20 64 65 70 65 6E 64 69 6E 67 20 6F 6E        depending on
014080:  20 74 68 65 20 65 76 65 6E 74 20 63 6C 61 73 73     the event class
014090:  2E 20 57 68 65 6E 20 74 68 65 20 65 76 65 6E 74    . When the event
0140A0:  20 72 6F 75 74 69 6E 65 20 72 65 74 75 72 6E 73     routine returns
0140B0:  20 74 68 65 20 65 76 65 6E 74 0D 0A 20 20 20 20     the event..    
0140C0:  20 20 20 63 6F 75 6E 74 20 69 73 20 64 65 63 72       count is decr
0140D0:  65 6D 65 6E 74 65 64 2C 20 75 6E 6C 65 73 73 20    emented, unless 
0140E0:  69 74 20 68 61 73 20 62 65 65 6E 20 73 65 74 20    it has been set 
0140F0:  74 6F 20 7A 65 72 6F 20 20 6F 72 20 20 6E 65 67    to zero  or  neg
014100:  61 74 69 76 65 20 20 69 6E 0D 0A 20 20 20 20 20    ative  in..     
014110:  20 20 74 68 65 20 6D 65 61 6E 74 69 6D 65 2E 0D      the meantime..
014120:  0A 0D 0A 20 20 20 20 20 20 20 31 32 2E 31 20 45    ...       12.1 E
014130:  76 65 6E 74 20 43 6C 61 73 73 2E 0D 0A 0D 0A 20    vent Class..... 
014140:  20 20 20 20 20 20 45 76 65 6E 74 73 20 61 72 65          Events are
014150:  20 65 69 74 68 65 72 20 73 79 6E 63 68 72 6F 6E     either synchron
014160:  6F 75 73 20 6F 72 20 61 73 79 6E 63 68 72 6F 6E    ous or asynchron
014170:  6F 75 73 2E 20 41 73 79 6E 63 68 72 6F 6E 6F 75    ous. Asynchronou
014180:  73 20 65 76 65 6E 74 73 20 61 72 65 0D 0A 20 20    s events are..  
014190:  20 20 20 20 20 69 6E 74 65 6E 64 65 64 20 66 6F         intended fo
0141A0:  72 20 74 68 65 20 70 72 6F 63 65 73 73 69 6E 67    r the processing
0141B0:  20 6F 66 20 65 78 74 65 72 6E 61 6C 20 65 76 65     of external eve
0141C0:  6E 74 73 20 20 77 68 69 63 68 20 20 72 65 71 75    nts  which  requ
0141D0:  69 72 65 20 20 61 6C 6D 6F 73 74 0D 0A 20 20 20    ire  almost..   
0141E0:  20 20 20 20 69 6D 6D 65 64 69 61 74 65 20 73 65        immediate se
0141F0:  72 76 69 63 65 2E 20 54 68 65 20 70 72 6F 63 65    rvice. The proce
014200:  73 73 69 6E 67 20 6F 66 20 61 73 79 6E 63 68 72    ssing of asynchr
014210:  6F 6E 6F 75 73 20 65 76 65 6E 74 73 20 70 72 65    onous events pre
014220:  2D 65 6D 70 74 73 20 74 68 65 0D 0A 20 20 20 20    -empts the..    
014230:  20 20 20 6D 61 69 6E 20 70 72 6F 67 72 61 6D 2E       main program.
014240:  20 54 68 65 20 20 70 72 6F 63 65 73 73 69 6E 67     The  processing
014250:  20 20 6F 66 20 20 73 79 6E 63 68 72 6F 6E 6F 75      of  synchronou
014260:  73 20 20 65 76 65 6E 74 73 20 20 69 73 20 20 75    s  events  is  u
014270:  6E 64 65 72 20 20 74 68 65 0D 0A 20 20 20 20 20    nder  the..     
014280:  20 20 63 6F 6D 70 6C 65 74 65 20 63 6F 6E 74 72      complete contr
014290:  6F 6C 20 6F 66 20 74 68 65 20 6D 61 69 6E 20 70    ol of the main p
0142A0:  72 6F 67 72 61 6D 2C 20 77 68 69 63 68 20 20 77    rogram, which  w
0142B0:  69 6C 6C 2C 20 20 69 6E 20 20 67 65 6E 65 72 61    ill,  in  genera
0142C0:  6C 2C 20 20 64 65 61 6C 0D 0A 20 20 20 20 20 20    l,  deal..      
0142D0:  20 77 69 74 68 20 74 68 65 6D 20 77 68 65 6E 20     with them when 
0142E0:  69 74 20 69 73 20 63 6F 6E 76 65 6E 69 65 6E 74    it is convenient
0142F0:  20 74 6F 20 64 6F 20 73 6F 2E 0D 0A 0D 0A 0D 0A     to do so.......
014300:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
014310:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
014320:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
014330:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
014340:  20 20 20 20 70 61 67 65 20 31 32 2E 31 0D 0A 0D        page 12.1...
014350:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
014360:  20 20 61 2E 20 41 73 79 6E 63 68 72 6F 6E 6F 75      a. Asynchronou
014370:  73 20 45 76 65 6E 74 73 2E 0D 0A 20 20 20 20 20    s Events...     
014380:  20 20 41 6E 20 61 73 79 6E 63 68 72 6F 6E 6F 75      An asynchronou
014390:  73 20 65 76 65 6E 74 20 69 73 20 70 72 6F 63 65    s event is proce
0143A0:  73 73 65 64 20 69 6D 6D 65 64 69 61 74 65 6C 79    ssed immediately
0143B0:  20 74 68 65 20 65 76 65 6E 74 20 69 73 20 20 6B     the event is  k
0143C0:  69 63 6B 65 64 20 20 2D 0D 0A 20 20 20 20 20 20    icked  -..      
0143D0:  20 6F 72 20 61 6C 6D 6F 73 74 20 69 6D 6D 65 64     or almost immed
0143E0:  69 61 74 65 6C 79 20 69 66 20 74 68 65 20 6B 69    iately if the ki
0143F0:  63 6B 20 6F 63 63 75 72 73 20 69 6E 20 74 68 65    ck occurs in the
014400:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
014410:  11 00 00 00 02 09 50 E5 11 00 C1 02 00 00 00 02    ......P.........
014420:  11 00 C2 02 00 00 00 02 11 00 C3 02 00 00 00 02    ................
014430:  11 00 C4 02 00 00 00 02 11 00 C5 02 00 00 00 02    ................
014440:  11 00 C6 02 00 00 00 02 11 00 C7 02 00 00 00 02    ................
014450:  11 00 C8 02 00 00 00 02 11 00 C9 02 00 00 00 02    ................
014460:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
014470:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
014480:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
014490:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0144F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
014500:  20 69 6E 74 65 72 72 75 70 74 20 70 61 74 68 20     interrupt path 
014510:  20 2D 20 20 73 65 65 0D 0A 20 20 20 20 20 20 20     -  see..       
014520:  73 65 63 74 69 6F 6E 20 31 31 20 6F 6E 20 69 6E    section 11 on in
014530:  74 65 72 72 75 70 74 73 2E 20 54 68 65 20 4B 65    terrupts. The Ke
014540:  72 6E 65 6C 20 64 6F 65 73 20 6E 6F 74 20 70 72    rnel does not pr
014550:  6F 76 69 64 65 20 20 61 6E 79 20 20 69 6E 74 65    ovide  any  inte
014560:  72 6C 6F 63 6B 73 0D 0A 20 20 20 20 20 20 20 62    rlocks..       b
014570:  65 74 77 65 65 6E 20 61 73 79 6E 63 68 72 6F 6E    etween asynchron
014580:  6F 75 73 20 65 76 65 6E 74 73 20 61 6E 64 20 74    ous events and t
014590:  68 65 20 6D 61 69 6E 20 70 72 6F 67 72 61 6D 20    he main program 
0145A0:  6F 72 20 6F 74 68 65 72 20 20 65 76 65 6E 74 73    or other  events
0145B0:  2C 20 20 73 6F 0D 0A 20 20 20 20 20 20 20 63 61    ,  so..       ca
0145C0:  72 65 20 6D 75 73 74 20 62 65 20 65 78 65 72 63    re must be exerc
0145D0:  69 73 65 64 20 74 6F 20 61 76 6F 69 64 20 69 6E    ised to avoid in
0145E0:  74 65 72 61 63 74 69 6F 6E 73 2E 20 49 74 20 20    teractions. It  
0145F0:  69 73 20 20 6D 6F 73 74 20 20 75 6E 77 69 73 65    is  most  unwise
014600:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 63 61 6C      to..       cal
014610:  6C 20 72 6F 75 74 69 6E 65 73 20 74 68 61 74 20    l routines that 
014620:  61 72 65 20 6E 6F 74 20 72 65 2D 65 6E 74 72 61    are not re-entra
014630:  6E 74 20 20 2D 20 20 66 6F 72 20 20 65 78 61 6D    nt  -  for  exam
014640:  70 6C 65 2C 20 20 74 68 65 20 20 66 69 72 6D 77    ple,  the  firmw
014650:  61 72 65 0D 0A 20 20 20 20 20 20 20 73 63 72 65    are..       scre
014660:  65 6E 20 64 72 69 76 69 6E 67 20 72 6F 75 74 69    en driving routi
014670:  6E 65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49    nes.....       I
014680:  66 20 74 68 65 20 65 76 65 6E 74 20 63 6F 75 6E    f the event coun
014690:  74 20 69 73 20 73 74 69 6C 6C 20 67 72 65 61 74    t is still great
0146A0:  65 72 20 74 68 61 6E 20 7A 65 72 6F 20 77 68 65    er than zero whe
0146B0:  6E 20 74 68 65 20 20 65 76 65 6E 74 20 20 72 6F    n the  event  ro
0146C0:  75 74 69 6E 65 0D 0A 20 20 20 20 20 20 20 72 65    utine..       re
0146D0:  74 75 72 6E 73 2C 20 69 74 20 69 73 20 64 65 63    turns, it is dec
0146E0:  72 65 6D 65 6E 74 65 64 2E 20 49 66 20 74 68 65    remented. If the
0146F0:  20 63 6F 75 6E 74 20 20 72 65 6D 61 69 6E 73 20     count  remains 
014700:  20 67 72 65 61 74 65 72 20 20 74 68 61 6E 20 20     greater  than  
014710:  7A 65 72 6F 0D 0A 20 20 20 20 20 20 20 74 68 65    zero..       the
014720:  6E 20 74 68 65 20 70 72 6F 63 65 73 73 20 69 73    n the process is
014730:  20 72 65 70 65 61 74 65 64 20 28 74 68 65 20 65     repeated (the e
014740:  76 65 6E 74 20 72 6F 75 74 69 6E 65 20 69 73 20    vent routine is 
014750:  20 63 61 6C 6C 65 64 20 20 61 67 61 69 6E 20 20     called  again  
014760:  61 6E 64 0D 0A 20 20 20 20 20 20 20 74 68 65 20    and..       the 
014770:  65 76 65 6E 74 20 63 6F 75 6E 74 20 69 73 20 64    event count is d
014780:  65 63 72 65 6D 65 6E 74 65 64 29 20 75 6E 74 69    ecremented) unti
014790:  6C 20 74 68 65 20 63 6F 75 6E 74 20 62 65 63 6F    l the count beco
0147A0:  6D 65 73 20 7A 65 72 6F 20 6F 72 20 69 73 20 73    mes zero or is s
0147B0:  65 74 0D 0A 20 20 20 20 20 20 20 6E 65 67 61 74    et..       negat
0147C0:  69 76 65 20 28 73 65 65 20 31 32 2E 32 20 62 65    ive (see 12.2 be
0147D0:  6C 6F 77 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    low).....       
0147E0:  62 2E 20 53 79 6E 63 68 72 6F 6E 6F 75 73 20 45    b. Synchronous E
0147F0:  76 65 6E 74 73 2E 0D 0A 20 20 20 20 20 20 20 53    vents...       S
014800:  79 6E 63 68 72 6F 6E 6F 75 73 20 65 76 65 6E 74    ynchronous event
014810:  73 20 61 72 65 20 6E 6F 74 20 70 72 6F 63 65 73    s are not proces
014820:  73 65 64 20 77 68 65 6E 20 74 68 65 20 65 76 65    sed when the eve
014830:  6E 74 20 69 73 20 6B 69 63 6B 65 64 2C 20 62 75    nt is kicked, bu
014840:  74 20 61 72 65 0D 0A 20 20 20 20 20 20 20 70 6C    t are..       pl
014850:  61 63 65 64 20 6F 6E 20 74 68 65 20 73 79 6E 63    aced on the sync
014860:  68 72 6F 6E 6F 75 73 20 65 76 65 6E 74 20 71 75    hronous event qu
014870:  65 75 65 2C 20 77 61 69 74 69 6E 67 20 74 6F 20    eue, waiting to 
014880:  62 65 20 70 72 6F 63 65 73 73 65 64 2E 20 45 76    be processed. Ev
014890:  65 6E 74 73 0D 0A 20 20 20 20 20 20 20 61 72 65    ents..       are
0148A0:  20 71 75 65 75 65 64 20 69 6E 20 64 65 73 63 65     queued in desce
0148B0:  6E 64 69 6E 67 20 6F 72 64 65 72 20 6F 66 20 70    nding order of p
0148C0:  72 69 6F 72 69 74 79 20 20 2D 20 20 65 71 75 61    riority  -  equa
0148D0:  6C 20 20 70 72 69 6F 72 69 74 79 20 20 65 76 65    l  priority  eve
0148E0:  6E 74 73 0D 0A 20 20 20 20 20 20 20 61 66 74 65    nts..       afte
0148F0:  72 20 74 68 6F 73 65 20 61 6C 72 65 61 64 79 20    r those already 
014900:  6F 6E 20 74 68 65 20 71 75 65 75 65 2E 0D 0A 0D    on the queue....
014910:  0A 20 20 20 20 20 20 20 54 68 65 20 20 66 6F 72    .       The  for
014920:  65 67 72 6F 75 6E 64 20 20 70 72 6F 67 72 61 6D    eground  program
014930:  20 20 73 68 6F 75 6C 64 20 20 70 6F 6C 6C 20 20      should  poll  
014940:  74 68 65 20 20 73 79 6E 63 68 72 6F 6E 6F 75 73    the  synchronous
014950:  20 20 65 76 65 6E 74 20 20 71 75 65 75 65 0D 0A      event  queue..
014960:  20 20 20 20 20 20 20 72 65 67 75 6C 61 72 6C 79           regularly
014970:  2C 20 74 6F 20 73 65 65 20 69 66 20 74 68 65 72    , to see if ther
014980:  65 20 61 72 65 20 61 6E 79 20 65 76 65 6E 74 73    e are any events
014990:  20 6F 75 74 73 74 61 6E 64 69 6E 67 2E 20 20 49     outstanding.  I
0149A0:  66 20 20 74 68 65 72 65 20 20 61 72 65 0D 0A 20    f  there  are.. 
0149B0:  20 20 20 20 20 20 74 68 65 6E 20 69 74 20 73 68          then it sh
0149C0:  6F 75 6C 64 20 70 72 6F 63 65 73 73 20 74 68 65    ould process the
0149D0:  6D 2E 20 54 68 65 20 64 69 66 66 65 72 65 6E 63    m. The differenc
0149E0:  65 20 20 62 65 74 77 65 65 6E 20 20 73 79 6E 63    e  between  sync
0149F0:  68 72 6F 6E 6F 75 73 20 20 61 6E 64 0D 0A 20 20    hronous  and..  
014A00:  20 20 20 20 20 61 73 79 6E 63 68 72 6F 6E 6F 75         asynchronou
014A10:  73 20 65 76 65 6E 74 73 20 69 73 2C 20 74 68 65    s events is, the
014A20:  72 65 66 6F 72 65 2C 20 74 68 61 74 20 74 68 65    refore, that the
014A30:  20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67     foreground prog
014A40:  72 61 6D 20 64 65 63 69 64 65 73 0D 0A 20 20 20    ram decides..   
014A50:  20 20 20 20 77 68 65 6E 20 73 79 6E 63 68 72 6F        when synchro
014A60:  6E 6F 75 73 20 65 76 65 6E 74 73 20 73 68 6F 75    nous events shou
014A70:  6C 64 20 62 65 20 70 72 6F 63 65 73 73 65 64 2C    ld be processed,
014A80:  20 62 75 74 20 20 74 68 65 20 20 65 76 65 6E 74     but  the  event
014A90:  20 20 27 6B 69 63 6B 65 72 27 0D 0A 20 20 20 20      'kicker'..    
014AA0:  20 20 20 64 65 63 69 64 65 73 20 77 68 65 6E 20       decides when 
014AB0:  61 73 79 6E 63 68 72 6F 6E 6F 75 73 20 65 76 65    asynchronous eve
014AC0:  6E 74 73 20 20 61 72 65 20 20 70 72 6F 63 65 73    nts  are  proces
014AD0:  73 65 64 2E 20 20 50 72 6F 76 69 64 65 64 20 20    sed.  Provided  
014AE0:  74 68 61 74 20 20 74 68 65 0D 0A 20 20 20 20 20    that  the..     
014AF0:  20 20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F      foreground pro
014B00:  67 72 61 6D 20 74 61 6B 65 73 20 73 75 69 74 61    gram takes suita
014B10:  62 6C 65 20 63 61 72 65 2C 20 74 68 65 72 65 20    ble care, there 
014B20:  73 68 6F 75 6C 64 20 62 65 20 6E 6F 20 20 64 69    should be no  di
014B30:  66 66 69 63 75 6C 74 79 0D 0A 20 20 20 20 20 20    fficulty..      
014B40:  20 69 6E 20 68 61 6E 64 6C 69 6E 67 20 74 68 65     in handling the
014B50:  20 69 6E 74 65 72 61 63 74 69 6F 6E 73 20 61 6E     interactions an
014B60:  64 20 72 65 73 6F 75 72 63 65 20 73 68 61 72 69    d resource shari
014B70:  6E 67 20 62 65 74 77 65 65 6E 20 20 73 79 6E 63    ng between  sync
014B80:  68 72 6F 6E 6F 75 73 0D 0A 20 20 20 20 20 20 20    hronous..       
014B90:  65 76 65 6E 74 73 20 61 6E 64 20 74 68 65 20 66    events and the f
014BA0:  6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67 72 61    oreground progra
014BB0:  6D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 57 68 65    m.....       Whe
014BC0:  6E 20 74 68 65 20 66 6F 72 65 67 72 6F 75 6E 64    n the foreground
014BD0:  20 70 72 6F 67 72 61 6D 20 66 69 6E 64 73 20 74     program finds t
014BE0:  68 65 20 73 79 6E 63 68 72 6F 6E 6F 75 73 20 65    he synchronous e
014BF0:  76 65 6E 74 20 71 75 65 75 65 20 20 69 73 20 20    vent queue  is  
014C00:  6E 6F 74 0D 0A 20 20 20 20 20 20 20 65 6D 70 74    not..       empt
014C10:  79 20 69 74 20 73 68 6F 75 6C 64 20 28 62 75 74    y it should (but
014C20:  20 69 73 20 6E 6F 74 20 63 6F 6E 73 74 72 61 69     is not constrai
014C30:  6E 65 64 20 74 6F 29 20 20 69 6E 73 74 72 75 63    ned to)  instruc
014C40:  74 20 20 74 68 65 20 20 4B 65 72 6E 65 6C 20 20    t  the  Kernel  
014C50:  74 6F 0D 0A 20 20 20 20 20 20 20 70 72 6F 63 65    to..       proce
014C60:  73 73 20 74 68 65 20 66 69 72 73 74 20 65 76 65    ss the first eve
014C70:  6E 74 20 6F 6E 20 74 68 65 20 71 75 65 75 65 2E    nt on the queue.
014C80:  20 57 68 65 6E 20 61 20 73 79 6E 63 68 72 6F 6E     When a synchron
014C90:  6F 75 73 20 65 76 65 6E 74 20 72 6F 75 74 69 6E    ous event routin
014CA0:  65 0D 0A 20 20 20 20 20 20 20 69 73 20 72 75 6E    e..       is run
014CB0:  20 74 68 65 20 4B 65 72 6E 65 6C 20 72 65 6D 65     the Kernel reme
014CC0:  6D 62 65 72 73 20 74 68 65 20 70 72 69 6F 72 69    mbers the priori
014CD0:  74 79 20 6F 66 20 74 68 65 20 65 76 65 6E 74 2E    ty of the event.
014CE0:  20 20 49 6E 20 20 74 68 65 20 20 65 76 65 6E 74      In  the  event
014CF0:  0D 0A 20 20 20 20 20 20 20 72 6F 75 74 69 6E 65    ..       routine
014D00:  20 74 68 65 20 73 79 6E 63 68 72 6F 6E 6F 75 73     the synchronous
014D10:  20 65 76 65 6E 74 20 71 75 65 75 65 20 6D 61 79     event queue may
014D20:  20 20 62 65 20 20 70 6F 6C 6C 65 64 2C 20 20 62      be  polled,  b
014D30:  75 74 20 20 74 68 65 20 20 4B 65 72 6E 65 6C 0D    ut  the  Kernel.
014D40:  0A 20 20 20 20 20 20 20 68 69 64 65 73 20 61 6E    .       hides an
014D50:  79 20 65 76 65 6E 74 20 77 68 6F 73 65 20 70 72    y event whose pr
014D60:  69 6F 72 69 74 79 20 69 73 20 6C 65 73 73 20 74    iority is less t
014D70:  68 61 6E 20 6F 72 20 20 65 71 75 61 6C 20 20 74    han or  equal  t
014D80:  6F 20 20 74 68 61 74 20 20 65 76 65 6E 74 0D 0A    o  that  event..
014D90:  20 20 20 20 20 20 20 63 75 72 72 65 6E 74 6C 79           currently
014DA0:  20 62 65 69 6E 67 20 70 72 6F 63 65 73 73 65 64     being processed
014DB0:  2E 20 57 68 65 6E 20 74 68 65 20 65 76 65 6E 74    . When the event
014DC0:  20 72 6F 75 74 69 6E 65 20 72 65 74 75 72 6E 73     routine returns
014DD0:  20 74 68 65 20 70 72 65 76 69 6F 75 73 0D 0A 20     the previous.. 
014DE0:  20 20 20 20 20 20 65 76 65 6E 74 20 70 72 69 6F          event prio
014DF0:  72 69 74 79 20 69 73 20 72 65 73 74 6F 72 65 64    rity is restored
014E00:  20 2D 20 20 73 6F 20 20 74 68 65 20 20 70 72 6F     -  so  the  pro
014E10:  63 65 73 73 69 6E 67 20 20 6F 66 20 20 65 76 65    cessing  of  eve
014E20:  6E 74 73 20 20 6D 61 79 20 20 62 65 0D 0A 20 20    nts  may  be..  
014E30:  20 20 20 20 20 6E 65 73 74 65 64 2E 0D 0A 0D 0A         nested.....
014E40:  20 20 20 20 20 20 20 54 68 65 20 73 79 6E 63 68           The synch
014E50:  72 6F 6E 6F 75 73 20 65 76 65 6E 74 20 70 72 69    ronous event pri
014E60:  6F 72 69 74 69 65 73 20 61 72 65 20 73 70 6C 69    orities are spli
014E70:  74 20 69 6E 74 6F 20 20 74 77 6F 20 20 72 61 6E    t into  two  ran
014E80:  67 65 73 2C 20 20 65 78 70 72 65 73 73 0D 0A 20    ges,  express.. 
014E90:  20 20 20 20 20 20 61 6E 64 20 6E 6F 72 6D 61 6C          and normal
014EA0:  2E 20 41 6C 6C 20 65 78 70 72 65 73 73 20 65 76    . All express ev
014EB0:  65 6E 74 73 20 68 61 76 65 20 68 69 67 68 65 72    ents have higher
014EC0:  20 70 72 69 6F 72 69 74 69 65 73 20 74 68 61 6E     priorities than
014ED0:  20 61 6C 6C 20 20 6E 6F 72 6D 61 6C 0D 0A 20 20     all  normal..  
014EE0:  20 20 20 20 20 65 76 65 6E 74 73 2E 20 54 68 65         events. The
014EF0:  20 4B 65 72 6E 65 6C 20 70 72 6F 76 69 64 65 73     Kernel provides
014F00:  20 61 20 6D 65 63 68 61 6E 69 73 6D 20 74 6F 20     a mechanism to 
014F10:  64 69 73 61 62 6C 65 20 74 68 65 20 20 70 72 6F    disable the  pro
014F20:  63 65 73 73 69 6E 67 20 20 6F 66 0D 0A 20 20 20    cessing  of..   
014F30:  20 20 20 20 6E 6F 72 6D 61 6C 20 65 76 65 6E 74        normal event
014F40:  73 2C 20 77 69 74 68 6F 75 74 20 61 66 66 65 63    s, without affec
014F50:  74 69 6E 67 20 65 78 70 72 65 73 73 20 65 76 65    ting express eve
014F60:  6E 74 73 2E 20 54 68 69 73 20 6D 61 79 20 62 65    nts. This may be
014F70:  20 20 75 73 65 64 20 20 74 6F 0D 0A 20 20 20 20      used  to..    
014F80:  20 20 20 69 6D 70 6C 65 6D 65 6E 74 20 27 63 72       implement 'cr
014F90:  69 74 69 63 61 6C 20 72 65 67 69 6F 6E 73 27 20    itical regions' 
014FA0:  74 68 72 6F 75 67 68 20 77 68 69 63 68 20 6E 6F    through which no
014FB0:  72 6D 61 6C 20 65 76 65 6E 74 73 20 6D 61 79 20    rmal events may 
014FC0:  69 6E 74 65 72 61 63 74 2E 0D 0A 20 20 20 20 20    interact...     
014FD0:  20 20 54 68 65 20 73 79 6E 63 68 72 6F 6E 6F 75      The synchronou
014FE0:  73 20 65 76 65 6E 74 20 27 6B 69 63 6B 65 64 27    s event 'kicked'
014FF0:  20 20 62 79 20 20 74 68 65 20 20 4B 65 79 20 20      by  the  Key  
015000:  4D 61 6E 61 67 65 72 20 20 62 72 65 61 6B 20 20    Manager  break  
015010:  68 61 6E 64 6C 69 6E 67 0D 0A 20 20 20 20 20 20    handling..      
015020:  20 6D 65 63 68 61 6E 69 73 6D 20 69 73 20 61 6E     mechanism is an
015030:  20 65 78 61 6D 70 6C 65 20 6F 66 20 61 6E 20 65     example of an e
015040:  78 70 72 65 73 73 20 73 79 6E 63 68 72 6F 6E 6F    xpress synchrono
015050:  75 73 20 65 76 65 6E 74 2E 0D 0A 0D 0A 20 20 20    us event.....   
015060:  20 20 20 20 31 32 2E 32 20 45 76 65 6E 74 20 43        12.2 Event C
015070:  6F 75 6E 74 2E 0D 0A 20 20 20 20 20 20 20 54 68    ount...       Th
015080:  65 20 6D 61 69 6E 20 70 75 72 70 6F 73 65 20 6F    e main purpose o
015090:  66 20 74 68 65 20 65 76 65 6E 74 20 63 6F 75 6E    f the event coun
0150A0:  74 20 69 73 20 74 6F 20 6B 65 65 70 20 74 72 61    t is to keep tra
0150B0:  63 6B 20 6F 66 20 74 68 65 20 64 69 66 66 65 72    ck of the differ
0150C0:  65 6E 63 65 0D 0A 20 20 20 20 20 20 20 62 65 74    ence..       bet
0150D0:  77 65 65 6E 20 74 68 65 20 6E 75 6D 62 65 72 20    ween the number 
0150E0:  6F 66 20 74 69 6D 65 73 20 74 68 65 20 65 76 65    of times the eve
0150F0:  6E 74 20 68 61 73 20 62 65 65 6E 20 6B 69 63 6B    nt has been kick
015100:  65 64 2C 20 61 6E 64 20 74 68 65 20 20 6E 75 6D    ed, and the  num
015110:  62 65 72 0D 0A 20 20 20 20 20 20 20 61 20 74 69    ber..       a ti
015120:  6D 65 73 20 74 68 65 20 65 76 65 6E 74 20 68 61    mes the event ha
015130:  73 20 62 65 65 6E 20 70 72 6F 63 65 73 73 65 64    s been processed
015140:  2E 20 54 68 69 73 20 65 6E 73 75 72 65 73 20 74    . This ensures t
015150:  68 61 74 20 61 20 6B 69 63 6B 20 69 73 20 20 6E    hat a kick is  n
015160:  6F 74 0D 0A 20 20 20 20 20 20 20 6D 69 73 73 65    ot..       misse
015170:  64 20 69 66 20 69 74 20 6F 63 63 75 72 73 20 62    d if it occurs b
015180:  65 66 6F 72 65 20 74 68 65 20 70 72 65 76 69 6F    efore the previo
015190:  75 73 20 6B 69 63 6B 20 68 61 73 20 62 65 65 6E    us kick has been
0151A0:  20 20 70 72 6F 63 65 73 73 65 64 2E 20 20 54 68      processed.  Th
0151B0:  65 0D 0A 20 20 20 20 20 20 20 65 76 65 6E 74 20    e..       event 
0151C0:  63 6F 75 6E 74 20 69 73 20 6E 6F 72 6D 61 6C 6C    count is normall
0151D0:  79 20 69 6E 63 72 65 6D 65 6E 74 65 64 20 20 77    y incremented  w
0151E0:  68 65 6E 20 20 74 68 65 20 20 65 76 65 6E 74 20    hen  the  event 
0151F0:  20 69 73 20 20 6B 69 63 6B 65 64 20 20 61 6E 64     is  kicked  and
015200:  0D 0A 20 20 20 20 20 20 20 64 65 63 72 65 6D 65    ..       decreme
015210:  6E 74 65 64 20 77 68 65 6E 20 74 68 65 20 65 76    nted when the ev
015220:  65 6E 74 20 72 6F 75 74 69 6E 65 20 72 65 74 75    ent routine retu
015230:  72 6E 73 2E 20 48 6F 77 65 76 65 72 20 74 68 65    rns. However the
015240:  20 20 65 78 61 63 74 20 20 61 63 74 69 6F 6E 0D      exact  action.
015250:  0A 20 20 20 20 20 20 20 64 65 70 65 6E 64 73 20    .       depends 
015260:  6F 6E 20 74 68 65 20 65 76 65 6E 74 20 63 6F 75    on the event cou
015270:  6E 74 20 61 73 20 66 6F 6C 6C 6F 77 73 3A 0D 0A    nt as follows:..
015280:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
015290:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
0152A0:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
0152B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0152C0:  20 20 20 20 20 20 20 20 70 61 67 65 20 31 32 2E            page 12.
0152D0:  32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    2.............. 
0152E0:  20 20 20 20 20 20 20 20 20 20 49 6E 63 72 65 6D              Increm
0152F0:  65 6E 74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ent.....        
015300:  20 20 20 20 20 20 20 20 2D 31 32 38 2E 2E 2D 32            -128..-2
015310:  3A 20 54 68 65 20 63 6F 75 6E 74 20 69 73 20 6E    : The count is n
015320:  6F 74 20 63 68 61 6E 67 65 64 20 2D 20 74 68 65    ot changed - the
015330:  20 65 76 65 6E 74 20 69 73 20 69 67 6E 6F 72 65     event is ignore
015340:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    d.....          
015350:  20 20 20 20 20 20 2D 31 3A 20 20 20 20 20 20 20          -1:       
015360:  54 68 69 73 20 76 61 6C 75 65 20 69 73 20 69 6C    This value is il
015370:  6C 65 67 61 6C 2E 0D 0A 0D 0A 20 20 20 20 20 20    legal.....      
015380:  20 20 20 20 20 20 20 20 20 20 30 3A 20 20 20 20              0:    
015390:  20 20 20 20 54 68 65 20 63 6F 75 6E 74 20 69 73        The count is
0153A0:  20 69 6E 63 72 65 6D 65 6E 74 65 64 20 61 6E 64     incremented and
0153B0:  20 20 65 76 65 6E 74 20 20 70 72 6F 63 65 73 73      event  process
0153C0:  69 6E 67 20 20 69 73 0D 0A 20 20 20 20 20 20 20    ing  is..       
0153D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0153E0:  20 20 20 69 6E 69 74 69 61 74 65 64 20 61 73 20       initiated as 
0153F0:  72 65 71 75 69 72 65 64 20 62 79 20 74 68 65 20    required by the 
015400:  65 76 65 6E 20 63 6C 61 73 73 2E 0D 0A 0D 0A 20    even class..... 
015410:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 31                   1
015420:  2E 2E 31 32 36 3A 20 20 20 54 68 65 20 63 6F 75    ..126:   The cou
015430:  6E 74 20 69 73 20 69 6E 63 72 65 6D 65 6E 74 65    nt is incremente
015440:  64 20 62 75 74 20 6E 6F 20 66 75 72 74 68 65 72    d but no further
015450:  20 20 61 63 74 69 6F 6E 20 20 69 73 0D 0A 20 20      action  is..  
015460:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
015470:  20 20 20 20 20 20 20 20 74 61 6B 65 6E 2E 20 54            taken. T
015480:  68 65 20 65 76 65 6E 74 20 69 73 20 77 61 69 74    he event is wait
015490:  69 6E 67 20 66 6F 72 20 61 20 70 72 65 76 69 6F    ing for a previo
0154A0:  75 73 20 6B 69 63 6B 20 20 74 6F 0D 0A 20 20 20    us kick  to..   
0154B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0154C0:  20 20 20 20 20 20 20 62 65 20 70 72 6F 63 65 73           be proces
0154D0:  73 65 64 20 6F 72 20 66 6F 72 20 70 72 6F 63 65    sed or for proce
0154E0:  73 73 69 6E 67 20 74 6F 20 63 6F 6D 70 6C 65 74    ssing to complet
0154F0:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    e.....          
015500:  20 20 20 20 20 20 31 32 37 3A 20 20 20 20 20 20          127:      
015510:  54 68 65 20 63 6F 75 6E 74 20 69 73 20 6E 6F 74    The count is not
015520:  20 63 68 61 6E 67 65 64 20 2D 20 74 68 65 20 6B     changed - the k
015530:  69 63 6B 20 69 73 20 69 67 6E 6F 72 65 64 2E 0D    ick is ignored..
015540:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 44 65    ...           De
015550:  63 72 65 6D 65 6E 74 2E 0D 0A 0D 0A 20 20 20 20    crement.....    
015560:  20 20 20 20 20 20 20 20 20 20 20 20 2D 31 32 38                -128
015570:  3A 20 20 20 20 20 54 68 69 73 20 76 61 6C 75 65    :     This value
015580:  20 69 73 20 69 6C 6C 65 67 61 6C 2E 0D 0A 0D 0A     is illegal.....
015590:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0155A0:  2D 31 32 37 2E 2E 30 3A 20 20 54 68 65 20 63 6F    -127..0:  The co
0155B0:  75 6E 74 20 69 73 20 6E 6F 74 20 20 63 68 61 6E    unt is not  chan
0155C0:  67 65 64 20 20 2D 20 20 74 68 65 20 20 65 76 65    ged  -  the  eve
0155D0:  6E 74 20 20 68 61 73 20 20 62 65 65 6E 0D 0A 20    nt  has  been.. 
0155E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0155F0:  20 20 20 20 20 20 20 20 20 64 69 73 61 72 6D 65             disarme
015600:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    d.....          
015610:  20 20 20 20 20 20 31 3A 20 20 20 20 20 20 20 20          1:        
015620:  54 68 65 20 63 6F 75 6E 74 20 69 73 20 64 65 63    The count is dec
015630:  72 65 6D 65 6E 74 65 64 20 61 6E 64 20 74 68 65    remented and the
015640:  20 20 65 76 65 6E 74 20 20 70 72 6F 63 65 73 73      event  process
015650:  69 6E 67 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ing..           
015660:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69                   i
015670:  73 20 74 65 72 6D 69 6E 61 74 65 64 2E 0D 0A 0D    s terminated....
015680:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
015690:  20 32 2E 2E 31 32 37 3A 20 20 20 54 68 65 20 63     2..127:   The c
0156A0:  6F 75 6E 74 20 69 73 20 64 65 63 72 65 6D 65 6E    ount is decremen
0156B0:  74 65 64 20 61 6E 64 20 74 68 65 20 20 65 76 65    ted and the  eve
0156C0:  6E 74 20 20 70 72 6F 63 65 73 73 69 6E 67 0D 0A    nt  processing..
0156D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0156E0:  20 20 20 20 20 20 20 20 20 20 69 73 20 63 6F 6E              is con
0156F0:  74 69 6E 75 65 64 2E 0D 0A 0D 0A 20 20 20 20 20    tinued.....     
015700:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
015710:  12 00 00 00 02 09 50 E5 12 00 C1 02 00 00 00 02    ......P.........
015720:  12 00 C2 02 00 00 00 02 12 00 C3 02 00 00 00 02    ................
015730:  12 00 C4 02 00 00 00 02 12 00 C5 02 00 00 00 02    ................
015740:  12 00 C6 02 00 00 00 02 12 00 C7 02 00 00 00 02    ................
015750:  12 00 C8 02 00 00 00 02 12 00 C9 02 00 00 00 02    ................
015760:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
015770:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
015780:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
015790:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0157F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
015800:  20 20 4E 6F 74 65 20 74 68 61 74 20 74 68 65 20      Note that the 
015810:  65 76 65 6E 74 20 72 6F 75 74 69 6E 65 20 6D 61    event routine ma
015820:  79 20 64 69 73 61 72 6D 20 69 74 73 65 6C 66 20    y disarm itself 
015830:  20 62 79 20 20 73 65 74 74 69 6E 67 20 20 74 68     by  setting  th
015840:  65 20 20 63 6F 75 6E 74 0D 0A 20 20 20 20 20 20    e  count..      
015850:  20 6E 65 67 61 74 69 76 65 20 28 62 79 20 63 6F     negative (by co
015860:  6E 76 65 6E 74 69 6F 6E 20 74 6F 20 2D 36 34 29    nvention to -64)
015870:  20 61 6E 64 20 20 63 61 6E 20 20 64 69 73 63 61     and  can  disca
015880:  72 64 20 20 75 6E 77 61 6E 74 65 64 20 20 6B 69    rd  unwanted  ki
015890:  63 6B 73 20 20 62 79 0D 0A 20 20 20 20 20 20 20    cks  by..       
0158A0:  73 65 74 74 69 6E 67 20 69 74 73 20 63 6F 75 6E    setting its coun
0158B0:  74 20 74 6F 20 6F 6E 65 2E 0D 0A 0D 0A 20 20 20    t to one.....   
0158C0:  20 20 20 20 31 32 2E 33 20 45 76 65 6E 74 20 52        12.3 Event R
0158D0:  6F 75 74 69 6E 65 2E 0D 0A 0D 0A 20 20 20 20 20    outine.....     
0158E0:  20 20 49 6E 20 67 65 6E 65 72 61 6C 20 74 68 65      In general the
0158F0:  20 61 64 64 72 65 73 73 20 6F 66 20 74 68 65 20     address of the 
015900:  65 76 65 6E 74 20 72 6F 75 74 69 6E 65 20 69 73    event routine is
015910:  20 67 69 76 65 6E 20 61 73 20 61 20 33 20 62 79     given as a 3 by
015920:  74 65 20 20 27 66 61 72 0D 0A 20 20 20 20 20 20    te  'far..      
015930:  20 61 64 64 72 65 73 73 27 20 28 73 65 65 20 73     address' (see s
015940:  65 63 74 69 6F 6E 20 32 20 6F 6E 20 74 68 65 20    ection 2 on the 
015950:  6D 65 6D 6F 72 79 20 6C 61 79 6F 75 74 29 2E 20    memory layout). 
015960:  54 68 69 73 20 61 6C 6C 6F 77 73 20 74 68 65 20    This allows the 
015970:  72 6F 75 74 69 6E 65 0D 0A 20 20 20 20 20 20 20    routine..       
015980:  74 6F 20 62 65 20 6C 6F 63 61 74 65 64 20 69 6E    to be located in
015990:  20 61 6E 79 20 52 4F 4D 20 6F 72 20 61 6E 79 77     any ROM or anyw
0159A0:  68 65 72 65 20 69 6E 20 52 41 4D 2E 0D 0A 0D 0A    here in RAM.....
0159B0:  20 20 20 20 20 20 20 41 20 73 70 65 63 69 61 6C           A special
0159C0:  20 66 6F 72 6D 20 6F 66 20 74 68 65 20 61 64 64     form of the add
0159D0:  72 65 73 73 20 63 6C 61 73 73 20 6D 61 79 20 73    ress class may s
0159E0:  70 65 63 69 66 79 20 74 68 65 20 72 6F 75 74 69    pecify the routi
0159F0:  6E 65 20 20 61 73 20 20 61 74 20 20 61 0D 0A 20    ne  as  at  a.. 
015A00:  20 20 20 20 20 20 27 6E 65 61 72 20 61 64 64 72          'near addr
015A10:  65 73 73 27 2E 20 54 68 69 73 20 64 6F 65 73 20    ess'. This does 
015A20:  6E 6F 74 20 63 68 61 6E 67 65 20 74 68 65 20 52    not change the R
015A30:  4F 4D 20 73 74 61 74 65 20 61 6E 64 20 73 6F 20    OM state and so 
015A40:  74 68 65 20 20 72 6F 75 74 69 6E 65 0D 0A 20 20    the  routine..  
015A50:  20 20 20 20 20 6D 75 73 74 20 62 65 20 6C 6F 63         must be loc
015A60:  61 74 65 64 20 65 69 74 68 65 72 20 69 6E 20 74    ated either in t
015A70:  68 65 20 6C 6F 77 65 72 20 52 4F 4D 20 6F 72 20    he lower ROM or 
015A80:  69 6E 20 74 68 65 20 63 65 6E 74 72 61 6C 20 33    in the central 3
015A90:  32 4B 20 6F 66 20 20 52 41 4D 2E 0D 0A 20 20 20    2K of  RAM...   
015AA0:  20 20 20 20 54 68 65 20 52 4F 4D 20 73 65 6C 65        The ROM sele
015AB0:  63 74 20 62 79 74 65 20 6F 66 20 74 68 65 20 27    ct byte of the '
015AC0:  66 61 72 20 61 64 64 72 65 73 73 27 20 69 73 20    far address' is 
015AD0:  69 67 6E 6F 72 65 64 20 61 6E 64 20 74 68 65 20    ignored and the 
015AE0:  6F 74 68 65 72 20 20 74 77 6F 0D 0A 20 20 20 20    other  two..    
015AF0:  20 20 20 62 79 74 65 73 20 74 61 6B 65 6E 20 61       bytes taken a
015B00:  73 20 74 68 65 20 61 64 64 72 65 73 73 20 6F 66    s the address of
015B10:  20 74 68 65 20 72 6F 75 74 69 6E 65 2E 20 43 61     the routine. Ca
015B20:  6C 6C 69 6E 67 20 20 61 20 20 27 6E 65 61 72 20    lling  a  'near 
015B30:  20 61 64 64 72 65 73 73 27 0D 0A 20 20 20 20 20     address'..     
015B40:  20 20 65 76 65 6E 74 20 72 6F 75 74 69 6E 65 20      event routine 
015B50:  72 65 71 75 69 72 65 73 20 61 20 6C 69 74 74 6C    requires a littl
015B60:  65 20 6C 65 73 73 20 77 6F 72 6B 20 74 68 61 6E    e less work than
015B70:  20 20 63 61 6C 6C 69 6E 67 20 20 61 20 20 66 75      calling  a  fu
015B80:  6C 6C 20 20 27 66 61 72 0D 0A 20 20 20 20 20 20    ll  'far..      
015B90:  20 61 64 64 72 65 73 73 27 2C 20 61 6E 64 20 69     address', and i
015BA0:  73 20 75 73 65 64 20 62 79 20 74 68 65 20 66 69    s used by the fi
015BB0:  72 6D 77 61 72 65 20 69 74 73 65 6C 66 2E 0D 0A    rmware itself...
015BC0:  0D 0A 20 20 20 20 20 20 20 31 32 2E 34 20 44 69    ..       12.4 Di
015BD0:  73 61 72 6D 69 6E 67 20 61 6E 64 20 52 65 69 6E    sarming and Rein
015BE0:  69 74 69 61 6C 69 7A 69 6E 67 20 45 76 65 6E 74    itializing Event
015BF0:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 42 65 66    s.....       Bef
015C00:  6F 72 65 20 61 6E 20 65 76 65 6E 74 20 62 6C 6F    ore an event blo
015C10:  63 6B 20 6D 61 79 20 62 65 20 72 65 69 6E 69 74    ck may be reinit
015C20:  69 61 6C 69 7A 65 64 20 74 68 65 20 65 76 65 6E    ialized the even
015C30:  74 20 6D 75 73 74 20 62 65 20 64 69 73 61 72 6D    t must be disarm
015C40:  65 64 2E 0D 0A 20 20 20 20 20 20 20 54 68 69 73    ed...       This
015C50:  20 65 6E 73 75 72 65 73 20 74 68 61 74 20 74 68     ensures that th
015C60:  65 20 65 76 65 6E 74 20 69 73 20 72 65 6D 6F 76    e event is remov
015C70:  65 64 20 66 72 6F 6D 20 74 68 65 20 76 61 72 69    ed from the vari
015C80:  6F 75 73 20 65 76 65 6E 74 20 20 70 65 6E 64 69    ous event  pendi
015C90:  6E 67 0D 0A 20 20 20 20 20 20 20 71 75 65 75 65    ng..       queue
015CA0:  73 20 61 6E 64 20 70 72 65 76 65 6E 74 73 20 74    s and prevents t
015CB0:  68 65 20 65 76 65 6E 74 20 71 75 65 75 65 73 20    he event queues 
015CC0:  62 65 69 6E 67 20 63 6F 72 72 75 70 74 65 64 20    being corrupted 
015CD0:  20 77 68 65 6E 20 20 74 68 65 20 20 65 76 65 6E     when  the  even
015CE0:  74 0D 0A 20 20 20 20 20 20 20 62 6C 6F 63 6B 20    t..       block 
015CF0:  69 73 20 69 6E 69 74 69 61 6C 69 7A 65 64 2E 20    is initialized. 
015D00:  41 6E 20 61 73 79 6E 63 68 72 6F 6E 6F 75 73 20    An asynchronous 
015D10:  65 76 65 6E 74 20 6D 75 73 74 20 6E 6F 74 20 62    event must not b
015D20:  65 20 20 72 65 69 6E 69 74 69 61 6C 69 7A 65 64    e  reinitialized
015D30:  0D 0A 20 20 20 20 20 20 20 66 72 6F 6D 20 69 6E    ..       from in
015D40:  73 69 64 65 20 69 74 73 20 61 73 79 6E 63 68 72    side its asynchr
015D50:  6F 6E 6F 75 73 20 20 65 76 65 6E 74 20 20 72 6F    onous  event  ro
015D60:  75 74 69 6E 65 20 20 28 62 65 63 61 75 73 65 20    utine  (because 
015D70:  20 69 6E 20 20 74 68 69 73 20 20 63 61 73 65 0D     in  this  case.
015D80:  0A 20 20 20 20 20 20 20 64 69 73 61 72 6D 69 6E    .       disarmin
015D90:  67 20 74 68 65 20 65 76 65 6E 74 20 64 6F 65 73    g the event does
015DA0:  20 6E 6F 74 20 72 65 6D 6F 76 65 20 74 68 65 20     not remove the 
015DB0:  65 76 65 6E 74 20 66 72 6F 6D 20 74 68 65 20 69    event from the i
015DC0:  6E 74 65 72 72 75 70 74 20 65 76 65 6E 74 0D 0A    nterrupt event..
015DD0:  20 20 20 20 20 20 20 70 65 6E 64 69 6E 67 20 71           pending q
015DE0:  75 65 75 65 29 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ueue)...........
015DF0:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
015E00:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
015E10:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
015E20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
015E30:  20 20 20 20 70 61 67 65 20 31 32 2E 33 0D 0A 0D        page 12.3...
015E40:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
015E50:  20 20 53 79 6E 63 68 72 6F 6E 6F 75 73 20 61 6E      Synchronous an
015E60:  64 20 61 73 79 6E 63 68 72 6F 6E 6F 75 73 20 65    d asynchronous e
015E70:  76 65 6E 74 73 20 61 72 65 20 64 69 73 61 72 6D    vents are disarm
015E80:  65 64 20 69 6E 20 64 69 66 66 65 72 65 6E 74 20    ed in different 
015E90:  6D 61 6E 6E 65 72 73 2E 0D 0A 0D 0A 0D 0A 20 20    manners.......  
015EA0:  20 20 20 20 20 20 20 20 20 61 2E 20 41 73 79 6E             a. Asyn
015EB0:  63 68 72 6F 6E 6F 75 73 20 45 76 65 6E 74 73 2E    chronous Events.
015EC0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ......          
015ED0:  20 41 6E 20 61 73 79 6E 63 68 72 6F 6E 6F 75 73     An asynchronous
015EE0:  20 65 76 65 6E 74 20 73 68 6F 75 6C 64 20 62 65     event should be
015EF0:  20 20 64 69 73 61 72 6D 65 64 20 20 62 79 20 20      disarmed  by  
015F00:  63 61 6C 6C 69 6E 67 20 20 4B 4C 20 20 44 49 53    calling  KL  DIS
015F10:  41 52 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ARM..           
015F20:  45 56 45 4E 54 2E 20 54 68 69 73 20 73 65 74 73    EVENT. This sets
015F30:  20 74 68 65 20 65 76 65 6E 74 20 63 6F 75 6E 74     the event count
015F40:  20 74 6F 20 61 20 6E 65 67 61 74 69 76 65 20 76     to a negative v
015F50:  61 6C 75 65 20 28 2D 36 34 29 61 6E 64 20 74 68    alue (-64)and th
015F60:  75 73 0D 0A 20 20 20 20 20 20 20 20 20 20 20 70    us..           p
015F70:  72 65 76 65 6E 74 73 20 6B 69 63 6B 73 20 68 61    revents kicks ha
015F80:  76 69 6E 67 20 61 6E 79 20 65 66 66 65 63 74 2E    ving any effect.
015F90:  20 49 66 20 74 68 65 20 65 76 65 6E 74 20 69 73     If the event is
015FA0:  20 6F 6E 20 74 68 65 20 69 6E 74 65 72 72 75 70     on the interrup
015FB0:  74 0D 0A 20 20 20 20 20 20 20 20 20 20 20 65 76    t..           ev
015FC0:  65 6E 74 20 70 65 6E 64 69 6E 67 20 71 75 65 75    ent pending queu
015FD0:  65 20 74 68 65 6E 20 69 74 20 77 69 6C 6C 20 62    e then it will b
015FE0:  65 20 64 69 73 63 61 72 64 65 64 20 6F 6E 6C 79    e discarded only
015FF0:  20 77 68 65 6E 20 61 6E 20 61 74 74 65 6D 70 74     when an attempt
016000:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 69 73 20    ..           is 
016010:  6D 61 64 65 20 74 6F 20 70 72 6F 63 65 73 73 20    made to process 
016020:  74 68 65 20 65 76 65 6E 74 20 61 6E 64 20 6E 6F    the event and no
016030:  74 20 69 6D 6D 65 64 69 61 74 65 6C 79 20 74 68    t immediately th
016040:  61 74 20 74 68 65 20 65 76 65 6E 74 20 69 73 0D    at the event is.
016050:  0A 20 20 20 20 20 20 20 20 20 20 20 64 69 73 61    .           disa
016060:  72 6D 65 64 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    rmed.........   
016070:  20 20 20 20 20 20 20 20 62 2E 20 53 79 6E 63 68            b. Synch
016080:  72 6F 6E 6F 75 73 20 45 76 65 6E 74 73 2E 0D 0A    ronous Events...
016090:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 41    ....           A
0160A0:  20 20 73 79 6E 63 68 72 6F 6E 6F 75 73 20 20 65      synchronous  e
0160B0:  76 65 6E 74 20 20 73 68 6F 75 6C 64 20 20 62 65    vent  should  be
0160C0:  20 20 64 69 73 61 72 6D 65 64 20 20 62 79 20 20      disarmed  by  
0160D0:  63 61 6C 6C 69 6E 67 20 20 4B 4C 20 20 20 44 45    calling  KL   DE
0160E0:  4C 0D 0A 20 20 20 20 20 20 20 20 20 20 20 53 59    L..           SY
0160F0:  4E 43 48 52 4F 4E 4F 55 53 2E 20 54 68 69 73 20    NCHRONOUS. This 
016100:  73 65 74 73 20 74 68 65 20 65 76 65 6E 74 20 63    sets the event c
016110:  6F 75 6E 74 20 74 6F 20 61 20 6E 65 67 61 74 69    ount to a negati
016120:  76 65 20 20 76 61 6C 75 65 20 20 28 2D 36 34 29    ve  value  (-64)
016130:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 61 6E 64    ..           and
016140:  20 72 65 6D 6F 76 65 73 20 74 68 65 20 65 76 65     removes the eve
016150:  6E 74 20 62 6C 6F 63 6B 20 66 72 6F 6D 20 20 74    nt block from  t
016160:  68 65 20 20 73 79 6E 63 68 72 6F 6E 6F 75 73 20    he  synchronous 
016170:  20 65 76 65 6E 74 20 20 70 65 6E 64 69 6E 67 0D     event  pending.
016180:  0A 20 20 20 20 20 20 20 20 20 20 20 71 75 65 75    .           queu
016190:  65 20 28 69 66 20 69 74 20 69 73 20 6F 6E 20 74    e (if it is on t
0161A0:  68 65 20 71 75 65 75 65 29 2E 0D 0A 0D 0A 0D 0A    he queue).......
0161B0:  20 20 20 20 20 20 20 54 68 65 20 61 62 6F 76 65           The above
0161C0:  20 70 72 6F 63 65 64 75 72 65 73 20 70 72 65 76     procedures prev
0161D0:  65 6E 74 20 74 68 65 20 65 76 65 6E 74 20 62 65    ent the event be
0161E0:  69 6E 67 20 73 75 63 63 65 73 73 66 75 6C 6C 79    ing successfully
0161F0:  20 6B 69 63 6B 65 64 2C 20 74 68 65 79 0D 0A 20     kicked, they.. 
016200:  20 20 20 20 20 20 64 6F 20 6E 6F 74 20 70 72 65          do not pre
016210:  76 65 6E 74 20 61 74 74 65 6D 70 74 73 20 62 65    vent attempts be
016220:  69 6E 67 20 6D 61 64 65 20 74 6F 20 6B 69 63 6B    ing made to kick
016230:  20 74 68 65 20 65 76 65 6E 74 2E 20 41 20 20 66     the event. A  f
016240:  61 73 74 20 20 74 69 63 6B 65 72 2C 0D 0A 20 20    ast  ticker,..  
016250:  20 20 20 20 20 66 72 61 6D 65 20 66 6C 79 62 61         frame flyba
016260:  63 6B 20 6F 72 20 74 69 63 6B 65 72 20 65 76 65    ck or ticker eve
016270:  6E 74 20 28 73 65 65 20 73 65 63 74 69 6F 6E 20    nt (see section 
016280:  31 31 2E 35 29 20 77 69 6C 6C 20 73 74 69 6C 6C    11.5) will still
016290:  20 62 65 20 6F 6E 20 20 69 74 73 0D 0A 20 20 20     be on  its..   
0162A0:  20 20 20 20 61 70 70 72 6F 70 72 69 61 74 65 20        appropriate 
0162B0:  71 75 65 75 65 20 61 6E 64 20 77 69 6C 6C 20 73    queue and will s
0162C0:  74 69 6C 6C 20 62 65 20 72 65 63 65 69 76 69 6E    till be receivin
0162D0:  67 20 72 65 67 75 6C 61 72 20 61 74 74 65 6D 70    g regular attemp
0162E0:  74 73 20 74 6F 20 6B 69 63 6B 0D 0A 20 20 20 20    ts to kick..    
0162F0:  20 20 20 69 74 2E 20 54 6F 20 70 72 65 76 65 6E       it. To preven
016300:  74 20 74 69 6D 65 20 62 65 69 6E 67 20 77 61 73    t time being was
016310:  74 65 64 20 28 61 6E 64 20 74 68 65 20 20 73 79    ted (and the  sy
016320:  73 74 65 6D 20 20 66 72 6F 6D 20 20 62 65 69 6E    stem  from  bein
016330:  67 20 20 73 6C 6F 77 65 64 0D 0A 20 20 20 20 20    g  slowed..     
016340:  20 20 64 6F 77 6E 20 62 65 63 61 75 73 65 20 6F      down because o
016350:  66 20 69 74 29 20 74 68 65 20 65 76 65 6E 74 20    f it) the event 
016360:  73 68 6F 75 6C 64 20 62 65 20 20 72 65 6D 6F 76    should be  remov
016370:  65 64 20 20 66 72 6F 6D 20 20 74 68 65 20 20 69    ed  from  the  i
016380:  6E 74 65 72 72 75 70 74 0D 0A 20 20 20 20 20 20    nterrupt..      
016390:  20 71 75 65 75 65 20 62 79 20 63 61 6C 6C 69 6E     queue by callin
0163A0:  67 20 4B 4C 20 44 45 4C 20 46 41 53 54 20 54 49    g KL DEL FAST TI
0163B0:  43 4B 45 52 2C 20 20 4B 4C 20 20 44 45 4C 20 20    CKER,  KL  DEL  
0163C0:  46 52 41 4D 45 20 20 46 4C 59 20 20 6F 72 20 20    FRAME  FLY  or  
0163D0:  4B 4C 20 20 44 45 4C 0D 0A 20 20 20 20 20 20 20    KL  DEL..       
0163E0:  54 49 43 4B 45 52 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D    TICKER..........
0163F0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
016400:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
016410:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    ............... 
016420:  20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50          AMSTRAD CP
016430:  43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49    C464/664/6128 FI
016440:  52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20    RMWARE          
016450:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
016460:  20 20 20 70 61 67 65 20 31 32 2E 34 0D 0A 1A 20       page 12.4... 
016470:  20 68 61 6E 64 6C 69 6E 67 20 20 6F 66 20 20 69     handling  of  i
016480:  31 31 2E 35 29 20 77 69 6C 6C 20 73 74 69 6C 6C    11.5) will still
016490:  20 62 65 20 6F 6E 20 20 69 74 73 0D 0A 20 20 20     be on  its..   
0164A0:  20 20 20 20 61 70 70 72 6F 70 72 69 61 74 65 20        appropriate 
0164B0:  71 75 65 75 65 20 61 6E 64 20 77 69 6C 6C 20 73    queue and will s
0164C0:  74 69 6C 6C 20 62 65 20 72 65 63 65 69 76 69 6E    till be receivin
0164D0:  67 20 72 65 67 75 6C 61 72 20 61 74 74 65 6D 70    g regular attemp
0164E0:  74 73 20 74 6F 20 6B 69 63 6B 0D 0A 20 20 20 20    ts to kick..    
0164F0:  20 20 20 69 74 2E 20 54 6F 20 70 72 65 76 65 6E       it. To preven
016500:  74 20 74 69 6D 65 20 62 65 69 6E 67 20 77 61 73    t time being was
016510:  74 65 64 20 28 61 6E 64 20 74 68 65 20 20 73 79    ted (and the  sy
016520:  73 74 65 6D 20 20 66 72 6F 6D 20 20 62 65 69 6E    stem  from  bein
016530:  67 20 20 73 6C 6F 77 65 64 0D 0A 20 20 20 20 20    g  slowed..     
016540:  20 20 64 6F 77 6E 20 62 65 63 61 75 73 65 20 6F      down because o
016550:  66 20 69 74 29 20 74 68 65 20 65 76 65 6E 74 20    f it) the event 
016560:  73 68 6F 75 6C 64 20 62 65 20 20 72 65 6D 6F 76    should be  remov
016570:  65 64 20 20 66 72 6F 6D 20 20 74 68 65 20 20 69    ed  from  the  i
016580:  6E 74 65 72 72 75 70 74 0D 0A 20 20 20 20 20 20    nterrupt..      
016590:  20 71 75 65 75 65 20 62 79 20 63 61 6C 6C 69 6E     queue by callin
0165A0:  67 20 4B 4C 20 44 45 4C 20 46 41 53 54 20 54 49    g KL DEL FAST TI
0165B0:  43 4B 45 52 2C 20 20 4B 4C 20 20 44 45 4C 20 20    CKER,  KL  DEL  
0165C0:  46 52 41 4D 45 20 20 46 4C 59 20 20 6F 72 20 20    FRAME  FLY  or  
0165D0:  4B 4C 20 20 44 45 4C 0D 0A 20 20 20 20 20 20 20    KL  DEL..       
0165E0:  54 49 43 4B 45 52 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D    TICKER..........
0165F0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
016600:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016610:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016620:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016630:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016640:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016650:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016660:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016670:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016680:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016690:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0166F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016700:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016710:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016720:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016730:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016740:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016750:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016760:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016770:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016780:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016790:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
0167F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
016800:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
016810:  33 20 54 68 65 20 4D 61 63 68 69 6E 65 20 50 61    3 The Machine Pa
016820:  63 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    ck.....       Th
016830:  65 20 4D 61 63 68 69 6E 65 20 50 61 63 6B 20 64    e Machine Pack d
016840:  65 61 6C 73 20 77 69 74 68 20 74 68 65 20 6C 6F    eals with the lo
016850:  77 20 6C 65 76 65 6C 20 64 72 69 76 69 6E 67 20    w level driving 
016860:  6F 66 20 74 68 65 20 68 61 72 64 77 61 72 65 2E    of the hardware.
016870:  20 20 49 74 0D 0A 20 20 20 20 20 20 20 61 6C 73      It..       als
016880:  6F 20 74 61 6C 6B 73 20 74 6F 20 74 68 65 20 43    o talks to the C
016890:  65 6E 74 72 6F 6E 69 63 73 20 70 6F 72 74 20 28    entronics port (
0168A0:  61 6E 64 20 68 65 6E 63 65 20 74 68 65 20 70 72    and hence the pr
0168B0:  69 6E 74 65 72 29 20 20 61 6E 64 20 20 69 73 20    inter)  and  is 
0168C0:  20 69 6E 0D 0A 20 20 20 20 20 20 20 63 68 61 72     in..       char
0168D0:  67 65 20 6F 66 20 72 75 6E 6E 69 6E 67 20 27 6C    ge of running 'l
0168E0:  6F 61 64 20 61 6E 64 20 67 6F 27 20 70 72 6F 67    oad and go' prog
0168F0:  72 61 6D 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    rams.....       
016900:  31 33 2E 31 20 48 61 72 64 77 61 72 65 20 49 6E    13.1 Hardware In
016910:  74 65 72 66 61 63 65 73 2E 0D 0A 0D 0A 20 20 20    terfaces.....   
016920:  20 20 20 20 54 68 65 20 72 6F 75 74 69 6E 65 73        The routines
016930:  20 70 72 6F 76 69 64 65 64 20 66 6F 72 20 64 72     provided for dr
016940:  69 76 69 6E 67 20 74 68 65 20 68 61 72 64 77 61    iving the hardwa
016950:  72 65 20 61 72 65 20 6F 6E 6C 79 20 74 6F 20 62    re are only to b
016960:  65 20 75 73 65 64 20 20 62 79 0D 0A 20 20 20 20    e used  by..    
016970:  20 20 20 74 68 6F 73 65 20 77 68 6F 20 75 6E 64       those who und
016980:  65 72 73 74 61 6E 64 20 74 68 65 20 68 61 72 64    erstand the hard
016990:  77 61 72 65 20 61 6E 64 20 20 68 6F 77 20 20 74    ware and  how  t
0169A0:  68 65 20 20 66 69 72 6D 77 61 72 65 20 20 64 72    he  firmware  dr
0169B0:  69 76 65 73 20 20 74 68 65 0D 0A 20 20 20 20 20    ives  the..     
0169C0:  20 20 68 61 72 64 77 61 72 65 2E 20 54 68 65 20      hardware. The 
0169D0:  75 73 65 72 20 73 68 6F 75 6C 64 20 6E 6F 74 20    user should not 
0169E0:  61 63 63 65 73 73 20 20 74 68 65 20 20 68 61 72    access  the  har
0169F0:  64 77 61 72 65 20 20 64 69 72 65 63 74 6C 79 20    dware  directly 
016A00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
016A10:  13 00 00 00 02 09 50 E5 13 00 C1 02 00 00 00 02    ......P.........
016A20:  13 00 C2 02 00 00 00 02 13 00 C3 02 00 00 00 02    ................
016A30:  13 00 C4 02 00 00 00 02 13 00 C5 02 00 00 00 02    ................
016A40:  13 00 C6 02 00 00 00 02 13 00 C7 02 00 00 00 02    ................
016A50:  13 00 C8 02 00 00 00 02 13 00 C9 02 00 00 00 02    ................
016A60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016A70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016A80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016A90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016AF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
016B00:  20 77 68 65 6E 20 20 61 0D 0A 20 20 20 20 20 20     when  a..      
016B10:  20 4D 61 63 68 69 6E 65 20 50 61 63 6B 20 72 6F     Machine Pack ro
016B20:  75 74 69 6E 65 20 69 73 20 70 72 6F 76 69 64 65    utine is provide
016B30:  64 20 66 6F 72 20 74 68 69 73 20 70 75 72 70 6F    d for this purpo
016B40:  73 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4F 66    se.....       Of
016B50:  74 65 6E 20 74 68 65 72 65 20 61 72 65 20 68 69    ten there are hi
016B60:  67 68 65 72 20 6C 65 76 65 6C 20 72 6F 75 74 69    gher level routi
016B70:  6E 65 73 20 74 68 61 74 20 61 63 63 6F 6D 70 6C    nes that accompl
016B80:  69 73 68 20 74 68 65 20 73 61 6D 65 20 65 66 66    ish the same eff
016B90:  65 63 74 73 0D 0A 20 20 20 20 20 20 20 62 75 74    ects..       but
016BA0:  20 61 6C 73 6F 20 6B 65 65 70 20 74 68 65 20 66     also keep the f
016BB0:  69 72 6D 77 61 72 65 20 69 6E 66 6F 72 6D 65 64    irmware informed
016BC0:  20 6F 66 20 20 74 68 65 20 20 63 75 72 72 65 6E     of  the  curren
016BD0:  74 20 20 73 65 74 74 69 6E 67 73 2E 20 20 57 68    t  settings.  Wh
016BE0:  65 72 65 0D 0A 20 20 20 20 20 20 20 70 6F 73 73    ere..       poss
016BF0:  69 62 6C 65 20 74 68 65 73 65 20 68 69 67 68 65    ible these highe
016C00:  72 20 6C 65 76 65 6C 20 72 6F 75 74 69 6E 65 73    r level routines
016C10:  20 73 68 6F 75 6C 64 20 62 65 20 75 73 65 64 20     should be used 
016C20:  20 61 6E 64 20 20 74 68 65 20 20 4D 61 63 68 69     and  the  Machi
016C30:  6E 65 0D 0A 20 20 20 20 20 20 20 50 61 63 6B 20    ne..       Pack 
016C40:  72 6F 75 74 69 6E 65 20 61 76 6F 69 64 65 64 2E    routine avoided.
016C50:  20 55 73 69 6E 67 20 74 68 65 20 4D 61 63 68 69     Using the Machi
016C60:  6E 65 20 50 61 63 6B 20 72 6F 75 74 69 6E 65 73    ne Pack routines
016C70:  20 20 6D 61 79 20 20 63 61 75 73 65 20 20 74 68      may  cause  th
016C80:  65 0D 0A 20 20 20 20 20 20 20 66 69 72 6D 77 61    e..       firmwa
016C90:  72 65 20 74 6F 20 6D 61 6B 65 20 65 72 72 6F 6E    re to make erron
016CA0:  65 6F 75 73 20 61 73 73 75 6D 70 74 69 6F 6E 73    eous assumptions
016CB0:  20 61 62 6F 75 74 20 74 68 65 20 63 75 72 72 65     about the curre
016CC0:  6E 74 20 73 65 74 74 69 6E 67 73 20 20 61 6E 64    nt settings  and
016CD0:  0D 0A 20 20 20 20 20 20 20 6D 61 79 20 63 61 75    ..       may cau
016CE0:  73 65 20 69 74 20 74 6F 20 67 6F 20 77 72 6F 6E    se it to go wron
016CF0:  67 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    g.....       The
016D00:  20 4D 61 63 68 69 6E 65 20 50 61 63 6B 20 6D 61     Machine Pack ma
016D10:  6B 65 73 20 63 65 72 74 61 69 6E 20 61 73 73 75    kes certain assu
016D20:  6D 70 74 69 6F 6E 73 20 20 61 62 6F 75 74 20 20    mptions  about  
016D30:  74 68 65 20 20 73 74 61 74 65 20 20 6F 66 20 20    the  state  of  
016D40:  74 68 65 0D 0A 20 20 20 20 20 20 20 68 61 72 64    the..       hard
016D50:  77 61 72 65 20 77 68 65 6E 20 69 74 20 61 63 63    ware when it acc
016D60:  65 73 73 65 73 20 69 74 2E 20 49 6E 20 70 61 72    esses it. In par
016D70:  74 69 63 75 6C 61 72 2C 20 50 50 49 20 70 6F 72    ticular, PPI por
016D80:  74 20 41 20 69 73 20 61 73 73 75 6D 65 64 20 20    t A is assumed  
016D90:  74 6F 0D 0A 20 20 20 20 20 20 20 62 65 20 69 6E    to..       be in
016DA0:  20 6F 75 74 70 75 74 20 6D 6F 64 65 20 61 6E 64     output mode and
016DB0:  20 74 68 65 20 73 6F 75 6E 64 20 63 68 69 70 2C     the sound chip,
016DC0:  20 55 4C 41 20 43 52 54 43 20 61 6E 64 20 43 65     ULA CRTC and Ce
016DD0:  6E 74 72 6F 6E 69 63 73 20 70 6F 72 74 20 61 72    ntronics port ar
016DE0:  65 0D 0A 20 20 20 20 20 20 20 61 73 73 75 6D 65    e..       assume
016DF0:  64 20 74 6F 20 62 65 20 69 6E 61 63 74 69 76 65    d to be inactive
016E00:  3B 20 74 68 61 74 20 69 73 2C 20 6E 6F 74 20 68    ; that is, not h
016E10:  61 6C 66 77 61 79 20 74 68 72 6F 75 67 68 20 73    alfway through s
016E20:  65 74 74 69 6E 67 20 20 61 20 20 76 61 6C 75 65    etting  a  value
016E30:  0D 0A 20 20 20 20 20 20 20 69 6E 74 6F 20 61 20    ..       into a 
016E40:  63 68 69 70 20 72 65 67 69 73 74 65 72 2E 20 49    chip register. I
016E50:  74 20 20 69 73 20 20 75 73 75 61 6C 6C 79 20 20    t  is  usually  
016E60:  65 73 73 65 6E 74 69 61 6C 20 20 74 68 61 74 20    essential  that 
016E70:  20 69 6E 74 65 72 72 75 70 74 73 20 20 62 65 0D     interrupts  be.
016E80:  0A 20 20 20 20 20 20 20 64 69 73 61 62 6C 65 64    .       disabled
016E90:  20 77 68 65 6E 20 61 63 63 65 73 73 69 6E 67 20     when accessing 
016EA0:  74 68 65 20 68 61 72 64 77 61 72 65 20 64 69 72    the hardware dir
016EB0:  65 63 74 6C 79 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    ectly.......    
016EC0:  20 20 20 54 68 65 72 65 20 61 72 65 20 66 6F 75       There are fou
016ED0:  72 20 6D 61 69 6E 20 61 72 65 61 73 20 6F 66 20    r main areas of 
016EE0:  74 68 65 20 68 61 72 64 77 61 72 65 20 74 68 61    the hardware tha
016EF0:  74 20 74 68 65 20 4D 61 63 68 69 6E 65 20 50 61    t the Machine Pa
016F00:  63 6B 20 20 64 65 61 6C 73 0D 0A 20 20 20 20 20    ck  deals..     
016F10:  20 20 77 69 74 68 3A 0D 0A 0D 0A 0D 0A 20 20 20      with:......   
016F20:  20 20 20 20 61 2E 20 54 68 65 20 73 63 72 65 65        a. The scree
016F30:  6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    n.......        
016F40:  20 20 20 54 68 65 72 65 20 61 72 65 20 74 68 72       There are thr
016F50:  65 65 20 61 73 70 65 63 74 73 20 6F 66 20 74 68    ee aspects of th
016F60:  65 20 73 63 72 65 65 6E 20 20 64 69 73 70 6C 61    e screen  displa
016F70:  79 20 20 74 68 61 74 20 20 63 61 6E 20 20 62 65    y  that  can  be
016F80:  20 20 73 65 74 0D 0A 20 20 20 20 20 20 20 20 20      set..         
016F90:  20 20 75 73 69 6E 67 20 74 68 65 20 4D 61 63 68      using the Mach
016FA0:  69 6E 65 20 50 61 63 6B 2E 20 54 68 65 73 65 20    ine Pack. These 
016FB0:  61 72 65 20 74 68 65 20 73 63 72 65 65 6E 20 6D    are the screen m
016FC0:  6F 64 65 20 28 73 65 74 20 62 79 20 20 63 61 6C    ode (set by  cal
016FD0:  6C 69 6E 67 0D 0A 20 20 20 20 20 20 20 20 20 20    ling..          
016FE0:  20 4D 43 20 53 45 54 20 4D 4F 44 45 29 20 61 6E     MC SET MODE) an
016FF0:  64 20 74 68 65 20 73 63 72 65 65 6E 20 62 61 73    d the screen bas
017000:  65 20 61 6E 64 20 6F 66 66 73 65 74 20 28 73 65    e and offset (se
017010:  74 20 20 62 79 20 20 63 61 6C 6C 69 6E 67 20 20    t  by  calling  
017020:  28 4D 43 0D 0A 20 20 20 20 20 20 20 20 20 20 20    (MC..           
017030:  53 45 54 20 4F 46 46 53 45 54 29 2E 0D 0A 0D 0A    SET OFFSET).....
017040:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 54 68 65    ..           The
017050:  20 73 63 72 65 65 6E 20 6D 6F 64 65 20 73 65 74     screen mode set
017060:  73 20 68 6F 77 20 6D 61 6E 79 20 70 69 78 65 6C    s how many pixel
017070:  73 20 61 72 65 20 64 69 73 70 6C 61 79 65 64 20    s are displayed 
017080:  6F 6E 20 20 74 68 65 20 20 73 63 72 65 65 6E 0D    on  the  screen.
017090:  0A 20 20 20 20 20 20 20 20 20 20 20 61 6E 64 20    .           and 
0170A0:  68 6F 77 20 6D 61 6E 79 20 69 6E 6B 73 20 6D 61    how many inks ma
0170B0:  79 20 62 65 20 75 73 65 64 20 61 73 20 66 6F 6C    y be used as fol
0170C0:  6C 6F 77 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    lows:......     
0170D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0170E0:  20 20 20 20 20 4D 6F 64 65 20 20 20 20 20 20 52         Mode      R
0170F0:  65 73 6F 6C 75 74 69 6F 6E 20 20 20 20 20 20 20    esolution       
017100:  20 20 20 49 6E 6B 73 0D 0A 20 20 20 20 20 20 20       Inks..       
017110:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
017120:  20 20 20 30 20 20 20 20 20 20 20 20 20 31 36 30       0         160
017130:  20 78 20 32 30 30 20 20 20 20 20 20 20 20 20 20     x 200          
017140:  20 31 36 0D 0A 20 20 20 20 20 20 20 20 20 20 20     16..           
017150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 31                   1
017160:  20 20 20 20 20 20 20 20 20 33 32 30 20 78 20 32             320 x 2
017170:  30 30 20 20 20 20 20 20 20 20 20 20 20 34 0D 0A    00           4..
017180:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
017190:  20 20 20 20 20 20 20 20 20 20 32 20 20 20 20 20              2     
0171A0:  20 20 20 20 36 34 30 20 78 20 32 30 30 20 20 20        640 x 200   
0171B0:  20 20 20 20 20 20 20 20 32 0D 0A 0D 0A 0D 0A 20            2...... 
0171C0:  20 20 20 20 20 20 20 20 20 20 54 68 65 20 73 63              The sc
0171D0:  72 65 65 6E 20 62 61 73 65 20 73 65 74 73 20 77    reen base sets w
0171E0:  68 69 63 68 20 31 36 4B 20 62 6C 6F 63 6B 20 6F    hich 16K block o
0171F0:  66 20 6D 65 6D 6F 72 79 20 20 69 73 20 20 75 73    f memory  is  us
017200:  65 64 20 20 66 6F 72 20 20 74 68 65 0D 0A 20 20    ed  for  the..  
017210:  20 20 20 20 20 20 20 20 20 73 63 72 65 65 6E 20             screen 
017220:  6D 65 6D 6F 72 79 2E 20 54 68 65 6F 72 65 74 69    memory. Theoreti
017230:  63 61 6C 6C 79 2C 20 61 6E 79 20 6F 66 20 23 30    cally, any of #0
017240:  30 30 30 2C 20 23 34 30 30 30 2C 20 23 38 30 30    000, #4000, #800
017250:  30 20 6F 72 20 20 23 43 30 30 30 0D 0A 20 20 20    0 or  #C000..   
017260:  20 20 20 20 20 20 20 20 63 6F 75 6C 64 20 62 65            could be
017270:  20 75 73 65 64 20 62 75 74 2C 20 69 6E 20 70 72     used but, in pr
017280:  61 63 74 69 63 65 2C 20 20 6F 74 68 65 72 20 20    actice,  other  
017290:  63 6F 6E 73 69 64 65 72 61 74 69 6F 6E 73 20 20    considerations  
0172A0:  6D 65 61 6E 20 20 74 68 61 74 0D 0A 20 20 20 20    mean  that..    
0172B0:  20 20 20 20 20 20 20 6F 6E 6C 79 20 23 34 30 30           only #400
0172C0:  30 20 61 6E 64 20 23 43 30 30 30 20 6D 61 79 20    0 and #C000 may 
0172D0:  62 65 20 75 73 65 66 75 6C 2E 0D 0A 0D 0A 0D 0A    be useful.......
0172E0:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
0172F0:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
017300:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
017310:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
017320:  20 20 20 20 70 61 67 65 20 31 33 2E 31 0D 0A 0D        page 13.1...
017330:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
017340:  20 20 20 20 20 20 54 68 65 20 73 63 72 65 65 6E          The screen
017350:  20 6F 66 66 73 65 74 20 73 65 74 73 20 77 68 69     offset sets whi
017360:  63 68 20 62 79 74 65 20 69 6E 20 74 68 65 20 73    ch byte in the s
017370:  63 72 65 65 6E 20 6D 65 6D 6F 72 79 20 20 69 73    creen memory  is
017380:  20 20 74 6F 20 20 62 65 0D 0A 20 20 20 20 20 20      to  be..      
017390:  20 20 20 20 20 64 69 73 70 6C 61 79 65 64 20 66         displayed f
0173A0:  69 72 73 74 2E 20 43 68 61 6E 67 69 6E 67 20 74    irst. Changing t
0173B0:  68 65 20 73 63 72 65 65 6E 20 6F 66 66 73 65 74    he screen offset
0173C0:  20 77 69 6C 6C 20 6D 6F 76 65 20 74 68 65 20 63     will move the c
0173D0:  6F 6E 74 65 6E 74 73 0D 0A 20 20 20 20 20 20 20    ontents..       
0173E0:  20 20 20 20 6F 66 20 74 68 65 20 73 63 72 65 65        of the scree
0173F0:  6E 20 69 6E 20 6F 6E 65 20 67 6F 2E 20 54 68 69    n in one go. Thi
017400:  73 20 69 73 20 75 73 65 64 20 66 6F 72 20 72 6F    s is used for ro
017410:  6C 6C 69 6E 67 20 74 68 65 20 73 63 72 65 65 6E    lling the screen
017420:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
017430:  41 20 66 75 6C 6C 65 72 20 64 65 73 63 72 69 70    A fuller descrip
017440:  74 69 6F 6E 20 6F 66 20 74 68 65 20 73 63 72 65    tion of the scre
017450:  65 6E 20 6C 61 79 6F 75 74 20 61 6E 64 20 69 74    en layout and it
017460:  73 20 72 65 6C 61 74 69 6F 6E 73 68 69 70 20 20    s relationship  
017470:  74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20 20 74    to..           t
017480:  68 65 73 65 20 61 73 70 65 63 74 73 20 63 61 6E    hese aspects can
017490:  20 62 65 20 66 6F 75 6E 64 20 69 6E 20 73 65 63     be found in sec
0174A0:  74 69 6F 6E 20 36 20 6F 6E 20 74 68 65 20 53 63    tion 6 on the Sc
0174B0:  72 65 65 6E 20 50 61 63 6B 2E 0D 0A 0D 0A 20 20    reen Pack.....  
0174C0:  20 20 20 20 20 20 20 20 20 49 66 20 61 64 64 72             If addr
0174D0:  65 73 73 65 73 20 61 72 65 20 74 6F 20 62 65 20    esses are to be 
0174E0:  72 65 61 64 20 62 61 63 6B 20 66 72 6F 6D 20 20    read back from  
0174F0:  74 68 65 20 20 43 52 54 20 20 63 6F 6E 74 72 6F    the  CRT  contro
017500:  6C 6C 65 72 20 20 63 68 69 70 2C 0D 0A 20 20 20    ller  chip,..   
017510:  20 20 20 20 20 20 20 20 77 68 65 6E 20 75 73 69            when usi
017520:  6E 67 20 61 20 6C 69 67 68 74 20 70 65 6E 20 66    ng a light pen f
017530:  6F 72 20 69 6E 73 74 61 6E 63 65 2C 20 74 68 65    or instance, the
017540:  6E 20 20 63 61 72 65 66 75 6C 20 20 69 6E 73 70    n  careful  insp
017550:  65 63 74 69 6F 6E 20 20 6F 66 0D 0A 0D 0A 20 20    ection  of....  
017560:  20 20 20 20 20 20 20 20 20 74 68 65 20 77 61 79             the way
017570:  20 74 68 65 20 73 63 72 65 65 6E 20 6D 65 6D 6F     the screen memo
017580:  72 79 20 69 73 20 61 64 64 72 65 73 73 65 64 20    ry is addressed 
017590:  77 69 6C 6C 20 62 65 20 6E 65 65 64 65 64 20 74    will be needed t
0175A0:  6F 20 74 72 61 6E 73 6C 61 74 65 0D 0A 20 20 20    o translate..   
0175B0:  20 20 20 20 20 20 20 20 74 68 65 20 73 63 72 65            the scre
0175C0:  65 6E 20 61 64 64 72 65 73 73 20 72 65 61 64 20    en address read 
0175D0:  66 72 6F 6D 20 74 68 65 20 63 68 69 70 20 74 6F    from the chip to
0175E0:  20 74 68 65 20 20 61 63 74 75 61 6C 20 20 70 6F     the  actual  po
0175F0:  73 69 74 69 6F 6E 20 20 6F 6E 0D 0A 20 20 20 20    sition  on..    
017600:  20 20 20 20 20 20 20 74 68 65 20 73 63 72 65 65           the scree
017610:  6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    n.....          
017620:  20 54 68 65 20 4D 61 63 68 69 6E 65 20 50 61 63     The Machine Pac
017630:  6B 20 61 6C 73 6F 20 70 72 6F 76 69 64 65 73 20    k also provides 
017640:  61 20 72 6F 75 74 69 6E 65 20 28 4D 43 20 57 41    a routine (MC WA
017650:  49 54 20 46 4C 59 42 41 43 4B 29 20 74 6F 20 77    IT FLYBACK) to w
017660:  61 69 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ait..           
017670:  75 6E 74 69 6C 20 66 72 61 6D 65 20 66 6C 79 62    until frame flyb
017680:  61 63 6B 20 6F 63 63 75 72 73 20 28 74 68 65 20    ack occurs (the 
017690:  20 73 74 61 72 74 20 20 6F 66 20 20 74 68 65 20     start  of  the 
0176A0:  20 76 65 72 74 69 63 61 6C 20 20 72 65 74 72 61     vertical  retra
0176B0:  63 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 70    ce..           p
0176C0:  65 72 69 6F 64 29 2E 20 54 68 69 73 20 6D 61 79    eriod). This may
0176D0:  20 62 65 20 75 73 65 64 20 74 6F 20 65 6E 73 75     be used to ensu
0176E0:  72 65 20 74 68 61 74 20 6F 70 65 72 61 74 69 6F    re that operatio
0176F0:  6E 73 20 6F 6E 20 74 68 65 20 20 73 63 72 65 65    ns on the  scree
017700:  6E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 61 72    n..           ar
017710:  65 20 70 65 72 66 6F 72 6D 65 64 20 77 69 74 68    e performed with
017720:  20 61 73 20 6C 69 74 74 6C 65 20 64 69 73 72 75     as little disru
017730:  70 74 69 6F 6E 20 20 61 73 20 20 69 73 20 20 70    ption  as  is  p
017740:  6F 73 73 69 62 6C 65 20 20 74 6F 20 20 74 68 65    ossible  to  the
017750:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 70 69 63    ..           pic
017760:  74 75 72 65 20 6F 6E 20 74 68 65 20 6D 6F 6E 69    ture on the moni
017770:  74 6F 72 20 73 69 6E 63 65 20 6E 6F 20 70 69 63    tor since no pic
017780:  74 75 72 65 20 69 73 20 67 65 6E 65 72 61 74 65    ture is generate
017790:  64 20 20 64 75 72 69 6E 67 20 20 74 68 69 73 0D    d  during  this.
0177A0:  0A 20 20 20 20 20 20 20 20 20 20 20 70 65 72 69    .           peri
0177B0:  6F 64 2E 20 41 73 20 61 6E 20 61 6C 74 65 72 6E    od. As an altern
0177C0:  61 74 69 76 65 20 74 6F 20 77 61 69 74 69 6E 67    ative to waiting
0177D0:  20 66 6F 72 20 66 72 61 6D 65 20 66 6C 79 62 61     for frame flyba
0177E0:  63 6B 20 20 65 78 70 6C 69 63 69 74 6C 79 0D 0A    ck  explicitly..
0177F0:  20 20 20 20 20 20 20 20 20 20 20 74 68 65 20 75               the u
017800:  73 65 72 20 73 68 6F 75 6C 64 20 63 6F 6E 73 69    ser should consi
017810:  64 65 72 20 73 65 74 74 69 6E 67 20 20 75 70 20    der setting  up 
017820:  20 61 20 20 66 72 61 6D 65 20 20 66 6C 79 62 61     a  frame  flyba
017830:  63 6B 20 20 65 76 65 6E 74 20 20 61 73 0D 0A 20    ck  event  as.. 
017840:  20 20 20 20 20 20 20 20 20 20 64 65 73 63 72 69              descri
017850:  62 65 64 20 69 6E 20 73 65 63 74 69 6F 6E 20 31    bed in section 1
017860:  31 2E 35 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20    1.5.....        
017870:  20 20 20 54 68 65 20 20 76 65 72 74 69 63 61 6C       The  vertical
017880:  20 20 72 65 74 72 61 63 65 20 20 70 65 72 69 6F      retrace  perio
017890:  64 20 20 69 73 20 20 6E 6F 74 20 20 76 65 72 79    d  is  not  very
0178A0:  20 20 6C 6F 6E 67 2E 20 20 46 75 72 74 68 65 72      long.  Further
0178B0:  6D 6F 72 65 2C 0D 0A 20 20 20 20 20 20 20 20 20    more,..         
0178C0:  20 20 61 70 70 72 6F 78 69 6D 61 74 65 6C 79 20      approximately 
0178D0:  31 30 30 20 6D 69 63 72 6F 73 65 63 6F 6E 64 73    100 microseconds
0178E0:  20 66 72 6F 6D 20 69 74 73 20 73 74 61 72 74 2C     from its start,
0178F0:  20 20 61 20 20 74 69 6D 65 20 20 69 6E 74 65 72      a  time  inter
017900:  72 75 70 74 0D 0A 20 20 20 20 20 20 20 20 20 20    rupt..          
017910:  20 6F 63 63 75 72 73 20 74 68 61 74 20 77 69 6C     occurs that wil
017920:  6C 20 63 61 75 73 65 20 74 68 65 20 66 72 61 6D    l cause the fram
017930:  65 20 66 6C 79 62 61 63 6B 20 65 76 65 6E 74 73    e flyback events
017940:  20 20 74 6F 20 20 62 65 20 20 70 72 6F 63 65 73      to  be  proces
017950:  73 65 64 0D 0A 20 20 20 20 20 20 20 20 20 20 20    sed..           
017960:  28 73 65 65 20 73 65 63 74 69 6F 6E 20 31 31 29    (see section 11)
017970:  2E 20 54 68 65 73 65 20 6D 61 79 20 74 61 6B 65    . These may take
017980:  20 61 20 73 69 67 6E 69 66 69 63 61 6E 74 20 6C     a significant l
017990:  65 6E 67 74 68 20 6F 66 20 74 69 6D 65 20 20 6F    ength of time  o
0179A0:  75 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20 6F    ut..           o
0179B0:  66 20 74 68 65 20 72 65 74 72 61 63 65 20 70 65    f the retrace pe
0179C0:  72 69 6F 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    riod.....       
0179D0:  62 2E 20 54 68 65 20 69 6E 6B 73 2E 0D 0A 20 20    b. The inks...  
0179E0:  20 20 20 20 20 20 20 20 20 54 68 65 20 4D 61 63             The Mac
0179F0:  68 69 6E 65 20 50 61 63 6B 20 64 65 61 6C 73 20    hine Pack deals 
017A00:  77 69 74 68 20 73 65 74 74 69 6E 67 20 74 68 65    with setting the
017A10:  20 63 6F 6C 6F 75 72 73 20 6F 66 20 69 6E 6B 73     colours of inks
017A20:  2E 20 54 68 65 72 65 20 20 69 73 0D 0A 20 20 20    . There  is..   
017A30:  20 20 20 20 20 20 20 20 61 20 66 75 6C 6C 65 72            a fuller
017A40:  20 65 78 70 6C 61 6E 61 74 69 6F 6E 20 6F 66 20     explanation of 
017A50:  74 68 65 20 72 65 6C 61 74 69 6F 6E 73 68 69 70    the relationship
017A60:  20 62 65 74 77 65 65 6E 20 69 6E 6B 73 20 61 6E     between inks an
017A70:  64 20 20 63 6F 6C 6F 75 72 73 0D 0A 20 20 20 20    d  colours..    
017A80:  20 20 20 20 20 20 20 69 6E 20 73 65 63 74 69 6F           in sectio
017A90:  6E 20 36 2E 32 2E 20 42 72 69 65 66 6C 79 2C 20    n 6.2. Briefly, 
017AA0:  74 68 65 20 63 6F 6C 6F 75 72 20 66 6F 72 20 65    the colour for e
017AB0:  61 63 68 20 69 6E 6B 20 20 61 6E 64 20 20 74 68    ach ink  and  th
017AC0:  65 20 20 62 6F 72 64 65 72 0D 0A 20 20 20 20 20    e  border..     
017AD0:  20 20 20 20 20 20 63 61 6E 20 62 65 20 73 70 65          can be spe
017AE0:  63 69 66 69 65 64 20 69 6E 64 65 70 65 6E 64 65    cified independe
017AF0:  6E 74 6C 79 20 61 6E 64 20 63 68 61 6E 67 65 64    ntly and changed
017B00:  20 61 74 20 77 69 6C 6C 2E 20 4E 6F 74 65 2C 20     at will. Note, 
017B10:  68 6F 77 65 76 65 72 2C 0D 0A 20 20 20 20 20 20    however,..      
017B20:  20 20 20 20 20 74 68 61 74 20 74 68 65 20 4D 61         that the Ma
017B30:  63 68 69 6E 65 20 50 61 63 6B 20 64 65 61 6C 73    chine Pack deals
017B40:  20 77 69 74 68 20 74 68 65 20 68 61 72 64 77 61     with the hardwa
017B50:  72 65 20 20 72 65 70 72 65 73 65 6E 74 61 74 69    re  representati
017B60:  6F 6E 73 20 20 6F 66 0D 0A 20 20 20 20 20 20 20    ons  of..       
017B70:  20 20 20 20 63 6F 6C 6F 75 72 73 20 61 6E 64 20        colours and 
017B80:  6E 6F 74 20 74 68 65 20 67 72 65 79 20 73 63 61    not the grey sca
017B90:  6C 65 20 63 6F 6C 6F 75 72 73 20 74 68 61 74 20    le colours that 
017BA0:  74 68 65 20 53 63 72 65 65 6E 20 20 50 61 63 6B    the Screen  Pack
017BB0:  20 20 75 73 65 73 0D 0A 20 20 20 20 20 20 20 20      uses..        
017BC0:  20 20 20 61 6E 64 20 61 6C 73 6F 20 74 68 61 74       and also that
017BD0:  20 61 6E 20 69 6E 6B 20 6D 61 79 20 6F 6E 6C 79     an ink may only
017BE0:  20 62 65 20 73 65 74 20 74 6F 20 6F 6E 65 20 63     be set to one c
017BF0:  6F 6C 6F 75 72 2C 20 20 74 68 65 20 20 66 6C 61    olour,  the  fla
017C00:  73 68 69 6E 67 0D 0A 20 20 20 20 20 20 20 20 20    shing..         
017C10:  20 20 69 6E 6B 73 20 61 72 65 20 6D 61 64 65 20      inks are made 
017C20:  62 79 20 74 68 65 20 53 63 72 65 65 6E 20 50 61    by the Screen Pa
017C30:  63 6B 20 73 65 74 74 69 6E 67 20 74 77 6F 20 63    ck setting two c
017C40:  6F 6C 6F 75 72 73 20 61 6C 74 65 72 6E 61 74 65    olours alternate
017C50:  6C 79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ly.....         
017C60:  20 20 54 77 6F 20 72 6F 75 74 69 6E 65 73 20 61      Two routines a
017C70:  72 65 20 70 72 6F 76 69 64 65 64 20 66 6F 72 20    re provided for 
017C80:  73 65 74 74 69 6E 67 20 74 68 65 20 63 6F 6C 6F    setting the colo
017C90:  75 72 73 20 6F 66 20 69 6E 6B 73 2E 20 4D 43 20    urs of inks. MC 
017CA0:  20 53 45 54 0D 0A 20 20 20 20 20 20 20 20 20 20     SET..          
017CB0:  20 49 4E 4B 53 20 61 6C 6C 6F 77 73 20 74 68 65     INKS allows the
017CC0:  20 63 6F 6C 6F 75 72 73 20 6F 66 20 61 6C 6C 20     colours of all 
017CD0:  31 36 20 69 6E 6B 73 20 61 6E 64 20 74 68 65 20    16 inks and the 
017CE0:  62 6F 72 64 65 72 20 20 74 6F 20 20 62 65 20 20    border  to  be  
017CF0:  73 65 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20    set..           
017D00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
017D10:  14 00 00 00 02 09 50 E5 14 00 C1 02 00 00 00 02    ......P.........
017D20:  14 00 C2 02 00 00 00 02 14 00 C3 02 00 00 00 02    ................
017D30:  14 00 C4 02 00 00 00 02 14 00 C5 02 00 00 00 02    ................
017D40:  14 00 C6 02 00 00 00 02 14 00 C7 02 00 00 00 02    ................
017D50:  14 00 C8 02 00 00 00 02 14 00 C9 02 00 00 00 02    ................
017D60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017D70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017D80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017D90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017DF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
017E00:  28 61 6C 74 68 6F 75 67 68 20 6E 6F 74 20 61 6C    (although not al
017E10:  6C 20 6F 66 20 74 68 65 20 69 6E 6B 73 20 6D 61    l of the inks ma
017E20:  79 20 62 65 20 76 69 73 69 62 6C 65 20 6F 6E 20    y be visible on 
017E30:  74 68 65 20 73 63 72 65 65 6E 20 69 6E 20 20 74    the screen in  t
017E40:  68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 63    he..           c
017E50:  75 72 72 65 6E 74 20 6D 6F 64 65 29 2E 20 4D 43    urrent mode). MC
017E60:  20 43 4C 45 41 52 20 49 4E 4B 53 20 73 65 74 73     CLEAR INKS sets
017E70:  20 74 68 65 20 63 6F 6C 6F 75 72 20 6F 66 20 74     the colour of t
017E80:  68 65 20 62 6F 72 64 65 72 20 69 6E 6B 20 61 6E    he border ink an
017E90:  64 0D 0A 20 20 20 20 20 20 20 20 20 20 20 73 65    d..           se
017EA0:  74 73 20 61 6C 6C 20 31 36 20 69 6E 6B 73 20 74    ts all 16 inks t
017EB0:  6F 20 74 68 65 20 73 61 6D 65 20 20 63 6F 6C 6F    o the same  colo
017EC0:  75 72 2E 20 20 54 68 65 20 20 6C 61 74 74 65 72    ur.  The  latter
017ED0:  20 20 69 73 20 20 75 73 65 64 20 20 77 68 65 6E      is  used  when
017EE0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 63 6C 65    ..           cle
017EF0:  61 72 69 6E 67 20 74 68 65 20 73 63 72 65 65 6E    aring the screen
017F00:  20 74 6F 20 6D 61 6B 65 20 74 68 65 20 6F 70 65     to make the ope
017F10:  72 61 74 69 6F 6E 20 61 70 70 65 61 72 20 69 6E    ration appear in
017F20:  73 74 61 6E 74 61 6E 65 6F 75 73 2E 0D 0A 0D 0A    stantaneous.....
017F30:  20 20 20 20 20 20 20 63 2E 20 54 68 65 20 73 6F           c. The so
017F40:  75 6E 64 20 63 68 69 70 2E 0D 0A 20 20 20 20 20    und chip...     
017F50:  20 20 20 20 20 20 41 20 72 6F 75 74 69 6E 65 2C          A routine,
017F60:  20 4D 43 20 53 4F 55 4E 44 20 52 45 47 49 53 54     MC SOUND REGIST
017F70:  45 52 2C 20 69 73 20 70 72 6F 76 69 64 65 64 20    ER, is provided 
017F80:  74 6F 20 77 72 69 74 65 20 74 6F 20 20 61 20 20    to write to  a  
017F90:  72 65 67 69 73 74 65 72 0D 0A 20 20 20 20 20 20    register..      
017FA0:  20 20 20 20 20 6F 66 20 74 68 65 20 73 6F 75 6E         of the soun
017FB0:  64 20 63 68 69 70 2E 20 54 68 69 73 20 69 73 20    d chip. This is 
017FC0:  75 73 65 64 20 62 79 20 74 68 65 20 53 6F 75 6E    used by the Soun
017FD0:  64 20 4D 61 6E 61 67 65 72 20 66 6F 72 20 20 68    d Manager for  h
017FE0:  61 72 64 77 61 72 65 0D 0A 20 20 20 20 20 20 20    ardware..       
017FF0:  20 20 20 20 61 63 63 65 73 73 2E 0D 0A 0D 0A 20        access..... 
018000:  20 20 20 20 20 20 64 2E 20 54 68 65 20 43 65 6E          d. The Cen
018010:  74 72 6F 6E 69 63 73 20 70 6F 72 74 2E 0D 0A 20    tronics port... 
018020:  20 20 20 20 20 20 20 20 20 20 54 77 6F 20 72 6F              Two ro
018030:  75 74 69 6E 65 73 20 61 72 65 20 70 72 6F 76 69    utines are provi
018040:  64 65 64 20 74 6F 20 61 63 63 65 73 73 20 74 68    ded to access th
018050:  65 20 43 65 6E 74 72 6F 6E 69 63 73 20 70 6F 72    e Centronics por
018060:  74 2E 20 20 4D 43 20 20 42 55 53 59 0D 0A 20 20    t.  MC  BUSY..  
018070:  20 20 20 20 20 20 20 20 20 50 52 49 4E 54 45 52             PRINTER
018080:  20 74 65 73 74 73 20 69 66 20 69 74 20 69 73 20     tests if it is 
018090:  62 75 73 79 2E 20 4D 43 20 53 45 4E 44 20 50 52    busy. MC SEND PR
0180A0:  49 4E 54 45 52 20 73 74 72 6F 62 65 73 20 64 61    INTER strobes da
0180B0:  74 61 20 20 6F 75 74 20 20 6F 66 0D 0A 20 20 20    ta  out  of..   
0180C0:  20 20 20 20 20 20 20 20 69 74 2E 20 44 61 74 61            it. Data
0180D0:  20 73 68 6F 75 6C 64 20 6E 6F 74 20 62 65 20 73     should not be s
0180E0:  65 6E 74 20 77 68 69 6C 65 20 74 68 65 20 70 6F    ent while the po
0180F0:  72 74 20 69 73 20 62 75 73 79 2E 0D 0A 0D 0A 20    rt is busy..... 
018100:  20 20 20 20 20 20 20 20 20 20 54 68 65 20 43 65              The Ce
018110:  6E 74 72 6F 6E 69 63 73 20 70 6F 72 74 20 69 73    ntronics port is
018120:  20 75 73 65 64 20 62 79 20 74 68 65 20 70 72 69     used by the pri
018130:  6E 74 65 72 20 20 72 6F 75 74 69 6E 65 73 20 20    nter  routines  
018140:  70 72 6F 76 69 64 65 64 20 20 69 6E 0D 0A 20 20    provided  in..  
018150:  20 20 20 20 20 20 20 20 20 74 68 65 20 4D 61 63             the Mac
018160:  68 69 6E 65 20 50 61 63 6B 20 61 6E 64 20 64 65    hine Pack and de
018170:  73 63 72 69 62 65 64 20 62 65 6C 6F 77 2E 0D 0A    scribed below...
018180:  0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44    ..       AMSTRAD
018190:  20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38     CPC464/664/6128
0181A0:  20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20     FIRMWARE       
0181B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0181C0:  20 20 20 20 20 20 70 61 67 65 20 31 33 2E 32 0D          page 13.2.
0181D0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
0181E0:  20 20 20 20 31 33 2E 32 20 54 68 65 20 50 72 69        13.2 The Pri
0181F0:  6E 74 65 72 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    nter.....       
018200:  54 68 65 72 65 20 69 73 20 61 20 72 6F 75 74 69    There is a routi
018210:  6E 65 2C 20 4D 43 20 50 52 49 4E 54 20 43 48 41    ne, MC PRINT CHA
018220:  52 2C 20 77 68 69 63 68 20 63 61 6C 6C 73 20 61    R, which calls a
018230:  6E 20 69 6E 64 69 72 65 63 74 69 6F 6E 2C 20 4D    n indirection, M
018240:  43 20 57 41 49 54 0D 0A 20 20 20 20 20 20 20 50    C WAIT..       P
018250:  52 49 4E 54 45 52 2C 20 66 6F 72 20 73 65 6E 64    RINTER, for send
018260:  69 6E 67 20 63 68 61 72 61 63 74 65 72 73 20 74    ing characters t
018270:  6F 20 74 68 65 20 20 70 72 69 6E 74 65 72 2C 20    o the  printer, 
018280:  20 6F 72 20 20 72 61 74 68 65 72 2C 20 20 74 6F     or  rather,  to
018290:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 43 65      the..       Ce
0182A0:  6E 74 72 6F 6E 69 63 73 20 70 6F 72 74 2E 20 49    ntronics port. I
0182B0:  6E 20 56 31 2E 31 20 66 69 72 6D 77 61 72 65 2C    n V1.1 firmware,
0182C0:  20 62 65 66 6F 72 65 20 73 65 6E 64 69 6E 67 20     before sending 
0182D0:  20 74 68 65 20 20 63 68 61 72 61 63 74 65 72 73     the  characters
0182E0:  20 20 4D 43 0D 0A 20 20 20 20 20 20 20 50 52 49      MC..       PRI
0182F0:  4E 54 20 43 48 41 52 20 74 72 61 6E 73 6C 61 74    NT CHAR translat
018300:  65 73 20 74 68 65 6D 20 75 73 69 6E 67 20 74 68    es them using th
018310:  65 20 70 72 69 6E 74 65 72 20 20 74 72 61 6E 73    e printer  trans
018320:  6C 61 74 69 6F 6E 20 20 74 61 62 6C 65 2E 20 20    lation  table.  
018330:  54 68 65 0D 0A 0D 0A 20 20 20 20 20 20 20 75 73    The....       us
018340:  65 72 20 63 61 6E 20 73 65 74 20 74 68 65 20 74    er can set the t
018350:  72 61 6E 73 6C 61 74 69 6F 6E 73 20 62 79 20 63    ranslations by c
018360:  61 6C 6C 69 6E 67 20 20 4D 43 20 20 50 52 49 4E    alling  MC  PRIN
018370:  54 20 20 54 52 41 4E 53 4C 41 54 49 4F 4E 2E 20    T  TRANSLATION. 
018380:  20 54 68 65 0D 0A 20 20 20 20 20 20 20 64 65 66     The..       def
018390:  61 75 6C 74 20 74 72 61 6E 73 6C 61 74 69 6F 6E    ault translation
0183A0:  20 74 61 62 6C 65 20 28 73 65 65 20 41 70 70 65     table (see Appe
0183B0:  6E 64 69 78 20 58 49 56 29 20 6F 6E 6C 79 20 20    ndix XIV) only  
0183C0:  61 66 66 65 63 74 73 20 20 63 68 61 72 61 63 74    affects  charact
0183D0:  65 72 73 0D 0A 20 20 20 20 20 20 20 69 6E 20 74    ers..       in t
0183E0:  68 65 20 72 61 6E 67 65 20 23 41 30 2E 2E 23 41    he range #A0..#A
0183F0:  46 20 61 6E 64 20 69 73 20 64 65 73 69 67 6E 65    F and is designe
018400:  64 20 74 6F 20 6D 61 6B 65 20 74 68 65 73 65 20    d to make these 
018410:  20 63 68 61 72 61 63 74 65 72 73 20 20 70 72 69     characters  pri
018420:  6E 74 0D 0A 20 20 20 20 20 20 20 6D 6F 72 65 20    nt..       more 
018430:  72 65 61 73 6F 6E 61 62 6C 79 20 6F 6E 20 74 68    reasonably on th
018440:  65 20 44 4D 50 2D 31 20 70 72 69 6E 74 65 72 20    e DMP-1 printer 
018450:  66 6F 72 20 76 61 72 69 6F 75 73 20 6C 61 6E 67    for various lang
018460:  75 61 67 65 20 6F 70 74 69 6F 6E 73 2E 0D 0A 0D    uage options....
018470:  0A 20 20 20 20 20 20 20 4D 43 20 57 41 49 54 20    .       MC WAIT 
018480:  50 52 49 4E 54 45 52 20 77 61 69 74 73 20 75 6E    PRINTER waits un
018490:  74 69 6C 20 74 68 65 20 43 65 6E 74 72 6F 6E 69    til the Centroni
0184A0:  63 73 20 70 6F 72 74 20 69 73 20 6E 6F 74 20 62    cs port is not b
0184B0:  75 73 79 20 20 61 6E 64 20 20 74 68 65 6E 0D 0A    usy  and  then..
0184C0:  20 20 20 20 20 20 20 73 65 6E 64 73 20 74 68 65           sends the
0184D0:  20 67 69 76 65 6E 20 63 68 61 72 61 63 74 65 72     given character
0184E0:  73 20 74 6F 20 69 74 2E 20 49 66 20 74 68 65 20    s to it. If the 
0184F0:  70 6F 72 74 20 72 65 6D 61 69 6E 73 20 62 75 73    port remains bus
018500:  79 20 66 6F 72 20 61 20 20 6C 6F 6E 67 0D 0A 20    y for a  long.. 
018510:  20 20 20 20 20 20 74 69 6D 65 20 74 68 65 6E 20          time then 
018520:  74 68 65 20 72 6F 75 74 69 6E 65 20 74 69 6D 65    the routine time
018530:  73 20 6F 75 74 20 61 6E 64 20 72 65 74 75 72 6E    s out and return
018540:  73 20 20 69 6E 64 69 63 61 74 69 6E 67 20 20 74    s  indicating  t
018550:  68 61 74 20 20 69 74 20 20 68 61 73 0D 0A 20 20    hat  it  has..  
018560:  20 20 20 20 20 66 61 69 6C 65 64 20 74 6F 20 73         failed to s
018570:  65 6E 64 20 74 68 65 20 63 68 61 72 61 63 74 65    end the characte
018580:  72 2E 20 54 68 69 73 20 74 69 6D 65 20 6F 75 74    r. This time out
018590:  20 63 61 6E 20 20 62 65 20 20 75 73 65 64 20 20     can  be  used  
0185A0:  74 6F 20 20 70 72 65 76 65 6E 74 0D 0A 20 20 20    to  prevent..   
0185B0:  20 20 20 20 70 72 6F 67 72 61 6D 73 20 20 27 68        programs  'h
0185C0:  61 6E 67 69 6E 67 27 20 20 62 65 63 61 75 73 65    anging'  because
0185D0:  20 20 74 68 65 79 20 20 61 72 65 20 20 77 61 69      they  are  wai
0185E0:  74 69 6E 67 20 20 20 66 6F 72 20 20 20 61 20 20    ting   for   a  
0185F0:  20 28 70 6F 73 73 69 62 6C 79 0D 0A 20 20 20 20     (possibly..    
018600:  20 20 20 6E 6F 6E 2D 65 78 69 73 74 65 6E 74 29       non-existent)
018610:  20 70 72 69 6E 74 65 72 20 74 6F 20 62 65 63 6F     printer to beco
018620:  6D 65 20 72 65 61 64 79 2E 0D 0A 0D 0A 0D 0A 20    me ready....... 
018630:  20 20 20 20 20 20 4D 43 20 57 41 49 54 20 50 52          MC WAIT PR
018640:  49 4E 54 45 52 20 61 6C 6C 6F 77 73 20 74 68 65    INTER allows the
018650:  20 75 73 65 72 20 74 6F 20 69 6E 74 65 72 63 65     user to interce
018660:  70 74 20 63 68 61 72 61 63 74 65 72 73 20 74 6F    pt characters to
018670:  20 62 65 20 73 65 6E 74 20 20 74 6F 0D 0A 20 20     be sent  to..  
018680:  20 20 20 20 20 74 68 65 20 70 72 69 6E 74 65 72         the printer
018690:  2E 20 54 68 69 73 20 63 6F 75 6C 64 20 61 6C 6C    . This could all
0186A0:  6F 77 20 73 70 65 63 69 61 6C 20 65 73 63 61 70    ow special escap
0186B0:  65 20 73 65 71 75 65 6E 63 65 73 20 74 6F 20 62    e sequences to b
0186C0:  65 20 20 69 6E 73 65 72 74 65 64 0D 0A 20 20 20    e  inserted..   
0186D0:  20 20 20 20 69 66 20 6E 65 65 64 65 64 2C 20 6F        if needed, o
0186E0:  72 20 69 74 20 63 6F 75 6C 64 20 61 6C 6C 6F 77    r it could allow
0186F0:  20 74 68 65 20 70 72 69 6E 74 65 72 20 74 6F 20     the printer to 
018700:  62 65 20 64 69 73 61 62 6C 65 64 20 6F 72 20 74    be disabled or t
018710:  68 65 20 20 6C 65 6E 67 74 68 0D 0A 20 20 20 20    he  length..    
018720:  20 20 20 6F 66 20 74 68 65 20 74 69 6D 65 20 6F       of the time o
018730:  75 74 20 74 6F 20 62 65 20 63 68 61 6E 67 65 64    ut to be changed
018740:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 33    .......       13
018750:  2E 33 20 4C 6F 61 64 69 6E 67 20 61 6E 64 20 52    .3 Loading and R
018760:  75 6E 6E 69 6E 67 20 50 72 6F 67 72 61 6D 73 2E    unning Programs.
018770:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
018780:  20 4D 61 63 68 69 6E 65 20 50 61 63 6B 20 70 72     Machine Pack pr
018790:  6F 76 69 64 65 73 20 74 77 6F 20 72 6F 75 74 69    ovides two routi
0187A0:  6E 65 73 20 66 6F 72 20 72 75 6E 6E 69 6E 67 20    nes for running 
0187B0:  70 72 6F 67 72 61 6D 73 2C 20 4D 43 20 20 53 54    programs, MC  ST
0187C0:  41 52 54 0D 0A 20 20 20 20 20 20 20 50 52 4F 47    ART..       PROG
0187D0:  52 41 4D 20 61 6E 64 20 4D 43 20 42 4F 4F 54 20    RAM and MC BOOT 
0187E0:  50 52 4F 47 52 41 4D 2E 0D 0A 0D 0A 0D 0A 20 20    PROGRAM.......  
0187F0:  20 20 20 20 20 4D 43 20 53 54 41 52 54 20 50 52         MC START PR
018800:  4F 47 52 41 4D 20 69 73 20 74 68 65 20 73 69 6D    OGRAM is the sim
018810:  70 6C 65 72 20 6F 66 20 74 68 65 20 20 74 77 6F    pler of the  two
018820:  20 20 72 6F 75 74 69 6E 65 73 2E 20 20 49 74 20      routines.  It 
018830:  20 63 6F 6D 70 6C 65 74 65 6C 79 0D 0A 20 20 20     completely..   
018840:  20 20 20 20 72 65 2D 69 6E 69 74 69 61 6C 69 7A        re-initializ
018850:  65 20 61 6C 6C 20 74 68 65 20 66 69 72 6D 77 61    e all the firmwa
018860:  72 65 20 61 6E 64 20 74 68 65 6E 20 65 6E 74 65    re and then ente
018870:  72 73 20 74 68 65 20 67 69 76 65 6E 20 70 72 6F    rs the given pro
018880:  67 72 61 6D 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    gram.......     
018890:  20 20 4D 43 20 42 4F 4F 54 20 50 52 4F 47 52 41      MC BOOT PROGRA
0188A0:  4D 20 69 73 20 6D 6F 72 65 20 63 6F 6D 70 6C 65    M is more comple
0188B0:  78 2E 20 49 74 20 69 73 20 66 6F 72 20 6C 6F 61    x. It is for loa
0188C0:  64 69 6E 67 20 61 20 70 72 6F 67 72 61 6D 20 69    ding a program i
0188D0:  6E 74 6F 20 20 52 41 4D 0D 0A 20 20 20 20 20 20    nto  RAM..      
0188E0:  20 61 6E 64 20 72 75 6E 6E 69 6E 67 20 69 74 2E     and running it.
0188F0:  20 54 68 65 20 75 73 65 72 20 73 75 70 70 6C 69     The user suppli
018900:  65 73 20 61 20 72 6F 75 74 69 6E 65 20 74 6F 20    es a routine to 
018910:  4D 43 20 20 42 4F 4F 54 20 20 50 52 4F 47 52 41    MC  BOOT  PROGRA
018920:  4D 20 20 74 68 61 74 0D 0A 20 20 20 20 20 20 20    M  that..       
018930:  77 69 6C 6C 20 6C 6F 61 64 20 74 68 65 20 70 72    will load the pr
018940:  6F 67 72 61 6D 20 61 6E 64 20 72 65 74 75 72 6E    ogram and return
018950:  20 69 74 73 20 65 6E 74 72 79 20 20 70 6F 69 6E     its entry  poin
018960:  74 2E 20 20 42 65 66 6F 72 65 20 20 74 68 69 73    t.  Before  this
018970:  20 20 6C 6F 61 64 0D 0A 20 20 20 20 20 20 20 72      load..       r
018980:  6F 75 74 69 6E 65 20 69 73 20 63 61 6C 6C 65 64    outine is called
018990:  20 61 73 20 6D 75 63 68 20 6F 66 20 74 68 65 20     as much of the 
0189A0:  66 69 72 6D 77 61 72 65 20 61 73 20 69 73 20 70    firmware as is p
0189B0:  6F 73 73 69 62 6C 65 20 69 73 20 20 72 65 73 65    ossible is  rese
0189C0:  74 20 20 73 6F 0D 0A 20 20 20 20 20 20 20 74 68    t  so..       th
0189D0:  61 74 20 74 68 65 20 61 72 65 20 6F 66 20 6D 65    at the are of me
0189E0:  6D 6F 72 79 20 62 65 74 77 65 65 6E 20 23 30 30    mory between #00
0189F0:  34 30 20 61 6E 64 20 74 68 65 20 62 61 73 65 20    40 and the base 
018A00:  6F 66 20 74 68 65 20 66 69 72 6D 77 61 72 65 20    of the firmware 
018A10:  20 52 41 4D 0D 0A 20 20 20 20 20 20 20 61 74 20     RAM..       at 
018A20:  23 42 31 30 30 20 69 73 20 61 76 61 69 6C 61 62    #B100 is availab
018A30:  6C 65 20 66 6F 72 20 75 73 65 2E 20 49 66 20 74    le for use. If t
018A40:  68 65 20 73 79 73 74 65 6D 20 77 65 72 65 20 6E    he system were n
018A50:  6F 74 20 20 72 65 73 65 74 20 20 74 68 65 6E 20    ot  reset  then 
018A60:  20 61 6E 0D 0A 20 20 20 20 20 20 20 61 63 74 69     an..       acti
018A70:  76 65 20 69 6E 64 69 72 65 63 74 69 6F 6E 2C 20    ve indirection, 
018A80:  65 76 65 6E 74 20 6F 72 20 69 6E 74 65 72 72 75    event or interru
018A90:  70 74 20 72 6F 75 74 69 6E 65 20 20 6D 69 67 68    pt routine  migh
018AA0:  74 20 20 62 65 20 20 6F 76 65 72 77 72 69 74 74    t  be  overwritt
018AB0:  65 6E 0D 0A 20 20 20 20 20 20 20 77 69 74 68 20    en..       with 
018AC0:  64 69 73 61 73 74 72 6F 75 73 20 63 6F 6E 73 65    disastrous conse
018AD0:  71 75 65 6E 63 65 73 2E 0D 0A 0D 0A 20 20 20 20    quences.....    
018AE0:  20 20 20 49 66 20 74 68 65 20 70 72 6F 67 72 61       If the progra
018AF0:  6D 20 69 73 20 6C 6F 61 64 65 64 20 73 75 63 63    m is loaded succ
018B00:  65 73 73 66 75 6C 6C 79 20 62 79 20 20 4D 43 20    essfully by  MC 
018B10:  20 42 4F 4F 54 20 20 50 52 4F 47 52 41 4D 20 20     BOOT  PROGRAM  
018B20:  74 68 65 6E 20 20 74 68 65 0D 0A 20 20 20 20 20    then  the..     
018B30:  20 20 66 69 72 6D 77 61 72 65 20 20 69 73 20 20      firmware  is  
018B40:  63 6F 6D 70 6C 65 74 65 6C 79 20 20 69 6E 69 74    completely  init
018B50:  69 61 6C 69 7A 65 64 20 20 61 6E 64 20 20 74 68    ialized  and  th
018B60:  65 20 20 70 72 6F 67 72 61 6D 20 20 69 73 20 20    e  program  is  
018B70:  65 6E 74 65 72 65 64 2E 0D 0A 20 20 20 20 20 20    entered...      
018B80:  20 48 6F 77 65 76 65 72 2C 20 69 66 20 74 68 65     However, if the
018B90:  20 6C 6F 61 64 69 6E 67 20 66 61 69 6C 73 20 74     loading fails t
018BA0:  68 65 6E 20 61 6E 20 61 70 70 72 6F 70 72 69 61    hen an appropria
018BB0:  74 65 20 6D 65 73 73 61 67 65 20 20 69 73 20 20    te message  is  
018BC0:  70 72 69 6E 74 65 64 0D 0A 20 20 20 20 20 20 20    printed..       
018BD0:  61 6E 64 20 74 68 65 20 70 72 65 76 69 6F 75 73    and the previous
018BE0:  20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67     foreground prog
018BF0:  72 61 6D 20 20 69 73 20 20 72 65 73 74 61 72 74    ram  is  restart
018C00:  65 64 2E 20 20 49 66 20 20 74 68 65 20 20 70 72    ed.  If  the  pr
018C10:  65 76 69 6F 75 73 0D 0A 20 20 20 20 20 20 20 70    evious..       p
018C20:  72 6F 67 72 61 6D 20 77 61 73 20 69 74 73 65 6C    rogram was itsel
018C30:  66 20 61 20 52 41 4D 20 70 72 6F 67 72 61 6D 20    f a RAM program 
018C40:  20 74 68 65 6E 20 20 74 68 65 20 20 64 65 66 61     then  the  defa
018C50:  75 6C 74 20 20 52 4F 4D 20 20 69 73 20 20 65 6E    ult  ROM  is  en
018C60:  74 65 72 65 64 0D 0A 20 20 20 20 20 20 20 69 6E    tered..       in
018C70:  73 74 65 61 64 20 62 65 63 61 75 73 65 20 69 74    stead because it
018C80:  20 69 73 20 6C 69 6B 65 6C 79 20 74 68 61 74 20     is likely that 
018C90:  74 68 65 20 70 72 65 76 69 6F 75 73 20 70 72 6F    the previous pro
018CA0:  67 72 61 6D 20 20 77 61 73 20 20 63 6F 72 72 75    gram  was  corru
018CB0:  70 74 65 64 0D 0A 20 20 20 20 20 20 20 77 68 65    pted..       whe
018CC0:  6E 20 74 68 65 20 61 74 74 65 6D 70 74 20 74 6F    n the attempt to
018CD0:  20 6C 6F 61 64 20 74 68 65 20 6E 65 77 20 6F 6E     load the new on
018CE0:  65 20 77 61 73 20 6D 61 64 65 2E 0D 0A 0D 0A 0D    e was made......
018CF0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
018D00:  41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36    AMSTRAD CPC464/6
018D10:  36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45    64/6128 FIRMWARE
018D20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
018D30:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
018D40:  65 20 31 33 2E 33 0D 0A 1A 20 6C 6F 77 20 6C 65    e 13.3... low le
018D50:  76 65 6C 20 64 72 69 76 69 6E 67 20 6F 66 20 74    vel driving of t
018D60:  68 65 20 68 61 72 64 77 61 72 65 2E 20 20 49 74    he hardware.  It
018D70:  0D 0A 20 20 20 20 20 20 20 61 6C 73 6F 20 74 61    ..       also ta
018D80:  20 48 6F 77 65 76 65 72 2C 20 69 66 20 74 68 65     However, if the
018D90:  20 6C 6F 61 64 69 6E 67 20 66 61 69 6C 73 20 74     loading fails t
018DA0:  68 65 6E 20 61 6E 20 61 70 70 72 6F 70 72 69 61    hen an appropria
018DB0:  74 65 20 6D 65 73 73 61 67 65 20 20 69 73 20 20    te message  is  
018DC0:  70 72 69 6E 74 65 64 0D 0A 20 20 20 20 20 20 20    printed..       
018DD0:  61 6E 64 20 74 68 65 20 70 72 65 76 69 6F 75 73    and the previous
018DE0:  20 66 6F 72 65 67 72 6F 75 6E 64 20 70 72 6F 67     foreground prog
018DF0:  72 61 6D 20 20 69 73 20 20 72 65 73 74 61 72 74    ram  is  restart
018E00:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
018E10:  34 20 46 69 72 6D 77 61 72 65 20 4A 75 6D 70 62    4 Firmware Jumpb
018E20:  6C 6F 63 6B 73 2E 0D 0A 0D 0A 20 20 20 20 20 20    locks.....      
018E30:  20 54 68 65 72 65 20 61 72 65 20 61 20 6E 75 6D     There are a num
018E40:  62 65 72 20 6F 66 20 6A 75 6D 70 62 6C 6F 63 6B    ber of jumpblock
018E50:  73 20 70 72 6F 76 69 64 65 64 20 62 79 20 74 68    s provided by th
018E60:  65 20 66 69 72 6D 77 61 72 65 2E 20 54 68 65 20    e firmware. The 
018E70:  6C 61 72 67 65 73 74 0D 0A 20 20 20 20 20 20 20    largest..       
018E80:  6F 66 20 74 68 65 73 65 20 69 73 20 74 68 65 20    of these is the 
018E90:  6D 61 69 6E 20 66 69 72 6D 77 61 72 65 20 6A 75    main firmware ju
018EA0:  6D 70 62 6C 6F 63 6B 2E 20 54 68 69 73 20 69 73    mpblock. This is
018EB0:  20 69 6E 74 65 6E 64 65 64 20 74 6F 20 20 62 65     intended to  be
018EC0:  20 20 75 73 65 64 0D 0A 20 20 20 20 20 20 20 62      used..       b
018ED0:  79 20 70 72 6F 67 72 61 6D 73 20 74 6F 20 61 63    y programs to ac
018EE0:  63 65 73 73 20 74 68 65 20 66 69 72 6D 77 61 72    cess the firmwar
018EF0:  65 20 72 6F 75 74 69 6E 65 73 20 69 6E 20 74 68    e routines in th
018F00:  65 20 6C 6F 77 65 72 20 20 52 4F 4D 2E 20 20 42    e lower  ROM.  B
018F10:  41 53 49 43 2C 0D 0A 20 20 20 20 20 20 20 66 6F    ASIC,..       fo
018F20:  72 20 69 6E 73 74 61 6E 63 65 2C 20 75 73 65 73    r instance, uses
018F30:  20 74 68 65 73 65 20 6A 75 6D 70 73 2E 20 4E 6F     these jumps. No
018F40:  74 65 2C 20 68 6F 77 65 76 65 72 20 74 68 61 74    te, however that
018F50:  20 74 68 65 20 20 66 69 72 6D 77 61 72 65 20 20     the  firmware  
018F60:  64 6F 65 73 0D 0A 20 20 20 20 20 20 20 6E 6F 74    does..       not
018F70:  20 75 73 65 20 74 68 69 73 20 6A 75 6D 70 62 6C     use this jumpbl
018F80:  6F 63 6B 20 66 6F 72 20 69 6E 74 65 72 6E 61 6C    ock for internal
018F90:  20 63 6F 6D 6D 75 6E 69 63 61 74 69 6F 6E 20 20     communication  
018FA0:  77 69 74 68 20 20 69 74 73 65 6C 66 2E 20 20 54    with  itself.  T
018FB0:  68 69 73 0D 0A 20 20 20 20 20 20 20 6D 65 61 6E    his..       mean
018FC0:  73 20 20 74 68 61 74 20 20 61 6C 74 65 72 69 6E    s  that  alterin
018FD0:  67 20 20 74 68 65 20 20 6A 75 6D 70 62 6C 6F 63    g  the  jumpbloc
018FE0:  6B 20 20 77 69 6C 6C 20 20 63 61 75 73 65 20 20    k  will  cause  
018FF0:  42 41 53 49 43 20 20 74 6F 20 20 20 62 65 68 61    BASIC  to   beha
019000:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
019010:  15 00 00 00 02 09 50 E5 15 00 C1 02 00 00 00 02    ......P.........
019020:  15 00 C2 02 00 00 00 02 15 00 C3 02 00 00 00 02    ................
019030:  15 00 C4 02 00 00 00 02 15 00 C5 02 00 00 00 02    ................
019040:  15 00 C6 02 00 00 00 02 15 00 C7 02 00 00 00 02    ................
019050:  15 00 C8 02 00 00 00 02 15 00 C9 02 00 00 00 02    ................
019060:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
019070:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
019080:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
019090:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0190F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
019100:  76 65 0D 0A 20 20 20 20 20 20 20 64 69 66 66 65    ve..       diffe
019110:  72 65 6E 74 6C 79 20 62 75 74 20 77 69 6C 6C 20    rently but will 
019120:  6E 6F 74 20 63 61 75 73 65 20 74 68 65 20 66 69    not cause the fi
019130:  72 6D 77 61 72 65 20 74 6F 20 62 65 68 61 76 65    rmware to behave
019140:  20 64 69 66 66 65 72 65 6E 74 6C 79 2E 0D 0A 0D     differently....
019150:  0A 20 20 20 20 20 20 20 54 68 65 20 6D 6F 73 74    .       The most
019160:  20 20 69 6D 70 6F 72 74 61 6E 74 20 20 6A 75 6D      important  jum
019170:  70 62 6C 6F 63 6B 20 20 69 73 20 20 74 68 65 20    pblock  is  the 
019180:  20 69 6E 64 69 72 65 63 74 69 6F 6E 73 20 20 6A     indirections  j
019190:  75 6D 70 62 6C 6F 63 6B 2E 20 20 54 68 65 0D 0A    umpblock.  The..
0191A0:  20 20 20 20 20 20 20 69 6E 64 69 72 65 63 74 69           indirecti
0191B0:  6F 6E 73 20 61 72 65 20 6A 75 6D 70 73 20 74 68    ons are jumps th
0191C0:  61 74 20 61 72 65 20 75 73 65 64 20 62 79 20 74    at are used by t
0191D0:  68 65 20 66 69 72 6D 77 61 72 65 20 20 61 74 20    he firmware  at 
0191E0:  20 6B 65 79 20 20 70 6F 69 6E 74 73 2E 0D 0A 20     key  points... 
0191F0:  20 20 20 20 20 20 54 68 69 73 20 61 6C 6C 6F 77          This allow
019200:  73 20 74 68 65 20 75 73 65 72 20 74 6F 20 61 6C    s the user to al
019210:  74 65 72 20 74 68 65 20 61 63 74 69 6F 6E 20 20    ter the action  
019220:  6F 66 20 20 66 69 72 6D 77 61 72 65 20 20 72 6F    of  firmware  ro
019230:  75 74 69 6E 65 73 2E 20 20 54 68 65 0D 0A 20 20    utines.  The..  
019240:  20 20 20 20 20 65 6E 74 72 69 65 73 20 69 6E 20         entries in 
019250:  74 68 69 73 20 6A 75 6D 70 62 6C 6F 63 6B 20 61    this jumpblock a
019260:  72 65 20 6E 6F 74 20 69 6E 74 65 6E 64 65 64 20    re not intended 
019270:  66 6F 72 20 74 68 65 20 75 73 65 72 20 74 6F 20    for the user to 
019280:  63 61 6C 6C 2C 20 20 6F 6E 6C 79 0D 0A 20 20 20    call,  only..   
019290:  20 20 20 20 66 6F 72 20 74 68 65 20 66 69 72 6D        for the firm
0192A0:  77 61 72 65 20 74 6F 20 63 61 6C 6C 2E 20 41 6C    ware to call. Al
0192B0:  74 65 72 69 6E 67 20 61 6E 20 69 6E 64 69 72 65    tering an indire
0192C0:  63 74 69 6F 6E 20 20 69 73 20 20 74 68 65 20 20    ction  is  the  
0192D0:  6D 65 74 68 6F 64 20 20 74 6F 0D 0A 20 20 20 20    method  to..    
0192E0:  20 20 20 6D 61 6B 65 20 74 68 65 20 66 69 72 6D       make the firm
0192F0:  77 61 72 65 20 62 65 68 61 76 65 20 64 69 66 66    ware behave diff
019300:  65 72 65 6E 74 6C 79 2E 0D 0A 0D 0A 20 20 20 20    erently.....    
019310:  20 20 20 54 68 65 20 72 65 6D 61 69 6E 69 6E 67       The remaining
019320:  20 74 77 6F 20 6A 75 6D 70 62 6C 6F 63 6B 73 20     two jumpblocks 
019330:  61 72 65 20 61 73 73 6F 63 69 61 74 65 64 20 77    are associated w
019340:  69 74 68 20 74 68 65 20 4B 65 72 6E 65 6C 2E 20    ith the Kernel. 
019350:  4F 6E 65 20 69 73 20 20 61 0D 0A 20 20 20 20 20    One is  a..     
019360:  20 20 6A 75 6D 70 62 6C 6F 63 6B 20 74 6F 20 61      jumpblock to a
019370:  6C 6C 6F 77 20 74 68 65 20 75 73 65 72 20 74 6F    llow the user to
019380:  20 63 61 6C 6C 20 76 61 72 69 6F 75 73 20 75 73     call various us
019390:  65 66 75 6C 20 4B 65 72 6E 65 6C 20 72 6F 75 74    eful Kernel rout
0193A0:  69 6E 65 73 20 20 74 6F 0D 0A 20 20 20 20 20 20    ines  to..      
0193B0:  20 64 6F 20 77 69 74 68 20 63 68 61 6E 67 69 6E     do with changin
0193C0:  67 20 52 4F 4D 20 73 74 61 74 65 73 20 61 6E 64    g ROM states and
0193D0:  20 74 68 65 20 6C 69 6B 65 2E 20 54 68 65 20 6F     the like. The o
0193E0:  74 68 65 72 20 69 73 20 6E 6F 74 20 61 20 6A 75    ther is not a ju
0193F0:  6D 70 62 6C 6F 63 6B 0D 0A 20 20 20 20 20 20 20    mpblock..       
019400:  61 73 20 73 75 63 68 2C 20 6A 75 73 74 20 61 6E    as such, just an
019410:  20 61 72 65 61 20 77 68 65 72 65 20 74 68 65 20     area where the 
019420:  72 6F 75 74 69 6E 65 73 20 61 72 65 20 61 74 20    routines are at 
019430:  20 70 75 62 6C 69 73 68 65 64 20 20 61 64 64 72     published  addr
019440:  65 73 73 65 73 2E 0D 0A 20 20 20 20 20 20 20 54    esses...       T
019450:  68 65 73 65 20 61 72 65 20 67 65 6E 65 72 61 6C    hese are general
019460:  20 75 74 69 6C 69 74 79 20 72 6F 75 74 69 6E 65     utility routine
019470:  73 20 61 6E 64 20 72 65 73 74 61 72 74 73 2E 20    s and restarts. 
019480:  49 6E 20 67 65 6E 65 72 61 6C 20 6E 65 69 74 68    In general neith
019490:  65 72 20 6F 66 0D 0A 20 20 20 20 20 20 20 74 68    er of..       th
0194A0:  65 73 65 20 61 72 65 61 73 20 73 68 6F 75 6C 64    ese areas should
0194B0:  20 62 65 20 61 6C 74 65 72 65 64 20 62 79 20 74     be altered by t
0194C0:  68 65 20 75 73 65 72 2E 0D 0A 0D 0A 20 20 20 20    he user.....    
0194D0:  20 20 20 54 68 65 20 72 6F 75 74 69 6E 65 73 20       The routines 
0194E0:  69 6E 20 20 74 68 65 73 65 20 20 6A 75 6D 70 62    in  these  jumpb
0194F0:  6C 6F 63 6B 73 20 20 61 72 65 20 20 62 72 69 65    locks  are  brie
019500:  66 6C 79 20 20 6C 69 73 74 65 64 20 20 62 65 6C    fly  listed  bel
019510:  6F 77 2E 20 20 4D 6F 72 65 0D 0A 20 20 20 20 20    ow.  More..     
019520:  20 20 63 6F 6D 70 6C 65 78 20 64 65 73 63 72 69      complex descri
019530:  70 74 69 6F 6E 73 20 6F 66 20 74 68 65 20 72 6F    ptions of the ro
019540:  75 74 69 6E 65 73 20 63 61 6E 20 62 65 20 66 6F    utines can be fo
019550:  75 6E 64 20 69 6E 20 73 65 63 74 69 6F 6E 73 20    und in sections 
019560:  31 35 2C 20 20 31 36 2C 0D 0A 20 20 20 20 20 20    15,  16,..      
019570:  20 31 37 20 61 6E 64 20 31 38 2E 0D 0A 20 20 20     17 and 18...   
019580:  20 20 20 20 41 4D 53 44 4F 53 20 70 72 6F 76 69        AMSDOS provi
019590:  64 65 73 20 61 20 6E 75 6D 62 65 72 20 6F 66 20    des a number of 
0195A0:  65 78 74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64    external command
0195B0:  73 20 20 77 68 69 63 68 20 20 61 6C 6C 6F 77 20    s  which  allow 
0195C0:  20 74 68 65 20 20 75 73 65 72 0D 0A 20 20 20 20     the  user..    
0195D0:  20 20 20 61 63 63 65 73 73 20 20 74 6F 20 20 74       access  to  t
0195E0:  68 65 20 20 6C 6F 77 20 20 6C 65 76 65 6C 20 20    he  low  level  
0195F0:  64 69 73 63 20 20 64 72 69 76 69 6E 67 20 20 61    disc  driving  a
019600:  6E 64 20 20 74 6F 20 20 68 69 67 68 20 20 6C 65    nd  to  high  le
019610:  76 65 6C 20 20 64 69 73 63 0D 0A 20 20 20 20 20    vel  disc..     
019620:  20 20 6F 70 65 72 61 74 69 6F 6E 73 2E 0D 0A 20      operations... 
019630:  20 20 20 20 20 20 54 68 65 73 65 20 63 6F 6D 6D          These comm
019640:  61 6E 64 73 20 61 72 65 20 20 61 63 63 65 73 73    ands are  access
019650:  65 64 20 20 75 73 69 6E 67 20 20 74 68 65 20 20    ed  using  the  
019660:  65 78 74 65 72 6E 61 6C 20 20 63 6F 6D 6D 61 6E    external  comman
019670:  64 20 20 6D 65 63 68 61 6E 69 73 6D 0D 0A 20 20    d  mechanism..  
019680:  20 20 20 20 20 64 65 73 63 72 69 62 65 64 20 69         described i
019690:  6E 20 73 65 63 74 69 6F 6E 20 31 30 2C 20 69 2E    n section 10, i.
0196A0:  65 2E 20 54 68 65 20 63 61 6C 6C 65 72 20 70 61    e. The caller pa
0196B0:  73 73 65 73 20 74 68 65 20 63 6F 6D 6D 61 6E 64    sses the command
0196C0:  20 6E 61 6D 65 20 74 6F 20 4B 4C 0D 0A 20 20 20     name to KL..   
0196D0:  20 20 20 20 46 49 4E 44 20 43 4F 4D 4D 41 4E 44        FIND COMMAND
0196E0:  20 20 61 6E 64 20 20 66 61 72 20 20 63 61 6C 6C      and  far  call
0196F0:  73 20 20 74 68 65 20 20 72 65 73 75 6C 74 69 6E    s  the  resultin
019700:  67 20 20 72 6F 75 74 69 6E 65 2E 20 20 4D 6F 72    g  routine.  Mor
019710:  65 20 20 63 6F 6D 70 6C 65 78 0D 0A 20 20 20 20    e  complex..    
019720:  20 20 20 64 65 73 63 72 69 70 74 69 6F 6E 73 20       descriptions 
019730:  6F 66 20 74 68 65 73 65 20 63 6F 6D 6D 61 6E 64    of these command
019740:  73 20 63 61 6E 20 62 65 20 66 6F 75 6E 64 20 69    s can be found i
019750:  6E 20 73 65 63 74 69 6F 6E 73 20 31 39 20 61 6E    n sections 19 an
019760:  64 20 32 30 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    d 20.....       
019770:  31 34 2E 31 20 54 68 65 20 4D 61 69 6E 20 4A 75    14.1 The Main Ju
019780:  6D 70 62 6C 6F 63 6B 2E 0D 0A 20 20 20 20 20 20    mpblock...      
019790:  20 54 68 65 20 6D 61 69 6E 20 66 69 72 6D 77 61     The main firmwa
0197A0:  72 65 20 6A 75 6D 70 62 6C 6F 63 6B 20 6C 69 65    re jumpblock lie
0197B0:  73 20 69 6E 20 52 41 4D 20 62 65 74 77 65 65 6E    s in RAM between
0197C0:  20 20 61 64 64 72 65 73 73 65 73 20 20 23 42 42      addresses  #BB
0197D0:  30 30 20 20 61 6E 64 0D 0A 20 20 20 20 20 20 20    00  and..       
0197E0:  23 42 44 35 44 2E 20 45 61 63 68 20 65 6E 74 72    #BD5D. Each entr
0197F0:  79 20 20 69 6E 20 20 74 68 65 20 20 6A 75 6D 70    y  in  the  jump
019800:  62 6C 6F 63 6B 20 20 6F 63 63 75 70 69 65 73 20    block  occupies 
019810:  20 74 68 72 65 65 20 20 62 79 74 65 73 20 20 61     three  bytes  a
019820:  6E 64 20 20 69 73 0D 0A 20 20 20 20 20 20 20 69    nd  is..       i
019830:  6E 69 74 69 61 6C 69 7A 65 64 20 74 6F 20 75 73    nitialized to us
019840:  65 20 4C 4F 57 20 4A 55 4D 50 20 72 65 73 74 61    e LOW JUMP resta
019850:  72 74 73 20 28 52 53 54 20 31 29 20 74 68 61 74    rts (RST 1) that
019860:  20 63 61 75 73 65 20 74 68 65 20 6C 6F 77 65 72     cause the lower
019870:  20 20 52 4F 4D 0D 0A 20 20 20 20 20 20 20 74 6F      ROM..       to
019880:  20 62 65 20 65 6E 61 62 6C 65 64 2C 20 73 6F 20     be enabled, so 
019890:  74 68 61 74 20 74 68 65 20 66 69 72 6D 77 61 72    that the firmwar
0198A0:  65 20 72 6F 75 74 69 6E 65 73 20 63 61 6E 20 62    e routines can b
0198B0:  65 20 72 75 6E 2C 20 61 6E 64 20 74 68 65 20 75    e run, and the u
0198C0:  70 70 65 72 0D 0A 20 20 20 20 20 20 20 52 4F 4D    pper..       ROM
0198D0:  20 74 6F 20 62 65 20 64 69 73 61 62 6C 65 64 2C     to be disabled,
0198E0:  20 73 6F 20 74 68 61 74 20 74 68 65 20 73 63 72     so that the scr
0198F0:  65 65 6E 20 6D 65 6D 6F 72 79 20 69 73 20 61 63    een memory is ac
019900:  63 65 73 73 69 62 6C 65 20 77 68 69 6C 65 20 20    cessible while  
019910:  74 68 65 0D 0A 20 20 20 20 20 20 20 66 69 72 6D    the..       firm
019920:  77 61 72 65 20 69 73 20 72 75 6E 6E 69 6E 67 2E    ware is running.
019930:  20 46 75 6C 6C 20 64 65 73 63 72 69 70 74 69 6F     Full descriptio
019940:  6E 73 20 6F 66 20 74 68 65 73 65 20 72 6F 75 74    ns of these rout
019950:  69 6E 65 73 20 63 61 6E 20 62 65 20 20 66 6F 75    ines can be  fou
019960:  6E 64 0D 0A 20 20 20 20 20 20 20 69 6E 20 73 65    nd..       in se
019970:  63 74 69 6F 6E 20 31 35 2E 0D 0A 20 20 20 20 20    ction 15...     
019980:  20 20 41 66 74 65 72 20 74 68 65 20 6A 75 6D 70      After the jump
019990:  62 6C 6F 63 6B 20 68 61 73 20 62 65 65 6E 20 73    block has been s
0199A0:  65 74 20 75 70 20 20 61 74 20 20 45 4D 53 20 20    et up  at  EMS  
0199B0:  69 74 20 20 69 73 20 20 70 61 74 63 68 65 64 20    it  is  patched 
0199C0:  20 62 79 20 20 74 68 65 0D 0A 20 20 20 20 20 20     by  the..      
0199D0:  20 69 6E 69 74 69 61 6C 69 7A 61 74 69 6F 6E 20     initialization 
0199E0:  6F 66 20 74 68 65 20 41 4D 53 44 4F 53 20 52 4F    of the AMSDOS RO
0199F0:  4D 20 74 6F 20 20 69 6E 73 74 61 6C 6C 20 20 74    M to  install  t
019A00:  68 65 20 20 64 69 73 63 20 20 28 72 61 74 68 65    he  disc  (rathe
019A10:  72 20 20 74 68 61 6E 0D 0A 20 20 20 20 20 20 20    r  than..       
019A20:  63 61 73 73 65 74 74 65 29 20 61 73 20 64 65 66    cassette) as def
019A30:  61 75 6C 74 20 62 75 74 20 69 73 20 6E 6F 74 20    ault but is not 
019A40:  20 6F 74 68 65 72 77 69 73 65 20 20 61 6C 74 65     otherwise  alte
019A50:  72 65 64 20 20 62 79 20 20 74 68 65 20 20 66 69    red  by  the  fi
019A60:  72 6D 77 61 72 65 0D 0A 20 20 20 20 20 20 20 75    rmware..       u
019A70:  6E 74 69 6C 20 74 68 65 20 73 79 73 74 65 6D 20    ntil the system 
019A80:  69 73 20 72 65 69 6E 69 74 69 61 6C 69 7A 65 64    is reinitialized
019A90:  2E 20 49 66 20 61 6E 79 20 65 6E 74 72 69 65 73    . If any entries
019AA0:  20 61 72 65 20 63 68 61 6E 67 65 64 20 74 68 65     are changed the
019AB0:  6E 20 20 69 74 0D 0A 20 20 20 20 20 20 20 69 73    n  it..       is
019AC0:  20 74 68 65 20 75 73 65 72 27 73 20 72 65 73 70     the user's resp
019AD0:  6F 6E 73 69 62 69 6C 69 74 79 20 74 6F 20 75 6E    onsibility to un
019AE0:  64 6F 20 20 74 68 65 20 20 61 6C 74 65 72 61 74    do  the  alterat
019AF0:  69 6F 6E 73 2E 20 20 54 68 69 73 20 20 63 61 6E    ions.  This  can
019B00:  20 20 62 65 0D 0A 20 20 20 20 20 20 20 61 63 68      be..       ach
019B10:  69 65 76 65 64 20 62 79 20 63 61 6C 6C 69 6E 67    ieved by calling
019B20:  20 4A 55 4D 50 20 20 52 45 53 54 4F 52 45 20 20     JUMP  RESTORE  
019B30:  77 68 69 63 68 20 20 63 6F 6D 70 6C 65 74 65 6C    which  completel
019B40:  79 20 20 69 6E 69 74 69 61 6C 69 7A 65 73 20 20    y  initializes  
019B50:  74 68 65 0D 0A 20 20 20 20 20 20 20 6A 75 6D 70    the..       jump
019B60:  62 6C 6F 63 6B 20 62 75 74 20 74 68 69 73 20 77    block but this w
019B70:  69 6C 6C 20 6C 6F 73 65 20 61 6E 79 20 6F 74 68    ill lose any oth
019B80:  65 72 20 70 61 74 63 68 65 73 2C 20 73 75 63 68    er patches, such
019B90:  20 61 73 20 74 68 6F 73 65 20 6D 61 64 65 20 20     as those made  
019BA0:  62 79 0D 0A 20 20 20 20 20 20 20 41 4D 53 44 4F    by..       AMSDO
019BB0:  53 2E 20 49 74 20 69 73 20 62 65 74 74 65 72 20    S. It is better 
019BC0:  74 6F 20 63 6F 70 79 20 74 68 65 20 20 6F 72 69    to copy the  ori
019BD0:  67 69 6E 61 6C 20 20 63 6F 6E 74 65 6E 74 73 20    ginal  contents 
019BE0:  20 6F 66 20 20 74 68 65 20 20 63 68 61 6E 67 65     of  the  change
019BF0:  64 0D 0A 20 20 20 20 20 20 20 65 6E 74 72 69 65    d..       entrie
019C00:  73 20 62 61 63 6B 2E 0D 0A 20 20 20 20 20 20 20    s back...       
019C10:  31 34 2E 31 2E 31 20 45 6E 74 72 69 65 73 20 74    14.1.1 Entries t
019C20:  6F 20 74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65    o the Key Manage
019C30:  72 2E 0D 0A 20 20 20 20 20 20 20 54 68 65 20 4B    r...       The K
019C40:  65 79 20 4D 61 6E 61 67 65 72 20 64 65 61 6C 73    ey Manager deals
019C50:  20 77 69 74 68 20 74 68 65 20 6B 65 79 62 6F 61     with the keyboa
019C60:  72 64 20 61 6E 64 20 74 68 65 20 6A 6F 79 73 74    rd and the joyst
019C70:  69 63 6B 73 2E 0D 0A 20 20 20 20 20 20 20 49 4E    icks...       IN
019C80:  49 54 49 41 4C 49 5A 41 54 49 4F 4E 0D 0A 20 20    ITIALIZATION..  
019C90:  20 20 20 20 20 30 20 20 20 20 23 42 42 30 30 20         0    #BB00 
019CA0:  20 4B 4D 20 49 4E 49 54 49 41 4C 49 5A 45 20 20     KM INITIALIZE  
019CB0:  20 20 20 20 20 49 6E 69 74 69 61 6C 69 7A 65 20         Initialize 
019CC0:  74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65 72 2E    the Key Manager.
019CD0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
019CE0:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
019CF0:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
019D00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019D10:  20 20 20 20 20 20 20 20 70 61 67 65 20 31 34 2E            page 14.
019D20:  31 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    1.............. 
019D30:  20 20 20 20 20 20 31 20 20 20 20 23 42 42 30 33          1    #BB03
019D40:  20 20 4B 4D 20 52 45 53 45 54 20 20 20 20 20 20      KM RESET      
019D50:  20 20 20 20 20 20 52 65 73 65 74 20 74 68 65 20          Reset the 
019D60:  20 4B 65 79 20 20 4D 61 6E 61 67 65 72 20 20 2D     Key  Manager  -
019D70:  20 20 63 6C 65 61 72 20 20 61 6C 6C 0D 0A 20 20      clear  all..  
019D80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019D90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019DA0:  20 20 20 20 20 62 75 66 66 65 72 73 2C 20 20 20         buffers,   
019DB0:  20 72 65 73 74 6F 72 65 20 20 20 20 73 74 61 6E     restore    stan
019DC0:  64 61 72 64 20 20 20 20 6B 65 79 0D 0A 20 20 20    dard    key..   
019DD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019DE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019DF0:  20 20 20 20 65 78 70 61 6E 73 69 6F 6E 73 20 61        expansions a
019E00:  6E 64 20 69 6E 64 69 72 65 63 74 69 6F 6E 73 2E    nd indirections.
019E10:  0D 0A 20 20 20 20 20 20 20 43 48 41 52 41 43 54    ..       CHARACT
019E20:  45 52 53 0D 0A 0D 0A 20 20 20 20 20 20 20 32 20    ERS....       2 
019E30:  20 20 20 23 42 42 30 36 20 20 4B 4D 20 57 41 49       #BB06  KM WAI
019E40:  54 20 43 48 41 52 20 20 20 20 20 20 20 20 57 61    T CHAR        Wa
019E50:  69 74 20 66 6F 72 20 74 68 65 20 6E 65 78 74 20    it for the next 
019E60:  63 68 61 72 61 63 74 65 72 20 20 66 72 6F 6D 20    character  from 
019E70:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20     the..          
019E80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019E90:  20 20 20 20 20 20 20 20 20 20 20 20 20 6B 65 79                 key
019EA0:  62 6F 61 72 64 2E 0D 0A 20 20 20 20 20 20 20 33    board...       3
019EB0:  20 20 20 20 23 42 42 30 39 20 20 4B 4D 20 52 45        #BB09  KM RE
019EC0:  41 44 20 43 48 41 52 20 20 20 20 20 20 20 20 54    AD CHAR        T
019ED0:  65 73 74 20 69 66 20 61 20 63 68 61 72 61 63 74    est if a charact
019EE0:  65 72 20 69 73 20 61 76 61 69 6C 61 62 6C 65 20    er is available 
019EF0:  20 66 72 6F 6D 0D 0A 20 20 20 20 20 20 20 20 20     from..         
019F00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019F10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68                  th
019F20:  65 20 6B 65 79 62 6F 61 72 64 2E 0D 0A 20 20 20    e keyboard...   
019F30:  20 20 20 20 34 20 20 20 20 23 42 42 30 43 20 20        4    #BB0C  
019F40:  4B 4D 20 43 48 41 52 20 52 45 54 55 52 4E 20 20    KM CHAR RETURN  
019F50:  20 20 20 20 52 65 74 75 72 6E 20 20 61 20 20 73        Return  a  s
019F60:  69 6E 67 6C 65 20 20 63 68 61 72 61 63 74 65 72    ingle  character
019F70:  20 20 74 6F 20 20 20 74 68 65 0D 0A 20 20 20 20      to   the..    
019F80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019F90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
019FA0:  20 20 20 6B 65 79 62 6F 61 72 64 20 66 6F 72 20       keyboard for 
019FB0:  6E 65 78 74 20 74 69 6D 65 2E 0D 0A 20 20 20 20    next time...    
019FC0:  20 20 20 31 39 31 20 20 23 42 44 33 44 20 20 4B       191  #BD3D  K
019FD0:  4D 20 46 4C 55 53 48 20 20 20 20 20 20 20 20 20    M FLUSH         
019FE0:  20 20 20 44 69 73 63 61 72 64 20 20 61 6C 6C 20       Discard  all 
019FF0:  20 70 65 6E 64 69 6E 67 20 20 63 68 61 72 61 63     pending  charac
01A000:  74 65 72 73 20 20 61 6E 64 0D 0A 20 20 20 20 20    ters  and..     
01A010:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A020:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A030:  20 20 6B 65 79 73 2E 0D 0A 20 20 20 20 20 20 20      keys...       
01A040:  35 20 20 20 20 23 42 42 30 46 20 20 4B 4D 20 53    5    #BB0F  KM S
01A050:  45 54 20 45 58 50 41 4E 44 20 20 20 20 20 20 20    ET EXPAND       
01A060:  53 65 74 20 61 6E 20 65 78 70 61 6E 73 69 6F 6E    Set an expansion
01A070:  20 73 74 72 69 6E 67 2E 0D 0A 20 20 20 20 20 20     string...      
01A080:  20 36 20 20 20 20 23 42 42 31 32 20 20 4B 4D 20     6    #BB12  KM 
01A090:  47 45 54 20 45 58 50 41 4E 44 20 20 20 20 20 20    GET EXPAND      
01A0A0:  20 47 65 74 20 20 61 20 20 63 68 61 72 61 63 74     Get  a  charact
01A0B0:  65 72 20 20 66 72 6F 6D 20 20 61 6E 20 20 65 78    er  from  an  ex
01A0C0:  70 61 6E 73 69 6F 6E 0D 0A 20 20 20 20 20 20 20    pansion..       
01A0D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A0E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A0F0:  73 74 72 69 6E 67 2E 0D 0A 20 20 20 20 20 20 20    string...       
01A100:  37 20 20 20 20 23 42 42 31 35 20 20 4B 4D 20 45    7    #BB15  KM E
01A110:  58 50 20 42 55 46 46 45 52 20 20 20 20 20 20 20    XP BUFFER       
01A120:  41 6C 6C 6F 63 61 74 65 20 20 61 20 20 20 62 75    Allocate  a   bu
01A130:  66 66 65 72 20 20 20 66 6F 72 20 20 20 65 78 70    ffer   for   exp
01A140:  61 6E 73 69 6F 6E 0D 0A 20 20 20 20 20 20 20 20    ansion..        
01A150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A160:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73                   s
01A170:  74 72 69 6E 67 73 2E 0D 0A 0D 0A 20 20 20 20 20    trings.....     
01A180:  20 20 4B 45 59 53 0D 0A 0D 0A 0D 0A 20 20 20 20      KEYS......    
01A190:  20 20 20 38 20 20 20 20 23 42 42 31 38 20 20 4B       8    #BB18  K
01A1A0:  4D 20 57 41 49 54 20 4B 45 59 20 20 20 20 20 20    M WAIT KEY      
01A1B0:  20 20 20 57 61 69 74 20 20 66 6F 72 20 20 74 68       Wait  for  th
01A1C0:  65 20 20 6E 65 78 74 20 20 6B 65 79 20 20 20 66    e  next  key   f
01A1D0:  72 6F 6D 20 20 20 74 68 65 0D 0A 20 20 20 20 20    rom   the..     
01A1E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A1F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A200:  20 20 6B 65 79 62 6F 61 72 64 2E 0D 0A 0D 0A 20      keyboard..... 
01A210:  20 20 20 20 20 20 39 20 20 20 20 23 42 42 31 42          9    #BB1B
01A220:  20 20 4B 4D 20 52 45 41 44 20 4B 45 59 20 20 20      KM READ KEY   
01A230:  20 20 20 20 20 20 54 65 73 74 20 6F 66 20 61 20          Test of a 
01A240:  6B 65 79 20 69 73 20 20 61 76 61 69 6C 61 62 6C    key is  availabl
01A250:  65 20 20 66 72 6F 6D 20 20 74 68 65 0D 0A 20 20    e  from  the..  
01A260:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A270:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A280:  20 20 20 20 20 6B 65 79 62 6F 61 72 64 2E 0D 0A         keyboard...
01A290:  0D 0A 20 20 20 20 20 20 20 31 30 20 20 20 23 42    ..       10   #B
01A2A0:  42 31 45 20 20 4B 4D 20 54 45 53 54 20 4B 45 59    B1E  KM TEST KEY
01A2B0:  20 20 20 20 20 20 20 20 20 54 65 73 74 20 69 66             Test if
01A2C0:  20 61 20 6B 65 79 20 69 73 20 70 72 65 73 73 65     a key is presse
01A2D0:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 39 30    d.....       190
01A2E0:  20 20 23 42 44 33 41 20 20 4B 4D 20 53 45 54 20      #BD3A  KM SET 
01A2F0:  4C 4F 43 4B 53 20 20 20 20 20 20 20 20 53 65 74    LOCKS        Set
01A300:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
01A310:  16 00 00 00 02 09 50 E5 16 00 C1 02 00 00 00 02    ......P.........
01A320:  16 00 C2 02 00 00 00 02 16 00 C3 02 00 00 00 02    ................
01A330:  16 00 C4 02 00 00 00 02 16 00 C5 02 00 00 00 02    ................
01A340:  16 00 C6 02 00 00 00 02 16 00 C7 02 00 00 00 02    ................
01A350:  16 00 C8 02 00 00 00 02 16 00 C9 02 00 00 00 02    ................
01A360:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A370:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A380:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A390:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A3F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01A400:  20 20 74 68 65 20 20 53 68 69 66 74 20 20 4C 6F      the  Shift  Lo
01A410:  63 6B 20 20 61 6E 64 20 20 43 61 70 73 20 20 4C    ck  and  Caps  L
01A420:  6F 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ock..           
01A430:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A440:  20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74                stat
01A450:  65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 31    es.....       11
01A460:  20 20 20 23 42 42 32 31 20 20 4B 4D 20 47 45 54       #BB21  KM GET
01A470:  20 53 54 41 54 45 20 20 20 20 20 20 20 20 46 65     STATE        Fe
01A480:  74 63 68 20 43 61 70 73 20 4C 6F 63 6B 20 61 6E    tch Caps Lock an
01A490:  64 20 53 68 69 66 74 20 4C 6F 63 6B 20 73 74 61    d Shift Lock sta
01A4A0:  74 65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    tes.....       1
01A4B0:  32 20 20 20 23 42 42 32 34 20 20 4B 4D 20 47 45    2   #BB24  KM GE
01A4C0:  54 20 4A 4F 59 53 54 49 43 4B 20 20 20 20 20 46    T JOYSTICK     F
01A4D0:  65 74 63 68 20 20 20 20 63 75 72 72 65 6E 74 20    etch    current 
01A4E0:  20 20 20 73 74 61 74 65 20 20 20 20 6F 66 20 20       state    of  
01A4F0:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20      the..         
01A500:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A510:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 6A 6F                  jo
01A520:  79 73 74 69 63 6B 28 73 29 2E 0D 0A 0D 0A 20 20    ystick(s).....  
01A530:  20 20 20 20 20 54 52 41 4E 53 4C 41 54 49 4F 4E         TRANSLATION
01A540:  20 54 41 42 4C 45 53 0D 0A 0D 0A 0D 0A 20 20 20     TABLES......   
01A550:  20 20 20 20 31 33 20 20 20 23 42 42 32 37 20 20        13   #BB27  
01A560:  4B 4D 20 53 45 54 20 54 52 41 4E 53 4C 41 54 45    KM SET TRANSLATE
01A570:  20 20 20 20 53 65 74 20 65 6E 74 72 79 20 20 69        Set entry  i
01A580:  6E 20 20 6B 65 79 20 20 74 72 61 6E 73 6C 61 74    n  key  translat
01A590:  69 6F 6E 20 20 74 61 62 6C 65 0D 0A 20 20 20 20    ion  table..    
01A5A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A5B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A5C0:  20 20 20 77 69 74 68 6F 75 74 20 73 68 69 66 74       without shift
01A5D0:  20 6F 72 20 63 6F 6E 74 72 6F 6C 2E 0D 0A 0D 0A     or control.....
01A5E0:  20 20 20 20 20 20 20 31 34 20 20 20 23 42 42 32           14   #BB2
01A5F0:  41 20 20 4B 4D 20 47 45 54 20 54 52 41 4E 53 4C    A  KM GET TRANSL
01A600:  41 54 45 20 20 20 20 47 65 74 20 65 6E 74 72 79    ATE    Get entry
01A610:  20 66 72 6F 6D 20 6B 65 79 20 20 74 72 61 6E 73     from key  trans
01A620:  6C 61 74 69 6F 6E 20 20 74 61 62 6C 65 0D 0A 20    lation  table.. 
01A630:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A640:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A650:  20 20 20 20 20 20 77 69 74 68 6F 75 74 20 73 68          without sh
01A660:  69 66 74 20 6F 72 20 63 6F 6E 74 72 6F 6C 2E 0D    ift or control..
01A670:  0A 0D 0A 20 20 20 20 20 20 20 31 35 20 20 20 23    ...       15   #
01A680:  42 42 32 44 20 20 4B 4D 20 53 45 54 20 53 48 49    BB2D  KM SET SHI
01A690:  46 54 20 20 20 20 20 20 20 20 53 65 74 20 65 6E    FT        Set en
01A6A0:  74 72 79 20 20 69 6E 20 20 6B 65 79 20 20 74 72    try  in  key  tr
01A6B0:  61 6E 73 6C 61 74 69 6F 6E 20 20 74 61 62 6C 65    anslation  table
01A6C0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
01A6D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A6E0:  20 20 20 20 20 20 20 20 20 77 68 65 6E 20 73 68             when sh
01A6F0:  69 66 74 20 6B 65 79 20 69 73 20 70 72 65 73 73    ift key is press
01A700:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36    ed.....       16
01A710:  20 20 20 23 42 42 33 30 20 20 4B 4D 20 47 45 54       #BB30  KM GET
01A720:  20 53 48 49 46 54 20 20 20 20 20 20 20 20 47 65     SHIFT        Ge
01A730:  74 20 65 6E 74 72 79 20 66 72 6F 6D 20 6B 65 79    t entry from key
01A740:  20 20 74 72 61 6E 73 6C 61 74 69 6F 6E 20 20 74      translation  t
01A750:  61 62 6C 65 0D 0A 20 20 20 20 20 20 20 20 20 20    able..          
01A760:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A770:  20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 65                 whe
01A780:  6E 20 73 68 69 66 74 20 6B 65 79 20 69 73 20 70    n shift key is p
01A790:  72 65 73 73 65 64 2E 0D 0A 0D 0A 20 20 20 20 20    ressed.....     
01A7A0:  20 20 31 37 20 20 20 23 42 42 33 33 20 20 4B 4D      17   #BB33  KM
01A7B0:  20 53 45 54 20 43 4F 4E 54 52 4F 4C 20 20 20 20     SET CONTROL    
01A7C0:  20 20 53 65 74 20 65 6E 74 72 79 20 20 69 6E 20      Set entry  in 
01A7D0:  20 6B 65 79 20 20 74 72 61 6E 73 6C 61 74 69 6F     key  translatio
01A7E0:  6E 20 20 74 61 62 6C 65 0D 0A 20 20 20 20 20 20    n  table..      
01A7F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A800:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A810:  20 77 68 65 6E 20 63 6F 6E 74 72 6F 6C 20 6B 65     when control ke
01A820:  79 20 69 73 20 70 72 65 73 73 65 64 2E 0D 0A 0D    y is pressed....
01A830:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    .......       AM
01A840:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
01A850:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
01A860:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A870:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
01A880:  31 34 2E 32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    14.2............
01A890:  0D 0A 20 20 20 20 20 20 20 31 38 20 20 20 23 42    ..       18   #B
01A8A0:  42 33 36 20 20 4B 4D 20 47 45 54 20 43 4F 4E 54    B36  KM GET CONT
01A8B0:  52 4F 4C 20 20 20 20 20 20 47 65 74 20 65 6E 74    ROL      Get ent
01A8C0:  72 79 20 66 6F 72 6D 20 6B 65 79 20 20 74 72 61    ry form key  tra
01A8D0:  6E 73 6C 61 74 69 6F 6E 20 20 74 61 62 6C 65 0D    nslation  table.
01A8E0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01A8F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01A900:  20 20 20 20 20 20 20 20 77 68 65 6E 20 63 6F 6E            when con
01A910:  74 72 6F 6C 20 6B 65 79 20 69 73 20 70 72 65 73    trol key is pres
01A920:  73 65 64 2E 0D 0A 20 20 20 20 20 20 20 52 45 50    sed...       REP
01A930:  45 41 54 49 4E 47 0D 0A 0D 0A 0D 0A 20 20 20 20    EATING......    
01A940:  20 20 20 31 39 20 20 20 23 42 42 33 39 20 20 4B       19   #BB39  K
01A950:  4D 20 53 45 54 20 52 45 50 45 41 54 20 20 20 20    M SET REPEAT    
01A960:  20 20 20 53 65 74 20 77 68 65 74 68 65 72 20 61       Set whether a
01A970:  20 6B 65 79 20 6D 61 79 20 72 65 70 65 61 74 2E     key may repeat.
01A980:  0D 0A 0D 0A 20 20 20 20 20 20 20 32 30 20 20 20    ....       20   
01A990:  23 42 42 33 43 20 20 4B 4D 20 47 45 54 20 52 45    #BB3C  KM GET RE
01A9A0:  50 45 41 54 20 20 20 20 20 20 20 41 73 6B 20 69    PEAT       Ask i
01A9B0:  66 20 61 20 6B 65 79 20 69 73 20 61 6C 6C 6F 77    f a key is allow
01A9C0:  65 64 20 74 6F 20 72 65 70 65 61 74 2E 0D 0A 0D    ed to repeat....
01A9D0:  0A 20 20 20 20 20 20 20 32 31 20 20 20 23 42 42    .       21   #BB
01A9E0:  33 46 20 20 4B 4D 20 53 45 54 20 44 45 4C 41 59    3F  KM SET DELAY
01A9F0:  20 20 20 20 20 20 20 20 53 65 74 20 73 74 61 72            Set star
01AA00:  74 20 75 70 20 64 65 6C 61 79 20 61 6E 64 20 72    t up delay and r
01AA10:  65 70 65 61 74 20 73 70 65 65 64 2E 0D 0A 0D 0A    epeat speed.....
01AA20:  20 20 20 20 20 20 20 32 32 20 20 20 23 42 42 34           22   #BB4
01AA30:  32 20 20 4B 4D 20 47 45 54 20 44 45 4C 41 59 20    2  KM GET DELAY 
01AA40:  20 20 20 20 20 20 20 47 65 74 20 73 74 61 72 74           Get start
01AA50:  20 75 70 20 64 65 6C 61 79 20 61 6E 64 20 72 65     up delay and re
01AA60:  70 65 61 74 20 73 70 65 65 64 2E 0D 0A 0D 0A 0D    peat speed......
01AA70:  0A 0D 0A 20 20 20 20 20 20 20 42 52 45 41 4B 53    ...       BREAKS
01AA80:  0D 0A 0D 0A 20 20 20 20 20 20 20 32 33 20 20 20    ....       23   
01AA90:  23 42 42 34 35 20 20 4B 4D 20 41 52 4D 20 42 52    #BB45  KM ARM BR
01AAA0:  45 41 4B 20 20 20 20 20 20 20 20 41 6C 6C 6F 77    EAK        Allow
01AAB0:  20 62 72 65 61 6B 20 65 76 65 6E 74 73 20 74 6F     break events to
01AAC0:  20 62 65 20 67 65 6E 65 72 61 74 65 64 2E 0D 0A     be generated...
01AAD0:  0D 0A 20 20 20 20 20 20 20 32 34 20 20 20 23 42    ..       24   #B
01AAE0:  42 34 38 20 20 4B 4D 20 44 49 53 41 52 4D 20 42    B48  KM DISARM B
01AAF0:  52 45 41 4B 20 20 20 20 20 50 72 65 76 65 6E 74    REAK     Prevent
01AB00:  20 20 20 62 72 65 61 6B 20 20 20 65 76 65 6E 74       break   event
01AB10:  20 20 20 66 72 6F 6D 20 20 20 62 65 69 6E 67 0D       from   being.
01AB20:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01AB30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01AB40:  20 20 20 20 20 20 20 20 67 65 6E 65 72 61 74 65            generate
01AB50:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 32 35 20    d.....       25 
01AB60:  20 20 23 42 42 34 42 20 20 4B 4D 20 42 52 45 41      #BB4B  KM BREA
01AB70:  4B 20 45 56 45 4E 54 20 20 20 20 20 20 47 65 6E    K EVENT      Gen
01AB80:  65 72 61 74 65 20 61 20 62 72 65 61 6B 20 65 76    erate a break ev
01AB90:  65 6E 74 20 28 69 66 20 61 72 6D 65 64 29 2E 0D    ent (if armed)..
01ABA0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 34 2E 31    .....       14.1
01ABB0:  2E 32 20 45 6E 74 72 69 65 73 20 74 6F 20 74 68    .2 Entries to th
01ABC0:  65 20 54 65 78 74 20 56 44 55 2E 0D 0A 0D 0A 0D    e Text VDU......
01ABD0:  0A 20 20 20 20 20 20 20 54 68 65 20 54 65 78 74    .       The Text
01ABE0:  20 56 44 55 20 69 73 20 61 20 63 68 61 72 61 63     VDU is a charac
01ABF0:  74 65 72 20 62 61 73 65 64 20 73 63 72 65 65 6E    ter based screen
01AC00:  20 64 72 69 76 65 72 2E 0D 0A 0D 0A 0D 0A 20 20     driver.......  
01AC10:  20 20 20 20 20 49 4E 49 54 49 41 4C 49 5A 41 54         INITIALIZAT
01AC20:  49 4F 4E 0D 0A 0D 0A 20 20 20 20 20 20 20 32 36    ION....       26
01AC30:  20 20 20 23 42 42 34 45 20 20 54 58 54 20 49 4E       #BB4E  TXT IN
01AC40:  49 54 49 41 4C 49 53 45 20 20 20 20 20 20 49 6E    ITIALISE      In
01AC50:  69 74 69 61 6C 69 7A 65 20 74 68 65 20 54 65 78    itialize the Tex
01AC60:  74 20 56 44 55 2E 0D 0A 0D 0A 20 20 20 20 20 20    t VDU.....      
01AC70:  20 32 37 20 20 20 23 42 42 35 31 20 20 54 58 54     27   #BB51  TXT
01AC80:  20 52 45 53 45 54 20 20 20 20 20 20 20 20 20 20     RESET          
01AC90:  20 52 65 73 65 74 20 74 68 65 20 54 65 78 74 20     Reset the Text 
01ACA0:  56 44 55 20 2D 20 20 72 65 73 74 6F 72 65 20 20    VDU -  restore  
01ACB0:  64 65 66 61 75 6C 74 0D 0A 20 20 20 20 20 20 20    default..       
01ACC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01ACD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01ACE0:  69 6E 64 69 72 65 63 74 69 6F 6E 73 20 20 20 20    indirections    
01ACF0:  61 6E 64 20 20 20 20 63 6F 6E 74 72 6F 6C 20 20    and    control  
01AD00:  20 20 63 6F 64 65 0D 0A 20 20 20 20 20 20 20 20      code..        
01AD10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01AD20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66                   f
01AD30:  75 6E 63 74 69 6F 6E 73 2E 0D 0A 0D 0A 20 20 20    unctions.....   
01AD40:  20 20 20 20 32 38 20 20 20 23 42 42 35 34 20 20        28   #BB54  
01AD50:  54 58 54 20 56 44 55 20 45 4E 41 42 4C 45 20 20    TXT VDU ENABLE  
01AD60:  20 20 20 20 41 6C 6C 6F 77 20 63 68 61 72 61 63        Allow charac
01AD70:  74 65 72 73 20 74 6F 20 62 65 20 70 6C 61 63 65    ters to be place
01AD80:  64 20 20 6F 6E 20 20 74 68 65 0D 0A 20 20 20 20    d  on  the..    
01AD90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01ADA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01ADB0:  20 20 20 73 63 72 65 65 6E 2E 0D 0A 0D 0A 20 20       screen.....  
01ADC0:  20 20 20 20 20 32 39 20 20 20 23 42 42 35 37 20         29   #BB57 
01ADD0:  20 54 58 54 20 56 44 55 20 44 49 53 41 42 4C 45     TXT VDU DISABLE
01ADE0:  20 20 20 20 20 50 72 65 76 65 6E 74 20 63 68 61         Prevent cha
01ADF0:  72 61 63 74 65 72 73 20 66 72 6F 6D 20 20 62 65    racters from  be
01AE00:  69 6E 67 20 20 70 6C 61 63 65 64 0D 0A 20 20 20    ing  placed..   
01AE10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01AE20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01AE30:  20 20 20 20 6F 6E 20 74 68 65 20 73 63 72 65 65        on the scree
01AE40:  6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 39 32    n.....       192
01AE50:  20 20 23 42 44 34 30 20 20 54 58 54 20 41 53 4B      #BD40  TXT ASK
01AE60:  20 53 54 41 54 45 20 20 20 20 20 20 20 47 65 74     STATE       Get
01AE70:  20 73 74 61 74 65 20 6F 66 20 74 68 65 20 74 65     state of the te
01AE80:  78 74 20 56 44 55 2E 0D 0A 0D 0A 0D 0A 20 20 20    xt VDU.......   
01AE90:  20 20 20 20 43 48 41 52 41 43 54 45 52 53 0D 0A        CHARACTERS..
01AEA0:  0D 0A 20 20 20 20 20 20 20 33 30 20 20 23 42 42    ..       30  #BB
01AEB0:  35 41 20 20 54 58 54 20 20 4F 55 54 50 55 54 20    5A  TXT  OUTPUT 
01AEC0:  20 20 20 20 20 20 20 20 20 4F 75 74 70 75 74 20             Output 
01AED0:  61 20 63 68 61 72 61 63 74 65 72 20 6F 72 20 20    a character or  
01AEE0:  63 6F 6E 74 72 6F 6C 20 63 6F 64 65 20 74 6F 0D    control code to.
01AEF0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01AF00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01AF10:  20 20 20 20 20 20 20 20 74 68 65 20 54 65 78 74            the Text
01AF20:  20 56 44 55 2E 0D 0A 0D 0A 20 20 20 20 20 20 20     VDU.....       
01AF30:  33 31 20 20 20 23 42 42 35 44 20 20 54 58 54 20    31   #BB5D  TXT 
01AF40:  57 52 20 43 48 41 52 20 20 20 20 20 20 20 20 20    WR CHAR         
01AF50:  57 72 69 74 65 20 61 20 63 68 61 72 61 63 74 65    Write a characte
01AF60:  72 20 6F 6E 74 6F 20 74 68 65 20 73 63 72 65 65    r onto the scree
01AF70:  6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 33 32 20    n.....       32 
01AF80:  20 20 23 42 42 36 30 20 20 54 58 54 20 52 44 20      #BB60  TXT RD 
01AF90:  43 48 41 52 20 20 20 20 20 20 20 20 20 52 65 61    CHAR         Rea
01AFA0:  64 20 61 20 63 68 61 72 61 63 74 65 72 20 66 72    d a character fr
01AFB0:  6F 6D 20 74 68 65 20 73 63 72 65 65 6E 2E 0D 0A    om the screen...
01AFC0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
01AFD0:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
01AFE0:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
01AFF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B000:  20 20 20 20 20 20 20 20 20 20 70 61 67 65 20 31              page 1
01B010:  34 2E 33 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    4.3.............
01B020:  0A 20 20 20 20 20 20 20 33 33 20 20 20 23 42 42    .       33   #BB
01B030:  36 33 20 20 54 58 54 20 53 45 54 20 47 52 41 50    63  TXT SET GRAP
01B040:  48 49 43 20 20 20 20 20 54 75 72 6E 20 20 6F 6E    HIC     Turn  on
01B050:  20 20 6F 72 20 20 6F 66 66 20 20 74 68 65 20 20      or  off  the  
01B060:  47 72 61 70 68 69 63 73 20 20 20 56 44 55 0D 0A    Graphics   VDU..
01B070:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B080:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B090:  20 20 20 20 20 20 20 63 68 61 72 61 63 74 65 72           character
01B0A0:  20 77 72 69 74 69 6E 67 20 6F 70 74 69 6F 6E 2E     writing option.
01B0B0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57 49 4E    ......       WIN
01B0C0:  44 4F 57 53 0D 0A 0D 0A 20 20 20 20 20 20 20 33    DOWS....       3
01B0D0:  34 20 20 20 23 42 42 36 36 20 20 54 58 54 20 57    4   #BB66  TXT W
01B0E0:  49 4E 20 45 4E 41 42 4C 45 20 20 20 20 20 20 53    IN ENABLE      S
01B0F0:  65 74 20 73 69 7A 65 20 6F 66 20 74 68 65 20 63    et size of the c
01B100:  75 72 72 65 6E 74 20 74 65 78 74 20 77 69 6E 64    urrent text wind
01B110:  6F 77 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 33 35    ow.....       35
01B120:  20 20 20 23 42 42 36 39 20 20 54 58 54 20 47 45       #BB69  TXT GE
01B130:  54 20 57 49 4E 44 4F 57 20 20 20 20 20 20 47 65    T WINDOW      Ge
01B140:  74 20 20 74 68 65 20 20 73 69 7A 65 20 20 6F 66    t  the  size  of
01B150:  20 20 74 68 65 20 20 63 75 72 72 65 6E 74 20 20      the  current  
01B160:  74 65 78 74 0D 0A 20 20 20 20 20 20 20 20 20 20    text..          
01B170:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B180:  20 20 20 20 20 20 20 20 20 20 20 20 20 77 69 6E                 win
01B190:  64 6F 77 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 33    dow.....       3
01B1A0:  36 20 20 20 23 42 42 36 43 20 20 54 58 54 20 43    6   #BB6C  TXT C
01B1B0:  4C 45 41 52 20 57 49 4E 44 4F 57 20 20 20 20 43    LEAR WINDOW    C
01B1C0:  6C 65 61 72 20 63 75 72 72 65 6E 74 20 77 69 6E    lear current win
01B1D0:  64 6F 77 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    dow.......      
01B1E0:  20 43 55 52 53 4F 52 0D 0A 0D 0A 20 20 20 20 20     CURSOR....     
01B1F0:  20 20 33 37 20 20 20 23 42 42 36 46 20 20 54 58      37   #BB6F  TX
01B200:  54 20 53 45 54 20 43 4F 4C 55 4D 4E 20 20 20 20    T SET COLUMN    
01B210:  20 20 53 65 74 20 63 75 72 73 6F 72 20 68 6F 72      Set cursor hor
01B220:  69 7A 6F 6E 74 61 6C 20 70 6F 73 69 74 69 6F 6E    izontal position
01B230:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 33 38 20 20    .....       38  
01B240:  20 23 42 42 37 32 20 20 54 58 54 20 53 45 54 20     #BB72  TXT SET 
01B250:  52 4F 57 20 20 20 20 20 20 20 20 20 53 65 74 20    ROW         Set 
01B260:  63 75 72 73 6F 72 20 76 65 72 74 69 63 61 6C 20    cursor vertical 
01B270:  70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20    position.....   
01B280:  20 20 20 20 33 39 20 20 20 23 42 42 37 35 20 20        39   #BB75  
01B290:  54 58 54 20 53 45 54 20 43 55 52 53 4F 52 20 20    TXT SET CURSOR  
01B2A0:  20 20 20 20 53 65 74 20 63 75 72 73 6F 72 20 70        Set cursor p
01B2B0:  6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20 20    osition.....    
01B2C0:  20 20 20 34 30 20 20 20 23 42 42 37 38 20 20 54       40   #BB78  T
01B2D0:  58 54 20 47 45 54 20 43 55 52 53 4F 52 20 20 20    XT GET CURSOR   
01B2E0:  20 20 20 41 73 6B 20 63 75 72 72 65 6E 74 20 63       Ask current c
01B2F0:  75 72 73 6F 72 20 70 6F 73 69 74 69 6F 6E 2E 0D    ursor position..
01B300:  0A 0D 0A 20 20 20 20 20 20 20 34 31 20 20 20 23    ...       41   #
01B310:  42 42 37 42 20 20 54 58 54 20 43 55 52 20 45 4E    BB7B  TXT CUR EN
01B320:  41 42 4C 45 20 20 20 20 20 20 41 6C 6C 6F 77 20    ABLE      Allow 
01B330:  63 75 72 73 6F 72 20 64 69 73 70 6C 61 79 20 2D    cursor display -
01B340:  20 75 73 65 72 2E 0D 0A 0D 0A 20 20 20 20 20 20     user.....      
01B350:  20 34 32 20 20 20 23 42 42 37 45 20 20 54 58 54     42   #BB7E  TXT
01B360:  20 43 55 52 20 44 49 53 41 42 4C 45 20 20 20 20     CUR DISABLE    
01B370:  20 44 69 73 73 61 6C 6C 6F 77 20 63 75 72 73 6F     Dissallow curso
01B380:  72 20 64 69 73 70 6C 61 79 20 2D 20 75 73 65 72    r display - user
01B390:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 34 33 20 20    .....       43  
01B3A0:  20 23 42 42 38 31 20 20 54 58 54 20 43 55 52 20     #BB81  TXT CUR 
01B3B0:  4F 4E 20 20 20 20 20 20 20 20 20 20 41 6C 6C 6F    ON          Allo
01B3C0:  77 20 63 75 72 73 6F 72 20 64 69 73 70 6C 61 79    w cursor display
01B3D0:  20 2D 20 73 79 73 74 65 6D 2E 0D 0A 0D 0A 20 20     - system.....  
01B3E0:  20 20 20 20 20 34 34 20 20 20 23 42 42 38 34 20         44   #BB84 
01B3F0:  20 54 58 54 20 43 55 52 20 4F 46 46 20 20 20 20     TXT CUR OFF    
01B400:  20 20 20 20 20 44 69 73 73 61 6C 6C 6F 77 20 63         Dissallow c
01B410:  75 72 73 6F 72 20 64 69 73 70 6C 61 79 20 2D 20    ursor display - 
01B420:  73 79 73 74 65 6D 2E 0D 0A 0D 0A 20 20 20 20 20    system.....     
01B430:  20 20 34 35 20 20 20 23 42 42 38 37 20 20 54 58      45   #BB87  TX
01B440:  54 20 56 41 4C 49 44 41 54 45 20 20 20 20 20 20    T VALIDATE      
01B450:  20 20 43 68 65 63 6B 20 69 66 20 61 20 63 75 72      Check if a cur
01B460:  73 6F 72 20 70 6F 73 69 74 69 6F 6E 20 20 69 73    sor position  is
01B470:  20 20 77 69 74 68 69 6E 0D 0A 20 20 20 20 20 20      within..      
01B480:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B490:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B4A0:  20 74 68 65 20 77 69 6E 64 6F 77 2E 0D 0A 0D 0A     the window.....
01B4B0:  20 20 20 20 20 20 20 34 36 20 20 20 23 42 42 38           46   #BB8
01B4C0:  41 20 20 54 58 54 20 50 4C 41 43 45 20 43 55 52    A  TXT PLACE CUR
01B4D0:  53 4F 52 20 20 20 20 50 75 74 20 61 20 63 75 72    SOR    Put a cur
01B4E0:  73 6F 72 20 62 6C 6F 62 20 6F 6E 20 74 68 65 20    sor blob on the 
01B4F0:  73 63 72 65 65 6E 2E 0D 0A 0D 0A 20 20 20 20 20    screen.....     
01B500:  20 20 34 37 20 20 20 23 42 42 38 44 20 20 54 58      47   #BB8D  TX
01B510:  54 20 52 45 4D 4F 56 45 20 43 55 52 53 4F 52 20    T REMOVE CURSOR 
01B520:  20 20 54 61 6B 65 20 61 20 63 75 72 73 6F 72 20      Take a cursor 
01B530:  62 6C 6F 62 20 6F 66 66 20 74 68 65 20 73 63 72    blob off the scr
01B540:  65 65 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    een.......      
01B550:  20 49 4E 4B 53 0D 0A 0D 0A 20 20 20 20 20 20 20     INKS....       
01B560:  34 38 20 20 20 23 42 42 39 30 20 20 54 58 54 20    48   #BB90  TXT 
01B570:  53 45 54 20 50 45 4E 20 20 20 20 20 20 20 20 20    SET PEN         
01B580:  53 65 74 20 69 6E 6B 20 66 6F 72 20 77 72 69 74    Set ink for writ
01B590:  69 6E 67 20 63 68 61 72 61 63 74 65 72 73 2E 0D    ing characters..
01B5A0:  0A 0D 0A 20 20 20 20 20 20 20 34 39 20 20 20 23    ...       49   #
01B5B0:  42 42 39 33 20 20 54 58 54 20 47 45 54 20 50 45    BB93  TXT GET PE
01B5C0:  4E 20 20 20 20 20 20 20 20 20 47 65 74 20 69 6E    N         Get in
01B5D0:  6B 20 66 6F 72 20 77 72 69 74 69 6E 67 20 63 68    k for writing ch
01B5E0:  61 72 61 63 74 65 72 73 2E 0D 0A 0D 0A 20 20 20    aracters.....   
01B5F0:  20 20 20 20 35 30 20 20 20 23 42 42 39 36 20 20        50   #BB96  
01B600:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
01B610:  17 00 00 00 02 09 50 E5 17 00 C1 02 00 00 00 02    ......P.........
01B620:  17 00 C2 02 00 00 00 02 17 00 C3 02 00 00 00 02    ................
01B630:  17 00 C4 02 00 00 00 02 17 00 C5 02 00 00 00 02    ................
01B640:  17 00 C6 02 00 00 00 02 17 00 C7 02 00 00 00 02    ................
01B650:  17 00 C8 02 00 00 00 02 17 00 C9 02 00 00 00 02    ................
01B660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B6F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01B700:  54 58 54 20 53 45 54 20 50 41 50 45 52 20 20 20    TXT SET PAPER   
01B710:  20 20 20 20 53 65 74 20 69 6E 6B 20 66 6F 72 20        Set ink for 
01B720:  77 72 69 74 69 6E 67 20 74 65 78 74 20 62 61 63    writing text bac
01B730:  6B 67 72 6F 75 6E 64 2E 0D 0A 0D 0A 20 20 20 20    kground.....    
01B740:  20 20 20 35 31 20 20 20 23 42 42 39 39 20 20 54       51   #BB99  T
01B750:  58 54 20 47 45 54 20 50 41 50 45 52 20 20 20 20    XT GET PAPER    
01B760:  20 20 20 47 65 74 20 69 6E 6B 20 66 6F 72 20 77       Get ink for w
01B770:  72 69 74 69 6E 67 20 74 65 78 74 20 62 61 63 6B    riting text back
01B780:  67 72 6F 75 6E 64 2E 0D 0A 0D 0A 20 20 20 20 20    ground.....     
01B790:  20 20 35 32 20 20 20 23 42 42 39 43 20 20 54 58      52   #BB9C  TX
01B7A0:  54 20 49 4E 56 45 52 53 45 20 20 20 20 20 20 20    T INVERSE       
01B7B0:  20 20 53 77 61 70 20 63 75 72 72 65 6E 74 20 70      Swap current p
01B7C0:  65 6E 20 61 6E 64 20 70 61 70 65 72 20 69 6E 6B    en and paper ink
01B7D0:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 35 33 20    s.....       53 
01B7E0:  20 20 23 42 42 39 46 20 20 54 58 54 20 53 45 54      #BB9F  TXT SET
01B7F0:  20 42 41 43 4B 20 20 20 20 20 20 20 20 41 6C 6C     BACK        All
01B800:  6F 77 20 20 6F 72 20 20 64 69 73 73 61 6C 6C 6F    ow  or  dissallo
01B810:  77 20 20 62 61 63 6B 67 72 6F 75 6E 64 20 62 65    w  background be
01B820:  69 6E 67 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ing..           
01B830:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B840:  20 20 20 20 20 20 20 20 20 20 20 20 77 72 69 74                writ
01B850:  74 65 6E 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ten.............
01B860:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
01B870:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
01B880:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
01B890:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01B8A0:  20 20 20 20 70 61 67 65 20 31 34 2E 34 0D 0A 0D        page 14.4...
01B8B0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
01B8C0:  20 20 35 34 20 20 20 23 42 42 41 32 20 20 54 58      54   #BBA2  TX
01B8D0:  54 20 47 45 54 20 42 41 43 4B 20 20 20 20 20 20    T GET BACK      
01B8E0:  20 20 41 73 6B 20 69 66 20 62 61 63 6B 67 72 6F      Ask if backgro
01B8F0:  75 6E 64 20 69 73 20 62 65 69 6E 67 20 77 72 69    und is being wri
01B900:  74 74 65 6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    tten.....       
01B910:  4D 41 54 52 49 43 45 53 0D 0A 0D 0A 20 20 20 20    MATRICES....    
01B920:  20 20 20 35 35 20 20 20 23 42 42 41 35 20 20 54       55   #BBA5  T
01B930:  58 54 20 47 45 54 20 4D 41 54 52 49 58 20 20 20    XT GET MATRIX   
01B940:  20 20 20 47 65 74 20 74 68 65 20 61 64 64 72 65       Get the addre
01B950:  73 73 20 6F 66 20 61 20 63 68 61 72 61 63 74 65    ss of a characte
01B960:  72 20 6D 61 74 72 69 78 2E 0D 0A 0D 0A 20 20 20    r matrix.....   
01B970:  20 20 20 20 35 36 20 20 20 23 42 42 41 38 20 20        56   #BBA8  
01B980:  54 58 54 20 53 45 54 20 4D 41 54 52 49 58 20 20    TXT SET MATRIX  
01B990:  20 20 20 20 53 65 74 20 61 20 63 68 61 72 61 63        Set a charac
01B9A0:  74 65 72 20 6D 61 74 72 69 78 2E 0D 0A 0D 0A 20    ter matrix..... 
01B9B0:  20 20 20 20 20 20 35 37 20 20 20 23 42 42 41 42          57   #BBAB
01B9C0:  20 20 54 58 54 20 53 45 54 20 4D 20 54 41 42 4C      TXT SET M TABL
01B9D0:  45 20 20 20 20 20 53 65 74 20 20 74 68 65 20 20    E     Set  the  
01B9E0:  75 73 65 72 20 20 64 65 66 69 6E 65 64 20 20 6D    user  defined  m
01B9F0:  61 74 72 69 78 20 20 74 61 62 6C 65 0D 0A 20 20    atrix  table..  
01BA00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BA10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BA20:  20 20 20 20 20 61 64 64 72 65 73 73 2E 0D 0A 0D         address....
01BA30:  0A 20 20 20 20 20 20 20 35 38 20 20 20 23 42 42    .       58   #BB
01BA40:  41 45 20 20 54 58 54 20 47 45 54 20 4D 20 54 41    AE  TXT GET M TA
01BA50:  42 4C 45 20 20 20 20 20 47 65 74 20 75 73 65 72    BLE     Get user
01BA60:  20 64 65 66 69 6E 65 64 20 6D 61 74 72 69 78 20     defined matrix 
01BA70:  74 61 62 6C 65 20 61 64 64 72 65 73 73 2E 0D 0A    table address...
01BA80:  0D 0A 0D 0A 20 20 20 20 20 20 20 43 4F 4E 54 52    ....       CONTR
01BA90:  4F 4C 20 43 4F 44 45 53 0D 0A 0D 0A 20 20 20 20    OL CODES....    
01BAA0:  20 20 20 35 39 20 20 20 23 42 42 42 31 20 20 54       59   #BBB1  T
01BAB0:  58 54 20 47 45 54 20 43 4F 4E 54 52 4F 4C 53 20    XT GET CONTROLS 
01BAC0:  20 20 20 46 65 74 63 68 20 61 64 64 72 65 73 73       Fetch address
01BAD0:  20 6F 66 20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65     of control code
01BAE0:  20 74 61 62 6C 65 2E 0D 0A 0D 0A 0D 0A 20 20 20     table.......   
01BAF0:  20 20 20 20 53 54 52 45 41 4D 53 0D 0A 0D 0A 20        STREAMS.... 
01BB00:  20 20 20 20 20 20 36 30 20 20 20 23 42 42 42 34          60   #BBB4
01BB10:  20 20 54 58 54 20 53 54 52 20 53 45 4C 45 43 54      TXT STR SELECT
01BB20:  20 20 20 20 20 20 53 65 6C 65 63 74 20 20 54 65          Select  Te
01BB30:  78 74 20 56 44 55 20 73 74 72 65 61 6D 2E 0D 0A    xt VDU stream...
01BB40:  0D 0A 20 20 20 20 20 20 20 36 31 20 20 20 23 42    ..       61   #B
01BB50:  42 42 37 20 20 54 58 54 20 53 57 41 50 20 53 54    BB7  TXT SWAP ST
01BB60:  52 45 41 4D 53 20 20 20 20 53 77 61 70 20 74 68    REAMS    Swap th
01BB70:  65 20 73 74 61 74 65 73 20 6F 66 20 74 77 6F 20    e states of two 
01BB80:  73 74 72 65 61 6D 73 2E 0D 0A 0D 0A 0D 0A 20 20    streams.......  
01BB90:  20 20 20 20 20 31 34 2E 31 2E 33 20 45 6E 74 72         14.1.3 Entr
01BBA0:  69 65 73 20 74 6F 20 74 68 65 20 47 72 61 70 68    ies to the Graph
01BBB0:  69 63 73 20 56 44 55 0D 0A 0D 0A 20 20 20 20 20    ics VDU....     
01BBC0:  20 20 54 68 65 20 47 72 61 70 68 69 63 73 20 56      The Graphics V
01BBD0:  44 55 20 64 65 61 6C 73 20 77 69 74 68 20 69 6E    DU deals with in
01BBE0:  64 69 76 69 64 75 61 6C 20 70 69 78 65 6C 73 2E    dividual pixels.
01BBF0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 4E 49    ......       INI
01BC00:  54 49 41 4C 49 5A 41 54 49 4F 4E 0D 0A 0D 0A 20    TIALIZATION.... 
01BC10:  20 20 20 20 20 20 36 32 20 20 20 23 42 42 42 41          62   #BBBA
01BC20:  20 20 47 52 41 20 49 4E 49 54 49 41 4C 49 53 45      GRA INITIALISE
01BC30:  20 20 20 20 20 20 49 6E 69 74 69 61 6C 69 7A 65          Initialize
01BC40:  20 74 68 65 20 47 72 61 70 68 69 63 73 20 56 44     the Graphics VD
01BC50:  55 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 36 33 20    U.....       63 
01BC60:  20 20 23 42 42 42 44 20 20 47 52 41 20 52 45 53      #BBBD  GRA RES
01BC70:  45 54 20 20 20 20 20 20 20 20 20 20 20 52 65 73    ET           Res
01BC80:  65 74 20 20 74 68 65 20 20 47 72 61 70 68 69 63    et  the  Graphic
01BC90:  73 20 20 56 44 55 20 20 2D 20 72 65 73 74 6F 72    s  VDU  - restor
01BCA0:  65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    e..             
01BCB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BCC0:  20 20 20 20 20 20 20 20 20 20 73 74 61 6E 64 61              standa
01BCD0:  72 64 20 69 6E 64 69 72 65 63 74 69 6F 6E 73 2E    rd indirections.
01BCE0:  0D 0A 20 20 20 20 20 20 20 31 39 33 20 20 23 42    ..       193  #B
01BCF0:  44 34 33 20 20 47 52 41 20 44 45 46 41 55 4C 54    D43  GRA DEFAULT
01BD00:  20 20 20 20 20 20 20 20 20 53 65 74 20 64 65 66             Set def
01BD10:  61 75 6C 74 20 47 72 61 70 68 69 63 73 20 56 44    ault Graphics VD
01BD20:  55 20 6D 6F 64 65 73 2E 0D 0A 0D 0A 0D 0A 20 20    U modes.......  
01BD30:  20 20 20 20 20 43 55 52 52 45 4E 54 20 50 4F 53         CURRENT POS
01BD40:  49 54 49 4F 4E 0D 0A 0D 0A 20 20 20 20 20 20 20    ITION....       
01BD50:  36 34 20 20 20 23 42 42 43 30 20 20 47 52 41 20    64   #BBC0  GRA 
01BD60:  4D 4F 56 45 20 41 42 53 4F 4C 55 54 45 20 20 20    MOVE ABSOLUTE   
01BD70:  4D 6F 76 65 20 74 6F 20 61 6E 20 61 62 73 6F 6C    Move to an absol
01BD80:  75 74 65 20 70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D    ute position....
01BD90:  0A 20 20 20 20 20 20 20 36 35 20 20 20 23 42 42    .       65   #BB
01BDA0:  43 33 20 20 47 52 41 20 4D 4F 56 45 20 52 45 4C    C3  GRA MOVE REL
01BDB0:  41 54 49 56 45 20 20 20 4D 6F 76 65 20 72 65 6C    ATIVE   Move rel
01BDC0:  61 74 69 76 65 20 74 6F 20 63 75 72 72 65 6E 74    ative to current
01BDD0:  20 70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20     position.....  
01BDE0:  20 20 20 20 20 36 36 20 20 20 23 42 42 43 36 20         66   #BBC6 
01BDF0:  20 47 52 41 20 41 53 4B 20 43 55 52 53 4F 52 20     GRA ASK CURSOR 
01BE00:  20 20 20 20 20 47 65 74 20 74 68 65 20 63 75 72         Get the cur
01BE10:  72 65 6E 74 20 70 6F 73 69 74 69 6F 6E 2E 0D 0A    rent position...
01BE20:  0D 0A 20 20 20 20 20 20 20 36 37 20 20 20 23 42    ..       67   #B
01BE30:  42 43 39 20 20 47 52 41 20 53 45 54 20 4F 52 49    BC9  GRA SET ORI
01BE40:  47 49 4E 20 20 20 20 20 20 53 65 74 20 20 20 74    GIN      Set   t
01BE50:  68 65 20 20 20 6F 72 69 67 69 6E 20 20 20 6F 66    he   origin   of
01BE60:  20 20 20 20 74 68 65 20 20 20 20 75 73 65 72 0D        the    user.
01BE70:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01BE80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BE90:  20 20 20 20 20 20 20 20 63 6F 6F 72 64 69 6E 61            coordina
01BEA0:  74 65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 36    tes.....       6
01BEB0:  38 20 20 20 23 42 42 43 43 20 20 47 52 41 20 47    8   #BBCC  GRA G
01BEC0:  45 54 20 4F 52 49 47 49 4E 20 20 20 20 20 20 47    ET ORIGIN      G
01BED0:  65 74 20 20 20 74 68 65 20 20 20 6F 72 69 67 69    et   the   origi
01BEE0:  6E 20 20 20 6F 66 20 20 20 20 74 68 65 20 20 20    n   of    the   
01BEF0:  20 75 73 65 72 0D 0A 20 20 20 20 20 20 20 20 20     user..         
01BF00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BF10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6F                  co
01BF20:  6F 72 64 69 6E 61 74 65 73 2E 0D 0A 0D 0A 20 20    ordinates.....  
01BF30:  20 20 20 20 20 31 39 37 20 20 23 42 44 34 46 20         197  #BD4F 
01BF40:  20 47 52 41 20 46 52 4F 4D 20 55 53 45 52 20 20     GRA FROM USER  
01BF50:  20 20 20 20 20 43 6F 6E 76 65 72 74 20 20 75 73         Convert  us
01BF60:  65 72 20 20 63 6F 6F 72 64 69 6E 61 74 65 73 20    er  coordinates 
01BF70:  20 20 74 6F 20 20 20 62 61 73 65 0D 0A 20 20 20      to   base..   
01BF80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BF90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BFA0:  20 20 20 20 63 6F 6F 72 64 69 6E 61 74 65 73 2E        coordinates.
01BFB0:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
01BFC0:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
01BFD0:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
01BFE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01BFF0:  20 20 20 20 20 20 20 20 20 20 20 20 70 61 67 65                page
01C000:  20 31 34 2E 35 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D     14.5...........
01C010:  0A 0D 0A 20 20 20 20 20 20 20 57 49 4E 44 4F 57    ...       WINDOW
01C020:  0D 0A 0D 0A 20 20 20 20 20 20 20 36 39 20 20 20    ....       69   
01C030:  23 42 42 43 46 20 20 47 52 41 20 57 49 4E 20 57    #BBCF  GRA WIN W
01C040:  49 44 54 48 20 20 20 20 20 20 20 53 65 74 20 20    IDTH       Set  
01C050:  6C 65 66 74 20 20 61 6E 64 20 20 72 69 67 68 74    left  and  right
01C060:  20 20 65 64 67 65 73 20 20 6F 66 20 20 20 74 68      edges  of   th
01C070:  65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    e..             
01C080:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C090:  20 20 20 20 20 20 20 20 20 20 67 72 61 70 68 69              graphi
01C0A0:  63 73 20 77 69 6E 64 6F 77 2E 0D 0A 0D 0A 20 20    cs window.....  
01C0B0:  20 20 20 20 20 37 30 20 20 20 23 42 42 44 32 20         70   #BBD2 
01C0C0:  20 47 52 41 20 57 49 4E 20 48 45 49 47 48 54 20     GRA WIN HEIGHT 
01C0D0:  20 20 20 20 20 53 65 74 20 20 74 6F 70 20 20 61         Set  top  a
01C0E0:  6E 64 20 20 62 6F 74 74 6F 6D 20 20 65 64 67 65    nd  bottom  edge
01C0F0:  73 20 20 6F 66 20 20 20 74 68 65 0D 0A 20 20 20    s  of   the..   
01C100:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C110:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C120:  20 20 20 20 67 72 61 70 68 69 63 73 20 77 69 6E        graphics win
01C130:  64 6F 77 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 37    dow.....       7
01C140:  31 20 20 20 23 42 42 44 35 20 20 47 52 41 20 47    1   #BBD5  GRA G
01C150:  45 54 20 57 20 57 49 44 54 48 20 20 20 20 20 47    ET W WIDTH     G
01C160:  65 74 20 74 68 65 20 6C 65 66 74 20 61 6E 64 20    et the left and 
01C170:  72 69 67 68 74 20 20 65 64 67 65 73 20 20 6F 66    right  edges  of
01C180:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20      the..         
01C190:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C1A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 72                  gr
01C1B0:  61 70 68 69 63 73 20 77 69 6E 64 6F 77 2E 0D 0A    aphics window...
01C1C0:  0D 0A 20 20 20 20 20 20 20 37 32 20 20 20 23 42    ..       72   #B
01C1D0:  42 44 38 20 20 47 52 41 20 47 45 54 20 57 20 48    BD8  GRA GET W H
01C1E0:  45 49 47 48 54 20 20 20 20 47 65 74 20 74 68 65    EIGHT    Get the
01C1F0:  20 74 6F 70 20 61 6E 64 20 62 6F 74 74 6F 6D 20     top and bottom 
01C200:  20 65 64 67 65 73 20 20 6F 66 20 20 74 68 65 0D     edges  of  the.
01C210:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01C220:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C230:  20 20 20 20 20 20 20 20 67 72 61 70 68 69 63 73            graphics
01C240:  20 77 69 6E 64 6F 77 2E 0D 0A 0D 0A 20 20 20 20     window.....    
01C250:  20 20 20 37 33 20 20 20 23 42 42 44 42 20 20 47       73   #BBDB  G
01C260:  52 41 20 43 4C 45 41 52 20 57 49 4E 44 4F 57 20    RA CLEAR WINDOW 
01C270:  20 20 20 43 6C 65 61 72 20 74 68 65 20 67 72 61       Clear the gra
01C280:  70 68 69 63 73 20 77 69 6E 64 6F 77 2E 0D 0A 0D    phics window....
01C290:  0A 0D 0A 20 20 20 20 20 20 20 49 4E 4B 53 0D 0A    ...       INKS..
01C2A0:  0D 0A 20 20 20 20 20 20 20 37 34 20 20 20 23 42    ..       74   #B
01C2B0:  42 44 45 20 20 47 52 41 20 53 45 54 20 50 45 4E    BDE  GRA SET PEN
01C2C0:  20 20 20 20 20 20 20 20 20 53 65 74 20 74 68 65             Set the
01C2D0:  20 67 72 61 70 68 69 63 73 20 70 6C 6F 74 74 69     graphics plotti
01C2E0:  6E 67 20 69 6E 6B 2E 0D 0A 0D 0A 20 20 20 20 20    ng ink.....     
01C2F0:  20 20 37 35 20 20 20 23 42 42 45 31 20 20 47 52      75   #BBE1  GR
01C300:  41 20 47 45 54 20 50 45 4E 20 20 20 20 20 20 20    A GET PEN       
01C310:  20 20 47 65 74 20 74 68 65 20 63 75 72 72 65 6E      Get the curren
01C320:  74 20 67 72 61 70 68 69 63 73 20 70 6C 6F 74 74    t graphics plott
01C330:  69 6E 67 20 69 6E 6B 2E 0D 0A 0D 0A 20 20 20 20    ing ink.....    
01C340:  20 20 20 37 36 20 20 20 23 42 42 45 34 20 20 47       76   #BBE4  G
01C350:  52 41 20 53 45 54 20 50 41 50 45 52 20 20 20 20    RA SET PAPER    
01C360:  20 20 20 53 65 74 20 74 68 65 20 67 72 61 70 68       Set the graph
01C370:  69 63 73 20 62 61 63 6B 67 72 6F 75 6E 64 20 69    ics background i
01C380:  6E 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 37 37    nk.....       77
01C390:  20 20 20 23 42 42 45 37 20 20 47 52 41 20 47 45       #BBE7  GRA GE
01C3A0:  54 20 50 41 50 45 52 20 20 20 20 20 20 20 47 65    T PAPER       Ge
01C3B0:  74 20 74 68 65 20 20 63 75 72 72 65 6E 74 20 20    t the  current  
01C3C0:  67 72 61 70 68 69 63 73 20 20 62 61 63 6B 67 72    graphics  backgr
01C3D0:  6F 75 6E 64 0D 0A 20 20 20 20 20 20 20 20 20 20    ound..          
01C3E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C3F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 69 6E 6B                 ink
01C400:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 39 34 20    .....       194 
01C410:  20 23 42 44 34 36 20 20 47 52 41 20 53 45 54 20     #BD46  GRA SET 
01C420:  42 41 43 4B 20 20 20 20 20 20 20 20 53 65 74 20    BACK        Set 
01C430:  20 77 68 65 74 68 65 72 20 20 62 61 63 6B 67 72     whether  backgr
01C440:  6F 75 6E 64 20 20 69 73 20 20 20 74 6F 20 20 20    ound  is   to   
01C450:  62 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    be..            
01C460:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C470:  20 20 20 20 20 20 20 20 20 20 20 77 72 69 74 74               writt
01C480:  65 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    en.......       
01C490:  50 4C 4F 54 54 49 4E 47 0D 0A 0D 0A 20 20 20 20    PLOTTING....    
01C4A0:  20 20 20 37 38 20 20 20 23 42 42 45 41 20 20 47       78   #BBEA  G
01C4B0:  52 41 20 50 4C 4F 54 20 41 42 53 4F 4C 55 54 45    RA PLOT ABSOLUTE
01C4C0:  20 20 20 50 6C 6F 74 20 61 20 70 6F 69 6E 74 20       Plot a point 
01C4D0:  61 74 20 61 6E 20 61 62 73 6F 6C 75 74 65 20 70    at an absolute p
01C4E0:  6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20 20    osition.....    
01C4F0:  20 20 20 37 39 20 20 20 23 42 42 45 44 20 20 47       79   #BBED  G
01C500:  52 41 20 50 4C 4F 54 20 52 45 4C 41 54 49 56 45    RA PLOT RELATIVE
01C510:  20 20 20 50 6C 6F 74 20 61 20 70 6F 69 6E 74 20       Plot a point 
01C520:  72 65 6C 61 74 69 76 65 20 74 6F 20 20 74 68 65    relative to  the
01C530:  20 20 63 75 72 72 65 6E 74 0D 0A 20 20 20 20 20      current..     
01C540:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C550:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C560:  20 20 70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20      position..... 
01C570:  20 20 20 20 20 20 54 45 53 54 49 4E 47 0D 0A 0D          TESTING...
01C580:  0A 20 20 20 20 20 20 20 38 30 20 20 20 23 42 42    .       80   #BB
01C590:  46 30 20 20 47 52 41 20 54 45 53 54 20 41 42 53    F0  GRA TEST ABS
01C5A0:  4F 4C 55 54 45 20 20 20 54 65 73 74 20 61 20 70    OLUTE   Test a p
01C5B0:  6F 69 6E 74 20 61 74 20 61 6E 20 61 62 73 6F 6C    oint at an absol
01C5C0:  75 74 65 20 70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D    ute position....
01C5D0:  0A 20 20 20 20 20 20 20 38 31 20 20 20 23 42 42    .       81   #BB
01C5E0:  46 33 20 20 47 52 41 20 54 45 53 54 20 52 45 4C    F3  GRA TEST REL
01C5F0:  41 54 49 56 45 20 20 20 54 65 73 74 20 61 20 70    ATIVE   Test a p
01C600:  6F 69 6E 74 20 72 65 6C 61 74 69 76 65 20 74 6F    oint relative to
01C610:  20 20 74 68 65 20 20 63 75 72 72 65 6E 74 0D 0A      the  current..
01C620:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C630:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C640:  20 20 20 20 20 20 20 70 6F 73 69 74 69 6F 6E 2E           position.
01C650:  0D 0A 0D 0A 20 20 20 20 20 20 20 4C 49 4E 45 20    ....       LINE 
01C660:  44 52 41 57 49 4E 47 0D 0A 0D 0A 20 20 20 20 20    DRAWING....     
01C670:  20 20 38 32 20 20 20 23 42 42 46 36 20 20 47 52      82   #BBF6  GR
01C680:  41 20 4C 49 4E 45 20 41 42 53 4F 4C 55 54 45 20    A LINE ABSOLUTE 
01C690:  20 20 44 72 61 77 20 61 20 6C 69 6E 65 20 74 6F      Draw a line to
01C6A0:  20 61 6E 20 61 62 73 6F 6C 75 74 65 20 70 6F 73     an absolute pos
01C6B0:  69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20 20 20 20    ition.....      
01C6C0:  20 38 33 20 20 20 23 42 42 46 39 20 20 47 52 41     83   #BBF9  GRA
01C6D0:  20 4C 49 4E 45 20 52 45 4C 41 54 49 56 45 20 20     LINE RELATIVE  
01C6E0:  20 44 72 61 77 20 61 20 6C 69 6E 65 20 72 65 6C     Draw a line rel
01C6F0:  61 74 69 76 65 20 20 74 6F 20 20 74 68 65 20 20    ative  to  the  
01C700:  63 75 72 72 65 6E 74 0D 0A 20 20 20 20 20 20 20    current..       
01C710:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C720:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C730:  70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20    position.....   
01C740:  20 20 20 20 31 39 35 20 20 23 42 44 34 39 20 20        195  #BD49  
01C750:  47 52 41 20 53 45 54 20 46 49 52 53 54 20 20 20    GRA SET FIRST   
01C760:  20 20 20 20 53 65 74 20 77 68 65 74 68 65 72 20        Set whether 
01C770:  66 69 72 73 74 20 70 6F 69 6E 74 20 6F 66 20 61    first point of a
01C780:  20 20 6C 69 6E 65 20 20 69 73 0D 0A 20 20 20 20      line  is..    
01C790:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C7A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C7B0:  20 20 20 74 6F 20 62 65 20 70 6C 6F 74 74 65 64       to be plotted
01C7C0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 39 36 20    .....       196 
01C7D0:  20 23 42 44 34 43 20 20 47 52 41 20 53 45 54 20     #BD4C  GRA SET 
01C7E0:  4C 49 4E 45 20 4D 41 53 4B 20 20 20 53 65 74 20    LINE MASK   Set 
01C7F0:  6D 61 73 6B 20 66 6F 72 20 64 72 61 77 69 6E 67    mask for drawing
01C800:  20 6C 69 6E 65 73 2E 0D 0A 0D 0A 0D 0A 20 20 20     lines.......   
01C810:  20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34        AMSTRAD CPC4
01C820:  36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D    64/664/6128 FIRM
01C830:  57 41 52 45 20 20 20 20 20 20 20 20 20 20 20 20    WARE            
01C840:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01C850:  20 70 61 67 65 20 31 34 2E 36 0D 0A 0D 0A 0D 0A     page 14.6......
01C860:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
01C870:  52 45 41 20 46 49 4C 4C 49 4E 47 0D 0A 0D 0A 20    REA FILLING.... 
01C880:  20 20 20 20 20 20 31 39 38 20 20 23 42 44 35 32          198  #BD52
01C890:  20 20 47 52 41 20 46 49 4C 4C 20 20 20 20 20 20      GRA FILL      
01C8A0:  20 20 20 20 20 20 46 69 6C 6C 20 61 6E 20 61 72          Fill an ar
01C8B0:  65 61 20 6F 66 20 74 68 65 20 73 63 72 65 65 6E    ea of the screen
01C8C0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 43 48 41 52    .....       CHAR
01C8D0:  41 43 54 45 52 20 44 52 41 57 49 4E 47 0D 0A 0D    ACTER DRAWING...
01C8E0:  0A 20 20 20 20 20 20 20 38 34 20 20 20 23 42 42    .       84   #BB
01C8F0:  46 43 20 20 47 52 41 20 57 52 20 43 48 41 52 20    FC  GRA WR CHAR 
01C900:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
01C910:  18 00 00 00 02 09 50 E5 18 00 C1 02 00 00 00 02    ......P.........
01C920:  18 00 C2 02 00 00 00 02 18 00 C3 02 00 00 00 02    ................
01C930:  18 00 C4 02 00 00 00 02 18 00 C5 02 00 00 00 02    ................
01C940:  18 00 C6 02 00 00 00 02 18 00 C7 02 00 00 00 02    ................
01C950:  18 00 C8 02 00 00 00 02 18 00 C9 02 00 00 00 02    ................
01C960:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C970:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C980:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C990:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01C9F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01CA00:  20 20 20 20 20 20 20 20 50 75 74 20 61 20 63 68            Put a ch
01CA10:  61 72 61 63 74 65 72 20 6F 6E 20 74 68 65 20 73    aracter on the s
01CA20:  63 72 65 65 6E 20 20 61 74 20 20 74 68 65 0D 0A    creen  at  the..
01CA30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CA40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CA50:  20 20 20 20 20 20 20 63 75 72 72 65 6E 74 20 67           current g
01CA60:  72 61 70 68 69 63 73 20 70 6F 73 69 74 69 6F 6E    raphics position
01CA70:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 34 2E 31    .....       14.1
01CA80:  2E 34 20 45 6E 74 72 69 65 73 20 74 6F 20 74 68    .4 Entries to th
01CA90:  65 20 53 63 72 65 65 6E 20 50 61 63 6B 0D 0A 0D    e Screen Pack...
01CAA0:  0A 20 20 20 20 20 20 20 54 68 65 20 53 63 72 65    .       The Scre
01CAB0:  65 6E 20 50 61 63 6B 20 69 6E 74 65 72 66 61 63    en Pack interfac
01CAC0:  65 73 20 74 68 65 20 54 65 78 74 20 61 6E 64 20    es the Text and 
01CAD0:  47 72 61 70 68 69 63 73 20 56 44 55 73 20 20 74    Graphics VDUs  t
01CAE0:  6F 20 20 74 68 65 20 20 73 63 72 65 65 6E 0D 0A    o  the  screen..
01CAF0:  20 20 20 20 20 20 20 68 61 72 64 77 61 72 65 2E           hardware.
01CB00:  20 53 63 72 65 65 6E 20 66 75 6E 63 74 69 6F 6E     Screen function
01CB10:  73 20 74 68 61 74 20 61 66 66 65 63 74 20 62 6F    s that affect bo
01CB20:  74 68 20 74 65 78 74 20 20 61 6E 64 20 20 67 72    th text  and  gr
01CB30:  61 70 68 69 63 73 20 20 28 65 2E 67 2E 0D 0A 20    aphics  (e.g... 
01CB40:  20 20 20 20 20 20 69 6E 6B 20 63 6F 6C 6F 75 72          ink colour
01CB50:  73 29 20 61 72 65 20 6C 6F 63 61 74 65 64 20 69    s) are located i
01CB60:  6E 20 74 68 65 20 53 63 72 65 65 6E 20 50 61 63    n the Screen Pac
01CB70:  6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49 4E 49    k.....       INI
01CB80:  54 49 41 4C 49 5A 41 54 49 4F 4E 0D 0A 0D 0A 20    TIALIZATION.... 
01CB90:  20 20 20 20 20 20 38 35 20 20 20 23 42 42 46 46          85   #BBFF
01CBA0:  20 20 53 43 52 20 49 4E 49 54 49 41 4C 49 53 45      SCR INITIALISE
01CBB0:  20 20 20 20 20 20 49 6E 69 74 69 61 6C 69 7A 65          Initialize
01CBC0:  20 74 68 65 20 53 63 72 65 65 6E 20 50 61 63 6B     the Screen Pack
01CBD0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 38 36 20 20    .....       86  
01CBE0:  20 23 42 43 30 32 20 20 53 43 52 20 52 45 53 45     #BC02  SCR RESE
01CBF0:  54 20 20 20 20 20 20 20 20 20 20 20 52 65 73 65    T           Rese
01CC00:  74 20 20 74 68 65 20 20 53 63 72 65 65 6E 20 20    t  the  Screen  
01CC10:  50 61 63 6B 20 20 20 2D 20 20 20 72 65 73 74 6F    Pack   -   resto
01CC20:  72 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    re..            
01CC30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CC40:  20 20 20 20 20 20 20 20 20 20 20 73 74 61 6E 64               stand
01CC50:  61 72 64 20 69 6E 64 69 72 65 63 74 69 6F 6E 73    ard indirections
01CC60:  2C 20 69 6E 6B 20 63 6F 6C 6F 75 72 73 20 61 6E    , ink colours an
01CC70:  64 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    d..             
01CC80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CC90:  20 20 20 20 20 20 20 20 20 20 66 6C 61 73 68 20              flash 
01CCA0:  72 61 74 65 73 2E 0D 0A 20 20 20 20 20 20 20 53    rates...       S
01CCB0:  43 52 45 45 4E 20 48 41 52 44 57 41 52 45 0D 0A    CREEN HARDWARE..
01CCC0:  0D 0A 20 20 20 20 20 20 20 38 37 20 20 23 42 43    ..       87  #BC
01CCD0:  30 35 20 20 53 43 52 20 53 45 54 20 4F 46 46 53    05  SCR SET OFFS
01CCE0:  45 54 20 20 20 20 20 20 20 53 65 74 20 74 68 65    ET       Set the
01CCF0:  20 6F 66 66 73 65 74 20 6F 66 20 20 74 68 65 20     offset of  the 
01CD00:  20 73 74 61 72 74 20 20 6F 66 20 20 74 68 65 0D     start  of  the.
01CD10:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01CD20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CD30:  20 20 20 20 20 20 20 20 73 63 72 65 65 6E 2E 0D            screen..
01CD40:  0A 0D 0A 20 20 20 20 20 20 20 38 38 20 20 23 42    ...       88  #B
01CD50:  43 30 38 20 20 53 43 52 20 53 45 54 20 42 41 53    C08  SCR SET BAS
01CD60:  45 20 20 20 20 20 20 20 20 20 53 65 74 20 74 68    E         Set th
01CD70:  65 20 61 72 65 61 20 6F 66 20 52 41 4D 20 20 74    e area of RAM  t
01CD80:  6F 20 20 75 73 65 20 20 66 6F 72 20 20 74 68 65    o  use  for  the
01CD90:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
01CDA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CDB0:  20 20 20 20 20 20 20 20 20 73 63 72 65 65 6E 20             screen 
01CDC0:  6D 65 6D 6F 72 79 2E 0D 0A 0D 0A 20 20 20 20 20    memory.....     
01CDD0:  20 20 31 39 39 20 23 42 44 35 35 20 20 53 43 52      199 #BD55  SCR
01CDE0:  20 53 45 54 20 50 4F 53 49 54 49 4F 4E 20 20 20     SET POSITION   
01CDF0:  20 20 53 65 74 20 74 68 65 20 6C 6F 63 61 74 69      Set the locati
01CE00:  6F 6E 20 6F 66 20 74 68 65 20 73 63 72 65 65 6E    on of the screen
01CE10:  20 20 6D 65 6D 6F 72 79 0D 0A 20 20 20 20 20 20      memory..      
01CE20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CE30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CE40:  20 77 69 74 68 6F 75 74 20 6D 6F 76 69 6E 67 20     without moving 
01CE50:  74 68 65 20 73 63 72 65 65 6E 2E 0D 0A 0D 0A 20    the screen..... 
01CE60:  20 20 20 20 20 20 38 39 20 20 23 42 43 30 42 20          89  #BC0B 
01CE70:  20 53 43 52 20 47 45 54 20 4C 4F 43 41 54 49 4F     SCR GET LOCATIO
01CE80:  4E 20 20 20 20 20 46 65 74 63 68 20 20 20 63 75    N     Fetch   cu
01CE90:  72 72 65 6E 74 20 20 20 62 61 73 65 20 20 20 61    rrent   base   a
01CEA0:  6E 64 20 20 20 20 6F 66 66 73 65 74 0D 0A 20 20    nd    offset..  
01CEB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CEC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01CED0:  20 20 20 20 20 73 65 74 74 69 6E 67 73 2E 0D 0A         settings...
01CEE0:  0D 0A 20 20 20 20 20 20 20 4D 4F 44 45 0D 0A 0D    ..       MODE...
01CEF0:  0A 20 20 20 20 20 20 20 39 30 20 20 23 42 43 30    .       90  #BC0
01CF00:  45 20 20 53 43 52 20 53 45 54 20 4D 4F 44 45 20    E  SCR SET MODE 
01CF10:  20 20 20 20 20 20 20 20 53 65 74 20 73 63 72 65            Set scre
01CF20:  65 6E 20 69 6E 74 6F 20 6E 65 77 20 6D 6F 64 65    en into new mode
01CF30:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 39 31 20 20    .....       91  
01CF40:  23 42 43 31 31 20 20 53 43 52 20 47 45 54 20 4D    #BC11  SCR GET M
01CF50:  4F 44 45 20 20 20 20 20 20 20 20 20 41 73 6B 20    ODE         Ask 
01CF60:  74 68 65 20 63 75 72 72 65 6E 74 20 73 63 72 65    the current scre
01CF70:  65 6E 20 6D 6F 64 65 2E 0D 0A 0D 0A 20 20 20 20    en mode.....    
01CF80:  20 20 20 39 32 20 20 23 42 43 31 34 20 20 53 43       92  #BC14  SC
01CF90:  52 20 43 4C 45 41 52 20 20 20 20 20 20 20 20 20    R CLEAR         
01CFA0:  20 20 20 43 6C 65 61 72 20 74 68 65 20 73 63 72       Clear the scr
01CFB0:  65 65 6E 20 28 74 6F 20 69 6E 6B 20 7A 65 72 6F    een (to ink zero
01CFC0:  29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 39 33 20    ).....       93 
01CFD0:  20 23 42 43 31 37 20 20 53 43 52 20 43 48 41 52     #BC17  SCR CHAR
01CFE0:  20 4C 49 4D 49 54 53 20 20 20 20 20 20 41 73 20     LIMITS      As 
01CFF0:  6B 20 73 69 7A 65 20 6F 66 20 74 68 65 20 73 63    k size of the sc
01D000:  72 65 65 6E 20 69 6E 20 63 68 61 72 61 63 74 65    reen in characte
01D010:  72 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 53 43    rs.....       SC
01D020:  52 45 45 4E 20 41 44 44 52 45 53 53 45 53 0D 0A    REEN ADDRESSES..
01D030:  0D 0A 20 20 20 20 20 20 20 39 34 20 20 23 42 43    ..       94  #BC
01D040:  31 41 20 20 53 43 52 20 43 48 41 52 20 50 4F 53    1A  SCR CHAR POS
01D050:  49 54 49 4F 4E 20 20 20 20 43 6F 6E 76 65 72 74    ITION    Convert
01D060:  20 20 70 68 79 73 69 63 61 6C 20 20 63 6F 6F 72      physical  coor
01D070:  64 69 6E 61 74 65 73 20 20 74 6F 20 20 20 61 0D    dinates  to   a.
01D080:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01D090:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D0A0:  20 20 20 20 20 20 20 20 73 63 72 65 65 6E 20 70            screen p
01D0B0:  6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20 20    osition.....    
01D0C0:  20 20 20 39 35 20 20 23 42 43 31 44 20 20 53 43       95  #BC1D  SC
01D0D0:  52 20 44 4F 54 20 50 4F 53 49 54 49 4F 4E 20 20    R DOT POSITION  
01D0E0:  20 20 20 43 6F 6E 76 65 72 74 20 62 61 73 65 20       Convert base 
01D0F0:  63 6F 6F 72 64 69 6E 61 74 65 73 20 74 6F 20 20    coordinates to  
01D100:  61 20 20 73 63 72 65 65 6E 0D 0A 20 20 20 20 20    a  screen..     
01D110:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D120:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D130:  20 20 70 6F 73 69 74 69 6F 6E 2E 0D 0A 0D 0A 20      position..... 
01D140:  20 20 20 20 20 20 39 36 20 20 23 42 43 32 30 20          96  #BC20 
01D150:  20 53 43 52 20 4E 45 58 54 20 42 59 54 45 20 20     SCR NEXT BYTE  
01D160:  20 20 20 20 20 20 53 74 65 70 20 61 20 73 63 72          Step a scr
01D170:  65 65 6E 20 61 64 64 72 65 73 73 20 72 69 67 68    een address righ
01D180:  74 20 6F 6E 65 20 62 79 74 65 2E 0D 0A 0D 0A 0D    t one byte......
01D190:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54    .....       AMST
01D1A0:  52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36    RAD CPC464/664/6
01D1B0:  31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20    128 FIRMWARE    
01D1C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D1D0:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 34             page 14
01D1E0:  2E 37 0D 0A 1A 20 20 20 20 20 20 20 20 20 20 70    .7...          p
01D1F0:  61 67 65 20 31 34 2E 31 30 0D 0A 1A 6F 66 20 74    age 14.10...of t
01D200:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
01D210:  20 20 20 39 37 20 20 23 42 43 32 33 20 20 53 43       97  #BC23  SC
01D220:  52 20 50 52 45 56 20 42 59 54 45 20 20 20 20 20    R PREV BYTE     
01D230:  20 20 20 53 74 65 70 20 61 20 73 63 72 65 65 6E       Step a screen
01D240:  20 61 64 64 72 65 73 73 20 6C 65 66 74 20 6F 6E     address left on
01D250:  65 20 62 79 74 65 2E 0D 0A 0D 0A 20 20 20 20 20    e byte.....     
01D260:  20 20 39 38 20 20 23 42 43 32 36 20 20 53 43 52      98  #BC26  SCR
01D270:  20 4E 45 58 54 20 4C 49 4E 45 20 20 20 20 20 20     NEXT LINE      
01D280:  20 20 53 74 65 70 20 61 20 73 63 72 65 65 6E 20      Step a screen 
01D290:  61 64 64 72 65 73 73 20 64 6F 77 6E 20 6F 6E 65    address down one
01D2A0:  20 6C 69 6E 65 2E 0D 0A 0D 0A 20 20 20 20 20 20     line.....      
01D2B0:  20 39 39 20 20 23 42 43 32 39 20 20 53 43 52 20     99  #BC29  SCR 
01D2C0:  50 52 45 56 20 4C 49 4E 45 20 20 20 20 20 20 20    PREV LINE       
01D2D0:  20 53 74 65 70 20 61 20 73 63 72 65 65 6E 20 61     Step a screen a
01D2E0:  64 64 72 65 73 73 20 75 70 20 6F 6E 65 20 6C 69    ddress up one li
01D2F0:  6E 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ne.......       
01D300:  49 4E 4B 53 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    INKS......      
01D310:  20 31 30 30 20 23 42 43 32 43 20 20 53 43 52 20     100 #BC2C  SCR 
01D320:  49 4E 4B 20 45 4E 43 4F 44 45 20 20 20 20 20 20    INK ENCODE      
01D330:  20 45 6E 63 6F 64 65 20 61 6E 20 69 6E 6B 20 74     Encode an ink t
01D340:  6F 20 63 6F 76 65 72 20 61 6C 6C 20 70 69 78 65    o cover all pixe
01D350:  6C 73 20 69 6E 20 61 0D 0A 20 20 20 20 20 20 20    ls in a..       
01D360:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D370:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D380:  62 79 74 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    byte.....       
01D390:  31 30 31 20 23 42 43 32 46 20 20 53 43 52 20 49    101 #BC2F  SCR I
01D3A0:  4E 4B 20 44 45 43 4F 44 45 20 20 20 20 20 20 20    NK DECODE       
01D3B0:  44 65 63 6F 64 65 20 61 6E 20 65 6E 63 6F 64 65    Decode an encode
01D3C0:  64 20 69 6E 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20    d ink.....      
01D3D0:  20 31 30 32 20 23 42 43 33 32 20 20 53 43 52 20     102 #BC32  SCR 
01D3E0:  53 45 54 20 49 4E 4B 20 20 20 20 20 20 20 20 20    SET INK         
01D3F0:  20 53 65 74 20 74 68 65 20 63 6F 6C 6F 75 72 73     Set the colours
01D400:  20 69 6E 20 77 68 69 63 68 20 74 6F 20 64 69 73     in which to dis
01D410:  70 6C 61 79 20 61 6E 0D 0A 20 20 20 20 20 20 20    play an..       
01D420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D430:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D440:  69 6E 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ink.....       1
01D450:  30 33 20 23 42 43 33 35 20 20 53 43 52 20 47 45    03 #BC35  SCR GE
01D460:  54 20 49 4E 4B 20 20 20 20 20 20 20 20 20 20 41    T INK          A
01D470:  73 6B 20 74 68 65 20 63 6F 6C 6F 75 72 73 20 61    sk the colours a
01D480:  6E 20 20 69 6E 6B 20 20 69 73 20 20 63 75 72 72    n  ink  is  curr
01D490:  65 6E 74 6C 79 0D 0A 20 20 20 20 20 20 20 20 20    ently..         
01D4A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D4B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 69                  di
01D4C0:  73 70 6C 61 79 65 64 20 69 6E 2E 0D 0A 0D 0A 20    splayed in..... 
01D4D0:  20 20 20 20 20 20 31 30 34 20 23 42 43 33 38 20          104 #BC38 
01D4E0:  20 53 43 52 20 53 45 54 20 42 4F 52 44 45 52 20     SCR SET BORDER 
01D4F0:  20 20 20 20 20 20 53 65 74 20 74 68 65 20 63 6F          Set the co
01D500:  6C 6F 75 72 73 20 69 6E 20 20 77 68 69 63 68 20    lours in  which 
01D510:  20 74 6F 20 20 64 69 73 70 6C 61 79 0D 0A 20 20     to  display..  
01D520:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D530:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D540:  20 20 20 20 20 74 68 65 20 62 6F 72 64 65 72 2E         the border.
01D550:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 30 35 20 23    ....       105 #
01D560:  42 43 33 42 20 20 53 43 52 20 47 45 54 20 42 4F    BC3B  SCR GET BO
01D570:  52 44 45 52 20 20 20 20 20 20 20 41 73 6B 20 20    RDER       Ask  
01D580:  74 68 65 20 20 20 63 6F 6C 6F 75 72 73 20 20 20    the   colours   
01D590:  74 68 65 20 20 20 62 6F 72 64 65 72 20 20 20 69    the   border   i
01D5A0:  73 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    s..             
01D5B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D5C0:  20 20 20 20 20 20 20 20 20 20 63 75 72 72 65 6E              curren
01D5D0:  74 6C 79 20 64 69 73 70 6C 61 79 65 64 20 69 6E    tly displayed in
01D5E0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 30 36 20    .....       106 
01D5F0:  23 42 43 33 45 20 20 53 43 52 20 53 45 54 20 46    #BC3E  SCR SET F
01D600:  4C 41 53 48 49 4E 47 20 20 20 20 20 53 65 74 20    LASHING     Set 
01D610:  74 68 65 20 66 6C 61 73 68 20 70 65 72 69 6F 64    the flash period
01D620:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 30 37    s.....       107
01D630:  20 23 42 43 34 31 20 20 53 43 52 20 47 45 54 20     #BC41  SCR GET 
01D640:  46 4C 41 53 48 49 4E 47 20 20 20 20 20 41 73 6B    FLASHING     Ask
01D650:  20 74 68 65 20 63 75 72 72 65 6E 74 20 66 6C 61     the current fla
01D660:  73 68 20 70 65 72 69 6F 64 73 2E 0D 0A 0D 0A 0D    sh periods......
01D670:  0A 20 20 20 20 20 20 20 4D 49 53 43 45 4C 4C 41    .       MISCELLA
01D680:  4E 45 4F 55 53 0D 0A 0D 0A 0D 0A 20 20 20 20 20    NEOUS......     
01D690:  20 20 31 30 38 20 23 42 43 34 34 20 20 53 43 52      108 #BC44  SCR
01D6A0:  20 46 49 4C 4C 20 42 4F 58 20 20 20 20 20 20 20     FILL BOX       
01D6B0:  20 20 46 69 6C 6C 20 61 20 63 68 61 72 61 63 74      Fill a charact
01D6C0:  65 72 20 61 72 65 61 20 20 6F 66 20 20 74 68 65    er area  of  the
01D6D0:  20 20 73 63 72 65 65 6E 0D 0A 20 20 20 20 20 20      screen..      
01D6E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D6F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D700:  20 77 69 74 68 20 61 6E 20 69 6E 6B 2E 0D 0A 0D     with an ink....
01D710:  0A 20 20 20 20 20 20 20 31 30 39 20 23 42 43 34    .       109 #BC4
01D720:  37 20 20 53 43 52 20 46 4C 4F 4F 44 20 42 4F 58    7  SCR FLOOD BOX
01D730:  20 20 20 20 20 20 20 20 46 69 6C 6C 20 61 20 62            Fill a b
01D740:  79 74 65 20 61 72 65 61 20 6F 66 20 74 68 65 20    yte area of the 
01D750:  73 63 72 65 65 6E 20 77 69 74 68 20 61 6E 0D 0A    screen with an..
01D760:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D770:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D780:  20 20 20 20 20 20 20 69 6E 6B 2E 0D 0A 0D 0A 20           ink..... 
01D790:  20 20 20 20 20 20 31 31 30 20 23 42 43 34 41 20          110 #BC4A 
01D7A0:  20 53 43 52 20 43 48 41 52 20 49 4E 56 45 52 54     SCR CHAR INVERT
01D7B0:  20 20 20 20 20 20 49 6E 76 65 72 74 20 61 20 63          Invert a c
01D7C0:  68 61 72 61 63 74 65 72 20 70 6F 73 69 74 69 6F    haracter positio
01D7D0:  6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 31 31    n.....       111
01D7E0:  20 23 42 43 34 44 20 20 53 43 52 20 48 57 20 52     #BC4D  SCR HW R
01D7F0:  4F 4C 4C 20 20 20 20 20 20 20 20 20 20 4D 6F 76    OLL          Mov
01D800:  65 20 74 68 65 20 77 68 6F 6C 65 20 73 63 72 65    e the whole scre
01D810:  65 6E 20 75 70 20 6F 72 20 64 6F 77 6E 20 65 69    en up or down ei
01D820:  67 68 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ght..           
01D830:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D840:  20 20 20 20 20 20 20 20 20 20 20 20 70 69 78 65                pixe
01D850:  6C 20 6C 69 6E 65 73 20 28 6F 6E 65 20 63 68 61    l lines (one cha
01D860:  72 61 63 74 65 72 29 2E 0D 0A 0D 0A 20 20 20 20    racter).....    
01D870:  20 20 20 31 31 32 20 23 42 43 35 30 20 20 53 43       112 #BC50  SC
01D880:  52 20 53 57 20 52 4F 4C 4C 20 20 20 20 20 20 20    R SW ROLL       
01D890:  20 20 20 4D 6F 76 65 20 61 6E 20 61 72 65 61 20       Move an area 
01D8A0:  6F 66 20 74 68 65 20 73 63 72 65 65 6E 20 75 70    of the screen up
01D8B0:  20 6F 72 20 20 64 6F 77 6E 0D 0A 20 20 20 20 20     or  down..     
01D8C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D8D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D8E0:  20 20 65 69 67 68 74 20 70 69 78 65 6C 20 6C 69      eight pixel li
01D8F0:  6E 65 73 20 28 6F 6E 65 20 63 68 61 72 61 63 74    nes (one charact
01D900:  65 72 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    er).....       1
01D910:  31 33 20 23 42 43 35 33 20 20 53 43 52 20 55 4E    13 #BC53  SCR UN
01D920:  50 41 43 4B 20 20 20 20 20 20 20 20 20 20 20 45    PACK           E
01D930:  78 70 61 6E 64 20 20 61 20 20 63 68 61 72 61 63    xpand  a  charac
01D940:  74 65 72 20 20 6D 61 74 72 69 78 20 20 66 6F 72    ter  matrix  for
01D950:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 20 20      the..         
01D960:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01D970:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 75                  cu
01D980:  72 72 65 6E 74 20 73 63 72 65 65 6E 20 6D 6F 64    rrent screen mod
01D990:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 31 34    e.....       114
01D9A0:  20 23 42 43 35 36 20 20 53 43 52 20 52 45 50 41     #BC56  SCR REPA
01D9B0:  43 4B 20 20 20 20 20 20 20 20 20 20 20 43 6F 6D    CK           Com
01D9C0:  70 72 65 73 73 20 61 20 20 63 68 61 72 61 63 74    press a  charact
01D9D0:  65 72 20 20 6D 61 74 72 69 78 20 20 74 6F 20 20    er  matrix  to  
01D9E0:  74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    the..           
01D9F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DA00:  20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 6E                stan
01DA10:  64 61 72 64 20 66 6F 72 6D 2E 0D 0A 0D 0A 0D 0A    dard form.......
01DA20:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
01DA30:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
01DA40:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
01DA50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DA60:  20 20 20 20 20 20 20 20 20 20 70 61 67 65 20 31              page 1
01DA70:  34 2E 38 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    4.8.............
01DA80:  0A 20 20 20 20 20 20 20 31 31 35 20 23 42 43 35    .       115 #BC5
01DA90:  39 20 20 53 43 52 20 41 43 43 45 53 53 20 20 20    9  SCR ACCESS   
01DAA0:  20 20 20 20 20 20 20 20 53 65 74 20 74 68 65 20            Set the 
01DAB0:  20 73 63 72 65 65 6E 20 20 77 72 69 74 65 20 20     screen  write  
01DAC0:  6D 6F 64 65 20 20 66 6F 72 20 20 74 68 65 0D 0A    mode  for  the..
01DAD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DAE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DAF0:  20 20 20 20 20 20 20 47 72 61 70 68 69 63 73 20           Graphics 
01DB00:  56 44 55 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    VDU.....       1
01DB10:  31 36 20 23 42 43 35 43 20 20 53 43 52 20 50 49    16 #BC5C  SCR PI
01DB20:  58 45 4C 53 20 20 20 20 20 20 20 20 20 20 20 57    XELS           W
01DB30:  72 69 74 65 20 61 20 70 69 78 65 6C 20 74 6F 20    rite a pixel to 
01DB40:  74 68 65 20 20 73 63 72 65 65 6E 20 20 69 67 6E    the  screen  ign
01DB50:  6F 72 69 6E 67 0D 0A 0D 0A 20 20 20 20 20 20 20    oring....       
01DB60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DB70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DB80:  74 68 65 20 47 72 61 70 68 69 63 73 20 56 44 55    the Graphics VDU
01DB90:  20 77 72 69 74 65 20 6D 6F 64 65 2E 0D 0A 20 20     write mode...  
01DBA0:  20 20 20 20 20 4C 49 4E 45 20 44 52 41 57 49 4E         LINE DRAWIN
01DBB0:  47 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 31    G......       11
01DBC0:  37 20 23 42 43 35 37 20 20 53 43 52 20 48 4F 52    7 #BC57  SCR HOR
01DBD0:  49 5A 4F 4E 54 41 4C 20 20 20 20 20 20 20 50 6C    IZONTAL       Pl
01DBE0:  6F 74 20 61 20 70 75 72 65 6C 79 20 68 6F 72 69    ot a purely hori
01DBF0:  7A 6F 6E 74 61 6C 20 6C 69 6E 65 2E 0D 0A 0D 0A    zontal line.....
01DC00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
01DC10:  19 00 00 00 02 09 50 E5 19 00 C1 02 00 00 00 02    ......P.........
01DC20:  19 00 C2 02 00 00 00 02 19 00 C3 02 00 00 00 02    ................
01DC30:  19 00 C4 02 00 00 00 02 19 00 C5 02 00 00 00 02    ................
01DC40:  19 00 C6 02 00 00 00 02 19 00 C7 02 00 00 00 02    ................
01DC50:  19 00 C8 02 00 00 00 02 19 00 C9 02 00 00 00 02    ................
01DC60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DC70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DC80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DC90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DCF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01DD00:  20 20 20 20 20 20 20 31 31 38 20 23 42 43 36 32           118 #BC62
01DD10:  20 20 53 43 52 20 56 45 52 54 49 43 41 4C 20 20      SCR VERTICAL  
01DD20:  20 20 20 20 20 20 20 50 6C 6F 74 20 61 20 70 75           Plot a pu
01DD30:  72 65 6C 79 20 76 65 72 74 69 63 61 6C 20 6C 69    rely vertical li
01DD40:  6E 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ne.......       
01DD50:  31 34 2E 31 2E 35 20 45 6E 74 72 69 65 73 20 74    14.1.5 Entries t
01DD60:  6F 20 74 68 65 20 43 61 73 73 65 74 74 65 20 4D    o the Cassette M
01DD70:  61 6E 61 67 65 72 2F 41 4D 53 44 4F 53 0D 0A 0D    anager/AMSDOS...
01DD80:  0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 43 61    ...       The Ca
01DD90:  73 73 65 74 74 65 20 4D 61 6E 61 67 65 72 20 68    ssette Manager h
01DDA0:  61 6E 64 6C 65 73 20 72 65 61 64 69 6E 67 20 66    andles reading f
01DDB0:  69 6C 65 73 20 66 72 6F 6D 20 74 61 70 65 20 61    iles from tape a
01DDC0:  6E 64 20 77 72 69 74 69 6E 67 20 66 69 6C 65 73    nd writing files
01DDD0:  0D 0A 20 20 20 20 20 20 20 74 6F 20 74 61 70 65    ..       to tape
01DDE0:  2E 20 41 4D 53 44 4F 53 20 69 6E 74 65 72 63 65    . AMSDOS interce
01DDF0:  70 74 73 20 74 68 65 20 73 74 61 72 72 65 64 20    pts the starred 
01DE00:  65 6E 74 72 69 65 73 20 61 6E 64 20 72 65 64 69    entries and redi
01DE10:  72 65 63 74 73 20 20 74 68 65 6D 20 20 73 6F 0D    rects  them  so.
01DE20:  0A 20 20 20 20 20 20 20 74 68 65 79 20 72 65 61    .       they rea
01DE30:  64 20 66 72 6F 6D 20 61 6E 64 20 77 72 69 74 65    d from and write
01DE40:  20 74 6F 20 64 69 73 63 2E 20 54 68 65 20 65 78     to disc. The ex
01DE50:  74 65 72 6E 61 6C 20 63 6F 6D 6D 61 6E 64 73 20    ternal commands 
01DE60:  54 41 50 45 20 61 6E 64 20 20 44 49 53 43 0D 0A    TAPE and  DISC..
01DE70:  20 20 20 20 20 20 20 63 61 6E 20 62 65 20 75 73           can be us
01DE80:  65 64 20 74 6F 20 73 77 69 74 63 68 20 62 65 74    ed to switch bet
01DE90:  77 65 65 6E 20 74 68 65 20 74 61 70 65 20 20 61    ween the tape  a
01DEA0:  6E 64 20 20 64 69 73 63 20 20 76 65 72 73 69 6F    nd  disc  versio
01DEB0:  6E 73 20 20 6F 66 20 20 74 68 65 73 65 0D 0A 20    ns  of  these.. 
01DEC0:  20 20 20 20 20 20 72 6F 75 74 69 6E 65 73 20 28          routines (
01DED0:  73 65 65 20 73 65 63 74 69 6F 6E 20 31 34 2E 36    see section 14.6
01DEE0:  29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49 4E 49    ).....       INI
01DEF0:  54 49 41 4C 49 5A 41 54 49 4F 4E 0D 0A 0D 0A 20    TIALIZATION.... 
01DF00:  20 20 20 20 20 20 31 31 39 20 23 42 43 36 35 20          119 #BC65 
01DF10:  20 43 41 53 20 49 4E 49 54 49 41 4C 49 53 45 20     CAS INITIALISE 
01DF20:  20 20 20 20 20 20 49 6E 69 74 69 61 6C 69 7A 65          Initialize
01DF30:  20 20 74 68 65 20 20 43 61 73 73 65 74 74 65 20      the  Cassette 
01DF40:  20 4D 61 6E 61 67 65 72 20 20 20 2D 0D 0A 20 20     Manager   -..  
01DF50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DF60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DF70:  20 20 20 20 20 63 6C 6F 73 65 20 61 6C 6C 20 73         close all s
01DF80:  74 72 65 61 6D 73 2C 20 73 65 74 20 20 64 65 66    treams, set  def
01DF90:  61 75 6C 74 20 20 73 70 65 65 64 0D 0A 20 20 20    ault  speed..   
01DFA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DFB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01DFC0:  20 20 20 20 61 6E 64 20 65 6E 61 62 6C 65 20 6D        and enable m
01DFD0:  65 73 73 61 67 65 73 2E 0D 0A 0D 0A 20 20 20 20    essages.....    
01DFE0:  20 20 20 31 32 30 20 23 42 43 36 38 20 20 43 41       120 #BC68  CA
01DFF0:  53 20 53 45 54 20 53 50 45 45 44 20 20 20 20 20    S SET SPEED     
01E000:  20 20 20 53 65 74 20 74 68 65 20 77 72 69 74 65       Set the write
01E010:  20 73 70 65 65 64 2E 0D 0A 0D 0A 20 20 20 20 20     speed.....     
01E020:  20 20 31 32 31 20 23 42 43 36 42 20 20 43 41 53      121 #BC6B  CAS
01E030:  20 4E 4F 49 53 59 20 20 20 20 20 20 20 20 20 20     NOISY          
01E040:  20 20 45 6E 61 62 6C 65 20 6F 72 20 64 69 73 61      Enable or disa
01E050:  62 6C 65 20 70 72 6F 6D 70 74 20 6D 65 73 73 61    ble prompt messa
01E060:  67 65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4D    ges.....       M
01E070:  4F 54 4F 52 20 43 4F 4E 54 52 4F 4C 0D 0A 0D 0A    OTOR CONTROL....
01E080:  20 20 20 20 20 20 20 31 32 32 20 23 42 43 36 45           122 #BC6E
01E090:  20 20 43 41 53 20 53 54 41 52 54 20 4D 4F 54 4F      CAS START MOTO
01E0A0:  52 20 20 20 20 20 20 53 74 61 72 74 20 74 68 65    R      Start the
01E0B0:  20 63 61 73 73 65 74 74 65 20 6D 6F 74 6F 72 2E     cassette motor.
01E0C0:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 32 33 20 23    ....       123 #
01E0D0:  42 43 37 31 20 20 43 41 53 20 53 54 4F 50 20 4D    BC71  CAS STOP M
01E0E0:  4F 54 4F 52 20 20 20 20 20 20 20 53 74 6F 70 20    OTOR       Stop 
01E0F0:  74 68 65 20 63 61 73 73 65 74 74 65 20 6D 6F 74    the cassette mot
01E100:  6F 72 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 32    or.....       12
01E110:  34 20 23 42 43 37 34 20 20 43 41 53 20 52 45 53    4 #BC74  CAS RES
01E120:  54 4F 52 45 20 4D 4F 54 4F 52 20 20 20 20 52 65    TORE MOTOR    Re
01E130:  73 74 6F 72 65 20 20 70 72 65 76 69 6F 75 73 20    store  previous 
01E140:  20 73 74 61 74 65 20 20 6F 66 20 20 63 61 73 73     state  of  cass
01E150:  65 74 74 65 0D 0A 20 20 20 20 20 20 20 20 20 20    ette..          
01E160:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E170:  20 20 20 20 20 20 20 20 20 20 20 20 20 6D 6F 74                 mot
01E180:  6F 72 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    or.........     
01E190:  20 20 52 45 41 44 49 4E 47 20 46 49 4C 45 53 0D      READING FILES.
01E1A0:  0A 0D 0A 20 20 20 20 20 20 20 31 32 35 20 23 42    ...       125 #B
01E1B0:  43 37 37 20 20 2A 43 41 53 20 49 4E 20 4F 50 45    C77  *CAS IN OPE
01E1C0:  4E 20 20 20 20 20 20 20 20 20 4F 70 65 6E 20 61    N         Open a
01E1D0:  20 66 69 6C 65 20 66 6F 72 20 69 6E 70 75 74 2E     file for input.
01E1E0:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 32 36 20 23    ....       126 #
01E1F0:  42 43 37 41 20 20 2A 43 41 53 20 49 4E 20 43 4C    BC7A  *CAS IN CL
01E200:  4F 53 45 20 20 20 20 20 20 20 20 43 6C 6F 73 65    OSE        Close
01E210:  20 74 68 65 20 69 6E 70 75 74 20 66 69 6C 65 20     the input file 
01E220:  70 72 6F 70 65 72 6C 79 2E 0D 0A 0D 0A 20 20 20    properly.....   
01E230:  20 20 20 20 31 32 37 20 23 42 43 37 44 20 20 2A        127 #BC7D  *
01E240:  43 41 53 20 49 4E 20 41 42 41 4E 44 4F 4E 20 20    CAS IN ABANDON  
01E250:  20 20 20 20 43 6C 6F 73 65 20 74 68 65 20 69 6E        Close the in
01E260:  70 75 74 20 66 69 6C 65 20 69 6D 6D 65 64 69 61    put file immedia
01E270:  74 65 6C 79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    tely.....       
01E280:  31 32 38 20 23 42 43 38 30 20 20 2A 43 41 53 20    128 #BC80  *CAS 
01E290:  49 4E 20 43 48 41 52 20 20 20 20 20 20 20 20 20    IN CHAR         
01E2A0:  52 65 61 64 20 61 20 63 68 61 72 61 63 74 65 72    Read a character
01E2B0:  20 66 72 6F 6D 20 74 68 65 20 69 6E 70 75 74 20     from the input 
01E2C0:  66 69 6C 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    file.....       
01E2D0:  31 32 39 20 23 42 43 38 33 20 20 2A 43 41 53 20    129 #BC83  *CAS 
01E2E0:  49 4E 20 44 49 52 45 43 54 20 20 20 20 20 20 20    IN DIRECT       
01E2F0:  52 65 61 64 20 74 68 65 20 69 6E 70 75 74 20 66    Read the input f
01E300:  69 6C 65 20 69 6E 74 6F 20 73 74 6F 72 65 2E 0D    ile into store..
01E310:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
01E320:  41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36    AMSTRAD CPC464/6
01E330:  36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45    64/6128 FIRMWARE
01E340:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E350:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
01E360:  65 20 31 34 2E 39 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    e 14.9..........
01E370:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 33 30 20 23    ....       130 #
01E380:  42 43 38 36 20 20 2A 43 41 53 20 52 45 54 55 52    BC86  *CAS RETUR
01E390:  4E 20 20 20 20 20 20 20 20 20 20 50 75 74 20 74    N          Put t
01E3A0:  68 65 20 6C 61 73 74 20 63 68 61 72 61 63 74 65    he last characte
01E3B0:  72 20 72 65 61 64 20 62 61 63 6B 2E 0D 0A 0D 0A    r read back.....
01E3C0:  20 20 20 20 20 20 20 31 33 31 20 23 42 43 38 39           131 #BC89
01E3D0:  20 20 2A 43 41 53 20 54 45 53 54 20 45 4F 46 20      *CAS TEST EOF 
01E3E0:  20 20 20 20 20 20 20 48 61 76 65 20 77 65 20 72           Have we r
01E3F0:  65 61 63 68 65 64 20 74 68 65 20 65 6E 64 20 20    eached the end  
01E400:  6F 66 20 20 74 68 65 20 20 66 69 6C 65 0D 0A 20    of  the  file.. 
01E410:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E430:  20 20 20 20 20 20 79 65 74 3F 0D 0A 0D 0A 20 20          yet?....  
01E440:  20 20 20 20 20 57 52 49 54 49 4E 47 20 46 49 4C         WRITING FIL
01E450:  45 53 0D 0A 0D 0A 20 20 20 20 20 20 20 31 33 32    ES....       132
01E460:  20 23 42 43 38 43 20 2A 43 41 53 20 4F 55 54 20     #BC8C *CAS OUT 
01E470:  4F 50 45 4E 20 20 20 20 20 20 20 20 20 4F 70 65    OPEN         Ope
01E480:  6E 20 61 20 66 69 6C 65 20 66 6F 72 20 6F 75 74    n a file for out
01E490:  70 75 74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    put.....       1
01E4A0:  33 33 20 23 42 43 38 46 20 2A 43 41 53 20 4F 55    33 #BC8F *CAS OU
01E4B0:  54 20 43 4C 4F 53 45 20 20 20 20 20 20 20 20 43    T CLOSE        C
01E4C0:  6C 6F 73 65 20 74 68 65 20 6F 75 74 70 75 74 20    lose the output 
01E4D0:  66 69 6C 65 20 70 72 6F 70 65 72 6C 79 2E 0D 0A    file properly...
01E4E0:  0D 0A 20 20 20 20 20 20 20 31 33 34 20 23 42 43    ..       134 #BC
01E4F0:  39 32 20 20 2A 43 41 53 20 4F 55 54 20 41 42 41    92  *CAS OUT ABA
01E500:  4E 44 4F 4E 20 20 20 20 20 43 6C 6F 73 65 20 74    NDON     Close t
01E510:  68 65 20 6F 75 74 70 75 74 20 66 69 6C 65 20 69    he output file i
01E520:  6D 6D 65 64 69 61 74 65 6C 79 2E 0D 0A 0D 0A 20    mmediately..... 
01E530:  20 20 20 20 20 20 31 33 35 20 23 42 43 39 35 20          135 #BC95 
01E540:  20 2A 43 41 53 20 4F 55 54 20 43 48 41 52 20 20     *CAS OUT CHAR  
01E550:  20 20 20 20 20 20 57 72 69 74 65 20 61 20 63 68          Write a ch
01E560:  61 72 61 63 74 65 72 20 74 6F 20 74 68 65 20 6F    aracter to the o
01E570:  75 74 70 75 74 20 66 69 6C 65 2E 0D 0A 0D 0A 20    utput file..... 
01E580:  20 20 20 20 20 20 31 33 36 20 23 42 43 39 38 20          136 #BC98 
01E590:  20 2A 43 41 53 20 4F 55 54 20 44 49 52 45 43 54     *CAS OUT DIRECT
01E5A0:  20 20 20 20 20 20 57 72 69 74 65 20 74 68 65 20          Write the 
01E5B0:  6F 75 74 70 75 74 20 20 66 69 6C 65 20 20 64 69    output  file  di
01E5C0:  72 65 63 74 6C 79 20 20 66 72 6F 6D 0D 0A 20 20    rectly  from..  
01E5D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E5E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E5F0:  20 20 20 20 20 73 74 6F 72 65 2E 0D 0A 0D 0A 20         store..... 
01E600:  20 20 20 20 20 20 43 41 54 41 4C 4F 47 55 49 4E          CATALOGUIN
01E610:  47 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 33    G......       13
01E620:  37 20 23 42 43 39 42 20 20 2A 43 41 53 20 43 41    7 #BC9B  *CAS CA
01E630:  54 41 4C 4F 47 20 20 20 20 20 20 20 20 20 47 65    TALOG         Ge
01E640:  6E 65 72 61 74 65 20 61 20 63 61 74 61 6C 6F 67    nerate a catalog
01E650:  75 65 20 66 72 6F 6D 20 74 68 65 20 74 61 70 65    ue from the tape
01E660:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 45    .......       RE
01E670:  43 4F 52 44 53 0D 0A 0D 0A 0D 0A 20 20 20 20 20    CORDS......     
01E680:  20 20 31 33 38 20 23 42 43 39 45 20 20 43 41 53      138 #BC9E  CAS
01E690:  20 57 52 49 54 45 20 20 20 20 20 20 20 20 20 20     WRITE          
01E6A0:  20 20 57 72 69 74 65 20 61 20 72 65 63 6F 72 64      Write a record
01E6B0:  20 74 6F 20 74 61 70 65 2E 0D 0A 0D 0A 20 20 20     to tape.....   
01E6C0:  20 20 20 20 31 33 39 20 23 42 43 41 31 20 20 43        139 #BCA1  C
01E6D0:  41 53 20 52 45 41 44 20 20 20 20 20 20 20 20 20    AS READ         
01E6E0:  20 20 20 20 52 65 61 64 20 61 20 72 65 63 6F 72        Read a recor
01E6F0:  64 20 66 72 6F 6D 20 74 61 70 65 2E 0D 0A 0D 0A    d from tape.....
01E700:  20 20 20 20 20 20 20 31 34 30 20 23 42 43 41 34           140 #BCA4
01E710:  20 20 43 41 53 20 43 48 45 43 4B 20 20 20 20 20      CAS CHECK     
01E720:  20 20 20 20 20 20 20 43 6F 6D 70 61 72 65 20 61           Compare a
01E730:  20 20 72 65 63 6F 72 64 20 20 6F 6E 20 20 74 61      record  on  ta
01E740:  70 65 20 20 77 69 74 68 20 20 74 68 65 0D 0A 20    pe  with  the.. 
01E750:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E760:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E770:  20 20 20 20 20 20 63 6F 6E 74 65 6E 74 73 20 6F          contents o
01E780:  66 20 73 74 6F 72 65 2E 0D 0A 0D 0A 0D 0A 20 20    f store.......  
01E790:  20 20 20 20 20 31 34 2E 31 2E 36 20 45 6E 74 72         14.1.6 Entr
01E7A0:  69 65 73 20 74 6F 20 74 68 65 20 53 6F 75 6E 64    ies to the Sound
01E7B0:  20 4D 61 6E 61 67 65 72 2E 0D 0A 0D 0A 0D 0A 20     Manager....... 
01E7C0:  20 20 20 20 20 20 54 68 65 20 53 6F 75 6E 64 20          The Sound 
01E7D0:  4D 61 6E 61 67 65 72 20 63 6F 6E 74 72 6F 6C 73    Manager controls
01E7E0:  20 74 68 65 20 73 6F 75 6E 64 20 63 68 69 70 2E     the sound chip.
01E7F0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 4E 49    ......       INI
01E800:  54 49 41 4C 49 5A 41 54 49 4F 4E 0D 0A 0D 0A 20    TIALIZATION.... 
01E810:  20 20 20 20 20 20 31 34 31 20 23 42 43 41 37 20          141 #BCA7 
01E820:  20 53 4F 55 4E 44 20 52 45 53 45 54 20 20 20 20     SOUND RESET    
01E830:  20 20 20 20 20 20 52 65 73 65 74 20 74 68 65 20          Reset the 
01E840:  53 6F 75 6E 64 20 20 4D 61 6E 61 67 65 72 20 20    Sound  Manager  
01E850:  2D 20 20 73 68 75 74 20 20 74 68 65 0D 0A 20 20    -  shut  the..  
01E860:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E870:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E880:  20 20 20 20 20 73 6F 75 6E 64 20 63 68 69 70 20         sound chip 
01E890:  20 75 70 20 20 61 6E 64 20 20 63 6C 65 61 72 20     up  and  clear 
01E8A0:  20 61 6C 6C 20 20 73 6F 75 6E 64 0D 0A 20 20 20     all  sound..   
01E8B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E8C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E8D0:  20 20 20 20 71 75 65 75 65 73 2E 0D 0A 0D 0A 20        queues..... 
01E8E0:  20 20 20 20 20 20 53 4F 55 4E 44 20 51 55 45 55          SOUND QUEU
01E8F0:  45 53 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ES......       1
01E900:  34 32 20 23 42 43 41 41 20 20 53 4F 55 4E 44 20    42 #BCAA  SOUND 
01E910:  51 55 45 55 45 20 20 20 20 20 20 20 20 20 20 41    QUEUE          A
01E920:  64 64 20 61 20 73 6F 75 6E 64 20 74 6F 20 61 20    dd a sound to a 
01E930:  73 6F 75 6E 64 20 71 75 65 75 65 2E 0D 0A 0D 0A    sound queue.....
01E940:  20 20 20 20 20 20 20 31 34 33 20 23 42 43 41 44           143 #BCAD
01E950:  20 20 53 4F 55 4E 44 20 43 48 45 43 4B 20 20 20      SOUND CHECK   
01E960:  20 20 20 20 20 20 20 41 73 6B 20 69 66 20 20 74           Ask if  t
01E970:  68 65 72 65 20 20 69 73 20 20 73 70 61 63 65 20    here  is  space 
01E980:  20 69 6E 20 20 61 20 20 73 6F 75 6E 64 0D 0A 20     in  a  sound.. 
01E990:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E9A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01E9B0:  20 20 20 20 20 20 71 75 65 75 65 2E 0D 0A 0D 0A          queue.....
01E9C0:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
01E9D0:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
01E9E0:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
01E9F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01EA00:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
01EA10:  31 34 2E 31 30 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    14.10...........
01EA20:  0A 0D 0A 20 20 20 20 20 20 20 31 34 34 20 23 42    ...       144 #B
01EA30:  43 42 30 20 20 53 4F 55 4E 44 20 41 52 4D 20 45    CB0  SOUND ARM E
01EA40:  56 45 4E 54 20 20 20 20 20 20 53 65 74 20 75 70    VENT      Set up
01EA50:  20 61 6E 20 65 76 65 6E 74 20 74 6F 20 62 65 20     an event to be 
01EA60:  72 75 6E 20 77 68 65 6E 20 61 20 73 6F 75 6E 64    run when a sound
01EA70:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
01EA80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01EA90:  20 20 20 20 20 20 20 20 20 71 75 65 75 65 20 62             queue b
01EAA0:  65 63 6F 6D 65 73 20 6E 6F 74 20 66 75 6C 6C 2E    ecomes not full.
01EAB0:  0D 0A 0D 0A 20 20 20 20 20 20 20 53 4F 55 4E 44    ....       SOUND
01EAC0:  53 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 34    S......       14
01EAD0:  35 20 23 42 43 42 33 20 20 53 4F 55 4E 44 20 52    5 #BCB3  SOUND R
01EAE0:  45 4C 45 41 53 45 20 20 20 20 20 20 20 20 41 6C    ELEASE        Al
01EAF0:  6C 6F 77 73 20 73 6F 75 6E 64 73 20 74 6F 20 68    lows sounds to h
01EB00:  61 70 70 65 6E 2E 0D 0A 0D 0A 20 20 20 20 20 20    appen.....      
01EB10:  20 31 34 36 20 23 42 43 42 36 20 20 53 4F 55 4E     146 #BCB6  SOUN
01EB20:  44 20 48 4F 4C 44 20 20 20 20 20 20 20 20 20 20    D HOLD          
01EB30:  20 53 74 6F 70 20 61 6C 6C 20 73 6F 75 6E 64 20     Stop all sound 
01EB40:  69 6E 20 6D 69 64 20 66 6C 69 67 68 74 2E 0D 0A    in mid flight...
01EB50:  0D 0A 20 20 20 20 20 20 20 31 34 37 20 23 42 43    ..       147 #BC
01EB60:  42 39 20 20 53 4F 55 4E 44 20 43 4F 4E 54 49 4E    B9  SOUND CONTIN
01EB70:  55 45 20 20 20 20 20 20 20 52 65 73 74 61 72 74    UE       Restart
01EB80:  20 73 6F 75 6E 64 20 20 61 66 74 65 72 20 20 74     sound  after  t
01EB90:  68 65 79 20 20 68 61 76 65 20 20 62 65 65 6E 0D    hey  have  been.
01EBA0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01EBB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01EBC0:  20 20 20 20 20 20 20 20 73 74 6F 70 70 65 64 2E            stopped.
01EBD0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 4E 56    ......       ENV
01EBE0:  45 4C 4F 50 45 53 0D 0A 0D 0A 0D 0A 20 20 20 20    ELOPES......    
01EBF0:  20 20 20 31 34 38 20 23 42 43 42 43 20 20 53 4F       148 #BCBC  SO
01EC00:  55 4E 44 20 41 4D 50 4C 20 45 4E 56 45 4C 4F 50    UND AMPL ENVELOP
01EC10:  45 20 20 53 65 74 20 75 70 20 61 6E 20 61 6D 70    E  Set up an amp
01EC20:  6C 69 74 75 64 65 20 65 6E 76 65 6C 6F 70 65 2E    litude envelope.
01EC30:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 34 39 20 23    ....       149 #
01EC40:  42 43 42 46 20 20 53 4F 55 4E 44 20 54 4F 4E 45    BCBF  SOUND TONE
01EC50:  20 45 4E 56 45 4C 4F 50 45 20 20 53 65 74 20 75     ENVELOPE  Set u
01EC60:  70 20 61 20 74 6F 6E 65 20 65 6E 76 65 6C 6F 70    p a tone envelop
01EC70:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 35 30    e.....       150
01EC80:  20 23 42 43 43 32 20 20 53 4F 55 4E 44 20 41 20     #BCC2  SOUND A 
01EC90:  41 44 44 52 45 53 53 20 20 20 20 20 20 47 65 74    ADDRESS      Get
01ECA0:  20 20 74 68 65 20 20 61 64 64 72 65 73 73 20 20      the  address  
01ECB0:  6F 66 20 20 20 61 6E 20 20 20 61 6D 70 6C 69 74    of   an   amplit
01ECC0:  75 64 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ude..           
01ECD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01ECE0:  20 20 20 20 20 20 20 20 20 20 20 20 65 6E 76 65                enve
01ECF0:  6C 6F 70 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    lope.....       
01ED00:  31 35 31 20 23 42 43 43 35 20 20 53 4F 55 4E 44    151 #BCC5  SOUND
01ED10:  20 54 20 41 44 44 52 45 53 53 20 20 20 20 20 20     T ADDRESS      
01ED20:  47 65 74 20 74 68 65 20 61 64 64 72 65 73 73 20    Get the address 
01ED30:  6F 66 20 61 20 74 6F 6E 65 20 65 6E 76 65 6C 6F    of a tone envelo
01ED40:  70 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    pe.......       
01ED50:  31 34 2E 31 2E 37 20 45 6E 74 72 69 65 73 20 74    14.1.7 Entries t
01ED60:  6F 20 74 68 65 20 4B 65 72 6E 65 6C 0D 0A 0D 0A    o the Kernel....
01ED70:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 4B 65 72    ..       The Ker
01ED80:  6E 65 6C 20 68 61 6E 64 6C 65 73 20 73 79 6E 63    nel handles sync
01ED90:  68 72 6F 6E 6F 75 73 20 61 6E 64 20 61 73 79 6E    hronous and asyn
01EDA0:  63 68 72 6F 6E 6F 75 73 20 65 76 65 6E 74 73 2E    chronous events.
01EDB0:  20 49 74 20 69 73 20 61 6C 73 6F 20 20 69 6E 0D     It is also  in.
01EDC0:  0A 20 20 20 20 20 20 20 63 68 61 72 67 65 20 6F    .       charge o
01EDD0:  66 20 74 68 65 20 73 74 6F 72 65 20 6D 61 70 20    f the store map 
01EDE0:  61 6E 64 20 73 77 69 74 63 68 69 6E 67 20 52 4F    and switching RO
01EDF0:  4D 73 20 6F 6E 20 61 6E 64 20 6F 66 66 2E 20 41    Ms on and off. A
01EE00:  70 61 72 74 20 66 72 6F 6D 20 20 74 68 65 0D 0A    part from  the..
01EE10:  20 20 20 20 20 20 20 65 6E 74 72 69 65 73 20 6C           entries l
01EE20:  69 73 74 65 64 20 62 65 6C 6F 77 2C 20 74 68 65    isted below, the
01EE30:  20 4B 65 72 6E 65 6C 20 68 61 73 20 69 74 73 20     Kernel has its 
01EE40:  6F 77 6E 20 6A 75 6D 70 62 6C 6F 63 6B 20 61 6E    own jumpblock an
01EE50:  64 20 61 20 6E 75 6D 62 65 72 20 6F 66 0D 0A 20    d a number of.. 
01EE60:  20 20 20 20 20 20 72 6F 75 74 69 6E 65 73 20 77          routines w
01EE70:  68 6F 73 65 20 61 64 64 72 65 73 73 65 73 20 61    hose addresses a
01EE80:  72 65 20 70 75 62 6C 69 73 68 65 64 2E 20 54 68    re published. Th
01EE90:  65 73 65 20 65 78 74 72 61 20 65 6E 74 72 69 65    ese extra entrie
01EEA0:  73 20 61 72 65 20 6C 69 73 74 65 64 0D 0A 20 20    s are listed..  
01EEB0:  20 20 20 20 20 69 6E 20 73 65 63 74 69 6F 6E 73         in sections
01EEC0:  20 31 34 2E 33 20 61 6E 64 20 31 34 2E 34 20 62     14.3 and 14.4 b
01EED0:  65 6C 6F 77 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    elow.......     
01EEE0:  20 20 49 4E 49 54 49 41 4C 49 5A 41 54 49 4F 4E      INITIALIZATION
01EEF0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 35 32    ......       152
01EF00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
01EF10:  1A 00 00 00 02 09 50 E5 1A 00 C1 02 00 00 00 02    ......P.........
01EF20:  1A 00 C2 02 00 00 00 02 1A 00 C3 02 00 00 00 02    ................
01EF30:  1A 00 C4 02 00 00 00 02 1A 00 C5 02 00 00 00 02    ................
01EF40:  1A 00 C6 02 00 00 00 02 1A 00 C7 02 00 00 00 02    ................
01EF50:  1A 00 C8 02 00 00 00 02 1A 00 C9 02 00 00 00 02    ................
01EF60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EF70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EF80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EF90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01EFF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
01F000:  20 23 42 43 43 38 20 20 4B 4C 20 43 48 4F 4B 45     #BCC8  KL CHOKE
01F010:  20 4F 46 46 20 20 20 20 20 20 20 20 20 52 65 73     OFF         Res
01F020:  65 74 20 74 68 65 20 4B 65 72 6E 65 6C 20 2D 20    et the Kernel - 
01F030:  20 63 6C 65 61 72 73 20 20 61 6C 6C 20 20 65 76     clears  all  ev
01F040:  65 6E 74 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ent..           
01F050:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F060:  20 20 20 20 20 20 20 20 20 20 20 20 71 75 65 75                queu
01F070:  65 73 20 65 74 63 2E 0D 0A 0D 0A 20 20 20 20 20    es etc.....     
01F080:  20 20 31 35 33 20 23 42 43 43 42 20 20 4B 4C 20      153 #BCCB  KL 
01F090:  52 4F 4D 20 57 41 4C 4B 20 20 20 20 20 20 20 20    ROM WALK        
01F0A0:  20 20 46 69 6E 64 20 20 61 6E 64 20 20 69 6E 69      Find  and  ini
01F0B0:  74 69 61 6C 69 7A 65 20 20 61 6C 6C 20 20 62 61    tialize  all  ba
01F0C0:  63 6B 67 72 6F 75 6E 64 0D 0A 20 20 20 20 20 20    ckground..      
01F0D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F0E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F0F0:  20 52 4F 4D 73 2E 0D 0A 0D 0A 20 20 20 20 20 20     ROMs.....      
01F100:  20 31 35 34 20 23 42 43 43 45 20 20 4B 4C 20 49     154 #BCCE  KL I
01F110:  4E 49 54 20 42 41 43 4B 20 20 20 20 20 20 20 20    NIT BACK        
01F120:  20 49 6E 69 74 69 61 6C 69 7A 65 20 20 61 20 20     Initialize  a  
01F130:  70 61 72 74 69 63 75 6C 61 72 20 20 20 62 61 63    particular   bac
01F140:  6B 67 72 6F 75 6E 64 0D 0A 20 20 20 20 20 20 20    kground..       
01F150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F160:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F170:  52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ROM.....       1
01F180:  35 35 20 23 42 43 44 31 20 20 4B 4C 20 4C 4F 47    55 #BCD1  KL LOG
01F190:  20 45 58 54 20 20 20 20 20 20 20 20 20 20 20 49     EXT           I
01F1A0:  6E 74 72 6F 64 75 63 65 20 61 6E 20 52 53 58 20    ntroduce an RSX 
01F1B0:  74 6F 20 74 68 65 20 66 69 72 6D 77 61 72 65 2E    to the firmware.
01F1C0:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 35 36 20 23    ....       156 #
01F1D0:  42 43 44 34 20 20 4B 4C 20 46 49 4E 44 20 43 4F    BCD4  KL FIND CO
01F1E0:  4D 4D 41 4E 44 20 20 20 20 20 20 53 65 61 72 63    MMAND      Searc
01F1F0:  68 20 66 6F 72 20 61 6E 20 52 53 58 20 6F 72 20    h for an RSX or 
01F200:  62 61 63 6B 67 72 6F 75 6E 64 20 52 4F 4D 20 6F    background ROM o
01F210:  72 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    r..             
01F220:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F230:  20 20 20 20 20 20 20 20 20 20 66 6F 72 65 67 72              foregr
01F240:  6F 75 6E 64 20 52 4F 4D 20 74 6F 20 70 72 6F 63    ound ROM to proc
01F250:  65 73 73 20 61 20 63 6F 6D 6D 61 6E 64 2E 0D 0A    ess a command...
01F260:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
01F270:  20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34 36       AMSTRAD CPC46
01F280:  34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57    4/664/6128 FIRMW
01F290:  41 52 45 20 20 20 20 20 20 20 20 20 20 20 20 20    ARE             
01F2A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70                   p
01F2B0:  61 67 65 20 31 34 2E 31 31 0D 0A 0D 0A 0D 0A 0D    age 14.11.......
01F2C0:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 46 52    .......       FR
01F2D0:  41 4D 45 20 46 4C 59 42 41 43 4B 20 4C 49 53 54    AME FLYBACK LIST
01F2E0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 35 37    ......       157
01F2F0:  20 23 42 43 44 37 20 20 4B 4C 20 4E 45 57 20 46     #BCD7  KL NEW F
01F300:  52 41 4D 45 20 46 4C 59 20 20 20 20 20 49 6E 69    RAME FLY     Ini
01F310:  74 69 61 6C 69 7A 65 20 61 6E 64 20 70 75 74 20    tialize and put 
01F320:  61 20 20 62 6C 6F 63 6B 20 20 6F 6E 74 6F 20 20    a  block  onto  
01F330:  74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    the..           
01F340:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F350:  20 20 20 20 20 20 20 20 20 20 20 20 66 72 61 6D                fram
01F360:  65 20 66 6C 79 62 61 63 6B 20 6C 69 73 74 2E 0D    e flyback list..
01F370:  0A 0D 0A 20 20 20 20 20 20 20 31 35 38 20 23 42    ...       158 #B
01F380:  43 44 41 20 20 4B 4C 20 41 44 44 20 46 52 41 4D    CDA  KL ADD FRAM
01F390:  45 20 46 4C 59 20 20 20 20 20 50 75 74 20 61 20    E FLY     Put a 
01F3A0:  62 6C 6F 63 6B 20 20 6F 6E 74 6F 20 20 74 68 65    block  onto  the
01F3B0:  20 20 66 72 61 6D 65 20 20 66 6C 79 62 61 63 6B      frame  flyback
01F3C0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
01F3D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F3E0:  20 20 20 20 20 20 20 20 20 6C 69 73 74 2E 0D 0A             list...
01F3F0:  0D 0A 20 20 20 20 20 20 20 31 35 39 20 23 42 43    ..       159 #BC
01F400:  44 44 20 20 4B 4C 20 44 45 4C 20 46 52 41 4D 45    DD  KL DEL FRAME
01F410:  20 46 4C 59 20 20 20 20 20 52 65 6D 6F 76 65 20     FLY     Remove 
01F420:  61 20 62 6C 6F 63 6B 20 66 72 6F 6D 20 74 68 65    a block from the
01F430:  20 66 72 61 6D 65 20 20 66 6C 79 62 61 63 6B 0D     frame  flyback.
01F440:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
01F450:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F460:  20 20 20 20 20 20 20 20 6C 69 73 74 2E 0D 0A 0D            list....
01F470:  0A 20 20 20 20 20 20 20 46 41 53 54 20 54 49 43    .       FAST TIC
01F480:  4B 45 52 20 4C 49 53 54 0D 0A 0D 0A 0D 0A 20 20    KER LIST......  
01F490:  20 20 20 20 20 31 36 30 20 23 42 43 45 30 20 20         160 #BCE0  
01F4A0:  4B 4C 20 4E 45 57 20 46 41 53 54 20 54 49 43 4B    KL NEW FAST TICK
01F4B0:  45 52 20 20 20 49 6E 69 74 69 61 6C 69 7A 65 20    ER   Initialize 
01F4C0:  61 6E 64 20 70 75 74 20 61 20 20 62 6C 6F 63 6B    and put a  block
01F4D0:  20 20 6F 6E 74 6F 20 20 74 68 65 0D 0A 20 20 20      onto  the..   
01F4E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F4F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F500:  20 20 20 20 66 61 73 74 20 74 69 63 6B 20 6C 69        fast tick li
01F510:  73 74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36    st.....       16
01F520:  31 20 23 42 43 45 33 20 20 4B 4C 20 41 44 44 20    1 #BCE3  KL ADD 
01F530:  46 41 53 54 20 54 49 43 4B 45 52 20 20 20 50 75    FAST TICKER   Pu
01F540:  74 20 61 20 62 6C 6F 63 6B 20 6F 6E 74 6F 20 74    t a block onto t
01F550:  68 65 20 66 61 73 74 20 74 69 63 6B 20 6C 69 73    he fast tick lis
01F560:  74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36 32    t.....       162
01F570:  20 23 42 43 45 36 20 20 4B 4C 20 44 45 4C 20 46     #BCE6  KL DEL F
01F580:  41 53 54 20 54 49 43 4B 45 52 20 20 20 52 65 6D    AST TICKER   Rem
01F590:  6F 76 65 20 61 20 20 62 6C 6F 63 6B 20 20 66 72    ove a  block  fr
01F5A0:  6F 6D 20 20 74 68 65 20 20 66 61 73 74 20 20 74    om  the  fast  t
01F5B0:  69 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ick..           
01F5C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F5D0:  20 20 20 20 20 20 20 20 20 20 20 20 6C 69 73 74                list
01F5E0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 49 43 4B    .....       TICK
01F5F0:  20 4C 49 53 54 0D 0A 0D 0A 0D 0A 20 20 20 20 20     LIST......     
01F600:  20 20 31 36 33 20 23 42 43 45 39 20 20 4B 4C 20      163 #BCE9  KL 
01F610:  41 44 44 20 54 49 43 4B 45 52 20 20 20 20 20 20    ADD TICKER      
01F620:  20 20 50 75 74 20 61 20 62 6C 6F 63 6B 20 6F 6E      Put a block on
01F630:  74 6F 20 74 68 65 20 74 69 63 6B 20 6C 69 73 74    to the tick list
01F640:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36 34 20    .....       164 
01F650:  23 42 43 45 43 20 20 4B 4C 20 44 45 4C 20 54 49    #BCEC  KL DEL TI
01F660:  43 4B 45 52 20 20 20 20 20 20 20 20 52 65 6D 6F    CKER        Remo
01F670:  76 65 20 61 20 62 6C 6F 63 6B 20 66 72 6F 6D 20    ve a block from 
01F680:  74 68 65 20 74 69 63 6B 20 6C 69 73 74 2E 0D 0A    the tick list...
01F690:  0D 0A 0D 0A 20 20 20 20 20 20 20 45 56 45 4E 54    ....       EVENT
01F6A0:  53 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36    S......       16
01F6B0:  35 20 23 42 43 45 46 20 20 4B 4C 20 49 4E 49 54    5 #BCEF  KL INIT
01F6C0:  20 45 56 45 4E 54 20 20 20 20 20 20 20 20 49 6E     EVENT        In
01F6D0:  69 74 69 61 6C 69 7A 65 20 61 6E 20 65 76 65 6E    itialize an even
01F6E0:  74 20 62 6C 6F 63 6B 2E 0D 0A 0D 0A 20 20 20 20    t block.....    
01F6F0:  20 20 20 31 36 36 20 23 42 43 46 32 20 20 4B 4C       166 #BCF2  KL
01F700:  20 45 56 45 4E 54 20 20 20 20 20 20 20 20 20 20     EVENT          
01F710:  20 20 20 27 4B 69 63 6B 27 20 61 6E 20 65 76 65       'Kick' an eve
01F720:  6E 74 20 62 6C 6F 63 6B 2E 0D 0A 0D 0A 20 20 20    nt block.....   
01F730:  20 20 20 20 31 36 37 20 23 42 43 46 35 20 20 4B        167 #BCF5  K
01F740:  4C 20 53 59 4E 43 20 52 45 53 45 54 20 20 20 20    L SYNC RESET    
01F750:  20 20 20 20 43 6C 65 61 72 20 73 79 6E 63 68 72        Clear synchr
01F760:  6F 6E 6F 75 73 20 65 76 65 6E 74 20 71 75 65 75    onous event queu
01F770:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 36 38    e.....       168
01F780:  20 23 42 43 46 38 20 20 4B 4C 20 44 45 4C 20 53     #BCF8  KL DEL S
01F790:  59 4E 43 48 52 4F 4E 4F 55 53 20 20 20 52 65 6D    YNCHRONOUS   Rem
01F7A0:  6F 76 65 20 61 20 73 79 6E 63 68 72 6F 6E 6F 75    ove a synchronou
01F7B0:  73 20 20 65 76 65 6E 74 20 20 66 72 6F 6D 20 20    s  event  from  
01F7C0:  74 68 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20    the..           
01F7D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01F7E0:  20 20 20 20 20 20 20 20 20 20 20 20 65 76 65 6E                even
01F7F0:  74 20 71 75 65 75 65 2E 0D 0A 0D 0A 20 20 20 20    t queue.....    
01F800:  20 20 20 31 36 39 20 23 42 43 46 42 20 20 4B 4C       169 #BCFB  KL
01F810:  20 4E 45 58 54 20 53 59 4E 43 20 20 20 20 20 20     NEXT SYNC      
01F820:  20 20 20 47 65 74 20 74 68 65 20 6E 65 78 74 20       Get the next 
01F830:  65 76 65 6E 74 20 66 72 6F 6D 20 74 68 65 20 71    event from the q
01F840:  75 65 75 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    ueue.....       
01F850:  31 37 30 20 23 42 43 46 45 20 20 4B 4C 20 44 4F    170 #BCFE  KL DO
01F860:  20 53 59 4E 43 20 20 20 20 20 20 20 20 20 20 20     SYNC           
01F870:  50 65 72 66 6F 72 6D 20 61 6E 20 65 76 65 6E 74    Perform an event
01F880:  20 72 6F 75 74 69 6E 65 2E 0D 0A 0D 0A 20 20 20     routine.....   
01F890:  20 20 20 20 31 37 31 20 23 42 44 30 31 20 20 4B        171 #BD01  K
01F8A0:  4C 20 44 4F 4E 45 20 53 59 4E 43 20 20 20 20 20    L DONE SYNC     
01F8B0:  20 20 20 20 46 69 6E 69 73 68 20 70 72 6F 63 65        Finish proce
01F8C0:  73 73 69 6E 67 20 61 6E 20 65 76 65 6E 74 2E 0D    ssing an event..
01F8D0:  0A 0D 0A 20 20 20 20 20 20 20 31 37 32 20 23 42    ...       172 #B
01F8E0:  44 30 34 20 20 4B 4C 20 45 56 45 4E 54 20 44 49    D04  KL EVENT DI
01F8F0:  53 41 42 4C 45 20 20 20 20 20 44 69 73 61 62 6C    SABLE     Disabl
01F900:  65 20 6E 6F 72 6D 61 6C 20 73 79 6E 63 68 72 6F    e normal synchro
01F910:  6E 6F 75 73 20 65 76 65 6E 74 73 2E 0D 0A 0D 0A    nous events.....
01F920:  20 20 20 20 20 20 20 31 37 33 20 23 42 44 30 37           173 #BD07
01F930:  20 20 4B 4C 20 45 56 45 4E 54 20 45 4E 41 42 4C      KL EVENT ENABL
01F940:  45 20 20 20 20 20 20 45 6E 61 62 6C 65 20 6E 6F    E      Enable no
01F950:  72 6D 61 6C 20 73 79 6E 63 68 72 6F 6E 6F 75 73    rmal synchronous
01F960:  20 65 76 65 6E 74 73 2E 0D 0A 0D 0A 20 20 20 20     events.....    
01F970:  20 20 20 31 37 34 20 23 42 44 30 41 20 20 4B 4C       174 #BD0A  KL
01F980:  20 44 49 53 41 52 4D 20 45 56 45 4E 54 20 20 20     DISARM EVENT   
01F990:  20 20 20 50 72 65 76 65 6E 74 20 61 6E 20 65 76       Prevent an ev
01F9A0:  65 6E 74 20 66 72 6F 6D 20 6F 63 63 75 72 72 69    ent from occurri
01F9B0:  6E 67 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    ng............. 
01F9C0:  20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50          AMSTRAD CP
01F9D0:  43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49    C464/664/6128 FI
01F9E0:  52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20    RMWARE          
01F9F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01FA00:  20 20 70 61 67 65 20 31 34 2E 31 32 0D 0A 0D 0A      page 14.12....
01FA10:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
01FA20:  20 45 4C 41 50 53 45 44 20 54 49 4D 45 0D 0A 0D     ELAPSED TIME...
01FA30:  0A 0D 0A 20 20 20 20 20 20 20 31 37 35 20 23 42    ...       175 #B
01FA40:  44 30 44 20 20 4B 4C 20 54 49 4D 45 20 50 4C 45    D0D  KL TIME PLE
01FA50:  41 53 45 20 20 20 20 20 20 20 41 73 6B 20 74 68    ASE       Ask th
01FA60:  65 20 65 6C 61 70 73 65 64 20 74 69 6D 65 2E 0D    e elapsed time..
01FA70:  0A 0D 0A 20 20 20 20 20 20 20 31 37 36 20 23 42    ...       176 #B
01FA80:  44 31 30 20 20 4B 4C 20 54 49 4D 45 20 53 45 54    D10  KL TIME SET
01FA90:  20 20 20 20 20 20 20 20 20 20 53 65 74 20 74 68              Set th
01FAA0:  65 20 65 6C 61 70 73 65 64 20 74 69 6D 65 2E 0D    e elapsed time..
01FAB0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 42 41 4E 4B    .....       BANK
01FAC0:  20 53 57 49 54 43 48 49 4E 47 0D 0A 0D 0A 0D 0A     SWITCHING......
01FAD0:  20 20 20 20 20 20 20 32 30 31 20 23 42 44 35 42           201 #BD5B
01FAE0:  20 20 4B 4C 20 42 41 4E 4B 20 53 57 49 54 43 48      KL BANK SWITCH
01FAF0:  20 20 20 20 20 20 20 53 65 6C 65 63 74 20 61 20           Select a 
01FB00:  6D 65 6D 6F 72 79 20 6F 72 67 61 6E 69 7A 61 74    memory organizat
01FB10:  69 6F 6E 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ion.....       1
01FB20:  34 2E 31 2E 38 20 45 6E 74 72 69 65 73 20 74 6F    4.1.8 Entries to
01FB30:  20 74 68 65 20 4D 61 63 68 69 6E 65 20 50 61 63     the Machine Pac
01FB40:  6B 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    k....       The 
01FB50:  4D 61 63 68 69 6E 65 20 50 61 63 6B 20 70 72 6F    Machine Pack pro
01FB60:  76 69 64 65 73 20 61 6E 20 69 6E 74 65 72 66 61    vides an interfa
01FB70:  63 65 20 74 6F 20 74 68 65 20 6D 61 63 68 69 6E    ce to the machin
01FB80:  65 20 20 68 61 72 64 77 61 72 65 2E 20 20 4D 6F    e  hardware.  Mo
01FB90:  73 74 0D 0A 20 20 20 20 20 20 20 70 61 63 6B 73    st..       packs
01FBA0:  20 75 73 65 20 4D 61 63 68 69 6E 65 20 74 6F 20     use Machine to 
01FBB0:  61 63 63 65 73 73 20 61 6E 79 20 68 61 72 64 77    access any hardw
01FBC0:  61 72 65 20 74 68 65 79 20 75 73 65 2E 20 54 68    are they use. Th
01FBD0:  65 20 6D 61 6A 6F 72 20 65 78 63 65 70 74 69 6F    e major exceptio
01FBE0:  6E 0D 0A 20 20 20 20 20 20 20 69 73 20 74 68 65    n..       is the
01FBF0:  20 43 61 73 73 65 74 74 65 20 4D 61 6E 61 67 65     Cassette Manage
01FC00:  72 20 77 68 69 63 68 2C 20 66 6F 72 20 73 70 65    r which, for spe
01FC10:  65 64 20 20 72 65 61 73 6F 6E 73 2C 20 20 70 65    ed  reasons,  pe
01FC20:  72 66 6F 72 6D 73 20 20 69 74 73 20 20 6F 77 6E    rforms  its  own
01FC30:  0D 0A 20 20 20 20 20 20 20 68 61 72 64 77 61 72    ..       hardwar
01FC40:  65 20 61 63 63 65 73 73 2E 0D 0A 0D 0A 20 20 20    e access.....   
01FC50:  20 20 20 20 50 52 4F 47 52 41 4D 53 0D 0A 0D 0A        PROGRAMS....
01FC60:  20 20 20 20 20 20 20 31 37 37 20 23 42 44 31 33           177 #BD13
01FC70:  20 20 4D 43 20 42 4F 4F 54 20 50 52 4F 47 52 41      MC BOOT PROGRA
01FC80:  4D 20 20 20 20 20 20 4C 6F 61 64 20 61 6E 64 20    M      Load and 
01FC90:  72 75 6E 20 61 20 66 6F 72 65 67 72 6F 75 6E 64    run a foreground
01FCA0:  20 70 72 6F 67 72 61 6D 2E 0D 0A 0D 0A 20 20 20     program.....   
01FCB0:  20 20 20 20 31 37 38 20 23 42 44 31 36 20 20 4D        178 #BD16  M
01FCC0:  43 20 53 54 41 52 54 20 50 52 4F 47 52 41 4D 20    C START PROGRAM 
01FCD0:  20 20 20 20 52 75 6E 20 61 20 66 6F 72 65 67 72        Run a foregr
01FCE0:  6F 75 6E 64 20 70 72 6F 67 72 61 6D 2E 0D 0A 0D    ound program....
01FCF0:  0A 0D 0A 20 20 20 20 20 20 20 53 43 52 45 45 4E    ...       SCREEN
01FD00:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 37 39 20 23    ....       179 #
01FD10:  42 44 31 39 20 20 4D 43 20 57 41 49 54 20 46 4C    BD19  MC WAIT FL
01FD20:  59 42 41 43 4B 20 20 20 20 20 20 57 61 69 74 20    YBACK      Wait 
01FD30:  66 6F 72 20 66 72 61 6D 65 20 66 6C 79 62 61 63    for frame flybac
01FD40:  6B 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 38 30    k.....       180
01FD50:  20 23 42 44 31 43 20 20 4D 43 20 53 45 54 20 4D     #BD1C  MC SET M
01FD60:  4F 44 45 20 20 20 20 20 20 20 20 20 20 53 65 74    ODE          Set
01FD70:  20 74 68 65 20 73 63 72 65 65 6E 20 6D 6F 64 65     the screen mode
01FD80:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 38 31 20    .....       181 
01FD90:  23 42 44 31 46 20 20 4D 43 20 53 43 52 45 45 4E    #BD1F  MC SCREEN
01FDA0:  20 4F 46 46 53 45 54 20 20 20 20 20 53 65 74 20     OFFSET     Set 
01FDB0:  74 68 65 20 73 63 72 65 65 6E 20 6F 66 66 73 65    the screen offse
01FDC0:  74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 38 32    t.....       182
01FDD0:  20 23 42 44 32 32 20 20 4D 43 20 43 4C 45 41 52     #BD22  MC CLEAR
01FDE0:  20 49 4E 4B 53 20 20 20 20 20 20 20 20 53 65 74     INKS        Set
01FDF0:  20 61 6C 6C 20 69 6E 6B 73 20 74 6F 20 6F 6E 65     all inks to one
01FE00:  20 63 6F 6C 6F 75 72 2E 0D 0A 0D 0A 20 20 20 20     colour.....    
01FE10:  20 20 20 31 38 33 20 23 42 44 32 35 20 20 4D 43       183 #BD25  MC
01FE20:  20 53 45 54 20 49 4E 4B 53 20 20 20 20 20 20 20     SET INKS       
01FE30:  20 20 20 53 65 74 20 63 6F 6C 6F 75 72 73 20 6F       Set colours o
01FE40:  66 20 61 6C 6C 20 74 68 65 20 69 6E 6B 73 2E 0D    f all the inks..
01FE50:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 50 52 49 4E    .....       PRIN
01FE60:  54 45 52 0D 0A 0D 0A 20 20 20 20 20 20 20 31 38    TER....       18
01FE70:  34 20 23 42 44 32 38 20 20 4D 43 20 52 45 53 45    4 #BD28  MC RESE
01FE80:  54 20 50 52 49 4E 54 45 52 20 20 20 20 20 52 65    T PRINTER     Re
01FE90:  73 65 74 20 74 68 65 20 70 72 69 6E 74 65 72 20    set the printer 
01FEA0:  69 6E 64 69 72 65 63 74 69 6F 6E 73 2E 0D 0A 0D    indirections....
01FEB0:  0A 20 20 20 20 20 20 20 32 30 30 20 23 42 44 35    .       200 #BD5
01FEC0:  38 20 20 4D 43 20 50 52 49 4E 54 20 54 52 41 4E    8  MC PRINT TRAN
01FED0:  53 4C 41 54 49 4F 4E 20 53 65 74 20 74 68 65 20    SLATION Set the 
01FEE0:  70 72 69 6E 74 65 72 20 74 72 61 6E 73 6C 61 74    printer translat
01FEF0:  69 6F 6E 20 74 61 62 6C 65 2E 0D 0A 0D 0A 20 20    ion table.....  
01FF00:  20 20 20 20 20 31 38 35 20 23 42 44 32 42 20 20         185 #BD2B  
01FF10:  4D 43 20 50 52 49 4E 54 20 43 48 41 52 20 20 20    MC PRINT CHAR   
01FF20:  20 20 20 20 20 54 72 61 6E 73 6C 61 74 65 20 61         Translate a
01FF30:  20 63 68 61 72 61 63 74 65 72 20 74 68 65 6E 20     character then 
01FF40:  73 65 6E 64 20 69 74 20 20 74 6F 0D 0A 20 20 20    send it  to..   
01FF50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01FF60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
01FF70:  20 20 20 20 74 68 65 20 43 65 6E 74 72 6F 6E 69        the Centroni
01FF80:  63 73 20 70 6F 72 74 2E 0D 0A 0D 0A 20 20 20 20    cs port.....    
01FF90:  20 20 20 31 38 36 20 23 42 44 32 45 20 20 4D 43       186 #BD2E  MC
01FFA0:  20 42 55 53 59 20 50 52 49 4E 54 45 52 20 20 20     BUSY PRINTER   
01FFB0:  20 20 20 54 65 73 74 20 69 66 20 74 68 65 20 43       Test if the C
01FFC0:  65 6E 74 72 6F 6E 69 63 73 20 70 6F 72 74 20 69    entronics port i
01FFD0:  73 20 62 75 73 79 2E 0D 0A 0D 0A 20 20 20 20 20    s busy.....     
01FFE0:  20 20 31 38 37 20 23 42 44 33 31 20 20 4D 43 20      187 #BD31  MC 
01FFF0:  53 45 4E 44 20 50 52 49 4E 54 45 52 20 20 20 20    SEND PRINTER    
020000:  20 20 53 65 6E 64 20 61 20 20 63 68 61 72 61 63      Send a  charac
020010:  74 65 72 20 20 74 6F 20 20 74 68 65 20 20 43 65    ter  to  the  Ce
020020:  6E 74 72 6F 6E 69 63 73 0D 0A 20 20 20 20 20 20    ntronics..      
020030:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020040:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020050:  20 70 6F 72 74 2E 0D 0A 0D 0A 20 20 20 20 20 20     port.....      
020060:  20 53 4F 55 4E 44 20 43 48 49 50 0D 0A 0D 0A 20     SOUND CHIP.... 
020070:  20 20 20 20 20 20 31 38 38 20 23 42 44 33 34 20          188 #BD34 
020080:  20 4D 43 20 53 4F 55 4E 44 20 52 45 47 49 53 54     MC SOUND REGIST
020090:  45 52 20 20 20 20 53 65 6E 64 20 64 61 74 61 20    ER    Send data 
0200A0:  74 6F 20 61 20 73 6F 75 6E 64 20 63 68 69 70 20    to a sound chip 
0200B0:  72 65 67 69 73 74 65 72 2E 0D 0A 0D 0A 0D 0A 20    register....... 
0200C0:  20 20 20 20 20 20 41 4D 53 54 52 41 44 20 34 36          AMSTRAD 46
0200D0:  34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57    4/664/6128 FIRMW
0200E0:  41 52 45 20 20 20 20 20 20 20 20 20 20 20 20 20    ARE             
0200F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020100:  20 20 70 61 67 65 20 31 34 2E 31 33 0D 0A 0D 0A      page 14.13....
020110:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
020120:  20 31 34 2E 31 2E 39 20 45 6E 74 72 69 65 73 20     14.1.9 Entries 
020130:  74 6F 20 4A 75 6D 70 65 72 0D 0A 0D 0A 20 20 20    to Jumper....   
020140:  20 20 20 20 4A 75 6D 70 65 72 20 73 65 74 73 20        Jumper sets 
020150:  75 70 20 74 68 65 20 6D 61 69 6E 20 6A 75 6D 70    up the main jump
020160:  62 6C 6F 63 6B 2E 0D 0A 0D 0A 20 20 20 20 20 20    block.....      
020170:  20 49 4E 49 54 49 41 4C 49 5A 41 54 49 4F 4E 0D     INITIALIZATION.
020180:  0A 0D 0A 20 20 20 20 20 20 20 31 38 39 20 23 42    ...       189 #B
020190:  44 33 37 20 20 4A 55 4D 50 20 52 45 53 54 4F 52    D37  JUMP RESTOR
0201A0:  45 20 20 20 20 20 20 20 20 20 52 65 73 74 6F 72    E         Restor
0201B0:  65 20 74 68 65 20 73 74 61 6E 64 61 72 64 20 6A    e the standard j
0201C0:  75 6D 70 62 6C 6F 63 6B 2E 0D 0A 0D 0A 20 20 20    umpblock.....   
0201D0:  20 20 20 20 31 34 2E 32 20 46 69 72 6D 77 61 72        14.2 Firmwar
0201E0:  65 20 49 6E 64 69 72 65 63 74 69 6F 6E 73 0D 0A    e Indirections..
0201F0:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 66 69 72    ..       The fir
020200:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
020210:  1B 00 00 00 02 09 50 E5 1B 00 C1 02 00 00 00 02    ......P.........
020220:  1B 00 C2 02 00 00 00 02 1B 00 C3 02 00 00 00 02    ................
020230:  1B 00 C4 02 00 00 00 02 1B 00 C5 02 00 00 00 02    ................
020240:  1B 00 C6 02 00 00 00 02 1B 00 C7 02 00 00 00 02    ................
020250:  1B 00 C8 02 00 00 00 02 1B 00 C9 02 00 00 00 02    ................
020260:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
020270:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
020280:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
020290:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0202F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
020300:  6D 77 61 72 65 20 69 6E 64 69 72 65 63 74 69 6F    mware indirectio
020310:  6E 73 20 6C 69 73 74 65 64 20 68 65 72 65 20 61    ns listed here a
020320:  72 65 20 74 61 6B 65 6E 20 61 74 20 6B 65 79 20    re taken at key 
020330:  70 6F 69 6E 74 73 20 20 69 6E 20 20 74 68 65 0D    points  in  the.
020340:  0A 20 20 20 20 20 20 20 66 69 72 6D 77 61 72 65    .       firmware
020350:  20 74 68 75 73 20 61 6C 6C 6F 77 69 6E 67 20 74     thus allowing t
020360:  68 65 20 75 73 65 72 20 74 6F 20 20 70 72 6F 76    he user to  prov
020370:  69 64 65 20 20 73 75 62 73 74 69 74 75 74 65 20    ide  substitute 
020380:  20 72 6F 75 74 69 6E 65 73 20 20 66 6F 72 0D 0A     routines  for..
020390:  20 20 20 20 20 20 20 6D 61 6E 79 20 66 69 72 6D           many firm
0203A0:  77 61 72 65 20 61 63 74 69 6F 6E 73 2C 20 77 69    ware actions, wi
0203B0:  74 68 6F 75 74 20 68 61 76 69 6E 67 20 74 6F 20    thout having to 
0203C0:  72 65 70 6C 61 63 65 20 61 20 20 63 6F 6D 70 6C    replace a  compl
0203D0:  65 74 65 20 20 66 69 72 6D 77 61 72 65 0D 0A 20    ete  firmware.. 
0203E0:  20 20 20 20 20 20 70 61 63 6B 61 67 65 2E 20 54          package. T
0203F0:  68 65 73 65 20 69 6E 64 69 72 65 63 74 69 6F 6E    hese indirection
020400:  73 20 61 72 65 20 6E 6F 74 20 69 6E 74 65 6E 64    s are not intend
020410:  65 64 20 66 6F 72 20 74 68 65 20 75 73 65 72 20    ed for the user 
020420:  20 74 6F 20 20 63 61 6C 6C 20 20 2D 0D 0A 20 20     to  call  -..  
020430:  20 20 20 20 20 74 68 65 72 65 20 69 73 20 75 73         there is us
020440:  75 61 6C 6C 79 20 61 20 68 69 67 68 65 72 20 6C    ually a higher l
020450:  65 76 65 6C 20 72 6F 75 74 69 6E 65 20 69 6E 20    evel routine in 
020460:  74 68 65 20 6D 61 69 6E 20 66 69 72 6D 77 61 72    the main firmwar
020470:  65 20 6A 75 6D 70 62 6C 6F 63 6B 0D 0A 20 20 20    e jumpblock..   
020480:  20 20 20 20 74 68 61 74 20 69 73 20 6D 6F 72 65        that is more
020490:  20 73 75 69 74 61 62 6C 65 2E 0D 0A 0D 0A 20 20     suitable.....  
0204A0:  20 20 20 20 20 54 68 65 20 69 6E 64 69 72 65 63         The indirec
0204B0:  74 69 6F 6E 73 20 61 72 65 20 73 65 74 20 75 70    tions are set up
0204C0:  20 62 79 20 74 68 65 20 70 61 63 6B 20 74 6F 20     by the pack to 
0204D0:  77 68 6F 6D 20 20 74 68 65 79 20 20 61 70 70 6C    whom  they  appl
0204E0:  79 20 20 77 68 65 6E 65 76 65 72 0D 0A 20 20 20    y  whenever..   
0204F0:  20 20 20 20 69 74 73 20 72 65 73 65 74 20 28 6F        its reset (o
020500:  72 20 69 6E 69 74 69 61 6C 69 7A 65 29 20 72 6F    r initialize) ro
020510:  75 74 69 6E 65 20 69 73 20 63 61 6C 6C 65 64 20    utine is called 
020520:  61 6E 64 20 64 75 72 69 6E 67 20 45 4D 53 3B 20    and during EMS; 
020530:  20 74 68 65 79 20 20 61 72 65 0D 0A 20 20 20 20     they  are..    
020540:  20 20 20 6E 6F 74 20 6F 74 68 65 72 77 69 73 65       not otherwise
020550:  20 61 6C 74 65 72 65 64 20 62 79 20 74 68 65 20     altered by the 
020560:  66 69 72 6D 77 61 72 65 2E 0D 0A 0D 0A 20 20 20    firmware.....   
020570:  20 20 20 20 54 68 65 20 69 6E 64 69 72 65 63 74        The indirect
020580:  69 6F 6E 73 20 61 72 65 20 61 6C 6C 20 20 74 68    ions are all  th
020590:  72 65 65 20 20 62 79 74 65 73 20 20 6C 6F 6E 67    ree  bytes  long
0205A0:  20 20 61 6E 64 20 20 75 73 65 20 20 73 74 61 6E      and  use  stan
0205B0:  64 61 72 64 20 20 6A 75 6D 70 0D 0A 20 20 20 20    dard  jump..    
0205C0:  20 20 20 69 6E 73 74 72 75 63 74 69 6F 6E 73 20       instructions 
0205D0:  28 23 43 33 29 2E 20 49 66 20 61 20 52 4F 4D 20    (#C3). If a ROM 
0205E0:  73 74 61 74 65 20 6F 74 68 65 72 20 74 68 61 6E    state other than
0205F0:  20 75 70 70 65 72 20 52 4F 4D 73 20 64 69 73 61     upper ROMs disa
020600:  62 6C 65 64 20 20 61 6E 64 0D 0A 20 20 20 20 20    bled  and..     
020610:  20 20 6C 6F 77 65 72 20 52 4F 4D 20 65 6E 61 62      lower ROM enab
020620:  6C 65 64 20 69 73 20 72 65 71 75 69 72 65 64 20    led is required 
020630:  74 68 65 6E 20 74 68 65 20 61 70 70 72 6F 70 72    then the appropr
020640:  69 61 74 65 20 72 65 73 74 61 72 74 20 69 6E 73    iate restart ins
020650:  74 72 75 63 74 69 6F 6E 0D 0A 20 20 20 20 20 20    truction..      
020660:  20 6D 69 67 68 74 20 62 65 20 73 75 62 73 74 69     might be substi
020670:  74 75 74 65 64 20 28 73 65 65 20 73 65 63 74 69    tuted (see secti
020680:  6F 6E 20 32 2E 33 29 2E 20 54 68 65 20 20 69 6E    on 2.3). The  in
020690:  64 69 72 65 63 74 69 6F 6E 73 20 20 61 72 65 20    directions  are 
0206A0:  20 74 6F 20 20 62 65 0D 0A 20 20 20 20 20 20 20     to  be..       
0206B0:  66 6F 75 6E 64 20 62 65 74 77 65 65 6E 20 23 42    found between #B
0206C0:  44 43 44 20 61 6E 64 20 23 42 44 46 36 2E 0D 0A    DCD and #BDF6...
0206D0:  0D 0A 20 20 20 20 20 20 20 41 74 20 74 68 69 73    ..       At this
0206E0:  20 6C 65 76 65 6C 20 6F 66 20 6F 70 65 72 61 74     level of operat
0206F0:  69 6F 6E 20 76 65 72 79 20 6C 69 74 74 6C 65 20    ion very little 
020700:  76 61 6C 69 64 61 74 69 6F 6E 20 69 73 20 63 61    validation is ca
020710:  72 72 69 65 64 20 20 6F 75 74 2E 20 20 49 66 0D    rried  out.  If.
020720:  0A 20 20 20 20 20 20 20 69 6E 63 6F 72 72 65 63    .       incorrec
020730:  74 20 70 61 72 61 6D 65 74 65 72 73 20 61 72 65    t parameters are
020740:  20 70 61 73 73 65 64 20 6F 72 20 61 20 20 73 75     passed or a  su
020750:  62 73 74 69 74 75 74 65 20 20 72 6F 75 74 69 6E    bstitute  routin
020760:  65 20 20 63 6F 72 72 75 70 74 73 20 20 61 0D 0A    e  corrupts  a..
020770:  20 20 20 20 20 20 20 72 65 67 69 73 74 65 72 20           register 
020780:  69 6E 20 64 65 66 69 61 6E 63 65 20 6F 66 20 74    in defiance of t
020790:  68 65 20 64 6F 63 75 6D 65 6E 74 65 64 20 20 69    he documented  i
0207A0:  6E 74 65 72 66 61 63 65 20 20 74 68 65 6E 20 20    nterface  then  
0207B0:  74 68 65 20 20 66 69 72 6D 77 61 72 65 0D 0A 20    the  firmware.. 
0207C0:  20 20 20 20 20 20 77 69 6C 6C 20 70 72 6F 62 61          will proba
0207D0:  62 6C 79 20 63 65 61 73 65 20 74 6F 20 66 75 6E    bly cease to fun
0207E0:  63 74 69 6F 6E 20 61 73 20 65 78 70 65 63 74 65    ction as expecte
0207F0:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4D 6F 72    d.....       Mor
020800:  65 20 64 65 74 61 69 6C 65 64 20 64 65 73 63 72    e detailed descr
020810:  69 70 74 69 6F 6E 73 20 6F 66 20 74 68 65 73 65    iptions of these
020820:  20 72 6F 75 74 69 6E 65 73 20 63 61 6E 20 62 65     routines can be
020830:  20 66 6F 75 6E 64 20 20 69 6E 20 20 73 65 63 74     found  in  sect
020840:  69 6F 6E 0D 0A 20 20 20 20 20 20 20 31 36 2E 0D    ion..       16..
020850:  0A 0D 0A 20 20 20 20 20 20 20 31 34 2E 32 2E 31    ...       14.2.1
020860:  20 54 65 78 74 20 56 44 55 20 49 6E 64 69 72 65     Text VDU Indire
020870:  63 74 69 6F 6E 73 0D 0A 0D 0A 20 20 20 20 20 20    ctions....      
020880:  20 30 20 20 20 23 42 44 43 44 20 20 54 58 54 20     0   #BDCD  TXT 
020890:  44 52 41 57 20 43 55 52 53 4F 52 20 20 20 20 20    DRAW CURSOR     
0208A0:  20 50 6C 61 63 65 20 74 68 65 20 63 75 72 73 6F     Place the curso
0208B0:  72 20 62 6C 6F 62 20 20 6F 6E 20 20 74 68 65 20    r blob  on  the 
0208C0:  20 73 63 72 65 65 6E 0D 0A 20 20 20 20 20 20 20     screen..       
0208D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0208E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0208F0:  28 69 66 20 65 6E 61 62 6C 65 64 29 2E 0D 0A 0D    (if enabled)....
020900:  0A 20 20 20 20 20 20 20 31 20 20 20 23 42 44 44    .       1   #BDD
020910:  30 20 20 54 58 54 20 55 4E 44 52 41 57 20 43 55    0  TXT UNDRAW CU
020920:  52 53 4F 52 20 20 20 20 52 65 6D 6F 76 65 20 74    RSOR    Remove t
020930:  68 65 20 63 75 72 73 6F 72 20 62 6C 6F 62 20 66    he cursor blob f
020940:  72 6F 6D 20 74 68 65 20 73 63 72 65 65 6E 0D 0A    rom the screen..
020950:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020960:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020970:  20 20 20 20 20 20 20 28 69 66 20 65 6E 61 62 6C           (if enabl
020980:  65 64 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 32    ed).....       2
020990:  20 20 20 23 42 44 44 33 20 20 54 58 54 20 57 52       #BDD3  TXT WR
0209A0:  49 54 45 20 43 48 41 52 20 20 20 20 20 20 20 57    ITE CHAR       W
0209B0:  72 69 74 65 20 61 20 63 68 61 72 61 63 74 65 72    rite a character
0209C0:  20 66 72 6F 6D 20 74 68 65 20 73 63 72 65 65 6E     from the screen
0209D0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 33 20 20 20    .....       3   
0209E0:  23 42 44 44 36 20 20 54 58 54 20 55 4E 57 52 49    #BDD6  TXT UNWRI
0209F0:  54 45 20 20 20 20 20 20 20 20 20 20 52 65 61 64    TE          Read
020A00:  20 61 20 63 68 61 72 61 63 74 65 72 20 66 72 6F     a character fro
020A10:  6D 20 74 68 65 20 73 63 72 65 65 6E 2E 0D 0A 0D    m the screen....
020A20:  0A 20 20 20 20 20 20 20 34 20 20 20 23 42 44 44    .       4   #BDD
020A30:  39 20 20 54 58 54 20 4F 55 54 20 41 43 54 49 4F    9  TXT OUT ACTIO
020A40:  4E 20 20 20 20 20 20 20 4F 75 74 70 75 74 20 61    N       Output a
020A50:  20 63 68 61 72 61 63 74 65 72 20 6F 72 20 63 6F     character or co
020A60:  6E 74 72 6F 6C 20 63 6F 64 65 2E 0D 0A 0D 0A 20    ntrol code..... 
020A70:  20 20 20 20 20 20 31 34 2E 32 2E 32 20 47 72 61          14.2.2 Gra
020A80:  70 68 69 63 73 20 56 44 55 20 49 6E 64 69 72 65    phics VDU Indire
020A90:  63 74 69 6F 6E 73 0D 0A 0D 0A 20 20 20 20 20 20    ctions....      
020AA0:  20 35 20 20 20 23 42 44 44 43 20 20 47 52 41 20     5   #BDDC  GRA 
020AB0:  50 4C 4F 54 20 20 20 20 20 20 20 20 20 20 20 20    PLOT            
020AC0:  20 50 6C 6F 74 20 61 20 70 6F 69 6E 74 2E 0D 0A     Plot a point...
020AD0:  0D 0A 20 20 20 20 20 20 20 36 20 20 20 23 42 44    ..       6   #BD
020AE0:  44 46 20 20 47 52 41 20 54 45 53 54 20 20 20 20    DF  GRA TEST    
020AF0:  20 20 20 20 20 20 20 20 20 54 65 73 74 20 61 20             Test a 
020B00:  70 6F 69 6E 74 2E 0D 0A 0D 0A 20 20 20 20 20 20    point.....      
020B10:  20 37 20 20 20 23 42 44 45 32 20 20 47 52 41 20     7   #BDE2  GRA 
020B20:  4C 49 4E 45 20 20 20 20 20 20 20 20 20 20 20 20    LINE            
020B30:  20 44 72 61 77 20 61 20 6C 69 6E 65 2E 0D 0A 0D     Draw a line....
020B40:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54    .....       AMST
020B50:  52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36    RAD CPC464/664/6
020B60:  31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20    128 FIRMWARE    
020B70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020B80:  20 20 20 20 20 20 20 20 70 61 67 65 20 31 34 2E            page 14.
020B90:  31 34 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    14..............
020BA0:  20 20 20 20 20 20 20 31 34 2E 32 2E 33 20 53 63           14.2.3 Sc
020BB0:  72 65 65 6E 20 50 61 63 6B 20 49 6E 64 69 72 65    reen Pack Indire
020BC0:  63 74 69 6F 6E 73 0D 0A 0D 0A 0D 0A 20 20 20 20    ctions......    
020BD0:  20 20 20 38 20 20 20 23 42 44 45 35 20 20 53 43       8   #BDE5  SC
020BE0:  52 20 52 45 41 44 20 20 20 20 20 20 20 20 20 20    R READ          
020BF0:  20 20 20 52 65 61 64 20 61 20 70 69 78 65 6C 20       Read a pixel 
020C00:  66 72 6F 6D 20 74 68 65 20 73 63 72 65 65 6E 2E    from the screen.
020C10:  0D 0A 0D 0A 20 20 20 20 20 20 20 39 20 20 20 23    ....       9   #
020C20:  42 44 45 38 20 20 53 43 52 20 57 52 49 54 45 20    BDE8  SCR WRITE 
020C30:  20 20 20 20 20 20 20 20 20 20 20 57 72 69 74 65               Write
020C40:  20 61 20 70 69 78 65 6C 28 73 29 20 74 6F 20 74     a pixel(s) to t
020C50:  68 65 20 20 73 63 72 65 65 6E 20 20 75 73 69 6E    he  screen  usin
020C60:  67 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    g..             
020C70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
020C80:  20 20 20 20 20 20 20 20 20 20 74 68 65 20 63 75              the cu
020C90:  72 72 65 6E 74 20 67 72 61 70 68 69 63 73 20 77    rrent graphics w
020CA0:  72 69 74 65 20 6D 6F 64 65 2E 0D 0A 0D 0A 20 20    rite mode.....  
020CB0:  20 20 20 20 20 31 30 20 20 23 42 44 45 42 20 20         10  #BDEB  
020CC0:  53 43 52 20 4D 4F 44 45 20 43 4C 45 41 52 20 20    SCR MODE CLEAR  
020CD0:  20 20 20 20 20 43 6C 65 61 72 20 74 68 65 20 73         Clear the s
020CE0:  63 72 65 65 6E 20 74 6F 20 69 6E 6B 20 30 2E 0D    creen to ink 0..
020CF0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 34 2E 32    .....       14.2
020D00:  2E 34 20 4B 65 79 62 6F 61 72 64 20 4D 61 6E 61    .4 Keyboard Mana
020D10:  67 65 72 20 49 6E 64 69 72 65 63 74 69 6F 6E 73    ger Indirections
020D20:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 31 20    ......       11 
020D30:  20 23 42 44 45 45 20 20 4B 4D 20 54 45 53 54 20     #BDEE  KM TEST 
020D40:  42 52 45 41 4B 20 20 20 20 20 20 20 20 54 65 73    BREAK        Tes
020D50:  74 20 66 6F 72 20 62 72 65 61 6B 20 28 6F 72 20    t for break (or 
020D60:  72 65 73 65 74 29 2E 0D 0A 0D 0A 20 20 20 20 20    reset).....     
020D70:  20 20 31 33 20 20 23 42 44 46 34 20 20 4B 4D 20      13  #BDF4  KM 
020D80:  53 43 41 4E 20 4B 45 59 53 20 20 20 20 20 20 20    SCAN KEYS       
020D90:  20 20 53 63 61 6E 20 74 68 65 20 6B 65 79 62 6F      Scan the keybo
020DA0:  61 72 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ard.......      
020DB0:  20 31 34 2E 32 2E 35 20 4D 61 63 68 69 6E 65 20     14.2.5 Machine 
020DC0:  50 61 63 6B 20 49 6E 64 69 72 65 63 74 69 6F 6E    Pack Indirection
020DD0:  73 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 32    s......       12
020DE0:  20 20 23 42 44 46 31 20 20 4D 43 20 57 41 49 54      #BDF1  MC WAIT
020DF0:  20 50 52 49 4E 54 45 52 20 20 20 20 20 20 50 72     PRINTER      Pr
020E00:  69 6E 74 20 61 20 63 68 61 72 61 63 74 65 72 20    int a character 
020E10:  6F 72 20 74 69 6D 65 20 6F 75 74 2E 0D 0A 0D 0A    or time out.....
020E20:  0D 0A 20 20 20 20 20 20 20 31 34 2E 33 20 54 68    ..       14.3 Th
020E30:  65 20 48 69 67 68 20 4B 65 72 6E 65 6C 20 4A 75    e High Kernel Ju
020E40:  6D 70 62 6C 6F 63 6B 0D 0A 0D 0A 0D 0A 20 20 20    mpblock......   
020E50:  20 20 20 20 54 68 65 20 68 69 67 68 20 4B 65 72        The high Ker
020E60:  6E 65 6C 20 6A 75 6D 70 62 6C 6F 63 6B 20 69 73    nel jumpblock is
020E70:  20 70 72 6F 76 69 64 65 64 20 74 6F 20 61 6C 6C     provided to all
020E80:  6F 77 20 74 68 65 20 75 73 65 72 20 74 6F 20 20    ow the user to  
020E90:  74 75 72 6E 20 20 52 4F 4D 73 0D 0A 20 20 20 20    turn  ROMs..    
020EA0:  20 20 20 6F 6E 20 61 6E 64 20 6F 66 66 20 61 6E       on and off an
020EB0:  64 20 20 74 6F 20 20 61 63 63 65 73 73 20 20 6D    d  to  access  m
020EC0:  65 6D 6F 72 79 20 20 75 6E 64 65 72 6E 65 61 74    emory  underneat
020ED0:  68 20 20 52 4F 4D 73 20 20 77 68 69 6C 65 20 20    h  ROMs  while  
020EE0:  74 68 65 79 20 20 61 72 65 0D 0A 20 20 20 20 20    they  are..     
020EF0:  20 20 65 6E 61 62 6C 65 64 2E 20 54 68 65 20 65      enabled. The e
020F00:  6E 74 72 69 65 73 20 69 6E 20 74 68 69 73 20 6A    ntries in this j
020F10:  75 6D 70 62 6C 6F 63 6B 20 61 72 65 20 6E 6F 74    umpblock are not
020F20:  20 61 6C 6C 20 6A 75 6D 70 20 20 69 6E 73 74 72     all jump  instr
020F30:  75 63 74 69 6F 6E 73 2C 0D 0A 20 20 20 20 20 20    uctions,..      
020F40:  20 73 6F 6D 65 20 65 6E 74 72 69 65 73 20 61 72     some entries ar
020F50:  65 20 74 68 65 20 73 74 61 72 74 20 6F 66 20 72    e the start of r
020F60:  6F 75 74 69 6E 65 73 2C 20 74 68 75 73 20 74 68    outines, thus th
020F70:  65 20 75 73 65 72 20 73 68 6F 75 6C 64 20 6E 6F    e user should no
020F80:  74 20 61 6C 74 65 72 0D 0A 20 20 20 20 20 20 20    t alter..       
020F90:  61 6E 79 20 6F 66 20 74 68 65 20 65 6E 74 72 69    any of the entri
020FA0:  65 73 20 20 69 6E 20 20 74 68 69 73 20 20 6A 75    es  in  this  ju
020FB0:  6D 70 62 6C 6F 63 6B 2E 20 20 54 68 65 20 20 68    mpblock.  The  h
020FC0:  69 67 68 20 20 4B 65 72 6E 65 6C 20 20 6A 75 6D    igh  Kernel  jum
020FD0:  70 62 6C 6F 63 6B 0D 0A 20 20 20 20 20 20 20 6F    pblock..       o
020FE0:  63 63 75 70 69 65 73 20 73 74 6F 72 65 20 66 72    ccupies store fr
020FF0:  6F 6D 20 23 42 39 30 30 20 75 70 77 61 72 64 73    om #B900 upwards
021000:  2E 20 4D 6F 72 65 20 64 65 74 61 69 6C 65 64 20    . More detailed 
021010:  64 65 73 63 72 69 70 74 69 6F 6E 73 20 20 6F 66    descriptions  of
021020:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 72 6F      the..       ro
021030:  75 74 69 6E 65 73 20 69 6E 20 69 74 20 63 61 6E    utines in it can
021040:  20 62 65 20 66 6F 75 6E 64 20 69 6E 20 73 65 63     be found in sec
021050:  74 69 6F 6E 20 31 37 2E 0D 0A 0D 0A 0D 0A 20 20    tion 17.......  
021060:  20 20 20 20 20 30 20 20 20 23 42 39 30 30 20 20         0   #B900  
021070:  4B 4C 20 55 20 52 4F 4D 20 45 4E 41 42 4C 45 20    KL U ROM ENABLE 
021080:  20 20 20 20 20 54 75 72 6E 20 6F 6E 20 74 68 65         Turn on the
021090:  20 63 75 72 72 65 6E 74 20 75 70 70 65 72 20 52     current upper R
0210A0:  4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 31 20    OM.....       1 
0210B0:  20 20 23 42 39 30 33 20 20 4B 4C 20 55 20 52 4F      #B903  KL U RO
0210C0:  4D 20 44 49 53 41 42 4C 45 20 20 20 20 20 54 75    M DISABLE     Tu
0210D0:  72 6E 20 6F 66 66 20 74 68 65 20 75 70 70 65 72    rn off the upper
0210E0:  20 52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20 20     ROM.....       
0210F0:  32 20 20 20 23 42 39 30 36 20 20 4B 4C 20 4C 20    2   #B906  KL L 
021100:  52 4F 4D 20 45 4E 41 42 4C 45 20 20 20 20 20 20    ROM ENABLE      
021110:  54 75 72 6E 20 6F 6E 20 74 68 65 20 6C 6F 77 65    Turn on the lowe
021120:  72 20 52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20 20 20    r ROM.....      
021130:  20 33 20 20 20 23 42 39 30 39 20 20 4B 4C 20 4C     3   #B909  KL L
021140:  20 52 4F 4D 20 44 49 53 41 42 4C 45 20 20 20 20     ROM DISABLE    
021150:  20 54 75 72 6E 20 6F 66 66 20 74 68 65 20 6C 6F     Turn off the lo
021160:  77 65 72 20 52 4F 4D 2E 0D 0A 0D 0A 20 20 20 20    wer ROM.....    
021170:  20 20 20 34 20 20 20 23 42 39 30 43 20 20 4B 4C       4   #B90C  KL
021180:  20 52 4F 4D 20 52 45 53 54 4F 52 45 20 20 20 20     ROM RESTORE    
021190:  20 20 20 52 65 73 74 6F 72 65 20 74 68 65 20 70       Restore the p
0211A0:  72 65 76 69 6F 75 73 20 52 4F 4D 20 73 74 61 74    revious ROM stat
0211B0:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 35 20 20    e.....       5  
0211C0:  20 23 42 39 30 46 20 20 4B 4C 20 52 4F 4D 20 53     #B90F  KL ROM S
0211D0:  45 4C 45 43 54 20 20 20 20 20 20 20 20 53 65 6C    ELECT        Sel
0211E0:  65 63 74 20 61 20 70 61 72 74 69 63 75 6C 61 72    ect a particular
0211F0:  20 75 70 70 65 72 20 52 4F 4D 2E 0D 0A 0D 0A 20     upper ROM..... 
021200:  20 20 20 20 20 20 36 20 20 20 23 42 39 31 32 20          6   #B912 
021210:  20 4B 4C 20 43 55 52 52 20 53 45 4C 45 43 54 49     KL CURR SELECTI
021220:  4F 4E 20 20 20 20 41 73 6B 20 20 77 68 69 63 68    ON    Ask  which
021230:  20 20 75 70 70 65 72 20 20 52 4F 4D 20 20 69 73      upper  ROM  is
021240:  20 20 20 63 75 72 72 65 6E 74 6C 79 0D 0A 20 20       currently..  
021250:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021260:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021270:  20 20 20 20 20 73 65 6C 65 63 74 65 64 2E 0D 0A         selected...
021280:  0D 0A 20 20 20 20 20 20 20 37 20 20 20 23 42 39    ..       7   #B9
021290:  31 35 20 20 4B 4C 20 50 52 4F 42 45 20 52 4F 4D    15  KL PROBE ROM
0212A0:  20 20 20 20 20 20 20 20 20 41 73 6B 20 63 6C 61             Ask cla
0212B0:  73 73 20 61 6E 64 20 76 65 72 73 69 6F 6E 20 6F    ss and version o
0212C0:  66 20 61 20 52 4F 4D 2E 0D 0A 0D 0A 0D 0A 0D 0A    f a ROM.........
0212D0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
0212E0:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
0212F0:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
021300:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021310:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 34             page 14
021320:  2E 31 35 0D 0A 1A 0D 0A 0D 0A 20 20 20 20 20 20    .15.......      
021330:  20 54 68 65 72 65 20 61 72 65 20 61 20 6E 75 6D     There are a num
021340:  62 65 72 20 6F 66 20 6A 75 6D 70 62 6C 6F 63 6B    ber of jumpblock
021350:  73 20 70 72 6F 76 69 64 65 64 20 62 79 20 74 68    s provided by th
021360:  65 20 66 69 72 6D 77 61 72 65 2E 20 54 68 65 20    e firmware. The 
021370:  6C 61 72 67 65 73 74 0D 0A 20 20 20 20 20 20 20    largest..       
021380:  20 52 4F 4D 20 52 45 53 54 4F 52 45 20 20 20 20     ROM RESTORE    
021390:  20 20 20 52 65 73 74 6F 72 65 20 74 68 65 20 70       Restore the p
0213A0:  72 65 76 69 6F 75 73 20 52 4F 4D 20 73 74 61 74    revious ROM stat
0213B0:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 35 20 20    e.....       5  
0213C0:  20 23 42 39 30 46 20 20 4B 4C 20 52 4F 4D 20 53     #B90F  KL ROM S
0213D0:  45 4C 45 43 54 20 20 20 20 20 20 20 20 53 65 6C    ELECT        Sel
0213E0:  65 63 74 20 61 20 70 61 72 74 69 63 75 6C 61 72    ect a particular
0213F0:  20 75 70 70 65 72 20 52 4F 4D 2E 0D 0A 0D 0A 20     upper ROM..... 
021400:  20 20 20 20 20 20 36 20 20 20 23 42 39 31 32 20          6   #B912 
021410:  20 4B 4C 20 43 55 52 52 20 53 45 4C 45 43 54 49     KL CURR SELECTI
021420:  4F 4E 20 20 20 20 41 73 6B 20 20 77 68 69 63 68    ON    Ask  which
021430:  20 20 75 70 70 65 72 20 20 52 4F 4D 20 20 69 73      upper  ROM  is
021440:  20 20 20 63 75 72 72 65 6E 74 6C 79 0D 0A 20 20       currently..  
021450:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021460:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021470:  20 20 20 20 20 73 65 6C 65 63 74 65 64 2E 0D 0A         selected...
021480:  0D 0A 20 20 20 20 20 20 20 37 20 20 20 23 42 39    ..       7   #B9
021490:  31 35 20 20 4B 4C 20 50 52 4F 42 45 20 52 4F 4D    15  KL PROBE ROM
0214A0:  20 20 20 20 20 20 20 20 20 41 73 6B 20 63 6C 61             Ask cla
0214B0:  73 73 20 61 6E 64 20 76 65 72 73 69 6F 6E 20 6F    ss and version o
0214C0:  66 20 61 20 52 4F 4D 2E 0D 0A 0D 0A 0D 0A 0D 0A    f a ROM.........
0214D0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
0214E0:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
0214F0:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
021500:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
021510:  1C 00 00 00 02 09 50 E5 1C 00 C1 02 00 00 00 02    ......P.........
021520:  1C 00 C2 02 00 00 00 02 1C 00 C3 02 00 00 00 02    ................
021530:  1C 00 C4 02 00 00 00 02 1C 00 C5 02 00 00 00 02    ................
021540:  1C 00 C6 02 00 00 00 02 1C 00 C7 02 00 00 00 02    ................
021550:  1C 00 C8 02 00 00 00 02 1C 00 C9 02 00 00 00 02    ................
021560:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
021570:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
021580:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
021590:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0215F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
021600:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
021610:  20 20 20 38 20 20 20 23 42 39 31 38 20 20 4B 4C       8   #B918  KL
021620:  20 52 4F 4D 20 44 45 53 45 4C 45 43 54 20 20 20     ROM DESELECT   
021630:  20 20 20 52 65 73 74 6F 72 65 20 20 20 74 68 65       Restore   the
021640:  20 20 20 70 72 65 76 69 6F 75 73 20 20 20 75 70       previous   up
021650:  70 65 72 20 20 20 52 4F 4D 0D 0A 20 20 20 20 20    per   ROM..     
021660:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021680:  20 20 73 65 6C 65 63 74 69 6F 6E 2E 0D 0A 0D 0A      selection.....
021690:  20 20 20 20 20 20 20 39 20 20 20 23 42 39 31 42           9   #B91B
0216A0:  20 20 4B 4C 20 4C 44 49 52 20 20 20 20 20 20 20      KL LDIR       
0216B0:  20 20 20 20 20 20 20 4D 6F 76 65 20 73 74 6F 72           Move stor
0216C0:  65 20 28 4C 44 49 52 29 20 77 69 74 68 20 52 4F    e (LDIR) with RO
0216D0:  4D 73 20 64 69 73 61 62 6C 65 64 2E 0D 0A 0D 0A    Ms disabled.....
0216E0:  20 20 20 20 20 20 20 31 30 20 20 23 42 39 31 45           10  #B91E
0216F0:  20 20 4B 4C 20 4C 44 44 52 20 20 20 20 20 20 20      KL LDDR       
021700:  20 20 20 20 20 20 20 4D 6F 76 65 20 73 74 6F 72           Move stor
021710:  65 20 28 4C 44 44 52 29 20 77 69 74 68 20 52 4F    e (LDDR) with RO
021720:  4D 73 20 64 69 73 61 62 6C 65 64 2E 0D 0A 0D 0A    Ms disabled.....
021730:  20 20 20 20 20 20 20 31 31 20 20 23 42 39 32 31           11  #B921
021740:  20 20 4B 4C 20 50 4F 4C 4C 20 53 59 4E 43 48 52      KL POLL SYNCHR
021750:  4F 4E 4F 55 53 20 20 43 68 65 63 6B 20 69 66 20    ONOUS  Check if 
021760:  61 6E 20 65 76 65 6E 74 20 77 69 74 68 20 68 69    an event with hi
021770:  67 68 65 72 20 70 72 69 6F 72 69 74 79 0D 0A 20    gher priority.. 
021780:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021790:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0217A0:  20 20 20 20 20 20 74 68 61 6E 20 74 68 65 20 63          than the c
0217B0:  75 72 72 65 6E 74 20 65 76 65 6E 74 20 69 73 20    urrent event is 
0217C0:  70 65 6E 64 69 6E 67 2E 0D 0A 0D 0A 20 20 20 20    pending.....    
0217D0:  20 20 20 31 34 20 20 23 42 39 32 41 20 20 4B 4C       14  #B92A  KL
0217E0:  20 53 43 41 4E 20 4E 45 45 44 45 44 20 20 20 20     SCAN NEEDED    
0217F0:  20 20 20 45 6E 73 75 72 65 20 6B 65 79 62 6F 61       Ensure keyboa
021800:  72 64 20 20 69 73 20 20 73 63 61 6E 6E 65 64 20    rd  is  scanned 
021810:  20 61 74 20 20 6E 65 78 74 0D 0A 20 20 20 20 20     at  next..     
021820:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021830:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021840:  20 20 6F 70 70 6F 72 74 75 6E 69 74 79 2E 0D 0A      opportunity...
021850:  0D 0A 20 20 20 20 20 20 20 28 4E 2E 42 3E 20 74    ..       (N.B> t
021860:  68 65 72 65 20 61 72 65 20 6E 6F 20 65 6E 74 72    here are no entr
021870:  69 65 73 20 31 32 20 6F 72 20 31 33 29 2E 0D 0A    ies 12 or 13)...
021880:  0D 0A 0D 0A 20 20 20 20 20 20 20 31 34 2E 34 20    ....       14.4 
021890:  54 68 65 20 4C 6F 77 20 4B 65 72 6E 65 6C 20 4A    The Low Kernel J
0218A0:  75 6D 70 62 6C 6F 63 6B 2E 0D 0A 0D 0A 0D 0A 20    umpblock....... 
0218B0:  20 20 20 20 20 20 54 68 65 20 4B 65 72 6E 65 6C          The Kernel
0218C0:  20 70 72 6F 76 69 64 65 73 20 61 20 6E 75 6D 62     provides a numb
0218D0:  65 72 20 6F 66 20 75 73 65 66 75 6C 20 72 6F 75    er of useful rou
0218E0:  74 69 6E 65 73 20 69 6E 20 74 68 65 20 61 72 65    tines in the are
0218F0:  61 20 6F 66 20 20 6D 65 6D 6F 72 79 0D 0A 20 20    a of  memory..  
021900:  20 20 20 20 20 62 65 74 77 65 65 6E 20 23 30 30         between #00
021910:  30 20 61 6E 64 20 23 30 30 33 46 2E 20 54 68 65    0 and #003F. The
021920:  73 65 20 61 72 65 20 61 76 61 69 6C 61 62 6C 65    se are available
021930:  2C 20 69 6E 20 73 6F 6D 65 20 63 61 73 65 73 2C    , in some cases,
021940:  20 62 6F 74 68 20 61 73 20 20 61 0D 0A 20 20 20     both as  a..   
021950:  20 20 20 20 70 75 62 6C 69 73 68 65 64 20 72 6F        published ro
021960:  75 74 69 6E 65 20 61 64 64 72 65 73 73 20 61 6E    utine address an
021970:  64 20 61 73 20 61 20 72 65 73 74 61 72 74 20 69    d as a restart i
021980:  6E 73 74 72 75 63 74 69 6F 6E 2E 20 49 6E 20 67    nstruction. In g
021990:  65 6E 65 72 61 6C 20 74 68 65 0D 0A 20 20 20 20    eneral the..    
0219A0:  20 20 20 72 6F 75 74 69 6E 65 73 20 61 72 65 20       routines are 
0219B0:  61 76 61 69 6C 61 62 6C 65 20 62 6F 74 68 20 69    available both i
0219C0:  6E 20 52 4F 4D 20 61 6E 64 20 52 41 4D 20 73 6F    n ROM and RAM so
0219D0:  20 77 68 65 74 68 65 72 20 74 68 65 20 6C 6F 77     whether the low
0219E0:  65 72 20 52 4F 4D 20 69 73 0D 0A 20 20 20 20 20    er ROM is..     
0219F0:  20 20 65 6E 61 62 6C 65 64 20 64 6F 65 73 20 6E      enabled does n
021A00:  6F 74 20 6D 61 74 74 65 72 2E 20 54 68 65 72 65    ot matter. There
021A10:  20 61 72 65 20 61 6C 73 6F 20 61 20 63 6F 75 70     are also a coup
021A20:  6C 65 20 20 6F 66 20 20 61 72 65 61 73 20 20 61    le  of  areas  a
021A30:  76 61 69 6C 61 62 6C 65 0D 0A 20 20 20 20 20 20    vailable..      
021A40:  20 66 6F 72 20 74 68 65 20 75 73 65 72 20 74 6F     for the user to
021A50:  20 70 61 74 63 68 20 74 6F 20 74 72 61 70 20 52     patch to trap R
021A60:  53 54 20 20 36 73 20 20 61 6E 64 20 20 69 6E 74    ST  6s  and  int
021A70:  65 72 72 75 70 74 73 20 20 66 72 6F 6D 20 20 65    errupts  from  e
021A80:  78 74 65 72 6E 61 6C 0D 0A 20 20 20 20 20 20 20    xternal..       
021A90:  68 61 72 64 77 61 72 65 2E 0D 0A 0D 0A 0D 0A 20    hardware....... 
021AA0:  20 20 20 20 20 20 54 68 65 20 6C 6F 77 20 4B 65          The low Ke
021AB0:  72 6E 65 6C 20 6A 75 6D 70 62 6C 6F 63 6B 20 69    rnel jumpblock i
021AC0:  73 20 20 6E 6F 74 20 20 69 6E 74 65 6E 64 65 64    s  not  intended
021AD0:  20 20 66 6F 72 20 20 74 68 65 20 20 75 73 65 72      for  the  user
021AE0:  20 20 74 6F 20 20 61 6C 74 65 72 2E 0D 0A 20 20      to  alter...  
021AF0:  20 20 20 20 20 48 6F 77 65 76 65 72 2C 20 69 74         However, it
021B00:  20 6D 61 79 20 62 65 20 6E 65 63 65 73 73 61 72     may be necessar
021B10:  79 20 74 6F 20 61 6C 74 65 72 20 69 74 20 75 6E    y to alter it un
021B20:  64 65 72 20 63 65 72 74 61 69 6E 20 20 63 69 72    der certain  cir
021B30:  63 75 6D 73 74 61 6E 63 65 73 2E 0D 0A 20 20 20    cumstances...   
021B40:  20 20 20 20 49 6E 20 70 61 72 74 69 63 75 6C 61        In particula
021B50:  72 20 74 68 65 20 49 4E 54 45 52 52 55 50 54 20    r the INTERRUPT 
021B60:  45 4E 54 52 59 20 28 62 79 20 70 61 74 63 68 69    ENTRY (by patchi
021B70:  6E 67 20 74 68 65 20 6A 75 6D 70 20 61 74 20 20    ng the jump at  
021B80:  23 30 30 33 38 29 20 20 6F 72 0D 0A 20 20 20 20    #0038)  or..    
021B90:  20 20 20 74 68 65 20 52 45 53 45 54 20 45 4E 54       the RESET ENT
021BA0:  52 59 20 28 62 79 20 20 70 61 74 63 68 69 6E 67    RY (by  patching
021BB0:  20 20 74 68 65 20 20 62 79 74 65 73 20 20 66 72      the  bytes  fr
021BC0:  6F 6D 20 20 23 30 30 30 30 2E 2E 23 30 30 30 37    om  #0000..#0007
021BD0:  29 2E 20 20 49 66 20 20 61 0D 0A 20 20 20 20 20    ).  If  a..     
021BE0:  20 20 70 72 6F 67 72 61 6D 20 64 6F 65 73 20 63      program does c
021BF0:  68 61 6E 67 65 20 61 6E 79 20 6C 6F 63 61 74 69    hange any locati
021C00:  6F 6E 73 20 69 6E 20 74 68 65 20 6A 75 6D 70 62    ons in the jumpb
021C10:  6C 6F 63 6B 20 28 6F 74 68 65 72 20 20 74 68 61    lock (other  tha
021C20:  6E 20 20 74 68 6F 73 65 0D 0A 20 20 20 20 20 20    n  those..      
021C30:  20 69 6E 20 74 68 65 20 55 53 45 52 20 52 45 53     in the USER RES
021C40:  54 41 52 54 20 6F 72 20 45 58 54 20 49 4E 54 45    TART or EXT INTE
021C50:  52 52 55 50 54 20 61 72 65 61 73 29 20 74 68 65    RRUPT areas) the
021C60:  6E 20 69 74 20 69 73 20 20 74 68 65 20 20 70 72    n it is  the  pr
021C70:  6F 67 72 61 6D 27 73 0D 0A 20 20 20 20 20 20 20    ogram's..       
021C80:  72 65 73 70 6F 6E 73 69 62 69 6C 69 74 79 20 74    responsibility t
021C90:  6F 20 65 6E 73 75 72 65 20 74 68 61 74 20 74 68    o ensure that th
021CA0:  65 20 6C 6F 77 65 72 20 52 4F 4D 20 69 73 20 65    e lower ROM is e
021CB0:  6E 61 62 6C 65 64 20 6F 72 20 74 68 65 20 6F 72    nabled or the or
021CC0:  69 67 69 6E 61 6C 0D 0A 20 20 20 20 20 20 20 63    iginal..       c
021CD0:  6F 6E 74 65 6E 74 73 20 61 72 65 20 72 65 73 74    ontents are rest
021CE0:  6F 72 65 64 20 77 68 65 6E 20 61 6E 79 20 6F 74    ored when any ot
021CF0:  68 65 72 20 70 72 6F 67 72 61 6D 73 20 72 75 6E    her programs run
021D00:  73 2E 20 49 6E 20 70 61 72 74 69 63 75 6C 61 72    s. In particular
021D10:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 70 72      the..       pr
021D20:  6F 67 72 61 6D 20 6D 75 73 74 20 73 6F 72 74 20    ogram must sort 
021D30:  6F 75 74 20 74 68 65 20 73 74 61 74 65 20 77 68    out the state wh
021D40:  65 6E 20 69 6E 74 65 72 72 75 70 74 73 20 6F 63    en interrupts oc
021D50:  63 75 72 20 28 68 65 6E 63 65 20 74 68 65 20 20    cur (hence the  
021D60:  6E 65 65 64 0D 0A 20 20 20 20 20 20 20 74 6F 20    need..       to 
021D70:  70 61 74 63 68 20 74 68 65 20 49 4E 54 45 52 52    patch the INTERR
021D80:  55 50 54 20 45 4E 54 52 59 29 2E 0D 0A 0D 0A 0D    UPT ENTRY)......
021D90:  0A 20 20 20 20 20 20 20 4D 6F 72 65 20 64 65 74    .       More det
021DA0:  61 69 6C 65 64 20 64 65 73 63 72 69 70 74 69 6F    ailed descriptio
021DB0:  6E 73 20 6F 66 20 74 68 65 20 72 6F 75 74 69 6E    ns of the routin
021DC0:  65 73 20 69 6E 20 74 68 69 73 20 20 6A 75 6D 70    es in this  jump
021DD0:  62 6C 6F 63 6B 20 20 63 61 6E 20 20 62 65 0D 0A    block  can  be..
021DE0:  20 20 20 20 20 20 20 66 6F 75 6E 64 20 69 6E 20           found in 
021DF0:  73 65 63 74 69 6F 6E 20 31 38 2E 0D 0A 0D 0A 0D    section 18......
021E00:  0A 20 20 20 20 20 20 20 23 30 30 30 30 20 20 52    .       #0000  R
021E10:  53 54 20 30 20 20 52 45 53 45 54 20 45 4E 54 52    ST 0  RESET ENTR
021E20:  59 20 20 20 20 20 20 20 43 6F 6D 70 6C 65 74 65    Y       Complete
021E30:  6C 79 20 72 65 73 65 74 20 20 74 68 65 20 20 6D    ly reset  the  m
021E40:  61 63 68 69 6E 65 20 20 61 73 20 20 69 66 0D 0A    achine  as  if..
021E50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021E60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021E70:  20 20 20 20 20 20 20 70 6F 77 65 72 65 64 20 75           powered u
021E80:  70 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 23 30 30    p.....       #00
021E90:  30 38 20 20 52 53 54 20 31 20 20 4C 4F 57 20 4A    08  RST 1  LOW J
021EA0:  55 4D 50 20 20 20 20 20 20 20 20 20 20 4A 75 6D    UMP          Jum
021EB0:  70 20 74 6F 20 6C 6F 77 65 72 20 52 4F 4D 20 20    p to lower ROM  
021EC0:  6F 72 20 20 52 41 4D 2C 20 20 74 61 6B 65 73 20    or  RAM,  takes 
021ED0:  20 61 6E 0D 0A 20 20 20 20 20 20 20 20 20 20 20     an..           
021EE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021EF0:  20 20 20 20 20 20 20 20 20 20 20 20 69 6E 6C 69                inli
021F00:  6E 65 20 27 6C 6F 77 20 61 64 64 72 65 73 73 27    ne 'low address'
021F10:  20 74 6F 20 6A 75 6D 70 20 74 6F 2E 0D 0A 0D 0A     to jump to.....
021F20:  20 20 20 20 20 20 20 23 30 30 30 42 20 20 20 20           #000B    
021F30:  20 20 20 20 20 4B 4C 20 4C 4F 57 20 50 43 48 4C         KL LOW PCHL
021F40:  20 20 20 20 20 20 20 4A 75 6D 70 20 74 6F 20 6C           Jump to l
021F50:  6F 77 65 72 20 52 4F 4D 20 6F 72 20 52 41 4D 2C    ower ROM or RAM,
021F60:  20 48 4C 20 20 63 6F 6E 74 61 69 6E 73 0D 0A 20     HL  contains.. 
021F70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021F80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
021F90:  20 20 20 20 20 20 74 68 65 20 27 6C 6F 77 20 61          the 'low a
021FA0:  64 64 72 65 73 73 27 20 74 6F 20 6A 75 6D 70 20    ddress' to jump 
021FB0:  74 6F 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 23 30    to.....       #0
021FC0:  30 30 45 20 20 20 20 20 20 20 20 20 50 43 42 43    00E         PCBC
021FD0:  20 49 4E 53 54 52 55 43 54 49 4F 4E 20 20 4A 75     INSTRUCTION  Ju
021FE0:  6D 70 20 74 6F 20 61 64 64 72 65 73 73 20 69 6E    mp to address in
021FF0:  20 42 43 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A     BC.............
022000:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
022010:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
022020:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
022030:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022040:  20 20 20 70 61 67 65 20 31 34 2E 31 36 0D 0A 0D       page 14.16...
022050:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
022060:  20 20 23 30 30 31 30 20 20 52 53 54 20 32 20 53      #0010  RST 2 S
022070:  49 44 45 20 43 41 4C 4C 20 20 20 20 20 20 20 20    IDE CALL        
022080:  20 20 43 61 6C 6C 20 74 6F 20 61 20 73 69 64 65      Call to a side
022090:  77 61 79 73 20 52 4F 4D 2C 20 20 74 61 6B 65 73    ways ROM,  takes
0220A0:  20 20 69 6E 6C 69 6E 65 0D 0A 20 20 20 20 20 20      inline..      
0220B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0220C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0220D0:  20 27 73 69 64 65 20 61 64 64 72 65 73 73 27 20     'side address' 
0220E0:  74 6F 20 63 61 6C 6C 2E 0D 0A 0D 0A 20 20 20 20    to call.....    
0220F0:  20 20 20 23 30 30 31 33 20 20 4B 4C 20 53 49 44       #0013  KL SID
022100:  45 20 50 43 48 4C 20 20 20 20 20 20 20 20 20 20    E PCHL          
022110:  20 20 20 43 61 6C 6C 20 74 6F 20 61 20 73 69 64       Call to a sid
022120:  65 77 61 79 73 20 20 52 4F 4D 2C 20 20 48 4C 20    eways  ROM,  HL 
022130:  20 63 6F 6E 74 61 69 6E 73 0D 0A 20 20 20 20 20     contains..     
022140:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022160:  20 20 27 73 69 64 65 20 61 64 64 72 65 73 73 27      'side address'
022170:  20 74 6F 20 63 61 6C 6C 2E 0D 0A 0D 0A 20 20 20     to call.....   
022180:  20 20 20 20 23 30 30 31 36 20 20 50 43 44 45 20        #0016  PCDE 
022190:  49 4E 53 54 52 55 43 54 49 4F 4E 20 20 20 20 20    INSTRUCTION     
0221A0:  20 20 20 20 4A 75 6D 70 20 74 6F 20 61 64 64 72        Jump to addr
0221B0:  65 73 73 20 69 6E 20 44 45 2E 0D 0A 0D 0A 20 20    ess in DE.....  
0221C0:  20 20 20 20 20 23 30 30 31 38 20 20 52 53 54 20         #0018  RST 
0221D0:  33 20 46 41 52 20 43 41 4C 4C 20 20 20 20 20 20    3 FAR CALL      
0221E0:  20 20 20 20 20 43 61 6C 6C 20 61 20 72 6F 75 74         Call a rout
0221F0:  69 6E 65 20 20 69 6E 20 20 61 6E 79 20 20 52 4F    ine  in  any  RO
022200:  4D 20 20 6F 72 20 20 52 41 4D 2C 0D 0A 20 20 20    M  or  RAM,..   
022210:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022220:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022230:  20 20 20 20 74 61 6B 65 73 20 61 6E 20 69 6E 6C        takes an inl
022240:  69 6E 65 20 61 64 64 72 65 73 73 20 20 6F 66 20    ine address  of 
022250:  20 74 68 65 20 20 27 66 61 72 0D 0A 20 20 20 20     the  'far..    
022260:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022270:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022280:  20 20 20 61 64 64 72 65 73 73 27 20 74 6F 20 63       address' to c
022290:  61 6C 6C 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 23    all.....       #
0222A0:  30 30 31 42 20 20 4B 4C 20 46 41 52 20 50 43 48    001B  KL FAR PCH
0222B0:  4C 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43    L              C
0222C0:  61 6C 6C 20 61 20 72 6F 75 74 69 6E 65 20 69 6E    all a routine in
0222D0:  20 61 6E 79 20 52 4F 4D 20 20 6F 72 20 20 52 41     any ROM  or  RA
0222E0:  4D 2C 20 20 43 0D 0A 20 20 20 20 20 20 20 20 20    M,  C..         
0222F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022300:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 6E                  an
022310:  64 20 48 4C 20 63 6F 6E 74 61 69 6E 20 74 68 65    d HL contain the
022320:  20 20 27 66 61 72 20 20 61 64 64 72 65 73 73 27      'far  address'
022330:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20      to..          
022340:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022350:  20 20 20 20 20 20 20 20 20 20 20 20 20 63 61 6C                 cal
022360:  6C 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 23 30 30    l.....       #00
022370:  31 45 20 20 50 43 48 4C 20 49 4E 53 54 52 55 43    1E  PCHL INSTRUC
022380:  54 49 4F 4E 20 20 20 20 20 20 20 20 20 4A 75 6D    TION         Jum
022390:  70 20 74 6F 20 61 64 64 72 65 73 73 20 69 6E 20    p to address in 
0223A0:  48 4C 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 23 30    HL.....       #0
0223B0:  30 32 30 20 20 52 53 54 20 34 20 52 41 4D 20 4C    020  RST 4 RAM L
0223C0:  41 4D 20 20 20 20 20 20 20 20 20 20 20 20 4C 44    AM            LD
0223D0:  20 41 2C 28 48 4C 29 20 77 69 74 68 20 61 6C 6C     A,(HL) with all
0223E0:  20 52 4F 4D 73 20 64 69 73 61 62 6C 65 64 2E 0D     ROMs disabled..
0223F0:  0A 0D 0A 20 20 20 20 20 20 20 23 30 30 32 33 20    ...       #0023 
022400:  20 4B 4C 20 46 41 52 20 49 43 41 4C 4C 20 20 20     KL FAR ICALL   
022410:  20 20 20 20 20 20 20 20 20 20 43 61 6C 6C 20 61              Call a
022420:  20 72 6F 75 74 69 6E 65 20 69 6E 20 61 6E 79 20     routine in any 
022430:  52 4F 4D 20 6F 72 20 20 52 41 4D 2C 20 20 48 4C    ROM or  RAM,  HL
022440:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
022450:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022460:  20 20 20 20 20 20 20 20 20 70 6F 69 6E 74 73 20             points 
022470:  61 74 20 74 68 65 20 27 66 61 72 20 61 64 64 72    at the 'far addr
022480:  65 73 73 27 20 74 6F 20 63 61 6C 6C 2E 0D 0A 0D    ess' to call....
022490:  0A 20 20 20 20 20 20 20 23 30 30 32 38 20 20 52    .       #0028  R
0224A0:  53 54 20 35 20 46 49 52 4D 20 4A 55 4D 50 20 20    ST 5 FIRM JUMP  
0224B0:  20 20 20 20 20 20 20 20 4A 75 6D 70 20 74 6F 20            Jump to 
0224C0:  6C 6F 77 65 72 20 20 52 4F 4D 2C 20 20 74 61 6B    lower  ROM,  tak
0224D0:  65 73 20 20 61 6E 20 20 69 6E 6C 69 6E 65 0D 0A    es  an  inline..
0224E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0224F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022500:  20 20 20 20 20 20 20 61 64 64 72 65 73 73 20 74           address t
022510:  6F 20 6A 75 6D 70 20 74 6F 2E 0D 0A 0D 0A 20 20    o jump to.....  
022520:  20 20 20 20 20 23 30 30 33 30 20 20 52 53 54 20         #0030  RST 
022530:  36 20 55 53 45 52 20 52 45 53 54 41 52 54 20 20    6 USER RESTART  
022540:  20 20 20 20 20 52 4F 4D 20 76 65 72 73 69 6F 6E         ROM version
022550:  20 73 61 76 65 73 20 63 75 72 72 65 6E 74 20 52     saves current R
022560:  4F 4D 20 73 74 61 74 65 20 69 6E 0D 0A 20 20 20    OM state in..   
022570:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022580:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022590:  20 20 20 20 23 30 30 32 42 2C 20 74 75 72 6E 73        #002B, turns
0225A0:  20 74 68 65 20 20 6C 6F 77 65 72 20 20 52 4F 4D     the  lower  ROM
0225B0:  20 20 6F 66 66 20 20 61 6E 64 0D 0A 20 20 20 20      off  and..    
0225C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0225D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0225E0:  20 20 20 6A 75 6D 70 73 20 74 6F 20 74 68 65 20       jumps to the 
0225F0:  52 41 4D 20 76 65 72 73 69 6F 6E 2E 20 52 41 4D    RAM version. RAM
022600:  20 20 76 65 72 73 69 6F 6E 0D 0A 20 20 20 20 20      version..     
022610:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022620:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022630:  20 20 6D 61 79 20 62 65 20 70 61 74 63 68 65 64      may be patched
022640:  20 20 62 79 20 20 74 68 65 20 20 75 73 65 72 20      by  the  user 
022650:  20 62 65 74 77 65 65 6E 0D 0A 20 20 20 20 20 20     between..      
022660:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022680:  20 23 30 30 33 30 20 61 6E 64 20 23 30 30 33 37     #0030 and #0037
022690:  20 69 6E 63 6C 75 73 69 76 65 6C 79 2E 0D 0A 0D     inclusively....
0226A0:  0A 20 20 20 20 20 20 20 23 30 30 33 38 20 20 52    .       #0038  R
0226B0:  53 54 20 37 20 49 4E 54 45 52 52 55 50 54 20 45    ST 7 INTERRUPT E
0226C0:  4E 54 52 59 20 20 20 20 54 68 69 73 20 72 65 73    NTRY    This res
0226D0:  74 61 72 74 20 69 73 20 6E 6F 74 20 61 76 61 69    tart is not avai
0226E0:  6C 61 62 6C 65 20 61 73 20 69 74 20 69 73 0D 0A    lable as it is..
0226F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022700:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022710:  20 20 20 20 20 20 20 75 73 65 64 20 20 66 6F 72           used  for
022720:  20 20 69 6E 74 65 72 72 75 70 74 73 20 20 28 5A      interrupts  (Z
022730:  38 30 20 20 69 6E 74 65 72 72 75 70 74 0D 0A 20    80  interrupt.. 
022740:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022750:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022760:  20 20 20 20 20 20 6D 6F 64 65 20 31 29 2E 0D 0A          mode 1)...
022770:  0D 0A 20 20 20 20 20 20 20 23 30 30 33 42 20 20    ..       #003B  
022780:  45 58 54 20 49 4E 54 45 52 52 55 50 54 20 20 20    EXT INTERRUPT   
022790:  20 20 20 20 20 20 20 20 20 57 68 65 6E 20 20 61             When  a
0227A0:  6E 20 20 69 6E 74 65 72 72 75 70 74 20 20 6F 63    n  interrupt  oc
0227B0:  63 75 72 73 20 20 20 6F 6E 20 20 20 74 68 65 0D    curs   on   the.
0227C0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
0227D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0227E0:  20 20 20 20 20 20 20 20 65 78 70 61 6E 73 69 6F            expansio
0227F0:  6E 20 20 70 6F 72 74 20 20 74 68 65 20 20 66 69    n  port  the  fi
022800:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
022810:  1D 00 00 00 02 09 50 E5 1D 00 C1 02 00 00 00 02    ......P.........
022820:  1D 00 C2 02 00 00 00 02 1D 00 C3 02 00 00 00 02    ................
022830:  1D 00 C4 02 00 00 00 02 1D 00 C5 02 00 00 00 02    ................
022840:  1D 00 C6 02 00 00 00 02 1D 00 C7 02 00 00 00 02    ................
022850:  1D 00 C8 02 00 00 00 02 1D 00 C9 02 00 00 00 02    ................
022860:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
022870:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
022880:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
022890:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0228F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
022900:  72 6D 77 61 72 65 20 20 20 63 61 6C 6C 73 0D 0A    rmware   calls..
022910:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022920:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022930:  20 20 20 20 20 20 20 6C 6F 63 61 74 69 6F 6E 20           location 
022940:  23 30 30 33 42 20 69 6E 20 52 41 4D 2E 20 20 54    #003B in RAM.  T
022950:  68 65 20 20 75 73 65 72 20 20 6D 61 79 0D 0A 20    he  user  may.. 
022960:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022970:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022980:  20 20 20 20 20 20 70 61 74 63 68 20 20 20 62 65          patch   be
022990:  74 77 65 65 6E 20 20 20 23 30 30 33 42 20 20 20    tween   #003B   
0229A0:  61 6E 64 20 20 20 20 23 30 30 33 46 0D 0A 20 20    and    #003F..  
0229B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0229C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0229D0:  20 20 20 20 20 69 6E 63 6C 75 73 69 76 65 20 74         inclusive t
0229E0:  6F 20 74 72 61 70 20 74 68 69 73 20 6F 63 63 75    o trap this occu
0229F0:  72 72 65 6E 63 65 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D    rrence..........
022A00:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
022A10:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
022A20:  20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34        AMSTRAD CPC4
022A30:  36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D    64/664/6128 FIRM
022A40:  57 41 52 45 20 20 20 20 20 20 20 20 20 20 20 20    WARE            
022A50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022A60:  70 61 67 65 20 31 34 2E 31 37 0D 0A 1A 68 65 20    page 14.17...he 
022A70:  6C 61 72 67 65 73 74 0D 0A 20 20 20 20 20 20 20    largest..       
022A80:  45 58 54 20 49 4E 54 45 52 52 55 50 54 20 20 20    EXT INTERRUPT   
022A90:  20 20 20 20 20 20 20 20 20 57 68 65 6E 20 20 61             When  a
022AA0:  6E 20 20 69 6E 74 65 72 72 75 70 74 20 20 6F 63    n  interrupt  oc
022AB0:  63 75 72 73 20 20 20 6F 6E 20 20 20 74 68 65 0D    curs   on   the.
022AC0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
022AD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022AE0:  20 20 20 20 20 20 20 20 65 78 70 61 6E 73 69 6F            expansio
022AF0:  6E 20 20 70 6F 72 74 20 20 74 68 65 20 20 66 69    n  port  the  fi
022B00:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
022B10:  35 20 54 68 65 20 4D 61 69 6E 20 46 69 72 6D 77    5 The Main Firmw
022B20:  61 72 65 20 4A 75 6D 70 62 6C 6F 63 6B 2E 0D 0A    are Jumpblock...
022B30:  0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 69 73 20    ....       This 
022B40:  73 65 63 74 69 6F 6E 20 64 65 73 63 72 69 62 65    section describe
022B50:  73 20 69 6E 20 64 65 74 61 69 6C 20 74 68 65 20    s in detail the 
022B60:  65 6E 74 72 79 20 61 6E 64 20 65 78 69 74 20 63    entry and exit c
022B70:  6F 6E 64 69 74 69 6F 6E 73 20 61 6E 64 20 74 68    onditions and th
022B80:  65 0D 0A 20 20 20 20 20 20 20 65 66 66 65 63 74    e..       effect
022B90:  73 20 6F 66 20 61 6C 6C 20 74 68 65 20 72 6F 75    s of all the rou
022BA0:  74 69 6E 65 73 20 69 6E 20 74 68 65 20 6D 61 69    tines in the mai
022BB0:  6E 20 66 69 72 6D 77 61 72 65 20 6A 75 6D 70 62    n firmware jumpb
022BC0:  6C 6F 63 6B 2E 20 20 54 68 65 20 20 6D 61 69 6E    lock.  The  main
022BD0:  0D 0A 20 20 20 20 20 20 20 66 69 72 6D 77 61 72    ..       firmwar
022BE0:  65 20 6A 75 6D 70 62 6C 6F 63 6B 20 69 73 20 64    e jumpblock is d
022BF0:  65 73 63 72 69 62 65 64 20 69 6E 20 73 65 63 74    escribed in sect
022C00:  69 6F 6E 20 31 34 2E 31 2E 0D 0A 0D 0A 0D 0A 20    ion 14.1....... 
022C10:  20 20 20 20 20 20 54 68 65 20 75 73 65 72 20 20          The user  
022C20:  69 73 20 20 61 64 76 69 73 65 64 20 20 74 6F 20    is  advised  to 
022C30:  20 72 65 61 64 20 20 74 68 65 20 20 73 65 63 74     read  the  sect
022C40:  69 6F 6E 73 20 20 6F 6E 20 20 65 61 63 68 20 20    ions  on  each  
022C50:  70 61 63 6B 20 20 62 65 66 6F 72 65 0D 0A 20 20    pack  before..  
022C60:  20 20 20 20 20 61 74 74 65 6D 70 74 69 6E 67 20         attempting 
022C70:  74 6F 20 75 6E 64 65 72 73 74 61 6E 64 20 74 68    to understand th
022C80:  65 20 6A 75 6D 70 62 6C 6F 63 6B 20 65 6E 74 72    e jumpblock entr
022C90:  69 65 73 2E 20 54 68 65 20 72 65 6C 65 76 61 6E    ies. The relevan
022CA0:  74 20 20 73 65 63 74 69 6F 6E 73 0D 0A 20 20 20    t  sections..   
022CB0:  20 20 20 20 61 72 65 3A 0D 0A 0D 0A 0D 0A 20 20        are:......  
022CC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 4B 65                  Ke
022CD0:  79 20 4D 61 6E 61 67 65 72 20 20 20 20 20 20 20    y Manager       
022CE0:  20 20 28 4B 4D 29 20 20 20 20 20 20 53 65 63 74      (KM)      Sect
022CF0:  69 6F 6E 20 33 2E 0D 0A 20 20 20 20 20 20 20 20    ion 3...        
022D00:  20 20 20 20 20 20 20 20 54 65 78 74 20 56 44 55            Text VDU
022D10:  20 20 20 20 20 20 20 20 20 20 20 20 28 54 58 54                (TXT
022D20:  29 20 20 20 20 20 53 65 63 74 69 6F 6E 20 34 2E    )     Section 4.
022D30:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
022D40:  20 20 47 72 61 70 68 69 63 73 20 56 44 55 20 20      Graphics VDU  
022D50:  20 20 20 20 20 20 28 47 52 41 29 20 20 20 20 20          (GRA)     
022D60:  53 65 63 74 69 6F 6E 20 35 2E 0D 0A 20 20 20 20    Section 5...    
022D70:  20 20 20 20 20 20 20 20 20 20 20 20 53 63 72 65                Scre
022D80:  65 6E 20 50 61 63 6B 20 20 20 20 20 20 20 20 20    en Pack         
022D90:  28 53 43 52 29 20 20 20 20 20 53 65 63 74 69 6F    (SCR)     Sectio
022DA0:  6E 20 36 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    n 6...          
022DB0:  20 20 20 20 20 20 53 6F 75 6E 64 20 4D 61 6E 61          Sound Mana
022DC0:  67 65 72 20 20 20 20 20 20 20 28 53 4F 55 4E 44    ger       (SOUND
022DD0:  29 20 20 20 53 65 63 74 69 6F 6E 20 37 2E 0D 0A    )   Section 7...
022DE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022DF0:  43 61 73 73 65 74 74 65 20 4D 61 6E 61 67 65 72    Cassette Manager
022E00:  20 20 20 20 28 43 41 53 29 20 20 20 20 20 53 65        (CAS)     Se
022E10:  63 74 69 6F 6E 20 38 2E 0D 0A 20 20 20 20 20 20    ction 8...      
022E20:  20 20 20 20 20 20 20 20 20 20 41 4D 53 44 4F 53              AMSDOS
022E30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
022E40:  20 20 20 20 20 20 20 20 53 65 63 74 69 6F 6E 20            Section 
022E50:  39 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    9...            
022E60:  20 20 20 20 4B 65 72 6E 65 6C 20 20 20 20 20 20        Kernel      
022E70:  20 20 20 20 20 20 20 20 28 4B 4C 29 20 20 20 20            (KL)    
022E80:  20 20 53 65 63 74 69 6F 6E 73 20 32 2C 20 31 30      Sections 2, 10
022E90:  2C 20 31 31 20 61 6E 64 20 31 32 2E 0D 0A 20 20    , 11 and 12...  
022EA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 4D 61                  Ma
022EB0:  63 68 69 6E 65 20 50 61 63 6B 20 20 20 20 20 20    chine Pack      
022EC0:  20 20 28 4D 43 29 20 20 20 20 20 20 53 65 63 74      (MC)      Sect
022ED0:  69 6F 6E 20 31 33 2E 0D 0A 0D 0A 0D 0A 20 20 20    ion 13.......   
022EE0:  20 20 20 20 54 68 65 20 74 6F 70 20 6C 69 6E 65        The top line
022EF0:  20 6F 66 20 65 61 63 68 20 64 65 73 63 72 69 70     of each descrip
022F00:  74 69 6F 6E 20 68 61 73 20 74 68 65 20 66 6F 6C    tion has the fol
022F10:  6C 6F 77 69 6E 67 20 6C 61 79 6F 75 74 3A 0D 0A    lowing layout:..
022F20:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
022F30:  20 20 20 20 3C 45 6E 74 72 79 20 6E 75 6D 62 65        <Entry numbe
022F40:  72 3E 3A 20 20 20 20 20 3C 45 6E 74 72 79 20 6E    r>:     <Entry n
022F50:  61 6D 65 3E 20 20 20 20 20 20 20 20 3C 45 6E 74    ame>        <Ent
022F60:  72 79 20 61 64 64 72 65 73 73 3E 0D 0A 0D 0A 0D    ry address>.....
022F70:  0A 20 20 20 20 20 20 20 45 6E 74 72 69 65 73 20    .       Entries 
022F80:  69 6E 20 74 68 65 20 6A 75 6D 70 62 6C 6F 63 6B    in the jumpblock
022F90:  20 61 72 65 20 20 6E 75 6D 62 65 72 65 64 20 20     are  numbered  
022FA0:  73 74 61 72 74 69 6E 67 20 20 66 72 6F 6D 20 20    starting  from  
022FB0:  30 2E 20 20 54 68 65 20 20 65 6E 74 72 79 0D 0A    0.  The  entry..
022FC0:  20 20 20 20 20 20 20 61 64 64 72 65 73 73 20 69           address i
022FD0:  73 20 74 68 65 20 61 64 64 72 65 73 73 20 74 6F    s the address to
022FE0:  20 63 61 6C 6C 20 74 6F 20 69 6E 76 6F 6B 65 20     call to invoke 
022FF0:  74 68 65 20 66 69 72 6D 77 61 72 65 20 72 6F 75    the firmware rou
023000:  74 69 6E 65 20 20 6F 72 20 20 74 68 65 0D 0A 20    tine  or  the.. 
023010:  20 20 20 20 20 20 61 64 64 72 65 73 73 20 6F 66          address of
023020:  20 74 68 65 20 74 68 72 65 65 20 62 79 74 65 73     the three bytes
023030:  20 74 6F 20 70 61 74 63 68 20 20 74 6F 20 20 69     to patch  to  i
023040:  6E 74 65 72 63 65 70 74 20 20 74 68 65 20 20 72    ntercept  the  r
023050:  6F 75 74 69 6E 65 2E 20 20 54 68 65 0D 0A 20 20    outine.  The..  
023060:  20 20 20 20 20 65 6E 74 72 79 20 61 64 64 72 65         entry addre
023070:  73 73 20 63 61 6E 20 62 65 20 63 61 6C 63 75 6C    ss can be calcul
023080:  61 74 65 64 20 61 73 3A 0D 0A 0D 0A 0D 0A 20 20    ated as:......  
023090:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 45 6E                  En
0230A0:  74 72 79 20 61 64 64 72 65 73 73 20 3D 20 53 74    try address = St
0230B0:  61 72 74 20 6F 66 20 6A 75 6D 70 62 6C 6F 63 6B    art of jumpblock
0230C0:  20 2B 33 20 2A 20 45 6E 74 72 79 20 6E 75 6D 62     +3 * Entry numb
0230D0:  65 72 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45    er......       E
0230E0:  61 63 68 20 65 6E 74 72 79 20 69 73 20 6E 61 6D    ach entry is nam
0230F0:  65 64 20 61 6E 64 20 69 73 20 72 65 66 65 72 72    ed and is referr
023100:  65 64 20 74 6F 20 62 79 20 6E 61 6D 65 20 74 68    ed to by name th
023110:  72 6F 75 67 68 6F 75 74 20 74 68 69 73 20 6D 61    roughout this ma
023120:  6E 75 61 6C 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    nual.....       
023130:  54 68 65 20 6C 61 73 74 20 73 65 63 74 69 6F 6E    The last section
023140:  20 6F 66 20 65 61 63 68 20 64 65 73 63 72 69 70     of each descrip
023150:  74 69 6F 6E 20 69 73 20 61 20 6C 69 73 74 20 20    tion is a list  
023160:  6F 66 20 20 72 65 6C 61 74 65 64 20 20 72 6F 75    of  related  rou
023170:  74 69 6E 65 73 2E 0D 0A 20 20 20 20 20 20 20 54    tines...       T
023180:  68 65 20 75 73 65 72 20 69 73 20 61 64 76 69 73    he user is advis
023190:  65 64 20 74 6F 20 6C 6F 6F 6B 20 61 74 20 74 68    ed to look at th
0231A0:  65 73 65 20 61 73 20 74 68 65 20 6C 69 73 74 20    ese as the list 
0231B0:  6D 61 79 20 69 6E 63 6C 75 64 65 20 20 72 6F 75    may include  rou
0231C0:  74 69 6E 65 73 0D 0A 20 20 20 20 20 20 20 6D 6F    tines..       mo
0231D0:  72 65 20 73 75 69 74 65 64 20 66 6F 72 20 20 74    re suited for  t
0231E0:  68 65 20 20 61 70 70 6C 69 63 61 74 69 6F 6E 20    he  application 
0231F0:  20 62 65 69 6E 67 20 20 63 6F 6E 73 69 64 65 72     being  consider
023200:  65 64 2E 20 20 43 6F 6E 76 65 72 73 65 6C 79 20    ed.  Conversely 
023210:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 72 6F 75     the..       rou
023220:  74 69 6E 65 73 20 6D 61 79 20 73 68 65 64 20 66    tines may shed f
023230:  75 72 74 68 65 72 20 6C 69 67 68 74 20 6F 6E 20    urther light on 
023240:  68 6F 77 20 74 68 65 20 6F 72 69 67 69 6E 61 6C    how the original
023250:  20 72 6F 75 74 69 6E 65 73 20 73 68 6F 75 6C 64     routines should
023260:  20 62 65 0D 0A 20 20 20 20 20 20 20 75 73 65 64     be..       used
023270:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    .......       Th
023280:  65 20 64 65 73 63 72 69 70 74 69 6F 6E 73 20 6F    e descriptions o
023290:  66 20 74 68 65 20 72 6F 75 74 69 6E 65 73 20 61    f the routines a
0232A0:  72 65 20 66 6F 72 20 74 68 65 20 64 65 66 61 75    re for the defau
0232B0:  6C 74 20 72 6F 75 74 69 6E 65 20 74 68 61 74 20    lt routine that 
0232C0:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 65 6E 74     the..       ent
0232D0:  72 79 20 6A 75 6D 70 73 20 74 6F 2E 20 54 68 65    ry jumps to. The
0232E0:  20 75 73 65 72 20 6D 61 79 20 63 68 61 6E 67 65     user may change
0232F0:  20 74 68 65 20 65 6E 74 72 79 20 61 6E 64 20 74     the entry and t
023300:  68 69 73 20 6D 61 79 20 20 61 6C 74 65 72 20 20    his may  alter  
023310:  74 68 65 0D 0A 20 20 20 20 20 20 20 61 63 74 69    the..       acti
023320:  6F 6E 20 6F 66 20 74 68 65 20 72 6F 75 74 69 6E    on of the routin
023330:  65 2E 20 54 68 65 20 75 73 65 72 20 69 73 20 61    e. The user is a
023340:  64 76 69 73 65 64 20 74 6F 20 73 74 69 63 6B 20    dvised to stick 
023350:  74 6F 20 74 68 65 20 20 65 6E 74 72 79 2F 65 78    to the  entry/ex
023360:  69 74 0D 0A 20 20 20 20 20 20 20 63 6F 6E 64 69    it..       condi
023370:  74 69 6F 6E 73 20 64 65 73 63 72 69 62 65 64 20    tions described 
023380:  6F 74 68 65 72 77 69 73 65 20 70 72 6F 67 72 61    otherwise progra
023390:  6D 73 20 74 68 61 74 20 63 61 6C 6C 20 74 68 65    ms that call the
0233A0:  20 20 72 6F 75 74 69 6E 65 20 20 28 42 41 53 49      routine  (BASI
0233B0:  43 0D 0A 20 20 20 20 20 20 20 66 6F 72 20 65 78    C..       for ex
0233C0:  61 6D 70 6C 65 29 20 6D 61 79 20 63 65 61 73 65    ample) may cease
0233D0:  20 74 6F 20 6F 70 65 72 61 74 65 20 63 6F 72 72     to operate corr
0233E0:  65 63 74 6C 79 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ectly...........
0233F0:  20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20 43           AMSTRAD C
023400:  50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20 46    PC464/664/6128 F
023410:  49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20 20    IRMWARE         
023420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023430:  20 20 20 20 70 61 67 65 20 31 35 2E 31 0D 0A 0D        page 15.1...
023440:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
023450:  20 20 30 3A 20 4B 4D 20 49 4E 49 54 49 41 4C 49      0: KM INITIALI
023460:  53 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20    SE              
023470:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023480:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023490:  20 20 20 23 42 42 30 30 0D 0A 0D 0A 0D 0A 20 20       #BB00......  
0234A0:  20 20 20 20 20 49 6E 69 74 69 61 6C 69 7A 65 20         Initialize 
0234B0:  74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65 72 0D    the Key Manager.
0234C0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74 69    .....       Acti
0234D0:  6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    on:......       
0234E0:  46 75 6C 6C 20 69 6E 69 74 69 61 6C 69 7A 61 74    Full initializat
0234F0:  69 6F 6E 20 6F 66 20 74 68 65 20 20 4B 65 79 20    ion of the  Key 
023500:  20 4D 61 6E 61 67 65 72 20 20 28 61 73 20 20 64     Manager  (as  d
023510:  75 72 69 6E 67 20 20 45 4D 53 29 2E 20 20 41 6C    uring  EMS).  Al
023520:  6C 20 20 4B 65 79 0D 0A 20 20 20 20 20 20 20 4D    l  Key..       M
023530:  61 6E 61 67 65 72 20 76 61 72 69 61 62 6C 65 73    anager variables
023540:  2C 20 20 62 75 66 66 65 72 73 20 20 61 6E 64 20    ,  buffers  and 
023550:  20 69 6E 64 69 72 65 63 74 69 6F 6E 73 20 20 61     indirections  a
023560:  72 65 20 20 69 6E 69 74 69 61 6C 69 7A 65 64 2E    re  initialized.
023570:  20 20 54 68 65 0D 0A 20 20 20 20 20 20 20 70 72      The..       pr
023580:  65 76 69 6F 75 73 20 73 74 61 74 65 20 6F 66 20    evious state of 
023590:  74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65 72 20    the Key Manager 
0235A0:  69 73 20 6C 6F 73 74 2E 0D 0A 0D 0A 0D 0A 20 20    is lost.......  
0235B0:  20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69         Entry condi
0235C0:  74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    tions:......    
0235D0:  20 20 20 4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73       No conditions
0235E0:  2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
0235F0:  45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A    Exit conditions:
023600:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 46 2C    ......       AF,
023610:  42 43 2C 44 45 20 61 6E 64 20 48 4C 20 63 6F 72    BC,DE and HL cor
023620:  72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 41 6C    rupt...       Al
023630:  6C 20 6F 74 68 65 72 20 72 65 67 69 73 74 65 72    l other register
023640:  73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A    s preserved.....
023650:  0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D    ..       Notes:.
023660:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
023670:  4B 65 79 20 4D 61 6E 61 67 65 72 20 69 6E 64 69    Key Manager indi
023680:  72 65 63 74 69 6F 6E 20 28 4B 4D 20 20 54 45 53    rection (KM  TES
023690:  54 20 20 4B 45 59 29 20 20 69 73 20 20 73 65 74    T  KEY)  is  set
0236A0:  20 20 74 6F 20 20 69 74 73 20 20 64 65 66 61 75      to  its  defau
0236B0:  6C 74 0D 0A 20 20 20 20 20 20 20 72 6F 75 74 69    lt..       routi
0236C0:  6E 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    ne.....       Th
0236D0:  65 20 6B 65 79 20 62 75 66 66 65 72 20 69 73 20    e key buffer is 
0236E0:  73 65 74 20 75 70 20 28 74 6F 20 62 65 20 65 6D    set up (to be em
0236F0:  70 74 79 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    pty).....       
023700:  54 68 65 20 65 78 70 61 6E 73 69 6F 6E 20 62 75    The expansion bu
023710:  66 66 65 72 20 69 73 20 73 65 74 20 75 70 20 61    ffer is set up a
023720:  6E 64 20 74 68 65 20 65 78 70 61 6E 73 69 6F 6E    nd the expansion
023730:  73 20 20 61 72 65 20 20 73 65 74 20 20 74 6F 20    s  are  set  to 
023740:  20 74 68 65 69 72 0D 0A 20 20 20 20 20 20 20 64     their..       d
023750:  65 66 61 75 6C 74 20 73 74 72 69 6E 67 73 2E 0D    efault strings..
023760:  0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 74 72    ...       The tr
023770:  61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 20    anslation table 
023780:  61 72 65 20 69 6E 69 74 69 61 6C 69 7A 65 64 20    are initialized 
023790:  74 6F 20 74 68 65 69 72 20 64 65 66 61 75 6C 74    to their default
0237A0:  20 74 72 61 6E 73 6C 61 74 69 6F 6E 73 2E 0D 0A     translations...
0237B0:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 72 65 70    ..       The rep
0237C0:  65 61 74 69 6E 67 20 6B 65 79 20 6D 61 70 20 69    eating key map i
0237D0:  73 20 69 6E 69 74 69 61 6C 69 7A 65 64 20 74 6F    s initialized to
0237E0:  20 69 74 73 20 64 65 66 61 75 6C 74 20 73 74 61     its default sta
0237F0:  74 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    te.....       Th
023800:  65 20 72 65 70 65 61 74 20 73 70 65 65 64 73 20    e repeat speeds 
023810:  61 72 65 20 73 65 74 20 74 6F 20 74 68 65 69 72    are set to their
023820:  20 64 65 66 61 75 6C 74 20 76 61 6C 75 65 73 2E     default values.
023830:  0D 0A 0D 0A 20 20 20 20 20 20 20 53 68 69 66 74    ....       Shift
023840:  20 61 6E 64 20 63 61 70 73 20 6C 6F 63 6B 20 61     and caps lock a
023850:  72 65 20 74 75 72 6E 65 64 20 6F 66 66 2E 0D 0A    re turned off...
023860:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 62 72 65    ..       The bre
023870:  61 6B 20 65 76 65 6E 74 20 69 73 20 64 69 73 61    ak event is disa
023880:  72 6D 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    rmed.....       
023890:  53 65 65 20 41 70 70 65 6E 64 69 63 65 73 20 49    See Appendices I
0238A0:  49 2C 20 49 49 49 20 61 6E 64 20 49 56 20 20 66    I, III and IV  f
0238B0:  6F 72 20 20 74 68 65 20 20 64 65 66 61 75 6C 74    or  the  default
0238C0:  20 20 74 72 61 6E 73 6C 61 74 69 6F 6E 20 20 74      translation  t
0238D0:  61 62 6C 65 73 2C 0D 0A 20 20 20 20 20 20 20 72    ables,..       r
0238E0:  65 70 65 61 74 69 6E 67 20 6B 65 79 20 74 61 62    epeating key tab
0238F0:  6C 65 20 61 6E 64 20 65 78 70 61 6E 73 69 6F 6E    le and expansion
023900:  20 73 74 72 69 6E 67 73 2E 0D 0A 0D 0A 20 20 20     strings.....   
023910:  20 20 20 20 54 68 69 73 20 72 6F 75 74 69 6E 65        This routine
023920:  20 65 6E 61 62 6C 65 73 20 69 6E 74 65 72 72 75     enables interru
023930:  70 74 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 52    pts.....       R
023940:  65 6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D    elated entries:.
023950:  0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 52 45 53    ...       KM RES
023960:  45 54 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ET......       A
023970:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
023980:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
023990:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0239A0:  20 20 20 20 20 20 20 20 20 20 20 20 70 61 67 65                page
0239B0:  20 31 35 2E 32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D     15.2...........
0239C0:  0A 0D 0A 20 20 20 20 20 20 20 31 3A 20 4B 4D 20    ...       1: KM 
0239D0:  52 45 53 45 54 20 20 20 20 20 20 20 20 20 20 20    RESET           
0239E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0239F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023A00:  20 20 20 20 20 20 20 20 20 20 20 23 42 42 30 33               #BB03
023A10:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65 73    ......       Res
023A20:  65 74 20 74 68 65 20 4B 65 79 20 4D 61 6E 61 67    et the Key Manag
023A30:  65 72 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    er.......       
023A40:  41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20    Action:......   
023A50:  20 20 20 20 52 65 69 6E 69 74 69 61 6C 69 7A 65        Reinitialize
023A60:  73 20 74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65    s the Key Manage
023A70:  72 20 69 6E 64 69 72 65 63 74 69 6F 6E 73 20 61    r indirections a
023A80:  6E 64 20 62 75 66 66 65 72 73 2E 0D 0A 0D 0A 0D    nd buffers......
023A90:  0A 20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F    .       Entry co
023AA0:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20    nditions:...... 
023AB0:  20 20 20 20 20 20 4E 6F 20 63 6F 6E 64 69 74 69          No conditi
023AC0:  6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ons.......      
023AD0:  20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73     Exit conditions
023AE0:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 46    :......       AF
023AF0:  2C 42 43 2C 44 45 20 61 6E 64 20 48 4C 20 63 6F    ,BC,DE and HL co
023B00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
023B10:  1E 00 00 00 02 09 50 E5 1E 00 C1 02 00 00 00 02    ......P.........
023B20:  1E 00 C2 02 00 00 00 02 1E 00 C3 02 00 00 00 02    ................
023B30:  1E 00 C4 02 00 00 00 02 1E 00 C5 02 00 00 00 02    ................
023B40:  1E 00 C6 02 00 00 00 02 1E 00 C7 02 00 00 00 02    ................
023B50:  1E 00 C8 02 00 00 00 02 1E 00 C9 02 00 00 00 02    ................
023B60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023B70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023B80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023B90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023BF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
023C00:  72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 41    rrupt...       A
023C10:  6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73 74 65    ll other registe
023C20:  72 73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D    rs preserved....
023C30:  0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A    ...       Notes:
023C40:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
023C50:  20 4B 65 79 20 4D 61 6E 61 67 65 72 20 69 6E 64     Key Manager ind
023C60:  69 72 65 63 74 69 6F 6E 20 28 4B 4D 20 20 54 45    irection (KM  TE
023C70:  53 54 20 20 4B 45 59 29 20 20 69 73 20 20 73 65    ST  KEY)  is  se
023C80:  74 20 20 74 6F 20 20 69 74 73 20 20 64 65 66 61    t  to  its  defa
023C90:  75 6C 74 0D 0A 20 20 20 20 20 20 20 72 6F 75 74    ult..       rout
023CA0:  69 6E 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ine.......      
023CB0:  20 54 68 65 20 6B 65 79 20 62 75 66 66 65 72 20     The key buffer 
023CC0:  69 73 20 73 65 74 20 75 70 20 28 74 6F 20 62 65    is set up (to be
023CD0:  20 65 6D 70 74 79 29 2E 0D 0A 0D 0A 0D 0A 20 20     empty).......  
023CE0:  20 20 20 20 20 54 68 65 20 65 78 70 61 6E 73 69         The expansi
023CF0:  6F 6E 20 62 75 66 66 65 72 20 69 73 20 73 65 74    on buffer is set
023D00:  20 75 70 20 61 6E 64 20 74 68 65 20 65 78 70 61     up and the expa
023D10:  6E 73 69 6F 6E 73 20 20 61 72 65 20 20 73 65 74    nsions  are  set
023D20:  20 20 74 6F 20 20 74 68 65 69 72 0D 0A 20 20 20      to  their..   
023D30:  20 20 20 20 64 65 66 61 75 6C 74 20 73 74 72 69        default stri
023D40:  6E 67 73 20 28 73 65 65 20 41 70 70 65 6E 64 69    ngs (see Appendi
023D50:  78 20 49 56 29 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    x IV).......    
023D60:  20 20 20 54 68 65 20 62 72 65 61 6B 20 65 76 65       The break eve
023D70:  6E 74 20 69 73 20 64 69 73 61 72 6D 65 64 2E 0D    nt is disarmed..
023D80:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20    .....       All 
023D90:  70 65 6E 64 69 6E 67 20 6B 65 79 73 20 61 6E 64    pending keys and
023DA0:  20 63 68 61 72 61 63 74 65 72 73 20 61 72 65 20     characters are 
023DB0:  64 69 73 63 61 72 64 65 64 2E 0D 0A 0D 0A 0D 0A    discarded.......
023DC0:  20 20 20 20 20 20 20 54 68 69 73 20 72 6F 75 74           This rout
023DD0:  69 6E 65 20 65 6E 61 62 6C 65 73 20 69 6E 74 65    ine enables inte
023DE0:  72 72 75 70 74 73 2E 0D 0A 0D 0A 0D 0A 20 20 20    rrupts.......   
023DF0:  20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72        Related entr
023E00:  69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B    ies:....       K
023E10:  4D 20 44 49 53 41 52 4D 20 42 52 45 41 4B 0D 0A    M DISARM BREAK..
023E20:  20 20 20 20 20 20 20 4B 4D 20 45 58 50 20 42 55           KM EXP BU
023E30:  46 46 45 52 0D 0A 20 20 20 20 20 20 20 4B 4D 20    FFER..       KM 
023E40:  49 4E 49 54 49 41 4C 49 53 45 0D 0A 0D 0A 0D 0A    INITIALISE......
023E50:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
023E60:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
023E70:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
023E80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023E90:  20 20 20 20 20 20 20 20 20 20 20 20 70 61 67 65                page
023EA0:  20 31 35 2E 33 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D     15.3...........
023EB0:  0A 0D 0A 20 20 20 20 20 20 20 32 3A 20 4B 4D 20    ...       2: KM 
023EC0:  57 41 49 54 20 43 48 41 52 20 20 20 20 20 20 20    WAIT CHAR       
023ED0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023EE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
023EF0:  20 20 20 20 20 20 20 20 20 20 20 23 42 42 30 36               #BB06
023F00:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57 61 69    ......       Wai
023F10:  74 20 66 6F 72 20 74 68 65 20 6E 65 78 74 20 63    t for the next c
023F20:  68 61 72 61 63 74 65 72 20 66 72 6F 6D 20 74 68    haracter from th
023F30:  65 20 6B 65 79 62 6F 61 72 64 2E 0D 0A 0D 0A 0D    e keyboard......
023F40:  0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D    .       Action:.
023F50:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 72 79 20    .....       Try 
023F60:  74 6F 20 67 65 74 20 61 20 63 68 61 72 61 63 74    to get a charact
023F70:  65 72 20 66 72 6F 6D 20 74 68 65 20 6B 65 79 20    er from the key 
023F80:  62 75 66 66 65 72 20 6F 72 20 20 74 68 65 20 20    buffer or  the  
023F90:  63 75 72 72 65 6E 74 20 20 65 78 70 61 6E 73 69    current  expansi
023FA0:  6F 6E 0D 0A 20 20 20 20 20 20 20 73 74 72 69 6E    on..       strin
023FB0:  67 2E 20 54 68 69 73 20 72 6F 75 74 69 6E 65 20    g. This routine 
023FC0:  77 61 69 74 73 20 20 75 6E 74 69 6C 20 20 61 20    waits  until  a 
023FD0:  20 63 68 61 72 61 63 74 65 72 20 20 69 73 20 20     character  is  
023FE0:  61 76 61 69 6C 61 62 6C 65 20 20 69 66 20 20 6E    available  if  n
023FF0:  6F 0D 0A 20 20 20 20 20 20 20 63 68 61 72 61 63    o..       charac
024000:  74 65 72 20 69 73 20 69 6D 6D 65 64 69 61 74 65    ter is immediate
024010:  6C 79 20 61 76 61 69 6C 61 62 6C 65 2E 0D 0A 0D    ly available....
024020:  0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72 79 20    ...       Entry 
024030:  63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D    conditions:.....
024040:  0A 20 20 20 20 20 20 20 4E 6F 20 63 6F 6E 64 69    .       No condi
024050:  74 69 6F 6E 73 2E 0D 0A 0D 0A 20 20 20 20 20 20    tions.....      
024060:  20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73     Exit conditions
024070:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 43 61    :......       Ca
024080:  72 72 79 20 74 72 75 65 2E 0D 0A 20 20 20 20 20    rry true...     
024090:  20 20 41 20 63 6F 6E 74 61 69 6E 73 20 74 68 65      A contains the
0240A0:  20 63 68 61 72 61 63 74 65 72 2E 0D 0A 20 20 20     character...   
0240B0:  20 20 20 20 4F 74 68 65 72 20 66 6C 61 67 73 20        Other flags 
0240C0:  63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20    corrupt...      
0240D0:  20 41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73     All other regis
0240E0:  74 65 72 73 20 70 72 65 73 65 72 76 65 64 2E 0D    ters preserved..
0240F0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65    .....       Note
024100:  73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    s:......       T
024110:  68 65 20 70 6F 73 73 69 62 6C 65 20 73 6F 75 72    he possible sour
024120:  63 65 73 20 66 6F 72 20 67 65 6E 65 72 61 74 69    ces for generati
024130:  6E 67 20 74 68 65 20 6E 65 78 74 20 20 63 68 61    ng the next  cha
024140:  72 61 63 74 65 72 20 20 61 72 65 2C 20 20 69 6E    racter  are,  in
024150:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 6F 72      the..       or
024160:  64 65 72 20 74 68 61 74 20 74 68 65 79 20 61 72    der that they ar
024170:  65 20 74 65 73 74 65 64 3A 0D 0A 0D 0A 0D 0A 20    e tested:...... 
024180:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54                   T
024190:  68 65 20 27 70 75 74 20 62 61 63 6B 27 20 63 68    he 'put back' ch
0241A0:  61 72 61 63 74 65 72 2E 0D 0A 20 20 20 20 20 20    aracter...      
0241B0:  20 20 20 20 20 20 20 20 20 20 54 68 65 20 6E 65              The ne
0241C0:  78 74 20 63 68 61 72 61 63 74 65 72 20 6F 66 20    xt character of 
0241D0:  61 6E 20 65 78 70 61 6E 73 69 6F 6E 20 73 74 72    an expansion str
0241E0:  69 6E 67 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    ing...          
0241F0:  20 20 20 20 20 20 54 68 65 20 66 69 72 73 74 20          The first 
024200:  63 68 61 72 61 63 74 65 72 20 6F 66 20 61 6E 20    character of an 
024210:  65 78 70 61 6E 73 69 6F 6E 20 73 74 72 69 6E 67    expansion string
024220:  2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
024230:  20 20 20 41 20 63 68 61 72 61 63 74 65 72 20 66       A character f
024240:  72 6F 6D 20 61 20 6B 65 79 20 74 72 61 6E 73 6C    rom a key transl
024250:  61 74 69 6F 6E 20 74 61 62 6C 65 2E 0D 0A 0D 0A    ation table.....
024260:  0D 0A 20 20 20 20 20 20 20 45 78 70 61 6E 73 69    ..       Expansi
024270:  6F 6E 20 74 6F 6B 65 6E 73 20 66 6F 75 6E 64 20    on tokens found 
024280:  69 6E 20 74 68 65 20 6B 65 79 20 74 72 61 6E 73    in the key trans
024290:  6C 61 74 69 6F 6E 20 74 61 62 6C 65 20 20 61 72    lation table  ar
0242A0:  65 20 20 65 78 70 61 6E 64 65 64 20 20 74 6F 0D    e  expanded  to.
0242B0:  0A 20 20 20 20 20 20 20 74 68 65 69 72 20 61 73    .       their as
0242C0:  73 6F 63 69 61 74 65 64 20 73 74 72 69 6E 67 73    sociated strings
0242D0:  2E 20 45 78 70 61 6E 73 69 6F 6E 20 74 6F 6B 65    . Expansion toke
0242E0:  6E 73 20 66 6F 75 6E 64 20 69 6E 20 65 78 70 61    ns found in expa
0242F0:  6E 73 69 6F 6E 20 20 73 74 72 69 6E 67 73 0D 0A    nsion  strings..
024300:  20 20 20 20 20 20 20 61 72 65 20 6E 6F 74 20 65           are not e
024310:  78 70 61 6E 64 65 64 20 62 75 74 20 61 72 65 20    xpanded but are 
024320:  74 72 65 61 74 65 64 20 61 73 20 63 68 61 72 61    treated as chara
024330:  63 74 65 72 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    cters.......    
024340:  20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72 69       Related entri
024350:  65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    es:......       
024360:  4B 4D 20 43 48 41 52 20 52 45 54 55 52 4E 0D 0A    KM CHAR RETURN..
024370:  20 20 20 20 20 20 20 4B 4D 20 52 45 41 44 20 43           KM READ C
024380:  48 41 52 0D 0A 20 20 20 20 20 20 20 4B 4D 20 57    HAR..       KM W
024390:  41 49 54 20 4B 45 59 0D 0A 0D 0A 0D 0A 0D 0A 0D    AIT KEY.........
0243A0:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    .......       AM
0243B0:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
0243C0:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
0243D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0243E0:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
0243F0:  31 35 2E 34 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    15.4............
024400:  0D 0A 20 20 20 20 20 20 20 33 3A 20 4B 4D 20 52    ..       3: KM R
024410:  45 41 44 20 43 48 41 52 20 20 20 20 20 20 20 20    EAD CHAR        
024420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024430:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024440:  20 20 20 20 20 20 20 20 20 20 23 42 42 30 39 0D              #BB09.
024450:  0A 0D 0A 20 20 20 20 20 20 20 54 65 73 74 20 69    ...       Test i
024460:  66 20 61 20 63 68 61 72 61 63 74 65 72 20 69 73    f a character is
024470:  20 61 76 61 69 6C 61 62 6C 65 20 66 72 6F 6D 20     available from 
024480:  74 68 65 20 6B 65 79 62 6F 61 72 64 2E 0D 0A 0D    the keyboard....
024490:  0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D    .       Action:.
0244A0:  0A 20 20 20 20 20 20 20 54 72 79 20 74 6F 20 67    .       Try to g
0244B0:  65 74 20 61 20 63 68 61 72 61 63 74 65 72 20 66    et a character f
0244C0:  72 6F 6D 20 74 68 65 20 6B 65 79 20 62 75 66 66    rom the key buff
0244D0:  65 72 20 6F 72 20 20 74 68 65 20 20 63 75 72 72    er or  the  curr
0244E0:  65 6E 74 20 20 65 78 70 61 6E 73 69 6F 6E 0D 0A    ent  expansion..
0244F0:  20 20 20 20 20 20 20 73 74 72 69 6E 67 2E 20 54           string. T
024500:  68 69 73 20 72 6F 75 74 69 6E 65 20 64 6F 65 73    his routine does
024510:  20 6E 6F 74 20 77 61 69 74 20 66 6F 72 20 61 20     not wait for a 
024520:  63 68 61 72 61 63 74 65 72 20 74 6F 20 62 65 63    character to bec
024530:  6F 6D 65 20 61 76 61 69 6C 61 62 6C 65 0D 0A 20    ome available.. 
024540:  20 20 20 20 20 20 69 66 20 74 68 65 72 65 20 69          if there i
024550:  73 20 6E 6F 20 63 68 61 72 61 63 74 65 72 20 61    s no character a
024560:  76 61 69 6C 61 62 6C 65 20 69 6D 6D 65 64 69 61    vailable immedia
024570:  74 65 6C 79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    tely.....       
024580:  45 6E 74 72 79 20 63 6F 6E 64 69 74 69 6F 6E 73    Entry conditions
024590:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 20 63    :....       No c
0245A0:  6F 6E 64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A 20 20    onditions.....  
0245B0:  20 20 20 20 20 45 78 69 74 20 63 6F 6E 64 69 74         Exit condit
0245C0:  69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    ions:....       
0245D0:  49 66 20 74 68 65 72 65 20 77 61 73 20 61 20 63    If there was a c
0245E0:  68 61 72 61 63 74 65 72 20 61 76 61 69 6C 61 62    haracter availab
0245F0:  6C 65 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    le:....         
024600:  20 20 20 20 20 20 20 43 61 72 72 79 20 74 72 75           Carry tru
024610:  65 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    e...            
024620:  20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73 20 74        A contains t
024630:  68 65 20 63 68 61 72 61 63 74 65 72 2E 0D 0A 0D    he character....
024640:  0A 20 20 20 20 20 20 20 49 66 20 74 68 65 72 65    .       If there
024650:  20 77 61 73 20 6E 6F 20 63 68 61 72 61 63 74 65     was no characte
024660:  72 20 61 76 61 69 6C 61 62 6C 65 2E 0D 0A 0D 0A    r available.....
024670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024680:  43 61 72 72 79 20 66 61 6C 73 65 2E 0D 0A 20 20    Carry false...  
024690:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 20                  A 
0246A0:  63 6F 72 72 75 70 74 2E 0D 0A 0D 0A 20 20 20 20    corrupt.....    
0246B0:  20 20 20 41 6C 77 61 79 73 3A 0D 0A 0D 0A 20 20       Always:....  
0246C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 4F 74                  Ot
0246D0:  68 65 72 20 66 6C 61 67 73 20 63 6F 72 72 75 70    her flags corrup
0246E0:  74 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    t...            
0246F0:  20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20 72 65        All other re
024700:  67 69 73 74 65 72 73 20 70 72 65 73 65 72 76 65    gisters preserve
024710:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74    d.....       Not
024720:  65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    es:....       Th
024730:  65 20 70 6F 73 73 69 62 6C 65 20 73 6F 75 72 63    e possible sourc
024740:  65 73 20 66 6F 72 20 67 65 6E 65 72 61 74 69 6E    es for generatin
024750:  67 20 74 68 65 20 6E 65 78 74 20 20 63 68 61 72    g the next  char
024760:  61 63 74 65 72 20 20 61 72 65 2C 20 20 69 6E 20    acter  are,  in 
024770:  20 74 68 65 0D 0A 20 20 20 20 20 20 20 6F 72 64     the..       ord
024780:  65 72 20 74 68 61 74 20 74 68 65 79 20 61 72 65    er that they are
024790:  20 74 65 73 74 65 64 3A 0D 0A 0D 0A 20 20 20 20     tested:....    
0247A0:  20 20 20 20 20 20 20 20 20 20 20 20 54 68 65 20                The 
0247B0:  27 70 75 74 20 62 61 63 6B 27 20 63 68 61 72 61    'put back' chara
0247C0:  63 74 65 72 2E 0D 0A 20 20 20 20 20 20 20 20 20    cter...         
0247D0:  20 20 20 20 20 20 20 54 68 65 20 6E 65 78 74 20           The next 
0247E0:  63 68 61 72 61 63 74 65 72 20 6F 66 20 61 6E 20    character of an 
0247F0:  65 78 70 61 6E 73 69 6F 6E 20 73 74 72 69 6E 67    expansion string
024800:  2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
024810:  20 20 20 54 68 65 20 66 69 72 73 74 20 63 68 61       The first cha
024820:  72 61 63 74 65 72 20 6F 66 20 61 6E 20 65 78 70    racter of an exp
024830:  61 6E 73 69 6F 6E 20 73 74 72 69 6E 67 2E 0D 0A    ansion string...
024840:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024850:  41 20 63 68 61 72 61 63 74 65 72 20 66 72 6F 6D    A character from
024860:  20 61 20 6B 65 79 20 74 72 61 6E 73 6C 61 74 69     a key translati
024870:  6F 6E 20 74 61 62 6C 65 2E 0D 0A 0D 0A 20 20 20    on table.....   
024880:  20 20 20 20 45 78 70 61 6E 73 69 6F 6E 20 74 6F        Expansion to
024890:  6B 65 6E 73 20 69 6E 20 74 68 65 20 6B 65 79 20    kens in the key 
0248A0:  74 72 61 6E 73 6C 61 74 69 6F 6E 20 20 74 61 62    translation  tab
0248B0:  6C 65 20 20 77 69 6C 6C 20 20 62 65 20 20 65 78    le  will  be  ex
0248C0:  70 61 6E 64 65 64 20 20 74 6F 0D 0A 20 20 20 20    panded  to..    
0248D0:  20 20 20 74 68 65 69 72 20 61 73 73 6F 63 69 61       their associa
0248E0:  74 65 64 20 73 74 72 69 6E 67 73 2E 20 45 78 70    ted strings. Exp
0248F0:  61 6E 73 69 6F 6E 20 74 6F 6B 65 6E 73 20 66 6F    ansion tokens fo
024900:  75 6E 64 20 69 6E 20 65 78 70 61 6E 73 69 6F 6E    und in expansion
024910:  20 20 73 74 72 69 6E 67 73 0D 0A 20 20 20 20 20      strings..     
024920:  20 20 61 72 65 20 6E 6F 74 20 65 78 70 61 6E 64      are not expand
024930:  65 64 20 62 75 74 20 61 72 65 20 74 72 65 61 74    ed but are treat
024940:  65 64 20 61 73 20 63 68 61 72 61 63 74 65 72 73    ed as characters
024950:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 69 73    .....       This
024960:  20 72 6F 75 74 69 6E 65 20 77 69 6C 6C 20 61 6C     routine will al
024970:  77 61 79 73 20 72 65 74 75 72 6E 20 61 20 63 68    ways return a ch
024980:  61 72 61 63 74 65 72 20 69 66 20 6F 6E 65 20 69    aracter if one i
024990:  73 20 61 76 61 69 6C 61 62 6C 65 2E 20 49 74 20    s available. It 
0249A0:  69 73 0D 0A 20 20 20 20 20 20 20 74 68 65 72 65    is..       there
0249B0:  66 6F 72 65 20 70 6F 73 73 69 62 6C 65 20 74 6F    fore possible to
0249C0:  20 66 6C 75 73 68 20 6F 75 74 20 74 68 65 20 4B     flush out the K
0249D0:  65 79 20 4D 61 6E 61 67 65 72 20 62 75 66 66 65    ey Manager buffe
0249E0:  72 73 20 62 79 20 63 61 6C 6C 69 6E 67 20 20 4B    rs by calling  K
0249F0:  4D 0D 0A 20 20 20 20 20 20 20 52 45 41 44 20 43    M..       READ C
024A00:  48 41 52 20 72 65 70 65 61 74 65 64 6C 79 20 75    HAR repeatedly u
024A10:  6E 74 69 6C 20 69 74 20 72 65 70 6F 72 74 73 20    ntil it reports 
024A20:  74 68 61 74 20 6E 6F 20 63 68 61 72 61 63 74 65    that no characte
024A30:  72 20 69 73 20 61 76 61 69 6C 61 62 6C 65 2E 0D    r is available..
024A40:  0A 0D 0A 20 20 20 20 20 20 20 52 65 6C 61 74 65    ...       Relate
024A50:  64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 20 20    d entries:....  
024A60:  20 20 20 20 20 4B 4D 20 43 48 41 52 20 52 45 54         KM CHAR RET
024A70:  55 52 4E 0D 0A 20 20 20 20 20 20 20 4B 4D 20 46    URN..       KM F
024A80:  4C 55 53 48 0D 0A 20 20 20 20 20 20 20 4B 4D 20    LUSH..       KM 
024A90:  52 45 41 44 20 4B 45 59 0D 0A 20 20 20 20 20 20    READ KEY..      
024AA0:  20 4B 4D 20 57 41 49 54 20 43 48 41 52 0D 0A 0D     KM WAIT CHAR...
024AB0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
024AC0:  41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36    AMSTRAD CPC464/6
024AD0:  36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45    64/6128 FIRMWARE
024AE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024AF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
024B00:  65 20 31 35 2E 35 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    e 15.5..........
024B10:  0D 0A 0D 0A 20 20 20 20 20 20 20 34 3A 20 4B 4D    ....       4: KM
024B20:  20 43 48 41 52 20 52 45 54 55 52 4E 20 20 20 20     CHAR RETURN    
024B30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024B40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
024B50:  20 20 20 20 20 20 20 20 20 20 20 20 23 42 42 30                #BB0
024B60:  43 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65    C......       Re
024B70:  74 75 72 6E 20 61 20 73 69 6E 67 6C 65 20 63 68    turn a single ch
024B80:  61 72 61 63 74 65 72 20 74 6F 20 74 68 65 20 6B    aracter to the k
024B90:  65 79 62 6F 61 72 64 20 66 6F 72 20 6E 65 78 74    eyboard for next
024BA0:  20 74 69 6D 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20     time.......    
024BB0:  20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A       Action:......
024BC0:  20 20 20 20 20 20 20 53 61 76 65 20 61 20 63 68           Save a ch
024BD0:  61 72 61 63 74 65 72 20 66 6F 72 20 74 68 65 20    aracter for the 
024BE0:  6E 65 78 74 20 63 61 6C 6C 20 6F 66 20 4B 4D 20    next call of KM 
024BF0:  52 45 41 44 20 43 48 41 52 20 6F 72 20 4B 4D 20    READ CHAR or KM 
024C00:  57 41 49 54 20 43 48 41 52 2E 0D 0A 0D 0A 0D 0A    WAIT CHAR.......
024C10:  20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E           Entry con
024C20:  64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20    ditions:......  
024C30:  20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73 20         A contains 
024C40:  74 68 65 20 63 68 61 72 61 63 74 65 72 20 74 6F    the character to
024C50:  20 70 75 74 20 62 61 63 6B 2E 0D 0A 0D 0A 0D 0A     put back.......
024C60:  20 20 20 20 20 20 20 45 78 69 74 20 63 6F 6E 64           Exit cond
024C70:  69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20    itions:......   
024C80:  20 20 20 20 41 6C 6C 20 72 65 67 69 73 74 65 72        All register
024C90:  73 20 61 6E 64 20 66 6C 61 67 73 20 70 72 65 73    s and flags pres
024CA0:  65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20    erved.........  
024CB0:  20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D         Notes:.....
024CC0:  0A 20 20 20 20 20 20 20 54 68 65 20 27 70 75 74    .       The 'put
024CD0:  20 62 61 63 6B 27 20 63 68 61 72 61 63 74 65 72     back' character
024CE0:  20 77 69 6C 6C 20 62 65 20 72 65 74 75 72 6E 65     will be returne
024CF0:  64 20 62 65 66 6F 72 65 20 61 6E 79 20 20 6F 74    d before any  ot
024D00:  68 65 72 20 20 63 68 61 72 61 63 74 65 72 0D 0A    her  character..
024D10:  20 20 20 20 20 20 20 69 73 20 67 65 6E 65 72 61           is genera
024D20:  74 65 64 20 62 79 20 74 68 65 20 6B 65 79 62 6F    ted by the keybo
024D30:  61 72 64 2E 20 49 74 20 77 69 6C 6C 20 6E 6F 74    ard. It will not
024D40:  20 62 65 20 20 65 78 70 61 6E 64 65 64 20 20 28     be  expanded  (
024D50:  6F 72 20 20 6F 74 68 65 72 77 69 73 65 0D 0A 20    or  otherwise.. 
024D60:  20 20 20 20 20 20 64 65 61 6C 74 20 77 69 74 68          dealt with
024D70:  29 20 62 75 74 20 77 69 6C 6C 20 62 65 20 72 65    ) but will be re
024D80:  74 75 72 6E 65 64 20 61 73 20 69 74 20 69 73 2E    turned as it is.
024D90:  20 54 68 65 20 20 27 70 75 74 20 20 62 61 63 6B     The  'put  back
024DA0:  27 20 20 63 68 61 72 61 63 74 65 72 0D 0A 20 20    '  character..  
024DB0:  20 20 20 20 20 6E 65 65 64 20 6E 6F 74 20 68 61         need not ha
024DC0:  76 65 20 62 65 65 6E 20 72 65 61 64 20 66 72 6F    ve been read fro
024DD0:  6D 20 74 68 65 20 6B 65 79 62 6F 61 72 64 2C 20    m the keyboard, 
024DE0:  69 74 20 63 6F 75 6C 64 20 62 65 20 69 6E 73 65    it could be inse
024DF0:  72 74 65 64 20 62 79 20 74 68 65 0D 0A 20 20 20    rted by the..   
024E00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
024E10:  1F 00 00 00 02 09 50 E5 1F 00 C1 02 00 00 00 02    ......P.........
024E20:  1F 00 C2 02 00 00 00 02 1F 00 C3 02 00 00 00 02    ................
024E30:  1F 00 C4 02 00 00 00 02 1F 00 C5 02 00 00 00 02    ................
024E40:  1F 00 C6 02 00 00 00 02 1F 00 C7 02 00 00 00 02    ................
024E50:  1F 00 C8 02 00 00 00 02 1F 00 C9 02 00 00 00 02    ................
024E60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024E70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024E80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024E90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024EA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024EB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024EC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024ED0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024EE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024EF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
024F00:  20 20 20 20 75 73 65 72 20 66 6F 72 20 73 6F 6D        user for som
024F10:  65 20 70 75 72 70 6F 73 65 2E 0D 0A 0D 0A 0D 0A    e purpose.......
024F20:  20 20 20 20 20 20 20 49 74 20 69 73 20 6F 6E 6C           It is onl
024F30:  79 20 70 6F 73 73 69 62 6C 65 20 74 6F 20 68 61    y possible to ha
024F40:  76 65 20 6F 6E 65 20 27 70 75 74 20 62 61 63 6B    ve one 'put back
024F50:  27 20 63 68 61 72 61 63 74 65 72 2E 20 49 66 20    ' character. If 
024F60:  74 68 69 73 20 20 72 6F 75 74 69 6E 65 0D 0A 20    this  routine.. 
024F70:  20 20 20 20 20 20 69 73 20 63 61 6C 6C 65 64 20          is called 
024F80:  74 77 69 63 65 20 77 69 74 68 6F 75 74 20 72 65    twice without re
024F90:  61 64 69 6E 67 20 61 20 63 68 61 72 61 63 74 65    ading a characte
024FA0:  72 20 20 62 65 74 77 65 65 6E 20 20 74 68 65 73    r  between  thes
024FB0:  65 20 20 74 68 65 6E 20 20 74 68 65 0D 0A 20 20    e  then  the..  
024FC0:  20 20 20 20 20 66 69 72 73 74 20 28 70 75 74 20         first (put 
024FD0:  62 61 63 6B 27 20 77 69 6C 6C 20 62 65 20 6C 6F    back' will be lo
024FE0:  73 74 2E 20 46 75 72 74 68 65 72 6D 6F 72 65 2C    st. Furthermore,
024FF0:  20 20 69 74 20 20 69 73 20 20 6E 6F 74 20 20 70      it  is  not  p
025000:  6F 73 73 69 62 6C 65 20 20 74 6F 0D 0A 20 20 20    ossible  to..   
025010:  20 20 20 20 72 65 74 75 72 6E 20 63 68 61 72 61        return chara
025020:  63 74 65 72 20 32 35 35 20 28 62 65 63 61 75 73    cter 255 (becaus
025030:  65 20 74 68 69 73 20 69 73 20 75 73 65 64 20 61    e this is used a
025040:  73 20 74 68 65 20 6D 61 72 6B 65 72 20 66 6F 72    s the marker for
025050:  20 20 6E 6F 20 20 27 70 75 74 0D 0A 20 20 20 20      no  'put..    
025060:  20 20 20 62 61 63 6B 27 20 63 68 61 72 61 63 74       back' charact
025070:  65 72 29 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    er).......      
025080:  20 52 65 6C 61 74 65 64 20 65 6E 74 72 69 65 73     Related entries
025090:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D    :......       KM
0250A0:  20 52 45 41 44 20 43 48 41 52 0D 0A 20 20 20 20     READ CHAR..    
0250B0:  20 20 20 4B 4D 20 57 41 49 54 20 43 48 41 52 0D       KM WAIT CHAR.
0250C0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    ................
0250D0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
0250E0:  41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36    AMSTRAD CPC464/6
0250F0:  36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45    64/6128 FIRMWARE
025100:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025110:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
025120:  65 20 31 35 2E 36 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    e 15.6..........
025130:  0D 0A 0D 0A 20 20 20 20 20 20 20 35 3A 20 4B 4D    ....       5: KM
025140:  20 53 45 54 20 45 58 50 41 4E 44 20 20 20 20 20     SET EXPAND     
025150:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025160:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025170:  20 20 20 20 20 20 20 20 20 20 20 20 23 42 42 30                #BB0
025180:  46 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65 74 20    F....       Set 
025190:  61 6E 20 65 78 70 61 6E 73 69 6F 6E 20 73 74 72    an expansion str
0251A0:  69 6E 67 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ing.....       A
0251B0:  63 74 69 6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20    ction:....      
0251C0:  20 53 65 74 20 74 68 65 20 65 78 70 61 6E 73 69     Set the expansi
0251D0:  6F 6E 20 73 74 72 69 6E 67 20 61 73 73 6F 63 69    on string associ
0251E0:  61 74 65 64 20 77 69 74 68 20 61 6E 20 65 78 70    ated with an exp
0251F0:  61 6E 73 69 6F 6E 20 74 6F 6B 65 6E 2E 0D 0A 0D    ansion token....
025200:  0A 20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F    .       Entry co
025210:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20    nditions:....   
025220:  20 20 20 20 42 20 63 6F 6E 74 61 69 6E 73 20 74        B contains t
025230:  68 65 20 65 78 70 61 6E 73 69 6F 6E 20 74 6F 6B    he expansion tok
025240:  65 6E 20 66 6F 72 20 74 68 65 20 65 78 70 61 6E    en for the expan
025250:  73 69 6F 6E 20 74 6F 20 73 65 74 2E 0D 0A 20 20    sion to set...  
025260:  20 20 20 20 20 43 20 63 6F 6E 74 61 69 6E 73 20         C contains 
025270:  74 68 65 20 6C 65 6E 67 74 68 20 6F 66 20 74 68    the length of th
025280:  65 20 73 74 72 69 6E 67 2E 0D 0A 20 20 20 20 20    e string...     
025290:  20 20 48 4C 20 63 6F 6E 74 61 69 6E 73 20 74 68      HL contains th
0252A0:  65 20 61 64 64 72 65 73 73 20 6F 66 20 74 68 65    e address of the
0252B0:  20 73 74 72 69 6E 67 2E 0D 0A 0D 0A 20 20 20 20     string.....    
0252C0:  20 20 20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F       Exit conditio
0252D0:  6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 66    ns:....       If
0252E0:  20 74 68 65 20 65 78 70 61 6E 73 69 6F 6E 20 69     the expansion i
0252F0:  73 20 4F 4B 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    s OK:....       
025300:  20 20 20 20 20 20 20 20 20 43 61 72 72 79 20 74             Carry t
025310:  72 75 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49    rue.....       I
025320:  66 20 74 68 65 20 73 74 72 69 6E 67 20 77 61 73    f the string was
025330:  20 74 6F 6F 20 6C 6F 6E 67 20 6F 72 20 74 68 65     too long or the
025340:  20 74 6F 6B 65 6E 20 77 61 73 20 69 6E 76 61 6C     token was inval
025350:  69 64 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    id:....         
025360:  20 20 20 20 20 20 20 43 61 72 72 79 20 66 61 6C           Carry fal
025370:  73 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C    se.....       Al
025380:  77 61 79 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    ways:....       
025390:  20 20 20 20 20 20 20 20 20 41 2C 42 43 2C 44 45             A,BC,DE
0253A0:  2C 48 4C 20 61 6E 64 20 6F 74 68 65 72 20 66 6C    ,HL and other fl
0253B0:  61 67 73 20 63 6F 72 72 75 70 74 2E 0D 0A 20 20    ags corrupt...  
0253C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 6C                  Al
0253D0:  6C 20 6F 74 68 65 72 20 72 65 67 69 73 74 65 72    l other register
0253E0:  73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A    s preserved.....
0253F0:  0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A 20    ..       Notes: 
025400:  54 68 65 20 73 74 72 69 6E 67 20 74 6F 20 62 65    The string to be
025410:  20 73 65 74 20 6D 61 79 20 6C 69 65 20 61 6E 79     set may lie any
025420:  77 68 65 72 65 20 69 6E 20 52 41 4D 2E 20 45 78    where in RAM. Ex
025430:  70 61 6E 73 69 6F 6E 20 73 74 72 69 6E 67 73 0D    pansion strings.
025440:  0A 20 20 20 20 20 20 20 63 61 6E 6E 6F 74 20 62    .       cannot b
025450:  65 20 73 65 74 20 64 69 72 65 63 74 6C 79 20 66    e set directly f
025460:  72 6F 6D 20 52 4F 4D 2E 0D 0A 0D 0A 0D 0A 20 20    rom ROM.......  
025470:  20 20 20 20 20 54 68 65 20 63 68 61 72 61 63 74         The charact
025480:  65 72 73 20 69 6E 20 74 68 65 20 73 74 72 69 6E    ers in the strin
025490:  67 20 61 72 65 20 20 6E 6F 74 20 20 65 78 70 61    g are  not  expa
0254A0:  6E 64 65 64 20 20 28 6F 72 20 20 6F 74 68 65 72    nded  (or  other
0254B0:  77 69 73 65 20 20 64 65 61 6C 74 0D 0A 20 20 20    wise  dealt..   
0254C0:  20 20 20 20 77 69 74 68 29 2E 20 49 74 20 69 73        with). It is
0254D0:  20 74 68 65 72 65 66 6F 72 65 20 70 6F 73 73 69     therefore possi
0254E0:  62 6C 65 20 74 6F 20 70 75 74 20 61 6E 79 20 63    ble to put any c
0254F0:  68 61 72 61 63 74 65 72 20 69 6E 74 6F 20 61 6E    haracter into an
025500:  20 65 78 70 61 6E 73 69 6F 6E 0D 0A 20 20 20 20     expansion..    
025510:  20 20 20 73 74 72 69 6E 67 2E 0D 0A 0D 0A 0D 0A       string.......
025520:  20 20 20 20 20 20 20 49 66 20 74 68 65 72 65 20           If there 
025530:  69 73 20 69 6E 73 75 66 66 69 63 69 65 6E 74 20    is insufficient 
025540:  72 6F 6F 6D 20 69 6E 20 74 68 65 20 20 65 78 70    room in the  exp
025550:  61 6E 73 69 6F 6E 20 20 62 75 66 66 65 72 20 20    ansion  buffer  
025560:  66 6F 72 20 20 74 68 65 20 20 6E 65 77 0D 0A 20    for  the  new.. 
025570:  20 20 20 20 20 20 73 74 72 69 6E 67 20 74 68 65          string the
025580:  6E 20 6E 6F 20 63 68 61 6E 67 65 20 69 73 20 6D    n no change is m
025590:  61 64 65 20 74 6F 20 74 68 65 20 65 78 70 61 6E    ade to the expan
0255A0:  73 69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    sions.......    
0255B0:  20 20 20 49 66 20 74 68 65 20 73 74 72 69 6E 67       If the string
0255C0:  20 73 65 74 20 69 73 20 63 75 72 72 65 6E 74 6C     set is currentl
0255D0:  79 20 62 65 69 6E 67 20 75 73 65 64 20 74 6F 20    y being used to 
0255E0:  67 65 6E 65 72 61 74 65 20 20 63 68 61 72 61 63    generate  charac
0255F0:  74 65 72 73 20 20 28 62 79 0D 0A 20 20 20 20 20    ters  (by..     
025600:  20 20 4B 4D 20 52 45 41 44 20 43 48 41 52 20 6F      KM READ CHAR o
025610:  72 20 4B 4D 20 57 41 49 54 20 43 48 41 52 29 20    r KM WAIT CHAR) 
025620:  74 68 65 6E 20 74 68 65 20 75 6E 72 65 61 64 20    then the unread 
025630:  70 6F 72 74 69 6F 6E 20 6F 66 20 74 68 65 20 73    portion of the s
025640:  74 72 69 6E 67 20 69 73 0D 0A 20 20 20 20 20 20    tring is..      
025650:  20 64 69 73 63 61 72 64 65 64 2E 20 54 68 65 20     discarded. The 
025660:  6E 65 78 74 20 63 68 61 72 61 63 74 65 72 20 77    next character w
025670:  69 6C 6C 20 62 65 20 72 65 61 64 20 66 72 6F 6D    ill be read from
025680:  20 74 68 65 20 6B 65 79 20 62 75 66 66 65 72 2E     the key buffer.
025690:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 69    ......       Thi
0256A0:  73 20 72 6F 75 74 69 6E 65 20 65 6E 61 62 6C 65    s routine enable
0256B0:  73 20 69 6E 74 65 72 72 75 70 74 73 2E 0D 0A 0D    s interrupts....
0256C0:  0A 20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20    .       Related 
0256D0:  65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 20 20 20 20    entries:....    
0256E0:  20 20 20 4B 4D 20 47 45 54 20 45 58 50 41 4E 44       KM GET EXPAND
0256F0:  0D 0A 20 20 20 20 20 20 20 4B 4D 20 52 45 41 44    ..       KM READ
025700:  20 43 48 41 52 0D 0A 20 20 20 20 20 20 20 4B 4D     CHAR..       KM
025710:  20 57 41 49 54 20 43 48 41 52 0D 0A 0D 0A 0D 0A     WAIT CHAR......
025720:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
025730:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
025740:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
025750:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025760:  20 20 20 20 20 20 20 20 70 61 67 65 20 31 35 2E            page 15.
025770:  37 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    7.............. 
025780:  20 20 20 20 20 20 36 3A 20 4B 4D 20 47 45 54 20          6: KM GET 
025790:  45 58 50 41 4E 44 20 20 20 20 20 20 20 20 20 20    EXPAND          
0257A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0257B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0257C0:  20 20 20 20 20 20 20 23 42 42 31 32 0D 0A 0D 0A           #BB12....
0257D0:  0D 0A 20 20 20 20 20 20 20 47 65 74 20 61 20 63    ..       Get a c
0257E0:  68 61 72 61 63 74 65 72 20 66 72 6F 6D 20 61 6E    haracter from an
0257F0:  20 65 78 70 61 6E 73 69 6F 6E 20 73 74 72 69 6E     expansion strin
025800:  67 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    g.......       A
025810:  63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    ction:......    
025820:  20 20 20 52 65 61 64 20 61 20 63 68 61 72 61 63       Read a charac
025830:  74 65 72 20 66 72 6F 6D 20 61 6E 20 20 65 78 70    ter from an  exp
025840:  61 6E 73 69 6F 6E 20 20 73 74 72 69 6E 67 2E 20    ansion  string. 
025850:  20 54 68 65 20 20 63 68 61 72 61 63 74 65 72 73     The  characters
025860:  20 20 69 6E 20 20 74 68 65 0D 0A 20 20 20 20 20      in  the..     
025870:  20 20 73 74 72 69 6E 67 20 61 72 65 20 6E 75 6D      string are num
025880:  62 65 72 65 64 20 73 74 61 72 74 69 6E 67 20 66    bered starting f
025890:  72 6F 6D 20 30 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    rom 0.......    
0258A0:  20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74 69       Entry conditi
0258B0:  6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ons:......      
0258C0:  20 41 20 63 6F 6E 74 61 69 6E 73 20 61 6E 20 65     A contains an e
0258D0:  78 70 61 6E 73 69 6F 6E 20 74 6F 6B 65 6E 2E 0D    xpansion token..
0258E0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4C 20 63 6F    .....       L co
0258F0:  6E 74 61 69 6E 73 20 74 68 65 20 63 68 61 72 61    ntains the chara
025900:  63 74 65 72 20 6E 75 6D 62 65 72 2E 0D 0A 0D 0A    cter number.....
025910:  0D 0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F    ..       Exit co
025920:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20    nditions:...... 
025930:  20 20 20 20 20 20 49 66 20 74 68 65 20 63 68 61          If the cha
025940:  72 61 63 74 65 72 20 77 61 73 20 66 6F 75 6E 64    racter was found
025950:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    :......         
025960:  20 20 20 20 20 20 20 20 20 20 43 61 72 72 79 20              Carry 
025970:  74 72 75 65 2E 0D 0A 20 20 20 20 20 20 20 20 20    true...         
025980:  20 20 20 20 20 20 20 20 20 20 41 20 63 6F 6E 74              A cont
025990:  61 69 6E 73 20 74 68 65 20 63 68 61 72 61 63 74    ains the charact
0259A0:  65 72 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    er.......       
0259B0:  49 66 20 74 68 65 20 74 6F 6B 65 6E 20 77 61 73    If the token was
0259C0:  20 69 6E 76 61 6C 69 64 20 6F 72 20 74 68 65 20     invalid or the 
0259D0:  73 74 72 69 6E 67 20 77 61 73 20 6E 6F 74 20 6C    string was not l
0259E0:  6F 6E 67 20 65 6E 6F 75 67 68 3A 0D 0A 0D 0A 0D    ong enough:.....
0259F0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
025A00:  20 20 20 20 43 61 72 72 79 20 66 61 6C 73 65 2E        Carry false.
025A10:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
025A20:  20 20 20 20 20 41 20 63 6F 72 72 75 70 74 2E 0D         A corrupt..
025A30:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 77 61    .....       Alwa
025A40:  79 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ys:......       
025A50:  20 20 20 20 20 20 20 20 20 20 20 20 44 45 20 61                DE a
025A60:  6E 64 20 6F 74 68 65 72 20 66 6C 61 67 73 20 63    nd other flags c
025A70:  6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20    orrupt...       
025A80:  20 20 20 20 20 20 20 20 20 20 20 20 41 6C 6C 20                All 
025A90:  6F 74 68 65 72 20 72 65 67 69 73 74 65 72 73 20    other registers 
025AA0:  70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A    preserved.......
025AB0:  20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D           Notes:...
025AC0:  0A 20 20 20 20 20 20 20 54 68 65 20 63 68 61 72    .       The char
025AD0:  61 63 74 65 72 73 20 69 6E 20 74 68 65 20 65 78    acters in the ex
025AE0:  70 61 6E 73 69 6F 6E 20 73 74 72 69 6E 67 20 61    pansion string a
025AF0:  72 65 20 6E 6F 74 20 65 78 70 61 6E 64 65 64 20    re not expanded 
025B00:  28 6F 72 20 20 6F 74 68 65 72 77 69 73 65 0D 0A    (or  otherwise..
025B10:  20 20 20 20 20 20 20 64 65 61 6C 74 20 77 69 74           dealt wit
025B20:  68 29 2E 20 49 74 20 69 73 20 74 68 65 72 65 66    h). It is theref
025B30:  6F 72 65 20 70 6F 73 73 69 62 6C 65 20 74 6F 20    ore possible to 
025B40:  70 75 74 20 20 61 6E 79 20 20 63 68 61 72 61 63    put  any  charac
025B50:  74 65 72 20 20 69 6E 74 6F 20 20 61 6E 0D 0A 20    ter  into  an.. 
025B60:  20 20 20 20 20 20 65 78 70 61 6E 73 69 6F 6E 20          expansion 
025B70:  73 74 72 69 6E 67 2E 0D 0A 0D 0A 0D 0A 20 20 20    string.......   
025B80:  20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72        Related entr
025B90:  69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B    ies:....       K
025BA0:  4D 20 52 45 41 44 20 43 48 41 52 0D 0A 20 20 20    M READ CHAR..   
025BB0:  20 20 20 20 4B 4D 20 53 45 54 20 45 58 50 41 4E        KM SET EXPAN
025BC0:  44 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    D......       AM
025BD0:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
025BE0:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
025BF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025C00:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
025C10:  31 35 2E 38 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    15.8............
025C20:  0D 0A 20 20 20 20 20 20 20 37 3A 20 4B 4D 20 45    ..       7: KM E
025C30:  58 50 20 42 55 46 46 45 52 20 20 20 20 20 20 20    XP BUFFER       
025C40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025C50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
025C60:  20 20 20 20 20 20 20 20 20 20 23 42 42 31 35 0D              #BB15.
025C70:  0A 0D 0A 20 20 20 20 20 20 20 41 6C 6C 6F 63 61    ...       Alloca
025C80:  74 65 20 61 20 62 75 66 66 65 72 20 66 6F 72 20    te a buffer for 
025C90:  65 78 70 61 6E 73 69 6F 6E 20 73 74 72 69 6E 67    expansion string
025CA0:  73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74    s.....       Act
025CB0:  69 6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 53    ion:....       S
025CC0:  65 74 20 74 68 65 20 61 64 64 72 65 73 73 20 61    et the address a
025CD0:  6E 64 20 6C 65 6E 67 74 68 20 6F 66 20 74 68 65    nd length of the
025CE0:  20 20 65 78 70 61 6E 73 69 6F 6E 20 20 62 75 66      expansion  buf
025CF0:  66 65 72 2E 20 20 49 6E 69 74 69 61 6C 69 7A 65    fer.  Initialize
025D00:  20 20 74 68 65 0D 0A 20 20 20 20 20 20 20 62 75      the..       bu
025D10:  66 66 65 72 20 77 69 74 68 20 74 68 65 20 64 65    ffer with the de
025D20:  66 61 75 6C 74 20 65 78 70 61 6E 73 69 6F 6E 20    fault expansion 
025D30:  73 74 72 69 6E 67 73 2E 0D 0A 0D 0A 20 20 20 20    strings.....    
025D40:  20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74 69       Entry conditi
025D50:  6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 44    ons:....       D
025D60:  45 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 61    E contains the a
025D70:  64 64 72 65 73 73 20 6F 66 20 74 68 65 20 62 75    ddress of the bu
025D80:  66 66 65 72 2E 0D 0A 20 20 20 20 20 20 20 48 4C    ffer...       HL
025D90:  20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 6C 65     contains the le
025DA0:  6E 67 74 68 20 6F 66 20 74 68 65 20 62 75 66 66    ngth of the buff
025DB0:  65 72 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78    er.....       Ex
025DC0:  69 74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A    it conditions:..
025DD0:  0D 0A 20 20 20 20 20 20 20 49 66 20 74 68 65 20    ..       If the 
025DE0:  62 75 66 66 65 72 20 69 73 20 4F 4B 3A 0D 0A 0D    buffer is OK:...
025DF0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
025E00:  20 43 61 72 72 79 20 74 72 75 65 2E 0D 0A 0D 0A     Carry true.....
025E10:  20 20 20 20 20 20 20 49 66 20 74 68 65 20 62 75           If the bu
025E20:  66 66 65 72 20 69 73 20 74 6F 6F 20 73 68 6F 72    ffer is too shor
025E30:  74 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    t.....          
025E40:  20 20 20 20 20 20 43 61 72 72 79 20 66 61 6C 73          Carry fals
025E50:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 77    e.....       Alw
025E60:  61 79 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ays:....        
025E70:  20 20 20 20 20 20 20 20 41 2C 42 43 2C 44 45 2C            A,BC,DE,
025E80:  48 4C 20 61 6E 64 20 6F 74 68 65 72 20 66 6C 61    HL and other fla
025E90:  67 73 20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20    gs corrupt...   
025EA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 41 6C 6C                 All
025EB0:  20 6F 74 68 65 72 20 72 65 67 69 73 74 65 72 73     other registers
025EC0:  20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 20     preserved..... 
025ED0:  20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A          Notes:....
025EE0:  0D 0A 20 20 20 20 20 20 20 54 68 65 20 62 75 66    ..       The buf
025EF0:  66 65 72 20 6D 75 73 74 20 6E 6F 74 20 62 65 20    fer must not be 
025F00:  6C 6F 63 61 74 65 64 20 75 6E 64 65 72 6E 65 61    located undernea
025F10:  74 68 20 61 20 52 4F 4D 20 20 61 6E 64 20 20 69    th a ROM  and  i
025F20:  74 20 20 6D 75 73 74 20 20 62 65 20 20 61 74 0D    t  must  be  at.
025F30:  0A 20 20 20 20 20 20 20 6C 65 61 73 74 20 34 39    .       least 49
025F40:  20 62 79 74 65 73 20 6C 6F 6E 67 20 20 28 69 2E     bytes long  (i.
025F50:  65 2E 20 20 68 61 76 65 20 20 73 75 66 66 69 63    e.  have  suffic
025F60:  69 65 6E 74 20 20 73 70 61 63 65 20 20 66 6F 72    ient  space  for
025F70:  20 20 74 68 65 20 20 64 65 66 61 75 6C 74 0D 0A      the  default..
025F80:  20 20 20 20 20 20 20 65 78 70 61 6E 73 69 6F 6E           expansion
025F90:  20 73 74 72 69 6E 67 73 29 2E 20 49 66 20 74 68     strings). If th
025FA0:  65 20 6E 65 77 20 62 75 66 66 65 72 20 69 73 20    e new buffer is 
025FB0:  74 6F 6F 20 73 68 6F 72 74 20 74 68 65 6E 20 74    too short then t
025FC0:  68 65 20 6F 6C 64 20 62 75 66 66 65 72 0D 0A 20    he old buffer.. 
025FD0:  20 20 20 20 20 20 69 73 20 6C 65 66 74 20 75 6E          is left un
025FE0:  63 68 61 6E 67 65 64 2E 0D 0A 0D 0A 0D 0A 20 20    changed.......  
025FF0:  20 20 20 20 20 54 68 65 20 64 65 66 61 75 6C 74         The default
026000:  20 65 78 70 61 6E 73 69 6F 6E 20 73 74 72 69 6E     expansion strin
026010:  67 73 20 61 72 65 20 67 69 76 65 6E 20 69 6E 20    gs are given in 
026020:  41 70 70 65 6E 64 69 78 20 49 56 2E 0D 0A 0D 0A    Appendix IV.....
026030:  0D 0A 20 20 20 20 20 20 20 41 6E 79 20 65 78 70    ..       Any exp
026040:  61 6E 73 69 6F 6E 20 73 74 72 69 6E 67 20 63 75    ansion string cu
026050:  72 72 65 6E 74 6C 79 20 62 65 69 6E 67 20 72 65    rrently being re
026060:  61 64 20 69 73 20 64 69 73 63 61 72 64 65 64 2E    ad is discarded.
026070:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 69    ......       Thi
026080:  73 20 72 6F 75 74 69 6E 65 20 65 6E 61 62 6C 65    s routine enable
026090:  73 20 69 6E 74 65 72 72 75 70 74 73 2E 0D 0A 0D    s interrupts....
0260A0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ...........     
0260B0:  20 20 52 65 6C 61 74 65 64 20 65 6E 74 72 69 65      Related entrie
0260C0:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20    s:....       KM 
0260D0:  47 45 54 20 45 58 50 41 4E 44 0D 0A 20 20 20 20    GET EXPAND..    
0260E0:  20 20 20 4B 4D 20 53 45 54 20 45 58 50 41 4E 44       KM SET EXPAND
0260F0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
026100:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
026110:  20 00 00 00 02 09 50 E5 20 00 C1 02 00 00 00 02     .....P. .......
026120:  20 00 C2 02 00 00 00 02 20 00 C3 02 00 00 00 02     ....... .......
026130:  20 00 C4 02 00 00 00 02 20 00 C5 02 00 00 00 02     ....... .......
026140:  20 00 C6 02 00 00 00 02 20 00 C7 02 00 00 00 02     ....... .......
026150:  20 00 C8 02 00 00 00 02 20 00 C9 02 00 00 00 02     ....... .......
026160:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
026170:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
026180:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
026190:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0261F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
026200:  20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F     AMSTRAD CPC464/
026210:  36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52    664/6128 FIRMWAR
026220:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
026230:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 61                  pa
026240:  67 65 20 31 35 2E 39 0D 0A 0D 0A 0D 0A 0D 0A 0D    ge 15.9.........
026250:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 38 3A 20 4B    .....       8: K
026260:  4D 20 57 41 49 54 20 4B 45 59 20 20 20 20 20 20    M WAIT KEY      
026270:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026280:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026290:  20 20 20 20 20 20 20 20 20 20 20 20 20 23 42 42                 #BB
0262A0:  31 38 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 57    18......       W
0262B0:  61 69 74 20 66 6F 72 20 6E 65 78 74 20 6B 65 79    ait for next key
0262C0:  20 66 72 6F 6D 20 74 68 65 20 6B 65 79 62 6F 61     from the keyboa
0262D0:  72 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    rd.......       
0262E0:  41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20    Action:......   
0262F0:  20 20 20 20 54 72 79 20 74 6F 20 67 65 74 20 61        Try to get a
026300:  20 6B 65 79 20 66 72 6F 6D 20 74 68 65 20 6B 65     key from the ke
026310:  79 20 62 75 66 66 65 72 2E 20 54 68 69 73 20 72    y buffer. This r
026320:  6F 75 74 69 6E 65 20 77 61 69 74 73 20 75 6E 74    outine waits unt
026330:  69 6C 20 20 61 20 20 6B 65 79 0D 0A 20 20 20 20    il  a  key..    
026340:  20 20 20 69 73 20 66 6F 75 6E 64 20 69 66 20 6E       is found if n
026350:  6F 20 6B 65 79 20 69 73 20 69 6D 6D 65 64 69 61    o key is immedia
026360:  74 65 6C 79 20 61 76 61 69 6C 61 62 6C 65 2E 0D    tely available..
026370:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72    .....       Entr
026380:  79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    y conditions:...
026390:  0A 0D 0A 20 20 20 20 20 20 20 4E 6F 20 63 6F 6E    ...       No con
0263A0:  64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20    ditions.......  
0263B0:  20 20 20 20 20 45 78 69 74 20 63 6F 6E 64 69 74         Exit condit
0263C0:  69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions:......     
0263D0:  20 20 43 61 72 72 79 20 74 72 75 65 2E 0D 0A 20      Carry true... 
0263E0:  20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73          A contains
0263F0:  20 74 68 65 20 63 68 61 72 61 63 74 65 72 20 6F     the character o
026400:  72 20 65 78 70 61 6E 73 69 6F 6E 20 74 6F 6B 65    r expansion toke
026410:  6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4F    n.......       O
026420:  74 68 65 72 20 66 6C 61 67 73 20 63 6F 72 72 75    ther flags corru
026430:  70 74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20    pt...       All 
026440:  72 65 67 69 73 74 65 72 73 20 70 72 65 73 65 72    registers preser
026450:  76 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ved.......      
026460:  20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20     Notes:......   
026470:  20 20 20 20 54 68 65 20 6E 65 78 74 20 6B 65 79        The next key
026480:  20 69 73 20 72 65 61 64 20 66 72 6F 6D 20 74 68     is read from th
026490:  65 20 6B 65 79 20 20 62 75 66 66 65 72 20 20 61    e key  buffer  a
0264A0:  6E 64 20 20 74 72 61 6E 73 6C 61 74 65 64 20 20    nd  translated  
0264B0:  75 73 69 6E 67 20 20 74 68 65 0D 0A 20 20 20 20    using  the..    
0264C0:  20 20 20 61 70 70 72 6F 70 72 69 61 74 65 20 6B       appropriate k
0264D0:  65 79 20 74 72 61 6E 73 6C 61 74 69 6F 6E 20 74    ey translation t
0264E0:  61 62 6C 65 2E 20 45 78 70 61 6E 73 69 6F 6E 20    able. Expansion 
0264F0:  74 6F 6B 65 6E 73 20 61 72 65 20 20 6E 6F 74 20    tokens are  not 
026500:  20 65 78 70 61 6E 64 65 64 0D 0A 20 20 20 20 20     expanded..     
026510:  20 20 62 75 74 20 61 72 65 20 20 70 61 73 73 65      but are  passe
026520:  64 20 20 6F 75 74 20 20 66 6F 72 20 20 74 68 65    d  out  for  the
026530:  20 20 75 73 65 72 20 20 74 6F 20 20 64 65 61 6C      user  to  deal
026540:  20 20 77 69 74 68 2C 20 20 61 73 20 20 61 72 65      with,  as  are
026550:  20 20 6E 6F 72 6D 61 6C 0D 0A 20 20 20 20 20 20      normal..      
026560:  20 63 68 61 72 61 63 74 65 72 73 2E 20 4F 74 68     characters. Oth
026570:  65 72 20 4B 65 79 20 20 4D 61 6E 61 67 65 72 20    er Key  Manager 
026580:  20 74 6F 6B 65 6E 73 20 20 28 73 68 69 66 74 20     tokens  (shift 
026590:  20 6C 6F 63 6B 2C 20 20 63 61 70 73 20 20 6C 6F     lock,  caps  lo
0265A0:  63 6B 20 20 61 6E 64 0D 0A 20 20 20 20 20 20 20    ck  and..       
0265B0:  69 67 6E 6F 72 65 29 20 61 72 65 20 6F 62 65 79    ignore) are obey
0265C0:  65 64 20 62 75 74 20 61 72 65 20 6E 6F 74 20 70    ed but are not p
0265D0:  61 73 73 65 64 20 6F 75 74 2E 0D 0A 0D 0A 0D 0A    assed out.......
0265E0:  20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20 65           Related e
0265F0:  6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20    ntries:......   
026600:  20 20 20 20 4B 4D 20 52 45 41 44 20 4B 45 59 0D        KM READ KEY.
026610:  0A 20 20 20 20 20 20 20 4B 4D 20 57 41 49 54 20    .       KM WAIT 
026620:  43 48 41 52 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    CHAR............
026630:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
026640:  0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44    ..       AMSTRAD
026650:  20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38     CPC464/664/6128
026660:  20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20     FIRMWARE       
026670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026680:  20 20 20 20 20 70 61 67 65 20 31 35 2E 31 30 0D         page 15.10.
026690:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
0266A0:  20 20 20 20 39 3A 20 4B 4D 20 52 45 41 44 20 4B        9: KM READ K
0266B0:  45 59 20 20 20 20 20 20 20 20 20 20 20 20 20 20    EY              
0266C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0266D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0266E0:  20 20 20 20 20 23 42 42 31 42 0D 0A 0D 0A 20 20         #BB1B....  
0266F0:  20 20 20 20 20 54 65 73 74 20 69 66 20 61 20 6B         Test if a k
026700:  65 79 20 69 73 20 61 76 61 69 6C 61 62 6C 65 20    ey is available 
026710:  66 72 6F 6D 20 74 68 65 20 6B 65 79 62 6F 61 72    from the keyboar
026720:  64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74    d.....       Act
026730:  69 6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    ion:....       T
026740:  72 79 20 74 6F 20 67 65 74 20 61 20 6B 65 79 20    ry to get a key 
026750:  66 72 6F 6D 20 74 68 65 20 6B 65 79 20 62 75 66    from the key buf
026760:  66 65 72 2E 20 54 68 69 73 20 72 6F 75 74 69 6E    fer. This routin
026770:  65 20 64 6F 65 73 20 6E 6F 74 20 77 61 69 74 20    e does not wait 
026780:  69 66 20 6E 6F 0D 0A 20 20 20 20 20 20 20 6B 65    if no..       ke
026790:  79 20 69 73 20 61 76 61 69 6C 61 62 6C 65 20 69    y is available i
0267A0:  6D 6D 65 64 69 61 74 65 6C 79 2E 0D 0A 0D 0A 20    mmediately..... 
0267B0:  20 20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64          Entry cond
0267C0:  69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20    itions:....     
0267D0:  20 20 4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73 2E      No conditions.
0267E0:  0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69 74 20    ....       Exit 
0267F0:  63 6F 6E 64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A 20    conditions..... 
026800:  20 20 20 20 20 20 49 66 20 61 20 6B 65 79 20 77          If a key w
026810:  61 73 20 61 76 61 69 6C 61 62 6C 65 3A 0D 0A 0D    as available:...
026820:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
026830:  20 43 61 72 72 79 20 74 72 75 65 2E 0D 0A 0D 0A     Carry true.....
026840:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026850:  41 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 63    A contains the c
026860:  68 61 72 61 63 74 65 72 20 6F 72 20 65 78 70 61    haracter or expa
026870:  6E 73 69 6F 6E 20 74 6F 6B 65 6E 2E 0D 0A 0D 0A    nsion token.....
026880:  20 20 20 20 20 20 20 49 66 20 6E 6F 20 6B 65 79           If no key
026890:  20 77 61 73 20 61 76 61 69 6C 61 62 6C 65 3A 0D     was available:.
0268A0:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
0268B0:  20 20 20 43 61 72 72 79 20 66 61 6C 73 65 2E 0D       Carry false..
0268C0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
0268D0:  20 41 20 63 6F 72 72 75 70 74 2E 0D 0A 0D 0A 20     A corrupt..... 
0268E0:  20 20 20 20 20 20 41 6C 77 61 79 73 3A 0D 0A 0D          Always:...
0268F0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
026900:  20 4F 74 68 65 72 20 66 6C 61 67 73 20 63 6F 72     Other flags cor
026910:  72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 20 20    rupt...         
026920:  20 20 20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72           All other
026930:  20 72 65 67 69 73 74 65 72 73 20 70 72 65 73 65     registers prese
026940:  72 76 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    rved.....       
026950:  4E 6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    Notes:......    
026960:  20 20 20 54 68 65 20 6E 65 78 74 20 6B 65 79 20       The next key 
026970:  69 73 20 72 65 61 64 20 66 72 6F 6D 20 74 68 65    is read from the
026980:  20 6B 65 79 20 20 62 75 66 66 65 72 20 20 61 6E     key  buffer  an
026990:  64 20 20 74 72 61 6E 73 6C 61 74 65 64 20 20 75    d  translated  u
0269A0:  73 69 6E 67 20 20 74 68 65 0D 0A 20 20 20 20 20    sing  the..     
0269B0:  20 20 61 70 70 72 6F 70 72 69 61 74 65 20 6B 65      appropriate ke
0269C0:  79 20 74 72 61 6E 73 6C 61 74 69 6F 6E 20 74 61    y translation ta
0269D0:  62 6C 65 2E 20 45 78 70 61 6E 73 69 6F 6E 20 74    ble. Expansion t
0269E0:  6F 6B 65 6E 73 20 61 72 65 20 20 6E 6F 74 20 20    okens are  not  
0269F0:  65 78 70 61 6E 64 65 64 0D 0A 20 20 20 20 20 20    expanded..      
026A00:  20 62 75 74 20 61 72 65 20 20 70 61 73 73 65 64     but are  passed
026A10:  20 20 6F 75 74 20 20 66 6F 72 20 20 74 68 65 20      out  for  the 
026A20:  20 75 73 65 72 20 20 74 6F 20 20 64 65 61 6C 20     user  to  deal 
026A30:  20 77 69 74 68 2C 20 20 61 73 20 20 61 72 65 20     with,  as  are 
026A40:  20 6E 6F 72 6D 61 6C 0D 0A 20 20 20 20 20 20 20     normal..       
026A50:  63 68 61 72 61 63 74 65 72 73 2E 20 4F 74 68 65    characters. Othe
026A60:  72 20 4B 65 79 20 20 4D 61 6E 61 67 65 72 20 20    r Key  Manager  
026A70:  74 6F 6B 65 6E 73 20 20 28 73 68 69 66 74 20 20    tokens  (shift  
026A80:  6C 6F 63 6B 2C 20 20 63 61 70 73 20 20 6C 6F 63    lock,  caps  loc
026A90:  6B 20 20 61 6E 64 0D 0A 20 20 20 20 20 20 20 69    k  and..       i
026AA0:  67 6E 6F 72 65 29 20 61 72 65 20 6F 62 65 79 65    gnore) are obeye
026AB0:  64 20 62 75 74 20 61 72 65 20 6E 6F 74 20 70 61    d but are not pa
026AC0:  73 73 65 64 20 6F 75 74 2E 0D 0A 0D 0A 0D 0A 20    ssed out....... 
026AD0:  20 20 20 20 20 20 54 68 69 73 20 72 6F 75 74 69          This routi
026AE0:  6E 65 20 77 69 6C 6C 20 61 6C 77 61 79 73 20 72    ne will always r
026AF0:  65 74 75 72 6E 20 61 20 6B 65 79 20 20 69 66 20    eturn a key  if 
026B00:  20 6F 6E 65 20 20 69 73 20 20 61 76 61 69 6C 61     one  is  availa
026B10:  62 6C 65 2E 20 20 49 74 20 20 69 73 0D 0A 20 20    ble.  It  is..  
026B20:  20 20 20 20 20 74 68 65 72 65 66 6F 72 65 20 70         therefore p
026B30:  6F 73 73 69 62 6C 65 20 74 6F 20 66 6C 75 73 68    ossible to flush
026B40:  20 6F 75 74 20 74 68 65 20 6B 65 79 20 62 75 66     out the key buf
026B50:  66 65 72 20 62 79 20 63 61 6C 6C 69 6E 67 20 4B    fer by calling K
026B60:  4D 20 52 45 41 44 20 20 4B 45 59 0D 0A 20 20 20    M READ  KEY..   
026B70:  20 20 20 20 72 65 70 65 61 74 65 64 6C 79 20 75        repeatedly u
026B80:  6E 74 69 6C 20 69 74 20 63 6C 61 69 6D 20 6E 6F    ntil it claim no
026B90:  20 6B 65 79 20 69 73 20 61 76 61 69 6C 61 62 6C     key is availabl
026BA0:  65 2E 20 4E 6F 74 65 2C 20 68 6F 77 65 76 65 72    e. Note, however
026BB0:  2C 20 74 68 61 74 20 74 68 65 0D 0A 20 20 20 20    , that the..    
026BC0:  20 20 20 27 70 75 74 20 62 61 63 6B 27 20 63 68       'put back' ch
026BD0:  61 72 61 63 74 65 72 20 6F 72 20 61 20 70 61 72    aracter or a par
026BE0:  74 69 61 6C 6C 79 20 72 65 61 64 20 65 78 70 61    tially read expa
026BF0:  6E 73 69 6F 6E 20 73 74 72 69 6E 67 20 69 73 20    nsion string is 
026C00:  20 69 67 6E 6F 72 65 64 2E 0D 0A 20 20 20 20 20     ignored...     
026C10:  20 20 49 74 20 69 73 20 61 64 76 69 73 61 62 6C      It is advisabl
026C20:  65 20 74 6F 20 75 73 65 20 4B 4D 20 52 45 41 44    e to use KM READ
026C30:  20 43 48 41 52 20 74 6F 20 66 6C 75 73 68 20 74     CHAR to flush t
026C40:  68 65 73 65 20 6F 75 74 20 20 77 68 65 6E 20 20    hese out  when  
026C50:  65 6D 70 74 79 69 6E 67 0D 0A 20 20 20 20 20 20    emptying..      
026C60:  20 74 68 65 20 4B 65 79 20 4D 61 6E 61 67 65 72     the Key Manager
026C70:  20 62 75 66 66 65 72 73 2C 20 6F 72 2C 20 69 6E     buffers, or, in
026C80:  20 56 31 2E 31 20 66 69 72 6D 77 61 72 65 2C 20     V1.1 firmware, 
026C90:  74 6F 20 63 61 6C 6C 20 4B 4D 20 46 4C 55 53 48    to call KM FLUSH
026CA0:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65    .......       Re
026CB0:  6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A    lated entries:..
026CC0:  0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 46 4C    ....       KM FL
026CD0:  55 53 48 0D 0A 20 20 20 20 20 20 20 4B 4D 20 52    USH..       KM R
026CE0:  45 41 44 20 43 48 41 52 0D 0A 20 20 20 20 20 20    EAD CHAR..      
026CF0:  20 4B 4D 20 57 41 49 54 20 4B 45 59 0D 0A 0D 0A     KM WAIT KEY....
026D00:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
026D10:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
026D20:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
026D30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026D40:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 35             page 15
026D50:  2E 31 31 0D 0A 1A 65 74 61 69 6C 20 74 68 65 20    .11...etail the 
026D60:  65 6E 74 72 79 20 61 6E 64 20 65 78 69 74 20 63    entry and exit c
026D70:  6F 6E 64 69 74 69 6F 6E 73 20 61 6E 64 20 74 68    onditions and th
026D80:  6E 74 69 6C 20 69 74 20 63 6C 61 69 6D 20 6E 6F    ntil it claim no
026D90:  20 6B 65 79 20 69 73 20 61 76 61 69 6C 61 62 6C     key is availabl
026DA0:  65 2E 20 4E 6F 74 65 2C 20 68 6F 77 65 76 65 72    e. Note, however
026DB0:  2C 20 74 68 61 74 20 74 68 65 0D 0A 20 20 20 20    , that the..    
026DC0:  20 20 20 27 70 75 74 20 62 61 63 6B 27 20 63 68       'put back' ch
026DD0:  61 72 61 63 74 65 72 20 6F 72 20 61 20 70 61 72    aracter or a par
026DE0:  74 69 61 6C 6C 79 20 72 65 61 64 20 65 78 70 61    tially read expa
026DF0:  6E 73 69 6F 6E 20 73 74 72 69 6E 67 20 69 73 20    nsion string is 
026E00:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
026E10:  20 20 20 31 30 3A 20 4B 4D 20 54 45 53 54 20 4B       10: KM TEST K
026E20:  45 59 20 20 20 20 20 20 20 20 20 20 20 20 20 20    EY              
026E30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026E40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
026E50:  20 20 20 20 23 42 42 31 45 0D 0A 0D 0A 20 20 20        #BB1E....   
026E60:  20 20 20 20 54 65 73 74 20 69 66 20 61 20 6B 65        Test if a ke
026E70:  79 20 69 73 20 70 72 65 73 73 65 64 2E 0D 0A 0D    y is pressed....
026E80:  0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D    .       Action:.
026E90:  0A 0D 0A 20 20 20 20 20 20 20 54 65 73 74 20 69    ...       Test i
026EA0:  66 20 61 20 70 61 72 74 69 63 75 6C 61 72 20 6B    f a particular k
026EB0:  65 79 20 6F 72 20 6A 6F 79 73 74 69 63 6B 20 62    ey or joystick b
026EC0:  75 74 74 6F 6E 20 69 73 20 70 72 65 73 73 65 64    utton is pressed
026ED0:  2E 20 54 68 69 73 20 20 69 73 20 20 64 6F 6E 65    . This  is  done
026EE0:  0D 0A 20 20 20 20 20 20 20 75 73 69 6E 67 20 74    ..       using t
026EF0:  68 65 20 20 6B 65 79 20 20 73 74 61 74 65 20 20    he  key  state  
026F00:  6D 61 70 20 20 72 61 74 68 65 72 20 20 74 68 65    map  rather  the
026F10:  6E 20 20 62 79 20 20 61 63 63 65 73 73 69 6E 67    n  by  accessing
026F20:  20 20 74 68 65 20 20 6B 65 79 62 6F 61 72 64 0D      the  keyboard.
026F30:  0A 20 20 20 20 20 20 20 68 61 72 64 77 61 72 65    .       hardware
026F40:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72    .....       Entr
026F50:  79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    y conditions:...
026F60:  0A 20 20 20 20 20 20 20 41 20 63 6F 6E 74 61 69    .       A contai
026F70:  6E 73 20 74 68 65 20 6B 65 79 20 6E 75 6D 62 65    ns the key numbe
026F80:  72 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69    r.....       Exi
026F90:  74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    t conditions:...
026FA0:  0A 20 20 20 20 20 20 20 49 66 20 74 68 65 20 6B    .       If the k
026FB0:  65 79 20 69 73 20 70 72 65 73 73 65 64 3A 0D 0A    ey is pressed:..
026FC0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
026FD0:  20 20 5A 65 72 6F 20 66 61 6C 73 65 2E 0D 0A 0D      Zero false....
026FE0:  0A 20 20 20 20 20 20 20 49 66 20 74 68 65 20 6B    .       If the k
026FF0:  65 79 20 69 73 20 6E 6F 74 20 70 72 65 73 73 65    ey is not presse
027000:  64 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    d:....          
027010:  20 20 20 20 20 20 5A 65 72 6F 20 74 72 75 65 2E          Zero true.
027020:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 77 61 79    ....       Alway
027030:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    s:....          
027040:  20 20 20 20 20 20 43 61 72 72 79 20 66 61 6C 73          Carry fals
027050:  65 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    e...            
027060:  20 20 20 20 43 20 63 6F 6E 74 61 69 6E 73 20 74        C contains t
027070:  68 65 20 63 75 72 72 65 6E 74 20 73 68 69 66 74    he current shift
027080:  20 61 6E 64 20 63 6F 6E 74 72 6F 6C 20 73 74 61     and control sta
027090:  74 65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    te.....         
0270A0:  20 20 20 20 20 20 20 41 2C 48 4C 20 61 6E 64 20           A,HL and 
0270B0:  6F 74 68 65 72 20 66 6C 61 67 73 20 63 6F 72 72    other flags corr
0270C0:  75 70 74 2E 0D 0A 20 20 20 20 20 20 20 20 20 20    upt...          
0270D0:  20 20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20          All other 
0270E0:  72 65 67 69 73 74 65 72 73 20 70 72 65 73 65 72    registers preser
0270F0:  76 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4E    ved.....       N
027100:  6F 74 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    otes:....       
027110:  54 68 65 20 73 68 69 66 74 20 61 6E 64 20 63 6F    The shift and co
027120:  6E 74 72 6F 6C 20 73 74 61 74 65 73 20 61 72 65    ntrol states are
027130:  20 61 75 74 6F 6D 61 74 69 63 61 6C 6C 79 20 20     automatically  
027140:  72 65 61 64 20 20 77 68 65 6E 20 20 61 20 20 6B    read  when  a  k
027150:  65 79 20 20 69 73 0D 0A 20 20 20 20 20 20 20 73    ey  is..       s
027160:  63 61 6E 6E 65 64 2E 20 49 66 20 62 69 74 20 37    canned. If bit 7
027170:  20 69 73 20 73 65 74 20 74 68 65 6E 20 74 68 65     is set then the
027180:  20 63 6F 6E 74 72 6F 6C 20 6B 65 79 20 69 73 20     control key is 
027190:  70 72 65 73 73 65 64 20 61 6E 64 20 69 66 20 62    pressed and if b
0271A0:  69 74 20 20 35 0D 0A 20 20 20 20 20 20 20 69 73    it  5..       is
0271B0:  20 73 65 74 20 74 68 65 6E 20 6F 6E 65 20 6F 66     set then one of
0271C0:  20 74 68 65 20 73 68 69 66 74 20 6B 65 79 73 20     the shift keys 
0271D0:  69 73 20 70 72 65 73 73 65 64 2E 0D 0A 0D 0A 20    is pressed..... 
0271E0:  20 20 20 20 20 20 54 68 65 20 6B 65 79 20 6E 75          The key nu
0271F0:  6D 62 65 72 20 69 73 20 6E 6F 74 20 63 68 65 63    mber is not chec
027200:  6B 65 64 2E 20 41 6E 20 69 6E 76 61 6C 69 64 20    ked. An invalid 
027210:  6B 65 79 20 6E 75 6D 62 65 72 20 77 69 6C 6C 20    key number will 
027220:  67 65 6E 65 72 61 74 65 20 74 68 65 0D 0A 20 20    generate the..  
027230:  20 20 20 20 20 63 6F 72 72 65 63 74 20 73 68 69         correct shi
027240:  66 74 20 61 6E 64 20 63 6F 6E 74 72 6F 6C 20 73    ft and control s
027250:  74 61 74 65 73 20 62 75 74 20 74 68 65 20 73 74    tates but the st
027260:  61 74 65 20 6F 66 20 74 68 65 20 6B 65 79 20 74    ate of the key t
027270:  65 73 74 65 64 20 20 77 69 6C 6C 0D 0A 20 20 20    ested  will..   
027280:  20 20 20 20 62 65 20 6D 65 61 6E 69 6E 67 6C 65        be meaningle
027290:  73 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    ss.....       Th
0272A0:  65 20 6B 65 79 20 73 74 61 74 65 20 6D 61 70 20    e key state map 
0272B0:  77 68 69 63 68 20 74 68 69 73 20 72 6F 75 74 69    which this routi
0272C0:  6E 65 20 74 65 73 74 73 20 69 73 20 75 70 64 61    ne tests is upda
0272D0:  74 65 64 20 62 79 20 74 68 65 20 20 6B 65 79 62    ted by the  keyb
0272E0:  6F 61 72 64 0D 0A 20 20 20 20 20 20 20 73 63 61    oard..       sca
0272F0:  6E 6E 69 6E 67 20 72 6F 75 74 69 6E 65 2E 20 4E    nning routine. N
027300:  6F 72 6D 61 6C 6C 79 20 74 68 69 73 20 72 75 6E    ormally this run
027310:  20 69 73 20 65 76 65 72 79 20 66 69 66 74 69 65     is every fiftie
027320:  74 68 20 6F 66 20 61 20 73 65 63 6F 6E 64 20 20    th of a second  
027330:  61 6E 64 0D 0A 20 20 20 20 20 20 20 73 6F 20 74    and..       so t
027340:  68 65 20 73 74 61 74 65 20 6D 61 79 20 62 65 20    he state may be 
027350:  6F 75 74 20 6F 66 20 64 61 74 65 20 20 62 79 20    out of date  by 
027360:  20 74 68 61 74 20 20 6D 75 63 68 2E 20 20 54 68     that  much.  Th
027370:  65 20 20 6B 65 79 20 20 64 65 62 6F 75 6E 63 69    e  key  debounci
027380:  6E 67 0D 0A 20 20 20 20 20 20 20 72 65 71 75 69    ng..       requi
027390:  72 65 73 20 74 68 61 74 20 61 20 6B 65 79 20 73    res that a key s
0273A0:  68 6F 75 6C 64 20 62 65 20 72 65 6C 65 61 73 65    hould be release
0273B0:  64 20 66 6F 72 20 74 77 6F 20 73 63 61 6E 73 20    d for two scans 
0273C0:  6F 66 20 20 74 68 65 20 20 6B 65 79 62 6F 61 72    of  the  keyboar
0273D0:  64 0D 0A 20 20 20 20 20 20 20 62 65 66 6F 72 65    d..       before
0273E0:  20 69 74 20 69 73 20 6D 61 72 6B 65 64 20 61 73     it is marked as
0273F0:  20 72 65 6C 65 61 73 65 64 20 69 6E 20 74 68 65     released in the
027400:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
027410:  21 00 00 00 02 09 50 E5 21 00 C1 02 00 00 00 02    !.....P.!.......
027420:  21 00 C2 02 00 00 00 02 21 00 C3 02 00 00 00 02    !.......!.......
027430:  21 00 C4 02 00 00 00 02 21 00 C5 02 00 00 00 02    !.......!.......
027440:  21 00 C6 02 00 00 00 02 21 00 C7 02 00 00 00 02    !.......!.......
027450:  21 00 C8 02 00 00 00 02 21 00 C9 02 00 00 00 02    !.......!.......
027460:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
027470:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
027480:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
027490:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0274F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
027500:  20 6B 65 79 20 73 74 61 74 65 20 6D 61 70 3B 20     key state map; 
027510:  74 68 65 20 70 72 65 73 73 69 6E 67 20 20 6F 66    the pressing  of
027520:  0D 0A 20 20 20 20 20 20 20 61 20 6B 65 79 20 69    ..       a key i
027530:  73 20 64 65 74 65 63 74 65 64 20 69 6D 6D 65 64    s detected immed
027540:  69 61 74 65 6C 79 2E 0D 0A 0D 0A 0D 0A 20 20 20    iately.......   
027550:  20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72        Related entr
027560:  69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B    ies:....       K
027570:  4D 20 47 45 54 20 4A 4F 59 53 54 49 43 4B 0D 0A    M GET JOYSTICK..
027580:  20 20 20 20 20 20 20 4B 4D 20 47 45 54 20 53 54           KM GET ST
027590:  41 54 45 0D 0A 20 20 20 20 20 20 20 4B 4D 20 52    ATE..       KM R
0275A0:  45 41 44 20 4B 45 59 0D 0A 0D 0A 0D 0A 0D 0A 0D    EAD KEY.........
0275B0:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
0275C0:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
0275D0:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
0275E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0275F0:  20 20 20 20 70 61 67 65 20 31 35 2E 31 32 0D 0A        page 15.12..
027600:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
027610:  20 20 20 31 31 3A 20 4B 4D 20 47 45 54 20 53 54       11: KM GET ST
027620:  41 54 45 20 20 20 20 20 20 20 20 20 20 20 20 20    ATE             
027630:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027640:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027650:  20 20 20 20 23 42 42 32 31 0D 0A 0D 0A 0D 0A 20        #BB21...... 
027660:  20 20 20 20 20 20 46 65 74 63 68 20 43 61 70 73          Fetch Caps
027670:  20 4C 6F 63 6B 20 61 6E 64 20 53 68 69 66 74 20     Lock and Shift 
027680:  4C 6F 63 6B 20 73 74 61 74 65 73 2E 0D 0A 0D 0A    Lock states.....
027690:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74 69 6F    ....       Actio
0276A0:  6E 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    n:......       A
0276B0:  73 6B 20 69 66 20 74 68 65 20 6B 65 79 62 6F 61    sk if the keyboa
0276C0:  72 64 20 69 73 20 63 75 72 72 65 6E 74 6C 79 20    rd is currently 
0276D0:  73 68 69 66 74 20 6C 6F 63 6B 65 64 20 6F 72 20    shift locked or 
0276E0:  63 61 70 73 20 6C 6F 63 6B 65 64 2E 0D 0A 0D 0A    caps locked.....
0276F0:  0D 0A 20 20 20 20 20 20 20 45 6E 74 72 79 20 63    ..       Entry c
027700:  6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A    onditions:......
027710:  20 20 20 20 20 20 20 4E 6F 20 63 6F 6E 64 69 74           No condit
027720:  69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions.......     
027730:  20 20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E      Exit condition
027740:  73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4C    s:......       L
027750:  20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20 73 68     contains the sh
027760:  69 66 74 20 6C 6F 63 6B 20 73 74 61 74 65 2E 0D    ift lock state..
027770:  0A 20 20 20 20 20 20 20 48 20 63 6F 6E 74 61 69    .       H contai
027780:  6E 73 20 74 68 65 20 63 61 70 73 20 6C 6F 63 6B    ns the caps lock
027790:  20 73 74 61 74 65 2E 0D 0A 0D 0A 0D 0A 20 20 20     state.......   
0277A0:  20 20 20 20 41 46 20 63 6F 72 72 75 70 74 2E 0D        AF corrupt..
0277B0:  0A 20 20 20 20 20 20 20 41 6C 6C 20 6F 74 68 65    .       All othe
0277C0:  72 20 72 65 67 69 73 74 65 72 73 20 70 72 65 73    r registers pres
0277D0:  65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    erved.......    
0277E0:  20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20       Notes:...... 
0277F0:  20 20 20 20 20 20 54 68 65 20 6C 6F 63 6B 20 73          The lock s
027800:  74 61 74 65 73 20 61 72 65 3A 0D 0A 0D 0A 0D 0A    tates are:......
027810:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027820:  23 30 30 20 20 20 20 20 20 20 6D 65 61 6E 73 20    #00       means 
027830:  74 68 65 20 6C 6F 63 6B 20 69 73 20 6F 66 66 0D    the lock is off.
027840:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
027850:  20 23 46 46 20 20 20 20 20 20 20 6D 65 61 6E 73     #FF       means
027860:  20 74 68 65 20 6C 6F 63 6B 20 69 73 20 6F 6E 0D     the lock is on.
027870:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
027880:  64 65 66 61 75 6C 74 20 6C 6F 63 6B 20 73 74 61    default lock sta
027890:  74 65 73 20 61 72 65 20 6F 66 66 2E 0D 0A 0D 0A    tes are off.....
0278A0:  0D 0A 20 20 20 20 20 20 20 52 65 6C 61 74 65 64    ..       Related
0278B0:  20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20     entries:...... 
0278C0:  20 20 20 20 20 20 4B 4D 20 53 45 54 20 4C 4F 43          KM SET LOC
0278D0:  4B 53 0D 0A 20 20 20 20 20 20 20 4B 4D 20 54 45    KS..       KM TE
0278E0:  53 54 20 4B 45 59 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ST KEY..........
0278F0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
027900:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
027910:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
027920:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
027930:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027940:  20 70 61 67 65 20 31 35 2E 31 33 0D 0A 0D 0A 0D     page 15.13.....
027950:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
027960:  31 32 3A 20 4B 4D 20 47 45 54 20 4A 4F 59 53 54    12: KM GET JOYST
027970:  49 43 4B 20 20 20 20 20 20 20 20 20 20 20 20 20    ICK             
027980:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027990:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0279A0:  20 23 42 42 32 34 0D 0A 0D 0A 0D 0A 20 20 20 20     #BB24......    
0279B0:  20 20 20 46 65 74 63 68 20 63 75 72 72 65 6E 74       Fetch current
0279C0:  20 73 74 61 74 65 20 6F 66 20 74 68 65 20 6A 6F     state of the jo
0279D0:  79 73 74 69 63 6B 28 73 29 2E 0D 0A 0D 0A 0D 0A    ystick(s).......
0279E0:  20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A           Action:..
0279F0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 73 6B 20 77    ....       Ask w
027A00:  68 61 74 20 74 68 65 20 63 75 72 72 65 6E 74 20    hat the current 
027A10:  73 74 61 74 65 73 20 6F 66 20 74 68 65 20 6A 6F    states of the jo
027A20:  79 73 74 69 63 6B 73 20 61 72 65 2E 20 54 68 65    ysticks are. The
027A30:  73 65 20 61 72 65 20 72 65 61 64 20 20 66 72 6F    se are read  fro
027A40:  6D 0D 0A 20 20 20 20 20 20 20 74 68 65 20 6B 65    m..       the ke
027A50:  79 20 73 74 61 74 65 20 6D 61 70 20 72 61 74 68    y state map rath
027A60:  65 72 20 74 68 61 6E 20 62 79 20 61 63 63 65 73    er than by acces
027A70:  73 69 6E 67 20 74 68 65 20 6B 65 79 62 6F 61 72    sing the keyboar
027A80:  64 20 68 61 72 64 77 61 72 65 2E 0D 0A 0D 0A 0D    d hardware......
027A90:  0A 20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F    .       Entry co
027AA0:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20    nditions:...... 
027AB0:  20 20 20 20 20 20 4E 6F 20 63 6F 6E 64 69 74 69          No conditi
027AC0:  6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ons.......      
027AD0:  20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73     Exit conditions
027AE0:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 48 20    :......       H 
027AF0:  63 6F 6E 74 61 69 6E 73 20 74 68 65 20 73 74 61    contains the sta
027B00:  74 65 20 6F 66 20 6A 6F 79 73 74 69 63 6B 20 30    te of joystick 0
027B10:  2E 0D 0A 20 20 20 20 20 20 20 4C 20 63 6F 6E 74    ...       L cont
027B20:  61 69 6E 73 20 74 68 65 20 73 74 61 74 65 20 6F    ains the state o
027B30:  66 20 6A 6F 79 73 74 69 63 6B 20 31 2E 0D 0A 20    f joystick 1... 
027B40:  20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73          A contains
027B50:  20 74 68 65 20 73 74 61 74 65 20 6F 66 20 6A 6F     the state of jo
027B60:  79 73 74 69 63 6B 20 30 2E 0D 0A 0D 0A 20 20 20    ystick 0.....   
027B70:  20 20 20 20 46 6C 61 67 73 20 63 6F 72 72 75 70        Flags corrup
027B80:  74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F    t...       All o
027B90:  74 68 65 72 20 72 65 67 69 73 74 65 72 73 20 70    ther registers p
027BA0:  72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20    reserved.....   
027BB0:  20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 20 20        Notes:....  
027BC0:  20 20 20 20 20 49 6E 20 6E 6F 72 6D 61 6C 20 6F         In normal o
027BD0:  70 65 72 61 74 69 6F 6E 20 74 68 65 20 6B 65 79    peration the key
027BE0:  20 73 74 61 74 65 20 6D 61 70 20 69 73 20 75 70     state map is up
027BF0:  64 61 74 65 64 20 62 79 20 74 68 65 20 20 6B 65    dated by the  ke
027C00:  79 20 20 73 63 61 6E 6E 69 6E 67 0D 0A 20 20 20    y  scanning..   
027C10:  20 20 20 20 72 6F 75 74 69 6E 65 20 65 76 65 72        routine ever
027C20:  79 20 66 69 66 74 69 65 74 68 20 6F 66 20 61 20    y fiftieth of a 
027C30:  20 73 65 63 6F 6E 64 20 20 73 6F 20 20 74 68 65     second  so  the
027C40:  20 20 73 74 61 74 65 20 20 72 65 74 75 72 6E 65      state  returne
027C50:  64 20 20 6D 61 79 20 20 62 65 0D 0A 20 20 20 20    d  may  be..    
027C60:  20 20 20 73 6C 69 67 68 74 6C 79 20 6F 75 74 20       slightly out 
027C70:  6F 66 20 64 61 74 65 2E 0D 0A 0D 0A 0D 0A 20 20    of date.......  
027C80:  20 20 20 20 20 54 68 65 20 6A 6F 79 73 74 69 63         The joystic
027C90:  6B 20 73 74 61 74 65 73 20 61 72 65 20 62 69 74    k states are bit
027CA0:  20 73 69 67 6E 69 66 69 63 61 6E 74 20 61 73 20     significant as 
027CB0:  66 6F 6C 6C 6F 77 73 3A 0D 0A 0D 0A 20 20 20 20    follows:....    
027CC0:  20 20 20 20 20 20 20 20 20 20 20 20 42 69 74 20                Bit 
027CD0:  30 20 20 20 20 20 55 70 2E 0D 0A 20 20 20 20 20    0     Up...     
027CE0:  20 20 20 20 20 20 20 20 20 20 20 42 69 74 20 31               Bit 1
027CF0:  20 20 20 20 20 44 6F 77 6E 2E 0D 0A 20 20 20 20         Down...    
027D00:  20 20 20 20 20 20 20 20 20 20 20 20 42 69 74 20                Bit 
027D10:  32 20 20 20 20 20 4C 65 66 74 2E 0D 0A 20 20 20    2     Left...   
027D20:  20 20 20 20 20 20 20 20 20 20 20 20 20 42 69 74                 Bit
027D30:  20 33 20 20 20 20 20 52 69 67 68 74 2E 0D 0A 20     3     Right... 
027D40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 42                   B
027D50:  69 74 20 34 20 20 20 20 20 46 69 72 65 20 32 2E    it 4     Fire 2.
027D60:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
027D70:  20 20 42 69 74 20 35 20 20 20 20 20 46 69 72 65      Bit 5     Fire
027D80:  20 31 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20     1...           
027D90:  20 20 20 20 20 42 69 74 20 36 20 20 20 20 20 53         Bit 6     S
027DA0:  70 61 72 65 20 6A 6F 79 73 74 69 63 6B 20 62 75    pare joystick bu
027DB0:  74 74 6F 6E 20 28 75 73 75 61 6C 6C 79 20 75 6E    tton (usually un
027DC0:  63 6F 6E 6E 65 63 74 65 64 29 2E 0D 0A 20 20 20    connected)...   
027DD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 42 69 74                 Bit
027DE0:  20 37 20 20 20 20 20 41 6C 77 61 79 73 20 7A 65     7     Always ze
027DF0:  72 6F 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 49 66    ro.....       If
027E00:  20 61 20 62 69 74 20 69 73 20 73 65 74 20 74 68     a bit is set th
027E10:  65 6E 20 74 68 65 20 61 70 70 72 6F 70 72 69 61    en the appropria
027E20:  74 65 20 62 75 74 74 6F 6E 20 69 73 20 70 72 65    te button is pre
027E30:  73 73 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    ssed.....       
027E40:  4A 6F 79 73 74 69 63 6B 20 31 20 69 73 20 69 6E    Joystick 1 is in
027E50:  64 69 73 74 69 6E 67 75 69 73 68 61 62 6C 65 20    distinguishable 
027E60:  66 72 6F 6D 20 63 65 72 74 61 69 6E 20 6B 65 79    from certain key
027E70:  73 20 6F 6E 20 74 68 65 20 6B 65 79 62 6F 61 72    s on the keyboar
027E80:  64 20 28 73 65 65 0D 0A 20 20 20 20 20 20 20 41    d (see..       A
027E90:  70 70 65 6E 64 69 78 20 31 29 2E 0D 0A 0D 0A 20    ppendix 1)..... 
027EA0:  20 20 20 20 20 20 52 65 6C 61 74 65 64 20 65 6E          Related en
027EB0:  74 72 69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20    tries:....      
027EC0:  20 4B 4D 20 54 45 53 54 20 4B 45 59 0D 0A 0D 0A     KM TEST KEY....
027ED0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
027EE0:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
027EF0:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
027F00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027F10:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 35             page 15
027F20:  2E 31 34 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    .14.............
027F30:  0A 20 20 20 20 20 20 20 31 33 3A 20 4B 4D 20 53    .       13: KM S
027F40:  45 54 20 54 52 41 4E 53 4C 41 54 45 20 20 20 20    ET TRANSLATE    
027F50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027F60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
027F70:  20 20 20 20 20 20 20 20 20 23 42 42 32 37 0D 0A             #BB27..
027F80:  0D 0A 20 20 20 20 20 20 20 53 65 74 20 65 6E 74    ..       Set ent
027F90:  72 79 20 69 6E 20 6E 6F 72 6D 61 6C 20 6B 65 79    ry in normal key
027FA0:  20 74 72 61 6E 73 6C 61 74 65 20 74 61 62 6C 65     translate table
027FB0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74 69    .....       Acti
027FC0:  6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65    on:....       Se
027FD0:  74 20 77 68 61 74 20 63 68 61 72 61 63 74 65 72    t what character
027FE0:  20 6F 72 20 74 6F 6B 65 6E 20 61 20 6B 65 79 20     or token a key 
027FF0:  77 69 6C 6C 20 62 65 20 74 72 61 6E 73 6C 61 74    will be translat
028000:  65 64 20 74 6F 20 20 77 68 65 6E 20 20 6E 65 69    ed to  when  nei
028010:  74 68 65 72 0D 0A 20 20 20 20 20 20 20 73 68 69    ther..       shi
028020:  66 74 20 6E 6F 72 20 63 6F 6E 74 72 6F 6C 20 69    ft nor control i
028030:  73 20 70 72 65 73 73 65 64 2E 0D 0A 0D 0A 20 20    s pressed.....  
028040:  20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69         Entry condi
028050:  74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20    tions:....      
028060:  20 41 20 63 6F 6E 74 61 69 6E 73 20 61 20 6B 65     A contains a ke
028070:  79 20 6E 75 6D 62 65 72 2E 0D 0A 20 20 20 20 20    y number...     
028080:  20 20 42 20 63 6F 6E 74 61 69 6E 73 20 74 68 65      B contains the
028090:  20 6E 65 77 20 74 72 61 6E 73 6C 61 74 69 6F 6E     new translation
0280A0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69 74    .....       Exit
0280B0:  20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A     conditions:....
0280C0:  20 20 20 20 20 20 20 41 46 20 61 6E 64 20 48 4C           AF and HL
0280D0:  20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20     corrupt...     
0280E0:  20 20 41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69      All other regi
0280F0:  73 74 65 72 73 20 70 72 65 73 65 72 76 65 64 2E    sters preserved.
028100:  0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73    ....       Notes
028110:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74    :....       If t
028120:  68 65 20 6B 65 79 20 6E 75 6D 62 65 72 20 69 73    he key number is
028130:  20 69 6E 76 61 6C 69 64 20 28 67 72 65 61 74 65     invalid (greate
028140:  72 20 20 74 68 61 6E 20 20 37 39 29 20 20 74 68    r  than  79)  th
028150:  65 6E 20 20 6E 6F 20 20 61 63 74 69 6F 6E 20 20    en  no  action  
028160:  69 73 0D 0A 20 20 20 20 20 20 20 74 61 6B 65 6E    is..       taken
028170:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4D 6F 73 74    .....       Most
028180:  20 76 61 6C 75 65 73 20 69 6E 20 74 68 65 20 74     values in the t
028190:  61 62 6C 65 20 61 72 65 20 74 72 65 61 74 65 64    able are treated
0281A0:  20 61 73 20 63 68 61 72 61 63 74 65 72 73 20 61     as characters a
0281B0:  6E 64 20 61 72 65 20 70 61 73 73 65 64 20 62 61    nd are passed ba
0281C0:  63 6B 0D 0A 20 20 20 20 20 20 20 74 6F 20 74 68    ck..       to th
0281D0:  65 20 75 73 65 72 2E 20 48 6F 77 65 76 65 72 2C    e user. However,
0281E0:  20 74 68 65 72 65 20 61 72 65 20 63 65 72 74 61     there are certa
0281F0:  69 6E 20 73 70 65 63 69 61 6C 20 76 61 6C 75 65    in special value
028200:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    s:....          
028210:  20 20 20 20 20 20 23 38 30 2E 2E 23 39 46 20 20          #80..#9F  
028220:  61 72 65 20 20 74 68 65 20 20 65 78 70 61 6E 73    are  the  expans
028230:  69 6F 6E 20 20 74 6F 6B 65 6E 73 20 20 61 6E 64    ion  tokens  and
028240:  20 20 61 72 65 20 20 65 78 70 61 6E 64 65 64 20      are  expanded 
028250:  20 74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20 20     to..           
028260:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63                   c
028270:  68 61 72 61 63 74 65 72 20 73 74 72 69 6E 67 73    haracter strings
028280:  20 77 68 65 6E 20 4B 4D 20 52 45 41 44 20 43 48     when KM READ CH
028290:  41 52 20 6F 72 20 4B 4D 20 57 41 49 54 20 43 48    AR or KM WAIT CH
0282A0:  41 52 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    AR..            
0282B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73                  is
0282C0:  20 63 61 6C 6C 65 64 20 61 6C 74 68 6F 75 67 68     called although
0282D0:  20 74 68 65 79 20 61 72 65 20 70 61 73 73 65 64     they are passed
0282E0:  20 20 62 61 63 6B 20 20 6C 69 6B 65 20 20 61 6E      back  like  an
0282F0:  79 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    y..             
028300:  20 20 20 20 20 20 20 20 20 20 20 20 20 6F 74 68                 oth
028310:  65 72 20 63 68 61 72 61 63 74 65 72 20 77 68 65    er character whe
028320:  6E 20 4B 4D 20 52 45 41 44 20 4B 45 59 20 6F 72    n KM READ KEY or
028330:  20 4B 4D 20 57 41 49 54 20 4B 45 59 20 20 69 73     KM WAIT KEY  is
028340:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
028350:  20 20 20 20 20 20 20 20 20 20 20 20 63 61 6C 6C                call
028360:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ed.....         
028370:  20 20 20 20 20 20 20 23 46 44 20 20 20 20 20 20           #FD      
028380:  20 69 73 20 74 68 65 20 63 61 70 73 20 6C 6F 63     is the caps loc
028390:  6B 20 74 6F 6B 65 6E 20 61 6E 64 20 63 61 75 73    k token and caus
0283A0:  65 73 20 74 68 65 20 63 61 70 73 20 6C 6F 63 6B    es the caps lock
0283B0:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20      to..          
0283C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0283D0:  74 6F 67 67 6C 65 20 28 74 75 72 6E 20 6F 6E 20    toggle (turn on 
0283E0:  69 66 20 6F 66 66 20 61 6E 64 20 76 69 63 65 20    if off and vice 
0283F0:  76 65 72 73 61 29 2E 0D 0A 0D 0A 20 20 20 20 20    versa).....     
028400:  20 20 20 20 20 20 20 20 20 20 20 23 46 45 20 20               #FE  
028410:  20 20 20 20 20 69 73 20 74 68 65 20 73 68 69 66         is the shif
028420:  74 20 6C 6F 63 6B 20 74 6F 6B 65 6E 20 61 6E 64    t lock token and
028430:  20 63 61 75 73 65 73 20 74 68 65 20 20 73 68 69     causes the  shi
028440:  66 74 20 20 6C 6F 63 6B 0D 0A 20 20 20 20 20 20    ft  lock..      
028450:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028460:  20 20 20 20 74 6F 20 74 6F 67 67 6C 65 20 28 74        to toggle (t
028470:  75 72 6E 20 6F 6E 20 69 66 20 6F 66 66 20 61 6E    urn on if off an
028480:  64 20 76 69 63 65 20 76 65 72 73 61 29 2E 0D 0A    d vice versa)...
028490:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0284A0:  20 20 23 46 46 20 20 20 20 20 20 20 69 73 20 74      #FF       is t
0284B0:  68 65 20 69 67 6E 6F 72 65 20 74 6F 6B 65 6E 20    he ignore token 
0284C0:  61 6E 64 20 6D 65 61 6E 73 20 20 74 68 65 20 20    and means  the  
0284D0:  6B 65 79 20 20 73 68 6F 75 6C 64 20 20 62 65 0D    key  should  be.
0284E0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
0284F0:  20 20 20 20 20 20 20 20 20 20 20 74 68 72 6F 77               throw
028500:  6E 20 61 77 61 79 2E 0D 0A 0D 0A 20 20 20 20 20    n away.....     
028510:  20 20 43 68 61 72 61 63 74 65 72 73 20 23 45 30      Characters #E0
028520:  2E 2E 23 46 43 20 68 61 76 65 20 73 70 65 63 69    ..#FC have speci
028530:  61 6C 20 6D 65 61 6E 69 6E 67 73 20 74 6F 20 20    al meanings to  
028540:  74 68 65 20 20 42 41 53 49 43 20 20 74 6F 20 20    the  BASIC  to  
028550:  64 6F 20 20 77 69 74 68 0D 0A 20 20 20 20 20 20    do  with..      
028560:  20 65 64 69 74 69 6E 67 2C 20 63 75 72 73 6F 72     editing, cursor
028570:  69 6E 67 20 61 6E 64 20 62 72 65 61 6B 73 2E 0D    ing and breaks..
028580:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65 65 20    .....       See 
028590:  41 70 70 65 6E 64 69 78 20 49 49 20 66 6F 72 20    Appendix II for 
0285A0:  61 20 66 75 6C 6C 20 6C 69 73 74 69 6E 67 20 6F    a full listing o
0285B0:  66 20 74 68 65 20 64 65 66 61 75 6C 74 20 74 72    f the default tr
0285C0:  61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 73    anslation tables
0285D0:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65    .......       Re
0285E0:  6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A    lated entries:..
0285F0:  0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 47 45    ....       KM GE
028600:  54 20 54 52 41 4E 53 4C 41 54 45 0D 0A 20 20 20    T TRANSLATE..   
028610:  20 20 20 20 4B 4D 20 53 45 54 20 43 4F 4E 54 52        KM SET CONTR
028620:  4F 4C 0D 0A 20 20 20 20 20 20 20 4B 4D 20 53 45    OL..       KM SE
028630:  54 20 53 48 49 46 54 0D 0A 0D 0A 0D 0A 0D 0A 0D    T SHIFT.........
028640:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
028650:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
028660:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
028670:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028680:  20 20 20 20 70 61 67 65 20 31 35 2E 31 35 0D 0A        page 15.15..
028690:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
0286A0:  20 20 20 31 34 3A 20 4B 4D 20 47 45 54 20 54 52       14: KM GET TR
0286B0:  41 4E 53 4C 41 54 45 20 20 20 20 20 20 20 20 20    ANSLATE         
0286C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0286D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0286E0:  20 20 20 20 23 42 42 32 41 0D 0A 0D 0A 0D 0A 20        #BB2A...... 
0286F0:  20 20 20 20 20 20 47 65 74 20 65 6E 74 72 79 20          Get entry 
028700:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
028710:  22 00 00 00 02 09 50 E5 22 00 C1 02 00 00 00 02    ".....P.".......
028720:  22 00 C2 02 00 00 00 02 22 00 C3 02 00 00 00 02    ".......".......
028730:  22 00 C4 02 00 00 00 02 22 00 C5 02 00 00 00 02    ".......".......
028740:  22 00 C6 02 00 00 00 02 22 00 C7 02 00 00 00 02    ".......".......
028750:  22 00 C8 02 00 00 00 02 22 00 C9 02 00 00 00 02    ".......".......
028760:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
028770:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
028780:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
028790:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
0287F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
028800:  66 72 6F 6D 20 6E 6F 72 6D 61 6C 20 74 72 61 6E    from normal tran
028810:  73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 2E 0D 0A    slation table...
028820:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74 69 6F    ....       Actio
028830:  6E 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 73 6B    n:....       Ask
028840:  20 77 68 61 74 20 63 68 61 72 61 63 74 65 72 20     what character 
028850:  6F 72 20 74 6F 6B 65 6E 20 61 20 6B 65 79 20 77    or token a key w
028860:  69 6C 6C 20 62 65 20 74 72 61 6E 73 6C 61 74 65    ill be translate
028870:  64 20 74 6F 20 20 77 68 65 6E 20 20 6E 65 69 74    d to  when  neit
028880:  68 65 72 0D 0A 20 20 20 20 20 20 20 73 68 69 66    her..       shif
028890:  74 20 6E 6F 72 20 63 6F 6E 74 72 6F 6C 20 69 73    t nor control is
0288A0:  20 70 72 65 73 73 65 64 2E 0D 0A 0D 0A 20 20 20     pressed.....   
0288B0:  20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74        Entry condit
0288C0:  69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    ions:....       
0288D0:  41 20 63 6F 6E 74 61 69 6E 73 20 61 20 6B 65 79    A contains a key
0288E0:  20 6E 75 6D 62 65 72 0D 0A 0D 0A 20 20 20 20 20     number....     
0288F0:  20 20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E      Exit condition
028900:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20 63    s:....       A c
028910:  6F 6E 74 61 69 6E 73 20 74 68 65 20 63 75 72 72    ontains the curr
028920:  65 6E 74 20 74 72 61 6E 73 6C 61 74 69 6F 6E 2E    ent translation.
028930:  0D 0A 0D 0A 20 20 20 20 20 20 20 48 4C 20 61 6E    ....       HL an
028940:  64 20 66 6C 61 67 73 20 63 6F 72 72 75 70 74 2E    d flags corrupt.
028950:  0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F 74 68    ..       All oth
028960:  65 72 20 72 65 67 69 73 74 65 72 73 20 70 72 65    er registers pre
028970:  73 65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20 20 20    served.....     
028980:  20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 20 20 20 20      Notes:....    
028990:  20 20 20 54 68 65 20 6B 65 79 20 6E 75 6D 62 65       The key numbe
0289A0:  72 20 69 73 20 6E 6F 74 20 63 68 65 63 6B 65 64    r is not checked
0289B0:  2E 20 49 66 20 69 74 20 69 73 20 69 6E 76 61 6C    . If it is inval
0289C0:  69 64 20 28 67 72 65 61 74 65 72 20 74 68 61 6E    id (greater than
0289D0:  20 37 39 29 20 74 68 65 6E 0D 0A 20 20 20 20 20     79) then..     
0289E0:  20 20 74 68 65 20 74 72 61 6E 73 6C 61 74 69 6F      the translatio
0289F0:  6E 20 72 65 74 75 72 6E 65 64 20 69 73 20 6D 65    n returned is me
028A00:  61 6E 69 6E 67 6C 65 73 73 2E 0D 0A 0D 0A 20 20    aningless.....  
028A10:  20 20 20 20 20 4D 6F 73 74 20 76 61 6C 75 65 73         Most values
028A20:  20 69 6E 20 74 68 65 20 74 61 62 6C 65 20 61 72     in the table ar
028A30:  65 20 74 72 65 61 74 65 64 20 61 73 20 63 68 61    e treated as cha
028A40:  72 61 63 74 65 72 73 20 61 6E 64 20 61 72 65 20    racters and are 
028A50:  70 61 73 73 65 64 20 62 61 63 6B 0D 0A 20 20 20    passed back..   
028A60:  20 20 20 20 74 6F 20 74 68 65 20 75 73 65 72 2E        to the user.
028A70:  20 48 6F 77 65 76 65 72 2C 20 74 68 65 72 65 20     However, there 
028A80:  61 72 65 20 63 65 72 74 61 69 6E 20 73 70 65 63    are certain spec
028A90:  69 61 6C 20 76 61 6C 75 65 73 3A 0D 0A 0D 0A 20    ial values:.... 
028AA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                   #
028AB0:  38 30 2E 2E 23 39 46 20 20 61 72 65 20 20 74 68    80..#9F  are  th
028AC0:  65 20 20 65 78 70 61 6E 73 69 6F 6E 20 20 74 6F    e  expansion  to
028AD0:  6B 65 6E 73 20 20 61 6E 64 20 20 61 72 65 20 20    kens  and  are  
028AE0:  65 78 70 61 6E 64 65 64 20 20 74 6F 0D 0A 20 20    expanded  to..  
028AF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028B00:  20 20 20 20 20 20 20 20 63 68 61 72 61 63 74 65            characte
028B10:  72 20 73 74 72 69 6E 67 73 20 77 68 65 6E 20 4B    r strings when K
028B20:  4D 20 52 45 41 44 20 43 48 41 52 20 6F 72 20 4B    M READ CHAR or K
028B30:  4D 20 57 41 49 54 20 43 48 41 52 0D 0A 20 20 20    M WAIT CHAR..   
028B40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028B50:  20 20 20 20 20 20 20 69 73 20 63 61 6C 6C 65 64           is called
028B60:  20 61 6C 74 68 6F 75 67 68 20 74 68 65 79 20 61     although they a
028B70:  72 65 20 70 61 73 73 65 64 20 20 62 61 63 6B 20    re passed  back 
028B80:  20 6C 69 6B 65 20 20 61 6E 79 0D 0A 20 20 20 20     like  any..    
028B90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028BA0:  20 20 20 20 20 20 6F 74 68 65 72 20 63 68 61 72          other char
028BB0:  61 63 74 65 72 20 77 68 65 6E 20 4B 4D 20 52 45    acter when KM RE
028BC0:  41 44 20 4B 45 59 20 6F 72 20 4B 4D 20 54 45 53    AD KEY or KM TES
028BD0:  54 20 4B 45 59 20 20 69 73 0D 0A 20 20 20 20 20    T KEY  is..     
028BE0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028BF0:  20 20 20 20 20 63 61 6C 6C 65 64 2E 0D 0A 0D 0A         called.....
028C00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028C10:  23 46 44 20 20 20 20 20 20 20 69 73 20 74 68 65    #FD       is the
028C20:  20 63 61 70 73 20 6C 6F 63 6B 20 74 6F 6B 65 6E     caps lock token
028C30:  20 61 6E 64 20 63 61 75 73 65 73 20 74 68 65 20     and causes the 
028C40:  63 61 70 73 20 6C 6F 63 6B 20 20 74 6F 0D 0A 20    caps lock  to.. 
028C50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028C60:  20 20 20 20 20 20 20 20 20 74 6F 67 67 6C 65 20             toggle 
028C70:  28 74 75 72 6E 20 6F 6E 20 69 66 20 6F 66 66 20    (turn on if off 
028C80:  61 6E 64 20 76 69 63 65 20 76 65 72 73 61 29 2E    and vice versa).
028C90:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
028CA0:  20 20 20 20 23 46 45 20 20 20 20 20 20 20 69 73        #FE       is
028CB0:  20 74 68 65 20 73 68 69 66 74 20 6C 6F 63 6B 20     the shift lock 
028CC0:  74 6F 6B 65 6E 20 61 6E 64 20 63 61 75 73 65 73    token and causes
028CD0:  20 74 68 65 20 20 73 68 69 66 74 20 20 6C 6F 63     the  shift  loc
028CE0:  6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    k..             
028CF0:  20 20 20 20 20 20 20 20 20 20 20 20 20 74 6F 20                 to 
028D00:  74 6F 67 67 6C 65 20 28 74 75 72 6E 20 6F 6E 20    toggle (turn on 
028D10:  69 66 20 6F 66 66 20 61 6E 64 20 76 69 63 65 20    if off and vice 
028D20:  76 65 72 73 61 29 2E 0D 0A 0D 0A 20 20 20 20 20    versa).....     
028D30:  20 20 20 20 20 20 20 20 20 20 20 23 46 46 20 20               #FF  
028D40:  20 20 20 20 20 69 73 20 74 68 65 20 69 67 6E 6F         is the igno
028D50:  72 65 20 74 6F 6B 65 6E 20 61 6E 64 20 6D 65 61    re token and mea
028D60:  6E 73 20 20 74 68 65 20 20 6B 65 79 20 20 73 68    ns  the  key  sh
028D70:  6F 75 6C 64 20 20 62 65 0D 0A 20 20 20 20 20 20    ould  be..      
028D80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028D90:  20 20 20 20 74 68 72 6F 77 6E 20 61 77 61 79 2E        thrown away.
028DA0:  0D 0A 0D 0A 20 20 20 20 20 20 20 43 68 61 72 61    ....       Chara
028DB0:  63 74 65 72 73 20 23 45 30 2E 2E 23 46 43 20 68    cters #E0..#FC h
028DC0:  61 76 65 20 73 70 65 63 69 61 6C 20 6D 65 61 6E    ave special mean
028DD0:  69 6E 67 73 20 74 6F 20 20 74 68 65 20 20 42 41    ings to  the  BA
028DE0:  53 49 43 20 20 74 6F 20 20 64 6F 20 20 77 69 74    SIC  to  do  wit
028DF0:  68 0D 0A 20 20 20 20 20 20 20 65 64 69 74 69 6E    h..       editin
028E00:  67 2C 20 63 75 72 73 6F 72 69 6E 67 20 61 6E 64    g, cursoring and
028E10:  20 62 72 65 61 6B 73 2E 0D 0A 0D 0A 20 20 20 20     breaks.....    
028E20:  20 20 20 53 65 65 20 41 70 70 65 6E 64 69 78 20       See Appendix 
028E30:  49 49 20 66 6F 72 20 61 20 66 75 6C 6C 20 6C 69    II for a full li
028E40:  73 74 69 6E 67 20 6F 66 20 74 68 65 20 64 65 66    sting of the def
028E50:  61 75 6C 74 20 74 72 61 6E 73 6C 61 74 69 6F 6E    ault translation
028E60:  20 74 61 62 6C 65 73 2E 0D 0A 0D 0A 20 20 20 20     tables.....    
028E70:  20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72 69       Related entri
028E80:  65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D    es:....       KM
028E90:  20 47 45 54 20 43 4F 4E 54 52 4F 4C 0D 0A 20 20     GET CONTROL..  
028EA0:  20 20 20 20 20 4B 4D 20 47 45 54 20 53 48 49 46         KM GET SHIF
028EB0:  54 0D 0A 20 20 20 20 20 20 20 4B 4D 20 53 45 54    T..       KM SET
028EC0:  20 54 52 41 4E 53 4C 41 54 45 0D 0A 0D 0A 0D 0A     TRANSLATE......
028ED0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
028EE0:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
028EF0:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
028F00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028F10:  20 20 20 20 20 20 20 70 61 67 65 20 31 35 2E 31           page 15.1
028F20:  36 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    6.............. 
028F30:  20 20 20 20 20 20 31 35 3A 20 4B 4D 20 53 45 54          15: KM SET
028F40:  20 53 48 49 46 54 20 20 20 20 20 20 20 20 20 20     SHIFT          
028F50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028F60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
028F70:  20 20 20 20 20 20 20 23 42 42 32 44 0D 0A 0D 0A           #BB2D....
028F80:  20 20 20 20 20 20 20 53 65 74 20 65 6E 74 72 79           Set entry
028F90:  20 69 6E 20 73 68 69 66 74 65 64 20 6B 65 79 20     in shifted key 
028FA0:  74 72 61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C    translation tabl
028FB0:  65 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41 63 74    e.....       Act
028FC0:  69 6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 53    ion:....       S
028FD0:  65 74 20 77 68 61 74 20 63 68 61 72 61 63 74 65    et what characte
028FE0:  72 20 6F 72 20 74 6F 6B 65 6E 20 61 20 6B 65 79    r or token a key
028FF0:  20 77 69 6C 6C 20 62 65 20 74 72 61 6E 73 6C 61     will be transla
029000:  74 65 64 20 74 6F 20 20 77 68 65 6E 20 20 63 6F    ted to  when  co
029010:  6E 74 72 6F 6C 0D 0A 20 20 20 20 20 20 20 69 73    ntrol..       is
029020:  20 6E 6F 74 20 70 72 65 73 73 65 64 20 62 75 74     not pressed but
029030:  20 73 68 69 66 74 20 69 73 20 70 72 65 73 73 65     shift is presse
029040:  64 20 6F 72 20 73 68 69 66 74 20 6C 6F 63 6B 20    d or shift lock 
029050:  69 73 20 6F 6E 3A 0D 0A 0D 0A 20 20 20 20 20 20    is on:....      
029060:  20 45 6E 74 72 79 20 63 6F 6E 64 69 74 69 6F 6E     Entry condition
029070:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20 63    s:....       A c
029080:  6F 6E 74 61 69 6E 73 20 61 20 6B 65 79 20 6E 75    ontains a key nu
029090:  6D 62 65 72 2E 0D 0A 20 20 20 20 20 20 20 42 20    mber...       B 
0290A0:  63 6F 6E 74 61 69 6E 73 20 74 68 65 20 6E 65 77    contains the new
0290B0:  20 74 72 61 6E 73 6C 61 74 69 6F 6E 2E 0D 0A 0D     translation....
0290C0:  0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F 6E    .       Exit con
0290D0:  64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20    ditions:....    
0290E0:  20 20 20 41 46 20 61 6E 64 20 48 4C 20 63 6F 72       AF and HL cor
0290F0:  72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 41 6C    rupt...       Al
029100:  6C 20 6F 74 68 65 72 20 72 65 67 69 73 74 65 72    l other register
029110:  73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A    s preserved.....
029120:  20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D           Notes:...
029130:  0A 20 20 20 20 20 20 20 49 66 20 74 68 65 20 6B    .       If the k
029140:  65 79 20 6E 75 6D 62 65 72 20 69 73 20 69 6E 76    ey number is inv
029150:  61 6C 69 64 20 28 67 72 65 61 74 65 72 20 20 74    alid (greater  t
029160:  68 61 6E 20 20 37 39 29 20 20 74 68 65 6E 20 20    han  79)  then  
029170:  6E 6F 20 20 61 63 74 69 6F 6E 20 20 69 73 0D 0A    no  action  is..
029180:  20 20 20 20 20 20 20 74 61 6B 65 6E 2E 0D 0A 0D           taken....
029190:  0A 0D 0A 20 20 20 20 20 20 20 4D 6F 73 74 20 76    ...       Most v
0291A0:  61 6C 75 65 73 20 69 6E 20 74 68 65 20 74 61 62    alues in the tab
0291B0:  6C 65 20 61 72 65 20 74 72 65 61 74 65 64 20 61    le are treated a
0291C0:  73 20 63 68 61 72 61 63 74 65 72 73 20 61 6E 64    s characters and
0291D0:  20 61 72 65 20 70 61 73 73 65 64 20 62 61 63 6B     are passed back
0291E0:  0D 0A 20 20 20 20 20 20 20 74 6F 20 74 68 65 20    ..       to the 
0291F0:  75 73 65 72 2E 20 48 6F 77 65 76 65 72 2C 20 74    user. However, t
029200:  68 65 72 65 20 61 72 65 20 63 65 72 74 61 69 6E    here are certain
029210:  20 73 70 65 63 69 61 6C 20 76 61 6C 75 65 73 3A     special values:
029220:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
029230:  20 20 20 20 23 38 30 2E 2E 23 39 46 20 20 61 72        #80..#9F  ar
029240:  65 20 20 74 68 65 20 20 65 78 70 61 6E 73 69 6F    e  the  expansio
029250:  6E 20 20 74 6F 6B 65 6E 73 20 20 61 6E 64 20 20    n  tokens  and  
029260:  61 72 65 20 20 65 78 70 61 6E 64 65 64 20 20 74    are  expanded  t
029270:  6F 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    o..             
029280:  20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 61                 cha
029290:  72 61 63 74 65 72 20 73 74 72 69 6E 67 73 20 77    racter strings w
0292A0:  68 65 6E 20 4B 4D 20 52 45 41 44 20 43 48 41 52    hen KM READ CHAR
0292B0:  20 6F 72 20 4B 4D 20 57 41 49 54 20 43 48 41 52     or KM WAIT CHAR
0292C0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
0292D0:  20 20 20 20 20 20 20 20 20 20 20 20 69 73 20 63                is c
0292E0:  61 6C 6C 65 64 20 61 6C 74 68 6F 75 67 68 20 74    alled although t
0292F0:  68 65 79 20 61 72 65 20 70 61 73 73 65 64 20 20    hey are passed  
029300:  62 61 63 6B 20 20 6C 69 6B 65 20 20 61 6E 79 0D    back  like  any.
029310:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
029320:  20 20 20 20 20 20 20 20 20 20 20 6F 74 68 65 72               other
029330:  20 63 68 61 72 61 63 74 65 72 20 77 68 65 6E 20     character when 
029340:  4B 4D 20 52 45 41 44 20 4B 45 59 20 6F 72 20 4B    KM READ KEY or K
029350:  4D 20 54 45 53 54 20 4B 45 59 20 20 69 73 0D 0A    M TEST KEY  is..
029360:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029370:  20 20 20 20 20 20 20 20 20 20 63 61 6C 6C 65 64              called
029380:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20    .....           
029390:  20 20 20 20 20 23 46 44 20 20 20 20 20 20 20 69         #FD       i
0293A0:  73 20 74 68 65 20 63 61 70 73 20 6C 6F 63 6B 20    s the caps lock 
0293B0:  74 6F 6B 65 6E 20 61 6E 64 20 63 61 75 73 65 73    token and causes
0293C0:  20 74 68 65 20 63 61 70 73 20 6C 6F 63 6B 20 20     the caps lock  
0293D0:  74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    to..            
0293E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 6F                  to
0293F0:  67 67 6C 65 20 28 74 75 72 6E 20 6F 6E 20 69 66    ggle (turn on if
029400:  20 6F 66 66 20 61 6E 64 20 76 69 63 65 20 76 65     off and vice ve
029410:  72 73 61 29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    rsa).....       
029420:  20 20 20 20 20 20 20 20 20 23 46 45 20 20 20 20             #FE    
029430:  20 20 20 69 73 20 74 68 65 20 73 68 69 66 74 20       is the shift 
029440:  6C 6F 63 6B 20 74 6F 6B 65 6E 20 61 6E 64 20 63    lock token and c
029450:  61 75 73 65 73 20 74 68 65 20 20 73 68 69 66 74    auses the  shift
029460:  20 20 6C 6F 63 6B 0D 0A 20 20 20 20 20 20 20 20      lock..        
029470:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029480:  20 20 74 6F 20 74 6F 67 67 6C 65 20 28 74 75 72      to toggle (tur
029490:  6E 20 6F 6E 20 69 66 20 6F 66 66 20 61 6E 64 20    n on if off and 
0294A0:  76 69 63 65 20 76 65 72 73 61 29 2E 0D 0A 0D 0A    vice versa).....
0294B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0294C0:  23 46 46 20 20 20 20 20 20 20 69 73 20 74 68 65    #FF       is the
0294D0:  20 69 67 6E 6F 72 65 20 74 6F 6B 65 6E 20 61 6E     ignore token an
0294E0:  64 20 6D 65 61 6E 73 20 20 74 68 65 20 20 6B 65    d means  the  ke
0294F0:  79 20 20 73 68 6F 75 6C 64 20 20 62 65 0D 0A 20    y  should  be.. 
029500:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029510:  20 20 20 20 20 20 20 20 20 74 68 72 6F 77 6E 20             thrown 
029520:  61 77 61 79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20    away.....       
029530:  43 68 61 72 61 63 74 65 72 73 20 23 45 30 2E 2E    Characters #E0..
029540:  23 46 43 20 68 61 76 65 20 73 70 65 63 69 61 6C    #FC have special
029550:  20 6D 65 61 6E 69 6E 67 73 20 74 6F 20 20 74 68     meanings to  th
029560:  65 20 20 42 41 53 49 43 20 20 74 6F 20 20 64 6F    e  BASIC  to  do
029570:  20 20 77 69 74 68 0D 0A 20 20 20 20 20 20 20 65      with..       e
029580:  64 69 74 69 6E 67 2C 20 63 75 72 73 6F 72 69 6E    diting, cursorin
029590:  67 20 61 6E 64 20 62 72 65 61 6B 73 2E 0D 0A 0D    g and breaks....
0295A0:  0A 0D 0A 20 20 20 20 20 20 20 53 65 65 20 41 70    ...       See Ap
0295B0:  70 65 6E 64 69 78 20 49 49 20 66 6F 72 20 61 20    pendix II for a 
0295C0:  66 75 6C 6C 20 6C 69 73 74 69 6E 67 20 6F 66 20    full listing of 
0295D0:  74 68 65 20 64 65 66 61 75 6C 74 20 74 72 61 6E    the default tran
0295E0:  73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 73 2E 0D    slation tables..
0295F0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65 6C 61    .....       Rela
029600:  74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A    ted entries:....
029610:  0D 0A 20 20 20 20 20 20 20 4B 4D 20 47 45 54 20    ..       KM GET 
029620:  43 4F 4E 54 52 4F 4C 0D 0A 20 20 20 20 20 20 20    CONTROL..       
029630:  4B 4D 20 47 45 54 20 53 48 49 46 54 0D 0A 20 20    KM GET SHIFT..  
029640:  20 20 20 20 20 4B 4D 20 53 45 54 20 54 52 41 4E         KM SET TRAN
029650:  53 4C 41 54 45 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    SLATE........   
029660:  20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34        AMSTRAD CPC4
029670:  36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D    64/664/6128 FIRM
029680:  57 41 52 45 20 20 20 20 20 20 20 20 20 20 20 20    WARE            
029690:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0296A0:  70 61 67 65 20 31 35 2E 31 37 0D 0A 0D 0A 0D 0A    page 15.17......
0296B0:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31    ........       1
0296C0:  36 3A 20 4B 4D 20 47 45 54 20 53 48 49 46 54 20    6: KM GET SHIFT 
0296D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0296E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
0296F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029700:  23 42 42 33 30 0D 0A 0D 0A 20 20 20 20 20 20 20    #BB30....       
029710:  47 65 74 20 65 6E 74 72 79 20 66 72 6F 6D 20 73    Get entry from s
029720:  68 69 66 74 65 64 20 6B 65 79 20 74 72 61 6E 73    hifted key trans
029730:  6C 61 74 69 6F 6E 20 74 61 62 6C 65 2E 0D 0A 0D    lation table....
029740:  0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D    .       Action:.
029750:  0A 0D 0A 20 20 20 20 20 20 20 41 73 6B 20 77 68    ...       Ask wh
029760:  61 74 20 63 68 61 72 61 63 74 65 72 20 6F 72 20    at character or 
029770:  74 6F 6B 65 6E 20 61 20 6B 65 79 20 77 69 6C 6C    token a key will
029780:  20 62 65 20 74 72 61 6E 73 6C 61 74 65 64 20 74     be translated t
029790:  6F 20 20 77 68 65 6E 20 20 63 6F 6E 74 72 6F 6C    o  when  control
0297A0:  0D 0A 20 20 20 20 20 20 20 69 73 20 6E 6F 74 20    ..       is not 
0297B0:  70 72 65 73 73 65 64 20 62 75 74 20 73 68 69 66    pressed but shif
0297C0:  74 20 69 73 20 70 72 65 73 73 65 64 20 6F 72 20    t is pressed or 
0297D0:  73 68 69 66 74 20 6C 6F 63 6B 20 69 73 20 6F 6E    shift lock is on
0297E0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72    .....       Entr
0297F0:  79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    y conditions:...
029800:  0A 20 20 20 20 20 20 20 41 20 63 6F 6E 74 61 69    .       A contai
029810:  6E 73 20 61 20 6B 65 79 20 6E 75 6D 62 65 72 2E    ns a key number.
029820:  0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69 74 20    ....       Exit 
029830:  63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20    conditions:.... 
029840:  20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73          A contains
029850:  20 74 68 65 20 63 75 72 72 65 6E 74 20 74 72 61     the current tra
029860:  6E 73 6C 61 74 69 6F 6E 2E 0D 0A 0D 0A 20 20 20    nslation.....   
029870:  20 20 20 20 48 4C 20 61 6E 64 20 66 6C 61 67 73        HL and flags
029880:  20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20     corrupt...     
029890:  20 20 41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69      All other regi
0298A0:  73 74 65 72 73 20 70 72 65 73 65 72 76 65 64 2E    sters preserved.
0298B0:  0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73    ....       Notes
0298C0:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    :....       The 
0298D0:  6B 65 79 20 6E 75 6D 62 65 72 20 69 73 20 6E 6F    key number is no
0298E0:  74 20 63 68 65 63 6B 65 64 2E 20 49 66 20 69 74    t checked. If it
0298F0:  20 69 73 20 69 6E 76 61 6C 69 64 20 28 67 72 65     is invalid (gre
029900:  61 74 65 72 20 74 68 61 6E 20 37 39 29 20 74 68    ater than 79) th
029910:  65 6E 0D 0A 20 20 20 20 20 20 20 74 68 65 20 74    en..       the t
029920:  72 61 6E 73 6C 61 74 69 6F 6E 20 72 65 74 75 72    ranslation retur
029930:  6E 65 64 20 69 73 20 6D 65 61 6E 69 6E 67 6C 65    ned is meaningle
029940:  73 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4D 6F    ss.....       Mo
029950:  73 74 20 76 61 6C 75 65 73 20 69 6E 20 74 68 65    st values in the
029960:  20 74 61 62 6C 65 20 61 72 65 20 74 72 65 61 74     table are treat
029970:  65 64 20 61 73 20 63 68 61 72 61 63 74 65 72 73    ed as characters
029980:  20 61 6E 64 20 61 72 65 20 70 61 73 73 65 64 20     and are passed 
029990:  62 61 63 6B 0D 0A 20 20 20 20 20 20 20 74 6F 20    back..       to 
0299A0:  74 68 65 20 75 73 65 72 2E 20 48 6F 77 65 76 65    the user. Howeve
0299B0:  72 2C 20 74 68 65 72 65 20 61 72 65 20 63 65 72    r, there are cer
0299C0:  74 61 69 6E 20 73 70 65 63 69 61 6C 20 76 61 6C    tain special val
0299D0:  75 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20    ues:....        
0299E0:  20 20 20 20 20 20 20 20 23 38 30 2E 2E 23 39 46            #80..#9F
0299F0:  20 20 61 72 65 20 20 74 68 65 20 20 65 78 70 61      are  the  expa
029A00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
029A10:  23 00 00 00 02 09 50 E5 23 00 C1 02 00 00 00 02    #.....P.#.......
029A20:  23 00 C2 02 00 00 00 02 23 00 C3 02 00 00 00 02    #.......#.......
029A30:  23 00 C4 02 00 00 00 02 23 00 C5 02 00 00 00 02    #.......#.......
029A40:  23 00 C6 02 00 00 00 02 23 00 C7 02 00 00 00 02    #.......#.......
029A50:  23 00 C8 02 00 00 00 02 23 00 C9 02 00 00 00 02    #.......#.......
029A60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029A70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029A80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029A90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029AF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
029B00:  6E 73 69 6F 6E 20 20 74 6F 6B 65 6E 73 20 20 61    nsion  tokens  a
029B10:  6E 64 20 20 61 72 65 20 20 65 78 70 61 6E 64 65    nd  are  expande
029B20:  64 20 20 74 6F 0D 0A 0D 0A 20 20 20 20 20 20 20    d  to....       
029B30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029B40:  20 20 20 63 68 61 72 61 63 74 65 72 20 73 74 72       character str
029B50:  69 6E 67 73 20 77 68 65 6E 20 4B 4D 20 52 45 41    ings when KM REA
029B60:  44 20 43 48 41 52 20 6F 72 20 4B 4D 20 57 41 49    D CHAR or KM WAI
029B70:  54 20 43 48 41 52 0D 0A 20 20 20 20 20 20 20 20    T CHAR..        
029B80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029B90:  20 20 69 73 20 63 61 6C 6C 65 64 20 61 6C 74 68      is called alth
029BA0:  6F 75 67 68 20 74 68 65 79 20 61 72 65 20 70 61    ough they are pa
029BB0:  73 73 65 64 20 20 62 61 63 6B 20 20 6C 69 6B 65    ssed  back  like
029BC0:  20 20 61 6E 79 0D 0A 20 20 20 20 20 20 20 20 20      any..         
029BD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029BE0:  20 6F 74 68 65 72 20 63 68 61 72 61 63 74 65 72     other character
029BF0:  20 77 68 65 6E 20 4B 4D 20 52 45 41 44 20 4B 45     when KM READ KE
029C00:  59 20 6F 72 20 4B 4D 20 54 45 53 54 20 4B 45 59    Y or KM TEST KEY
029C10:  20 20 69 73 0D 0A 20 20 20 20 20 20 20 20 20 20      is..          
029C20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029C30:  63 61 6C 6C 65 64 2E 0D 0A 0D 0A 20 20 20 20 20    called.....     
029C40:  20 20 20 20 20 20 20 20 20 20 20 23 46 44 20 20               #FD  
029C50:  20 20 20 20 20 69 73 20 74 68 65 20 63 61 70 73         is the caps
029C60:  20 6C 6F 63 6B 20 74 6F 6B 65 6E 20 61 6E 64 20     lock token and 
029C70:  63 61 75 73 65 73 20 74 68 65 20 63 61 70 73 20    causes the caps 
029C80:  6C 6F 63 6B 20 20 74 6F 0D 0A 20 20 20 20 20 20    lock  to..      
029C90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029CA0:  20 20 20 20 74 6F 67 67 6C 65 20 28 74 75 72 6E        toggle (turn
029CB0:  20 6F 6E 20 69 66 20 6F 66 66 20 61 6E 64 20 76     on if off and v
029CC0:  69 63 65 20 76 65 72 73 61 29 2E 0D 0A 0D 0A 20    ice versa)..... 
029CD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                   #
029CE0:  46 45 20 20 20 20 20 20 20 69 73 20 74 68 65 20    FE       is the 
029CF0:  73 68 69 66 74 20 6C 6F 63 6B 20 74 6F 6B 65 6E    shift lock token
029D00:  20 61 6E 64 20 63 61 75 73 65 73 20 74 68 65 20     and causes the 
029D10:  20 73 68 69 66 74 20 20 6C 6F 63 6B 0D 0A 20 20     shift  lock..  
029D20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029D30:  20 20 20 20 20 20 20 20 74 6F 20 74 6F 67 67 6C            to toggl
029D40:  65 20 28 74 75 72 6E 20 6F 6E 20 69 66 20 6F 66    e (turn on if of
029D50:  66 20 61 6E 64 20 76 69 63 65 20 76 65 72 73 61    f and vice versa
029D60:  29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ).....          
029D70:  20 20 20 20 20 20 23 46 46 20 20 20 20 20 20 20          #FF       
029D80:  69 73 20 74 68 65 20 69 67 6E 6F 72 65 20 74 6F    is the ignore to
029D90:  6B 65 6E 20 61 6E 64 20 6D 65 61 6E 73 20 20 74    ken and means  t
029DA0:  68 65 20 20 6B 65 79 20 20 73 68 6F 75 6C 64 20    he  key  should 
029DB0:  20 62 65 0D 0A 20 20 20 20 20 20 20 20 20 20 20     be..           
029DC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74                   t
029DD0:  68 72 6F 77 6E 20 61 77 61 79 2E 0D 0A 0D 0A 20    hrown away..... 
029DE0:  20 20 20 20 20 20 43 68 61 72 61 63 74 65 72 73          Characters
029DF0:  20 23 45 30 2E 2E 23 46 43 20 68 61 76 65 20 73     #E0..#FC have s
029E00:  70 65 63 69 61 6C 20 6D 65 61 6E 69 6E 67 73 20    pecial meanings 
029E10:  74 6F 20 20 74 68 65 20 20 42 41 53 49 43 20 20    to  the  BASIC  
029E20:  74 6F 20 20 64 6F 20 20 77 69 74 68 0D 0A 20 20    to  do  with..  
029E30:  20 20 20 20 20 65 64 69 74 69 6E 67 2C 20 63 75         editing, cu
029E40:  72 73 6F 72 69 6E 67 20 61 6E 64 20 62 72 65 61    rsoring and brea
029E50:  6B 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65    ks.....       Se
029E60:  65 20 41 70 70 65 6E 64 69 78 20 49 49 20 66 6F    e Appendix II fo
029E70:  72 20 61 20 66 75 6C 6C 20 6C 69 73 74 69 6E 67    r a full listing
029E80:  20 6F 66 20 74 68 65 20 64 65 66 61 75 6C 74 20     of the default 
029E90:  74 72 61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C    translation tabl
029EA0:  65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65    es.....       Re
029EB0:  6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A    lated entries:..
029EC0:  0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 47 45    ....       KM GE
029ED0:  54 20 43 4F 4E 54 52 4F 4C 0D 0A 20 20 20 20 20    T CONTROL..     
029EE0:  20 20 4B 4D 20 47 45 54 20 53 48 49 46 54 0D 0A      KM GET SHIFT..
029EF0:  20 20 20 20 20 20 20 4B 4D 20 53 45 54 20 54 52           KM SET TR
029F00:  41 4E 53 4C 41 54 45 0D 0A 0D 0A 0D 0A 0D 0A 0D    ANSLATE.........
029F10:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
029F20:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
029F30:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
029F40:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029F50:  20 20 20 20 70 61 67 65 20 31 35 2E 31 38 0D 0A        page 15.18..
029F60:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
029F70:  20 20 20 31 37 3A 20 4B 4D 20 53 45 54 20 43 4F       17: KM SET CO
029F80:  4E 54 52 4F 4C 20 20 20 20 20 20 20 20 20 20 20    NTROL           
029F90:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029FA0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
029FB0:  20 20 20 20 23 42 42 33 33 0D 0A 0D 0A 20 20 20        #BB33....   
029FC0:  20 20 20 20 53 65 74 20 65 6E 74 72 79 20 69 6E        Set entry in
029FD0:  20 63 6F 6E 74 72 6F 6C 20 6B 65 79 20 74 72 61     control key tra
029FE0:  6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 2E 0D    nslation table..
029FF0:  0A 0D 0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E    ...       Action
02A000:  3A 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65 74 20    :....       Set 
02A010:  61 20 63 68 61 72 61 63 74 65 72 20 6F 72 20 74    a character or t
02A020:  6F 6B 65 6E 20 61 20 6B 65 79 20 77 69 6C 6C 20    oken a key will 
02A030:  62 65 20 74 72 61 6E 73 6C 61 74 65 64 20 74 6F    be translated to
02A040:  20 77 68 65 6E 20 20 63 6F 6E 74 72 6F 6C 20 20     when  control  
02A050:  69 73 0D 0A 20 20 20 20 20 20 20 70 72 65 73 73    is..       press
02A060:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E    ed.....       En
02A070:  74 72 79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D    try conditions:.
02A080:  0A 0D 0A 20 20 20 20 20 20 20 41 20 63 6F 6E 74    ...       A cont
02A090:  61 69 6E 73 20 61 20 6B 65 79 20 6E 75 6D 62 65    ains a key numbe
02A0A0:  72 2E 0D 0A 20 20 20 20 20 20 20 42 20 63 6F 6E    r...       B con
02A0B0:  74 61 69 6E 73 20 74 68 65 20 6E 65 77 20 74 72    tains the new tr
02A0C0:  61 6E 73 6C 61 74 69 6F 6E 2E 0D 0A 0D 0A 20 20    anslation.....  
02A0D0:  20 20 20 20 20 45 78 69 74 20 63 6F 6E 64 69 74         Exit condit
02A0E0:  69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    ions:....       
02A0F0:  41 46 20 61 6E 64 20 48 4C 20 63 6F 72 72 75 70    AF and HL corrup
02A100:  74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F    t...       All o
02A110:  74 68 65 72 20 72 65 67 69 73 74 65 72 73 20 70    ther registers p
02A120:  72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20    reserved.....   
02A130:  20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 20 20        Notes:....  
02A140:  20 20 20 20 20 49 66 20 74 68 65 20 6B 65 79 20         If the key 
02A150:  6E 75 6D 62 65 72 20 69 73 20 69 6E 76 61 6C 69    number is invali
02A160:  64 20 28 67 72 65 61 74 65 72 20 20 74 68 61 6E    d (greater  than
02A170:  20 20 37 39 29 20 20 74 68 65 6E 20 20 6E 6F 20      79)  then  no 
02A180:  20 61 63 74 69 6F 6E 20 20 69 73 0D 0A 20 20 20     action  is..   
02A190:  20 20 20 20 74 61 6B 65 6E 2E 0D 0A 0D 0A 20 20        taken.....  
02A1A0:  20 20 20 20 20 4D 6F 73 74 20 76 61 6C 75 65 73         Most values
02A1B0:  20 69 6E 20 74 68 65 20 74 61 62 6C 65 20 61 72     in the table ar
02A1C0:  65 20 74 72 65 61 74 65 64 20 61 73 20 63 68 61    e treated as cha
02A1D0:  72 61 63 74 65 72 73 20 61 6E 64 20 61 72 65 20    racters and are 
02A1E0:  70 61 73 73 65 64 20 62 61 63 6B 0D 0A 20 20 20    passed back..   
02A1F0:  20 20 20 20 74 6F 20 74 68 65 20 75 73 65 72 2E        to the user.
02A200:  20 48 6F 77 65 76 65 72 2C 20 74 68 65 72 65 20     However, there 
02A210:  61 72 65 20 63 65 72 74 61 69 6E 20 73 70 65 63    are certain spec
02A220:  69 61 6C 20 76 61 6C 75 65 73 3A 0D 0A 0D 0A 20    ial values:.... 
02A230:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                   #
02A240:  38 30 2E 2E 23 39 46 20 20 61 72 65 20 20 74 68    80..#9F  are  th
02A250:  65 20 20 65 78 70 61 6E 73 69 6F 6E 20 20 74 6F    e  expansion  to
02A260:  6B 65 6E 73 20 20 61 6E 64 20 20 61 72 65 20 20    kens  and  are  
02A270:  65 78 70 61 6E 64 65 64 20 20 74 6F 0D 0A 20 20    expanded  to..  
02A280:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A290:  20 20 20 20 20 20 20 20 63 68 61 72 61 63 74 65            characte
02A2A0:  72 20 73 74 72 69 6E 67 73 20 77 68 65 6E 20 4B    r strings when K
02A2B0:  4D 20 52 45 41 44 20 43 48 41 52 20 6F 72 20 4B    M READ CHAR or K
02A2C0:  4D 20 57 41 49 54 20 43 48 41 52 0D 0A 20 20 20    M WAIT CHAR..   
02A2D0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A2E0:  20 20 20 20 20 20 20 69 73 20 63 61 6C 6C 65 64           is called
02A2F0:  20 61 6C 74 68 6F 75 67 68 20 74 68 65 79 20 61     although they a
02A300:  72 65 20 70 61 73 73 65 64 20 20 62 61 63 6B 20    re passed  back 
02A310:  20 6C 69 6B 65 20 20 61 6E 79 0D 0A 20 20 20 20     like  any..    
02A320:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A330:  20 20 20 20 20 20 6F 74 68 65 72 20 63 68 61 72          other char
02A340:  61 63 74 65 72 20 77 68 65 6E 20 4B 4D 20 52 45    acter when KM RE
02A350:  41 44 20 4B 45 59 20 6F 72 20 4B 4D 20 54 45 53    AD KEY or KM TES
02A360:  54 20 4B 45 59 20 20 69 73 0D 0A 20 20 20 20 20    T KEY  is..     
02A370:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A380:  20 20 20 20 20 63 61 6C 6C 65 64 2E 0D 0A 0D 0A         called.....
02A390:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
02A3A0:  20 20 23 46 44 20 20 20 20 20 20 20 69 73 20 74      #FD       is t
02A3B0:  68 65 20 63 61 70 73 20 6C 6F 63 6B 20 74 6F 6B    he caps lock tok
02A3C0:  65 6E 20 61 6E 64 20 63 61 75 73 65 73 20 74 68    en and causes th
02A3D0:  65 20 63 61 70 73 20 6C 6F 63 6B 20 20 74 6F 0D    e caps lock  to.
02A3E0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
02A3F0:  20 20 20 20 20 20 20 20 20 20 20 74 6F 67 67 6C               toggl
02A400:  65 20 28 74 75 72 6E 20 6F 6E 20 69 66 20 6F 66    e (turn on if of
02A410:  66 20 61 6E 64 20 76 69 63 65 20 76 65 72 73 61    f and vice versa
02A420:  29 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ).....          
02A430:  20 20 20 20 20 20 23 46 45 20 20 20 20 20 20 20          #FE       
02A440:  69 73 20 74 68 65 20 73 68 69 66 74 20 6C 6F 63    is the shift loc
02A450:  6B 20 74 6F 6B 65 6E 20 61 6E 64 20 63 61 75 73    k token and caus
02A460:  65 73 20 74 68 65 20 20 73 68 69 66 74 20 20 6C    es the  shift  l
02A470:  6F 63 6B 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ock..           
02A480:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74                   t
02A490:  6F 20 74 6F 67 67 6C 65 20 28 74 75 72 6E 20 6F    o toggle (turn o
02A4A0:  6E 20 69 66 20 6F 66 66 20 61 6E 64 20 76 69 63    n if off and vic
02A4B0:  65 20 76 65 72 73 61 29 2E 0D 0A 0D 0A 20 20 20    e versa).....   
02A4C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 23 46 46                 #FF
02A4D0:  20 20 20 20 20 20 20 69 73 20 74 68 65 20 69 67           is the ig
02A4E0:  6E 6F 72 65 20 74 6F 6B 65 6E 20 61 6E 64 20 6D    nore token and m
02A4F0:  65 61 6E 73 20 20 74 68 65 20 20 6B 65 79 20 20    eans  the  key  
02A500:  73 68 6F 75 6C 64 20 20 62 65 0D 0A 20 20 20 20    should  be..    
02A510:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A520:  20 20 20 20 20 20 74 68 72 6F 77 6E 20 61 77 61          thrown awa
02A530:  79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 43 68 61    y.....       Cha
02A540:  72 61 63 74 65 72 73 20 23 45 30 2E 2E 23 46 43    racters #E0..#FC
02A550:  20 68 61 76 65 20 73 70 65 63 69 61 6C 20 6D 65     have special me
02A560:  61 6E 69 6E 67 73 20 74 6F 20 20 74 68 65 20 20    anings to  the  
02A570:  42 41 53 49 43 20 20 74 6F 20 20 64 6F 20 20 77    BASIC  to  do  w
02A580:  69 74 68 0D 0A 20 20 20 20 20 20 20 65 64 69 74    ith..       edit
02A590:  69 6E 67 2C 20 63 75 72 73 6F 72 69 6E 67 20 61    ing, cursoring a
02A5A0:  6E 64 20 62 72 65 61 6B 73 2E 0D 0A 0D 0A 20 20    nd breaks.....  
02A5B0:  20 20 20 20 20 53 65 65 20 41 70 70 65 6E 64 69         See Appendi
02A5C0:  78 20 49 49 20 66 6F 72 20 61 20 66 75 6C 6C 20    x II for a full 
02A5D0:  6C 69 73 74 69 6E 67 20 6F 66 20 74 68 65 20 64    listing of the d
02A5E0:  65 66 61 75 6C 74 20 74 72 61 6E 73 6C 61 74 69    efault translati
02A5F0:  6F 6E 20 74 61 62 6C 65 73 2E 0D 0A 0D 0A 0D 0A    on tables.......
02A600:  20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20 65           Related e
02A610:  6E 74 72 69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20    ntries:....     
02A620:  20 20 4B 4D 20 47 45 54 20 43 4F 4E 54 52 4F 4C      KM GET CONTROL
02A630:  0D 0A 20 20 20 20 20 20 20 4B 4D 20 47 45 54 20    ..       KM GET 
02A640:  53 48 49 46 54 0D 0A 20 20 20 20 20 20 20 4B 4D    SHIFT..       KM
02A650:  20 53 45 54 20 54 52 41 4E 53 4C 41 54 45 0D 0A     SET TRANSLATE..
02A660:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ..........      
02A670:  20 41 4D 53 54 52 41 44 20 43 50 43 34 36 34 2F     AMSTRAD CPC464/
02A680:  36 36 34 2F 36 31 32 38 20 46 49 52 4D 57 41 52    664/6128 FIRMWAR
02A690:  45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    E               
02A6A0:  20 20 20 20 20 20 20 20 20 20 20 20 20 70 61 67                 pag
02A6B0:  65 20 31 35 2E 31 39 0D 0A 0D 0A 0D 0A 0D 0A 0D    e 15.19.........
02A6C0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 31 38 3A 20    .....       18: 
02A6D0:  4B 4D 20 47 45 54 20 43 4F 4E 54 52 4F 4C 20 20    KM GET CONTROL  
02A6E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A6F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02A700:  20 20 20 20 20 20 20 20 20 20 20 20 20 23 42 42                 #BB
02A710:  33 36 0D 0A 0D 0A 20 20 20 20 20 20 20 47 65 74    36....       Get
02A720:  20 65 6E 74 72 79 20 66 72 6F 6D 20 63 6F 6E 74     entry from cont
02A730:  72 6F 6C 20 6B 65 79 20 74 72 61 6E 73 6C 61 74    rol key translat
02A740:  69 6F 6E 20 74 61 62 6C 65 2E 0D 0A 0D 0A 20 20    ion table.....  
02A750:  20 20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A         Action:....
02A760:  20 20 20 20 20 20 20 41 73 6B 20 77 68 61 74 20           Ask what 
02A770:  61 20 63 68 61 72 61 63 74 65 72 20 6F 72 20 74    a character or t
02A780:  6F 6B 65 6E 20 61 20 6B 65 79 20 77 69 6C 6C 20    oken a key will 
02A790:  62 65 20 74 72 61 6E 73 6C 61 74 65 64 20 74 6F    be translated to
02A7A0:  20 77 68 65 6E 20 63 6F 6E 74 72 6F 6C 0D 0A 20     when control.. 
02A7B0:  20 20 20 20 20 20 69 73 20 70 72 65 73 73 65 64          is pressed
02A7C0:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72    .....       Entr
02A7D0:  79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    y conditions:...
02A7E0:  0A 20 20 20 20 20 20 20 41 20 63 6F 6E 74 61 69    .       A contai
02A7F0:  6E 73 20 61 20 6B 65 79 20 6E 75 6D 62 65 72 2E    ns a key number.
02A800:  0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69 74 20    ....       Exit 
02A810:  63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20    conditions:.... 
02A820:  20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E 73          A contains
02A830:  20 74 68 65 20 63 75 72 72 65 6E 74 20 74 72 61     the current tra
02A840:  6E 73 6C 61 74 69 6F 6E 2E 0D 0A 20 20 20 20 20    nslation...     
02A850:  20 20 48 4C 20 61 6E 64 20 66 6C 61 67 73 20 63      HL and flags c
02A860:  6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20    orrupt...       
02A870:  41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73 74    All other regist
02A880:  65 72 73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A    ers preserved...
02A890:  0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D    ..       Notes:.
02A8A0:  0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 6B 65    ...       The ke
02A8B0:  79 20 6E 75 6D 62 65 72 20 69 73 20 6E 6F 74 20    y number is not 
02A8C0:  63 68 65 63 6B 65 64 2E 20 49 66 20 69 74 20 69    checked. If it i
02A8D0:  73 20 69 6E 76 61 6C 69 64 20 28 67 72 65 61 74    s invalid (great
02A8E0:  65 72 20 74 68 61 6E 20 37 39 29 20 74 68 65 6E    er than 79) then
02A8F0:  0D 0A 20 20 20 20 20 20 20 74 68 65 20 74 72 61    ..       the tra
02A900:  6E 73 6C 61 74 69 6F 6E 20 72 65 74 75 72 6E 65    nslation returne
02A910:  64 20 69 73 20 6D 65 61 6E 69 6E 67 6C 65 73 73    d is meaningless
02A920:  2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4D 6F 73 74    .....       Most
02A930:  20 76 61 6C 75 65 73 20 69 6E 20 74 68 65 20 74     values in the t
02A940:  61 62 6C 65 20 61 72 65 20 74 72 65 61 74 65 64    able are treated
02A950:  20 61 73 20 63 68 61 72 61 63 74 65 72 73 20 61     as characters a
02A960:  6E 64 20 61 72 65 20 70 61 73 73 65 64 20 62 61    nd are passed ba
02A970:  63 6B 0D 0A 20 20 20 20 20 20 20 74 6F 20 74 68    ck..       to th
02A980:  65 20 75 73 65 72 2E 20 48 6F 77 65 76 65 72 2C    e user. However,
02A990:  20 74 68 65 72 65 20 61 72 65 20 63 65 72 74 61     there are certa
02A9A0:  69 6E 20 73 70 65 63 69 61 6C 20 76 61 6C 75 65    in special value
02A9B0:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    s:....          
02A9C0:  20 20 20 20 20 20 23 38 30 2E 2E 23 39 46 20 20          #80..#9F  
02A9D0:  61 72 65 20 20 74 68 65 20 20 65 78 70 61 6E 73    are  the  expans
02A9E0:  69 6F 6E 20 20 74 6F 6B 65 6E 73 20 20 61 6E 64    ion  tokens  and
02A9F0:  20 20 61 72 65 20 20 65 78 70 61 6E 64 65 64 20      are  expanded 
02AA00:  20 74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20 20     to..           
02AA10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63                   c
02AA20:  68 61 72 61 63 74 65 72 20 73 74 72 69 6E 67 73    haracter strings
02AA30:  20 77 68 65 6E 20 4B 4D 20 52 45 41 44 20 43 48     when KM READ CH
02AA40:  41 52 20 6F 72 20 4B 4D 20 57 41 49 54 20 43 48    AR or KM WAIT CH
02AA50:  41 52 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    AR..            
02AA60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73                  is
02AA70:  20 63 61 6C 6C 65 64 20 61 6C 74 68 6F 75 67 68     called although
02AA80:  20 74 68 65 79 20 61 72 65 20 70 61 73 73 65 64     they are passed
02AA90:  20 20 62 61 63 6B 20 20 6C 69 6B 65 20 20 61 6E      back  like  an
02AAA0:  79 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    y..             
02AAB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 6F 74 68                 oth
02AAC0:  65 72 20 63 68 61 72 61 63 74 65 72 20 77 68 65    er character whe
02AAD0:  6E 20 4B 4D 20 52 45 41 44 20 4B 45 59 20 6F 72    n KM READ KEY or
02AAE0:  20 4B 4D 20 54 45 53 54 20 4B 45 59 20 20 69 73     KM TEST KEY  is
02AAF0:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
02AB00:  20 20 20 20 20 20 20 20 20 20 20 20 63 61 6C 6C                call
02AB10:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    ed.....         
02AB20:  20 20 20 20 20 20 20 23 46 44 20 20 20 20 20 20           #FD      
02AB30:  20 69 73 20 74 68 65 20 63 61 70 73 20 6C 6F 63     is the caps loc
02AB40:  6B 20 74 6F 6B 65 6E 20 61 6E 64 20 63 61 75 73    k token and caus
02AB50:  65 73 20 74 68 65 20 63 61 70 73 20 6C 6F 63 6B    es the caps lock
02AB60:  20 20 74 6F 0D 0A 20 20 20 20 20 20 20 20 20 20      to..          
02AB70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02AB80:  74 6F 67 67 6C 65 20 28 74 75 72 6E 20 6F 6E 20    toggle (turn on 
02AB90:  69 66 20 6F 66 66 20 61 6E 64 20 76 69 63 65 20    if off and vice 
02ABA0:  76 65 72 73 61 29 2E 0D 0A 0D 0A 20 20 20 20 20    versa).....     
02ABB0:  20 20 20 20 20 20 20 20 20 20 20 23 46 45 20 20               #FE  
02ABC0:  20 20 20 20 20 69 73 20 74 68 65 20 73 68 69 66         is the shif
02ABD0:  74 20 6C 6F 63 6B 20 74 6F 6B 65 6E 20 61 6E 64    t lock token and
02ABE0:  20 63 61 75 73 65 73 20 74 68 65 20 20 73 68 69     causes the  shi
02ABF0:  66 74 20 20 6C 6F 63 6B 0D 0A 20 20 20 20 20 20    ft  lock..      
02AC00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02AC10:  20 20 20 20 74 6F 20 74 6F 67 67 6C 65 20 28 74        to toggle (t
02AC20:  75 72 6E 20 6F 6E 20 69 66 20 6F 66 66 20 61 6E    urn on if off an
02AC30:  64 20 76 69 63 65 20 76 65 72 73 61 29 2E 0D 0A    d vice versa)...
02AC40:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
02AC50:  20 20 23 46 46 20 20 20 20 20 20 20 69 73 20 74      #FF       is t
02AC60:  68 65 20 69 67 6E 6F 72 65 20 74 6F 6B 65 6E 20    he ignore token 
02AC70:  61 6E 64 20 6D 65 61 6E 73 20 20 74 68 65 20 20    and means  the  
02AC80:  6B 65 79 20 20 73 68 6F 75 6C 64 20 20 62 65 0D    key  should  be.
02AC90:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
02ACA0:  20 20 20 20 20 20 20 20 20 20 20 74 68 72 6F 77               throw
02ACB0:  6E 20 61 77 61 79 2E 0D 0A 0D 0A 20 20 20 20 20    n away.....     
02ACC0:  20 20 43 68 61 72 61 63 74 65 72 73 20 23 45 30      Characters #E0
02ACD0:  2E 2E 23 46 43 20 68 61 76 65 20 73 70 65 63 69    ..#FC have speci
02ACE0:  61 6C 20 6D 65 61 6E 69 6E 67 73 20 74 6F 20 20    al meanings to  
02ACF0:  74 68 65 20 20 42 41 53 49 43 20 20 74 6F 20 20    the  BASIC  to  
02AD00:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
02AD10:  24 00 00 00 02 09 50 E5 24 00 C1 02 00 00 00 02    $.....P.$.......
02AD20:  24 00 C2 02 00 00 00 02 24 00 C3 02 00 00 00 02    $.......$.......
02AD30:  24 00 C4 02 00 00 00 02 24 00 C5 02 00 00 00 02    $.......$.......
02AD40:  24 00 C6 02 00 00 00 02 24 00 C7 02 00 00 00 02    $.......$.......
02AD50:  24 00 C8 02 00 00 00 02 24 00 C9 02 00 00 00 02    $.......$.......
02AD60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02AD70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02AD80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02AD90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADA0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADB0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADC0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADD0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADE0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02ADF0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02AE00:  64 6F 20 20 77 69 74 68 0D 0A 20 20 20 20 20 20    do  with..      
02AE10:  20 65 64 69 74 69 6E 67 2C 20 63 75 72 73 6F 72     editing, cursor
02AE20:  69 6E 67 20 61 6E 64 20 62 72 65 61 6B 73 2E 0D    ing and breaks..
02AE30:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 53 65 65 20    .....       See 
02AE40:  41 70 70 65 6E 64 69 78 20 49 49 20 66 6F 72 20    Appendix II for 
02AE50:  61 20 66 75 6C 6C 20 6C 69 73 74 69 6E 67 20 6F    a full listing o
02AE60:  66 20 74 68 65 20 64 65 66 61 75 6C 74 20 74 72    f the default tr
02AE70:  61 6E 73 6C 61 74 69 6F 6E 20 74 61 62 6C 65 73    anslation tables
02AE80:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65    .......       Re
02AE90:  6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A    lated entries:..
02AEA0:  0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 47 45    ....       KM GE
02AEB0:  54 20 43 4F 4E 54 52 4F 4C 0D 0A 20 20 20 20 20    T CONTROL..     
02AEC0:  20 20 4B 4D 20 47 45 54 20 53 48 49 46 54 0D 0A      KM GET SHIFT..
02AED0:  20 20 20 20 20 20 20 4B 4D 20 53 45 54 20 54 52           KM SET TR
02AEE0:  41 4E 53 4C 41 54 45 0D 0A 0D 0A 0D 0A 0D 0A 0D    ANSLATE.........
02AEF0:  0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44 20    .       AMSTRAD 
02AF00:  43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38 20    CPC464/664/6128 
02AF10:  46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20 20    FIRMWARE        
02AF20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02AF30:  20 20 20 20 70 61 67 65 20 31 35 2E 32 30 0D 0A        page 15.20..
02AF40:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
02AF50:  20 20 20 31 39 3A 20 4B 4D 20 53 45 54 20 52 45       19: KM SET RE
02AF60:  50 45 41 54 20 20 20 20 20 20 20 20 20 20 20 20    PEAT            
02AF70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02AF80:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02AF90:  20 20 20 20 23 42 42 33 39 0D 0A 0D 0A 0D 0A 20        #BB39...... 
02AFA0:  20 20 20 20 20 20 53 65 74 20 77 68 65 74 68 65          Set whethe
02AFB0:  72 20 61 20 6B 65 79 20 6D 61 79 20 72 65 70 65    r a key may repe
02AFC0:  61 74 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    at.......       
02AFD0:  41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20    Action:......   
02AFE0:  20 20 20 20 53 65 74 20 74 68 65 20 65 6E 74 72        Set the entr
02AFF0:  79 20 69 6E 20 74 68 65 20 72 65 70 65 61 74 69    y in the repeati
02B000:  6E 67 20 6B 65 79 20 6D 61 70 20 74 68 61 74 20    ng key map that 
02B010:  64 65 74 65 72 6D 69 6E 65 73 20 77 68 65 74 68    determines wheth
02B020:  65 72 20 20 61 20 20 6B 65 79 0D 0A 20 20 20 20    er  a  key..    
02B030:  20 20 20 69 73 20 61 6C 6C 6F 77 65 64 20 74 6F       is allowed to
02B040:  20 72 65 70 65 61 74 20 6F 72 20 6E 6F 74 2E 0D     repeat or not..
02B050:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74 72    .....       Entr
02B060:  79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    y conditions:...
02B070:  0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74 68 65    ...       If the
02B080:  20 6B 65 79 20 69 73 20 74 6F 20 62 65 20 61 6C     key is to be al
02B090:  6C 6F 77 65 64 20 74 6F 20 72 65 70 65 61 74 3A    lowed to repeat:
02B0A0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20    ......          
02B0B0:  20 20 20 20 20 20 42 20 63 6F 6E 74 61 69 6E 73          B contains
02B0C0:  20 23 46 46 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20     #FF.......     
02B0D0:  20 20 49 66 20 74 68 65 20 6B 65 79 20 69 73 20      If the key is 
02B0E0:  6E 6F 74 20 74 6F 20 62 65 20 61 6C 6C 6F 77 65    not to be allowe
02B0F0:  64 20 74 6F 20 72 65 70 65 61 74 3A 0D 0A 0D 0A    d to repeat:....
02B100:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
02B110:  20 20 42 20 63 6F 6E 74 61 69 6E 73 20 23 30 30      B contains #00
02B120:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 77    ......       Alw
02B130:  61 79 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ays:......      
02B140:  20 20 20 20 20 20 20 20 20 20 41 20 63 6F 6E 74              A cont
02B150:  61 69 6E 73 20 74 68 65 20 6B 65 79 20 6E 75 6D    ains the key num
02B160:  62 65 72 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ber.......      
02B170:  20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73     Exit conditions
02B180:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 46    :......       AF
02B190:  2C 42 43 20 61 6E 64 20 48 4C 20 63 6F 72 72 75    ,BC and HL corru
02B1A0:  70 74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20    pt...       All 
02B1B0:  6F 74 68 65 72 20 72 65 67 69 73 74 65 72 73 20    other registers 
02B1C0:  70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A    preserved.......
02B1D0:  20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D           Notes:...
02B1E0:  0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74 68 65    ...       If the
02B1F0:  20 6B 65 79 20 6E 75 6D 62 65 72 20 69 73 20 69     key number is i
02B200:  6E 76 61 6C 69 64 20 28 67 72 65 61 74 65 72 20    nvalid (greater 
02B210:  20 74 68 61 6E 20 20 37 39 29 20 20 74 68 65 6E     than  79)  then
02B220:  20 20 6E 6F 20 20 61 63 74 69 6F 6E 20 20 69 73      no  action  is
02B230:  0D 0A 20 20 20 20 20 20 20 74 61 6B 65 6E 2E 0D    ..       taken..
02B240:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20    .....       The 
02B250:  64 65 66 61 75 6C 74 20 72 65 70 65 61 74 69 6E    default repeatin
02B260:  67 20 6B 65 79 73 20 61 72 65 20 6C 69 73 74 65    g keys are liste
02B270:  64 20 69 6E 20 41 70 70 65 6E 64 69 78 20 49 49    d in Appendix II
02B280:  49 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52    I.......       R
02B290:  65 6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D    elated entries:.
02B2A0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 47    .....       KM G
02B2B0:  45 54 20 52 45 50 45 41 54 0D 0A 20 20 20 20 20    ET REPEAT..     
02B2C0:  20 20 4B 4D 20 53 45 54 20 44 45 4C 41 59 0D 0A      KM SET DELAY..
02B2D0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53    ......       AMS
02B2E0:  54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34 2F    TRAD CPC464/664/
02B2F0:  36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20 20    6128 FIRMWARE   
02B300:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B310:  20 20 20 20 20 20 20 20 20 70 61 67 65 20 31 35             page 15
02B320:  2E 32 31 0D 0A 1A 20 20 20 20 20 20 20 20 20 20    .21...          
02B330:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B340:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B350:  20 20 20 20 23 42 42 31 45 0D 0A 0D 0A 20 20 20        #BB1E....   
02B360:  20 20 20 20 54 65 73 74 20 69 66 20 61 20 6B 65        Test if a ke
02B370:  79 20 69 73 20 70 72 65 73 73 65 64 2E 0D 0A 0D    y is pressed....
02B380:  00 43 48 41 50 2D 31 34 20 50 33 20 00 00 00 27    .CHAP-14 P3 ...'
02B390:  7E 7F 80 81 82 00 00 00 00 00 00 00 00 00 00 00    ~...............
02B3A0:  00 43 48 41 50 2D 31 35 20 50 31 20 00 00 00 7F    .CHAP-15 P1 ....
02B3B0:  83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92    ................
02B3C0:  00 43 48 41 50 2D 31 35 20 24 24 24 00 00 00 80    .CHAP-15 $$$....
02B3D0:  93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2    ................
02B3E0:  E5 43 48 41 50 2D 31 35 20 50 32 20 01 00 00 07    .CHAP-15 P2 ....
02B3F0:  A3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    £...............
02B400:  0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A    .       Notes:..
02B410:  0D 0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74 68    ....       If th
02B420:  65 20 6B 65 79 20 6E 75 6D 62 65 72 20 69 73 20    e key number is 
02B430:  69 6E 76 61 6C 69 64 20 28 67 72 65 61 74 65 72    invalid (greater
02B440:  20 20 74 68 61 6E 20 20 37 39 29 20 20 74 68 65      than  79)  the
02B450:  6E 20 20 6E 6F 20 20 61 63 74 69 6F 6E 20 20 69    n  no  action  i
02B460:  73 0D 0A 20 20 20 20 20 20 20 74 61 6B 65 6E 2E    s..       taken.
02B470:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
02B480:  20 64 65 66 61 75 6C 74 20 72 65 70 65 61 74 69     default repeati
02B490:  6E 67 20 6B 65 79 73 20 61 72 65 20 6C 69 73 74    ng keys are list
02B4A0:  65 64 20 69 6E 20 41 70 70 65 6E 64 69 78 20 49    ed in Appendix I
02B4B0:  49 49 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    II.......       
02B4C0:  52 65 6C 61 74 65 64 20 65 6E 74 72 69 65 73 3A    Related entries:
02B4D0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20    ......       KM 
02B4E0:  47 45 54 20 52 45 50 45 41 54 0D 0A 20 20 20 20    GET REPEAT..    
02B4F0:  20 20 20 4B 4D 20 53 45 54 20 44 45 4C 41 59 0D       KM SET DELAY.
02B500:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D    .......       AM
02B510:  53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36 34    STRAD CPC464/664
02B520:  2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20 20    /6128 FIRMWARE  
02B530:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B540:  20 20 20 20 20 20 20 20 20 20 70 61 67 65 20 31              page 1
02B550:  35 2E 32 31 0D 0A 1A 74 61 69 6C 20 74 68 65 20    5.21...tail the 
02B560:  65 6E 74 72 79 20 61 6E 64 20 65 78 69 74 20 63    entry and exit c
02B570:  6F 6E 64 69 74 69 6F 6E 73 20 61 6E 64 20 74 68    onditions and th
02B580:  74 61 69 6E 73 20 74 68 65 20 6B 65 79 20 6E 75    tains the key nu
02B590:  6D 62 65 72 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    mber.......     
02B5A0:  20 20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E      Exit condition
02B5B0:  73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    s:......       A
02B5C0:  46 2C 42 43 20 61 6E 64 20 48 4C 20 63 6F 72 72    F,BC and HL corr
02B5D0:  75 70 74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C    upt...       All
02B5E0:  20 6F 74 68 65 72 20 72 65 67 69 73 74 65 72 73     other registers
02B5F0:  20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D     preserved......
02B600:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
02B610:  20 20 20 32 30 3A 20 4B 4D 20 53 45 54 20 44 45       20: KM SET DE
02B620:  4C 41 59 20 20 20 20 20 20 20 20 20 20 20 20 20    LAY             
02B630:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B640:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B650:  20 20 20 20 23 42 42 33 43 0D 0A 0D 0A 0D 0A 20        #BB3C...... 
02B660:  20 20 20 20 20 20 41 73 6B 20 69 66 20 61 20 6B          Ask if a k
02B670:  65 79 20 69 73 20 61 6C 6C 6F 77 65 64 20 74 6F    ey is allowed to
02B680:  20 72 65 70 65 61 74 2E 0D 0A 0D 0A 0D 0A 20 20     repeat.......  
02B690:  20 20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A         Action:....
02B6A0:  0D 0A 20 20 20 20 20 20 20 54 65 73 74 20 74 68    ..       Test th
02B6B0:  65 20 65 6E 74 72 79 20 69 6E 20 74 68 65 20 72    e entry in the r
02B6C0:  65 70 65 61 74 69 6E 67 20 6B 65 79 20 6D 61 70    epeating key map
02B6D0:  20 74 68 61 74 20 73 61 79 73 20 20 77 68 65 74     that says  whet
02B6E0:  68 65 72 20 20 61 20 20 6B 65 79 20 20 69 73 0D    her  a  key  is.
02B6F0:  0A 20 20 20 20 20 20 20 61 6C 6C 6F 77 65 64 20    .       allowed 
02B700:  74 6F 20 72 65 70 65 61 74 20 6F 72 20 6E 6F 74    to repeat or not
02B710:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E    .......       En
02B720:  74 72 79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D    try conditions:.
02B730:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74    .....       If t
02B740:  68 65 20 6B 65 79 20 69 73 20 61 6C 6C 6F 77 65    he key is allowe
02B750:  64 20 74 6F 20 72 65 70 65 61 74 3A 0D 0A 0D 0A    d to repeat:....
02B760:  0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20    ..              
02B770:  20 20 5A 65 72 6F 20 66 61 6C 73 65 2E 0D 0A 0D      Zero false....
02B780:  0A 0D 0A 20 20 20 20 20 20 20 49 66 20 74 68 65    ...       If the
02B790:  20 6B 65 79 20 69 73 20 6E 6F 74 20 61 6C 6C 6F     key is not allo
02B7A0:  77 65 64 20 74 6F 20 72 65 70 65 61 74 3A 0D 0A    wed to repeat:..
02B7B0:  0D 0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    ....            
02B7C0:  20 20 20 20 5A 65 72 6F 20 74 72 75 65 2E 0D 0A        Zero true...
02B7D0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 6C 77 61 79    ....       Alway
02B7E0:  73 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 20 20    s......         
02B7F0:  20 20 20 20 20 20 20 43 61 72 72 79 20 66 61 6C           Carry fal
02B800:  73 65 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20    se...           
02B810:  20 20 20 20 20 41 2C 48 4C 20 61 6E 64 20 6F 74         A,HL and ot
02B820:  68 65 72 20 66 6C 61 67 73 20 63 6F 72 72 75 70    her flags corrup
02B830:  74 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20    t...            
02B840:  20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20 72 65        All other re
02B850:  67 69 73 74 65 72 73 20 70 72 65 73 65 72 76 65    gisters preserve
02B860:  64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E    d.......       N
02B870:  6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    otes:......     
02B880:  20 20 54 68 65 20 6B 65 79 20 6E 75 6D 62 65 72      The key number
02B890:  20 69 73 20 6E 6F 74 20 63 68 65 63 6B 65 64 2E     is not checked.
02B8A0:  20 49 66 20 69 74 20 69 73 20 69 6E 76 61 6C 69     If it is invali
02B8B0:  64 20 28 67 72 65 61 74 65 72 20 74 68 61 6E 20    d (greater than 
02B8C0:  37 39 29 20 74 68 65 6E 0D 0A 20 20 20 20 20 20    79) then..      
02B8D0:  20 74 68 65 20 72 65 70 65 61 74 20 73 74 61 74     the repeat stat
02B8E0:  65 20 72 65 74 75 72 6E 65 64 20 69 73 20 6D 65    e returned is me
02B8F0:  61 6E 69 6E 67 6C 65 73 73 2E 0D 0A 0D 0A 0D 0A    aningless.......
02B900:  20 20 20 20 20 20 20 54 68 65 20 64 65 66 61 75           The defau
02B910:  6C 74 20 72 65 70 65 61 74 69 6E 67 20 6B 65 79    lt repeating key
02B920:  73 20 61 72 65 20 6C 69 73 74 65 64 20 69 6E 20    s are listed in 
02B930:  41 70 70 65 6E 64 69 78 20 49 49 49 2E 0D 0A 0D    Appendix III....
02B940:  0A 0D 0A 20 20 20 20 20 20 20 52 65 6C 61 74 65    ...       Relate
02B950:  64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A    d entries:......
02B960:  20 20 20 20 20 20 20 4B 4D 20 53 45 54 20 52 45           KM SET RE
02B970:  50 45 41 54 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    PEAT............
02B980:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
02B990:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
02B9A0:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
02B9B0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02B9C0:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
02B9D0:  31 35 2E 32 32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    15.22...........
02B9E0:  0A 0D 0A 20 20 20 20 20 20 20 32 31 3A 20 4B 4D    ...       21: KM
02B9F0:  20 53 45 54 20 44 45 4C 41 59 20 20 20 20 20 20     SET DELAY      
02BA00:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02BA10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02BA20:  20 20 20 20 20 20 20 20 20 20 20 23 42 42 33 46               #BB3F
02BA30:  0D 0A 0D 0A 20 20 20 20 20 20 20 53 65 74 20 73    ....       Set s
02BA40:  74 61 72 74 20 64 65 6C 61 79 20 61 6E 64 20 72    tart delay and r
02BA50:  65 70 65 61 74 20 73 70 65 65 64 2E 0D 0A 0D 0A    epeat speed.....
02BA60:  20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A           Action:..
02BA70:  0D 0A 20 20 20 20 20 20 20 53 65 74 20 74 68 65    ..       Set the
02BA80:  20 74 69 6D 65 20 62 65 66 6F 72 65 20 6B 65 79     time before key
02BA90:  73 20 66 69 72 73 74 20 72 65 70 65 61 74 20 28    s first repeat (
02BAA0:  73 74 61 72 74 20 75 70 20 64 65 6C 61 79 29 20    start up delay) 
02BAB0:  20 61 6E 64 20 20 74 68 65 20 20 74 69 6D 65 0D     and  the  time.
02BAC0:  0A 20 20 20 20 20 20 20 62 65 74 77 65 65 6E 20    .       between 
02BAD0:  72 65 70 65 61 74 73 20 28 72 65 70 65 61 74 20    repeats (repeat 
02BAE0:  73 70 65 65 64 29 2E 0D 0A 0D 0A 0D 0A 20 20 20    speed).......   
02BAF0:  20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74        Entry condit
02BB00:  69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions:......     
02BB10:  20 20 48 20 63 6F 6E 74 61 69 6E 73 20 74 68 65      H contains the
02BB20:  20 6E 65 77 20 73 74 61 72 74 20 75 70 20 64 65     new start up de
02BB30:  6C 61 79 2E 0D 0A 20 20 20 20 20 20 20 4C 20 63    lay...       L c
02BB40:  6F 6E 74 61 69 6E 73 20 74 68 65 20 6E 65 77 20    ontains the new 
02BB50:  72 65 70 65 61 74 20 73 70 65 65 64 2E 0D 0A 0D    repeat speed....
02BB60:  0A 0D 0A 20 20 20 20 20 20 20 45 78 69 74 20 63    ...       Exit c
02BB70:  6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A    onditions:......
02BB80:  20 20 20 20 20 20 20 41 46 20 63 6F 72 72 75 70           AF corrup
02BB90:  74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F    t...       All o
02BBA0:  74 68 65 72 20 72 65 67 69 73 74 65 72 73 20 70    ther registers p
02BBB0:  72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A 20    reserved....... 
02BBC0:  20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A          Notes:....
02BBD0:  0D 0A 20 20 20 20 20 20 20 42 6F 74 68 20 64 65    ..       Both de
02BBE0:  6C 61 79 73 20 61 72 65 20 67 69 76 65 6E 20 69    lays are given i
02BBF0:  6E 20 20 73 63 61 6E 73 20 20 6F 66 20 20 74 68    n  scans  of  th
02BC00:  65 20 20 6B 65 79 62 6F 61 72 64 2E 20 20 54 68    e  keyboard.  Th
02BC10:  65 20 20 6B 65 79 62 6F 61 72 64 20 20 69 73 0D    e  keyboard  is.
02BC20:  0A 20 20 20 20 20 20 20 73 63 61 6E 6E 65 64 20    .       scanned 
02BC30:  65 76 65 72 79 20 66 69 66 74 69 65 74 68 20 6F    every fiftieth o
02BC40:  66 20 61 20 73 65 63 6F 6E 64 2E 0D 0A 0D 0A 0D    f a second......
02BC50:  0A 20 20 20 20 20 20 20 41 20 73 74 61 72 74 20    .       A start 
02BC60:  75 70 20 64 65 6C 61 79 20 6F 72 20 72 65 70 65    up delay or repe
02BC70:  61 74 20 73 70 65 65 64 20 6F 66 20 30 20 69 73    at speed of 0 is
02BC80:  20 74 61 6B 65 6E 20 74 6F 20 6D 65 61 6E 20 32     taken to mean 2
02BC90:  35 36 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    56.......       
02BCA0:  54 68 65 20 64 65 66 61 75 6C 74 20 73 74 61 72    The default star
02BCB0:  74 20 75 70 20 64 65 6C 61 79 20 69 73 20 33 30    t up delay is 30
02BCC0:  20 73 63 61 6E 73 20 28 30 2E 36 20 73 65 63 6F     scans (0.6 seco
02BCD0:  6E 64 73 29 20 61 6E 64 20 20 74 68 65 20 20 64    nds) and  the  d
02BCE0:  65 66 61 75 6C 74 0D 0A 20 20 20 20 20 20 20 72    efault..       r
02BCF0:  65 70 65 61 74 20 73 70 65 65 64 20 69 73 20 32    epeat speed is 2
02BD00:  20 73 63 61 6E 73 20 28 30 2E 30 34 20 73 65 63     scans (0.04 sec
02BD10:  6F 6E 64 73 20 6F 72 20 32 35 20 63 68 61 72 61    onds or 25 chara
02BD20:  63 74 65 72 73 20 61 20 73 65 63 6F 6E 64 29 2E    cters a second).
02BD30:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74    ......       Not
02BD40:  65 20 74 68 61 74 20 61 20 6B 65 79 20 69 73 20    e that a key is 
02BD50:  70 72 65 76 65 6E 74 65 64 20 66 72 6F 6D 20 72    prevented from r
02BD60:  65 70 65 61 74 69 6E 67 20 28 62 79 20 74 68 65    epeating (by the
02BD70:  20 20 6B 65 79 20 20 73 63 61 6E 6E 65 72 29 20      key  scanner) 
02BD80:  20 69 66 0D 0A 20 20 20 20 20 20 20 74 68 65 20     if..       the 
02BD90:  6B 65 79 20 62 75 66 66 65 72 20 69 73 20 6E 6F    key buffer is no
02BDA0:  74 20 65 6D 70 74 79 2E 20 54 68 75 73 20 20 74    t empty. Thus  t
02BDB0:  68 65 20 20 61 63 74 75 61 6C 20 20 72 65 70 65    he  actual  repe
02BDC0:  61 74 20 20 73 70 65 65 64 20 20 69 73 20 20 74    at  speed  is  t
02BDD0:  68 65 0D 0A 20 20 20 20 20 20 20 73 6C 6F 77 65    he..       slowe
02BDE0:  72 20 6F 66 20 74 68 65 20 73 75 70 70 6C 69 65    r of the supplie
02BDF0:  64 20 72 65 70 65 61 74 20 73 70 65 65 64 20 61    d repeat speed a
02BE00:  6E 64 20 74 68 65 20 72 61 74 65 20 61 74 20 20    nd the rate at  
02BE10:  77 68 69 63 68 20 20 63 68 61 72 61 63 74 65 72    which  character
02BE20:  73 0D 0A 20 20 20 20 20 20 20 61 72 65 20 72 65    s..       are re
02BE30:  6D 6F 76 65 64 20 66 72 6F 6D 20 74 68 65 20 62    moved from the b
02BE40:  75 66 66 65 72 2E 20 54 68 69 73 20 69 73 20 69    uffer. This is i
02BE50:  6E 74 65 6E 64 65 64 20 74 6F 20 70 72 65 76 65    ntended to preve
02BE60:  6E 74 20 74 68 65 20 75 73 65 72 20 66 72 6F 6D    nt the user from
02BE70:  0D 0A 20 20 20 20 20 20 20 67 65 74 74 69 6E 67    ..       getting
02BE80:  20 74 6F 6F 20 66 61 72 20 61 68 65 61 64 20 6F     too far ahead o
02BE90:  66 20 61 20 70 72 6F 67 72 61 6D 20 74 68 61 74    f a program that
02BEA0:  20 69 73 20 72 75 6E 6E 69 6E 67 20 73 6C 75 67     is running slug
02BEB0:  67 69 73 68 6C 79 2E 0D 0A 0D 0A 0D 0A 20 20 20    gishly.......   
02BEC0:  20 20 20 20 54 68 65 20 73 74 61 72 74 20 75 70        The start up
02BED0:  20 64 65 6C 61 79 20 61 6E 64 20 72 65 70 65 61     delay and repea
02BEE0:  74 20 73 70 65 65 64 20 61 70 70 6C 79 20 74 6F    t speed apply to
02BEF0:  20 61 6C 6C 20 6B 65 79 73 20 6F 6E 20 74 68 65     all keys on the
02BF00:  20 20 6B 65 79 62 6F 61 72 64 0D 0A 20 20 20 20      keyboard..    
02BF10:  20 20 20 74 68 61 74 20 61 72 65 20 73 65 74 20       that are set 
02BF20:  74 6F 20 72 65 70 65 61 74 2E 0D 0A 0D 0A 0D 0A    to repeat.......
02BF30:  20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20 65           Related e
02BF40:  6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20    ntries:......   
02BF50:  20 20 20 20 4B 4D 20 47 45 54 20 44 45 4C 41 59        KM GET DELAY
02BF60:  0D 0A 20 20 20 20 20 20 20 4B 4D 20 53 45 54 20    ..       KM SET 
02BF70:  52 45 50 45 41 54 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    REPEAT..........
02BF80:  0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52 41 44    ..       AMSTRAD
02BF90:  20 43 50 43 34 36 34 2F 36 36 34 2F 36 31 32 38     CPC464/664/6128
02BFA0:  20 46 49 52 4D 57 41 52 45 20 20 20 20 20 20 20     FIRMWARE       
02BFB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02BFC0:  20 20 20 20 20 70 61 67 65 20 31 35 2E 32 33 0D         page 15.23.
02BFD0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    .............   
02BFE0:  20 20 20 20 32 32 3A 20 4B 4D 20 47 45 54 20 44        22: KM GET D
02BFF0:  45 4C 41 59 20 20 20 20 20 20 20 20 20 20 20 20    ELAY            
02C000:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
02C010:  25 00 00 00 02 09 50 E5 25 00 C1 02 00 00 00 02    %.....P.%.......
02C020:  25 00 C2 02 00 00 00 02 25 00 C3 02 00 00 00 02    %.......%.......
02C030:  25 00 C4 02 00 00 00 02 25 00 C5 02 00 00 00 02    %.......%.......
02C040:  25 00 C6 02 00 00 00 02 25 00 C7 02 00 00 00 02    %.......%.......
02C050:  25 00 C8 02 00 00 00 02 25 00 C9 02 00 00 00 02    %.......%.......
02C060:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C070:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C080:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C090:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C0F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02C100:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C110:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C120:  20 20 20 20 20 23 42 42 34 32 0D 0A 0D 0A 0D 0A         #BB42......
02C130:  20 20 20 20 20 20 20 47 65 74 20 73 74 61 72 74           Get start
02C140:  20 75 70 20 64 65 6C 61 79 20 61 6E 64 20 72 65     up delay and re
02C150:  70 65 61 74 20 73 70 65 65 64 2E 0D 0A 0D 0A 0D    peat speed......
02C160:  0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D    .       Action:.
02C170:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 73 6B 20    .....       Ask 
02C180:  74 68 65 20 74 69 6D 65 20 62 65 66 6F 72 65 20    the time before 
02C190:  6B 65 79 73 20 66 69 72 73 74 20 72 65 70 65 61    keys first repea
02C1A0:  74 20 28 73 74 61 72 74 20 75 70 20 64 65 6C 61    t (start up dela
02C1B0:  79 29 20 20 61 6E 64 20 20 74 68 65 20 20 74 69    y)  and  the  ti
02C1C0:  6D 65 0D 0A 20 20 20 20 20 20 20 62 65 74 77 65    me..       betwe
02C1D0:  65 6E 20 72 65 70 65 61 74 73 20 28 72 65 70 65    en repeats (repe
02C1E0:  61 74 20 73 70 65 65 64 29 2E 0D 0A 0D 0A 0D 0A    at speed).......
02C1F0:  20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E           Entry con
02C200:  64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20    ditions:......  
02C210:  20 20 20 20 20 4E 6F 20 63 6F 6E 64 69 74 69 6F         No conditio
02C220:  6E 73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ns.......       
02C230:  45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A    Exit conditions:
02C240:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 48 20 63    ......       H c
02C250:  6F 6E 74 61 69 6E 73 20 74 68 65 20 73 74 61 72    ontains the star
02C260:  74 20 75 70 20 64 65 6C 61 79 2E 0D 0A 20 20 20    t up delay...   
02C270:  20 20 20 20 4C 20 63 6F 6E 74 61 69 6E 73 20 74        L contains t
02C280:  68 65 20 72 65 70 65 61 74 20 73 70 65 65 64 2E    he repeat speed.
02C290:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 46 20    ......       AF 
02C2A0:  63 6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20    corrupt...      
02C2B0:  20 41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73     All other regis
02C2C0:  74 65 72 73 20 70 72 65 73 65 72 76 65 64 2E 0D    ters preserved..
02C2D0:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65    .....       Note
02C2E0:  73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 42    s:......       B
02C2F0:  6F 74 68 20 64 65 6C 61 79 73 20 61 72 65 20 67    oth delays are g
02C300:  69 76 65 6E 20 69 6E 20 20 73 63 61 6E 73 20 20    iven in  scans  
02C310:  6F 66 20 20 74 68 65 20 20 6B 65 79 62 6F 61 72    of  the  keyboar
02C320:  64 2E 20 20 54 68 65 20 20 6B 65 79 62 6F 61 72    d.  The  keyboar
02C330:  64 20 20 69 73 0D 0A 20 20 20 20 20 20 20 73 63    d  is..       sc
02C340:  61 6E 6E 65 64 20 65 76 65 72 79 20 66 69 66 74    anned every fift
02C350:  69 65 74 68 20 6F 66 20 61 20 73 65 63 6F 6E 64    ieth of a second
02C360:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20    .......       A 
02C370:  72 65 70 65 61 74 20 73 70 65 65 64 20 6F 72 20    repeat speed or 
02C380:  73 74 61 72 74 20 75 70 20 64 65 6C 61 79 20 6F    start up delay o
02C390:  66 20 30 20 6D 65 61 6E 73 20 32 35 36 2E 0D 0A    f 0 means 256...
02C3A0:  0D 0A 0D 0A 20 20 20 20 20 20 20 52 65 6C 61 74    ....       Relat
02C3B0:  65 64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D    ed entries:.....
02C3C0:  0A 20 20 20 20 20 20 20 4B 4D 20 53 45 54 20 44    .       KM SET D
02C3D0:  45 4C 41 59 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ELAY............
02C3E0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02C3F0:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
02C400:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
02C410:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
02C420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C430:  20 20 20 20 20 20 20 70 61 67 65 20 31 35 2E 32           page 15.2
02C440:  34 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    4.............. 
02C450:  20 20 20 20 20 20 32 33 3A 20 4B 4D 20 41 52 4D          23: KM ARM
02C460:  20 42 52 45 41 4B 53 20 20 20 20 20 20 20 20 20     BREAKS         
02C470:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C480:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C490:  20 20 20 20 20 20 20 23 42 42 34 35 0D 0A 0D 0A           #BB45....
02C4A0:  0D 0A 20 20 20 20 20 20 20 41 6C 6C 6F 77 20 62    ..       Allow b
02C4B0:  72 65 61 6B 20 65 76 65 6E 74 73 20 74 6F 20 62    reak events to b
02C4C0:  65 20 67 65 6E 65 72 61 74 65 64 2E 0D 0A 0D 0A    e generated.....
02C4D0:  0D 0A 20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A    ..       Action:
02C4E0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 72 6D    ......       Arm
02C4F0:  20 74 68 65 20 62 72 65 61 6B 20 6D 65 63 68 61     the break mecha
02C500:  6E 69 73 6D 2E 20 54 68 65 20 6E 65 78 74 20 63    nism. The next c
02C510:  61 6C 6C 20 6F 66 20 4B 4D 20 42 52 45 41 4B 20    all of KM BREAK 
02C520:  45 56 45 4E 54 20 77 69 6C 6C 20 67 65 6E 65 72    EVENT will gener
02C530:  61 74 65 0D 0A 20 20 20 20 20 20 20 61 20 62 72    ate..       a br
02C540:  65 61 6B 20 65 76 65 6E 74 2E 0D 0A 0D 0A 0D 0A    eak event.......
02C550:  20 20 20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E           Entry con
02C560:  64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20    ditions:......  
02C570:  20 20 20 20 20 44 45 20 63 6F 6E 74 61 69 6E 73         DE contains
02C580:  20 74 68 65 20 61 64 64 72 65 73 73 20 6F 66 20     the address of 
02C590:  74 68 65 20 62 72 65 61 6B 20 65 76 65 6E 74 20    the break event 
02C5A0:  72 6F 75 74 69 6E 65 2E 0D 0A 20 20 20 20 20 20    routine...      
02C5B0:  20 43 20 63 6F 6E 74 61 69 6E 73 20 74 68 65 20     C contains the 
02C5C0:  52 4F 4D 20 73 65 6C 65 63 74 20 61 64 64 72 65    ROM select addre
02C5D0:  73 73 20 66 6F 72 20 74 68 69 73 20 72 6F 75 74    ss for this rout
02C5E0:  69 6E 65 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ine.......      
02C5F0:  20 45 78 69 74 20 63 6F 6E 64 69 74 69 6F 6E 73     Exit conditions
02C600:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 46    :......       AF
02C610:  2C 42 43 2C 44 45 20 61 6E 64 20 48 4C 20 63 6F    ,BC,DE and HL co
02C620:  72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20 41    rrupt...       A
02C630:  6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73 74 65    ll other registe
02C640:  72 73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A 0D    rs preserved....
02C650:  0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74 65 73 3A    ...       Notes:
02C660:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65    ......       The
02C670:  20 62 72 65 61 6B 20 6D 65 63 68 61 6E 69 73 6D     break mechanism
02C680:  20 63 61 6E 20 62 65 20 64 69 73 61 72 6D 65 64     can be disarmed
02C690:  20 62 79 20 63 61 6C 6C 69 6E 67 20 4B 4D 20 44     by calling KM D
02C6A0:  49 53 41 52 4D 20 42 52 45 41 4B 20 28 6F 72 20    ISARM BREAK (or 
02C6B0:  20 4B 4D 0D 0A 20 20 20 20 20 20 20 52 45 53 45     KM..       RESE
02C6C0:  54 29 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    T).......       
02C6D0:  54 68 69 73 20 72 6F 75 74 69 6E 65 20 65 6E 61    This routine ena
02C6E0:  62 6C 65 73 20 69 6E 74 65 72 72 75 70 74 73 2E    bles interrupts.
02C6F0:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65 6C    ......       Rel
02C700:  61 74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D    ated entries:...
02C710:  0A 0D 0A 20 20 20 20 20 20 20 4B 4D 20 42 52 45    ...       KM BRE
02C720:  41 4B 20 45 56 45 4E 54 0D 0A 20 20 20 20 20 20    AK EVENT..      
02C730:  20 4B 4D 20 44 49 53 41 52 4D 20 42 52 45 41 4B     KM DISARM BREAK
02C740:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02C750:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02C760:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
02C770:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
02C780:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
02C790:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C7A0:  20 20 20 20 20 20 20 70 61 67 65 20 31 35 2E 32           page 15.2
02C7B0:  35 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    5.............. 
02C7C0:  20 20 20 20 20 20 32 34 3A 20 4B 4D 20 44 49 53          24: KM DIS
02C7D0:  41 52 4D 20 42 52 45 41 4B 20 20 20 20 20 20 20    ARM BREAK       
02C7E0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C7F0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02C800:  20 20 20 20 20 20 20 23 42 42 34 38 0D 0A 0D 0A           #BB48....
02C810:  0D 0A 20 20 20 20 20 20 20 50 72 65 76 65 6E 74    ..       Prevent
02C820:  20 62 72 65 61 6B 20 65 76 65 6E 74 73 20 66 72     break events fr
02C830:  6F 6D 20 62 65 69 6E 67 20 67 65 6E 65 72 61 74    om being generat
02C840:  65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    ed.......       
02C850:  41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20    Action:......   
02C860:  20 20 20 20 44 69 73 61 72 6D 20 74 68 65 20 62        Disarm the b
02C870:  72 65 61 6B 20 6D 65 63 68 61 6E 69 73 6D 2E 20    reak mechanism. 
02C880:  46 72 6F 6D 20 6E 6F 77 20 6F 6E 20 74 68 65 20    From now on the 
02C890:  67 65 6E 65 72 61 74 69 6F 6E 20 6F 66 20 62 72    generation of br
02C8A0:  65 61 6B 20 65 76 65 6E 74 73 0D 0A 20 20 20 20    eak events..    
02C8B0:  20 20 20 62 79 20 4B 4D 20 42 52 45 41 4B 20 45       by KM BREAK E
02C8C0:  56 45 4E 54 20 77 69 6C 6C 20 62 65 20 73 75 70    VENT will be sup
02C8D0:  70 72 65 73 73 65 64 2E 0D 0A 0D 0A 0D 0A 20 20    pressed.......  
02C8E0:  20 20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69         Entry condi
02C8F0:  74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    tions:......    
02C900:  20 20 20 4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73       No conditions
02C910:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78    .......       Ex
02C920:  69 74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A    it conditions:..
02C930:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 46 20 61 6E    ....       AF an
02C940:  64 20 48 4C 20 63 6F 72 72 75 70 74 2E 0D 0A 20    d HL corrupt... 
02C950:  20 20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20          All other 
02C960:  72 65 67 69 73 74 65 72 73 20 70 72 65 73 65 72    registers preser
02C970:  76 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ved.......      
02C980:  20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20     Notes:......   
02C990:  20 20 20 20 42 72 65 61 6B 20 65 76 65 6E 74 73        Break events
02C9A0:  20 63 61 6E 20 62 65 20 72 65 61 72 6D 65 64 20     can be rearmed 
02C9B0:  62 79 20 63 61 6C 6C 69 6E 67 20 4B 4D 20 41 52    by calling KM AR
02C9C0:  4D 20 42 52 45 41 4B 2E 0D 0A 0D 0A 0D 0A 20 20    M BREAK.......  
02C9D0:  20 20 20 20 20 54 68 65 20 64 65 66 61 75 6C 74         The default
02C9E0:  20 73 74 61 74 65 20 6F 66 20 74 68 65 20 62 72     state of the br
02C9F0:  65 61 6B 20 6D 65 63 68 61 6E 69 73 6D 20 69 73    eak mechanism is
02CA00:  20 64 69 73 61 72 6D 65 64 2C 20 74 68 75 73 20     disarmed, thus 
02CA10:  63 61 6C 6C 69 6E 67 20 20 4B 4D 0D 0A 20 20 20    calling  KM..   
02CA20:  20 20 20 20 52 45 53 45 54 20 77 69 6C 6C 20 61        RESET will a
02CA30:  6C 73 6F 20 64 69 73 61 72 6D 20 62 72 65 61 6B    lso disarm break
02CA40:  73 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    s.......       T
02CA50:  68 69 73 20 72 6F 75 74 69 6E 65 20 65 6E 61 62    his routine enab
02CA60:  6C 65 73 20 69 6E 74 65 72 72 75 70 74 73 2E 0D    les interrupts..
02CA70:  0A 0D 0A 0D 0A 20 20 20 20 20 20 20 52 65 6C 61    .....       Rela
02CA80:  74 65 64 20 65 6E 74 72 69 65 73 3A 0D 0A 0D 0A    ted entries:....
02CA90:  0D 0A 20 20 20 20 20 20 20 4B 4D 20 41 52 4D 20    ..       KM ARM 
02CAA0:  42 52 45 41 4B 0D 0A 20 20 20 20 20 20 20 4B 4D    BREAK..       KM
02CAB0:  20 42 52 45 41 4B 20 45 56 45 4E 54 0D 0A 0D 0A     BREAK EVENT....
02CAC0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02CAD0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20    ............    
02CAE0:  20 20 20 41 4D 53 54 52 41 44 20 43 50 43 34 36       AMSTRAD CPC46
02CAF0:  34 2F 36 36 34 2F 36 31 32 38 20 46 49 52 4D 57    4/664/6128 FIRMW
02CB00:  41 52 45 20 20 20 20 20 20 20 20 20 20 20 20 20    ARE             
02CB10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70                   p
02CB20:  61 67 65 20 31 35 2E 32 36 0D 0A 0D 0A 0D 0A 0D    age 15.26.......
02CB30:  0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 32 35    .......       25
02CB40:  3A 20 4B 4D 20 42 52 45 41 4B 20 45 56 45 4E 54    : KM BREAK EVENT
02CB50:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02CB60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02CB70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23                   #
02CB80:  42 42 34 42 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    BB4B......      
02CB90:  20 47 65 6E 65 72 61 74 65 20 61 20 62 72 65 61     Generate a brea
02CBA0:  6B 20 65 76 65 6E 74 20 28 69 66 20 61 72 6D 65    k event (if arme
02CBB0:  64 29 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    d).......       
02CBC0:  41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20    Action:......   
02CBD0:  20 20 20 20 54 72 79 20 74 6F 20 67 65 6E 65 72        Try to gener
02CBE0:  61 74 65 20 61 20 62 72 65 61 6B 20 65 76 65 6E    ate a break even
02CBF0:  74 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45    t.......       E
02CC00:  6E 74 72 79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A    ntry conditions:
02CC10:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 20    ......       No 
02CC20:  63 6F 6E 64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A 0D    conditions......
02CC30:  0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F 6E    .       Exit con
02CC40:  64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20    ditions:......  
02CC50:  20 20 20 20 20 41 46 20 61 6E 64 20 48 4C 20 63         AF and HL c
02CC60:  6F 72 72 75 70 74 2E 0D 0A 20 20 20 20 20 20 20    orrupt...       
02CC70:  41 6C 6C 20 6F 74 68 65 72 20 72 65 67 69 73 74    All other regist
02CC80:  65 72 73 20 70 72 65 73 65 72 76 65 64 2E 0D 0A    ers preserved...
02CC90:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 74    ......       Not
02CCA0:  65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    es:......       
02CCB0:  49 66 20 74 68 65 20 62 72 65 61 6B 20 6D 65 63    If the break mec
02CCC0:  68 61 6E 69 73 6D 20 69 73 20 64 69 73 61 72 6D    hanism is disarm
02CCD0:  65 64 20 74 68 65 6E 20 6E 6F 20 61 63 74 69 6F    ed then no actio
02CCE0:  6E 20 69 73 20 74 61 6B 65 6E 2E 20 20 4F 74 68    n is taken.  Oth
02CCF0:  65 72 77 69 73 65 0D 0A 20 20 20 20 20 20 20 61    erwise..       a
02CD00:  20 62 72 65 61 6B 20 65 76 65 6E 74 20 69 73 20     break event is 
02CD10:  67 65 6E 65 72 61 74 65 64 20 61 6E 64 20 61 20    generated and a 
02CD20:  73 70 65 63 69 61 6C 20 6D 61 72 6B 65 72 20 69    special marker i
02CD30:  73 20 70 6C 61 63 65 64 20 69 6E 74 6F 20 74 68    s placed into th
02CD40:  65 20 6B 65 79 0D 0A 20 20 20 20 20 20 20 62 75    e key..       bu
02CD50:  66 66 65 72 2E 20 54 68 69 73 20 6D 61 72 6B 65    ffer. This marke
02CD60:  72 20 67 65 6E 65 72 61 74 65 73 20 61 20 62 72    r generates a br
02CD70:  65 61 6B 20 65 76 65 6E 74 20 74 6F 6B 65 6E 20    eak event token 
02CD80:  28 23 45 46 29 20 77 68 65 6E 20 72 65 61 64 20    (#EF) when read 
02CD90:  66 72 6F 6D 0D 0A 20 20 20 20 20 20 20 74 68 65    from..       the
02CDA0:  20 62 75 66 66 65 72 2E 20 20 54 68 65 20 20 62     buffer.  The  b
02CDB0:  72 65 61 6B 20 20 6D 65 63 68 61 6E 69 73 6D 20    reak  mechanism 
02CDC0:  20 69 73 20 20 61 75 74 6F 6D 61 74 69 63 61 6C     is  automatical
02CDD0:  6C 79 20 20 64 69 73 61 72 6D 65 64 20 20 61 66    ly  disarmed  af
02CDE0:  74 65 72 0D 0A 20 20 20 20 20 20 20 67 65 6E 65    ter..       gene
02CDF0:  72 61 74 69 6E 67 20 61 20 62 72 65 61 6B 20 65    rating a break e
02CE00:  76 65 6E 74 20 73 6F 20 74 68 61 74 20 6D 75 6C    vent so that mul
02CE10:  74 69 70 6C 65 20 62 72 65 61 6B 73 20 63 61 6E    tiple breaks can
02CE20:  20 62 65 20 61 76 6F 69 64 65 64 2E 0D 0A 0D 0A     be avoided.....
02CE30:  0D 0A 20 20 20 20 20 20 20 54 68 69 73 20 72 6F    ..       This ro
02CE40:  75 74 69 6E 65 20 6D 61 79 20 72 75 6E 20 66 72    utine may run fr
02CE50:  6F 6D 20 74 68 65 20 69 6E 74 65 72 72 75 70 74    om the interrupt
02CE60:  20 70 61 74 68 20 61 6E 64 20 20 74 68 75 73 20     path and  thus 
02CE70:  20 64 6F 65 73 20 20 6E 6F 74 20 20 61 6E 64 0D     does  not  and.
02CE80:  0A 20 20 20 20 20 20 20 73 68 6F 75 6C 64 20 6E    .       should n
02CE90:  6F 74 20 65 6E 61 62 6C 65 20 69 6E 74 65 72 72    ot enable interr
02CEA0:  75 70 74 73 2E 20 4E 6F 74 65 2C 20 68 6F 77 65    upts. Note, howe
02CEB0:  76 65 72 2C 20 74 68 61 74 20 75 73 69 6E 67 20    ver, that using 
02CEC0:  61 20 4C 4F 57 20 4A 55 4D 50 20 20 74 6F 0D 0A    a LOW JUMP  to..
02CED0:  20 20 20 20 20 20 20 63 61 6C 6C 20 74 68 65 20           call the 
02CEE0:  72 6F 75 74 69 6E 65 20 28 61 73 20 74 68 65 20    routine (as the 
02CEF0:  66 69 72 6D 77 61 72 65 20 6A 75 6D 70 62 6C 6F    firmware jumpblo
02CF00:  63 6B 20 69 73 20 73 65 74 20 74 6F 20 64 6F 29    ck is set to do)
02CF10:  20 64 6F 65 73 20 20 65 6E 61 62 6C 65 0D 0A 20     does  enable.. 
02CF20:  20 20 20 20 20 20 69 6E 74 65 72 72 75 70 74 73          interrupts
02CF30:  20 61 6E 64 20 20 73 6F 20 20 74 68 65 20 20 6A     and  so  the  j
02CF40:  75 6D 70 62 6C 6F 63 6B 20 20 6D 61 79 20 20 6E    umpblock  may  n
02CF50:  6F 74 20 20 62 65 20 20 75 73 65 64 20 20 64 69    ot  be  used  di
02CF60:  72 65 63 74 6C 79 20 20 66 72 6F 6D 0D 0A 20 20    rectly  from..  
02CF70:  20 20 20 20 20 69 6E 74 65 72 72 75 70 74 20 72         interrupt r
02CF80:  6F 75 74 69 6E 65 73 2E 0D 0A 0D 0A 0D 0A 20 20    outines.......  
02CF90:  20 20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74         Related ent
02CFA0:  72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ries:......     
02CFB0:  20 20 4B 4D 20 41 52 4D 20 42 52 45 41 4B 0D 0A      KM ARM BREAK..
02CFC0:  20 20 20 20 20 20 20 4B 4D 20 44 49 53 41 52 4D           KM DISARM
02CFD0:  20 42 52 45 41 4B 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A     BREAK..........
02CFE0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
02CFF0:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
02D000:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
02D010:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
02D020:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D030:  20 70 61 67 65 20 31 35 2E 32 37 0D 0A 0D 0A 0D     page 15.27.....
02D040:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
02D050:  32 36 3A 20 54 58 54 20 49 4E 49 54 49 41 4C 49    26: TXT INITIALI
02D060:  53 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20    SE              
02D070:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D080:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D090:  20 23 42 42 34 45 0D 0A 0D 0A 20 20 20 20 20 20     #BB4E....      
02D0A0:  20 49 6E 69 74 69 61 6C 69 73 65 20 74 68 65 20     Initialise the 
02D0B0:  54 65 78 74 20 56 44 55 2E 0D 0A 0D 0A 20 20 20    Text VDU.....   
02D0C0:  20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A 20        Action:.... 
02D0D0:  20 20 20 20 20 20 46 75 6C 6C 20 69 6E 69 74 69          Full initi
02D0E0:  61 6C 69 7A 61 74 69 6F 6E 20 6F 66 20 74 68 65    alization of the
02D0F0:  20 54 65 78 74 20 56 44 55 20 28 61 73 20 75 73     Text VDU (as us
02D100:  65 64 20 64 75 72 69 6E 67 20 45 4D 53 29 2E 20    ed during EMS). 
02D110:  41 6C 6C 20 54 65 78 74 20 56 44 55 0D 0A 20 20    All Text VDU..  
02D120:  20 20 20 20 20 76 61 72 69 61 62 6C 65 73 20 61         variables a
02D130:  6E 64 20 69 6E 64 69 72 65 63 74 69 6F 6E 73 20    nd indirections 
02D140:  61 72 65 20 69 6E 69 74 69 61 6C 69 7A 65 64 2C    are initialized,
02D150:  20 74 68 65 20 70 72 65 76 69 6F 75 73 20 56 44     the previous VD
02D160:  55 20 73 74 61 74 65 20 20 69 73 0D 0A 20 20 20    U state  is..   
02D170:  20 20 20 20 6C 6F 73 74 2E 0D 0A 0D 0A 20 20 20        lost.....   
02D180:  20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74        Entry condit
02D190:  69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20    ions:....       
02D1A0:  4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A    No conditions:..
02D1B0:  0D 0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F    ..       Exit co
02D1C0:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20    nditions:....   
02D1D0:  20 20 20 20 41 46 2C 42 43 2C 44 45 20 61 6E 64        AF,BC,DE and
02D1E0:  20 48 4C 20 63 6F 72 72 75 70 74 2E 0D 0A 20 20     HL corrupt...  
02D1F0:  20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20 72         All other r
02D200:  65 67 69 73 74 65 72 73 20 70 72 65 73 65 72 76    egisters preserv
02D210:  65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F    ed.....       No
02D220:  74 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 54    tes:....       T
02D230:  68 65 20 54 65 78 74 20 56 44 55 20 69 6E 64 69    he Text VDU indi
02D240:  72 65 63 74 69 6F 6E 73 20 28 54 58 54 20 44 52    rections (TXT DR
02D250:  41 57 20 43 55 52 53 4F 52 2C 20 20 54 58 54 20    AW CURSOR,  TXT 
02D260:  20 55 4E 44 52 41 57 20 20 43 55 52 53 4F 52 2C     UNDRAW  CURSOR,
02D270:  20 20 54 58 54 0D 0A 20 20 20 20 20 20 20 57 52      TXT..       WR
02D280:  49 54 45 20 43 48 41 52 2C 20 54 58 54 20 55 4E    ITE CHAR, TXT UN
02D290:  57 52 49 54 45 20 61 6E 64 20 54 58 54 20 4F 55    WRITE and TXT OU
02D2A0:  54 20 41 43 54 49 4F 4E 29 20 61 72 65 20 73 65    T ACTION) are se
02D2B0:  74 20 74 6F 20 20 74 68 65 69 72 20 20 64 65 66    t to  their  def
02D2C0:  61 75 6C 74 0D 0A 20 20 20 20 20 20 20 72 6F 75    ault..       rou
02D2D0:  74 69 6E 65 73 2E 0D 0A 0D 0A 20 20 20 20 20 20    tines.....      
02D2E0:  20 54 68 65 20 63 6F 6E 74 72 6F 6C 20 63 6F 64     The control cod
02D2F0:  65 20 74 61 62 6C 65 20 69 73 20 73 65 74 20 75    e table is set u
02D300:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
02D310:  26 00 00 00 02 09 50 E5 26 00 C1 02 00 00 00 02    &.....P.&.......
02D320:  26 00 C2 02 00 00 00 02 26 00 C3 02 00 00 00 02    &.......&.......
02D330:  26 00 C4 02 00 00 00 02 26 00 C5 02 00 00 00 02    &.......&.......
02D340:  26 00 C6 02 00 00 00 02 26 00 C7 02 00 00 00 02    &.......&.......
02D350:  26 00 C8 02 00 00 00 02 26 00 C9 02 00 00 00 02    &.......&.......
02D360:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D370:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D380:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D390:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D3F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02D400:  70 20 74 6F 20 70 65 72 66 6F 72 6D 20 74 68 65    p to perform the
02D410:  20 64 65 66 61 75 6C 74 20 20 63 6F 6E 74 72 6F     default  contro
02D420:  6C 20 20 63 6F 64 65 0D 0A 20 20 20 20 20 20 20    l  code..       
02D430:  61 63 74 69 6F 6E 73 2E 0D 0A 0D 0A 20 20 20 20    actions.....    
02D440:  20 20 20 54 68 65 20 75 73 65 72 20 64 65 66 69       The user defi
02D450:  6E 65 64 20 63 68 61 72 61 63 74 65 72 20 74 61    ned character ta
02D460:  62 6C 65 20 69 73 20 73 65 74 20 74 6F 20 65 6D    ble is set to em
02D470:  70 74 79 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 53    pty.....       S
02D480:  74 72 65 61 6D 20 30 20 69 73 20 73 65 6C 65 63    tream 0 is selec
02D490:  74 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ted.....       A
02D4A0:  6C 6C 20 73 74 72 65 61 6D 73 20 61 72 65 20 73    ll streams are s
02D4B0:  65 74 20 74 6F 20 74 68 65 69 72 20 64 65 66 61    et to their defa
02D4C0:  75 6C 74 20 73 74 61 74 65 73 3A 0D 0A 0D 0A 0D    ult states:.....
02D4D0:  0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    .               
02D4E0:  20 54 68 65 20 74 65 78 74 20 70 61 70 65 72 20     The text paper 
02D4F0:  28 62 61 63 6B 67 72 6F 75 6E 64 29 20 69 73 20    (background) is 
02D500:  73 65 74 20 74 6F 20 69 6E 6B 20 30 2E 0D 0A 20    set to ink 0... 
02D510:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54                   T
02D520:  68 65 20 74 65 78 74 20 70 65 6E 20 28 66 6F 72    he text pen (for
02D530:  65 67 72 6F 75 6E 64 29 20 69 73 20 73 65 74 20    eground) is set 
02D540:  74 6F 20 69 6E 6B 20 31 2E 0D 0A 20 20 20 20 20    to ink 1...     
02D550:  20 20 20 20 20 20 20 20 20 20 20 54 68 65 20 74               The t
02D560:  65 78 74 20 77 69 6E 64 6F 77 20 69 73 20 73 65    ext window is se
02D570:  74 20 74 6F 20 74 68 65 20 65 6E 74 69 72 65 20    t to the entire 
02D580:  73 63 72 65 65 6E 2E 0D 0A 20 20 20 20 20 20 20    screen...       
02D590:  20 20 20 20 20 20 20 20 20 54 68 65 20 74 65 78             The tex
02D5A0:  74 20 63 75 72 73 6F 72 20 69 73 20 65 6E 61 62    t cursor is enab
02D5B0:  6C 65 64 20 62 75 74 20 74 75 72 6E 65 64 20 6F    led but turned o
02D5C0:  66 66 2E 0D 0A 20 20 20 20 20 20 20 20 20 20 20    ff...           
02D5D0:  20 20 20 20 20 54 68 65 20 63 68 61 72 61 63 74         The charact
02D5E0:  65 72 20 77 72 69 74 65 20 6D 6F 64 65 20 69 73    er write mode is
02D5F0:  20 73 65 74 20 74 6F 20 6F 70 61 71 75 65 2E 0D     set to opaque..
02D600:  0A 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20    ...             
02D610:  20 20 20 54 68 65 20 56 44 55 20 69 73 20 65 6E       The VDU is en
02D620:  61 62 6C 65 64 2E 0D 0A 20 20 20 20 20 20 20 20    abled...        
02D630:  20 20 20 20 20 20 20 20 54 68 65 20 67 72 61 70            The grap
02D640:  68 69 63 73 20 63 68 61 72 61 63 74 65 72 20 77    hics character w
02D650:  72 69 74 65 20 6D 6F 64 65 20 69 73 20 74 75 72    rite mode is tur
02D660:  6E 20 6F 66 66 2E 0D 0A 20 20 20 20 20 20 20 20    n off...        
02D670:  20 20 20 20 20 20 20 20 54 68 65 20 63 75 72 73            The curs
02D680:  6F 72 20 69 73 20 6D 6F 76 65 64 20 74 6F 20 74    or is moved to t
02D690:  68 65 20 74 6F 70 20 6C 65 66 74 20 63 6F 72 6E    he top left corn
02D6A0:  65 72 20 6F 66 20 74 68 65 20 77 69 6E 64 6F 77    er of the window
02D6B0:  2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    .......       Th
02D6C0:  65 20 64 65 66 61 75 6C 74 20 63 68 61 72 61 63    e default charac
02D6D0:  74 65 72 20 73 65 74 20 61 6E 64 20 74 68 65 20    ter set and the 
02D6E0:  64 65 66 61 75 6C 74 20 73 65 74 74 69 6E 67 20    default setting 
02D6F0:  66 6F 72 20 74 68 65 20 63 6F 6E 74 72 6F 6C 20    for the control 
02D700:  63 6F 64 65 0D 0A 20 20 20 20 20 20 20 74 61 62    code..       tab
02D710:  6C 65 20 61 72 65 20 64 65 73 63 72 69 62 65 64    le are described
02D720:  20 69 6E 20 41 70 70 65 6E 64 69 63 65 73 20 56     in Appendices V
02D730:  49 20 61 6E 64 20 56 49 49 2E 0D 0A 0D 0A 0D 0A    I and VII.......
02D740:  20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20 45           Related E
02D750:  6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20    ntries:......   
02D760:  20 20 20 20 53 43 52 20 49 4E 49 54 49 41 4C 49        SCR INITIALI
02D770:  53 45 0D 0A 20 20 20 20 20 20 20 54 58 54 20 52    SE..       TXT R
02D780:  45 53 45 54 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ESET..........  
02D790:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
02D7A0:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
02D7B0:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
02D7C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D7D0:  20 70 61 67 65 20 31 35 2E 32 38 0D 0A 0D 0A 0D     page 15.28.....
02D7E0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
02D7F0:  32 37 3A 20 54 58 54 20 52 45 53 45 54 20 20 20    27: TXT RESET   
02D800:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D810:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D820:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02D830:  20 23 42 42 35 31 0D 0A 0D 0A 0D 0A 20 20 20 20     #BB51......    
02D840:  20 20 20 52 65 73 65 74 20 74 68 65 20 54 65 78       Reset the Tex
02D850:  74 20 56 44 55 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    t VDU.......    
02D860:  20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A       Action:......
02D870:  20 20 20 20 20 20 20 52 65 69 6E 69 74 69 61 6C           Reinitial
02D880:  69 7A 65 20 74 68 65 20 54 65 78 74 20 56 44 55    ize the Text VDU
02D890:  20 69 6E 64 69 72 65 63 74 69 6F 6E 73 20 61 6E     indirections an
02D8A0:  64 20 74 68 65 20 20 63 6F 6E 74 72 6F 6C 20 20    d the  control  
02D8B0:  63 6F 64 65 20 20 74 61 62 6C 65 73 2E 0D 0A 20    code  tables... 
02D8C0:  20 20 20 20 20 20 44 6F 65 73 20 6E 6F 74 20 61          Does not a
02D8D0:  66 66 65 63 74 20 61 6E 79 20 6F 74 68 65 72 20    ffect any other 
02D8E0:  61 73 70 65 63 74 20 6F 66 20 74 68 65 20 54 65    aspect of the Te
02D8F0:  78 74 20 56 44 55 2E 0D 0A 0D 0A 0D 0A 20 20 20    xt VDU.......   
02D900:  20 20 20 20 45 6E 74 72 79 20 63 6F 6E 64 69 74        Entry condit
02D910:  69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    ions:......     
02D920:  20 20 4E 6F 20 63 6F 6E 64 69 74 69 6F 6E 73 2E      No conditions.
02D930:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 78 69    ......       Exi
02D940:  74 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D    t conditions:...
02D950:  0A 0D 0A 20 20 20 20 20 20 20 41 46 2C 42 43 2C    ...       AF,BC,
02D960:  44 45 20 61 6E 64 20 48 4C 20 63 6F 72 72 75 70    DE and HL corrup
02D970:  74 2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F    t...       All o
02D980:  74 68 65 72 20 72 65 67 69 73 74 65 72 73 20 70    ther registers p
02D990:  72 65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A 20    reserved....... 
02D9A0:  20 20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A          Notes:....
02D9B0:  20 20 20 20 20 20 20 54 68 65 20 54 65 78 74 20           The Text 
02D9C0:  56 44 55 20 69 6E 64 69 72 65 63 74 69 6F 6E 73    VDU indirections
02D9D0:  20 54 58 54 20 44 52 41 57 20 20 43 55 52 53 4F     TXT DRAW  CURSO
02D9E0:  52 2C 20 20 54 58 54 20 20 55 4E 44 52 41 57 20    R,  TXT  UNDRAW 
02D9F0:  20 43 55 52 53 4F 52 2C 20 20 54 58 54 0D 0A 20     CURSOR,  TXT.. 
02DA00:  20 20 20 20 20 20 57 52 49 54 45 20 43 48 41 52          WRITE CHAR
02DA10:  2C 20 54 58 54 20 55 4E 57 52 49 54 45 20 61 6E    , TXT UNWRITE an
02DA20:  64 20 54 58 54 20 4F 55 54 20 41 43 54 49 4F 4E    d TXT OUT ACTION
02DA30:  20 61 72 65 20 73 65 74 20 20 74 6F 20 20 74 68     are set  to  th
02DA40:  65 69 72 20 20 64 65 66 61 75 6C 74 0D 0A 20 20    eir  default..  
02DA50:  20 20 20 20 20 72 6F 75 74 69 6E 65 73 2E 0D 0A         routines...
02DA60:  0D 0A 0D 0A 20 20 20 20 20 20 20 54 68 65 20 63    ....       The c
02DA70:  6F 6E 74 72 6F 6C 20 63 6F 64 65 20 74 61 62 6C    ontrol code tabl
02DA80:  65 20 69 73 20 73 65 74 20 75 70 20 74 6F 20 70    e is set up to p
02DA90:  65 72 66 6F 72 6D 20 74 68 65 20 20 64 65 66 61    erform the  defa
02DAA0:  75 6C 74 20 20 63 6F 6E 74 72 6F 6C 20 20 63 6F    ult  control  co
02DAB0:  64 65 0D 0A 20 20 20 20 20 20 20 61 63 74 69 6F    de..       actio
02DAC0:  6E 73 20 28 73 65 65 20 41 70 70 65 6E 64 69 78    ns (see Appendix
02DAD0:  20 56 49 49 29 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A     VII)...........
02DAE0:  20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20 45           Related E
02DAF0:  6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20    ntries:......   
02DB00:  20 20 20 20 54 58 54 20 49 4E 49 54 49 41 4C 49        TXT INITIALI
02DB10:  53 45 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    SE..............
02DB20:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02DB30:  0D 0A 0D 0A 20 20 20 20 20 20 20 41 4D 53 54 52    ....       AMSTR
02DB40:  41 44 20 43 50 43 34 36 34 2F 36 36 34 2F 36 31    AD CPC464/664/61
02DB50:  32 38 20 46 49 52 4D 57 41 52 45 20 20 20 20 20    28 FIRMWARE     
02DB60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DB70:  20 20 20 20 20 20 20 70 61 67 65 20 31 35 2E 32           page 15.2
02DB80:  39 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20    9.............. 
02DB90:  20 20 20 20 20 20 32 38 3A 20 54 58 54 20 56 44          28: TXT VD
02DBA0:  55 20 45 4E 41 42 4C 45 20 20 20 20 20 20 20 20    U ENABLE        
02DBB0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DBC0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DBD0:  20 20 20 20 20 20 20 23 42 42 35 34 0D 0A 0D 0A           #BB54....
02DBE0:  0D 0A 20 20 20 20 20 20 20 41 6C 6C 6F 77 20 63    ..       Allow c
02DBF0:  68 61 72 61 63 74 65 72 73 20 74 6F 20 62 65 20    haracters to be 
02DC00:  70 6C 61 63 65 64 20 6F 6E 20 74 68 65 20 73 63    placed on the sc
02DC10:  72 65 65 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    reen.......     
02DC20:  20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20      Action:...... 
02DC30:  20 20 20 20 20 20 50 65 72 6D 69 74 20 63 68 61          Permit cha
02DC40:  72 61 63 74 65 72 73 20 74 6F 20 62 65 20 70 72    racters to be pr
02DC50:  69 6E 74 65 64 20 77 68 65 6E 20 72 65 71 75 65    inted when reque
02DC60:  73 74 65 64 20 28 62 79 20 63 61 6C 6C 69 6E 67    sted (by calling
02DC70:  20 54 58 54 20 20 4F 55 54 50 55 54 0D 0A 20 20     TXT  OUTPUT..  
02DC80:  20 20 20 20 20 6F 72 20 54 58 54 20 57 52 20 43         or TXT WR C
02DC90:  48 41 52 29 2E 20 45 6E 61 62 6C 69 6E 67 20 61    HAR). Enabling a
02DCA0:  70 70 6C 69 65 73 20 74 6F 20 74 68 65 20 20 63    pplies to the  c
02DCB0:  75 72 72 65 6E 74 6C 79 20 20 73 65 6C 65 63 74    urrently  select
02DCC0:  65 64 20 20 73 74 72 65 61 6D 2E 0D 0A 20 20 20    ed  stream...   
02DCD0:  20 20 20 20 54 68 65 20 63 75 72 73 6F 72 20 62        The cursor b
02DCE0:  6C 6F 62 20 69 73 20 61 6C 73 6F 20 65 6E 61 62    lob is also enab
02DCF0:  6C 65 64 20 28 62 79 20 63 61 6C 6C 69 6E 67 20    led (by calling 
02DD00:  54 58 54 20 43 55 52 20 45 4E 41 42 4C 45 29 2E    TXT CUR ENABLE).
02DD10:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 45 6E 74    ......       Ent
02DD20:  72 79 20 63 6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A    ry conditions:..
02DD30:  0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F 20 63 6F    ....       No co
02DD40:  6E 64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A 0D 0A 20    nditions....... 
02DD50:  20 20 20 20 20 20 45 78 69 74 20 63 6F 6E 64 69          Exit condi
02DD60:  74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    tions:......    
02DD70:  20 20 20 41 46 20 63 6F 72 72 75 70 74 2E 0D 0A       AF corrupt...
02DD80:  20 20 20 20 20 20 20 41 6C 6C 20 6F 74 68 65 72           All other
02DD90:  20 72 65 67 69 73 74 65 72 73 20 70 72 65 73 65     registers prese
02DDA0:  72 76 65 64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20    rved.......     
02DDB0:  20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20      Notes:......  
02DDC0:  20 20 20 20 20 54 68 65 20 63 6F 6E 74 72 6F 6C         The control
02DDD0:  20 63 6F 64 65 20 62 75 66 66 65 72 20 75 73 65     code buffer use
02DDE0:  64 20 62 79 20 54 58 54 20 4F 55 54 50 55 54 20    d by TXT OUTPUT 
02DDF0:  69 73 20 65 6D 70 74 69 65 64 2C 20 61 6E 79 20    is emptied, any 
02DE00:  20 69 6E 63 6F 6D 70 6C 65 74 65 0D 0A 20 20 20     incomplete..   
02DE10:  20 20 20 20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65        control code
02DE20:  20 73 65 71 75 65 6E 63 65 20 77 69 6C 6C 20 62     sequence will b
02DE30:  65 20 6C 6F 73 74 2E 0D 0A 0D 0A 0D 0A 0D 0A 0D    e lost..........
02DE40:  0A 20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20    .       Related 
02DE50:  65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20    entries:......  
02DE60:  20 20 20 20 20 54 58 54 20 41 53 4B 20 53 54 41         TXT ASK STA
02DE70:  54 45 0D 0A 20 20 20 20 20 20 20 54 58 54 20 43    TE..       TXT C
02DE80:  55 52 20 45 4E 41 42 4C 45 0D 0A 20 20 20 20 20    UR ENABLE..     
02DE90:  20 20 54 58 54 20 4F 55 54 50 55 54 0D 0A 20 20      TXT OUTPUT..  
02DEA0:  20 20 20 20 20 54 58 54 20 56 44 55 20 44 49 53         TXT VDU DIS
02DEB0:  41 42 4C 45 0D 0A 20 20 20 20 20 20 20 54 58 54    ABLE..       TXT
02DEC0:  20 57 52 20 43 48 41 52 0D 0A 0D 0A 0D 0A 0D 0A     WR CHAR........
02DED0:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    ................
02DEE0:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
02DEF0:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
02DF00:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
02DF10:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DF20:  20 20 20 20 20 20 20 20 20 20 20 70 61 67 65 20               page 
02DF30:  31 35 2E 33 30 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D    15.30...........
02DF40:  0A 0D 0A 20 20 20 20 20 20 20 32 39 3A 20 54 58    ...       29: TX
02DF50:  54 20 56 44 55 20 44 49 53 41 42 4C 45 20 20 20    T VDU DISABLE   
02DF60:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DF70:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02DF80:  20 20 20 20 20 20 20 20 20 20 20 23 42 42 35 37               #BB57
02DF90:  0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 50 72 65    ......       Pre
02DFA0:  76 65 6E 74 20 63 68 61 72 61 63 74 65 72 20 62    vent character b
02DFB0:  65 69 6E 67 20 70 6C 61 63 65 64 20 6F 6E 20 74    eing placed on t
02DFC0:  68 65 20 73 63 72 65 65 6E 2E 0D 0A 0D 0A 0D 0A    he screen.......
02DFD0:  20 20 20 20 20 20 20 41 63 74 69 6F 6E 3A 0D 0A           Action:..
02DFE0:  0D 0A 0D 0A 20 20 20 20 20 20 20 50 72 65 76 65    ....       Preve
02DFF0:  6E 74 73 20 63 68 61 72 61 63 74 65 72 73 20 62    nts characters b
02E000:  65 69 6E 67 20 70 72 69 6E 74 65 64 20 6F 6E 20    eing printed on 
02E010:  74 68 65 20 73 63 72 65 65 6E 20 28 77 68 65 6E    the screen (when
02E020:  20 20 54 58 54 20 20 4F 55 54 50 55 54 20 20 6F      TXT  OUTPUT  o
02E030:  72 0D 0A 20 20 20 20 20 20 20 54 58 54 20 57 52    r..       TXT WR
02E040:  20 43 48 41 52 20 69 73 20 63 61 6C 6C 65 64 29     CHAR is called)
02E050:  2E 20 41 70 70 6C 69 65 73 20 74 6F 20 74 68 65    . Applies to the
02E060:  20 63 75 72 72 65 6E 74 6C 79 20 73 65 6C 65 63     currently selec
02E070:  74 65 64 20 73 74 72 65 61 6D 2E 20 20 54 68 65    ted stream.  The
02E080:  0D 0A 20 20 20 20 20 20 20 63 75 72 73 6F 72 20    ..       cursor 
02E090:  62 6C 6F 62 20 69 73 20 61 6C 73 6F 20 64 69 73    blob is also dis
02E0A0:  61 62 6C 65 64 20 28 62 79 20 63 61 6C 6C 69 6E    abled (by callin
02E0B0:  67 20 54 58 54 20 43 55 52 20 44 49 53 41 42 4C    g TXT CUR DISABL
02E0C0:  45 29 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    E).......       
02E0D0:  45 6E 74 72 79 20 63 6F 6E 64 69 74 69 6F 6E 73    Entry conditions
02E0E0:  3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E 6F    :......       No
02E0F0:  20 63 6F 6E 64 69 74 69 6F 6E 73 2E 0D 0A 0D 0A     conditions.....
02E100:  0D 0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F    ..       Exit co
02E110:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20    nditions:...... 
02E120:  20 20 20 20 20 20 41 46 20 63 6F 72 72 75 70 74          AF corrupt
02E130:  2E 0D 0A 20 20 20 20 20 20 20 41 6C 6C 20 6F 74    ...       All ot
02E140:  68 65 72 20 72 65 67 69 73 74 65 72 73 20 70 72    her registers pr
02E150:  65 73 65 72 76 65 64 2E 0D 0A 0D 0A 0D 0A 20 20    eserved.......  
02E160:  20 20 20 20 20 4E 6F 74 65 73 3A 0D 0A 0D 0A 0D         Notes:.....
02E170:  0A 20 20 20 20 20 20 20 54 68 65 20 63 6F 6E 74    .       The cont
02E180:  72 6F 6C 20 63 6F 64 65 20 62 75 66 66 65 72 20    rol code buffer 
02E190:  75 73 65 64 20 62 79 20 54 58 54 20 4F 55 54 50    used by TXT OUTP
02E1A0:  55 54 20 69 73 20 65 6D 70 74 69 65 64 2C 20 61    UT is emptied, a
02E1B0:  6E 79 20 20 69 6E 63 6F 6D 70 6C 65 74 65 0D 0A    ny  incomplete..
02E1C0:  20 20 20 20 20 20 20 63 6F 6E 74 72 6F 6C 20 63           control c
02E1D0:  6F 64 65 20 73 65 71 75 65 6E 63 65 20 77 69 6C    ode sequence wil
02E1E0:  6C 20 62 65 20 6C 6F 73 74 2E 0D 0A 0D 0A 0D 0A    l be lost.......
02E1F0:  20 20 20 20 20 20 20 49 6E 20 56 31 2E 31 20 66           In V1.1 f
02E200:  69 72 6D 77 61 72 65 20 63 6F 6E 74 72 6F 6C 20    irmware control 
02E210:  63 6F 64 65 73 20 61 72 65 20 73 74 69 6C 6C 20    codes are still 
02E220:  6F 62 65 79 65 64 20 62 79 20 54 58 54 20 4F 55    obeyed by TXT OU
02E230:  54 50 55 54 2E 20 49 6E 20 56 31 2E 31 0D 0A 20    TPUT. In V1.1.. 
02E240:  20 20 20 20 20 20 66 69 72 6D 77 61 72 65 20 6F          firmware o
02E250:  6E 6C 79 20 74 68 6F 73 65 20 63 6F 6E 74 72 6F    nly those contro
02E260:  6C 20 63 6F 64 65 73 20 77 68 69 63 68 20 61 72    l codes which ar
02E270:  65 20 6D 61 72 6B 65 64 20 69 6E 20 74 68 65 20    e marked in the 
02E280:  63 6F 6E 74 72 6F 6C 20 63 6F 64 65 0D 0A 20 20    control code..  
02E290:  20 20 20 20 20 74 61 62 6C 65 20 77 69 6C 6C 20         table will 
02E2A0:  62 65 20 6F 62 65 79 65 64 3B 20 6F 74 68 65 72    be obeyed; other
02E2B0:  20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65 73 20 77     control codes w
02E2C0:  69 6C 6C 20 62 65 20 69 67 6E 6F 72 65 64 20 28    ill be ignored (
02E2D0:  73 65 65 20 73 65 63 74 69 6F 6E 0D 0A 20 20 20    see section..   
02E2E0:  20 20 20 20 34 2E 37 29 2E 0D 0A 0D 0A 0D 0A 0D        4.7)........
02E2F0:  0A 20 20 20 20 20 20 20 52 65 6C 61 74 65 64 20    .       Related 
02E300:  65 6E 74 72 69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20    entries:......  
02E310:  20 20 20 20 20 54 58 54 20 41 53 4B 20 53 54 41         TXT ASK STA
02E320:  54 45 0D 0A 20 20 20 20 20 20 20 54 58 54 20 43    TE..       TXT C
02E330:  55 52 20 45 4E 41 42 4C 45 0D 0A 20 20 20 20 20    UR ENABLE..     
02E340:  20 20 54 58 54 20 4F 55 54 50 55 54 0D 0A 20 20      TXT OUTPUT..  
02E350:  20 20 20 20 20 54 58 54 20 56 44 55 20 44 49 53         TXT VDU DIS
02E360:  41 42 4C 45 0D 0A 20 20 20 20 20 20 20 54 58 54    ABLE..       TXT
02E370:  20 57 52 20 43 48 41 52 0D 0A 0D 0A 0D 0A 0D 0A     WR CHAR........
02E380:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
02E390:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
02E3A0:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
02E3B0:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
02E3C0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02E3D0:  20 70 61 67 65 20 31 35 2E 33 31 0D 0A 0D 0A 0D     page 15.31.....
02E3E0:  0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20    .........       
02E3F0:  33 30 3A 20 54 58 54 20 4F 55 54 50 55 54 20 20    30: TXT OUTPUT  
02E400:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02E410:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02E420:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02E430:  20 23 42 42 35 41 0D 0A 0D 0A 20 20 20 20 20 20     #BB5A....      
02E440:  20 4F 75 74 70 75 74 20 61 20 63 68 61 72 61 63     Output a charac
02E450:  74 65 72 20 6F 72 20 63 6F 6E 74 72 6F 6C 20 63    ter or control c
02E460:  6F 64 65 20 74 6F 20 74 68 65 20 54 65 78 74 20    ode to the Text 
02E470:  56 44 55 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 41    VDU.....       A
02E480:  63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    ction:......    
02E490:  20 20 20 4F 75 74 70 75 74 20 63 68 61 72 61 63       Output charac
02E4A0:  74 65 72 73 20 74 6F 20 74 68 65 20 73 63 72 65    ters to the scre
02E4B0:  65 6E 20 61 6E 64 20 20 6F 62 65 79 20 20 63 6F    en and  obey  co
02E4C0:  6E 74 72 6F 6C 20 20 63 6F 64 65 73 20 20 28 63    ntrol  codes  (c
02E4D0:  68 61 72 61 63 74 65 72 73 0D 0A 20 20 20 20 20    haracters..     
02E4E0:  20 20 23 30 30 2E 2E 23 31 46 29 2E 20 57 6F 72      #00..#1F). Wor
02E4F0:  6B 73 20 6F 6E 20 74 68 65 20 63 75 72 72 65 6E    ks on the curren
02E500:  74 6C 79 20 73 65 6C 65 63 74 65 64 20 73 74 72    tly selected str
02E510:  65 61 6D 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    eam.......      
02E520:  20 45 6E 74 72 79 20 63 6F 6E 64 69 74 69 6F 6E     Entry condition
02E530:  73 3A 0D 0A 0D 0A 20 20 20 20 20 20 20 41 20 63    s:....       A c
02E540:  6F 6E 74 61 69 6E 73 20 74 68 65 20 63 68 61 72    ontains the char
02E550:  61 63 74 65 72 20 74 6F 20 73 65 6E 64 2E 0D 0A    acter to send...
02E560:  0D 0A 20 20 20 20 20 20 20 45 78 69 74 20 63 6F    ..       Exit co
02E570:  6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 20 20 20    nditions:....   
02E580:  20 20 20 20 41 6C 6C 20 72 65 67 69 73 74 65 72        All register
02E590:  73 20 61 6E 64 20 66 6C 61 67 73 20 70 72 65 73    s and flags pres
02E5A0:  65 72 76 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20    erved.....      
02E5B0:  20 4E 6F 74 65 73 3A 0D 0A 0D 0A 20 20 20 20 20     Notes:....     
02E5C0:  20 20 54 68 69 73 20 72 6F 75 74 69 6E 65 20 63      This routine c
02E5D0:  61 6C 6C 73 20 74 68 65 20 54 58 54 20 4F 55 54    alls the TXT OUT
02E5E0:  20 41 43 54 49 4F 4E 20 69 6E 64 69 72 65 63 74     ACTION indirect
02E5F0:  69 6F 6E 20 74 6F 20 64 6F 20 20 74 68 65 20 20    ion to do  the  
02E600:  54 72 61 63 6B 2D 49 6E 66 6F 0D 0A 00 01 00 00    Track-Info......
02E610:  27 00 00 00 02 09 50 E5 27 00 C1 02 00 00 00 02    '.....P.'.......
02E620:  27 00 C2 02 00 00 00 02 27 00 C3 02 00 00 00 02    '.......'.......
02E630:  27 00 C4 02 00 00 00 02 27 00 C5 02 00 00 00 02    '.......'.......
02E640:  27 00 C6 02 00 00 00 02 27 00 C7 02 00 00 00 02    '.......'.......
02E650:  27 00 C8 02 00 00 00 02 27 00 C9 02 00 00 00 02    '.......'.......
02E660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6A0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6B0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6C0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6D0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6E0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E6F0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
02E700:  77 6F 72 6B 20 20 6F 66 0D 0A 20 20 20 20 20 20    work  of..      
02E710:  20 70 72 69 6E 74 69 6E 67 20 74 68 65 20 63 68     printing the ch
02E720:  61 72 61 63 74 65 72 20 6F 72 20 6F 62 65 79 69    aracter or obeyi
02E730:  6E 67 20 74 68 65 20 63 6F 6E 74 72 6F 6C 20 63    ng the control c
02E740:  6F 64 65 20 64 65 73 63 72 69 62 65 64 20 62 65    ode described be
02E750:  6C 6F 77 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 43    low.....       C
02E760:  6F 6E 74 72 6F 6C 20 63 6F 64 65 73 20 6D 61 79    ontrol codes may
02E770:  20 74 61 6B 65 20 75 70 20 74 6F 20 39 20 70 61     take up to 9 pa
02E780:  72 61 6D 65 74 65 72 73 2E 20 54 68 65 73 65 20    rameters. These 
02E790:  20 61 72 65 20 20 74 68 65 20 20 63 68 61 72 61     are  the  chara
02E7A0:  63 74 65 72 73 0D 0A 20 20 20 20 20 20 20 73 65    cters..       se
02E7B0:  6E 74 20 66 6F 6C 6C 6F 77 69 6E 67 20 74 68 65    nt following the
02E7C0:  20 69 6E 69 74 69 61 6C 20 20 63 6F 6E 74 72 6F     initial  contro
02E7D0:  6C 20 20 63 6F 64 65 2E 20 20 54 68 65 20 20 63    l  code.  The  c
02E7E0:  68 61 72 61 63 74 65 72 73 20 20 73 65 6E 74 20    haracters  sent 
02E7F0:  20 61 72 65 0D 0A 20 20 20 20 20 20 20 73 74 6F     are..       sto
02E800:  72 65 64 20 69 6E 20 74 68 65 20 63 6F 6E 74 72    red in the contr
02E810:  6F 6C 20 63 6F 64 65 20 62 75 66 66 65 72 20 75    ol code buffer u
02E820:  6E 74 69 6C 20 73 75 66 66 69 63 69 65 6E 74 20    ntil sufficient 
02E830:  68 61 76 65 20 62 65 65 6E 20 20 72 65 63 65 69    have been  recei
02E840:  76 65 64 0D 0A 20 20 20 20 20 20 20 74 6F 20 6D    ved..       to m
02E850:  61 6B 65 20 75 70 20 61 6C 6C 20 74 68 65 20 70    ake up all the p
02E860:  61 72 61 6D 65 74 65 72 73 2E 20 54 68 65 20 63    arameters. The c
02E870:  6F 6E 74 72 6F 6C 20 63 6F 64 65 20 62 75 66 66    ontrol code buff
02E880:  65 72 20 20 69 73 20 20 6F 6E 6C 79 20 20 6C 6F    er  is  only  lo
02E890:  6E 67 0D 0A 20 20 20 20 20 20 20 65 6E 6F 75 67    ng..       enoug
02E8A0:  68 20 74 6F 20 61 63 63 65 70 74 20 39 20 70 61    h to accept 9 pa
02E8B0:  72 61 6D 65 74 65 72 20 63 68 61 72 61 63 74 65    rameter characte
02E8C0:  72 73 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 54 68    rs.....       Th
02E8D0:  65 72 65 20 69 73 20 6F 6E 6C 79 20 6F 6E 65 20    ere is only one 
02E8E0:  63 6F 6E 74 72 6F 6C 20 63 6F 64 65 20 62 75 66    control code buf
02E8F0:  66 65 72 20 66 6F 72 20 61 6C 6C 20 73 74 72 65    fer for all stre
02E900:  61 6D 73 2E 20 49 74 20 69 73 20 74 68 65 72 65    ams. It is there
02E910:  66 6F 72 65 0D 0A 20 20 20 20 20 20 20 70 6F 73    fore..       pos
02E920:  73 69 62 6C 65 20 74 6F 20 67 65 74 20 75 6E 70    sible to get unp
02E930:  72 65 64 69 63 74 61 62 6C 65 20 72 65 73 75 6C    redictable resul
02E940:  74 73 20 69 66 20 74 68 65 20 6F 75 74 70 75 74    ts if the output
02E950:  20 73 74 72 65 61 6D 20 69 73 20 20 63 68 61 6E     stream is  chan
02E960:  67 65 64 0D 0A 20 20 20 20 20 20 20 6D 69 64 77    ged..       midw
02E970:  61 79 20 74 68 72 6F 75 67 68 20 73 65 6E 64 69    ay through sendi
02E980:  6E 67 20 61 20 63 6F 6E 74 72 6F 6C 20 63 6F 64    ng a control cod
02E990:  65 20 73 65 71 75 65 6E 63 65 2E 0D 0A 0D 0A 20    e sequence..... 
02E9A0:  20 20 20 20 20 20 49 66 20 74 68 65 20 56 44 55          If the VDU
02E9B0:  20 69 73 20 64 69 73 61 62 6C 65 64 20 74 68 65     is disabled the
02E9C0:  6E 20 6E 6F 20 20 63 68 61 72 61 63 74 65 72 73    n no  characters
02E9D0:  20 20 77 69 6C 6C 20 20 62 65 20 20 70 72 69 6E      will  be  prin
02E9E0:  74 65 64 20 20 6F 6E 20 20 74 68 65 0D 0A 20 20    ted  on  the..  
02E9F0:  20 20 20 20 20 73 63 72 65 65 6E 2E 20 49 6E 20         screen. In 
02EA00:  56 31 2E 30 20 66 69 72 6D 77 61 72 65 20 61 6C    V1.0 firmware al
02EA10:  6C 20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65 73 20    l control codes 
02EA20:  77 69 6C 6C 20 73 74 69 6C 6C 20 62 65 20 6F 62    will still be ob
02EA30:  65 79 65 64 20 62 75 74 20 69 6E 0D 0A 20 20 20    eyed but in..   
02EA40:  20 20 20 20 56 31 2E 31 20 66 69 72 6D 77 61 72        V1.1 firmwar
02EA50:  65 20 6F 6E 6C 79 20 74 68 6F 73 65 20 63 6F 64    e only those cod
02EA60:  65 73 20 6D 61 72 6B 65 64 20 69 6E 20 74 68 65    es marked in the
02EA70:  20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65 20 74 61     control code ta
02EA80:  62 6C 65 20 61 73 20 20 74 6F 0D 0A 20 20 20 20    ble as  to..    
02EA90:  20 20 20 62 65 20 6F 62 65 79 65 64 20 77 68 65       be obeyed whe
02EAA0:  6E 20 74 68 65 20 56 44 55 20 69 73 20 64 69 73    n the VDU is dis
02EAB0:  61 62 6C 65 64 20 77 69 6C 6C 20 62 65 20 6F 62    abled will be ob
02EAC0:  65 79 65 64 20 28 73 65 65 20 73 65 63 74 69 6F    eyed (see sectio
02EAD0:  6E 20 34 2E 37 29 2E 0D 0A 0D 0A 20 20 20 20 20    n 4.7).....     
02EAE0:  20 20 49 66 20 74 68 65 20 67 72 61 70 68 69 63      If the graphic
02EAF0:  20 63 68 61 72 61 63 74 65 72 20 77 72 69 74 65     character write
02EB00:  20 6D 6F 64 65 20 69 73 20 65 6E 61 62 6C 65 64     mode is enabled
02EB10:  20 74 68 65 6E 20 61 6C 6C 20 63 68 61 72 61 63     then all charac
02EB20:  74 65 72 73 20 61 6E 64 0D 0A 20 20 20 20 20 20    ters and..      
02EB30:  20 63 6F 6E 74 72 6F 6C 20 63 6F 64 65 73 20 61     control codes a
02EB40:  72 65 20 70 72 69 6E 74 65 64 20 75 73 69 6E 67    re printed using
02EB50:  20 74 68 65 20 47 72 61 70 68 69 63 73 20 56 44     the Graphics VD
02EB60:  55 20 72 6F 75 74 69 6E 65 2C 20 47 52 41 20 57    U routine, GRA W
02EB70:  52 20 20 43 48 41 52 2C 0D 0A 20 20 20 20 20 20    R  CHAR,..      
02EB80:  20 61 6E 64 20 61 72 65 20 6E 6F 74 20 6F 62 65     and are not obe
02EB90:  79 65 64 2E 0D 0A 0D 0A 20 20 20 20 20 20 20 43    yed.....       C
02EBA0:  68 61 72 61 63 74 65 72 73 20 61 72 65 20 77 72    haracters are wr
02EBB0:  69 74 74 65 6E 20 69 6E 20 20 74 68 65 20 20 73    itten in  the  s
02EBC0:  61 6D 65 20 20 77 61 79 20 20 74 68 61 74 20 20    ame  way  that  
02EBD0:  54 58 54 20 20 57 52 20 20 43 48 41 52 20 20 77    TXT  WR  CHAR  w
02EBE0:  72 69 74 65 73 0D 0A 20 20 20 20 20 20 20 63 68    rites..       ch
02EBF0:  61 72 61 63 74 65 72 73 2E 0D 0A 0D 0A 0D 0A 20    aracters....... 
02EC00:  20 20 20 20 20 20 52 65 6C 61 74 65 64 20 65 6E          Related en
02EC10:  74 72 69 65 73 3A 0D 0A 0D 0A 20 20 20 20 20 20    tries:....      
02EC20:  20 47 52 41 20 57 52 20 43 48 41 52 0D 0A 20 20     GRA WR CHAR..  
02EC30:  20 20 20 20 20 54 58 54 20 4F 55 54 20 41 43 54         TXT OUT ACT
02EC40:  49 4F 4E 0D 0A 20 20 20 20 20 20 20 54 58 54 20    ION..       TXT 
02EC50:  53 45 54 20 47 52 41 50 48 49 43 0D 0A 20 20 20    SET GRAPHIC..   
02EC60:  20 20 20 20 54 58 54 20 56 44 55 20 44 49 53 41        TXT VDU DISA
02EC70:  42 4C 45 0D 0A 20 20 20 20 20 20 20 54 58 54 20    BLE..       TXT 
02EC80:  56 44 55 20 45 4E 41 42 4C 45 0D 0A 20 20 20 20    VDU ENABLE..    
02EC90:  20 20 20 54 58 54 20 57 52 20 43 48 41 52 0D 0A       TXT WR CHAR..
02ECA0:  0D 0A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 41    ........       A
02ECB0:  4D 53 54 52 41 44 20 43 50 43 34 36 34 2F 36 36    MSTRAD CPC464/66
02ECC0:  34 2F 36 31 32 38 20 46 49 52 4D 57 41 52 45 20    4/6128 FIRMWARE 
02ECD0:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02ECE0:  20 20 20 20 20 20 20 20 20 20 70 61 67 65 20 31              page 1
02ECF0:  35 2E 33 32 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A    5.32............
02ED00:  0D 0A 20 20 20 20 20 20 20 33 31 3A 20 54 58 54    ..       31: TXT
02ED10:  20 57 52 20 43 48 41 52 20 20 20 20 20 20 20 20     WR CHAR        
02ED20:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02ED30:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02ED40:  20 20 20 20 23 42 42 35 44 0D 0A 0D 0A 0D 0A 20        #BB5D...... 
02ED50:  20 20 20 20 20 20 57 72 69 74 65 20 61 20 63 68          Write a ch
02ED60:  61 72 61 63 74 65 72 20 74 6F 20 74 68 65 20 73    aracter to the s
02ED70:  63 72 65 65 6E 2E 0D 0A 0D 0A 0D 0A 20 20 20 20    creen.......    
02ED80:  20 20 20 41 63 74 69 6F 6E 3A 0D 0A 0D 0A 0D 0A       Action:......
02ED90:  20 20 20 20 20 20 20 50 72 69 6E 74 20 61 20 63           Print a c
02EDA0:  68 61 72 61 63 74 65 72 20 20 6F 6E 20 20 74 68    haracter  on  th
02EDB0:  65 20 20 73 63 72 65 65 6E 20 20 61 74 20 20 74    e  screen  at  t
02EDC0:  68 65 20 20 63 75 72 73 6F 72 20 20 70 6F 73 69    he  cursor  posi
02EDD0:  74 69 6F 6E 20 20 6F 66 20 20 74 68 65 0D 0A 20    tion  of  the.. 
02EDE0:  20 20 20 20 20 20 63 75 72 72 65 6E 74 6C 79 20          currently 
02EDF0:  73 65 6C 65 63 74 65 64 20 73 74 72 65 61 6D 2E    selected stream.
02EE00:  20 43 6F 6E 74 72 6F 6C 20 20 63 6F 64 65 73 20     Control  codes 
02EE10:  20 28 63 68 61 72 61 63 74 65 72 73 20 20 23 30     (characters  #0
02EE20:  30 2E 2E 23 31 46 29 20 20 61 72 65 0D 0A 20 20    0..#1F)  are..  
02EE30:  20 20 20 20 20 70 72 69 6E 74 65 72 20 61 6E 64         printer and
02EE40:  20 6E 6F 74 20 6F 62 65 79 65 64 2E 0D 0A 0D 0A     not obeyed.....
02EE50:  0D 0A 20 20 20 20 20 20 20 45 6E 74 72 79 20 63    ..       Entry c
02EE60:  6F 6E 64 69 74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A    onditions:......
02EE70:  20 20 20 20 20 20 20 41 20 63 6F 6E 74 61 69 6E           A contain
02EE80:  73 20 74 68 65 20 63 68 61 72 61 63 74 65 72 20    s the character 
02EE90:  74 6F 20 70 72 69 6E 74 2E 0D 0A 0D 0A 0D 0A 20    to print....... 
02EEA0:  20 20 20 20 20 20 45 78 69 74 20 63 6F 6E 64 69          Exit condi
02EEB0:  74 69 6F 6E 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20    tions:......    
02EEC0:  20 20 20 41 46 2C 42 43 2C 44 45 20 61 6E 64 20       AF,BC,DE and 
02EED0:  48 4C 20 63 6F 72 72 75 70 74 2E 0D 0A 20 20 20    HL corrupt...   
02EEE0:  20 20 20 20 41 6C 6C 20 6F 74 68 65 72 20 72 65        All other re
02EEF0:  67 69 73 74 65 72 73 20 70 72 65 73 65 72 76 65    gisters preserve
02EF00:  64 2E 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20 20 4E    d.......       N
02EF10:  6F 74 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20    otes:......     
02EF20:  20 20 49 66 20 74 68 65 20 56 44 55 20 69 73 20      If the VDU is 
02EF30:  64 69 73 61 62 6C 65 64 20 74 68 65 6E 20 6E 6F    disabled then no
02EF40:  20 63 68 61 72 61 63 74 65 72 20 77 69 6C 6C 20     character will 
02EF50:  62 65 20 70 72 69 6E 74 65 64 2E 0D 0A 0D 0A 0D    be printed......
02EF60:  0A 20 20 20 20 20 20 20 42 65 66 6F 72 65 20 70    .       Before p
02EF70:  72 69 6E 74 69 6E 67 20 74 68 65 20 63 68 61 72    rinting the char
02EF80:  61 63 74 65 72 20 74 68 65 20 63 75 72 73 6F 72    acter the cursor
02EF90:  20 70 6F 73 69 74 69 6F 6E 20 20 69 73 20 20 66     position  is  f
02EFA0:  6F 72 63 65 64 20 20 74 6F 20 20 6C 69 65 0D 0A    orced  to  lie..
02EFB0:  20 20 20 20 20 20 20 77 69 74 68 69 6E 20 20 74           within  t
02EFC0:  68 65 20 20 74 65 78 74 20 20 77 69 6E 64 6F 77    he  text  window
02EFD0:  20 20 28 73 65 65 20 20 54 58 54 20 20 56 41 4C      (see  TXT  VAL
02EFE0:  49 44 41 54 45 29 2E 20 20 41 66 74 65 72 20 20    IDATE).  After  
02EFF0:  70 72 69 6E 74 69 6E 67 20 20 74 68 65 0D 0A 20    printing  the.. 
02F000:  20 20 20 20 20 20 63 68 61 72 61 63 74 65 72 20          character 
02F010:  74 68 65 20 63 75 72 73 6F 72 20 69 73 20 6D 6F    the cursor is mo
02F020:  76 65 64 20 72 69 67 68 74 20 6F 6E 65 20 63 68    ved right one ch
02F030:  61 72 61 63 74 65 72 2E 0D 0A 0D 0A 0D 0A 20 20    aracter.......  
02F040:  20 20 20 20 20 54 6F 20 70 75 74 20 74 68 65 20         To put the 
02F050:  63 68 61 72 61 63 74 65 72 20 6F 6E 20 74 68 65    character on the
02F060:  20 73 63 72 65 65 6E 20 74 68 69 73 20 72 6F 75     screen this rou
02F070:  74 69 6E 65 20 63 61 6C 6C 73 20 20 74 68 65 20    tine calls  the 
02F080:  20 54 58 54 20 20 57 52 49 54 45 0D 0A 20 20 20     TXT  WRITE..   
02F090:  20 20 20 20 43 48 41 52 20 69 6E 64 69 72 65 63        CHAR indirec
02F0A0:  74 69 6F 6E 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    tion.........   
02F0B0:  20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72        Related entr
02F0C0:  69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ies:......      
02F0D0:  20 47 52 41 20 57 52 20 43 48 41 52 0D 0A 20 20     GRA WR CHAR..  
02F0E0:  20 20 20 20 20 54 58 54 20 4F 55 54 50 55 54 0D         TXT OUTPUT.
02F0F0:  0A 20 20 20 20 20 20 20 54 58 54 20 52 44 20 43    .       TXT RD C
02F100:  48 41 52 0D 0A 20 20 20 20 20 20 20 54 58 54 20    HAR..       TXT 
02F110:  57 52 49 54 45 20 43 48 41 52 0D 0A 0D 0A 0D 0A    WRITE CHAR......
02F120:  0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 0D 0A 20 20    ..............  
02F130:  20 20 20 20 20 41 4D 53 54 52 41 44 20 43 50 43         AMSTRAD CPC
02F140:  34 36 34 2F 36 36 34 2F 36 31 32 38 20 46 49 52    464/664/6128 FIR
02F150:  4D 57 41 52 45 20 20 20 20 20 20 20 20 20 20 20    MWARE           
02F160:  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                    
02F170:  20 70 61 67 65 20 31 35 2E 33 33 0D 0A 1A 74 6F     page 15.33...to
02F180:  61 63 74 65 72 20 74 68 65 20 63 75 72 73 6F 72    acter the cursor
02F190:  20 70 6F 73 69 74 69 6F 6E 20 20 69 73 20 20 66     position  is  f
02F1A0:  6F 72 63 65 64 20 20 74 6F 20 20 6C 69 65 0D 0A    orced  to  lie..
02F1B0:  20 20 20 20 20 20 20 77 69 74 68 69 6E 20 20 74           within  t
02F1C0:  68 65 20 20 74 65 78 74 20 20 77 69 6E 64 6F 77    he  text  window
02F1D0:  20 20 28 73 65 65 20 20 54 58 54 20 20 56 41 4C      (see  TXT  VAL
02F1E0:  49 44 41 54 45 29 2E 20 20 41 66 74 65 72 20 20    IDATE).  After  
02F1F0:  70 72 69 6E 74 69 6E 67 20 20 74 68 65 0D 0A 20    printing  the.. 
02F200:  20 20 20 20 20 20 63 68 61 72 61 63 74 65 72 20          character 
02F210:  74 68 65 20 63 75 72 73 6F 72 20 69 73 20 6D 6F    the cursor is mo
02F220:  76 65 64 20 72 69 67 68 74 20 6F 6E 65 20 63 68    ved right one ch
02F230:  61 72 61 63 74 65 72 2E 0D 0A 0D 0A 0D 0A 20 20    aracter.......  
02F240:  20 20 20 20 20 54 6F 20 70 75 74 20 74 68 65 20         To put the 
02F250:  63 68 61 72 61 63 74 65 72 20 6F 6E 20 74 68 65    character on the
02F260:  20 73 63 72 65 65 6E 20 74 68 69 73 20 72 6F 75     screen this rou
02F270:  74 69 6E 65 20 63 61 6C 6C 73 20 20 74 68 65 20    tine calls  the 
02F280:  20 54 58 54 20 20 57 52 49 54 45 0D 0A 20 20 20     TXT  WRITE..   
02F290:  20 20 20 20 43 48 41 52 20 69 6E 64 69 72 65 63        CHAR indirec
02F2A0:  74 69 6F 6E 2E 0D 0A 0D 0A 0D 0A 0D 0A 20 20 20    tion.........   
02F2B0:  20 20 20 20 52 65 6C 61 74 65 64 20 65 6E 74 72        Related entr
02F2C0:  69 65 73 3A 0D 0A 0D 0A 0D 0A 20 20 20 20 20 20    ies:......      
02F2D0:  20 47 52 41 20 57 52 20 43 48 41 52 0D 0A 20 20     GRA WR CHAR..  
02F2E0:  20 20 20 20 20 54 58 54 20 4F 55 54 50 55 54 0D         TXT OUTPUT.
02F2F0:  0A 20 20 20 20 20 20 20 54 58 54 20 52 44 20 43    .       TXT RD C
02F300:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F310:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F320:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F330:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F340:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F350:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F360:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F370:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F380:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F390:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F3F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F400:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F410:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F420:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F430:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F440:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F450:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F460:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F470:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F480:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F490:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F4F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F500:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F510:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F520:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F530:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F540:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F550:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F560:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F570:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F580:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F590:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F5F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F600:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F610:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F620:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F630:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F640:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F650:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F660:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F670:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F680:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F690:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F6F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F700:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F710:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F720:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F730:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F740:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F750:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F760:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F770:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F780:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F790:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F7F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F800:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F810:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F820:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F830:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F840:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F850:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F860:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F870:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F880:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F890:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8A0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8B0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8C0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8D0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8E0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
02F8F0:  E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5 E5    ................
RESULT OF SEARCH :
PRO=220   CHEA=0   COD=51   MUSI=0   COP=7   GRA=184   WRIT=53   198=1   199=1   STARTER=0   KBI=0   CAAV=0   L.TOURNIER=0  
EXTENDED CPC DSK File    SAMdisk120417(  PCHAP-10 1  !"#$%&'()*+,CHAP-10 1 -CHAP
-10 2 ./0123456789CHAP-10 2 CHAP-11   TABCDEFGHICHAP-12   QJKLMNOPQRSTCHAP-13   
GUVWXYZCHAP-14 1 abcdefghijklmCHAP-14 2 nopqrstuvwxyzCHAP-14 3 'CHAP-15 1 CHAP-1
5 2 CHAP-15 2 £CHAP-15 3 qCHAP-9  1   CHAP-9  1 CHAP-9  2 N                   9 
AMSDOS           AMSDOS is a disc operating system used  with  all  the  CPC  ra
nge  of         computer, of course, in the case of  the  464  the  DDI-1  has  
to  be         fitted. AMSDOS enables programs to be access disc files in  a  si
milar         manner to cassette files, indeed existing programs which currently
 use         the cassette should be able to  use  disc  files  with  little  or 
 no         modification. The main source of incompatability  will  be  filename
s,         AMSDOS filenames must conform to CP/M standards but cassette filename
s         are far less restricted.             AMSDOS has been designed to compl
ement CP/M, not to compete  with  it.         They share the same file structure
 and can read and write each other's         files.           AMSDOS resides in 
the same ROM as the CP/M BIOS.             9.1 Features.             AMSDOS prov
ides the following facilities                    Switching the cassette input an
d output streams to  and  from                  disc. So that all the facilities
 available  on  the  cassette                  become available on disc.        
            Displaying the disc directory.                    Erasing disc files
.                    Renaming disc files.                    Selecting the defau
lt drive and user.               Whenever AMSDOS creates a new file it is always
 given a  name  with  a         type part of .$$$ regardless of the  given  name
.  When  the  file  is         closed any previous version of the file is rename
d with  a  .BAK  type         part and the new version is renamed from .$$$ to i
ts proper name.  Any         existing .BAK version is deleted. This gives an  au
tomatic  one  level         file back-up.           For example, if the disc con
tains the files FRED.BAS and FRED.BAK  and         the user opens a file called 
FRED.BAS the AMSDOS  will  create  a  new         file called FRED.$$$. When the
 file is closed the existing FRED.BAK is         deleted, FRED.BAS is renamed to
 FRED.BAK and FRED.$$$ is then  renamed         to FRED.BAS.           All AMSDO
S facilities  are  implemented  either  by  intercepting  the         cassette f
irmware calls or by external commands.             AMSTRAD CPC464/664/6128 FIRMW
ARE                              page 9.1                     The intercepted fi
rmware calls are                      CAS IN OPEN                  CAS IN CHAR  
                CAS IN DIRECT                  CAS RETURN                  CAS T
EST EOF                  CAS IN CLOSE                  CA  PS IN ABANDON        
          CAS OUT OPEN                    CAS OUT CHAR                  CAS OUT 
DIRECT                  CAS OUT CLOSE                  CAS OUT ABANDON          
        CAS OUT CATALOG             The remaining cassette firmware calls are no
t intercepted  and  remain         unaffected.             Full descriptions of 
both the tape and disc versions of these routines         are given in section 1
5.             The AMSDOS external commands are                      A         S
elects default drive A                  B         Selects default drive B       
           CPM       Cold boot CP/M                  DIR       Display disc dire
ctory                  DISC      Redirect cassette routines to disc             
     DISC.IN   Redirect cassette input routines to disc                  DISC.OU
T  Redirect cassette output routines to disc                  DRIVE     Select d
efault drive                  ERA       Erase files                  REN       R
ename files                  TAPE      Redirect cassette routines to cassette   
               TAPE.IN   Redirect cassette input routines to cassette           
       TAPE.OUT  Redirect cassette output routines to cassette                  
USER      Select default user                 From BASIC all these commands must
 be preceded by a ''.             Some of these commands require parameters.    
         Full descriptions of these external commands are given in section 20.  
               AMSTRAD CPC464/664/6128 FIRMWARE                              pag
e 9.2                     9.2 Filenames             AMSDOS filenames are upwards
 compatible with CP/M  filenames.  But  is         addition the user number may 
also  be  specified  and  non-significant         spaces are permitted before  a
nd  after  the  name  and  any  embedded         punctuation.             Exampl
es                 ANAME               Default user, drive, and type            
 10WOMBAT.TXT       Default drive, and user number 10             2AWOMBAT.TXT  
     User 2, on Drive A             *.*                 Default drive, user, and
 all files             5B  POSSUM . $$$   A name with non-significant spaces    
         aaardark          Lowercase, AMSDOS will convert to uppercase          
   If given, the user number must be in the range 0..15, the drive letter       
  must be A or B. If either the user or the drive is given they must  be        
 followed by a colon.             The following characters may be used in the na
me and type parts                            a-z A-Z 0-9 ! " # $ & ' + -   '    
         Any other characters will cause the commands to fail with the message  
                  BAD COMMAND           The characters '' and '*' are wildcards,
 that is, when placed  within         a filename or type it will be interpreted 
as  'any  valid  character'.         For example if the filename 'GE.B*' was use
d in the  DIR  command         then the files 'GAME1.BAS' 'GAME1.BAK' 'GAME29.BA
S'  and  'GREET.BAS',         and any matching combinations, would be displayed 
in the directory.             When passing  a  filename,  AMSDOS  shifts  lower 
 case  letters  into         uppercase and removes bit 7.           If the user 
or drive is omitted then the current  default  values  are         assumed. Thes
e defaults may be set by the user.           If the type part is omitted then  a
  default  type  is  assumed.  This         depends on the context in which the 
name is being used, but usually  a         default type part of three spaces is 
assumed.           9.3 File Headers           Cassette files are  subdivided  in
to  2K  blocks,  each  of  which  is         preceded by header. CP/M files do n
ot have headers. AMSDOS files  may,         or may not have a header depending o
n the contents of the  file.  This         will not cause problems for programs 
written in BASIC  but  it  is  an         important difference between cassette 
and disc files.             AMSTRAD CPC464/664/6128 FIRMWARE                    
          page 9.3                     Unprotected ASCII files do no have header
. All other AMSDOS files have         a single header in the first 128 bytes of 
the file, the header record.         These headers are detected by checksumming 
the first 67 bytes  of  the         record. If the checksum is as expected then 
a header  is  present,  if         not then there is no header. Thus it  is  pos
sible,  though  unlikely,         that a file without a header could be mistaken
 for one with a header.             The format of the header record is as follow
s     P               Bytes   0..63       Cassette/Disc header (see below)      
                    64..66      Length of the file in  bytes,  excluding  the   
                               header   record.   24   bit   number,   least    
                              significant byte in lowest address                
          67..68      Sixteen bit checksum, sum of bytes 0..66                  
        69..127     Undefined             The use that the cassette manager make
s of the header is described  in         section 8.4. AMSDOS uses the header as 
follows                                Bytes             Filename           0   
      User number, #00..#FF                            1...8     Name part, padd
ed with spaces                            9...11    Type part, padded with space
s                            12...15   #00             Block number       16    
    Not used, set to 0             Last block         17        Not used, set to
 0           File type          18        As per cassette           Data length 
       19...20   As per cassette           Data location      21...22   As per c
assette           First block        23        Set to #FF, only used for output 
files           Logical length     24...25   As per cassette           Entry add
ress      26...27   As per cassette           Unallocated        28...63   As pe
r cassette               AMSTRAD CPC464/664/6128 FIRMWARE                       
       page 9.4                     When a file without a header is opened for  
input  a  fake  header  is         constructed in store as follows              
                  Bytes             Filename           0         User number, #0
0..#FF                            1..8      Name part, padded with spaces       
                     9..11     Type part, padded with spaces                    
        12..15    #00             File type          18        #16, unprotected 
ASCII version 1         Data location      19..20    Address of 2K buffer       
  First block        23        #FF             All other fields are set to zero.
             9.4 Disc Organisation             AMSDOS and the CP/M 2.2 BIOS supp
ort  three  different  disc  formats         SYSTEM format, DATA ONLY format, an
d IBM format. The  CP/M  Plus  BIOS         supports the SYSTEM and DATA formats
 but not IBM format.             The BIOS automatically detects the format of a 
disc. Under  CP/M  this         occurs for drive A at a warm boot and for drive 
B the first time it is         accessed. Under AMSDOS this occurs each time a di
sc with no open files         is accessed. To permit this automatic detection ea
ch format has unique         sector numbers as detailed below.             3 inc
h discs are double sided, but only one side may be accessed at  a         time d
epending on which way round the user inserts the disc. There  my         be diff
erent formats on the two sides.             Common To All Formats             Si
ngle sided (the two sides of a 3 inch disc are treated separately).             
512 byte physical sector size.             40 track numbered 0 to 39.           
  1024 byte CP/M block size.             64 directory entries.             AMSTR
AD CPC464/664/6128 FIRMWARE                              page 9.5               
      System Format           9 sectors per track numbered #41 to #49.          
 2 reserved tracks.           2 to 1 sector interleave.           The system for
mat is the main  format  supported,  CP/M  can  only  be         loaded (Cold Bo
ot) from a system format disc. CP/M 2.2 also requires a         system format di
sc to warm boot.  The  reserved  tracks  are  used  as         follows          
          Track 0 sector #41           boot sector.                    Track 0 s
ector #42           configuration sector.                    Track 0 sectors #43
..#47     unused                    Track 0 sectors #48..#49     and            
      Track 1 sectors #41..#49     CCP and BIOS           CP/M Plus only uses Tr
ack 0 sector #41 as a boot sector         Track 0 sector #42...#49 and Track 1 a
re unused.           Note Another format called 'VENDOR' format is a  special  v
ersion  of         system format which does not contain any software on the two 
 reserved         tracks. It is intended for use in software distribution.      
     Data Only Format           9 sectors per track numbered #C1 to #C9.        
   0 reserved tracks.           2 to 1 sector interleave.           This format 
is not recommended for use with CP/M 2.2 since it  is  not         possible to '
warm boot' from it. However, because there    Pis  a  little         more disc s
pace available it is useful for AMSDOS or CP/M Plus.           IBM Format       
    8 sectors per track numbered 1 to 8           1 reserved track           no 
sector interleave             This format is logically the same as the single-si
ded format  used  by         CP/M on the IBM PC. It is intended  for  specialist
  use  and  is  not         otherwise recommended as it is not possible to 'warm
 boot' from it.                     AMSTRAD 464/664/6128 FIRMWARE               
                  page 9.6                     9.5 Boot Sector             In or
der that non-CP/M systems may be implemented at a later date  the         BIOS i
nitialization is performed, in part, by a boot program which  is         read fr
om the disc before attempting to load  CP/M.  In  the  non-CP/M         case the
 boot program would not jump to the warm boot routine  but  go         on its ow
n way, using the BIOS and firmware routines as desired.             The boot pro
gram is in the boot  sector  which  is  the  first  sector         (sector #41) 
on track 0.           During a cold boot the BIOS is initialized into a minimum 
state before         loading and executing the boot program. This state is as fo
llows.                      All routines in the ROM copy of the BIOS  jumpblock 
 all  the                  routines in the extended jumpblock are available.    
                Alternate and IY register saving is enabled.                    
Interrupts are indirected via the BIOS and run on the  BIOS's                  s
tack.                    Disc messages are enabled.                    The initi
al command buffer is empty.                    The  IOBYTE  at  #0003  is  initi
alized  to  #81  (LSTLPT,                  PUNTTY, RDRTTY, CONCRT).             
       The current drive at #0004 is initialized to #00.                    The 
serial interface is not initialized.                    The CCP and BDOS are not
 in store.                    The CP/M jumps at #0000 and #0005 are not initiali
zed.             The boot sector is read and loaded into  store  at  #0100  the 
 stack         pointer is initialized to a value immediately below  the  BIOS's 
 data         (#AD33 is normal) area and the boot program is entered at  #0100. 
 The         boot program may use store from #0100 upwards  until  it  reaches  
the         stack.             To run CP/M the boot program must, at least, jump
  to  the  warm  boot         entry in the ROM jumpblock.           The boot pro
gram for CP/M 2.2 loads and obeys the configuration sector         and then warm
 boots CP/M.           The boot program for CP/M Plus searches for, loads and ex
ecutes a file         with the type part .EMS.               AMSTRAD CPC464/664/
6128 FIRMWARE                              page 9.7                     The boot
 program has the following interface           Entry                    SPhighes
t address available+1 (a good place for the stack)                  BCaddress of
 ROM copy of BIOS jumpblock (BOOT)             Exit                    To run CP
/M the program should jump the the  WBOOT  entry  in                  the above 
jumpblock           The ROM copy of the BIOS jumpblock should not  be  used  at 
 any  time         (indeed, only the boot program knows where it is).           
9.6 AMSDOS Messages           AMSDOS uses the CP/M 2.2 BIOS in order the access 
the disc.  Thus  the         BIOS messages will be displayed in the event of  a 
 disc  error.  This         section explains the meaning of the AMSDOS messages.
           In the following drive means A or  B,  filename  means  an  AMSDOS   
      filename.                    Bad command           There is a syntax error
 in a command or filename.                    filename already exists           
The user is trying to rename a file to a name which is already in use.          
          filename not found           The user is trying to open for input, era
se or rename a file that does         not exist.                    Drive drive 
directory full           There is no more free directory  entries  (64  director
y  entries  per         disc).                    Drive drive disc full         
  There is no more free disc blocks.                    Drive drive disc changed
, closing filename           The user has changed the disc while files were stil
l open on it.                    filename is read only           The user is  tr
ying  to  erase  or  rename  a  file  which  is  marked         read-only. May a
lso be caused by closing a file when existing  version    P       of the file is
 read-only.               AMSTRAD CPC464/664/6128 FIRMWARE                      
        page 9.8  ter, of                    9.7 BIOS Facilities Available to AM
SDOS           AMSDOS uses the CP/M BIOS 2.2 to access the  disc.  In  order  th
at  a         program running under AMSDOS may access the disc directly nine of 
 the         BIOS extended jumpblock  routines  are  available.  The  routines  
are         accessed as external commands. An example of using these  commands  
is         given in section 10.6.           Note The BIOS extended jumpblock its
elf is not available,  indeed  it           does not exist in the AMSDOS environ
ment.           The BIOS routines available and their command names are as follo
ws                    SET MESSAGE                   Ctrl (#01)                  
SETUP DISC                    Ctrl (#02)                  SELECT FORMAT         
        Ctrl (#03)                  READ SECTOR                   Ctrl (#04)    
              WRITE SECTOR                  Ctrl (#05)                  FORMAT T
RACK                  Ctrl (#06)                  MOVE TRACK                    
Ctrl (#07)                  GET DR STATUS                 Ctrl (#08)            
      SET RETRY COUNT               Ctrl (#09)           These routines are desc
ribed in section 19.           The word at #BE40 contains the address of the  di
sc  parameter  header         vector. Disc parameter headers and extended disc p
arameter blocks  may         be patched as required (see section 9.8).          
   Only the BIOS facilities mentioned here may be  used  from  a  program       
  running under AMSDOS.             9.8 Store requirements             When init
ialized AMSDOS reserves #500 bytes of memory from the  memory         pool and t
he kernel  reserves  another  4  for  its  external  command         chaining in
formation.             When loading a machine code program from disc  into  stor
e  using  the         AMSDOS routine CAS IN DIRECT it is important that  AMSDOS'
s  variables         are not overwritten. This presents a problem since in  gene
ral  it  is         not possible to discover where these variables are!  This  i
s  because         variables for expansion ROMs are allocated dynamically. Note 
that this         problem does not arise  when  loading  from  the  cassette  si
nce  the         cassette manager's variables are in the firmware variable area.
             AMSDOS reserves store from the top of  memory  pool  so  the  simpl
est         solution is to always load machine code programs into  the  bottom  
of         store. The program can then relocate itself to  a  higher  address  i
f         required.               AMSTRAD CPC464/664/6128 FIRMWARE              
                page 9.9                     Alternatively the machine code prog
ram could be loaded in two  stages         first load and run a small loader in 
the bottom of store.  The  action         of MC BOOT PROGRAM will have shut down
 all RSXs  and  extension  ROMs.         The loader program should now initializ
e AMSDOS  using  KL  INIT  BACK         thus forcing AMSDOS variables to be wher
ever you so wish.  The  loader         can now load the machine code program usi
ng the AMSDOS routines CAS IN         OPEN, CAS IN DIRECT, and CAS IN CLOSE toge
ther with MC START PROGRAM.           In order to initialize AMSDOS using KL INI
T BACK, AMSDOS's ROM  number         is required. To determine AMSDOS's ROM  num
ber  look  at  any  of  the         intercepted  cassette  jumpblock  entries  w
ith  the   DISC   routines         selected. Each entry is a far call, the addre
ss part of  which  points         at a three byte far address, the third part of
 the fa  Pr address is  the         ROM number. Obviously this should be done be
fore AMSDOS is shut done.           Existing machine code programs, developed on
 cassette systems  without           any expansion ROMs, frequently only use sto
re to  #ABFF  in  order  to         avoid BASICs variables. These can easily be 
modified  to  use  AMSDOS.         Write some machine code to  initialize  AMSDO
S  using  KL  INIT  BACK.         AMSDOS will reserve RAM down to #ABFC, almost 
 the  same  as  used  by         BASIC.           9.9 Extended Disc Parameter Bl
ocks           In  order  to  facilitate  reading  and  writing  'foreign'  disc
s  of         differing formats, all the parameters concerning a drive are  kept
  in         RAM in an extended CP/M disc parameter block (XPB).  The  knowledga
ble         user may patch an XPB.             There are two XPBs, one per drive
.             XPB structure             bytes 0...14       standard CP/M 2.2 DPB
 (see below).         byte  15           first sector number.               16  
         number of sectors per track.               17           gap length (rea
d/write).               18           gap length (format).               19      
     filler byte for formatting.               20           log(2)(sector size)-
7,'N' for uPD765A.               21           sector size/128               22  
         reserved current track (set by BIOS).               23           reserv
ed #00--not aligned, #FF--aligned (set by                             BIOS)     
          24           #00--auto-select format, #FF--don't  auto-select         
                    format.             The XPB for a drive may be  found  by  a
ccessing  the  Disc  Parameter         Header (DPH) vector. The first word of th
e DPH is the address  of  the         XPB for drive A, the second word is the ad
dress of the XPB  for  drive         B. The address of the DPH is stored at loca
tion #BE40.               AMSTRAD CPC464/664/6128 FIRMWARE                      
       page 9.10                     The values stored in the standard CP/M 2.2 
DPB (Disc Parameter  Block)         are often derived from the data block alloca
tion size, BLS,  which  is         the number of bytes in a block and which may 
be 1024, 2048, 4096, 8192         or 16384. The value of BLS is not stored in th
e  DPB  but  it  may  be         deduced from the  values  stored  there.  CP/M 
 plus  has  a  slightly         different DPB. The CP/M 2.2 DPB is laid out as f
ollows           bytes    0..1  (SPT)  Total number of 128 byte records on each 
track.                     2  (BSH)  log(2)BLS-7.                     3  (BLM)  
BLS/128-1.                     4  (EXM)  If DSM256 then BLS/1024-1 else BLS/2048
-1.                  5..6  (DSM)  Total size of disc blocks excluding any       
                         reserved tracks.                  7..8  (DRM)  Total nu
mber of directory entries -1.                 9..10 (AL0/1) Bit significant repr
esentation of number of                                directory blocks (#0080--
1, #00C0--2 etc).                11..12  (CKS)  Length of checksum vector. Norma
lly DRM/4+1 but                                if checksumming is not required t
hen 0.                13..14  (OFF)  Number of reserved tracks. This is also the
                                track on which the directory starts.           T
he XPBs for the different formats are initialized as follows           System fo
rmat                    36        records per track                  3         b
lock shift                  7         block mask                  0         exte
nt mask                  170       number of blocks-1                  63       
 number of directory entries-1                  #00C0     2 directory blocks    
              16        size of checksum vector                  2         reser
ved tracks                  #41       first sector number                  9    
     sectors per track                  42        gap length (read/write)       
           82        gap length (format)                  #E5       filler byte 
                 2         log(2)(sector size)-7                  4         reco
rds per track                  0         current track                  0       
  not aligned                  0         do auto select format           Data on
ly format                    36        records per track                  3     
    block shift                  7         block mask                  0        
 extent mask                  179       number of blocks-1                  63  
      number of directory   Pentries-1                  #00C0     2 directory bl
ocks                  16        size of checksum vector                  0      
   reserved tracks                  #C1       first sector number               
   9         sectors per track           AMSTRAD CPC464/664/6128 FIRMWARE       
             page 9.12 (part 1)                              42        gap lengt
h (read/write)                  82        gap length (format)                  #
E5       filler byte                  2         log(2)(sector size)-7           
       4         records per track                  0         current track     
             0         not aligned                  0         do auto-select for
mat                 IBM Format                    32        records per track   
               3         block shift                  7         block mask      
            0         extent mask                  155       number of blocks-1 
                 63        number of directory entries-1                  #00C0 
    2 directory blocks                  16        size of checksum vector       
           1         reserved tracks                  #01       first sector num
ber                  8         sectors per track                  42        gap 
length (read/write)                  80        gap length (format)              
    #E5       filler byte                  2         log(2)(sector size)-7      
            4         records per track                  0         current track
                  0         not aligned                  0         do auto selec
t                                                             AMSTRAD CPC464/664
/6128 FIRMWARE                    page 9.12 (part 2)  OS is a disc operating sys
tem used  with  all  the  CPC  range  of         computer, o        80        ga
p length (format)                  #E5       filler byte                  2     
    log(2)(sector size)-7                  4         records per track          
        0         current track                  0         not aligned          
           10 Expansion ROMs, Resident System Extensions and RAM Programs.      
       The system can address up to 252 expansion ROMs, mapped over  the  top   
      16K of memory, starting at #C000. The Kernel supports two varieties of    
     expansion ROM, foreground and background. A resident system  extension     
    (RSX) is similar in use to a background ROM, but must be  loaded  into      
   RAM before it can be used.             A foreground ROM contains one or more 
programs, only one of which  may         be running at one time. The on-board BA
SIC is the  default  foreground         program. Other possible foreground progr
ams are                      - other systems, such as FORTH or CP/M.            
      - applications, such as a Word Processor or Spread Sheet.                 
 - tools, such as an Assembler or Debugger.             A RAM program, once load
ed, takes over the machine in  much  the  same         way as a foreground ROM p
rogram. Games will generally be RAM programs.             There may be up to 16 
background ROMs, each  of  which  provides  some         sort of service indepen
dent of the foreground program. It is  expected         that expansion periphera
ls will each have an associated background ROM         containing  suitable  sup
port  routines.  Other  background  ROMs  may         augment the existing  mach
ine  software  for  example,  by  providing         further graphics functions. 
            A resident system extension (RSX), once loaded, provides some sort  
of         service in the same way  as  a  background  ROM.  An  RSX  might,  fo
r         example, provide special support for a given printer  -  where  it  is
         more economical to provide the software on cassette rather than in ROM 
        (or PROM).             10.1 ROM Addressing.             Expansion ROMs h
ave ROM address in the range 0..251. To select a given         ROM the Kernel se
ts its ROM address by writing to I/O  address  #DF00.         If a ROM is fitted
 at the address  selected,  then  all  further  read         accesses to the top
 16K of memory will return data from the  expansion         ROM. If no ROM is fi
tted at the currently  selected  ROM  address  the         contents of the on-bo
ard ROM are returned.             When the machine  is  first  turned  on  ROM  
0  is  selected  as  the         foreground program. If no expansion ROM is fitt
ed at  ROM  address  0,         the on-board ROM is used, and BASIC is entered. 
If an expansion ROM is         fitted at ROM address 0 it takes precedence  P ov
er the on-board ROM.               AMSTRAD CPC464/664/6128 FIRMWARE             
                page 10.1                     In V1.0 firmware background ROMs m
ust be fitted at  ROM  addresses  in         the range 1...7. Foreground ROMs mu
st be  fitted  so  that  there  are         contiguous ROMs from address 1. When
 searching for  a  foreground  ROM         the kernel starts at address 0  and  
works  upwards  until  the  first         address greater than 0 if found.      
     In V1.1 firmware background ROMs may be fitted at ROM addresses in the     
    range 0...15. Foreground ROMs must be fitted contiguously from address      
   16 or at any background ROM address. When searching for  a  foreground       
  ROM the kernel starts at address 0 and works upwards until  the  first        
 unused address greater than 15 is found.           In either case if an expansi
on ROM 0 is fitted the  on-board  ROM  can         still be accessed at the firs
t unused ROM address.           The Kernel  supports  a  'far  address'  which  
my  be  used  to  call         subroutines in expansion ROMs. The  'far  address
'  is  a  three  byte         object, the last byte of which is  a  ROM  select 
 number.  Since  the         arrangement of ROMs in an expansion card is quite  
arbitrary  the  ROM         select part of the 'far address' must be established
 at run time.  The         'sideways' ROM addressing facility  allows  a  foregr
ound  program  to         occupy up to  four  contiguous  ROM  select  addresses
,  and  supports         subroutine calls between the ROMs without  requiring  t
he  program  to         know the actual ROM address of any of them.           10
.2 The Format of an Expansion ROM.           An expansion ROM may be up to 16K b
ytes long, the first byte being  at         address #C000. The first few bytes o
f the ROM are the 'ROM Prefix' and         must take the form                   
 Byte 0   ROM type.                  Byte 1   ROM Mark Number.                  
Byte 2   ROM Version Number.                  Byte 3   ROM Modification Level.  
                Byte 4   External Command Table.           The ROM type specifie
s what sort of ROM this  is  and  must  take  the         following values      
            0   Foreground ROM.                  1   Background ROM.            
      2   Extension ROM.           The on-board ROM must be unique in having bit
 7 of the type  byte  set         (thus its type byte is #80). This marker is us
ed to detect the end  of         foreground ROMs. If a foreground program will n
ot fit  into  a  single         ROM then the extra ROMs required should be marke
d as extension ROMs.           The mark number, version number and modification 
level may be  set  to         any values required.           The external comman
d table comprises a list of  command  names  and  a         jumpblock. Each comm
and name is implicitly associated  with  the  same         numbered entry in the
 jumpblock. The table takes the form                  Bytes 0..1  Address of com
mand name table                  Bytes 2..4  Jumpblock entry 0                  
Bytes 5..7  Jumpblock entry 1                  ...etc ...etc           AMSTRAD C
PC464/664/6128 FIRMWARE                             page 10.2                   
  The command name table is a list of names, each of which may be up  to        
 16 characters long. The last character of each name must  have  bit  7         
set but no other character may. The table  is  terminated  by  a  null         (
character 0) after the last character of the last  name.  Apart  from         th
e fact that all characters must be in the range 0..127 and that  the         fir
st character may not be a null, there are no  restrictions  on  the         char
acters in command names. However,  if  unsuitable  characters  are         chose
n it may prove impossible for programs such as  BASIC  to  access         the co
mmands. BASIC expects alphabetic characters in the  commandnames         to be i
n upper case and will not allow characters such as a space or         comma in t
he command name.           The ROM prefix for the on-board ROM is               
         ORG #C000           Start of the ROM                        DEFB #80+0 
         On board ROM, Foreground                      DEFB 1              Mark 
1                      DEFB 0              Version 0                      DEFB 0
              Modification 0                        DEFW NAMETABLE     Address o
f name table.                        JP STARTBASIC      The only entry in the ju
mpblock           NA  PMETABLE  DEFB 'BASI','C'+#80 The only command name       
               DEFB 0              End of table marker             The ROM prefi
x for a serial I/O card might be                        ORG #C000           Star
t of ROM                        DEFB 1              Background ROM              
        DEFB 0              Mark 0                      DEFB 5              Vers
ion 5                      DEFB 0              Modification 0                   
     DEFW NAMETABLE     Address of name table                        JP EMSENTRY
        0 Background ROM power-up entry                      JP RESET           
 1                      JP SETBAUDRATE    2                      JP GETCHARACTER
    3                      JP PUTCHARACTER    4                         ...etc  
         NAMETABLE  DEFB 'SIO DRIVE','R'+#80            0                      D
EFB 'SIO.RESE','T'+#80             1                      DEFB 'SIO.SET.BAU','D'
+#80          2                      DEFB 'SIO.GET.CHA','R'+#80          3      
                DEFB 'SIO.PUT.CHA','R'+#80          4                           
 ...etc                      DEFB 0                              End of table ma
rker                   AMSTRAD CPC464/664/6128 FIRMWARE                         
    page 10.3                     Note that the command name table entry for the
 power-up entry includes         a space. This is still a legal name but the BAS
IC will never  be  able         to generate it because of the way it uses spaces
. Because BASIC cannot         generate the name it is impossible  for  a  BASIC
  user  to  call  the         power-up entry by mistake (see section 10.4)      
     10.3 Foreground ROMs and RAM Programs.           Each of the entries to the
 foreground ROM is expected to  represent  a         separate program, whose nam
e is given by the  corresponding  entry  in         the name table. The first en
try of ROM 0 is the default power-up entry         point at the end of EMS.     
      Once a RAM  program  has  been  loaded  it  is  treated  much  like  a    
     foreground ROM, except that it does not have a  ROM  prefix,  and  the     
    required entry point is determined separately.           Just before a foreg
round program is entered the machine  is  reset  to         its EMS state  i.e. 
 all  the  hardware  and  all  the  firmware  are         initialized. The envir
onment and entry conditions are as follows           Memory              Section
 2 describes the memory layout of the system. Three areas of            memory a
re available to the program.              1. The Static Variable Area.          
    The area from #AC00 to #B0FF inclusive is reserved for use  by  the         
   foreground program - although  it  may  use  more  or  less  as  it          
  requires. It is also possible to reserve  a  foreground  data  area           
 starting at #0040 if this is required.              2. The Stack.              
The hardware stack is set to an area immediately below #C000  which            i
s at least 256 bytes long.              3. The Main Memory Pool.              Mo
st of the rest of memory will  be  available  to  the  foreground            pro
gram, depending on what memory is taken by any  background  ROMs            whic
h the foreground program chooses to initialize.             Registers           
     The base and limit of the  free  memory  area  are  passed  to  the        
    program in registers.                BC  Address of the highest usable byte 
in memory. (#B0FF)            DE  Address of the lowest usable byte in the memor
y pool. (#0040)            HL  Address of the highest byte in the memory pool. (
#ABFF)                 AMSTRAD CPC464/664/6128 FIRMWARE                         
    page 10.4                     Note that the program is free to use any memor
y  between  the  address         given in DE and the address in BC inclusive (i.
e. #0040 to #B0FF). The         contents of HL reflect the standard allocation f
or  static  variables         the program is free to use more, or less, as the m
ood takes it. Also a         foreground data area may be reserved at the bottom 
of store  as  well.         The program should set HL and DE to reflect the area
 it is  using  for         variables before initializing any background ROMs (se
e below).           SP is set to the machine provided area #C000. The program  c
an  depend         on at least 256 bytes of stack.           The contents of the
 other registers is indeterminate.  Note  that  the         alternate register s
et (AF' BC' DE'  HL')  is  not  a  Pvailable  to  the         program. (But see 
Appendix XI).           ROM select state                    For ROM programs    
   The foreground ROM is selected.                                          The 
upper ROM is enabled.                                            The lower ROM i
s disabled.                    For RAM programs       No ROM is selected.       
                                   The upper ROM is disabled                    
                      The lower ROM is disabled.           General              
      Interrupts are enabled.                    All hardware  and  firmware  is
  in  its  initial  state.  In                  particular any expansion devices
 fitted have been reset,  but                  not yet initialized.           It
 is  the  foreground  program's  responsibility  to  initialize  any         bac
kground ROMs required and to load  and  initialize  any  RSXs.  The         Kern
el entry 'KL ROM WALK' looks for background ROMs  and  initializes         any t
hat it finds. The Kernel entry 'KL INIT BACK' will  initialize  a         partic
ular background ROM. These entries must be passed the  addresses         of the 
lowest and highest bytes in the memory pool which  is  why  the         foregrou
nd program must reserve its fixed data area before winding  up         the backg
round ROMs. The background ROMs may allocate memory for their         own use by
 moving  either  or  both  boundaries.  If,  therefore,  the         foreground 
program does allow background ROMs to function it must cope         with a memor
y pool  whilst  bounds  are  not  fixed  until  after  all         background RO
Ms have been initialized. Note that the location  of  the         foreground pro
gram's data areas are fixed whilst a background  program         must deal with 
variable data areas.           If background ROMs are not initialized then the  
memory  map  is  very         simple, but since discs, light pens, etc are likel
y to use  background         ROMs  for  support  software  it  is  rather  limit
ing  not  to  allow         background ROMs even for an apparently 'dedicated' g
ame.           The on-board BASIC initializes all background ROMs at  EMS.  The 
 user         chooses whether to load any RSXs from tape.               AMSTRAD 
CPC464/664/6128 FIRMWARE                           page 10.5                    
 10.4 Background ROMs.           Background ROMs  lie  dormant  until  initializ
ed  by  the  foreground         program. During initialization the background  s
oftware  may  allocate         itself some memory and initialize any  data  stru
ctures  an  hardware.         Providing the initialization is successful the Ker
nel places  the  ROM         on the list of possible takers for external command
s.           The first entry in a background ROM's jumpblock is  it  initializat
ion         routine. This routine must only be called by the firmware when the R
OM         is initialized it is not meant for the user to call.  Tricks  such  a
s         including a space in  the  name  makes  it  impossible  for  BASIC  to
         generate the correct name and hence impossible for  a  BASIC  user  to 
        call the entry. The entry and exit conditions for  the  initialization  
       routine are           Entry              DE contains the address of the l
owest byte in the memory pool.            HL contains the address of the highest
 byte in the memory pool.           Exit              If the initialization was 
successful              Carry true.            DE contains the new address of th
e lowest byte in the memory pool.            HL contains the new address of the 
highest byte in the memory pool.              If the initialization failed      
        Carry false.            DE and HL preserved.              Always        
      A, BC and other flags corrupt.            All other registers preserved.  
         Notes           The upper ROM is enabled and selected.         The lowe
r ROM is disabled.           The routine may not use the alternate register set.
           The ROM may allocate itself memory either at the top or the bottom  o
f         the memory pool (or both), simply by changing the appropriate register
         and returning the new value. For example, to reserve 256  bytes  given 
        an address of #AB7F as the top of the pool the program would  subtract  
       256 from HL giving a new top  of  pool  address  of  #AA7F.  The  area   
      preserved would be from #AA80 to #AB7F inclusive.           The carry fals
e return is only recognized in V1.1  firmware.  In  V1.0         firmware    P  
       this will be treated as if carry was returned true.                 AMSTR
AD CPC464/664/6128 FIRMWARE                             page 10.6  e 10.8  OMs, 
Resident System Extensions and RAM Programs.             The system can address 
up to 252 expansio                   When the initialization routine returns, th
e Kernel stores the address         of the base of the upper area which the ROM 
has allocated itself (i.e.         HL+1). Whenever an entry in the ROM is called
 this address  is  passed         in the IY index register. This allows the ROM 
routine  to  access  its         upper variable  area  easily  enough  even  tho
ugh  it  was  allocated         dynamically. Access to any lower variable  area 
 should  be  done  via         pointers in the upper area. Since background ROMs
 do not use  absolute         areas of memory, problems of background ROMs clash
ing with each  other         or  with  the  foreground  program  will  never  ar
ise.  Note  that  a         background ROM is very likely to expect that its upp
er data area  lies         above #0040 so that it is accessible irrespective of 
whether the lower         ROM is enabled or not.               If the initializa
tion is successful then the Kernel  also  places  the         ROM on its list of
 possible handlers of external commands (see below).         Note that when the 
list is scanned for external  commands  the  latest         addition is tried fi
rst. The entry KL ROM WALK processes the  ROMs  in         reverse address order
 (15, 14, ...0), ignoring any gaps of  foreground         ROMs, thus the ROMs wi
ll be searched in the order 0, 1, ...15.               10.5 Resident System Exte
nsions.               An RSX is similar to a background ROM. Responsibility for 
 loading  an         RSX and providing it with memory lies with the foreground p
rogram.  To         fit in with the dynamic allocation of memory to background R
OMs it  is         recommended that RSXs should be position independent or reloc
ated when         loaded. An RSX could be relocated by  writing  a  short BASIC 
'loader'         program which reads the RSX in a format which may be relocated 
 easily         and POKEs into store.               Once an RSX is load it may b
e placed on the list of possible  handlers         of external commands (see fol
lowing  page)  by  calling  KL  LOG  EXT,         passing it the address of the 
RSXs external command table and  a  four         byte block of memory (in the ce
ntral 32K of RAM) for the Kernel's use.         The format of the table is exact
ly the same as for  a  background  ROM         (see section 10.2). The only diff
erence is in  the  interpretation  of         the  table  -  the  first  entry  
in  the  jumpblock  is  not   called         automatically  by  the  Kernel  and
  thus  need  not  be   the   RSX's         initialization routine.             
                    AMSTRAD CPC464/664/6128 FIRMWARE                            
 page 10.7                     For example, the way to add an external command t
able for  a  graphics         extension for BASIC might be           INITIALIZE 
       LD HL,WORKSPACE         RSX power-up Routine                            L
D BC,RSXTABLE                            JP KLLOGEXT           WORKSPACE        
DEFS 4                   Area for Kernel to use           RSXTABLE         DEFW 
NAMETABLE                              JP DRAWCIRCLE           0                
            JP DRAWTRIANGLE         1                            JP FILLAREA    
         2           NAMETABLE         DEFB 'CIRCL','E'+#80     0               
             DEFB 'TRIANGL','E'+#80   1                            DEFB 'FIL','L
'+#80       2                            DEFB #00           Note that when the l
ist is scanned for  external  commands  the latest           Paddition is tried 
first. Since RSX's will, in general, be loaded after         background  ROMs  h
ave  been  initialized,  RSX  commands  will   take         precedence  over  th
ose  in  background  ROMs.  The  entry  and   exit         conditions for  exter
nal  commands  are  discussed  in  the  following         section (section 10.6)
.           10.6 External Commands.           Once the foreground program  has  
decided  that  it  has  an  external         command on its hands it should call
 the Kernel entry KL FIND  COMMAND,         passing to it a string giving the co
mmand  name.  This  routine  first         attempts to find an RSX or a backgrou
nd  ROM  whose  external  command         table contains the command. Only those
 RSXs and ROMs which  have  been         suitably initialized are taken into con
sideration. If the  command  is         found then the 'far address' of the corr
esponding jumpblock  entry  is         returned (see section 2.3). If the comman
d is not  found  the  routine         starts at ROM 0 and searches  for  a  fore
ground  ROM  whose  external         command table contains the command. If a fo
reground ROM is  found,then         the system resets and enters the appropriate
 foreground program. If no         match for the command can be found a failure 
indication is returned.           Note that the external command mechanism allow
s both  for  finding  of         background and RSX routines, and for switching 
of foreground programs.         Note also that the first command name in a backg
round ROM  corresponds         to the implicit initialization entry, and should 
 not  be  used  as  a         command.           The first time a background  or
  RSX  routine  is  used  the  external         command mechanism should be used
 to establish its  jumpblock  address.         This may then be stored and used 
directly for subsequent calls of  the         routine. It is foolish to assume t
hat a particular background  ROM  is         always plugged into the same socket
  or  that  a  relocatable  RSX  is         always located at the same address. 
                  AMSTRAD CPC464/664/6128 FIRMWARE                             p
age 10.8                     The first time a background  or  RSX  routine  is  
used  the  external         command mechanism should be used to establish its  j
umpblock  address.         This may then be stored and used directly for subsequ
ent calls of  the         routine. It is foolish to assume that a particular bac
kground  ROM  is         always plugged into the same socket  or  that  a  reloc
atable  RSX  is         always located at the same address.           It is the 
foreground program's responsibility to invoke  the  external         command onc
e its address has been found, and to pass its parameters in         a suitable f
orm. BASIC in the on-board ROM functions as  follows,  and         should serve 
as a model for other foreground programs if only to allow         common use of 
commands by other systems               An external command is identified by a v
ertical bar ('') followed             by the command name, optionally followed b
y a list of  parameters.             The bar does not form part of the command n
ame. The  command  name             must consist of alphabetic  characters  (whi
ch  are  converted  to             upper case), numeric characters or dots.     
          Parameters are passed by value, that is each parameter  may  be  a    
         numeric expression, the calculated value of which is passed, or an     
        address. The number and type of parameters must be agreed  between      
       the BASIC program  and  the  command  because  BASIC  performs  no       
      checking.               Each parameter passed is a two byte number,  whose
  interpretation             depends on its type               Integer expressio
n      two's complement  value  of  the  Integer                                
      result.             Real expression         the  Real  result  forced   to
   Unsigned                                      Integer.             Variable r
eference      address of the value of a variable (for a                         
             string  this  is  the  address   of   the                          
            descriptor).             A string descriptor is three  bytes  long. 
 Byte  0  contains  the             length of the string. Bytes 1 and 2 contain 
the address where  the             string is stored. If the string length is 0 t
hen  the  address  of             the  string  is  meaningless.  String  variabl
es  may  be  changed      P         providing that the string descriptor is not 
altered in any way.           Entry             A contains the number of paramet
ers.             IX contains the address of the parameters.             IY conta
ins the address of  the  ROM's  upper  data  area  if  the             command w
as found in a background ROM. If the command was found in             an RSX's e
xternal command table then IY is undefined.         Exit             AF,BC,DE,HL
,IX and IY corrupt.             Alternate register set untouched.         Notes 
            Index register IX contains the address of the parameters. If there  
           are no parameters then the ith parameter is at offset (n-i)x2 from   
          the index register address -  so  the  1st  parameter  is  at  the    
         largest offset, and the last parameter is pointed to by IX.            
   The IY register is set by the Kernel and not by BASIC. The  A  and           
  IX registers and the parameter area are set by BASIC.           AMSTRAD CPC464
/664/6128 FIRMWARE                             page 10.9                     10.
7 Examples.             a) A simple external command.             This example u
ses the BIOS routine SET MESSAGE that is available as an         external comman
d under AMSDOS. SET MESSAGE turns on or  off  the  disc         error messages a
nd has the following interface                 SET MESSAGE                      
  Command nameControl A                 Entry conditions                      A 
 #00   Turn disc error messages on.                  A  #FF   Turn disc error me
ssages off.                 Exit conditions                      A  Previos stat
e.                  HL and flags corrupt.             Before it is possible to u
se the external command it is  necessary  to         establish the store and far
  address  of  the  routine.  This  may  be         performed as follows        
              LD HL,CMDNAME                Pointer to command name              
    CALL KLFINDCOMMAND          Ask Kernel where it is                  JR NC,ER
RORROUTINE           Command not found error                           LD (CMDFA
RADDRESS+0),HL     Store address                  LD A,C                  LD (CM
DFARADDRESS+2),A      Store ROM number           CMDNAME          DEFB #01+#80  
      Control A  #01         CMDFARADDRESS    DEFS 3              Area for stori
ng far address             Having found the far address of the routine it can no
w be called.  For         example                      LD A,0                   
     Enable messages                  RST 3                         Far CALL    
              DEFW CMDFARADDRESS          Pointer to far address                
       AMSTRAD CPC464/664/6128 FIRMWARE                            page 10.10   
                  b) A complex external command             This example uses th
e INCHAR external command provided by  the  serial         interface. INCHAR rea
ds a character from the Serial Interface and  has         the following interfac
e                 INCHAR                             Command nameINCHAR         
    Entry conditions                      A  Number of parameters (should be 2).
                  IX  Address of parameter block.                    IX+2  Addre
ss to store status/                  IX+0  Address to store character read.     
        Exit conditions                      AF,BC,DE,HL,IX and IY corrupt.     
        Before it is possible to use the external command it is  necessary  to  
       establish and store the far  address  of  the  routine.  This  may  be   
      performed as follows                      LD HL,CMDTABLE               Poi
nter to command name                  CALL KLFINDCOMMAND          Ask Kernel whe
re it is                  JR NC,ERRORROUTINE           Command not found error  
                         LD (CMDFARADDRESS+0),HL     Store address              
    LD A,C                  LD (CMDFARADDRESS+2),A      Store ROM number        
   CMDNAME          DEFB 'INCHA','R'+#80         CMDFARADDRESS   DEFS 3         
     Area for storing far address           Having found the far address of the 
routine it can now be called.  For         example                    LD A,2    
                    2 parameters                  LD IX,PARAMBLOCK             A
ddress of parameter block                  RST 3                         FAR CAL
L                  DEFW CMDFARADDRESS          Pointer to far address           
       LD HL,(STATUS)                HLSerial Interface status                P 
             LD A,(CHAR)                   ACharacter read (if any)           PA
RAMBLOCK        DEFW STATUS         First parameter is status                   
         DEFW CHAR           Second parameter is character                  STAT
US            DEFW #0000         CHAR              DEFW #0000           AMSTRAD 
CPC464/664/6128 FIRMWARE                            page 10.11                  
   c) Passing different types of parameter             This exmple uses an inven
ted external command which takes a string  of         characters, looks these up
 in an index and returns a reference number.         The external command is ass
umed to be designed to be called from BASIC         as follows                  
    REFNUM,CHARTRING$,INDEXNUM,REFNUM             i.e. The first parameter is a 
string (whose address is  passed)  which         is to be looked up. The second 
parameter is a number specifying  which         index to use, and the third para
meter is a variable (whose address  is         passed) which is to be set to the
 required reference number.             The far address of the routine can be es
tablished in the same  way  as         was described in the previous two example
s. To call this routine  from         a machine code program it is necessary to 
set up the  parameter  block         and a string descriptor. The following subr
outine does this             GETREFNUM                           Entry HLAddress
 of string.                                                       A Length of st
ring.                                                       DEIndex number.     
                                           Exit  HLReference number.            
                                            AF,BC,DE,IX,IY corrupt.             
     LD (STRDESCRIPTOR+0),A       Store length of string.                    LD 
(STRDESCRIPTOR+1),HL      Store address of string                  LD (PARAMBLOC
K+2),DE         Store index number                           LD A,3             
           3 parameters                  LD IX,PARAMBLOCK             Address of
 parameter block                  RST 3                         FAR CALL        
          DEFW CMDFARADDRESS          Pointer to far address                    
       LD HL,REFNUM                 HLReference number                  RET     
      PARAMBLOCK       DEFW STRDESCRIPTOR First paramater is address of         
                                       string desriptor                         
   DEFW  #0000         Second  parameter  is  index                             
                   number                            DEFW REFNUM         Third p
arameter is address of                                                store for 
reference number                  STRDESCRIPTOR     DEFB #00            Length  
                          DEFW #0000          Address                  REFNUM   
          DEFW #0000                     AMSTRAD CPC464/664/6128 FIRMWARE       
                     page 10.12                     The external command routine
 that is being  called  has  to  pick  the         parameters out of the pramete
r block and it might work as follows                        LD L,(IX+0)         
         LD H,(IX+1)                   HLAddress of string                      
                          descriptor                           LD A,(HL)        
          INC HL                        ALength of the string                   
 LD E,(HL)                  INC HL                  LD D,(HL)                  E
X HL,DE                      HLAddress of string.                           LD E
,(IX+2)                  LD D,(IX+3)                   DEIndex number           
         ...                           Look up string                    LD (IX+
4),L                  LD (IX+5),H                   Store resulting reference   
               RET                           number                             
                                                AMSTRAD CPC464/664/6128 FIRMWARE
                            page 10.13  $$$hen the initialization routine return
s, the Kernel stores the address         of the base of the upper area whic   DE
Index number                    ...                           Look up string    
                LD (IX+4),L                  LD (IX+5),H                   Store
 resulting reference                  RET                           number      
                                                                       AMSTRAD C
PC464/664/6128 FIRMWARE                            pag  P               11 Inter
rupts.           There is only one source  of  interrupts  in  an  unexpanded  m
achine,         namely  a  regular  time  interrupt.  Expansion  boards  may  ge
nerate         interrupts, but suitable software must be provided to  deal  with
  the         extra interrupts.           The system runs with interrupts  enabl
ed  most  of  the  time.  It  is         inadvisable to disable interrupts for a
 prolonged period  if  this  is         avoidable because the time interrupts wi
ll be missed.             A number of firmware routines enable interrupts and th
is  is  remarked         upon in their descriptions. In particular the kernel ro
utines  dealing         with ROMs and the  restart  instructions  (  eg.  LOW  J
UMP  )  enable         interrupts.             11.1   The Time Interrupt.       
      The time interrupt occurs roughly once every 1/300th of a  second.  On    
     machines with PAL monitors (as in the UK ) or SECAM monitors (  as  in     
    France ) the timer is synchronised  with  frame  flyback  every  sixth      
   tick. On machines using NTSC monitors ( as in the US )  the  timer  is       
  synchronised with frame flyback every fifth tick. The  time  interrupt        
 is processed by the Kernel and presented to the rest of the system  in         
a number of ways                a. Fast Ticker Interrupts.              Period  
1/300th of a second.             For a high resolution or very short period timi
ng ( not  intended  for         general use ).             b. Sound Generation I
nterrupt.          Period  1/1OOth of a second.             This interrupt drive
s the sound generation firmware, but is  otherwise         not visible to the sy
stem.             c. Frame Flyback Interrupt.             Period  1/50th or 60th
 of a                                                               second.     
      For actions which must take place during frame flyback.  Ink  flashing    
     is performed during a frame flyback interrupt, for example.           d. Ti
cker Interrupt.                   Period  1/50th of a second.           This is 
the general purpose ticker interrupt. The keyboard is  scanned         at the st
art of each ticker interrupt.             AMSTRAD CPC464/664/6128 FIRMWARE      
                       page 11.1                     e. System Clock.           
There is a timer that counts fast ticks ie. 1/300ths of a second. This         c
an be used to measure elapsed time without setting  up  a  relatively         ex
pensive fast tick event. The timer is read by calling KL TIME PLEASE         and
 may be set by calling KL TIME SET.           11.2 External Interrupts.         
  The Z80 is run  in  interrupt  mode  1.  Which  is  to  say  that  all        
 interrupts cause  an  RST7  to  be  executed  by  the  processor.  The         
interrupt handling code in the Kernel can distinguish between the time         i
nterrupt and an external  interrupt.  It  does  this  by  re-enabling         in
terrupts inside the interrupt routine. If the interrupt repeats then         it 
is assumed to be an external interrupt, otherwise it is taken to be         a ti
me interrupt. Note that this requires that the source of  external         inter
rupts should not clear the interrupt condition until the software         resets
 it. Unless special action is taken in hardware, Z80  peripheral         chips w
ill not obey this requirement. In such  cases  the  recommended         course o
f action is described in Appendix XIII.           Before an external interrupt i
s enabled its interrupt handler must  be         ' installed '. This is done by 
copying the 5 bytes at address #003B to         a new  location  and  replacing 
 them  by  suitable  code  (  probably         including a jump ). When the Kern
el detects an external  interrupt  it         calls address #003B in RAM to proc
ess the interrupt.                   Entry                         No conditions
.                   Exit                       AF, BC,DE and HL corrupt.        
             All other registers preserved.                   Notes             
        Interrupts are disabled and must remain disabled.                     Th
e lower ROM is disabled.                     The upper ROM select and state are 
indeterminate.                     The alternate register set must not be touche
d.           The interrupt routine must establish whether  it  can  deal  with  
the         interrupt, and if so it must at least clear it. If  the  interrupt  
is         not the responsibility of the routine then it should jump to the  cop
y         of the   Pbytes taken from location #003B which may be competent to  d
eal         with the interrupt. This requires the code patched at  location  #00
3B         to be position independent in case a second external interrupt handle
r         is installed. The code put at #003B at EMS is position  independent  -
         it merely returns.           Note that interrupt handling code must be 
 in  RAM  somewhere  between         #0040 and #BFFF. Interrupt handlers should 
be as short as possible. If         an interrupt requires a lot of  processing  
beyond  that  required  to         clear it, then the interrupt should kick  an 
 event  to  do  the  work         outside the interrupt path.               AMST
RAD CPC464/664/6128 FIRMWARE                             page 11.2              
       11.3 Nonmaskable Interrupts.           There is no provision for handling
 a nonmaskable  interrupt  (NMI)  in         the firmware (despite the fact that
 NMI is available on  the  external         bus connector). Various firmware  ro
utines  (notably  those  connected         with driving the Centronics port, the
 PPI to access the sound chip and         keyboard, and the cassette) will have 
timing constraints  violated  if         NMIs occur whilst they are active. It i
s recommended that  NMI  should         not be used.           11.4 Interrupts a
nd Events.             As a general rule hardware interrupts should be transform
ed into their         software equivalents, 'events', as soon as possible. The  
handling  of         events is more flexible than the handling of hardware inter
rupts - for         example there are no restrictions on where event routines ma
y  reside,         or on interrupt enabling.           Events are described by a
n event block. This block contains the  event         class, the event count and
 an event routine  address.  When  an  event         occurs the event block is '
kicked' and the  Kernel  arranges  for  the         event routine to be called o
nce for each kick  (the  number  of  kicks         outstanding is kept in the ev
ent block).  The  event  routine  is  not         necessarily called immediately
. When the event routine is actually run         depends on the event class as f
ollows               a. Express Asynchronous Events.               This is an un
usual class of event.  The  even  routine  is  called             immediately du
ring  interrupt  processing.  The  routine  must  be             accessible by t
he interrupt code, it may  not  enable  interrupts,             corrupt the IX a
nd IY registers or use the alternate register set.             The routine shoul
d be as short as possible.               b. Normal Asynchronous Events.         
      This is the most flexible sort of event. When the event is  kicked        
     the event routine is not called, but the event block is placed  on         
    the interrupt event pending queue.               Once the current interrupt 
has been  processed,  just  before  the             Kernel  returns  from  the  
interrupt  path,  any  events  on  the             interrupt event pending queue
 are processed. While the events  are             being processed the system is 
running with interrupts enabled  and             may be regarded as no longer be
ing in the interrupt  path.  It  is             using its own stack  rather  tha
n  the  main  system  stack.  This             private stack is 128 bytes long. 
              The asynchronous event routine is, therefore, called shortly after
             the event is kicked and is not restricted in what  it  may  do  or 
            where it may be located. The event routine may take as long to run  
           as is needed. Any further kicks received during the time that  the   
          event routine is running will be added to the event count and will    
         be processed before returning to the interrupt program.                
 AMSTRAD CPC464/664/6128 FIRMWARE                             page 11.3         
                c. Synchronous Events.                 Synchronous events are qu
eued on  the  synchronous  event  pending             queue. They are not proces
sed until the foreground program  allows             the  queue  to  be  process
ed.  This  can  be  used   to   control             interactions between differe
nt parts of programs.             11.5 Interrupt Queues.             The various
 time interrupts  provide  three  sources  of  'kicks'  for         events. The 
events to be kicked when each of the interrupts occur  are         stored on que
ues, one  queue  for  each  source  of  kicks.  The  user         p  Provides an
 area to store for the Kernel's use. The size of  the  area         depends on w
hich queue it is for. The last 7 bytes  of  the  area  are         always an eve
nt block which the user should initialize  appropriately.             Appendix X
 describes the layout of these blocks in greater detail.                 a. Fast
 Ticker Events.                 Events on the fast ticker queue are 'kicked' on 
each  fast  ticker             interrupt, i.e. every 1/300th of a second. A fast
 ticker block  is             9 bytes long.                 b. Ticker Events.   
              Each event on the ticker queue is associated  with  a  timer.  The
             timer may be a 'one shot', which goes off  once,  or  a  repeater, 
            which goes off periodically. The timer counts  ticker  interrupts,  
           i.e. 1/50ths of a second, and when  sufficient  have  occurred  it   
          goes off. Each time the timer associated with an  event  goes  off    
         the event is kicked. A ticker block is 13 bytes long.                 c
. Frame Flyback Events.                 Events on the frame flyback queue are ki
cked on each frame flyback             interrupt, i.e. 1/50th of a second on PAL
 or  SECAM  machines  and             every 1/60th of a second on NTSC machines.
 A frame  flyback  block             is 9 bytes long.                           
  AMSTRAD CPC464/664/6128 FIRMWARE                             page 11.4  here i
s only one source  of  interrupts  in  an  unexpanded  machine,         namely  
a  re               12 Events.             The even mechanism is primarily provi
ded by the Kernel to support  the         handling  of  interrupts  and  other  
external  events.  However,  the         mechanism may also be used to handle in
ternal  events  in  complicated         programs  (such  as  a  simulation,  for
   example).   An   event   is         characterised by the following           
      a. Event Class (see section 12.1)                 Events may be synchronou
s or asynchronous, express or normal.                 b. Event Priority (see sec
tion 12.1)                 Synchronous events have an associated priority.      
           c. Event Count (see section 12.2)                 Each time an event 
occurs the count is incremented.             Each time an event is processed the
 count is decremented.             The event may be disarmed by setting the coun
t negative.               d. Event Routine. (see section 12.3)               The
 address of the routine which is called to process the event.             An eve
nt appears to the Kernel as a data block  containing  the  above         values 
(see Appendix X for the exact layout of an  event  block).  The         block mu
st be in the central 32K bytes of memory, so that  the  Kernel         can acces
s it without worrying about the ROM enable state.           When an event occurs
 the associated event block is kicked  by  calling         KL EVENT. If the even
t count  is  negative,  the  'kick'  is  ignored,         otherwise the event co
unt is incremented (up to a maximum of 127)  and         the event routine will 
 be  called  at  some  time  in  the  future  -         depending on the event c
lass. When the event routine returns the event         count is decremented, unl
ess it has been set to zero  or  negative  in         the meantime.           12
.1 Event Class.           Events are either synchronous or asynchronous. Asynchr
onous events are         intended for the processing of external events  which  
require  almost         immediate service. The processing of asynchronous events
 pre-empts the         main program. The  processing  of  synchronous  events  i
s  under  the         complete control of the main program, which  will,  in  ge
neral,  deal         with them when it is convenient to do so.             AMSTR
AD CPC464/664/6128 FIRMWARE                             page 12.1               
      a. Asynchronous Events.         An asynchronous event is processed immedia
tely the event is  kicked  -         or almost immediately if the kick occurs in
 the  P interrupt path  -  see         section 11 on interrupts. The Kernel does
 not provide  any  interlocks         between asynchronous events and the main p
rogram or other  events,  so         care must be exercised to avoid interaction
s. It  is  most  unwise  to         call routines that are not re-entrant  -  fo
r  example,  the  firmware         screen driving routines.           If the eve
nt count is still greater than zero when the  event  routine         returns, it
 is decremented. If the count  remains  greater  than  zero         then the pro
cess is repeated (the event routine is  called  again  and         the event cou
nt is decremented) until the count becomes zero or is set         negative (see 
12.2 below).           b. Synchronous Events.         Synchronous events are not
 processed when the event is kicked, but are         placed on the synchronous e
vent queue, waiting to be processed. Events         are queued in descending ord
er of priority  -  equal  priority  events         after those already on the qu
eue.           The  foreground  program  should  poll  the  synchronous  event  
queue         regularly, to see if there are any events outstanding.  If  there 
 are         then it should process them. The difference  between  synchronous  
and         asynchronous events is, therefore, that the foreground program decid
es         when synchronous events should be processed, but  the  event  'kicker
'         decides when asynchronous events  are  processed.  Provided  that  the
         foreground program takes suitable care, there should be no  difficulty 
        in handling the interactions and resource sharing between  synchronous  
       events and the foreground program.           When the foreground program 
finds the synchronous event queue  is  not         empty it should (but is not c
onstrained to)  instruct  the  Kernel  to         process the first event on the
 queue. When a synchronous event routine         is run the Kernel remembers the
 priority of the event.  In  the  event         routine the synchronous event qu
eue may  be  polled,  but  the  Kernel         hides any event whose priority is
 less than or  equal  to  that  event         currently being processed. When th
e event routine returns the previous         event priority is restored -  so  t
he  processing  of  events  may  be         nested.           The synchronous ev
ent priorities are split into  two  ranges,  express         and normal. All exp
ress events have higher priorities than all  normal         events. The Kernel p
rovides a mechanism to disable the  processing  of         normal events, withou
t affecting express events. This may be  used  to         implement 'critical re
gions' through which normal events may interact.         The synchronous event '
kicked'  by  the  Key  Manager  break  handling         mechanism is an example 
of an express synchronous event.           12.2 Event Count.         The main pu
rpose of the event count is to keep track of the difference         between the 
number of times the event has been kicked, and the  number         a times the e
vent has been processed. This ensures that a kick is  not         missed if it o
ccurs before the previous kick has been  processed.  The         event count is 
normally incremented  when  the  event  is  kicked  and         decremented when
 the event routine returns. However the  exact  action         depends on the ev
ent count as follows             AMSTRAD CPC464/664/6128 FIRMWARE               
              page 12.2                         Increment.                    -1
28..-2 The count is not changed - the event is ignored.                    -1   
    This value is illegal.                    0        The count is incremented 
and  event  processing  is                            initiated as required by t
he even class.                    1..126   The count is incremented but no furth
er  action  is                            taken. The event is waiting for a prev
ious kick  to                            be processed or for processing to compl
ete.                    127      The count is not changed - the kick is ignored.
               Decrement.                    -128     This value is illegal.    
                -127..0  The count is not  changed  -  the  event  has  been    
                        disarmed.                    1        The count is decre
mented and the  event  processing                            is terminated.     
               2..127   The count is decremented and the  event  processing     
                       is continued.           P  Note that the event routine ma
y disarm itself  by  setting  the  count         negative (by convention to -64)
 and  can  discard  unwanted  kicks  by         setting its count to one.       
    12.3 Event Routine.           In general the address of the event routine is
 given as a 3 byte  'far         address' (see section 2 on the memory layout). 
This allows the routine         to be located in any ROM or anywhere in RAM.    
       A special form of the address class may specify the routine  as  at  a   
      'near address'. This does not change the ROM state and so the  routine    
     must be located either in the lower ROM or in the central 32K of  RAM.     
    The ROM select byte of the 'far address' is ignored and the other  two      
   bytes taken as the address of the routine. Calling  a  'near  address'       
  event routine requires a little less work than  calling  a  full  'far        
 address', and is used by the firmware itself.           12.4 Disarming and Rein
itializing Events.           Before an event block may be reinitialized the even
t must be disarmed.         This ensures that the event is removed from the vari
ous event  pending         queues and prevents the event queues being corrupted 
 when  the  event         block is initialized. An asynchronous event must not b
e  reinitialized         from inside its asynchronous  event  routine  (because 
 in  this  case         disarming the event does not remove the event from the i
nterrupt event         pending queue).                 AMSTRAD CPC464/664/6128 F
IRMWARE                             page 12.3                     Synchronous an
d asynchronous events are disarmed in different manners.                 a. Asyn
chronous Events.                 An asynchronous event should be  disarmed  by  
calling  KL  DISARM             EVENT. This sets the event count to a negative v
alue (-64)and thus             prevents kicks having any effect. If the event is
 on the interrupt             event pending queue then it will be discarded only
 when an attempt             is made to process the event and not immediately th
at the event is             disarmed.                   b. Synchronous Events.  
               A  synchronous  event  should  be  disarmed  by  calling  KL   DE
L             SYNCHRONOUS. This sets the event count to a negative  value  (-64)
             and removes the event block from  the  synchronous  event  pending 
            queue (if it is on the queue).             The above procedures prev
ent the event being successfully kicked, they         do not prevent attempts be
ing made to kick the event. A  fast  ticker,         frame flyback or ticker eve
nt (see section 11.5) will still be on  its         appropriate queue and will s
till be receiving regular attempts to kick         it. To prevent time being was
ted (and the  system  from  being  slowed         down because of it) the event 
should be  removed  from  the  interrupt         queue by calling KL DEL FAST TI
CKER,  KL  DEL  FRAME  FLY  or  KL  DEL         TICKER.                         
                                      AMSTRAD CPC464/664/6128 FIRMWARE          
                   page 12.4    handling  of  i11.5) will still be on  its      
   appropriate queue and will still be receiving regular attempts to kick       
  it. To prevent time being wasted (and the  system  from  being  slowed        
 down because of it) the event should be  removed  from  the  interrupt         
queue by calling KL DEL FAST TICKER,  KL  DEL  FRAME  FLY  or  KL  DEL         T
ICKER.                                        13 The Machine Pack.           The
 Machine Pack deals with the low level driving of the hardware.  It         also
 talks to the Centronics port (and hence the printer)  and  is  in         charg
e of running 'load and go' programs.           13.1 Hardware Interfaces.        
   The routines provided for driving the hardware are only to be used  by       
  those who understand the hardware and  how  the  firmware  drives  the        
 hardware. The user should not access  the  hardware  directly   P when  a      
   Machine Pack routine is provided for this purpose.           Often there are 
higher level routines that accomplish the same effects         but also keep the
 firmware informed of  the  current  settings.  Where         possible these hig
her level routines should be used  and  the  Machine         Pack routine avoide
d. Using the Machine Pack routines  may  cause  the         firmware to make err
oneous assumptions about the current settings  and         may cause it to go wr
ong.           The Machine Pack makes certain assumptions  about  the  state  of
  the         hardware when it accesses it. In particular, PPI port A is assumed
  to         be in output mode and the sound chip, ULA CRTC and Centronics port 
are         assumed to be inactive that is, not halfway through setting  a  valu
e         into a chip register. It  is  usually  essential  that  interrupts  be
         disabled when accessing the hardware directly.             There are fo
ur main areas of the hardware that the Machine Pack  deals         with         
    a. The screen.                 There are three aspects of the screen  displa
y  that  can  be  set             using the Machine Pack. These are the screen m
ode (set by  calling             MC SET MODE) and the screen base and offset (se
t  by  calling  (MC             SET OFFSET).                 The screen mode set
s how many pixels are displayed on  the  screen             and how many inks ma
y be used as follows                                Mode      Resolution        
  Inks                            0         160 x 200           16              
              1         320 x 200           4                            2      
   640 x 200           2                 The screen base sets which 16K block of
 memory  is  used  for  the             screen memory. Theoretically, any of #00
00, #4000, #8000 or  #C000             could be used but, in practice,  other  c
onsiderations  mean  that             only #4000 and #C000 may be useful.       
      AMSTRAD CPC464/664/6128 FIRMWARE                             page 13.1    
                     The screen offset sets which byte in the screen memory  is 
 to  be             displayed first. Changing the screen offset will move the co
ntents             of the screen in one go. This is used for rolling the screen.
               A fuller description of the screen layout and its relationship  t
o             these aspects can be found in section 6 on the Screen Pack.       
        If addresses are to be read back from  the  CRT  controller  chip,      
       when using a light pen for instance, then  careful  inspection  of       
        the way the screen memory is addressed will be needed to translate      
       the screen address read from the chip to the  actual  position  on       
      the screen.               The Machine Pack also provides a routine (MC WAI
T FLYBACK) to wait             until frame flyback occurs (the  start  of  the  
vertical  retrace             period). This may be used to ensure that operation
s on the  screen             are performed with as little disruption  as  is  po
ssible  to  the             picture on the monitor since no picture is generated
  during  this             period. As an alternative to waiting for frame flybac
k  explicitly             the user should consider setting  up  a  frame  flybac
k  event  as             described in section 11.5.               The  vertical 
 retrace  period  is  not  very  long.  Furthermore,             approximately 1
00 microseconds from its start,  a  time  interrupt             occurs that will
 cause the frame flyback events  to  be  processed             (see section 11).
 These may take a significant length of time  out             of the retrace per
iod.           b. The inks.             The Machine Pack deals with setting the 
colours of inks. There  is             a fuller explanation of the relationship 
between inks and  colours             in section 6.2. Briefly, the colour for ea
ch ink  and  the  border             can be specified independently and changed 
at will. Note, however,             that the Machine Pack deals with the hardwar
e  representations  of             colours and not the grey scale colours that t
he Screen  Pack  uses             and also that an ink may only be set to one co
lour,  the  flashing             inks are made by the Screen Pack setting two co
lours alternately.               Two routines are provided for setting the colou
rs of inks. MC  SET             INKS allows the colours of all 16 inks and the b
order  to  be  set               P(although not all of the inks may be visible o
n the screen in  the             current mode). MC CLEAR INKS sets the colour of
 the border ink and             sets all 16 inks to the same  colour.  The  latt
er  is  used  when             clearing the screen to make the operation appear 
instantaneous.           c. The sound chip.             A routine, MC SOUND REGI
STER, is provided to write to  a  register             of the sound chip. This i
s used by the Sound Manager for  hardware             access.           d. The C
entronics port.             Two routines are provided to access the Centronics p
ort.  MC  BUSY             PRINTER tests if it is busy. MC SEND PRINTER strobes 
data  out  of             it. Data should not be sent while the port is busy.   
            The Centronics port is used by the printer  routines  provided  in  
           the Machine Pack and described below.           AMSTRAD CPC464/664/61
28 FIRMWARE                             page 13.2                     13.2 The P
rinter.           There is a routine, MC PRINT CHAR, which calls an indirection,
 MC WAIT         PRINTER, for sending characters to the  printer,  or  rather,  
to  the         Centronics port. In V1.1 firmware, before sending  the  characte
rs  MC         PRINT CHAR translates them using the printer  translation  table.
  The           user can set the translations by calling  MC  PRINT  TRANSLATION
.  The         default translation table (see Appendix XIV) only  affects  chara
cters         in the range #A0..#AF and is designed to make these  characters  p
rint         more reasonably on the DMP-1 printer for various language options. 
          MC WAIT PRINTER waits until the Centronics port is not busy  and  then
         sends the given characters to it. If the port remains busy for a  long 
        time then the routine times out and returns  indicating  that  it  has  
       failed to send the character. This time out can  be  used  to  prevent   
      programs  'hanging'  because  they  are  waiting   for   a   (possibly    
     non-existent) printer to become ready.             MC WAIT PRINTER allows t
he user to intercept characters to be sent  to         the printer. This could a
llow special escape sequences to be  inserted         if needed, or it could all
ow the printer to be disabled or the  length         of the time out to be chang
ed.             13.3 Loading and Running Programs.             The Machine Pack 
provides two routines for running programs, MC  START         PROGRAM and MC BOO
T PROGRAM.             MC START PROGRAM is the simpler of the  two  routines.  I
t  completely         re-initialize all the firmware and then enters the given p
rogram.             MC BOOT PROGRAM is more complex. It is for loading a program
 into  RAM         and running it. The user supplies a routine to MC  BOOT  PROG
RAM  that         will load the program and return its entry  point.  Before  th
is  load         routine is called as much of the firmware as is possible is  re
set  so         that the are of memory between #0040 and the base of the firmwar
e  RAM         at #B100 is available for use. If the system were not  reset  the
n  an         active indirection, event or interrupt routine  might  be  overwri
tten         with disastrous consequences.           If the program is loaded su
ccessfully by  MC  BOOT  PROGRAM  then  the         firmware  is  completely  in
itialized  and  the  program  is  entered.         However, if the loading fails
 then an appropriate message  is  printed         and the previous foreground pr
ogram  is  restarted.  If  the  previous         program was itself a RAM progra
m  then  the  default  ROM  is  entered         instead because it is likely tha
t the previous program  was  corrupted         when the attempt to load the new 
one was made.                     AMSTRAD CPC464/664/6128 FIRMWARE              
               page 13.3   low level driving of the hardware.  It         also t
a However, if the loading fails then an appropriate message  is  printed        
 and the previous foreground program  is  restart               14 Firmware Jump
blocks.           There are a number of jumpblocks provided by the firmware. The
 largest         of these is the main firmware jumpblock. This is intended to  b
e  used         by programs to access the firmware routines in the lower  ROM.  
BASIC,         for instance, uses these jumps. Note, however that the  firmware 
 does         not use this jumpblock for internal communication  with  itself.  
This         means  that  altering  the  jumpblock  will  cause  BASIC  to   beh
a  Pve         differently but will not cause the firmware to behave differently
.           The most  important  jumpblock  is  the  indirections  jumpblock.  T
he         indirections are jumps that are used by the firmware  at  key  points
.         This allows the user to alter the action  of  firmware  routines.  The
         entries in this jumpblock are not intended for the user to call,  only 
        for the firmware to call. Altering an indirection  is  the  method  to  
       make the firmware behave differently.           The remaining two jumpblo
cks are associated with the Kernel. One is  a         jumpblock to allow the use
r to call various useful Kernel routines  to         do with changing ROM states
 and the like. The other is not a jumpblock         as such, just an area where 
the routines are at  published  addresses.         These are general utility rou
tines and restarts. In general neither of         these areas should be altered 
by the user.           The routines in  these  jumpblocks  are  briefly  listed 
 below.  More         complex descriptions of the routines can be found in secti
ons 15,  16,         17 and 18.         AMSDOS provides a number of external com
mands  which  allow  the  user         access  to  the  low  level  disc  drivin
g  and  to  high  level  disc         operations.         These commands are  ac
cessed  using  the  external  command  mechanism         described in section 10
, i.e. The caller passes the command name to KL         FIND COMMAND  and  far  
calls  the  resulting  routine.  More  complex         descriptions of these com
mands can be found in sections 19 and 20.           14.1 The Main Jumpblock.    
     The main firmware jumpblock lies in RAM between  addresses  #BB00  and     
    #BD5D. Each entry  in  the  jumpblock  occupies  three  bytes  and  is      
   initialized to use LOW JUMP restarts (RST 1) that cause the lower  ROM       
  to be enabled, so that the firmware routines can be run, and the upper        
 ROM to be disabled, so that the screen memory is accessible while  the         
firmware is running. Full descriptions of these routines can be  found         i
n section 15.         After the jumpblock has been set up  at  EMS  it  is  patc
hed  by  the         initialization of the AMSDOS ROM to  install  the  disc  (r
ather  than         cassette) as default but is not  otherwise  altered  by  the
  firmware         until the system is reinitialized. If any entries are changed
 then  it         is the user's responsibility to undo  the  alterations.  This 
 can  be         achieved by calling JUMP  RESTORE  which  completely  initializ
es  the         jumpblock but this will lose any other patches, such as those ma
de  by         AMSDOS. It is better to copy the  original  contents  of  the  ch
anged         entries back.         14.1.1 Entries to the Key Manager.         T
he Key Manager deals with the keyboard and the joysticks.         INITIALIZATION
         0    #BB00  KM INITIALIZE       Initialize the Key Manager.           A
MSTRAD CPC464/664/6128 FIRMWARE                             page 14.1           
          1    #BB03  KM RESET            Reset the  Key  Manager  -  clear  all
                                         buffers,    restore    standard    key 
                                        expansions and indirections.         CHA
RACTERS           2    #BB06  KM WAIT CHAR        Wait for the next character  f
rom  the                                         keyboard.         3    #BB09  K
M READ CHAR        Test if a character is available  from                       
                  the keyboard.         4    #BB0C  KM CHAR RETURN      Return  
a  single  character  to   the                                         keyboard 
for next time.         191  #BD3D  KM FLUSH            Discard  all  pending  ch
aracters  and                                         keys.         5    #BB0F  
KM SET EXPAND       Set an expansion string.         6    #BB12  KM GET EXPAND  
     Get  a  character  from  an  expansion                                     
    string.         7    #BB15  KM EXP BUFFER       Allocate  a   buffer   for  
 expansion                                         strings.           KEYS      
       8    #BB18  KM WAIT KEY         Wait  for  the  next  key   from   the   
                                      keyboard.           9    #BB1B  KM READ KE
Y         Test of a key is  available  from  the                                
         keyboard.           10   #BB1E  KM TEST KEY         Test if a key is pr
essed.           190  #BD3A  KM SET LOCKS        Set  P  the  Shift  Lock  and  
Caps  Lock                                         states.           11   #BB21 
 KM GET STATE        Fetch Caps Lock and Shift Lock states.           12   #BB24
  KM GET JOYSTICK     Fetch    current    state    of    the                    
                     joystick(s).           TRANSLATION TABLES             13   
#BB27  KM SET TRANSLATE    Set entry  in  key  translation  table               
                          without shift or control.           14   #BB2A  KM GET
 TRANSLATE    Get entry from key  translation  table                            
             without shift or control.           15   #BB2D  KM SET SHIFT       
 Set entry  in  key  translation  table                                         
when shift key is pressed.           16   #BB30  KM GET SHIFT        Get entry f
rom key  translation  table                                         when shift k
ey is pressed.           17   #BB33  KM SET CONTROL      Set entry  in  key  tra
nslation  table                                         when control key is pres
sed.                 AMSTRAD CPC464/664/6128 FIRMWARE                           
  page 14.2                     18   #BB36  KM GET CONTROL      Get entry form k
ey  translation  table                                         when control key 
is pressed.         REPEATING             19   #BB39  KM SET REPEAT       Set wh
ether a key may repeat.           20   #BB3C  KM GET REPEAT       Ask if a key i
s allowed to repeat.           21   #BB3F  KM SET DELAY        Set start up dela
y and repeat speed.           22   #BB42  KM GET DELAY        Get start up delay
 and repeat speed.               BREAKS           23   #BB45  KM ARM BREAK      
  Allow break events to be generated.           24   #BB48  KM DISARM BREAK     
Prevent   break   event   from   being                                         g
enerated.           25   #BB4B  KM BREAK EVENT      Generate a break event (if a
rmed).             14.1.2 Entries to the Text VDU.             The Text VDU is a
 character based screen driver.             INITIALIZATION           26   #BB4E 
 TXT INITIALISE      Initialize the Text VDU.           27   #BB51  TXT RESET   
        Reset the Text VDU -  restore  default                                  
       indirections    and    control    code                                   
      functions.           28   #BB54  TXT VDU ENABLE      Allow characters to b
e placed  on  the                                         screen.           29  
 #BB57  TXT VDU DISABLE     Prevent characters from  being  placed              
                           on the screen.           192  #BD40  TXT ASK STATE   
    Get state of the text VDU.             CHARACTERS           30  #BB5A  TXT  
OUTPUT          Output a character or  control code to                          
               the Text VDU.           31   #BB5D  TXT WR CHAR         Write a c
haracter onto the screen.           32   #BB60  TXT RD CHAR         Read a chara
cter from the screen.               AMSTRAD CPC464/664/6128 FIRMWARE            
                 page 14.3                     33   #BB63  TXT SET GRAPHIC     T
urn  on  or  off  the  Graphics   VDU                                         ch
aracter writing option.             WINDOWS           34   #BB66  TXT WIN ENABLE
      Set size of the current text window.           35   #BB69  TXT GET WINDOW 
     Get  the  size  of  the  current  text                                     
    window.           36   #BB6C  TXT CLEAR WINDOW    Clear current window.     
        CURSOR           37   #BB6F  TXT SET COLUMN      Set cursor horizontal p
osition.           38   #BB72  TXT SET ROW         Set cursor vertical position.
           39   #BB75  TXT SET CURSOR      Set cursor position.           40   #
BB78  TXT GET CURSOR      Ask current cursor position.           41   #BB7B  TXT
 CUR ENABLE      Allow cursor display - user.           42   #BB7E  TXT CUR DISA
BLE     Dissallow cursor display - user.           43   #BB81  TXT CUR ON       
   Allow cursor display - system.           44   #BB84  TXT CUR OFF         Diss
allow cursor display - system.           45   #BB87  TXT VALIDATE        Check i
f a cursor position  is  within                                         the wind
ow.           46   #BB8A  TXT PLACE CURSOR    Put a cursor blob on the screen.  
         47   #BB8D  TXT REMOVE CURSOR   Take a cursor blob off the screen.     
        INKS           48   #BB90  TXT SET PEN         Set ink for writing chara
cters.           49   #BB93  TXT GET PEN         Get ink for writing characters.
           50   #BB96    PTXT SET PAPER       Set ink for writing text backgroun
d.           51   #BB99  TXT GET PAPER       Get ink for writing text background
.           52   #BB9C  TXT INVERSE         Swap current pen and paper inks.    
       53   #BB9F  TXT SET BACK        Allow  or  dissallow  background being   
                                      written.                   AMSTRAD CPC464/
664/6128 FIRMWARE                             page 14.4                     54  
 #BBA2  TXT GET BACK        Ask if background is being written.           MATRIC
ES           55   #BBA5  TXT GET MATRIX      Get the address of a character matr
ix.           56   #BBA8  TXT SET MATRIX      Set a character matrix.           
57   #BBAB  TXT SET M TABLE     Set  the  user  defined  matrix  table          
                               address.           58   #BBAE  TXT GET M TABLE   
  Get user defined matrix table address.             CONTROL CODES           59 
  #BBB1  TXT GET CONTROLS    Fetch address of control code table.             ST
REAMS           60   #BBB4  TXT STR SELECT      Select  Text VDU stream.        
   61   #BBB7  TXT SWAP STREAMS    Swap the states of two streams.             1
4.1.3 Entries to the Graphics VDU           The Graphics VDU deals with individu
al pixels.             INITIALIZATION           62   #BBBA  GRA INITIALISE      
Initialize the Graphics VDU.           63   #BBBD  GRA RESET           Reset  th
e  Graphics  VDU  - restore                                         standard ind
irections.         193  #BD43  GRA DEFAULT         Set default Graphics VDU mode
s.             CURRENT POSITION           64   #BBC0  GRA MOVE ABSOLUTE   Move t
o an absolute position.           65   #BBC3  GRA MOVE RELATIVE   Move relative 
to current position.           66   #BBC6  GRA ASK CURSOR      Get the current p
osition.           67   #BBC9  GRA SET ORIGIN      Set   the   origin   of    th
e    user                                         coordinates.           68   #B
BCC  GRA GET ORIGIN      Get   the   origin   of    the    user                 
                        coordinates.           197  #BD4F  GRA FROM USER       C
onvert  user  coordinates   to   base                                         co
ordinates.               AMSTRAD CPC464/664/6128 FIRMWARE                       
      page 14.5                     WINDOW           69   #BBCF  GRA WIN WIDTH  
     Set  left  and  right  edges  of   the                                     
    graphics window.           70   #BBD2  GRA WIN HEIGHT      Set  top  and  bo
ttom  edges  of   the                                         graphics window.  
         71   #BBD5  GRA GET W WIDTH     Get the left and right  edges  of  the 
                                        graphics window.           72   #BBD8  G
RA GET W HEIGHT    Get the top and bottom  edges  of  the                       
                  graphics window.           73   #BBDB  GRA CLEAR WINDOW    Cle
ar the graphics window.             INKS           74   #BBDE  GRA SET PEN      
   Set the graphics plotting ink.           75   #BBE1  GRA GET PEN         Get 
the current graphics plotting ink.           76   #BBE4  GRA SET PAPER       Set
 the graphics background ink.           77   #BBE7  GRA GET PAPER       Get the 
 current  graphics  background                                         ink.     
      194  #BD46  GRA SET BACK        Set  whether  background  is   to   be    
                                     written.             PLOTTING           78 
  #BBEA  GRA PLOT ABSOLUTE   Plot a point at an absolute position.           79 
  #BBED  GRA PLOT RELATIVE   Plot a point relative to  the  current             
                            position.           TESTING           80   #BBF0  GR
A TEST ABSOLUTE   Test a point at an absolute position.           81   #BBF3  GR
A TEST RELATIVE   Test a point relative to  the  current                        
                 position.           LINE DRAWING           82   #BBF6  GRA LINE
 ABSOLUTE   Draw a line to an absolute position.           83   #BBF9  GRA LINE 
RELATIVE   Draw a line relative  to  the  current                               
          position.           195  #BD49  GRA SET FIRST       Set whether first 
point of a  line  is                                         to be plotted.     
      196  #BD4C  GRA SET LINE MASK   Set mask for drawing lines.             AM
STRAD CPC464/664/6128 FIRMWARE                             page 14.6            
         AREA FILLING           198  #BD52  GRA FILL            Fill an area of 
the screen.           CHARACTER DRAWING           84   #BBFC  GRA WR CHAR   P   
     Put a character on the screen  at  the                                     
    current graphics position.           14.1.4 Entries to the Screen Pack      
     The Screen Pack interfaces the Text and Graphics VDUs  to  the  screen     
    hardware. Screen functions that affect both text  and  graphics  (e.g.      
   ink colours) are located in the Screen Pack.           INITIALIZATION        
   85   #BBFF  SCR INITIALISE      Initialize the Screen Pack.           86   #B
C02  SCR RESET           Reset  the  Screen  Pack   -   restore                 
                        standard indirections, ink colours and                  
                       flash rates.         SCREEN HARDWARE           87  #BC05 
 SCR SET OFFSET       Set the offset of  the  start  of  the                    
                     screen.           88  #BC08  SCR SET BASE         Set the a
rea of RAM  to  use  for  the                                         screen mem
ory.           199 #BD55  SCR SET POSITION     Set the location of the screen  m
emory                                         without moving the screen.        
   89  #BC0B  SCR GET LOCATION     Fetch   current   base   and    offset       
                                  settings.           MODE           90  #BC0E  
SCR SET MODE         Set screen into new mode.           91  #BC11  SCR GET MODE
         Ask the current screen mode.           92  #BC14  SCR CLEAR            
Clear the screen (to ink zero).           93  #BC17  SCR CHAR LIMITS      As k s
ize of the screen in characters.           SCREEN ADDRESSES           94  #BC1A 
 SCR CHAR POSITION    Convert  physical  coordinates  to   a                    
                     screen position.           95  #BC1D  SCR DOT POSITION     
Convert base coordinates to  a  screen                                         p
osition.           96  #BC20  SCR NEXT BYTE        Step a screen address right o
ne byte.                 AMSTRAD CPC464/664/6128 FIRMWARE                       
      page 14.7            page 14.10  of t                   97  #BC23  SCR PRE
V BYTE        Step a screen address left one byte.           98  #BC26  SCR NEXT
 LINE        Step a screen address down one line.           99  #BC29  SCR PREV 
LINE        Step a screen address up one line.             INKS             100 
#BC2C  SCR INK ENCODE       Encode an ink to cover all pixels in a              
                           byte.           101 #BC2F  SCR INK DECODE       Decod
e an encoded ink.           102 #BC32  SCR SET INK          Set the colours in w
hich to display an                                         ink.           103 #B
C35  SCR GET INK          Ask the colours an  ink  is  currently                
                         displayed in.           104 #BC38  SCR SET BORDER      
 Set the colours in  which  to  display                                         
the border.           105 #BC3B  SCR GET BORDER       Ask  the   colours   the  
 border   is                                         currently displayed in.    
       106 #BC3E  SCR SET FLASHING     Set the flash periods.           107 #BC4
1  SCR GET FLASHING     Ask the current flash periods.             MISCELLANEOUS
             108 #BC44  SCR FILL BOX         Fill a character area  of  the  scr
een                                         with an ink.           109 #BC47  SC
R FLOOD BOX        Fill a byte area of the screen with an                       
                  ink.           110 #BC4A  SCR CHAR INVERT      Invert a charac
ter position.           111 #BC4D  SCR HW ROLL          Move the whole screen up
 or down eight                                         pixel lines (one characte
r).           112 #BC50  SCR SW ROLL          Move an area of the screen up or  
down                                         eight pixel lines (one character). 
          113 #BC53  SCR UNPACK           Expand  a  character  matrix  for  the
                                         current screen mode.           114 #BC5
6  SCR REPACK           Compress a  character  matrix  to  the                  
                       standard form.                   AMSTRAD CPC464/664/6128 
FIRMWARE                             page 14.8                     115 #BC59  SC
R ACCESS           Set the  screen  write  mode  for  the                       
                  Graphics VDU.           116 #BC5C  SCR PIXELS           Write 
a pixel to the  screen  ignoring                                           the G
raphics VDU write mode.         LINE DRAWING             117 #BC57  SCR HORIZONT
AL       Plot a purely horizontal line.      P       118 #BC62  SCR VERTICAL    
     Plot a purely vertical line.             14.1.5 Entries to the Cassette Man
ager/AMSDOS             The Cassette Manager handles reading files from tape and
 writing files         to tape. AMSDOS intercepts the starred entries and redire
cts  them  so         they read from and write to disc. The external commands TA
PE and  DISC         can be used to switch between the tape  and  disc  versions
  of  these         routines (see section 14.6).           INITIALIZATION       
    119 #BC65  CAS INITIALISE       Initialize  the  Cassette  Manager   -      
                                   close all streams, set  default  speed       
                                  and enable messages.           120 #BC68  CAS 
SET SPEED        Set the write speed.           121 #BC6B  CAS NOISY            
Enable or disable prompt messages.           MOTOR CONTROL           122 #BC6E  
CAS START MOTOR      Start the cassette motor.           123 #BC71  CAS STOP MOT
OR       Stop the cassette motor.           124 #BC74  CAS RESTORE MOTOR    Rest
ore  previous  state  of  cassette                                         motor
.               READING FILES           125 #BC77  *CAS IN OPEN         Open a f
ile for input.           126 #BC7A  *CAS IN CLOSE        Close the input file pr
operly.           127 #BC7D  *CAS IN ABANDON      Close the input file immediate
ly.           128 #BC80  *CAS IN CHAR         Read a character from the input fi
le.           129 #BC83  *CAS IN DIRECT       Read the input file into store.   
              AMSTRAD CPC464/664/6128 FIRMWARE                             page 
14.9                     130 #BC86  *CAS RETURN          Put the last character 
read back.           131 #BC89  *CAS TEST EOF        Have we reached the end  of
  the  file                                         yet           WRITING FILES 
          132 #BC8C *CAS OUT OPEN         Open a file for output.           133 
#BC8F *CAS OUT CLOSE        Close the output file properly.           134 #BC92 
 *CAS OUT ABANDON     Close the output file immediately.           135 #BC95  *C
AS OUT CHAR        Write a character to the output file.           136 #BC98  *C
AS OUT DIRECT      Write the output  file  directly  from                       
                  store.           CATALOGUING             137 #BC9B  *CAS CATAL
OG         Generate a catalogue from the tape.             RECORDS             1
38 #BC9E  CAS WRITE            Write a record to tape.           139 #BCA1  CAS 
READ             Read a record from tape.           140 #BCA4  CAS CHECK        
    Compare a  record  on  tape  with  the                                      
   contents of store.             14.1.6 Entries to the Sound Manager.          
   The Sound Manager controls the sound chip.             INITIALIZATION        
   141 #BCA7  SOUND RESET          Reset the Sound  Manager  -  shut  the       
                                  sound chip  up  and  clear  all  sound        
                                 queues.           SOUND QUEUES             142 
#BCAA  SOUND QUEUE          Add a sound to a sound queue.           143 #BCAD  S
OUND CHECK          Ask if  there  is  space  in  a  sound                      
                   queue.                   AMSTRAD CPC464/664/6128 FIRMWARE    
                        page 14.10                     144 #BCB0  SOUND ARM EVEN
T      Set up an event to be run when a sound                                   
      queue becomes not full.           SOUNDS             145 #BCB3  SOUND RELE
ASE        Allows sounds to happen.           146 #BCB6  SOUND HOLD           St
op all sound in mid flight.           147 #BCB9  SOUND CONTINUE       Restart so
und  after  they  have  been                                         stopped.   
          ENVELOPES             148 #BCBC  SOUND AMPL ENVELOPE  Set up an amplit
ude envelope.           149 #BCBF  SOUND TONE ENVELOPE  Set up a tone envelope. 
          150 #BCC2  SOUND A ADDRESS      Get  the  address  of   an   amplitude
                                         envelope.           151 #BCC5  SOUND T 
ADDRESS      Get the address of a tone envelope.             14.1.7 Entries to t
he Kernel             The Kernel handles synchronous and asynchronous events. It
 is also  in         charge of the store map and switching ROMs on and off. Apar
t from  the         entries listed below, the Kernel has its own jumpblock and a
 number of         routines whose addresses are published. These extra entries a
re listed         in sections 14.3 and 14.4 below.             INITIALIZATION   
          152  P #BCC8  KL CHOKE OFF         Reset the Kernel -  clears  all  ev
ent                                         queues etc.           153 #BCCB  KL 
ROM WALK          Find  and  initialize  all  background                        
                 ROMs.           154 #BCCE  KL INIT BACK         Initialize  a  
particular   background                                         ROM.           1
55 #BCD1  KL LOG EXT           Introduce an RSX to the firmware.           156 #
BCD4  KL FIND COMMAND      Search for an RSX or background ROM or               
                          foreground ROM to process a command.                  
   AMSTRAD CPC464/664/6128 FIRMWARE                            page 14.11       
              FRAME FLYBACK LIST             157 #BCD7  KL NEW FRAME FLY     Ini
tialize and put a  block  onto  the                                         fram
e flyback list.           158 #BCDA  KL ADD FRAME FLY     Put a block  onto  the
  frame  flyback                                         list.           159 #BC
DD  KL DEL FRAME FLY     Remove a block from the frame  flyback                 
                        list.           FAST TICKER LIST             160 #BCE0  
KL NEW FAST TICKER   Initialize and put a  block  onto  the                     
                    fast tick list.           161 #BCE3  KL ADD FAST TICKER   Pu
t a block onto the fast tick list.           162 #BCE6  KL DEL FAST TICKER   Rem
ove a  block  from  the  fast  tick                                         list
.           TICK LIST             163 #BCE9  KL ADD TICKER        Put a block on
to the tick list.           164 #BCEC  KL DEL TICKER        Remove a block from 
the tick list.             EVENTS             165 #BCEF  KL INIT EVENT        In
itialize an event block.           166 #BCF2  KL EVENT             'Kick' an eve
nt block.           167 #BCF5  KL SYNC RESET        Clear synchronous event queu
e.           168 #BCF8  KL DEL SYNCHRONOUS   Remove a synchronous  event  from  
the                                         event queue.           169 #BCFB  KL
 NEXT SYNC         Get the next event from the queue.           170 #BCFE  KL DO
 SYNC           Perform an event routine.           171 #BD01  KL DONE SYNC     
    Finish processing an event.           172 #BD04  KL EVENT DISABLE     Disabl
e normal synchronous events.           173 #BD07  KL EVENT ENABLE      Enable no
rmal synchronous events.           174 #BD0A  KL DISARM EVENT      Prevent an ev
ent from occurring.                   AMSTRAD CPC464/664/6128 FIRMWARE          
                  page 14.12                     ELAPSED TIME             175 #B
D0D  KL TIME PLEASE       Ask the elapsed time.           176 #BD10  KL TIME SET
          Set the elapsed time.             BANK SWITCHING             201 #BD5B
  KL BANK SWITCH       Select a memory organization.           14.1.8 Entries to
 the Machine Pack           The Machine Pack provides an interface to the machin
e  hardware.  Most         packs use Machine to access any hardware they use. Th
e major exception         is the Cassette Manager which, for speed  reasons,  pe
rforms  its  own         hardware access.           PROGRAMS           177 #BD13
  MC BOOT PROGRAM      Load and run a foreground program.           178 #BD16  M
C START PROGRAM     Run a foreground program.             SCREEN           179 #
BD19  MC WAIT FLYBACK      Wait for frame flyback.           180 #BD1C  MC SET M
ODE          Set the screen mode.           181 #BD1F  MC SCREEN OFFSET     Set 
the screen offset.           182 #BD22  MC CLEAR INKS        Set all inks to one
 colour.           183 #BD25  MC SET INKS          Set colours of all the inks. 
            PRINTER           184 #BD28  MC RESET PRINTER     Reset the printer 
indirections.           200 #BD58  MC PRINT TRANSLATION Set the printer translat
ion table.           185 #BD2B  MC PRINT CHAR        Translate a character then 
send it  to                                         the Centronics port.        
   186 #BD2E  MC BUSY PRINTER      Test if the Centronics port is busy.         
  187 #BD31  MC SEND PRINTER      Send a  character  to  the  Centronics        
                                 port.           SOUND CHIP           188 #BD34 
 MC SOUND REGISTER    Send data to a sound chip register.             AMSTRAD 46
4/664/6128 FIRMWARE                               page 14.13                    
 14.1.9 Entries to Jumper           Jumper sets up the main jumpblock.          
 INITIALIZATION           189 #BD37  JUMP RESTORE         Restore the standard j
umpblock.           14.2 Firmware Indirections           The fir  Pmware indirec
tions listed here are taken at key points  in  the         firmware thus allowin
g the user to  provide  substitute  routines  for         many firmware actions,
 without having to replace a  complete  firmware         package. These indirect
ions are not intended for the user  to  call  -         there is usually a highe
r level routine in the main firmware jumpblock         that is more suitable.   
        The indirections are set up by the pack to whom  they  apply  whenever  
       its reset (or initialize) routine is called and during EMS  they  are    
     not otherwise altered by the firmware.           The indirections are all  
three  bytes  long  and  use  standard  jump         instructions (#C3). If a RO
M state other than upper ROMs disabled  and         lower ROM enabled is require
d then the appropriate restart instruction         might be substituted (see sec
tion 2.3). The  indirections  are  to  be         found between #BDCD and #BDF6.
           At this level of operation very little validation is carried  out.  I
f         incorrect parameters are passed or a  substitute  routine  corrupts  a
         register in defiance of the documented  interface  then  the  firmware 
        will probably cease to function as expected.           More detailed des
criptions of these routines can be found  in  section         16.           14.2
.1 Text VDU Indirections           0   #BDCD  TXT DRAW CURSOR      Place the cur
sor blob  on  the  screen                                         (if enabled). 
          1   #BDD0  TXT UNDRAW CURSOR    Remove the cursor blob from the screen
                                         (if enabled).           2   #BDD3  TXT 
WRITE CHAR       Write a character from the screen.           3   #BDD6  TXT UNW
RITE          Read a character from the screen.           4   #BDD9  TXT OUT ACT
ION       Output a character or control code.           14.2.2 Graphics VDU Indi
rections           5   #BDDC  GRA PLOT             Plot a point.           6   #
BDDF  GRA TEST             Test a point.           7   #BDE2  GRA LINE          
   Draw a line.               AMSTRAD CPC464/664/6128 FIRMWARE                  
          page 14.14                     14.2.3 Screen Pack Indirections        
     8   #BDE5  SCR READ             Read a pixel from the screen.           9  
 #BDE8  SCR WRITE            Write a pixel(s) to the  screen  using             
                            the current graphics write mode.           10  #BDEB
  SCR MODE CLEAR       Clear the screen to ink 0.             14.2.4 Keyboard Ma
nager Indirections             11  #BDEE  KM TEST BREAK        Test for break (o
r reset).           13  #BDF4  KM SCAN KEYS         Scan the keyboard.          
   14.2.5 Machine Pack Indirections             12  #BDF1  MC WAIT PRINTER      
Print a character or time out.             14.3 The High Kernel Jumpblock       
      The high Kernel jumpblock is provided to allow the user to  turn  ROMs    
     on and off and  to  access  memory  underneath  ROMs  while  they  are     
    enabled. The entries in this jumpblock are not all jump  instructions,      
   some entries are the start of routines, thus the user should not alter       
  any of the entries  in  this  jumpblock.  The  high  Kernel  jumpblock        
 occupies store from #B900 upwards. More detailed descriptions  of  the         
routines in it can be found in section 17.             0   #B900  KL U ROM ENABL
E      Turn on the current upper ROM.           1   #B903  KL U ROM DISABLE     
Turn off the upper ROM.           2   #B906  KL L ROM ENABLE      Turn on the lo
wer ROM.           3   #B909  KL L ROM DISABLE     Turn off the lower ROM.      
     4   #B90C  KL ROM RESTORE       Restore the previous ROM state.           5
   #B90F  KL ROM SELECT        Select a particular upper ROM.           6   #B91
2  KL CURR SELECTION    Ask  which  upper  ROM  is   currently                  
                       selected.           7   #B915  KL PROBE ROM         Ask c
lass and version of a ROM.                     AMSTRAD CPC464/664/6128 FIRMWARE 
                           page 14.15             There are a number of jumpbloc
ks provided by the firmware. The largest          ROM RESTORE       Restore the 
previous ROM state.           5   #B90F  KL ROM SELECT        Select a particula
r upper ROM.           6   #B912  KL CURR SELECTION    Ask  which  upper  ROM  i
s   currently                                         selected.           7   #B
915  KL PROBE ROM         Ask class and version of a ROM.                     AM
STRAD CPC464/664/6128 FIRMWARE     P                   8   #B918  KL ROM DESELEC
T      Restore   the   previous   upper   ROM                                   
      selection.           9   #B91B  KL LDIR              Move store (LDIR) wit
h ROMs disabled.           10  #B91E  KL LDDR              Move store (LDDR) wit
h ROMs disabled.           11  #B921  KL POLL SYNCHRONOUS  Check if an event wit
h higher priority                                         than the current event
 is pending.           14  #B92A  KL SCAN NEEDED       Ensure keyboard  is  scan
ned  at  next                                         opportunity.           (N.
B there are no entries 12 or 13).             14.4 The Low Kernel Jumpblock.    
         The Kernel provides a number of useful routines in the area of  memory 
        between #000 and #003F. These are available, in some cases, both as  a  
       published routine address and as a restart instruction. In general the   
      routines are available both in ROM and RAM so whether the lower ROM is    
     enabled does not matter. There are also a couple  of  areas  available     
    for the user to patch to trap RST  6s  and  interrupts  from  external      
   hardware.             The low Kernel jumpblock is  not  intended  for  the  u
ser  to  alter.         However, it may be necessary to alter it under certain  
circumstances.         In particular the INTERRUPT ENTRY (by patching the jump a
t  #0038)  or         the RESET ENTRY (by  patching  the  bytes  from  #0000..#0
007).  If  a         program does change any locations in the jumpblock (other  
than  those         in the USER RESTART or EXT INTERRUPT areas) then it is  the 
 program's         responsibility to ensure that the lower ROM is enabled or the
 original         contents are restored when any other programs runs. In particu
lar  the         program must sort out the state when interrupts occur (hence th
e  need         to patch the INTERRUPT ENTRY).             More detailed descrip
tions of the routines in this  jumpblock  can  be         found in section 18.  
           #0000  RST 0  RESET ENTRY       Completely reset  the  machine  as  i
f                                         powered up.           #0008  RST 1  LO
W JUMP          Jump to lower ROM  or  RAM,  takes  an                          
               inline 'low address' to jump to.           #000B         KL LOW P
CHL       Jump to lower ROM or RAM, HL  contains                                
         the 'low address' to jump to.           #000E         PCBC INSTRUCTION 
 Jump to address in BC.                   AMSTRAD CPC464/664/6128 FIRMWARE      
                      page 14.16                     #0010  RST 2 SIDE CALL     
     Call to a sideways ROM,  takes  inline                                     
    'side address' to call.           #0013  KL SIDE PCHL             Call to a 
sideways  ROM,  HL  contains                                         'side addre
ss' to call.           #0016  PCDE INSTRUCTION         Jump to address in DE.   
        #0018  RST 3 FAR CALL           Call a routine  in  any  ROM  or  RAM,  
                                       takes an inline address  of  the  'far   
                                      address' to call.           #001B  KL FAR 
PCHL              Call a routine in any ROM  or  RAM,  C                        
                 and HL contain the  'far  address'  to                         
                call.           #001E  PCHL INSTRUCTION         Jump to address 
in HL.           #0020  RST 4 RAM LAM            LD A,(HL) with all ROMs disable
d.           #0023  KL FAR ICALL             Call a routine in any ROM or  RAM, 
 HL                                         points at the 'far address' to call.
           #0028  RST 5 FIRM JUMP          Jump to lower  ROM,  takes  an  inlin
e                                         address to jump to.           #0030  R
ST 6 USER RESTART       ROM version saves current ROM state in                  
                       #002B, turns the  lower  ROM  off  and                   
                      jumps to the RAM version. RAM  version                    
                     may be patched  by  the  user  between                     
                    #0030 and #0037 inclusively.           #0038  RST 7 INTERRUP
T ENTRY    This restart is not available as it is                               
          used  for  interrupts  (Z80  interrupt                                
         mode 1).           #003B  EXT INTERRUPT            When  an  interrupt 
 occurs   on   the                                         expansion  port  the 
 fi  Prmware   calls                                         location #003B in R
AM.  The  user  may                                         patch   between   #0
03B   and    #003F                                         inclusive to trap thi
s occurrence.                                             AMSTRAD CPC464/664/612
8 FIRMWARE                            page 14.17  he largest         EXT INTERRU
PT            When  an  interrupt  occurs   on   the                            
             expansion  port  the  fi               15 The Main Firmware Jumpblo
ck.             This section describes in detail the entry and exit conditions a
nd the         effects of all the routines in the main firmware jumpblock.  The 
 main         firmware jumpblock is described in section 14.1.             The u
ser  is  advised  to  read  the  sections  on  each  pack  before         attemp
ting to understand the jumpblock entries. The relevant  sections         are    
                  Key Manager         (KM)      Section 3.                  Text
 VDU            (TXT)     Section 4.                  Graphics VDU        (GRA) 
    Section 5.                  Screen Pack         (SCR)     Section 6.        
          Sound Manager       (SOUND)   Section 7.                  Cassette Man
ager    (CAS)     Section 8.                  AMSDOS                        Sect
ion 9.                  Kernel              (KL)      Sections 2, 10, 11 and 12.
                  Machine Pack        (MC)      Section 13.             The top 
line of each description has the following layout                      Entry num
ber     Entry name        Entry address             Entries in the jumpblock are
  numbered  starting  from  0.  The  entry         address is the address to cal
l to invoke the firmware routine  or  the         address of the three bytes to 
patch  to  intercept  the  routine.  The         entry address can be calculated
 as                      Entry address  Start of jumpblock +3 * Entry number    
         Each entry is named and is referred to by name throughout this manual. 
          The last section of each description is a list  of  related  routines.
         The user is advised to look at these as the list may include  routines 
        more suited for  the  application  being  considered.  Conversely  the  
       routines may shed further light on how the original routines should be   
      used.             The descriptions of the routines are for the default rou
tine that  the         entry jumps to. The user may change the entry and this ma
y  alter  the         action of the routine. The user is advised to stick to the
  entry/exit         conditions described otherwise programs that call the  rout
ine  (BASIC         for example) may cease to operate correctly.                
 AMSTRAD CPC464/664/6128 FIRMWARE                             page 15.1         
            0 KM INITIALISE                                                 #BB0
0             Initialize the Key Manager             Action             Full ini
tialization of the  Key  Manager  (as  during  EMS).  All  Key         Manager v
ariables,  buffers  and  indirections  are  initialized.  The         previous s
tate of the Key Manager is lost.             Entry conditions             No con
ditions.               Exit conditions             AF,BC,DE and HL corrupt.     
    All other registers preserved.             Notes             The Key Manager
 indirection (KM  TEST  KEY)  is  set  to  its  default         routine.        
   The key buffer is set up (to be empty).           The expansion buffer is set
 up and the expansions  are  set  to  their         default strings.           T
he translation table are initialized to their default translations.           Th
e repeating key map is initialized to its default state.           The repeat sp
eeds are set to their default values.           Shift and caps lock are turned o
ff.           The break event is disarmed.           See Appendices II, III and 
IV  for  the  default  translation  tables,         repeating key table and expa
nsion strings.           This routine enables interrupts.           Related entr
ies           KM RESET             AMSTRAD CPC464/664/6128 FIRMWARE             
                page 15.2                     1 KM RESET                        
                              #BB03             Reset the Key Manager.          
   Action             Reinitializes the Key Manager indirections and buffers.   
          Entry conditions             No conditions.             Exit condition
s             AF,BC,DE and HL co  Prrupt.         All other registers preserved.
             Notes             The Key Manager indirection (KM  TEST  KEY)  is  
set  to  its  default         routine.             The key buffer is set up (to 
be empty).             The expansion buffer is set up and the expansions  are  s
et  to  their         default strings (see Appendix IV).             The break e
vent is disarmed.             All pending keys and characters are discarded.    
         This routine enables interrupts.             Related entries           
KM DISARM BREAK         KM EXP BUFFER         KM INITIALISE                     
AMSTRAD CPC464/664/6128 FIRMWARE                             page 15.3          
           2 KM WAIT CHAR                                                  #BB06
             Wait for the next character from the keyboard.             Action  
           Try to get a character from the key buffer or  the  current  expansio
n         string. This routine waits  until  a  character  is  available  if  no
         character is immediately available.             Entry conditions       
      No conditions.           Exit conditions             Carry true.         A
 contains the character.         Other flags corrupt.         All other register
s preserved.             Notes             The possible sources for generating t
he next  character  are,  in  the         order that they are tested            
          The 'put back' character.                  The next character of an ex
pansion string.                  The first character of an expansion string.    
              A character from a key translation table.             Expansion to
kens found in the key translation table  are  expanded  to         their associa
ted strings. Expansion tokens found in expansion  strings         are not expand
ed but are treated as characters.             Related entries             KM CHA
R RETURN         KM READ CHAR         KM WAIT KEY                       AMSTRAD 
CPC464/664/6128 FIRMWARE                             page 15.4                  
   3 KM READ CHAR                                                  #BB09        
   Test if a character is available from the keyboard.           Action         
Try to get a character from the key buffer or  the  current  expansion         s
tring. This routine does not wait for a character to become available         if
 there is no character available immediately.           Entry conditions        
   No conditions.           Exit conditions           If there was a character a
vailable                    Carry true.                  A contains the characte
r.           If there was no character available.                    Carry false
.                  A corrupt.           Always                    Other flags co
rrupt.                  All other registers preserved.           Notes          
 The possible sources for generating the next  character  are,  in  the         
order that they are tested                    The 'put back' character.         
         The next character of an expansion string.                  The first c
haracter of an expansion string.                  A character from a key transla
tion table.           Expansion tokens in the key translation  table  will  be  
expanded  to         their associated strings. Expansion tokens found in expansi
on  strings         are not expanded but are treated as characters.           Th
is routine will always return a character if one is available. It is         the
refore possible to flush out the Key Manager buffers by calling  KM         READ
 CHAR repeatedly until it reports that no character is available.           Rela
ted entries           KM CHAR RETURN         KM FLUSH         KM READ KEY       
  KM WAIT CHAR                   AMSTRAD CPC464/664/6128 FIRMWARE               
              page 15.5                     4 KM CHAR RETURN                    
                            #BB0C             Return a single character to the k
eyboard for next time.             Action             Save a character for the n
ext call of KM READ CHAR or KM WAIT CHAR.             Entry conditions          
   A contains the character to put back.             Exit conditions            
 All registers and flags preserved.               Notes             The 'put bac
k' character will be returned before any  other  character         is generated 
by the keyboard. It will not be  expanded  (or  otherwise         dealt with) bu
t will be returned as it is. The  'put  back'  character         need not have b
een read from the keyboard, it could be inserted by the       P    user for some
 purpose.             It is only possible to have one 'put back' character. If t
his  routine         is called twice without reading a character  between  these
  then  the         first (put back' will be lost. Furthermore,  it  is  not  po
ssible  to         return character 255 (because this is used as the marker for 
 no  'put         back' character).             Related entries             KM R
EAD CHAR         KM WAIT CHAR                                 AMSTRAD CPC464/664
/6128 FIRMWARE                             page 15.6                     5 KM SE
T EXPAND                                                 #BB0F           Set an 
expansion string.           Action           Set the expansion string associated
 with an expansion token.           Entry conditions           B contains the ex
pansion token for the expansion to set.         C contains the length of the str
ing.         HL contains the address of the string.           Exit conditions   
        If the expansion is OK                    Carry true.           If the s
tring was too long or the token was invalid                    Carry false.     
      Always                    A,BC,DE,HL and other flags corrupt.             
     All other registers preserved.             Notes The string to be set may l
ie anywhere in RAM. Expansion strings         cannot be set directly from ROM.  
           The characters in the string are  not  expanded  (or  otherwise  deal
t         with). It is therefore possible to put any character into an expansion
         string.             If there is insufficient room in the  expansion  bu
ffer  for  the  new         string then no change is made to the expansions.    
         If the string set is currently being used to generate  characters  (by 
        KM READ CHAR or KM WAIT CHAR) then the unread portion of the string is  
       discarded. The next character will be read from the key buffer.          
   This routine enables interrupts.           Related entries           KM GET E
XPAND         KM READ CHAR         KM WAIT CHAR                 AMSTRAD CPC464/6
64/6128 FIRMWARE                             page 15.7                     6 KM 
GET EXPAND                                                 #BB12             Get
 a character from an expansion string.             Action             Read a cha
racter from an  expansion  string.  The  characters  in  the         string are 
numbered starting from 0.             Entry conditions             A contains an
 expansion token.             L contains the character number.             Exit 
conditions             If the character was found                         Carry 
true.                     A contains the character.             If the token was
 invalid or the string was not long enough                         Carry false. 
                    A corrupt.             Always                         DE and
 other flags corrupt.                     All other registers preserved.        
     Notes           The characters in the expansion string are not expanded (or
  otherwise         dealt with). It is therefore possible to put  any  character
  into  an         expansion string.             Related entries           KM RE
AD CHAR         KM SET EXPAND             AMSTRAD CPC464/664/6128 FIRMWARE      
                       page 15.8                     7 KM EXP BUFFER            
                                     #BB15           Allocate a buffer for expan
sion strings.           Action           Set the address and length of the  expa
nsion  buffer.  Initialize  the         buffer with the default expansion string
s.           Entry conditions           DE contains the address of the buffer.  
       HL contains the length of the buffer.           Exit conditions          
 If the buffer is OK                    Carry true.           If the buffer is t
oo short.                    Carry false.           Always                    A,
BC,DE,HL and other flags corrupt.                  All other registers preserved
.           Notes             The buffer must not be located underneath a ROM  a
nd  it  must  be  at         least 49 bytes long  (i.e.  have  sufficient  space
  for  the  default         expansion strings). If the new buffer is too short t
hen the old buffer         is left unchanged.             The default expansion 
strings are given in Appendix IV.             Any expansion string currently bei
ng read is discarded.             This routine enables interrupts.              
       Related entries           KM GET EXPAND         KM SET EXPAND            
       P          AMSTRAD CPC464/664/6128 FIRMWARE                             p
age 15.9                     8 KM WAIT KEY                                      
             #BB18             Wait for next key from the keyboard.             
Action             Try to get a key from the key buffer. This routine waits unti
l  a  key         is found if no key is immediately available.             Entry
 conditions             No conditions.             Exit conditions             C
arry true.         A contains the character or expansion token.             Othe
r flags corrupt.         All registers preserved.             Notes             
The next key is read from the key  buffer  and  translated  using  the         a
ppropriate key translation table. Expansion tokens are  not  expanded         bu
t are  passed  out  for  the  user  to  deal  with,  as  are  normal         cha
racters. Other Key  Manager  tokens  (shift  lock,  caps  lock  and         igno
re) are obeyed but are not passed out.             Related entries             K
M READ KEY         KM WAIT CHAR                                     AMSTRAD CPC4
64/664/6128 FIRMWARE                            page 15.10                     9
 KM READ KEY                                                   #BB1B           T
est if a key is available from the keyboard.           Action           Try to g
et a key from the key buffer. This routine does not wait if no         key is av
ailable immediately.           Entry conditions           No conditions.        
   Exit conditions.           If a key was available                    Carry tr
ue.                    A contains the character or expansion token.           If
 no key was available                    Carry false.                  A corrupt
.           Always                    Other flags corrupt.                  All 
other registers preserved.           Notes             The next key is read from
 the key  buffer  and  translated  using  the         appropriate key translatio
n table. Expansion tokens are  not  expanded         but are  passed  out  for  
the  user  to  deal  with,  as  are  normal         characters. Other Key  Manag
er  tokens  (shift  lock,  caps  lock  and         ignore) are obeyed but are no
t passed out.             This routine will always return a key  if  one  is  av
ailable.  It  is         therefore possible to flush out the key buffer by calli
ng KM READ  KEY         repeatedly until it claim no key is available. Note, how
ever, that the         'put back' character or a partially read expansion string
 is  ignored.         It is advisable to use KM READ CHAR to flush these out  wh
en  emptying         the Key Manager buffers, or, in V1.1 firmware, to call KM F
LUSH.             Related entries             KM FLUSH         KM READ CHAR     
    KM WAIT KEY                 AMSTRAD CPC464/664/6128 FIRMWARE                
            page 15.11  etail the entry and exit conditions and thntil it claim 
no key is available. Note, however, that the         'put back' character or a p
artially read expansion string is                    10 KM TEST KEY             
                                     #BB1E           Test if a key is pressed.  
         Action           Test if a particular key or joystick button is pressed
. This  is  done         using the  key  state  map  rather  then  by  accessing
  the  keyboard         hardware.           Entry conditions           A contain
s the key number.           Exit conditions           If the key is pressed     
               Zero false.           If the key is not pressed                  
  Zero true.           Always                    Carry false.                  C
 contains the current shift and control state.                    A,HL and other
 flags corrupt.                  All other registers preserved.           Notes 
          The shift and control states are automatically  read  when  a  key  is
         scanned. If bit 7 is set then the control key is pressed and if bit  5 
        is set then one of the shift keys is pressed.           The key number i
s not checked. An invalid key number will generate the         correct shift and
 control states but the state of the key tested  will         be meaningless.   
        The key state map which this routine tests is updated by the  keyboard  
       scanning routine. Normally this run is every fiftieth of a second  and   
      so the state may be out of date  by  that  much.  The  key  debouncing    
     requires that a key should be released for two scans of  the  keyboard     
    before it is marked as released in the  !P!!!!!!!!! key state map the pressi
ng  of         a key is detected immediately.             Related entries       
    KM GET JOYSTICK         KM GET STATE         KM READ KEY                 AMS
TRAD CPC464/664/6128 FIRMWARE                            page 15.12             
        11 KM GET STATE                                                 #BB21   
          Fetch Caps Lock and Shift Lock states.               Action           
  Ask if the keyboard is currently shift locked or caps locked.             Entr
y conditions             No conditions.             Exit conditions             
L contains the shift lock state.         H contains the caps lock state.        
     AF corrupt.         All other registers preserved.             Notes       
      The lock states are                      #00       means the lock is off  
                #FF       means the lock is on             The default lock stat
es are off.             Related entries             KM SET LOCKS         KM TEST
 KEY                               AMSTRAD CPC464/664/6128 FIRMWARE             
               page 15.13                     12 KM GET JOYSTICK                
                              #BB24             Fetch current state of the joyst
ick(s).             Action             Ask what the current states of the joysti
cks are. These are read  from         the key state map rather than by accessing
 the keyboard hardware.             Entry conditions             No conditions. 
            Exit conditions             H contains the state of joystick 0.     
    L contains the state of joystick 1.         A contains the state of joystick
 0.           Flags corrupt.         All other registers preserved.           No
tes           In normal operation the key state map is updated by the  key  scan
ning         routine every fiftieth of a  second  so  the  state  returned  may 
 be         slightly out of date.             The joystick states are bit signif
icant as follows                    Bit 0     Up.                  Bit 1     Dow
n.                  Bit 2     Left.                  Bit 3     Right.           
       Bit 4     Fire 2.                  Bit 5     Fire 1.                  Bit
 6     Spare joystick button (usually unconnected).                  Bit 7     A
lways zero.           If a bit is set then the appropriate button is pressed.   
        Joystick 1 is indistinguishable from certain keys on the keyboard (see  
       Appendix 1).           Related entries           KM TEST KEY             
    AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.14      
               13 KM SET TRANSLATE                                             #
BB27           Set entry in normal key translate table.           Action        
   Set what character or token a key will be translated to  when  neither       
  shift nor control is pressed.           Entry conditions           A contains 
a key number.         B contains the new translation.           Exit conditions 
          AF and HL corrupt.         All other registers preserved.           No
tes           If the key number is invalid (greater  than  79)  then  no  action
  is         taken.           Most values in the table are treated as characters
 and are passed back         to the user. However, there are certain special val
ues                    #80..#9F  are  the  expansion  tokens  and  are  expanded
  to                            character strings when KM READ CHAR or KM WAIT C
HAR                            is called although they are passed  back  like  a
ny                            other character when KM READ KEY or KM WAIT KEY  i
s                            called.                    #FD       is the caps lo
ck token and causes the caps lock  to                            toggle (turn on
 if off and vice versa).                    #FE       is the shift lock token an
d causes the  shift  lock                            to toggle (turn on if off a
nd vice versa).                    #FF       is the ignore token and means  the 
 key  should  be                            thrown away.           Characters #E
0..#FC have special meanings to  the  BASIC  to  do  with         editing, curso
ring and breaks.             See Appendix II for a full listing of the default t
ranslation tables.             Related entries             KM GET TRANSLATE     
    KM SET CONTROL         KM SET SHIFT                 AMSTRAD CPC464/664/6128 
FIRMWARE                            page 15.15                     14 KM GET TRA
NSLATE                                             #BB2A             Get entry  
 "P"""""""""from normal translation table.             Action           Ask what
 character or token a key will be translated to  when  neither         shift nor
 control is pressed.           Entry conditions           A contains a key numbe
r           Exit conditions           A contains the current translation.       
    HL and flags corrupt.         All other registers preserved.           Notes
           The key number is not checked. If it is invalid (greater than 79) the
n         the translation returned is meaningless.           Most values in the 
table are treated as characters and are passed back         to the user. However
, there are certain special values                    #80..#9F  are  the  expans
ion  tokens  and  are  expanded  to                            character strings
 when KM READ CHAR or KM WAIT CHAR                            is called although
 they are passed  back  like  any                            other character whe
n KM READ KEY or KM TEST KEY  is                            called.             
       #FD       is the caps lock token and causes the caps lock  to            
                toggle (turn on if off and vice versa).                    #FE  
     is the shift lock token and causes the  shift  lock                        
    to toggle (turn on if off and vice versa).                    #FF       is t
he ignore token and means  the  key  should  be                            throw
n away.           Characters #E0..#FC have special meanings to  the  BASIC  to  
do  with         editing, cursoring and breaks.           See Appendix II for a 
full listing of the default translation tables.           Related entries       
    KM GET CONTROL         KM GET SHIFT         KM SET TRANSLATE                
 AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.16         
            15 KM SET SHIFT                                                 #BB2
D           Set entry in shifted key translation table.           Action        
   Set what character or token a key will be translated to  when  control       
  is not pressed but shift is pressed or shift lock is on           Entry condit
ions           A contains a key number.         B contains the new translation. 
          Exit conditions           AF and HL corrupt.         All other registe
rs preserved.           Notes           If the key number is invalid (greater  t
han  79)  then  no  action  is         taken.             Most values in the tab
le are treated as characters and are passed back         to the user. However, t
here are certain special values                    #80..#9F  are  the  expansion
  tokens  and  are  expanded  to                            character strings wh
en KM READ CHAR or KM WAIT CHAR                            is called although th
ey are passed  back  like  any                            other character when K
M READ KEY or KM TEST KEY  is                            called.                
    #FD       is the caps lock token and causes the caps lock  to               
             toggle (turn on if off and vice versa).                    #FE     
  is the shift lock token and causes the  shift  lock                           
 to toggle (turn on if off and vice versa).                    #FF       is the 
ignore token and means  the  key  should  be                            thrown a
way.           Characters #E0..#FC have special meanings to  the  BASIC  to  do 
 with         editing, cursoring and breaks.             See Appendix II for a f
ull listing of the default translation tables.             Related entries      
       KM GET CONTROL         KM GET SHIFT         KM SET TRANSLATE             
  AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.17        
             16 KM GET SHIFT                                                 #BB
30           Get entry from shifted key translation table.           Action     
      Ask what character or token a key will be translated to  when  control    
     is not pressed but shift is pressed or shift lock is on.           Entry co
nditions           A contains a key number.           Exit conditions           
A contains the current translation.           HL and flags corrupt.         All 
other registers preserved.           Notes           The key number is not check
ed. If it is invalid (greater than 79) then         the translation returned is 
meaningless.           Most values in the table are treated as characters and ar
e passed back         to the user. However, there are certain special values    
                #80..#9F  are  the  expa  #P#########nsion  tokens  and  are  ex
panded  to                              character strings when KM READ CHAR or K
M WAIT CHAR                            is called although they are passed  back 
 like  any                            other character when KM READ KEY or KM TES
T KEY  is                            called.                    #FD       is the
 caps lock token and causes the caps lock  to                            toggle 
(turn on if off and vice versa).                    #FE       is the shift lock 
token and causes the  shift  lock                            to toggle (turn on 
if off and vice versa).                    #FF       is the ignore token and mea
ns  the  key  should  be                            thrown away.           Chara
cters #E0..#FC have special meanings to  the  BASIC  to  do  with         editin
g, cursoring and breaks.           See Appendix II for a full listing of the def
ault translation tables.           Related entries             KM GET CONTROL   
      KM GET SHIFT         KM SET TRANSLATE                 AMSTRAD CPC464/664/6
128 FIRMWARE                            page 15.18                     17 KM SET
 CONTROL                                               #BB33           Set entry
 in control key translation table.           Action           Set a character or
 token a key will be translated to when  control  is         pressed.           
Entry conditions           A contains a key number.         B contains the new t
ranslation.           Exit conditions           AF and HL corrupt.         All o
ther registers preserved.           Notes           If the key number is invalid
 (greater  than  79)  then  no  action  is         taken.           Most values 
in the table are treated as characters and are passed back         to the user. 
However, there are certain special values                    #80..#9F  are  the 
 expansion  tokens  and  are  expanded  to                            character 
strings when KM READ CHAR or KM WAIT CHAR                            is called a
lthough they are passed  back  like  any                            other charac
ter when KM READ KEY or KM TEST KEY  is                            called.      
                #FD       is the caps lock token and causes the caps lock  to   
                         toggle (turn on if off and vice versa).                
    #FE       is the shift lock token and causes the  shift  lock               
             to toggle (turn on if off and vice versa).                    #FF  
     is the ignore token and means  the  key  should  be                        
    thrown away.           Characters #E0..#FC have special meanings to  the  BA
SIC  to  do  with         editing, cursoring and breaks.           See Appendix 
II for a full listing of the default translation tables.             Related ent
ries           KM GET CONTROL         KM GET SHIFT         KM SET TRANSLATE     
              AMSTRAD CPC464/664/6128 FIRMWARE                            page 1
5.19                     18 KM GET CONTROL                                      
         #BB36           Get entry from control key translation table.          
 Action           Ask what a character or token a key will be translated to when
 control         is pressed.           Entry conditions           A contains a k
ey number.           Exit conditions           A contains the current translatio
n.         HL and flags corrupt.         All other registers preserved.         
  Notes           The key number is not checked. If it is invalid (greater than 
79) then         the translation returned is meaningless.           Most values 
in the table are treated as characters and are passed back         to the user. 
However, there are certain special values                    #80..#9F  are  the 
 expansion  tokens  and  are  expanded  to                            character 
strings when KM READ CHAR or KM WAIT CHAR                            is called a
lthough they are passed  back  like  any                            other charac
ter when KM READ KEY or KM TEST KEY  is                            called.      
              #FD       is the caps lock token and causes the caps lock  to     
                       toggle (turn on if off and vice versa).                  
  #FE       is the shift lock token and causes the  shift  lock                 
           to toggle (turn on if off and vice versa).                    #FF    
   is the ignore token and means  the  key  should  be                          
  thrown away.           Characters #E0..#FC have special meanings to  the  BASI
C  to    $P$$$$$$$$$do  with         editing, cursoring and breaks.             
See Appendix II for a full listing of the default translation tables.           
  Related entries             KM GET CONTROL         KM GET SHIFT         KM SET
 TRANSLATE                 AMSTRAD CPC464/664/6128 FIRMWARE                     
       page 15.20                     19 KM SET REPEAT                          
                      #BB39             Set whether a key may repeat.           
  Action             Set the entry in the repeating key map that determines whet
her  a  key         is allowed to repeat or not.             Entry conditions   
          If the key is to be allowed to repeat                      B contains 
#FF.             If the key is not to be allowed to repeat                      
B contains #00             Always                      A contains the key number
.             Exit conditions             AF,BC and HL corrupt.         All othe
r registers preserved.             Notes             If the key number is invali
d (greater  than  79)  then  no  action  is         taken.             The defau
lt repeating keys are listed in Appendix III.             Related entries       
      KM GET REPEAT         KM SET DELAY               AMSTRAD CPC464/664/6128 F
IRMWARE                            page 15.21                                   
             #BB1E           Test if a key is pressed.   CHAP-14 P3 'CHAP-15 P1 
CHAP-15 $$$CHAP-15 P2 £        Notes             If the key number is invalid (g
reater  than  79)  then  no  action  is         taken.             The default r
epeating keys are listed in Appendix III.             Related entries           
  KM GET REPEAT         KM SET DELAY               AMSTRAD CPC464/664/6128 FIRMW
ARE                            page 15.21  tail the entry and exit conditions an
d thtains the key number.             Exit conditions             AF,BC and HL c
orrupt.         All other registers preserved.                        20 KM SET 
DELAY                                                 #BB3C             Ask if a
 key is allowed to repeat.             Action             Test the entry in the 
repeating key map that says  whether  a  key  is         allowed to repeat or no
t.             Entry conditions             If the key is allowed to repeat     
                 Zero false.             If the key is not allowed to repeat    
                  Zero true.             Always                      Carry false
.                  A,HL and other flags corrupt.                  All other regi
sters preserved.             Notes             The key number is not checked. If
 it is invalid (greater than 79) then         the repeat state returned is meani
ngless.             The default repeating keys are listed in Appendix III.      
       Related entries             KM SET REPEAT                           AMSTR
AD CPC464/664/6128 FIRMWARE                            page 15.22               
      21 KM SET DELAY                                                 #BB3F     
      Set start delay and repeat speed.           Action           Set the time 
before keys first repeat (start up delay)  and  the  time         between repeat
s (repeat speed).             Entry conditions             H contains the new st
art up delay.         L contains the new repeat speed.             Exit conditio
ns             AF corrupt.         All other registers preserved.             No
tes             Both delays are given in  scans  of  the  keyboard.  The  keyboa
rd  is         scanned every fiftieth of a second.             A start up delay 
or repeat speed of 0 is taken to mean 256.             The default start up dela
y is 30 scans (0.6 seconds) and  the  default         repeat speed is 2 scans (0
.04 seconds or 25 characters a second).             Note that a key is prevented
 from repeating (by the  key  scanner)  if         the key buffer is not empty. 
Thus  the  actual  repeat  speed  is  the         slower of the supplied repeat 
speed and the rate at  which  characters         are removed from the buffer. Th
is is intended to prevent the user from         getting too far ahead of a progr
am that is running sluggishly.             The start up delay and repeat speed a
pply to all keys on the  keyboard         that are set to repeat.             Re
lated entries             KM GET DELAY         KM SET REPEAT                   A
MSTRAD CPC464/664/6128 FIRMWARE                            page 15.23           
          22 KM GET DELAY              %P%%%%%%%%%                              
       #BB42             Get start up delay and repeat speed.             Action
             Ask the time before keys first repeat (start up delay)  and  the  t
ime         between repeats (repeat speed).             Entry conditions        
     No conditions.             Exit conditions             H contains the start
 up delay.         L contains the repeat speed.             AF corrupt.         
All other registers preserved.             Notes             Both delays are giv
en in  scans  of  the  keyboard.  The  keyboard  is         scanned every fiftie
th of a second.             A repeat speed or start up delay of 0 means 256.    
         Related entries             KM SET DELAY                               
        AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.24  
                   23 KM ARM BREAKS                                             
   #BB45             Allow break events to be generated.             Action     
        Arm the break mechanism. The next call of KM BREAK EVENT will generate  
       a break event.             Entry conditions             DE contains the a
ddress of the break event routine.         C contains the ROM select address for
 this routine.             Exit conditions             AF,BC,DE and HL corrupt. 
        All other registers preserved.             Notes             The break m
echanism can be disarmed by calling KM DISARM BREAK (or  KM         RESET).     
        This routine enables interrupts.             Related entries            
 KM BREAK EVENT         KM DISARM BREAK                                         
  AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.25        
             24 KM DISARM BREAK                                              #BB
48             Prevent break events from being generated.             Action    
         Disarm the break mechanism. From now on the generation of break events 
        by KM BREAK EVENT will be suppressed.             Entry conditions      
       No conditions.             Exit conditions             AF and HL corrupt.
         All other registers preserved.             Notes             Break even
ts can be rearmed by calling KM ARM BREAK.             The default state of the 
break mechanism is disarmed, thus calling  KM         RESET will also disarm bre
aks.             This routine enables interrupts.             Related entries   
          KM ARM BREAK         KM BREAK EVENT                                   
    AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.26      
               25 KM BREAK EVENT                                               #
BB4B             Generate a break event (if armed).             Action          
   Try to generate a break event.             Entry conditions             No co
nditions.             Exit conditions             AF and HL corrupt.         All
 other registers preserved.               Notes             If the break mechani
sm is disarmed then no action is taken.  Otherwise         a break event is gene
rated and a special marker is placed into the key         buffer. This marker ge
nerates a break event token (#EF) when read from         the buffer.  The  break
  mechanism  is  automatically  disarmed  after         generating a break event
 so that multiple breaks can be avoided.             This routine may run from t
he interrupt path and  thus  does  not  and         should not enable interrupts
. Note, however, that using a LOW JUMP  to         call the routine (as the firm
ware jumpblock is set to do) does  enable         interrupts and  so  the  jumpb
lock  may  not  be  used  directly  from         interrupt routines.            
 Related entries             KM ARM BREAK         KM DISARM BREAK               
                AMSTRAD CPC464/664/6128 FIRMWARE                            page
 15.27                     26 TXT INITIALISE                                    
           #BB4E           Initialise the Text VDU.           Action           F
ull initialization of the Text VDU (as used during EMS). All Text VDU         va
riables and indirections are initialized, the previous VDU state  is         los
t.           Entry conditions           No conditions           Exit conditions 
          AF,BC,DE and HL corrupt.         All other registers preserved.       
    Notes           The Text VDU indirections (TXT DRAW CURSOR,  TXT  UNDRAW  CU
RSOR,  TXT         WRITE CHAR, TXT UNWRITE and TXT OUT ACTION) are set to  their
  default         routines.           The control code table is set u  &P&&&&&&&
&&p to perform the default  control  code         actions.           The user de
fined character table is set to empty.           Stream 0 is selected.          
 All streams are set to their default states                      The text paper
 (background) is set to ink 0.                  The text pen (foreground) is set
 to ink 1.                  The text window is set to the entire screen.        
          The text cursor is enabled but turned off.                  The charac
ter write mode is set to opaque.                    The VDU is enabled.         
         The graphics character write mode is turn off.                  The cur
sor is moved to the top left corner of the window.             The default chara
cter set and the default setting for the control code         table are describe
d in Appendices VI and VII.             Related Entries             SCR INITIALI
SE         TXT RESET                 AMSTRAD CPC464/664/6128 FIRMWARE           
                 page 15.28                     27 TXT RESET                    
                                #BB51             Reset the Text VDU.           
  Action             Reinitialize the Text VDU indirections and the  control  co
de  tables.         Does not affect any other aspect of the Text VDU.           
  Entry conditions             No conditions.             Exit conditions       
      AF,BC,DE and HL corrupt.         All other registers preserved.           
  Notes           The Text VDU indirections TXT DRAW  CURSOR,  TXT  UNDRAW  CURS
OR,  TXT         WRITE CHAR, TXT UNWRITE and TXT OUT ACTION are set  to  their  
default         routines.             The control code table is set up to perfor
m the  default  control  code         actions (see Appendix VII).               
  Related Entries             TXT INITIALISE                                    
     AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.29     
                28 TXT VDU ENABLE                                               
#BB54             Allow characters to be placed on the screen.             Actio
n             Permit characters to be printed when requested (by calling TXT  OU
TPUT         or TXT WR CHAR). Enabling applies to the  currently  selected  stre
am.         The cursor blob is also enabled (by calling TXT CUR ENABLE).        
     Entry conditions             No conditions.             Exit conditions    
         AF corrupt.         All other registers preserved.             Notes   
          The control code buffer used by TXT OUTPUT is emptied, any  incomplete
         control code sequence will be lost.                 Related entries    
         TXT ASK STATE         TXT CUR ENABLE         TXT OUTPUT         TXT VDU
 DISABLE         TXT WR CHAR                                       AMSTRAD CPC46
4/664/6128 FIRMWARE                            page 15.30                     29
 TXT VDU DISABLE                                              #BB57             
Prevent character being placed on the screen.             Action             Pre
vents characters being printed on the screen (when  TXT  OUTPUT  or         TXT 
WR CHAR is called). Applies to the currently selected stream.  The         curso
r blob is also disabled (by calling TXT CUR DISABLE).             Entry conditio
ns             No conditions.             Exit conditions             AF corrupt
.         All other registers preserved.             Notes             The contr
ol code buffer used by TXT OUTPUT is emptied, any  incomplete         control co
de sequence will be lost.             In V1.1 firmware control codes are still o
beyed by TXT OUTPUT. In V1.1         firmware only those control codes which are
 marked in the control code         table will be obeyed other control codes wil
l be ignored (see section         4.7).               Related entries           
  TXT ASK STATE         TXT CUR ENABLE         TXT OUTPUT         TXT VDU DISABL
E         TXT WR CHAR                             AMSTRAD CPC464/664/6128 FIRMWA
RE                            page 15.31                     30 TXT OUTPUT      
                                             #BB5A           Output a character 
or control code to the Text VDU.           Action             Output characters 
to the screen and  obey  control  codes  (characters         #00..#1F). Works on
 the currently selected stream.             Entry conditions           A contain
s the character to send.           Exit conditions           All registers and f
lags preserved.           Notes           This routine calls the TXT OUT ACTION 
indirection to do  the    'P'''''''''work  of         printing the character or 
obeying the control code described below.           Control codes may take up to
 9 parameters. These  are  the  characters         sent following the initial  c
ontrol  code.  The  characters  sent  are         stored in the control code buf
fer until sufficient have been  received         to make up all the parameters. 
The control code buffer  is  only  long         enough to accept 9 parameter cha
racters.           There is only one control code buffer for all streams. It is 
therefore         possible to get unpredictable results if the output stream is 
 changed         midway through sending a control code sequence.           If th
e VDU is disabled then no  characters  will  be  printed  on  the         screen
. In V1.0 firmware all control codes will still be obeyed but in         V1.1 fi
rmware only those codes marked in the control code table as  to         be obeye
d when the VDU is disabled will be obeyed (see section 4.7).           If the gr
aphic character write mode is enabled then all characters and         control co
des are printed using the Graphics VDU routine, GRA WR  CHAR,         and are no
t obeyed.           Characters are written in  the  same  way  that  TXT  WR  CH
AR  writes         characters.             Related entries           GRA WR CHAR
         TXT OUT ACTION         TXT SET GRAPHIC         TXT VDU DISABLE         
TXT VDU ENABLE         TXT WR CHAR                 AMSTRAD CPC464/664/6128 FIRMW
ARE                           page 15.32                     31 TXT WR CHAR     
                                       #BB5D             Write a character to th
e screen.             Action             Print a character  on  the  screen  at 
 the  cursor  position  of  the         currently selected stream. Control  code
s  (characters  #00..#1F)  are         printer and not obeyed.             Entry
 conditions             A contains the character to print.             Exit cond
itions             AF,BC,DE and HL corrupt.         All other registers preserve
d.             Notes             If the VDU is disabled then no character will b
e printed.             Before printing the character the cursor position  is  fo
rced  to  lie         within  the  text  window  (see  TXT  VALIDATE).  After  p
rinting  the         character the cursor is moved right one character.         
    To put the character on the screen this routine calls  the  TXT  WRITE      
   CHAR indirection.               Related entries             GRA WR CHAR      
   TXT OUTPUT         TXT RD CHAR         TXT WRITE CHAR                        
   AMSTRAD CPC464/664/6128 FIRMWARE                            page 15.33  toact
er the cursor position  is  forced  to  lie         within  the  text  window  (
see  TXT  VALIDATE).  After  printing  the         character the cursor is moved
 right one character.             To put the character on the screen this routin
e calls  the  TXT  WRITE         CHAR indirection.               Related entries
             GRA WR CHAR         TXT OUTPUT         TXT RD C
Tous droits réservés. Reproduction sans autorisation interdite. © Kukulcan