home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / softcrc / libs / primer2.arj < prev    next >
ARJ Archive  |  1997-07-22  |  42.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: ARJ Archive (archive/arj).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert ARJ Archive (archive/arj) magic Supported
100% file ARJ archive data, v6, slash-switched, created 22 jul 1980+17, original name: PRIMER2.ARJ, os: MS-DOS default
99% file data default
66% TrID ARJ compressed archive (standard) default
33% TrID ARJ compressed archive default
100% dearkID deark: arj (ARJ) default
100% siegfried fmt/610 ARJ File Format default
100% lsar ARJ default
100% gt2 ARJ Archiv gefunden (Auflistung ist deaktiviert) default
100% detectItEasy Archive: ARJ(6) default
100% binwalkID ARJ archive data, header size: 132, version 6, minimum version to extract: 1, slash-switched, compression method: stored, file type: comment header, original name: "PRIMER2.ARJ", original file date: 1988-08-03 03:31:23, compressed file size: 586582283, uncompressed file size: 0, os: MS-DOS default
100% xdgMime application/x-arj default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 60 ea 84 00 1e 06 01 00 | 10 00 02 0b 0b 89 f6 22 |`.......|......."|
|00000010| 0b 89 f6 22 00 00 00 00 | 00 00 00 00 00 00 00 00 |..."....|........|
|00000020| 00 00 50 52 49 4d 45 52 | 32 2e 41 52 4a 00 0a 20 |..PRIMER|2.ARJ.. |
|00000030| 20 20 20 41 72 63 68 69 | 76 65 20 46 72 6f 6d 0a | Archi|ve From.|
|00000040| 20 48 20 41 20 43 20 4b | 20 45 20 52 27 73 20 20 | H A C K| E R's |
|00000050| 20 43 20 44 0a 20 20 20 | 20 20 43 72 65 61 74 65 | C D. | Create|
|00000060| 64 20 42 79 0a 20 20 57 | 68 69 74 65 20 45 61 67 |d By. W|hite Eag|
|00000070| 6c 65 20 5b 52 43 44 5d | 0a 20 20 20 20 20 20 20 |le [RCD]|. |
|00000080| 20 31 39 39 37 0a 0a 00 | 96 0e 7d 9c 00 00 60 ea | 1997...|..}...`.|
|00000090| 2a 00 1e 06 01 00 10 00 | 00 0b c1 2b 0f 0b da a7 |*.......|...+....|
|000000a0| 00 00 da a7 00 00 8a a0 | 1b b1 00 00 20 00 00 00 |........|.... ...|
|000000b0| 50 52 49 4d 45 52 2e 44 | 4f 43 00 00 e4 8c 01 f6 |PRIMER.D|OC......|
|000000c0| 00 00 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|000000d0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|000000e0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|000000f0| 20 20 41 6e 20 41 73 73 | 65 6d 62 6c 79 20 4c 61 | An Ass|embly La|
|00000100| 6e 67 75 61 67 65 20 50 | 72 69 6d 65 72 0d 0a 0d |nguage P|rimer...|
|00000110| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000120| 20 20 28 43 29 20 31 39 | 38 33 20 62 79 20 44 61 | (C) 19|83 by Da|
|00000130| 76 69 64 20 57 68 69 74 | 6d 61 6e 0d 0a 0d 0a 0d |vid Whit|man.....|
|00000140| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00000150| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00000160| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00000170| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00000180| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00000190| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|000001a0| 0a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |..... | |
|000001b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000001c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000001d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000001e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 31 0d 0a 0d | | 1...|
|000001f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 54 |. | T|
|00000200| 41 42 4c 45 20 4f 46 20 | 43 4f 4e 54 45 4e 54 53 |ABLE OF |CONTENTS|
|00000210| 0d 0a 0d 0a 0d 0a 49 6e | 74 72 6f 64 75 63 74 69 |......In|troducti|
|00000220| 6f 6e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |on......|........|
|00000230| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000240| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 32 0d 0a 0d 0a 54 68 |........|.2....Th|
|00000250| 65 20 43 6f 6d 70 75 74 | 65 72 20 41 73 20 41 20 |e Comput|er As A |
|00000260| 42 69 74 20 50 61 74 74 | 65 72 6e 20 4d 61 6e 69 |Bit Patt|ern Mani|
|00000270| 70 75 6c 61 74 6f 72 2e | 2e 2e 2e 2e 2e 2e 2e 2e |pulator.|........|
|00000280| 2e 32 0d 0a 0d 0a 44 69 | 67 72 65 73 73 69 6f 6e |.2....Di|gression|
|00000290| 3a 20 41 20 4e 6f 74 61 | 74 69 6f 6e 20 53 79 73 |: A Nota|tion Sys|
|000002a0| 74 65 6d 20 66 6f 72 20 | 42 69 74 20 50 61 74 74 |tem for |Bit Patt|
|000002b0| 65 72 6e 73 2e 2e 2e 2e | 2e 34 0d 0a 0d 0a 41 64 |erns....|.4....Ad|
|000002c0| 64 72 65 73 73 69 6e 67 | 20 4d 65 6d 6f 72 79 2e |dressing| Memory.|
|000002d0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000002e0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000002f0| 2e 36 0d 0a 0d 0a 54 68 | 65 20 43 6f 6e 74 65 6e |.6....Th|e Conten|
|00000300| 74 73 20 6f 66 20 4d 65 | 6d 6f 72 79 3a 20 44 61 |ts of Me|mory: Da|
|00000310| 74 61 20 61 6e 64 20 50 | 72 6f 67 72 61 6d 73 2e |ta and P|rograms.|
|00000320| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 37 0d 0a 0d 0a 54 68 |........|.7....Th|
|00000330| 65 20 44 61 77 6e 20 6f | 66 20 41 73 73 65 6d 62 |e Dawn o|f Assemb|
|00000340| 6c 79 20 4c 61 6e 67 75 | 61 67 65 2e 2e 2e 2e 2e |ly Langu|age.....|
|00000350| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000360| 2e 38 0d 0a 0d 0a 54 68 | 65 20 38 30 38 38 2e 2e |.8....Th|e 8088..|
|00000370| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000380| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000390| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 39 0d 0a 0d 0a 41 73 |........|.9....As|
|000003a0| 73 65 6d 62 6c 79 20 4c | 61 6e 67 75 61 67 65 20 |sembly L|anguage |
|000003b0| 53 79 6e 74 61 78 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |Syntax..|........|
|000003c0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000003d0| 31 32 0d 0a 0d 0a 54 68 | 65 20 53 74 61 63 6b 2e |12....Th|e Stack.|
|000003e0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000003f0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000400| 2e 2e 2e 2e 2e 2e 2e 2e | 31 34 0d 0a 0d 0a 53 6f |........|14....So|
|00000410| 66 74 77 61 72 65 20 49 | 6e 74 65 72 72 75 70 74 |ftware I|nterrupt|
|00000420| 73 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |s.......|........|
|00000430| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000440| 31 35 0d 0a 0d 0a 50 73 | 65 75 64 6f 2d 4f 70 65 |15....Ps|eudo-Ope|
|00000450| 72 61 74 69 6f 6e 73 2e | 2e 2e 2e 2e 2e 2e 2e 2e |rations.|........|
|00000460| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|00000470| 2e 2e 2e 2e 2e 2e 2e 2e | 31 37 0d 0a 0d 0a 54 75 |........|17....Tu|
|00000480| 74 6f 72 69 61 6c 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |torial..|........|
|00000490| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000004a0| 2e 2e 2e 2e 2e 2e 2e 2e | 2e 2e 2e 2e 2e 2e 2e 2e |........|........|
|000004b0| 31 38 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |18......|........|
|000004c0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|000004d0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|000004e0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|000004f0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00000500| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000510| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000520| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000530| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000540| 20 20 20 20 20 20 20 32 | 0d 0a 0d 0a 49 4e 54 52 | 2|....INTR|
|00000550| 4f 44 55 43 54 49 4f 4e | 0d 0a 0d 0a 4d 61 6e 79 |ODUCTION|....Many|
|00000560| 20 70 65 6f 70 6c 65 20 | 72 65 71 75 65 73 74 69 | people |requesti|
|00000570| 6e 67 20 43 48 41 53 4d | 20 68 61 76 65 20 69 6e |ng CHASM| have in|
|00000580| 64 69 63 61 74 65 64 20 | 74 68 61 74 20 74 68 65 |dicated |that the|
|00000590| 79 20 61 72 65 0d 0a 69 | 6e 74 65 72 65 73 74 65 |y are..i|ntereste|
|000005a0| 64 20 69 6e 20 2a 6c 65 | 61 72 6e 69 6e 67 2a 20 |d in *le|arning* |
|000005b0| 61 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |assembly| languag|
|000005c0| 65 2e 20 20 54 68 65 79 | 20 61 72 65 20 62 65 67 |e. They| are beg|
|000005d0| 69 6e 6e 65 72 73 2c 0d | 0a 61 6e 64 20 68 61 76 |inners,.|.and hav|
|000005e0| 65 20 6c 69 74 74 6c 65 | 20 69 64 65 61 20 6a 75 |e little| idea ju|
|000005f0| 73 74 20 77 68 65 72 65 | 20 74 6f 20 73 74 61 72 |st where| to star|
|00000600| 74 2e 20 20 54 68 69 73 | 20 70 72 69 6d 65 72 20 |t. This| primer |
|00000610| 69 73 0d 0a 64 69 72 65 | 63 74 65 64 20 74 6f 20 |is..dire|cted to |
|00000620| 74 68 6f 73 65 20 75 73 | 65 72 73 2e 20 20 45 78 |those us|ers. Ex|
|00000630| 70 65 72 69 61 6e 63 65 | 64 20 75 73 65 72 73 20 |periance|d users |
|00000640| 77 69 6c 6c 20 70 72 6f | 62 61 62 6c 79 20 66 69 |will pro|bably fi|
|00000650| 6e 64 0d 0a 6c 69 74 74 | 6c 65 20 68 65 72 65 20 |nd..litt|le here |
|00000660| 74 68 61 74 20 74 68 65 | 79 20 64 6f 20 6e 6f 74 |that the|y do not|
|00000670| 20 61 6c 72 65 61 64 79 | 20 6b 6e 6f 77 2e 0d 0a | already| know...|
|00000680| 0d 0a 42 65 69 6e 67 20 | 61 20 70 72 69 6d 65 72 |..Being |a primer|
|00000690| 2c 20 74 68 69 73 20 74 | 65 78 74 20 77 69 6c 6c |, this t|ext will|
|000006a0| 20 6e 6f 74 20 74 65 61 | 63 68 20 79 6f 75 20 65 | not tea|ch you e|
|000006b0| 76 65 72 79 74 68 69 6e | 67 20 74 68 65 72 65 20 |verythin|g there |
|000006c0| 69 73 0d 0a 74 6f 20 6b | 6e 6f 77 20 61 62 6f 75 |is..to k|now abou|
|000006d0| 74 20 61 73 73 65 6d 62 | 6c 79 20 6c 61 6e 67 75 |t assemb|ly langu|
|000006e0| 61 67 65 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 2e |age prog|ramming.|
|000006f0| 20 20 49 74 27 73 20 70 | 75 72 70 6f 73 65 20 69 | It's p|urpose i|
|00000700| 73 20 74 6f 0d 0a 67 69 | 76 65 20 79 6f 75 20 73 |s to..gi|ve you s|
|00000710| 6f 6d 65 20 6f 66 20 74 | 68 65 20 76 6f 63 61 62 |ome of t|he vocab|
|00000720| 75 6c 61 72 79 20 61 6e | 64 20 67 65 6e 65 72 61 |ulary an|d genera|
|00000730| 6c 20 69 64 65 61 73 20 | 77 68 69 63 68 20 77 69 |l ideas |which wi|
|00000740| 6c 6c 20 68 65 6c 70 0d | 0a 79 6f 75 20 6f 6e 20 |ll help.|.you on |
|00000750| 79 6f 75 72 20 77 61 79 | 2e 0d 0a 0d 0a 49 20 6d |your way|.....I m|
|00000760| 75 73 74 20 6d 61 6b 65 | 20 61 20 73 6d 61 6c 6c |ust make| a small|
|00000770| 20 63 61 76 65 61 74 3a | 20 49 20 63 6f 6e 73 69 | caveat:| I consi|
|00000780| 64 65 72 20 6d 79 73 65 | 6c 66 20 61 20 72 65 6c |der myse|lf a rel|
|00000790| 61 74 69 76 65 20 62 65 | 67 69 6e 6e 65 72 0d 0a |ative be|ginner..|
|000007a0| 69 6e 20 61 73 73 65 6d | 62 6c 79 20 6c 61 6e 67 |in assem|bly lang|
|000007b0| 75 61 67 65 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |uage pro|gramming|
|000007c0| 2e 20 20 41 20 62 69 67 | 20 70 61 72 74 20 6f 66 |. A big| part of|
|000007d0| 20 74 68 65 20 72 65 61 | 73 6f 6e 20 66 6f 72 0d | the rea|son for.|
|000007e0| 0a 77 72 69 74 69 6e 67 | 20 43 48 41 53 4d 20 77 |.writing| CHASM w|
|000007f0| 61 73 20 74 6f 20 74 72 | 79 20 61 6e 64 20 6c 65 |as to tr|y and le|
|00000800| 61 72 6e 20 74 68 69 73 | 20 62 72 61 6e 63 68 20 |arn this| branch |
|00000810| 6f 66 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 0d 0a |of progr|amming..|
|00000820| 66 72 6f 6d 20 74 68 65 | 20 69 6e 73 69 64 65 20 |from the| inside |
|00000830| 6f 75 74 2e 20 20 49 20 | 74 68 69 6e 6b 20 49 27 |out. I |think I'|
|00000840| 76 65 20 6c 65 61 72 6e | 65 64 20 71 75 69 74 65 |ve learn|ed quite|
|00000850| 20 61 20 62 69 74 2c 20 | 62 75 74 20 69 74 27 73 | a bit, |but it's|
|00000860| 0d 0a 71 75 69 74 65 20 | 70 6f 73 73 69 62 6c 65 |..quite |possible|
|00000870| 20 74 68 61 74 20 73 6f | 6d 65 20 6f 66 20 74 68 | that so|me of th|
|00000880| 65 20 69 64 65 61 73 20 | 49 20 72 65 6c 61 74 65 |e ideas |I relate|
|00000890| 20 68 65 72 65 20 6d 61 | 79 20 68 61 76 65 20 73 | here ma|y have s|
|000008a0| 6f 6d 65 0d 0a 73 6d 61 | 6c 6c 2c 20 6f 72 20 65 |ome..sma|ll, or e|
|000008b0| 76 65 6e 20 6c 61 72 67 | 65 2c 20 66 6c 61 77 73 |ven larg|e, flaws|
|000008c0| 20 69 6e 20 74 68 65 6d | 2e 20 20 4e 6f 6e 65 74 | in them|. Nonet|
|000008d0| 68 65 6c 65 73 73 2c 20 | 49 20 68 61 76 65 0d 0a |heless, |I have..|
|000008e0| 70 72 6f 64 75 63 65 64 | 20 61 20 6e 75 6d 62 65 |produced| a numbe|
|000008f0| 72 20 6f 66 20 77 6f 72 | 6b 69 6e 67 20 61 73 73 |r of wor|king ass|
|00000900| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 70 |embly la|nguage p|
|00000910| 72 6f 67 72 61 6d 73 20 | 62 79 0d 0a 66 6f 6c 6c |rograms |by..foll|
|00000920| 6f 77 69 6e 67 20 74 68 | 65 20 69 64 65 61 73 20 |owing th|e ideas |
|00000930| 70 72 65 73 65 6e 74 65 | 64 20 68 65 72 65 2e 0d |presente|d here..|
|00000940| 0a 0d 0a 54 48 45 20 43 | 4f 4d 50 55 54 45 52 20 |...THE C|OMPUTER |
|00000950| 41 53 20 41 20 42 49 54 | 20 50 41 54 54 45 52 4e |AS A BIT| PATTERN|
|00000960| 20 4d 41 4e 49 50 55 4c | 41 54 4f 52 2e 0d 0a 0d | MANIPUL|ATOR....|
|00000970| 0a 57 65 20 61 6c 6c 20 | 68 61 76 65 20 73 6f 6d |.We all |have som|
|00000980| 65 20 63 6f 6e 63 65 70 | 74 69 6f 6e 20 61 62 6f |e concep|tion abo|
|00000990| 75 74 20 77 68 61 74 20 | 61 20 63 6f 6d 70 75 74 |ut what |a comput|
|000009a0| 65 72 20 64 6f 65 73 2e | 20 20 4f 6e 20 6f 6e 65 |er does.| On one|
|000009b0| 0d 0a 6c 65 76 65 6c 2c | 20 69 74 20 6d 61 79 20 |..level,| it may |
|000009c0| 62 65 20 74 68 6f 75 67 | 68 74 20 6f 66 20 61 73 |be thoug|ht of as|
|000009d0| 20 61 20 6d 61 63 68 69 | 6e 65 20 77 68 69 63 68 | a machi|ne which|
|000009e0| 20 63 61 6e 20 65 78 65 | 63 75 74 65 20 42 41 53 | can exe|cute BAS|
|000009f0| 49 43 0d 0a 70 72 6f 67 | 72 61 6d 73 2e 20 20 41 |IC..prog|rams. A|
|00000a00| 6e 6f 74 68 65 72 20 69 | 64 65 61 20 69 73 20 74 |nother i|dea is t|
|00000a10| 68 61 74 20 74 68 65 20 | 63 6f 6d 70 75 74 65 72 |hat the |computer|
|00000a20| 20 69 73 20 61 20 6e 75 | 6d 62 65 72 0d 0a 63 72 | is a nu|mber..cr|
|00000a30| 75 6e 63 68 69 6e 67 20 | 64 65 76 69 63 65 2e 20 |unching |device. |
|00000a40| 20 41 73 20 49 20 77 72 | 69 74 65 20 74 68 69 73 | As I wr|ite this|
|00000a50| 20 70 72 69 6d 65 72 2c | 20 49 27 6d 20 75 73 69 | primer,| I'm usi|
|00000a60| 6e 67 20 6d 79 20 63 6f | 6d 70 75 74 65 72 0d 0a |ng my co|mputer..|
|00000a70| 61 73 20 61 20 77 6f 72 | 64 20 70 72 6f 63 65 73 |as a wor|d proces|
|00000a80| 73 6f 72 2e 0d 0a 0d 0a | 49 27 64 20 6c 69 6b 65 |sor.....|I'd like|
|00000a90| 20 74 6f 20 69 6e 74 72 | 6f 64 75 63 65 20 61 20 | to intr|oduce a |
|00000aa0| 6d 6f 72 65 20 67 65 6e | 65 72 61 6c 20 63 6f 6e |more gen|eral con|
|00000ab0| 63 65 70 74 20 6f 66 20 | 6a 75 73 74 20 77 68 61 |cept of |just wha|
|00000ac0| 74 20 73 6f 72 74 20 6f | 66 0d 0a 6d 61 63 68 69 |t sort o|f..machi|
|00000ad0| 6e 65 20 61 20 63 6f 6d | 70 75 74 65 72 20 69 73 |ne a com|puter is|
|00000ae0| 3a 20 61 20 62 69 74 20 | 70 61 74 74 65 72 6e 20 |: a bit |pattern |
|00000af0| 6d 61 6e 69 70 75 6c 61 | 74 6f 72 2e 0d 0a 0d 0a |manipula|tor.....|
|00000b00| 49 27 6d 20 63 65 72 74 | 61 69 6e 20 74 68 61 74 |I'm cert|ain that|
|00000b10| 20 65 76 65 72 79 6f 6e | 65 20 68 61 73 20 62 65 | everyon|e has be|
|00000b20| 65 6e 20 69 6e 74 72 6f | 64 75 63 65 64 20 74 6f |en intro|duced to|
|00000b30| 20 74 68 65 20 69 64 65 | 61 20 6f 66 20 61 0d 0a | the ide|a of a..|
|00000b40| 2a 62 69 74 2a 2e 20 20 | 28 4e 6f 74 65 3a 20 54 |*bit*. |(Note: T|
|00000b50| 68 72 6f 75 67 68 6f 75 | 74 20 74 68 69 73 20 70 |hroughou|t this p|
|00000b60| 72 69 6d 65 72 2c 20 61 | 20 77 6f 72 64 20 65 6e |rimer, a| word en|
|00000b70| 63 6c 6f 73 65 64 20 69 | 6e 0d 0a 2a 61 73 74 65 |closed i|n..*aste|
|00000b80| 72 69 73 6b 73 2a 20 69 | 73 20 74 6f 20 62 65 20 |risks* i|s to be |
|00000b90| 72 65 61 64 20 61 73 20 | 69 66 20 69 74 20 77 65 |read as |if it we|
|00000ba0| 72 65 20 69 6e 20 69 74 | 61 6c 69 63 73 2e 29 20 |re in it|alics.) |
|00000bb0| 20 41 20 62 69 74 20 68 | 61 73 0d 0a 74 77 6f 20 | A bit h|as..two |
|00000bc0| 73 74 61 74 65 73 3a 20 | 6f 6e 20 61 6e 64 20 6f |states: |on and o|
|00000bd0| 66 66 2c 20 74 79 70 69 | 63 61 6c 6c 79 20 72 65 |ff, typi|cally re|
|00000be0| 70 72 65 73 65 6e 74 65 | 64 20 77 69 74 68 20 74 |presente|d with t|
|00000bf0| 68 65 20 73 79 6d 62 6f | 6c 73 0d 0a 22 31 22 20 |he symbo|ls.."1" |
|00000c00| 20 61 6e 64 20 22 30 22 | 2e 20 20 49 6e 20 74 68 | and "0"|. In th|
|00000c10| 69 73 20 63 6f 6e 74 65 | 78 74 2c 20 44 4f 4e 27 |is conte|xt, DON'|
|00000c20| 54 20 74 68 69 6e 6b 20 | 6f 66 20 31 20 61 6e 64 |T think |of 1 and|
|00000c30| 20 30 20 61 73 0d 0a 6e | 75 6d 62 65 72 73 2e 20 | 0 as..n|umbers. |
|00000c40| 20 54 68 65 79 20 61 72 | 65 20 6d 65 72 65 6c 79 | They ar|e merely|
|00000c50| 20 63 6f 6e 76 65 6e 69 | 65 6e 74 20 73 68 6f 72 | conveni|ent shor|
|00000c60| 74 68 61 6e 64 20 6c 61 | 62 65 6c 73 20 66 6f 72 |thand la|bels for|
|00000c70| 20 74 68 65 0d 0a 73 74 | 61 74 65 20 6f 66 20 61 | the..st|ate of a|
|00000c80| 20 62 69 74 2e 0d 0a 0d | 0a 54 68 65 20 6d 65 6d | bit....|.The mem|
|00000c90| 6f 72 79 20 6f 66 20 79 | 6f 75 72 20 63 6f 6d 70 |ory of y|our comp|
|00000ca0| 75 74 65 72 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |uter con|sists of|
|00000cb0| 20 61 20 68 75 67 65 20 | 63 6f 6c 6c 65 63 74 69 | a huge |collecti|
|00000cc0| 6f 6e 20 6f 66 0d 0a 62 | 69 74 73 2c 20 65 61 63 |on of..b|its, eac|
|00000cd0| 68 20 6f 66 20 77 68 69 | 63 68 20 63 6f 75 6c 64 |h of whi|ch could|
|00000ce0| 20 62 65 20 69 6e 20 65 | 69 74 68 65 72 20 74 68 | be in e|ither th|
|00000cf0| 65 20 31 20 6f 72 20 30 | 20 28 6f 6e 20 6f 72 20 |e 1 or 0| (on or |
|00000d00| 6f 66 66 29 0d 0a 73 74 | 61 74 65 2e 0d 0a 0d 0a |off)..st|ate.....|
|00000d10| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00000d20| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00000d30| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |...... | |
|00000d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 33 0d 0a | | 3..|
|00000d80| 0d 0a 0d 0a 41 74 20 74 | 68 65 20 68 65 61 72 74 |....At t|he heart|
|00000d90| 20 6f 66 20 79 6f 75 72 | 20 63 6f 6d 70 75 74 65 | of your| compute|
|00000da0| 72 20 69 73 20 61 20 6d | 69 63 72 6f 70 72 6f 63 |r is a m|icroproc|
|00000db0| 65 73 73 6f 72 20 63 68 | 69 70 2c 20 6e 61 6d 65 |essor ch|ip, name|
|00000dc0| 64 20 74 68 65 0d 0a 38 | 30 38 38 20 62 79 20 49 |d the..8|088 by I|
|00000dd0| 6e 74 65 6c 2c 20 77 68 | 6f 20 6d 61 6b 65 73 20 |ntel, wh|o makes |
|00000de0| 74 68 65 20 63 68 69 70 | 2e 20 20 57 68 61 74 20 |the chip|. What |
|00000df0| 74 68 69 73 20 63 68 69 | 70 20 63 61 6e 20 64 6f |this chi|p can do|
|00000e00| 20 69 73 0d 0a 6d 61 6e | 69 70 75 6c 61 74 65 20 | is..man|ipulate |
|00000e10| 74 68 65 20 62 69 74 73 | 20 77 68 69 63 68 20 6d |the bits| which m|
|00000e20| 61 6b 65 20 75 70 20 74 | 68 65 20 6d 65 6d 6f 72 |ake up t|he memor|
|00000e30| 79 2e 20 20 54 68 65 20 | 38 30 38 38 20 6c 69 6b |y. The |8088 lik|
|00000e40| 65 73 20 74 6f 0d 0a 68 | 61 6e 64 6c 65 20 62 69 |es to..h|andle bi|
|00000e50| 74 73 20 69 6e 20 63 68 | 75 6e 6b 73 2c 20 61 6e |ts in ch|unks, an|
|00000e60| 64 20 73 6f 20 77 65 27 | 6c 6c 20 69 6e 74 72 6f |d so we'|ll intro|
|00000e70| 64 75 63 65 20 73 70 65 | 63 69 61 6c 20 6e 61 6d |duce spe|cial nam|
|00000e80| 65 73 20 66 6f 72 0d 0a | 74 68 65 20 74 77 6f 20 |es for..|the two |
|00000e90| 73 69 7a 65 73 20 6f 66 | 20 62 69 74 20 63 68 75 |sizes of| bit chu|
|00000ea0| 6e 6b 73 20 74 68 65 20 | 38 30 38 38 20 69 73 20 |nks the |8088 is |
|00000eb0| 6d 6f 73 74 20 68 61 70 | 70 79 20 77 69 74 68 2e |most hap|py with.|
|00000ec0| 20 20 41 0d 0a 2a 62 79 | 74 65 2a 20 77 69 6c 6c | A..*by|te* will|
|00000ed0| 20 72 65 66 65 72 20 74 | 6f 20 61 20 63 6f 6c 6c | refer t|o a coll|
|00000ee0| 65 63 74 69 6f 6e 20 6f | 66 20 65 69 67 68 74 20 |ection o|f eight |
|00000ef0| 62 69 74 73 2e 20 20 41 | 20 2a 77 6f 72 64 2a 0d |bits. A| *word*.|
|00000f00| 0a 63 6f 6e 73 69 73 74 | 73 20 6f 66 20 74 77 6f |.consist|s of two|
|00000f10| 20 62 79 74 65 73 2c 20 | 6f 72 20 65 71 75 69 76 | bytes, |or equiv|
|00000f20| 61 6c 65 6e 74 6c 79 2c | 20 73 69 78 74 65 65 6e |alently,| sixteen|
|00000f30| 20 62 69 74 73 2e 0d 0a | 0d 0a 41 20 63 6f 6c 6c | bits...|..A coll|
|00000f40| 65 63 74 69 6f 6e 20 6f | 66 20 62 69 74 73 20 68 |ection o|f bits h|
|00000f50| 6f 6c 64 73 20 61 20 70 | 61 74 74 65 72 6e 2c 20 |olds a p|attern, |
|00000f60| 64 65 74 65 72 6d 69 6e | 65 64 20 62 79 20 74 68 |determin|ed by th|
|00000f70| 65 20 73 74 61 74 65 20 | 6f 66 0d 0a 69 74 27 73 |e state |of..it's|
|00000f80| 20 69 6e 64 69 76 69 64 | 75 61 6c 20 62 69 74 73 | individ|ual bits|
|00000f90| 2e 20 20 48 65 72 65 20 | 61 72 65 20 73 6f 6d 65 |. Here |are some|
|00000fa0| 20 74 79 70 69 63 61 6c | 20 62 79 74 65 20 6c 6f | typical| byte lo|
|00000fb0| 6e 67 20 70 61 74 74 65 | 72 6e 73 3a 0d 0a 0d 0a |ng patte|rns:....|
|00000fc0| 31 30 31 30 31 30 31 30 | 20 20 20 20 20 20 20 20 |10101010| |
|00000fd0| 20 31 31 31 31 31 31 31 | 31 20 20 20 20 20 20 20 | 1111111|1 |
|00000fe0| 20 20 30 30 30 30 31 31 | 31 31 0d 0a 0d 0a 49 66 | 000011|11....If|
|00000ff0| 20 79 6f 75 27 76 65 20 | 68 61 64 20 61 20 63 6f | you've |had a co|
|00001000| 75 72 73 65 20 69 6e 20 | 70 72 6f 62 61 62 69 6c |urse in |probabil|
|00001010| 69 74 79 2c 20 69 74 27 | 73 20 71 75 69 74 65 20 |ity, it'|s quite |
|00001020| 65 61 73 79 20 74 6f 20 | 77 6f 72 6b 0d 0a 6f 75 |easy to |work..ou|
|00001030| 74 20 74 68 61 74 20 74 | 68 65 72 65 20 61 72 65 |t that t|here are|
|00001040| 20 32 35 36 20 70 6f 73 | 73 69 62 6c 65 20 70 61 | 256 pos|sible pa|
|00001050| 74 74 65 72 6e 73 20 74 | 68 61 74 20 61 20 62 79 |tterns t|hat a by|
|00001060| 74 65 20 63 6f 75 6c 64 | 20 68 6f 6c 64 2e 0d 0a |te could| hold...|
|00001070| 53 69 6d 69 6c 61 72 6c | 79 2c 20 61 20 77 6f 72 |Similarl|y, a wor|
|00001080| 64 20 63 61 6e 20 68 6f | 6c 64 20 36 35 2c 35 33 |d can ho|ld 65,53|
|00001090| 36 20 64 69 66 66 65 72 | 65 6e 74 20 70 61 74 74 |6 differ|ent patt|
|000010a0| 65 72 6e 73 2e 0d 0a 0d | 0a 41 6c 6c 20 72 69 67 |erns....|.All rig|
|000010b0| 68 74 2c 20 6e 6f 77 20 | 66 6f 72 20 74 68 65 20 |ht, now |for the |
|000010c0| 73 69 6e 67 6c 65 20 6d | 6f 73 74 20 69 6d 70 6f |single m|ost impo|
|000010d0| 72 74 61 6e 74 20 69 64 | 65 61 20 69 6e 20 61 73 |rtant id|ea in as|
|000010e0| 73 65 6d 62 6c 79 0d 0a | 6c 61 6e 67 75 61 67 65 |sembly..|language|
|000010f0| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 2e 20 20 41 | program|ming. A|
|00001100| 72 65 20 79 6f 75 20 73 | 69 74 74 69 6e 67 20 64 |re you s|itting d|
|00001110| 6f 77 6e 3f 20 20 54 68 | 65 73 65 20 62 69 74 20 |own? Th|ese bit |
|00001120| 70 61 74 74 65 72 6e 73 | 0d 0a 63 61 6e 20 62 65 |patterns|..can be|
|00001130| 20 75 73 65 64 20 74 6f | 20 72 65 70 72 65 73 65 | used to| represe|
|00001140| 6e 74 20 6f 74 68 65 72 | 20 73 65 74 73 20 6f 66 |nt other| sets of|
|00001150| 20 74 68 69 6e 67 73 2c | 20 62 79 20 6d 61 70 70 | things,| by mapp|
|00001160| 69 6e 67 20 65 61 63 68 | 0d 0a 70 61 74 74 65 72 |ing each|..patter|
|00001170| 6e 20 6f 6e 74 6f 20 61 | 20 6d 65 6d 62 65 72 20 |n onto a| member |
|00001180| 6f 66 20 74 68 65 20 6f | 74 68 65 72 20 73 65 74 |of the o|ther set|
|00001190| 2e 20 20 44 6f 65 73 6e | 27 74 20 73 6f 75 6e 64 |. Doesn|'t sound|
|000011a0| 20 6c 69 6b 65 20 6d 75 | 63 68 2c 0d 0a 62 75 74 | like mu|ch,..but|
|000011b0| 20 49 42 4d 20 68 61 73 | 20 6d 61 64 65 20 2a 42 | IBM has| made *B|
|000011c0| 49 4c 4c 49 4f 4e 53 2a | 20 6f 66 66 20 74 68 69 |ILLIONS*| off thi|
|000011d0| 73 20 69 64 65 61 2e 0d | 0a 0d 0a 46 6f 72 20 65 |s idea..|...For e|
|000011e0| 78 61 6d 70 6c 65 2c 20 | 62 79 20 6d 61 70 70 69 |xample, |by mappi|
|000011f0| 6e 67 20 74 68 65 20 70 | 61 74 74 65 72 6e 73 20 |ng the p|atterns |
|00001200| 61 20 77 6f 72 64 20 63 | 61 6e 20 68 6f 6c 64 20 |a word c|an hold |
|00001210| 6f 6e 74 6f 20 74 68 65 | 20 73 65 74 0d 0a 6f 66 |onto the| set..of|
|00001220| 20 69 6e 74 65 67 65 72 | 73 2c 20 79 6f 75 20 63 | integer|s, you c|
|00001230| 61 6e 20 72 65 70 72 65 | 73 65 6e 74 20 65 69 74 |an repre|sent eit|
|00001240| 68 65 72 20 74 68 65 20 | 6e 75 6d 62 65 72 73 20 |her the |numbers |
|00001250| 66 72 6f 6d 20 30 20 74 | 6f 20 36 35 35 33 35 0d |from 0 t|o 65535.|
|00001260| 0a 6f 72 20 2d 33 32 37 | 36 38 20 74 6f 20 33 32 |.or -327|68 to 32|
|00001270| 37 36 37 2c 20 64 65 70 | 65 6e 64 69 6e 67 20 6f |767, dep|ending o|
|00001280| 6e 20 74 68 65 20 65 78 | 61 63 74 20 6d 61 70 70 |n the ex|act mapp|
|00001290| 69 6e 67 20 79 6f 75 20 | 75 73 65 2e 20 20 59 6f |ing you |use. Yo|
|000012a0| 75 0d 0a 6d 69 67 68 74 | 20 72 65 63 6f 67 6e 69 |u..might| recogni|
|000012b0| 7a 65 20 74 68 65 73 65 | 20 6e 75 6d 62 65 72 20 |ze these| number |
|000012c0| 72 61 6e 67 65 73 20 61 | 73 20 74 68 65 20 72 61 |ranges a|s the ra|
|000012d0| 6e 67 65 20 6f 66 20 70 | 6f 73 73 69 62 6c 65 20 |nge of p|ossible |
|000012e0| 6c 69 6e 65 0d 0a 6e 75 | 6d 62 65 72 73 2c 20 61 |line..nu|mbers, a|
|000012f0| 6e 64 20 74 68 65 20 70 | 6f 73 73 69 62 6c 65 20 |nd the p|ossible |
|00001300| 76 61 6c 75 65 73 20 6f | 66 20 61 6e 20 69 6e 74 |values o|f an int|
|00001310| 65 67 65 72 20 76 61 72 | 69 61 62 6c 65 2c 20 69 |eger var|iable, i|
|00001320| 6e 20 42 41 53 49 43 0d | 0a 70 72 6f 67 72 61 6d |n BASIC.|.program|
|00001330| 73 2e 20 20 54 68 69 73 | 20 65 78 70 6c 61 69 6e |s. This| explain|
|00001340| 73 20 74 68 65 73 65 20 | 73 6f 6d 65 77 68 61 74 |s these |somewhat|
|00001350| 20 61 72 62 69 74 72 61 | 72 79 20 73 65 65 6d 69 | arbitra|ry seemi|
|00001360| 6e 67 20 6c 69 6d 69 74 | 73 3a 0d 0a 42 41 53 49 |ng limit|s:..BASI|
|00001370| 43 20 75 73 65 73 20 77 | 6f 72 64 73 20 6f 66 20 |C uses w|ords of |
|00001380| 6d 65 6d 6f 72 79 20 74 | 6f 20 68 6f 6c 64 20 6c |memory t|o hold l|
|00001390| 69 6e 65 20 6e 75 6d 62 | 65 72 73 20 61 6e 64 20 |ine numb|ers and |
|000013a0| 69 6e 74 65 67 65 72 0d | 0a 76 61 72 69 61 62 6c |integer.|.variabl|
|000013b0| 65 73 2e 0d 0a 0d 0a 41 | 73 20 61 6e 6f 74 68 65 |es.....A|s anothe|
|000013c0| 72 20 65 78 61 6d 70 6c | 65 2c 20 79 6f 75 20 63 |r exampl|e, you c|
|000013d0| 6f 75 6c 64 20 6d 61 70 | 20 74 68 65 20 70 61 74 |ould map| the pat|
|000013e0| 74 65 72 6e 73 20 61 20 | 62 79 74 65 20 63 61 6e |terns a |byte can|
|000013f0| 20 68 6f 6c 64 0d 0a 6f | 6e 74 6f 20 61 20 73 65 | hold..o|nto a se|
|00001400| 72 69 65 73 20 6f 66 20 | 61 72 62 69 74 72 61 72 |ries of |arbitrar|
|00001410| 69 6c 79 20 63 68 6f 73 | 65 6e 20 6c 69 74 74 6c |ily chos|en littl|
|00001420| 65 20 70 69 63 74 75 72 | 65 73 20 77 68 69 63 68 |e pictur|es which|
|00001430| 20 6d 69 67 68 74 0d 0a | 62 65 20 64 69 73 70 6c | might..|be displ|
|00001440| 61 79 65 64 20 6f 6e 20 | 61 20 76 69 64 65 6f 20 |ayed on |a video |
|00001450| 73 63 72 65 65 6e 2e 20 | 20 49 66 20 79 6f 75 20 |screen. | If you |
|00001460| 6c 6f 6f 6b 20 69 6e 20 | 61 70 70 65 6e 64 69 78 |look in |appendix|
|00001470| 20 47 20 6f 66 0d 0a 79 | 6f 75 72 20 42 41 53 49 | G of..y|our BASI|
|00001480| 43 20 6d 61 6e 75 61 6c | 2c 20 79 6f 75 27 6c 6c |C manual|, you'll|
|00001490| 20 6e 6f 74 69 63 65 20 | 74 68 61 74 20 74 68 65 | notice |that the|
|000014a0| 72 65 20 61 72 65 20 2a | 65 78 61 63 74 6c 79 2a |re are *|exactly*|
|000014b0| 20 32 35 36 0d 0a 64 69 | 66 66 65 72 61 6e 74 20 | 256..di|fferant |
|000014c0| 63 68 61 72 61 63 74 65 | 72 73 20 74 68 61 74 20 |characte|rs that |
|000014d0| 63 61 6e 20 62 65 20 64 | 69 73 70 6c 61 79 65 64 |can be d|isplayed|
|000014e0| 20 6f 6e 20 79 6f 75 72 | 20 73 63 72 65 65 6e 2e | on your| screen.|
|000014f0| 20 20 59 6f 75 72 0d 0a | 63 6f 6d 70 75 74 65 72 | Your..|computer|
|00001500| 20 75 73 65 73 20 61 20 | 62 79 74 65 20 6f 66 20 | uses a |byte of |
|00001510| 6d 65 6d 6f 72 79 20 74 | 6f 20 74 65 6c 6c 20 69 |memory t|o tell i|
|00001520| 74 20 77 68 61 74 20 63 | 68 61 72 61 63 74 65 72 |t what c|haracter|
|00001530| 20 74 6f 0d 0a 64 69 73 | 70 6c 61 79 20 61 74 20 | to..dis|play at |
|00001540| 65 61 63 68 20 6c 6f 63 | 61 74 69 6f 6e 20 6f 66 |each loc|ation of|
|00001550| 20 74 68 65 20 76 69 64 | 65 6f 20 73 63 72 65 65 | the vid|eo scree|
|00001560| 6e 2e 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |n.......|........|
|00001570| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00001580| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00001590| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |.... | |
|000015a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000015b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000015c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000015d0| 20 20 20 20 20 20 20 20 | 20 20 20 34 0d 0a 0d 0a | | 4....|
|000015e0| 57 69 74 68 6f 75 74 20 | 67 65 74 74 69 6e 67 20 |Without |getting |
|000015f0| 74 6f 6f 20 66 61 72 20 | 61 68 65 61 64 20 6f 66 |too far |ahead of|
|00001600| 20 6d 79 73 65 6c 66 2c | 20 49 27 6c 6c 20 6a 75 | myself,| I'll ju|
|00001610| 73 74 20 63 61 73 75 61 | 6c 6c 79 0d 0a 6d 65 6e |st casua|lly..men|
|00001620| 74 69 6f 6e 20 74 68 61 | 74 20 74 68 65 72 65 20 |tion tha|t there |
|00001630| 61 72 65 20 61 62 6f 75 | 74 20 32 35 36 20 66 75 |are abou|t 256 fu|
|00001640| 6e 64 61 6d 65 6e 74 61 | 6c 20 6f 70 65 72 61 74 |ndamenta|l operat|
|00001650| 69 6f 6e 73 20 74 68 61 | 74 20 74 68 65 0d 0a 38 |ions tha|t the..8|
|00001660| 30 38 38 20 6d 69 63 72 | 6f 70 72 6f 63 65 73 73 |088 micr|oprocess|
|00001670| 6f 72 20 63 68 69 70 20 | 63 61 6e 20 63 61 72 72 |or chip |can carr|
|00001680| 79 20 6f 75 74 2e 20 20 | 54 68 69 73 20 73 75 67 |y out. |This sug|
|00001690| 67 65 73 74 73 20 61 6e | 6f 74 68 65 72 0d 0a 6d |gests an|other..m|
|000016a0| 61 70 70 69 6e 67 20 77 | 68 69 63 68 20 77 65 27 |apping w|hich we'|
|000016b0| 6c 6c 20 64 69 73 63 75 | 73 73 20 69 6e 20 6d 6f |ll discu|ss in mo|
|000016c0| 72 65 20 64 65 74 61 69 | 6c 20 6c 61 74 65 72 2e |re detai|l later.|
|000016d0| 0d 0a 0d 0a 54 68 65 20 | 70 6f 69 6e 74 20 6f 66 |....The |point of|
|000016e0| 20 74 68 69 73 20 64 69 | 73 63 75 73 73 69 6f 6e | this di|scussion|
|000016f0| 20 69 73 20 74 68 61 74 | 20 77 65 20 63 61 6e 20 | is that| we can |
|00001700| 75 73 65 20 62 69 74 20 | 70 61 74 74 65 72 6e 73 |use bit |patterns|
|00001710| 20 74 6f 0d 0a 72 65 70 | 72 65 73 65 6e 74 20 61 | to..rep|resent a|
|00001720| 6e 79 74 68 69 6e 67 20 | 77 65 20 77 61 6e 74 2c |nything |we want,|
|00001730| 20 61 6e 64 20 62 79 20 | 6d 61 6e 69 70 75 6c 61 | and by |manipula|
|00001740| 74 69 6e 67 20 74 68 65 | 20 70 61 74 74 65 72 6e |ting the| pattern|
|00001750| 73 20 69 6e 0d 0a 64 69 | 66 66 65 72 61 6e 74 20 |s in..di|fferant |
|00001760| 77 61 79 73 2c 20 77 65 | 20 63 61 6e 20 70 72 6f |ways, we| can pro|
|00001770| 64 75 63 65 20 72 65 73 | 75 6c 74 73 20 77 68 69 |duce res|ults whi|
|00001780| 63 68 20 68 61 76 65 20 | 73 69 67 6e 69 66 69 63 |ch have |signific|
|00001790| 61 6e 63 65 20 69 6e 0d | 0a 74 65 72 6d 73 20 6f |ance in.|.terms o|
|000017a0| 66 20 77 68 61 74 20 77 | 65 27 72 65 20 63 68 6f |f what w|e're cho|
|000017b0| 6f 73 69 6e 67 20 74 6f | 20 72 65 70 72 65 73 65 |osing to| represe|
|000017c0| 6e 74 2e 0d 0a 0d 0a 44 | 49 47 52 45 53 53 49 4f |nt.....D|IGRESSIO|
|000017d0| 4e 3a 20 41 20 4e 4f 54 | 41 54 49 4f 4e 20 53 59 |N: A NOT|ATION SY|
|000017e0| 53 54 45 4d 20 46 4f 52 | 20 42 49 54 20 50 41 54 |STEM FOR| BIT PAT|
|000017f0| 54 45 52 4e 53 0d 0a 0d | 0a 42 65 63 61 75 73 65 |TERNS...|.Because|
|00001800| 20 6f 66 20 74 68 65 69 | 72 20 69 6d 70 6f 72 74 | of thei|r import|
|00001810| 61 6e 63 65 2c 20 69 74 | 20 77 6f 75 6c 64 20 62 |ance, it| would b|
|00001820| 65 20 6e 69 63 65 20 74 | 6f 20 68 61 76 65 20 61 |e nice t|o have a|
|00001830| 0d 0a 63 6f 6e 76 65 6e | 69 65 6e 74 20 77 61 79 |..conven|ient way|
|00001840| 20 74 6f 20 72 65 70 72 | 65 73 65 6e 74 20 74 68 | to repr|esent th|
|00001850| 65 20 76 61 72 69 6f 75 | 73 20 62 69 74 20 70 61 |e variou|s bit pa|
|00001860| 74 74 65 72 6e 73 20 77 | 65 27 6c 6c 20 62 65 0d |tterns w|e'll be.|
|00001870| 0a 74 61 6c 6b 69 6e 67 | 20 61 62 6f 75 74 2e 20 |.talking| about. |
|00001880| 20 57 65 20 61 6c 72 65 | 61 64 79 20 68 61 76 65 | We alre|ady have|
|00001890| 20 6f 6e 65 20 77 61 79 | 2c 20 62 79 20 6c 69 73 | one way|, by lis|
|000018a0| 74 69 6e 67 20 74 68 65 | 20 73 74 61 74 65 73 20 |ting the| states |
|000018b0| 6f 66 0d 0a 74 68 65 20 | 69 6e 64 69 76 69 64 75 |of..the |individu|
|000018c0| 61 6c 20 62 69 74 73 20 | 61 73 20 61 20 73 65 72 |al bits |as a ser|
|000018d0| 69 65 73 20 6f 66 20 31 | 27 73 20 61 6e 64 20 30 |ies of 1|'s and 0|
|000018e0| 27 73 2e 20 20 54 68 69 | 73 20 73 79 73 74 65 6d |'s. Thi|s system|
|000018f0| 20 69 73 0d 0a 73 6f 6d | 65 77 68 61 74 20 63 6c | is..som|ewhat cl|
|00001900| 75 6d 73 79 2c 20 61 6e | 64 20 65 72 72 6f 72 20 |umsy, an|d error |
|00001910| 70 72 6f 6e 65 2e 20 20 | 41 72 65 20 74 68 65 20 |prone. |Are the |
|00001920| 66 6f 6c 6c 6f 77 69 6e | 67 20 77 6f 72 64 0d 0a |followin|g word..|
|00001930| 70 61 74 74 65 72 6e 73 | 20 69 64 65 6e 74 69 63 |patterns| identic|
|00001940| 61 6c 20 6f 72 20 64 69 | 66 66 65 72 65 6e 74 3f |al or di|fferent?|
|00001950| 0d 0a 0d 0a 31 31 31 31 | 31 31 31 30 31 31 31 31 |....1111|11101111|
|00001960| 31 31 31 31 20 20 20 20 | 20 20 20 20 20 20 20 20 |1111 | |
|00001970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 31 31 31 | | 111|
|00001980| 31 31 31 31 31 30 31 31 | 31 31 31 31 31 0d 0a 0d |11111011|11111...|
|00001990| 0a 59 6f 75 20 70 72 6f | 62 61 62 6c 79 20 68 61 |.You pro|bably ha|
|000019a0| 64 20 74 72 6f 75 62 6c | 65 20 74 65 6c 6c 69 6e |d troubl|e tellin|
|000019b0| 67 20 74 68 65 6d 20 61 | 70 61 72 74 2e 20 20 49 |g them a|part. I|
|000019c0| 74 27 73 20 65 61 73 69 | 65 72 20 74 6f 20 74 65 |t's easi|er to te|
|000019d0| 6c 6c 0d 0a 74 68 61 74 | 20 74 68 65 79 27 72 65 |ll..that| they're|
|000019e0| 20 64 69 66 66 65 72 65 | 6e 74 20 62 79 20 62 72 | differe|nt by br|
|000019f0| 65 61 6b 69 6e 67 20 74 | 68 65 6d 20 64 6f 77 6e |eaking t|hem down|
|00001a00| 20 69 6e 74 6f 20 6d 6f | 72 65 20 6d 61 6e 61 67 | into mo|re manag|
|00001a10| 61 62 6c 65 0d 0a 70 69 | 65 63 65 73 2c 20 61 6e |able..pi|eces, an|
|00001a20| 64 20 63 6f 6d 70 61 72 | 69 6e 67 20 74 68 65 20 |d compar|ing the |
|00001a30| 70 69 65 63 65 73 2e 20 | 20 48 65 72 65 20 61 72 |pieces. | Here ar|
|00001a40| 65 20 74 68 65 20 73 61 | 6d 65 20 74 77 6f 20 70 |e the sa|me two p|
|00001a50| 61 74 74 65 72 6e 73 0d | 0a 62 72 6f 6b 65 6e 20 |atterns.|.broken |
|00001a60| 64 6f 77 6e 20 69 6e 74 | 6f 20 66 6f 75 72 20 62 |down int|o four b|
|00001a70| 69 74 20 63 68 75 6e 6b | 73 3a 0d 0a 0d 0a 31 31 |it chunk|s:....11|
|00001a80| 31 31 20 31 31 31 30 20 | 31 31 31 31 20 31 31 31 |11 1110 |1111 111|
|00001a90| 31 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |1 | |
|00001aa0| 20 20 20 31 31 31 31 20 | 31 31 31 31 20 30 31 31 | 1111 |1111 011|
|00001ab0| 31 20 31 31 31 31 0d 0a | 0d 0a 53 6f 6d 65 20 63 |1 1111..|..Some c|
|00001ac0| 6c 6f 77 6e 20 68 61 73 | 20 67 69 76 65 6e 20 74 |lown has| given t|
|00001ad0| 68 65 20 6e 61 6d 65 20 | 2a 6e 79 62 62 6c 65 2a |he name |*nybble*|
|00001ae0| 20 74 6f 20 61 20 63 68 | 75 6e 6b 20 6f 66 20 34 | to a ch|unk of 4|
|00001af0| 20 62 69 74 73 2c 0d 0a | 70 72 65 73 75 6d 61 62 | bits,..|presumab|
|00001b00| 6c 79 20 62 65 63 61 75 | 73 65 20 34 20 62 69 74 |ly becau|se 4 bit|
|00001b10| 73 20 61 72 65 20 68 61 | 6c 66 20 61 20 62 79 74 |s are ha|lf a byt|
|00001b20| 65 2e 20 20 41 20 6e 79 | 62 62 6c 65 20 69 73 20 |e. A ny|bble is |
|00001b30| 66 61 69 72 6c 79 0d 0a | 65 61 73 79 20 74 6f 20 |fairly..|easy to |
|00001b40| 68 61 6e 64 6c 65 2e 20 | 20 54 68 65 72 65 20 61 |handle. | There a|
|00001b50| 72 65 20 6f 6e 6c 79 20 | 31 36 20 70 6f 73 73 69 |re only |16 possi|
|00001b60| 62 6c 65 20 6e 79 62 62 | 6c 65 20 6c 6f 6e 67 20 |ble nybb|le long |
|00001b70| 70 61 74 74 65 72 6e 73 | 2c 0d 0a 61 6e 64 20 6d |patterns|,..and m|
|00001b80| 6f 73 74 20 70 65 6f 70 | 6c 65 20 63 61 6e 20 64 |ost peop|le can d|
|00001b90| 69 73 74 69 6e 67 75 69 | 73 68 20 62 65 74 77 65 |istingui|sh betwe|
|00001ba0| 65 6e 20 74 68 65 20 70 | 61 74 74 65 72 6e 73 20 |en the p|atterns |
|00001bb0| 71 75 69 74 65 0d 0a 65 | 61 73 69 6c 79 2e 0d 0a |quite..e|asily...|
|00001bc0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00001bd0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00001be0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00001bf0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 20 20 |........|...... |
|00001c00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c40| 20 20 20 20 20 35 0d 0a | 0d 0a 45 61 63 68 20 6e | 5..|..Each n|
|00001c50| 79 62 62 6c 65 20 70 61 | 74 74 65 72 6e 20 68 61 |ybble pa|ttern ha|
|00001c60| 73 20 62 65 65 6e 20 67 | 69 76 65 6e 20 61 20 75 |s been g|iven a u|
|00001c70| 6e 69 71 75 65 20 73 79 | 6d 62 6f 6c 20 61 67 72 |nique sy|mbol agr|
|00001c80| 65 65 64 20 75 70 6f 6e | 20 62 79 0d 0a 63 6f 6d |eed upon| by..com|
|00001c90| 70 75 74 65 72 20 73 63 | 69 65 6e 74 69 73 74 73 |puter sc|ientists|
|00001ca0| 2e 20 20 54 68 65 20 66 | 69 72 73 74 20 31 30 20 |. The f|irst 10 |
|00001cb0| 70 61 74 74 65 72 6e 73 | 20 77 65 72 65 20 67 69 |patterns| were gi|
|00001cc0| 76 65 6e 20 73 79 6d 62 | 6f 6c 73 0d 0a 22 30 22 |ven symb|ols.."0"|
|00001cd0| 20 74 68 72 6f 75 67 68 | 20 22 39 22 2c 20 61 6e | through| "9", an|
|00001ce0| 64 20 77 68 65 6e 20 74 | 68 65 79 20 72 61 6e 20 |d when t|hey ran |
|00001cf0| 6f 75 74 20 6f 66 20 64 | 69 67 69 74 20 73 74 79 |out of d|igit sty|
|00001d00| 6c 65 20 73 79 6d 62 6f | 6c 73 2c 0d 0a 74 68 65 |le symbo|ls,..the|
|00001d10| 79 20 75 73 65 64 20 74 | 68 65 20 6c 65 74 74 65 |y used t|he lette|
|00001d20| 72 73 20 22 41 22 20 74 | 68 72 6f 75 67 68 20 22 |rs "A" t|hrough "|
|00001d30| 46 22 20 66 6f 72 20 74 | 68 65 20 6c 61 73 74 20 |F" for t|he last |
|00001d40| 73 69 78 20 70 61 74 74 | 65 72 6e 73 2e 0d 0a 42 |six patt|erns...B|
|00001d50| 65 6c 6f 77 20 69 73 20 | 74 68 65 20 22 6e 79 62 |elow is |the "nyb|
|00001d60| 62 6c 65 20 70 61 74 74 | 65 72 6e 20 63 6f 64 65 |ble patt|ern code|
|00001d70| 22 3a 0d 0a 0d 0a 30 30 | 30 30 20 3d 20 30 20 20 |":....00|00 = 0 |
|00001d80| 20 20 30 30 30 31 20 3d | 20 31 20 20 20 20 30 30 | 0001 =| 1 00|
|00001d90| 31 30 20 3d 20 32 20 20 | 20 20 30 30 31 31 20 3d |10 = 2 | 0011 =|
|00001da0| 20 33 0d 0a 0d 0a 30 31 | 30 30 20 3d 20 34 20 20 | 3....01|00 = 4 |
|00001db0| 20 20 30 31 30 31 20 3d | 20 35 20 20 20 20 30 31 | 0101 =| 5 01|
|00001dc0| 31 30 20 3d 20 36 20 20 | 20 20 30 31 31 31 20 3d |10 = 6 | 0111 =|
|00001dd0| 20 37 0d 0a 0d 0a 31 30 | 30 30 20 3d 20 38 20 20 | 7....10|00 = 8 |
|00001de0| 20 20 31 30 30 31 20 3d | 20 39 20 20 20 20 31 30 | 1001 =| 9 10|
|00001df0| 31 30 20 3d 20 41 20 20 | 20 20 31 30 31 31 20 3d |10 = A | 1011 =|
|00001e00| 20 42 0d 0a 0d 0a 31 31 | 30 30 20 3d 20 43 20 20 | B....11|00 = C |
|00001e10| 20 20 31 31 30 31 20 3d | 20 44 20 20 20 20 31 31 | 1101 =| D 11|
|00001e20| 31 30 20 3d 20 45 20 20 | 20 20 31 31 31 31 20 3d |10 = E | 1111 =|
|00001e30| 20 46 0d 0a 0d 0a 55 73 | 69 6e 67 20 74 68 65 20 | F....Us|ing the |
|00001e40| 6e 79 62 62 6c 65 20 63 | 6f 64 65 2c 20 77 65 20 |nybble c|ode, we |
|00001e50| 63 61 6e 20 72 65 70 72 | 65 73 65 6e 74 20 74 68 |can repr|esent th|
|00001e60| 65 20 74 77 6f 20 73 69 | 6d 69 6c 61 72 20 77 6f |e two si|milar wo|
|00001e70| 72 64 0d 0a 70 61 74 74 | 65 72 6e 73 20 67 69 76 |rd..patt|erns giv|
|00001e80| 65 6e 20 61 62 6f 76 65 | 2c 20 77 69 74 68 20 74 |en above|, with t|
|00001e90| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6d 6f 72 |he follo|wing mor|
|00001ea0| 65 20 6d 61 6e 61 67 61 | 62 6c 65 20 73 68 6f 72 |e managa|ble shor|
|00001eb0| 74 68 61 6e 64 0d 0a 76 | 65 72 73 69 6f 6e 73 3a |thand..v|ersions:|
|00001ec0| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |.... | |
|00001ed0| 20 20 20 46 45 46 46 20 | 20 20 20 20 20 20 46 46 | FEFF | FF|
|00001ee0| 37 46 0d 0a 0d 0a 4f 66 | 20 63 6f 75 72 73 65 2c |7F....Of| course,|
|00001ef0| 20 74 68 65 20 61 73 73 | 69 67 6e 6d 65 6e 74 20 | the ass|ignment |
|00001f00| 6f 66 20 74 68 65 20 73 | 79 6d 62 6f 6c 73 20 66 |of the s|ymbols f|
|00001f10| 6f 72 20 74 68 65 20 76 | 61 72 69 6f 75 73 20 6e |or the v|arious n|
|00001f20| 79 62 62 6c 65 0d 0a 70 | 61 74 74 65 72 6e 73 20 |ybble..p|atterns |
|00001f30| 77 61 73 20 6e 6f 74 20 | 73 6f 20 61 72 62 69 74 |was not |so arbit|
|00001f40| 72 61 72 79 20 61 73 20 | 49 27 76 65 20 74 72 69 |rary as |I've tri|
|00001f50| 65 64 20 74 6f 20 6d 61 | 6b 65 20 69 74 20 61 70 |ed to ma|ke it ap|
|00001f60| 70 65 61 72 2e 20 20 41 | 0d 0a 70 65 72 63 65 70 |pear. A|..percep|
|00001f70| 74 69 76 65 20 72 65 61 | 64 65 72 20 77 68 6f 20 |tive rea|der who |
|00001f80| 68 61 73 20 62 65 65 6e | 20 65 78 70 6f 73 65 64 |has been| exposed|
|00001f90| 20 74 6f 20 62 69 6e 61 | 72 79 20 6e 75 6d 62 65 | to bina|ry numbe|
|00001fa0| 72 73 20 77 69 6c 6c 0d | 0a 68 61 76 65 20 6e 6f |rs will.|.have no|
|00001fb0| 74 69 63 65 64 20 61 6e | 20 75 6e 64 65 72 6c 79 |ticed an| underly|
|00001fc0| 69 6e 67 20 73 79 73 74 | 65 6d 20 74 6f 20 74 68 |ing syst|em to th|
|00001fd0| 65 20 61 73 73 69 67 6e | 6d 65 6e 74 73 2e 20 20 |e assign|ments. |
|00001fe0| 49 66 20 74 68 65 20 31 | 27 73 0d 0a 61 6e 64 20 |If the 1|'s..and |
|00001ff0| 30 27 73 20 6f 66 20 74 | 68 65 20 70 61 74 74 65 |0's of t|he patte|
|00002000| 72 6e 73 20 61 72 65 20 | 69 6e 74 65 72 70 72 65 |rns are |interpre|
|00002010| 74 65 64 20 61 73 20 61 | 63 74 75 61 6c 20 2a 6e |ted as a|ctual *n|
|00002020| 75 6d 62 65 72 73 2a 2c | 0d 0a 72 61 74 68 65 72 |umbers*,|..rather|
|00002030| 20 74 68 61 6e 20 6d 65 | 72 65 20 73 79 6d 62 6f | than me|re symbo|
|00002040| 6c 73 20 66 6f 72 20 62 | 69 74 20 73 74 61 74 65 |ls for b|it state|
|00002050| 73 2c 20 74 68 65 20 66 | 69 72 73 74 20 31 30 20 |s, the f|irst 10 |
|00002060| 70 61 74 74 65 72 6e 73 | 0d 0a 63 6f 72 72 65 73 |patterns|..corres|
|00002070| 70 6f 6e 64 20 74 6f 20 | 62 69 6e 61 72 79 20 6e |pond to |binary n|
|00002080| 75 6d 62 65 72 73 20 77 | 68 6f 73 65 20 64 65 63 |umbers w|hose dec|
|00002090| 69 6d 61 6c 20 72 65 70 | 72 65 73 65 6e 74 61 74 |imal rep|resentat|
|000020a0| 69 6f 6e 20 69 73 20 74 | 68 65 0d 0a 73 79 6d 62 |ion is t|he..symb|
|000020b0| 6f 6c 20 61 73 73 69 67 | 6e 65 64 20 74 6f 20 74 |ol assig|ned to t|
|000020c0| 68 65 20 70 61 74 74 65 | 72 6e 2e 20 20 54 68 65 |he patte|rn. The|
|000020d0| 20 6c 61 73 74 20 73 69 | 78 20 70 61 74 74 65 72 | last si|x patter|
|000020e0| 6e 73 20 72 65 63 65 69 | 76 65 20 74 68 65 0d 0a |ns recei|ve the..|
|000020f0| 73 79 6d 62 6f 6c 73 20 | 22 41 22 20 74 68 72 6f |symbols |"A" thro|
|00002100| 75 67 68 20 22 46 22 2c | 20 61 6e 64 20 74 61 6b |ugh "F",| and tak|
|00002110| 65 6e 20 74 6f 67 65 74 | 68 65 72 2c 20 74 68 65 |en toget|her, the|
|00002120| 20 73 79 6d 62 6f 6c 73 | 20 30 0d 0a 74 68 72 6f | symbols| 0..thro|
|00002130| 75 67 68 20 46 20 63 6f | 6e 73 74 69 74 75 74 65 |ugh F co|nstitute|
|00002140| 20 74 68 65 20 64 69 67 | 69 74 73 20 6f 66 20 74 | the dig|its of t|
|00002150| 68 65 20 2a 68 65 78 61 | 64 65 63 69 6d 61 6c 2a |he *hexa|decimal*|
|00002160| 20 6e 75 6d 62 65 72 0d | 0a 73 79 73 74 65 6d 2e | number.|.system.|
|00002170| 20 20 54 68 75 73 2c 20 | 74 68 65 20 73 79 6d 62 | Thus, |the symb|
|00002180| 6f 6c 73 20 61 73 73 69 | 67 6e 65 64 20 74 6f 20 |ols assi|gned to |
|00002190| 74 68 65 20 64 69 66 66 | 65 72 65 6e 74 20 6e 79 |the diff|erent ny|
|000021a0| 62 62 6c 65 0d 0a 70 61 | 74 74 65 72 6e 73 20 77 |bble..pa|tterns w|
|000021b0| 65 72 65 20 62 6f 72 6e | 20 6f 75 74 20 6f 66 20 |ere born| out of |
|000021c0| 68 69 73 74 6f 72 69 63 | 61 6c 20 70 72 65 6a 75 |historic|al preju|
|000021d0| 64 69 63 65 20 69 6e 20 | 74 68 69 6e 6b 69 6e 67 |dice in |thinking|
|000021e0| 20 6f 66 0d 0a 74 68 65 | 20 63 6f 6d 70 75 74 65 | of..the| compute|
|000021f0| 72 20 61 73 20 73 74 72 | 69 63 74 6c 79 20 61 20 |r as str|ictly a |
|00002200| 6e 75 6d 62 65 72 20 68 | 61 6e 64 6c 69 6e 67 20 |number h|andling |
|00002210| 6d 61 63 68 69 6e 65 2e | 20 20 41 6c 74 68 6f 75 |machine.| Althou|
|00002220| 67 68 0d 0a 74 68 69 73 | 20 69 73 20 61 6e 20 69 |gh..this| is an i|
|00002230| 6d 70 6f 72 74 61 6e 74 | 20 69 6e 74 65 72 70 72 |mportant| interpr|
|00002240| 65 74 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 73 65 |etation |of these|
|00002250| 20 73 79 6d 62 6f 6c 73 | 2c 20 66 6f 72 20 74 68 | symbols|, for th|
|00002260| 65 0d 0a 74 69 6d 65 20 | 62 65 69 6e 67 20 69 74 |e..time |being it|
|00002270| 27 73 20 65 6e 6f 75 67 | 68 20 74 6f 20 6d 65 72 |'s enoug|h to mer|
|00002280| 65 6c 79 20 74 68 69 6e | 6b 20 6f 66 20 74 68 65 |ely thin|k of the|
|00002290| 6d 20 61 73 20 61 20 73 | 68 6f 72 74 68 61 6e 64 |m as a s|horthand|
|000022a0| 20 77 61 79 0d 0a 74 6f | 20 77 72 69 74 65 20 64 | way..to| write d|
|000022b0| 6f 77 6e 20 62 69 74 20 | 70 61 74 74 65 72 6e 73 |own bit |patterns|
|000022c0| 2e 0d 0a 0d 0a 42 65 63 | 61 75 73 65 20 73 6f 6d |.....Bec|ause som|
|000022d0| 65 20 6e 79 62 62 6c 65 | 20 70 61 74 74 65 72 6e |e nybble| pattern|
|000022e0| 73 20 63 61 6e 20 6c 6f | 6f 6b 20 6a 75 73 74 20 |s can lo|ok just |
|000022f0| 6c 69 6b 65 20 61 20 6e | 75 6d 62 65 72 2c 20 69 |like a n|umber, i|
|00002300| 74 27 73 0d 0a 6f 66 74 | 65 6e 20 6e 65 63 65 73 |t's..oft|en neces|
|00002310| 73 61 72 79 20 74 6f 20 | 73 6f 6d 65 68 6f 77 20 |sary to |somehow |
|00002320| 69 6e 64 69 63 61 74 65 | 20 74 68 61 74 20 77 65 |indicate| that we|
|00002330| 27 72 65 20 74 61 6c 6b | 69 6e 67 20 61 62 6f 75 |'re talk|ing abou|
|00002340| 74 20 61 0d 0a 70 61 74 | 74 65 72 6e 2e 20 20 49 |t a..pat|tern. I|
|00002350| 6e 20 42 41 53 49 43 2c | 20 79 6f 75 20 64 6f 20 |n BASIC,| you do |
|00002360| 74 68 69 73 20 62 79 20 | 61 64 64 69 6e 67 20 74 |this by |adding t|
|00002370| 68 65 20 63 68 61 72 61 | 63 74 65 72 73 20 26 48 |he chara|cters &H|
|00002380| 20 74 6f 0d 0a 74 68 65 | 20 62 65 67 69 6e 6e 69 | to..the| beginni|
|00002390| 6e 67 20 6f 66 20 74 68 | 65 20 70 61 74 74 65 72 |ng of th|e patter|
|000023a0| 6e 3a 20 26 48 31 32 33 | 34 2e 20 20 41 20 6d 6f |n: &H123|4. A mo|
|000023b0| 72 65 20 63 6f 6d 6d 6f | 6e 20 63 6f 6e 76 65 6e |re commo|n conven|
|000023c0| 74 69 6f 6e 0d 0a 69 73 | 20 74 6f 20 6a 75 73 74 |tion..is| to just|
|000023d0| 20 61 64 64 20 74 68 65 | 20 6c 65 74 74 65 72 20 | add the| letter |
|000023e0| 48 20 74 6f 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |H to the| end of |
|000023f0| 74 68 65 20 70 61 74 74 | 65 72 6e 3a 20 31 32 33 |the patt|ern: 123|
|00002400| 34 48 2e 20 20 49 6e 0d | 0a 62 6f 74 68 20 63 6f |4H. In.|.both co|
|00002410| 6e 76 65 6e 74 69 6f 6e | 73 2c 20 74 68 65 20 48 |nvention|s, the H|
|00002420| 20 69 73 20 72 65 66 65 | 72 72 69 6e 67 20 74 6f | is refe|rring to|
|00002430| 20 68 65 78 61 64 65 63 | 69 6d 61 6c 2e 0d 0a 0d | hexadec|imal....|
|00002440| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00002450| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00002460| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 20 20 20 20 20 20 20 |........|. |
|00002470| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002480| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024b0| 36 0d 0a 0d 0a 45 76 65 | 6e 74 75 61 6c 6c 79 20 |6....Eve|ntually |
|000024c0| 79 6f 75 27 6c 6c 20 77 | 61 6e 74 20 74 6f 20 6c |you'll w|ant to l|
|000024d0| 65 61 72 6e 20 61 62 6f | 75 74 20 75 73 69 6e 67 |earn abo|ut using|
|000024e0| 20 74 68 65 20 68 65 78 | 61 64 65 63 69 6d 61 6c | the hex|adecimal|
|000024f0| 0d 0a 6e 75 6d 62 65 72 | 20 73 79 73 74 65 6d 2c |..number| system,|
|00002500| 20 73 69 6e 63 65 20 69 | 74 20 69 73 20 61 6e 20 | since i|t is an |
|00002510| 69 6d 70 6f 72 74 61 6e | 74 20 77 61 79 20 74 6f |importan|t way to|
|00002520| 20 75 73 65 20 62 69 74 | 20 70 61 74 74 65 72 6e | use bit| pattern|
|00002530| 73 2e 0d 0a 49 27 6d 20 | 6e 6f 74 20 67 6f 69 6e |s...I'm |not goin|
|00002540| 67 20 74 6f 20 64 69 73 | 63 75 73 73 20 69 74 20 |g to dis|cuss it |
|00002550| 69 6e 20 74 68 69 73 20 | 70 72 69 6d 65 72 2c 20 |in this |primer, |
|00002560| 62 65 63 61 75 73 65 20 | 61 20 6e 75 6d 62 65 72 |because |a number|
|00002570| 20 6f 66 0d 0a 62 6f 6f | 6b 73 20 68 61 76 65 20 | of..boo|ks have |
|00002580| 6d 75 63 68 20 62 65 74 | 74 65 72 20 74 72 65 61 |much bet|ter trea|
|00002590| 74 6d 65 6e 74 73 20 6f | 66 20 74 68 69 73 20 74 |tments o|f this t|
|000025a0| 6f 70 69 63 20 74 68 61 | 6e 20 49 20 63 6f 75 6c |opic tha|n I coul|
|000025b0| 64 0d 0a 70 72 6f 64 75 | 63 65 2e 20 20 43 6f 6e |d..produ|ce. Con|
|000025c0| 73 69 64 65 72 20 74 68 | 69 73 20 61 6e 20 61 64 |sider th|is an ad|
|000025d0| 76 61 6e 63 65 64 20 74 | 6f 70 69 63 20 79 6f 75 |vanced t|opic you|
|000025e0| 27 6c 6c 20 77 61 6e 74 | 20 74 6f 20 66 69 6c 6c |'ll want| to fill|
|000025f0| 20 69 6e 0d 0a 6c 61 74 | 65 72 2e 0d 0a 0d 0a 41 | in..lat|er.....A|
|00002600| 44 44 52 45 53 53 49 4e | 47 20 4d 45 4d 4f 52 59 |DDRESSIN|G MEMORY|
|00002610| 0d 0a 0d 0a 41 73 20 73 | 74 61 74 65 64 20 62 65 |....As s|tated be|
|00002620| 66 6f 72 65 2c 20 74 68 | 65 20 38 30 38 38 20 63 |fore, th|e 8088 c|
|00002630| 68 69 70 20 69 6e 73 69 | 64 65 20 79 6f 75 72 20 |hip insi|de your |
|00002640| 63 6f 6d 70 75 74 65 72 | 20 63 61 6e 0d 0a 6d 61 |computer| can..ma|
|00002650| 6e 69 70 75 6c 61 74 65 | 20 74 68 65 20 62 69 74 |nipulate| the bit|
|00002660| 20 70 61 74 74 65 72 6e | 73 20 77 68 69 63 68 20 | pattern|s which |
|00002670| 6d 61 6b 65 20 75 70 20 | 74 68 65 20 63 6f 6d 70 |make up |the comp|
|00002680| 75 74 65 72 27 73 20 6d | 65 6d 6f 72 79 2e 0d 0a |uter's m|emory...|
|00002690| 53 6f 6d 65 20 6f 66 20 | 74 68 65 20 70 6f 73 73 |Some of |the poss|
|000026a0| 69 62 6c 65 20 6d 61 6e | 69 70 75 6c 61 74 69 6f |ible man|ipulatio|
|000026b0| 6e 73 20 61 72 65 20 63 | 6f 70 79 69 6e 67 20 70 |ns are c|opying p|
|000026c0| 61 74 74 65 72 6e 73 20 | 66 72 6f 6d 20 6f 6e 65 |atterns |from one|
|000026d0| 0d 0a 70 6c 61 63 65 20 | 74 6f 20 61 6e 6f 74 68 |..place |to anoth|
|000026e0| 65 72 2c 20 74 75 72 6e | 69 6e 67 20 6f 6e 20 6f |er, turn|ing on o|
|000026f0| 72 20 74 75 72 6e 69 6e | 67 20 6f 66 66 20 63 65 |r turnin|g off ce|
|00002700| 72 74 61 69 6e 20 62 69 | 74 73 2c 20 6f 72 0d 0a |rtain bi|ts, or..|
|00002710| 69 6e 74 65 72 70 72 65 | 74 69 6e 67 20 74 68 65 |interpre|ting the|
|00002720| 20 70 61 74 74 65 72 6e | 73 20 61 73 20 6e 75 6d | pattern|s as num|
|00002730| 62 65 72 73 20 61 6e 64 | 20 70 65 72 66 6f 72 6d |bers and| perform|
|00002740| 69 6e 67 20 61 72 69 74 | 68 6d 65 74 69 63 0d 0a |ing arit|hmetic..|
|00002750| 6f 70 65 72 61 74 69 6f | 6e 73 20 6f 6e 20 74 68 |operatio|ns on th|
|00002760| 65 6d 2e 20 20 54 6f 20 | 70 65 72 66 6f 72 6d 20 |em. To |perform |
|00002770| 61 6e 79 20 6f 66 20 74 | 68 65 73 65 20 61 63 74 |any of t|hese act|
|00002780| 69 6f 6e 73 2c 20 74 68 | 65 20 38 30 38 38 0d 0a |ions, th|e 8088..|
|00002790| 68 61 73 20 74 6f 20 6b | 6e 6f 77 20 77 68 61 74 |has to k|now what|
|000027a0| 20 70 61 72 74 20 6f 66 | 20 6d 65 6d 6f 72 79 20 | part of| memory |
|000027b0| 69 73 20 74 6f 20 62 65 | 20 77 6f 72 6b 65 64 20 |is to be| worked |
|000027c0| 6f 6e 2e 20 20 41 20 73 | 70 65 63 69 66 69 63 0d |on. A s|pecific.|
|000027d0| 0a 6c 6f 63 61 74 69 6f | 6e 20 69 6e 20 6d 65 6d |.locatio|n in mem|
|000027e0| 6f 72 79 20 69 73 20 69 | 64 65 6e 74 69 66 69 65 |ory is i|dentifie|
|000027f0| 64 20 62 79 20 69 74 27 | 73 20 2a 61 64 64 72 65 |d by it'|s *addre|
|00002800| 73 73 2a 2e 0d 0a 0d 0a | 41 6e 20 61 64 64 72 65 |ss*.....|An addre|
|00002810| 73 73 20 69 73 20 61 20 | 70 6f 69 6e 74 65 72 20 |ss is a |pointer |
|00002820| 69 6e 74 6f 20 6d 65 6d | 6f 72 79 2e 20 20 45 61 |into mem|ory. Ea|
|00002830| 63 68 20 61 64 64 72 65 | 73 73 20 70 6f 69 6e 74 |ch addre|ss point|
|00002840| 73 20 74 6f 20 74 68 65 | 0d 0a 62 65 67 69 6e 6e |s to the|..beginn|
|00002850| 69 6e 67 20 6f 66 20 61 | 20 62 79 74 65 20 6c 6f |ing of a| byte lo|
|00002860| 6e 67 20 63 68 75 6e 6b | 20 6f 66 20 6d 65 6d 6f |ng chunk| of memo|
|00002870| 72 79 2e 20 20 54 68 65 | 20 38 30 38 38 20 68 61 |ry. The| 8088 ha|
|00002880| 73 20 74 68 65 0d 0a 63 | 61 70 61 62 69 6c 69 74 |s the..c|apabilit|
|00002890| 79 20 74 6f 20 64 69 73 | 74 69 6e 67 75 69 73 68 |y to dis|tinguish|
|000028a0| 20 31 2c 30 34 38 2c 35 | 37 36 20 64 69 66 66 65 | 1,048,5|76 diffe|
|000028b0| 72 61 6e 74 20 62 79 74 | 65 73 20 6f 66 20 6d 65 |rant byt|es of me|
|000028c0| 6d 6f 72 79 2e 0d 0a 0d | 0a 42 79 20 74 68 69 73 |mory....|.By this|
|000028d0| 20 70 6f 69 6e 74 2c 20 | 69 74 20 70 72 6f 62 61 | point, |it proba|
|000028e0| 62 6c 79 20 63 6f 6d 65 | 73 20 61 73 20 6e 6f 20 |bly come|s as no |
|000028f0| 73 75 70 72 69 73 65 20 | 74 6f 20 68 65 61 72 20 |suprise |to hear |
|00002900| 74 68 61 74 0d 0a 61 64 | 64 72 65 73 73 65 73 20 |that..ad|dresses |
|00002910| 61 72 65 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 |are repr|esented |
|00002920| 61 73 20 70 61 74 74 65 | 72 6e 73 20 6f 66 20 62 |as patte|rns of b|
|00002930| 69 74 73 2e 20 20 49 74 | 20 74 61 6b 65 73 20 32 |its. It| takes 2|
|00002940| 30 20 62 69 74 73 0d 0a | 74 6f 20 67 65 74 20 61 |0 bits..|to get a|
|00002950| 20 74 6f 74 61 6c 20 6f | 66 20 31 2c 30 34 38 2c | total o|f 1,048,|
|00002960| 35 37 36 20 64 69 66 66 | 65 72 61 6e 74 20 70 61 |576 diff|erant pa|
|00002970| 74 74 65 72 6e 73 2c 20 | 61 6e 64 20 74 68 75 73 |tterns, |and thus|
|00002980| 20 61 6e 0d 0a 61 64 64 | 72 65 73 73 20 6d 61 79 | an..add|ress may|
|00002990| 20 62 65 20 77 72 69 74 | 74 65 6e 20 64 6f 77 6e | be writ|ten down|
|000029a0| 20 61 73 20 61 20 73 65 | 72 69 65 73 20 6f 66 20 | as a se|ries of |
|000029b0| 35 20 6e 79 62 62 6c 65 | 20 63 6f 64 65 73 2e 20 |5 nybble| codes. |
|000029c0| 20 46 6f 72 0d 0a 65 78 | 61 6d 70 6c 65 2c 20 44 | For..ex|ample, D|
|000029d0| 4f 53 20 73 74 6f 72 65 | 73 20 61 20 70 61 74 74 |OS store|s a patt|
|000029e0| 65 72 6e 20 77 68 69 63 | 68 20 65 6e 63 6f 64 65 |ern whic|h encode|
|000029f0| 73 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |s inform|ation ab|
|00002a00| 6f 75 74 0d 0a 77 68 61 | 74 20 65 71 75 69 70 6d |out..wha|t equipm|
|00002a10| 65 6e 74 20 69 73 20 69 | 6e 73 74 61 6c 6c 65 64 |ent is i|nstalled|
|00002a20| 20 6f 6e 20 79 6f 75 72 | 20 49 42 4d 20 50 43 20 | on your| IBM PC |
|00002a30| 69 6e 20 74 68 65 20 77 | 6f 72 64 20 77 68 69 63 |in the w|ord whic|
|00002a40| 68 0d 0a 62 65 67 69 6e | 73 20 61 74 20 6c 6f 63 |h..begin|s at loc|
|00002a50| 61 74 69 6f 6e 20 30 30 | 34 31 30 2e 20 20 49 6e |ation 00|410. In|
|00002a60| 74 65 72 70 72 65 74 69 | 6e 67 20 74 68 65 20 61 |terpreti|ng the a|
|00002a70| 64 64 72 65 73 73 20 61 | 73 20 61 20 68 65 78 0d |ddress a|s a hex.|
|00002a80| 0a 6e 75 6d 62 65 72 2c | 20 74 68 65 20 73 65 63 |.number,| the sec|
|00002a90| 6f 6e 64 20 62 79 74 65 | 20 6f 66 20 74 68 69 73 |ond byte| of this|
|00002aa0| 20 77 6f 72 64 20 68 61 | 73 20 61 6e 20 61 64 64 | word ha|s an add|
|00002ab0| 72 65 73 73 20 31 20 67 | 72 65 61 74 65 72 0d 0a |ress 1 g|reater..|
|00002ac0| 74 68 61 6e 20 30 30 34 | 31 30 2c 20 6f 72 20 30 |than 004|10, or 0|
|00002ad0| 30 34 31 31 2e 0d 0a 0d | 0a 54 68 65 20 38 30 38 |0411....|.The 808|
|00002ae0| 38 20 69 73 6e 27 74 20 | 76 65 72 79 20 68 61 70 |8 isn't |very hap|
|00002af0| 70 79 20 68 61 6e 64 6c | 69 6e 67 20 32 30 20 62 |py handl|ing 20 b|
|00002b00| 69 74 73 20 61 74 20 61 | 20 74 69 6d 65 2e 20 20 |its at a| time. |
|00002b10| 54 68 65 0d 0a 62 69 67 | 67 65 73 74 20 63 68 75 |The..big|gest chu|
|00002b20| 6e 6b 20 74 68 61 74 27 | 73 20 63 6f 6e 76 65 6e |nk that'|s conven|
|00002b30| 69 65 6e 74 20 66 6f 72 | 20 69 74 20 74 6f 20 75 |ient for| it to u|
|00002b40| 73 65 20 69 73 20 61 20 | 31 36 20 62 69 74 20 77 |se is a |16 bit w|
|00002b50| 6f 72 64 2e 0d 0a 54 68 | 65 20 38 30 38 38 20 61 |ord...Th|e 8088 a|
|00002b60| 63 74 75 61 6c 6c 79 20 | 63 61 6c 63 75 6c 61 74 |ctually |calculat|
|00002b70| 65 73 20 32 30 20 62 69 | 74 20 61 64 64 72 65 73 |es 20 bi|t addres|
|00002b80| 73 65 73 20 61 73 20 74 | 68 65 20 63 6f 6d 62 69 |ses as t|he combi|
|00002b90| 6e 61 74 69 6f 6e 0d 0a | 6f 66 20 74 77 6f 20 77 |nation..|of two w|
|00002ba0| 6f 72 64 73 2c 20 61 20 | 73 65 67 6d 65 6e 74 20 |ords, a |segment |
|00002bb0| 77 6f 72 64 20 61 6e 64 | 20 61 6e 20 6f 66 66 73 |word and| an offs|
|00002bc0| 65 74 20 77 6f 72 64 2e | 20 20 54 68 65 20 63 6f |et word.| The co|
|00002bd0| 6d 62 69 6e 61 74 69 6f | 6e 0d 0a 70 72 6f 63 65 |mbinatio|n..proce|
|00002be0| 73 73 20 69 6e 76 6f 6c | 76 65 73 20 69 6e 74 65 |ss invol|ves inte|
|00002bf0| 72 70 72 65 74 69 6e 67 | 20 74 68 65 20 74 77 6f |rpreting| the two|
|00002c00| 20 70 61 74 74 65 72 6e | 73 20 61 73 20 68 65 78 | pattern|s as hex|
|00002c10| 61 64 65 63 69 6d 61 6c | 0d 0a 6e 75 6d 62 65 72 |adecimal|..number|
|00002c20| 73 20 61 6e 64 20 61 64 | 64 69 6e 67 20 74 68 65 |s and ad|ding the|
|00002c30| 6d 2e 20 20 54 68 65 20 | 77 61 79 20 74 68 61 74 |m. The |way that|
|00002c40| 20 74 77 6f 20 31 36 20 | 62 69 74 20 70 61 74 74 | two 16 |bit patt|
|00002c50| 65 72 6e 73 20 63 61 6e | 20 62 65 0d 0a 63 6f 6d |erns can| be..com|
|00002c60| 62 69 6e 65 64 20 74 6f | 20 67 69 76 65 20 6f 6e |bined to| give on|
|00002c70| 65 20 32 30 20 62 69 74 | 20 70 61 74 74 65 72 6e |e 20 bit| pattern|
|00002c80| 20 69 73 20 74 68 61 74 | 20 74 68 65 20 74 77 6f | is that| the two|
|00002c90| 20 70 61 74 74 65 72 6e | 73 20 61 72 65 0d 0a 61 | pattern|s are..a|
|00002ca0| 64 64 65 64 20 6f 75 74 | 20 6f 66 20 61 6c 69 67 |dded out| of alig|
|00002cb0| 6e 6d 65 6e 74 20 62 79 | 20 6f 6e 65 20 6e 79 62 |nment by| one nyb|
|00002cc0| 62 6c 65 3a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |ble:....|........|
|00002cd0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00002ce0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00002cf0| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |...... | |
|00002d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002d10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002d30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 37 0d 0a | | 7..|
|00002d40| 0d 0a 20 20 20 20 30 30 | 34 30 20 20 20 20 20 20 |.. 00|40 |
|00002d50| 34 20 6e 79 62 62 6c 65 | 20 73 65 67 6d 65 6e 74 |4 nybble| segment|
|00002d60| 0d 0a 20 20 20 20 20 30 | 30 31 30 20 20 20 20 20 |.. 0|010 |
|00002d70| 34 20 6e 79 62 62 6c 65 | 20 6f 66 66 73 65 74 0d |4 nybble| offset.|
|00002d80| 0a 20 20 20 2d 2d 2d 2d | 2d 2d 2d 2d 0d 0a 20 20 |. ----|----.. |
|00002d90| 20 20 30 30 34 31 30 20 | 20 20 20 20 35 20 6e 79 | 00410 | 5 ny|
|00002da0| 62 62 6c 65 20 61 64 64 | 72 65 73 73 0d 0a 0d 0a |bble add|ress....|
|00002db0| 42 65 63 61 75 73 65 20 | 6f 66 20 74 68 69 73 20 |Because |of this |
|00002dc0| 6d 65 63 68 61 6e 69 73 | 6d 20 66 6f 72 20 63 61 |mechanis|m for ca|
|00002dd0| 6c 63 75 6c 61 74 69 6e | 67 20 61 64 64 72 65 73 |lculatin|g addres|
|00002de0| 73 65 73 2c 20 74 68 65 | 79 20 77 69 6c 6c 0d 0a |ses, the|y will..|
|00002df0| 6f 66 74 65 6e 20 62 65 | 20 77 72 69 74 74 65 6e |often be| written|
|00002e00| 20 64 6f 77 6e 20 69 6e | 20 77 68 61 74 20 6d 61 | down in| what ma|
|00002e10| 79 20 62 65 20 63 61 6c | 6c 65 64 20 73 65 67 6d |y be cal|led segm|
|00002e20| 65 6e 74 3a 6f 66 66 73 | 65 74 20 66 6f 72 6d 2e |ent:offs|et form.|
|00002e30| 0d 0a 54 68 75 73 2c 20 | 74 68 65 20 61 64 64 72 |..Thus, |the addr|
|00002e40| 65 73 73 20 69 6e 20 61 | 62 6f 76 65 20 63 61 6c |ess in a|bove cal|
|00002e50| 63 75 6c 61 74 69 6f 6e | 20 63 6f 75 6c 64 20 62 |culation| could b|
|00002e60| 65 20 77 72 69 74 74 65 | 6e 3a 0d 0a 0d 0a 30 30 |e writte|n:....00|
|00002e70| 34 30 3a 30 30 31 30 0d | 0a 0d 0a 4d 45 4d 4f 52 |40:0010.|...MEMOR|
|00002e80| 59 20 43 4f 4e 54 45 52 | 4e 53 3a 20 44 41 54 41 |Y CONTER|NS: DATA|
|00002e90| 20 41 4e 44 20 50 52 4f | 47 52 41 4d 53 0d 0a 0d | AND PRO|GRAMS...|
|00002ea0| 0a 54 68 65 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 |.The con|tents of|
|00002eb0| 20 6d 65 6d 6f 72 79 20 | 6d 61 79 20 62 65 20 62 | memory |may be b|
|00002ec0| 72 6f 6b 65 6e 20 64 6f | 77 6e 20 69 6e 74 6f 20 |roken do|wn into |
|00002ed0| 74 77 6f 20 62 72 6f 61 | 64 20 63 6c 61 73 73 65 |two broa|d classe|
|00002ee0| 73 2e 0d 0a 54 68 65 20 | 66 69 72 73 74 20 69 73 |s...The |first is|
|00002ef0| 20 2a 64 61 74 61 2a 2c | 20 6a 75 73 74 20 72 61 | *data*,| just ra|
|00002f00| 77 20 70 61 74 74 65 72 | 6e 73 20 6f 66 20 62 69 |w patter|ns of bi|
|00002f10| 74 73 20 66 6f 72 20 74 | 68 65 20 38 30 38 38 20 |ts for t|he 8088 |
|00002f20| 74 6f 0d 0a 77 6f 72 6b | 20 6f 6e 2e 20 20 54 68 |to..work| on. Th|
|00002f30| 65 20 73 69 67 6e 69 66 | 69 63 61 6e 63 65 20 6f |e signif|icance o|
|00002f40| 66 20 74 68 65 20 70 61 | 74 74 65 72 6e 73 20 69 |f the pa|tterns i|
|00002f50| 73 20 64 65 74 65 72 6d | 69 6e 65 64 20 62 79 20 |s determ|ined by |
|00002f60| 77 68 61 74 0d 0a 74 68 | 65 20 63 6f 6d 70 75 74 |what..th|e comput|
|00002f70| 65 72 20 69 73 20 62 65 | 69 6e 67 20 75 73 65 64 |er is be|ing used|
|00002f80| 20 66 6f 72 20 61 74 20 | 61 6e 79 20 67 69 76 65 | for at |any give|
|00002f90| 6e 20 74 69 6d 65 2e 0d | 0a 0d 0a 54 68 65 20 73 |n time..|...The s|
|00002fa0| 65 63 6f 6e 64 20 63 6c | 61 73 73 20 6f 66 20 6d |econd cl|ass of m|
|00002fb0| 65 6d 6f 72 79 20 63 6f | 6e 74 65 6e 74 73 20 61 |emory co|ntents a|
|00002fc0| 72 65 20 2a 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |re *inst|ructions|
|00002fd0| 2a 2e 20 20 54 68 65 20 | 38 30 38 38 0d 0a 63 61 |*. The |8088..ca|
|00002fe0| 6e 20 6c 6f 6f 6b 20 61 | 74 20 6d 65 6d 6f 72 79 |n look a|t memory|
|00002ff0| 20 61 6e 64 20 69 6e 74 | 65 72 70 72 65 74 20 61 | and int|erpret a|
|00003000| 20 70 61 74 74 65 72 6e | 20 69 74 20 73 65 65 73 | pattern| it sees|
|00003010| 20 74 68 65 72 65 20 61 | 73 0d 0a 73 70 65 63 69 | there a|s..speci|
|00003020| 66 79 69 6e 67 20 6f 6e | 65 20 6f 66 20 74 68 65 |fying on|e of the|
|00003030| 20 32 30 30 20 73 6f 6d | 65 20 66 75 6e 64 61 6d | 200 som|e fundam|
|00003040| 65 6e 74 61 6c 20 6f 70 | 65 72 61 74 69 6f 6e 73 |ental op|erations|
|00003050| 20 69 74 20 6b 6e 6f 77 | 73 20 68 6f 77 0d 0a 74 | it know|s how..t|
|00003060| 6f 20 64 6f 2e 20 20 54 | 68 69 73 20 6d 61 70 70 |o do. T|his mapp|
|00003070| 69 6e 67 20 6f 66 20 70 | 61 74 74 65 72 6e 73 20 |ing of p|atterns |
|00003080| 6f 6e 74 6f 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |onto ope|rations |
|00003090| 69 73 20 63 61 6c 6c 65 | 64 20 74 68 65 0d 0a 2a |is calle|d the..*|
|000030a0| 6d 61 63 68 69 6e 65 20 | 6c 61 6e 67 75 61 67 65 |machine |language|
|000030b0| 2a 20 6f 66 20 74 68 65 | 20 38 30 38 38 2e 20 20 |* of the| 8088. |
|000030c0| 41 20 6d 61 63 68 69 6e | 65 20 6c 61 6e 67 75 61 |A machin|e langua|
|000030d0| 67 65 20 2a 70 72 6f 67 | 72 61 6d 2a 0d 0a 63 6f |ge *prog|ram*..co|
|000030e0| 6e 73 69 73 74 73 20 6f | 66 20 61 20 73 65 72 69 |nsists o|f a seri|
|000030f0| 65 73 20 6f 66 20 70 61 | 74 74 65 72 6e 73 20 6c |es of pa|tterns l|
|00003100| 6f 63 61 74 65 64 20 69 | 6e 20 63 6f 6e 73 65 71 |ocated i|n conseq|
|00003110| 75 74 69 76 65 20 6d 65 | 6d 6f 72 79 0d 0a 6c 6f |utive me|mory..lo|
|00003120| 63 61 74 69 6f 6e 73 2c | 20 77 68 6f 73 65 20 63 |cations,| whose c|
|00003130| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 6f 70 65 |orrespon|ding ope|
|00003140| 72 61 74 69 6f 6e 73 20 | 70 65 72 66 6f 72 6d 20 |rations |perform |
|00003150| 73 6f 6d 65 20 75 73 65 | 66 75 6c 0d 0a 70 72 6f |some use|ful..pro|
|00003160| 63 65 73 73 2e 0d 0a 0d | 0a 4e 6f 74 65 20 74 68 |cess....|.Note th|
|00003170| 61 74 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 77 |at there| is no w|
|00003180| 61 79 20 66 6f 72 20 74 | 68 65 20 38 30 38 38 20 |ay for t|he 8088 |
|00003190| 74 6f 20 6b 6e 6f 77 20 | 77 68 65 74 68 65 72 20 |to know |whether |
|000031a0| 61 20 67 69 76 65 6e 0d | 0a 70 61 74 74 65 72 6e |a given.|.pattern|
|000031b0| 20 69 73 20 6d 65 61 6e | 74 20 74 6f 20 62 65 20 | is mean|t to be |
|000031c0| 61 6e 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 2c 20 |an instr|uction, |
|000031d0| 6f 72 20 61 20 70 69 65 | 63 65 20 6f 66 20 64 61 |or a pie|ce of da|
|000031e0| 74 61 20 74 6f 0d 0a 6f | 70 65 72 61 74 65 20 6f |ta to..o|perate o|
|000031f0| 6e 2e 20 20 49 74 20 69 | 73 20 71 75 69 74 65 20 |n. It i|s quite |
|00003200| 70 6f 73 73 69 62 6c 65 | 20 66 6f 72 20 74 68 65 |possible| for the|
|00003210| 20 63 68 69 70 20 74 6f | 20 61 63 63 69 64 65 6e | chip to| acciden|
|00003220| 74 61 6c 6c 79 0d 0a 62 | 65 67 69 6e 20 72 65 61 |tally..b|egin rea|
|00003230| 64 69 6e 67 20 77 68 61 | 74 20 77 61 73 20 69 6e |ding wha|t was in|
|00003240| 74 65 6e 64 65 64 20 74 | 6f 20 62 65 20 64 61 74 |tended t|o be dat|
|00003250| 61 2c 20 61 6e 64 20 69 | 6e 74 65 72 70 72 65 74 |a, and i|nterpret|
|00003260| 20 69 74 20 61 73 20 61 | 0d 0a 70 72 6f 67 72 61 | it as a|..progra|
|00003270| 6d 2e 20 20 53 6f 6d 65 | 20 70 72 65 74 74 79 20 |m. Some| pretty |
|00003280| 62 69 7a 61 72 72 65 20 | 74 68 69 6e 67 73 20 63 |bizarre |things c|
|00003290| 61 6e 20 6f 63 63 75 72 | 20 77 68 65 6e 20 74 68 |an occur| when th|
|000032a0| 69 73 20 68 61 70 70 65 | 6e 73 2e 0d 0a 49 6e 20 |is happe|ns...In |
|000032b0| 61 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |assembly| languag|
|000032c0| 65 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 63 69 |e progra|mming ci|
|000032d0| 72 63 6c 65 73 2c 20 74 | 68 69 73 20 69 73 20 6b |rcles, t|his is k|
|000032e0| 6e 6f 77 6e 20 61 73 0d | 0a 22 63 72 61 73 68 69 |nown as.|."crashi|
|000032f0| 6e 67 20 74 68 65 20 73 | 79 73 74 65 6d 22 2e 0d |ng the s|ystem"..|
|00003300| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00003310| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00003320| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00003330| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 20 20 20 |........|..... |
|00003340| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003370| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003380| 20 20 20 20 38 0d 0a 0d | 0a 54 48 45 20 44 41 57 | 8...|.THE DAW|
|00003390| 4e 20 4f 46 20 41 53 53 | 45 4d 42 4c 59 20 4c 41 |N OF ASS|EMBLY LA|
|000033a0| 4e 47 55 41 47 45 0d 0a | 0d 0a 55 6e 6c 65 73 73 |NGUAGE..|..Unless|
|000033b0| 20 79 6f 75 20 68 61 70 | 70 65 6e 20 74 6f 20 62 | you hap|pen to b|
|000033c0| 65 20 61 6e 20 38 30 38 | 38 20 63 68 69 70 2c 20 |e an 808|8 chip, |
|000033d0| 74 68 65 20 70 61 74 74 | 65 72 6e 73 20 77 68 69 |the patt|erns whi|
|000033e0| 63 68 20 6d 61 6b 65 20 | 75 70 0d 0a 61 20 6d 61 |ch make |up..a ma|
|000033f0| 63 68 69 6e 65 20 6c 61 | 6e 67 75 61 67 65 20 70 |chine la|nguage p|
|00003400| 72 6f 67 72 61 6d 20 63 | 61 6e 20 62 65 20 70 72 |rogram c|an be pr|
|00003410| 65 74 74 79 20 69 6e 63 | 6f 6d 70 72 65 68 65 6e |etty inc|omprehen|
|00003420| 73 69 62 6c 65 2e 20 20 | 46 6f 72 0d 0a 65 78 61 |sible. |For..exa|
|00003430| 6d 70 6c 65 2c 20 74 68 | 65 20 70 61 74 74 65 72 |mple, th|e patter|
|00003440| 6e 20 77 68 69 63 68 20 | 74 65 6c 6c 73 20 74 68 |n which |tells th|
|00003450| 65 20 38 30 38 38 20 74 | 6f 20 66 6c 69 70 20 61 |e 8088 t|o flip a|
|00003460| 6c 6c 20 74 68 65 20 62 | 69 74 73 20 69 6e 0d 0a |ll the b|its in..|
|00003470| 74 68 65 20 62 79 74 65 | 20 61 74 20 61 64 64 72 |the byte| at addr|
|00003480| 65 73 73 20 35 35 35 35 | 20 69 73 3a 0d 0a 0d 0a |ess 5555| is:....|
|00003490| 46 36 20 31 36 20 35 35 | 20 35 35 0d 0a 0d 0a 77 |F6 16 55| 55....w|
|000034a0| 68 69 63 68 20 69 73 20 | 6e 6f 74 20 76 65 72 79 |hich is |not very|
|000034b0| 20 69 6e 66 6f 72 6d 61 | 74 69 76 65 2c 20 61 6c | informa|tive, al|
|000034c0| 74 68 6f 75 67 68 20 79 | 6f 75 20 63 61 6e 20 73 |though y|ou can s|
|000034d0| 65 65 20 74 68 65 20 35 | 35 35 35 0d 0a 61 64 64 |ee the 5|555..add|
|000034e0| 72 65 73 73 20 69 6e 20 | 74 68 65 72 65 2e 20 20 |ress in |there. |
|000034f0| 49 6e 20 61 6e 63 69 65 | 6e 74 20 68 69 73 74 6f |In ancie|nt histo|
|00003500| 72 79 2c 20 74 68 65 20 | 6f 6c 64 20 77 6f 6f 64 |ry, the |old wood|
|00003510| 2d 62 75 72 6e 69 6e 67 | 20 61 6e 64 0d 0a 76 61 |-burning| and..va|
|00003520| 63 75 75 6d 20 74 75 62 | 65 20 63 6f 6d 70 75 74 |cuum tub|e comput|
|00003530| 65 72 73 20 77 65 72 65 | 20 70 72 6f 67 72 61 6d |ers were| program|
|00003540| 6d 65 64 20 62 79 20 6c | 61 62 6f 72 69 6f 75 73 |med by l|aborious|
|00003550| 6c 79 20 66 69 67 75 72 | 69 6e 67 20 6f 75 74 0d |ly figur|ing out.|
|00003560| 0a 62 69 74 20 70 61 74 | 74 65 72 6e 73 20 77 68 |.bit pat|terns wh|
|00003570| 69 63 68 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 |ich repr|esented |
|00003580| 74 68 65 20 73 65 72 69 | 65 73 20 6f 66 20 69 6e |the seri|es of in|
|00003590| 73 74 72 75 63 74 69 6f | 6e 73 0d 0a 64 65 73 69 |structio|ns..desi|
|000035a0| 72 65 64 2e 20 20 4e 65 | 65 64 6c 65 73 73 20 74 |red. Ne|edless t|
|000035b0| 6f 20 73 61 79 2c 20 74 | 68 69 73 20 74 65 63 68 |o say, t|his tech|
|000035c0| 6e 69 71 75 65 20 77 61 | 73 20 69 6e 63 72 65 64 |nique wa|s incred|
|000035d0| 69 62 6c 79 20 74 65 64 | 69 6f 75 73 2c 0d 0a 61 |ibly ted|ious,..a|
|000035e0| 6e 64 20 76 65 72 79 20 | 70 72 6f 6e 65 20 74 6f |nd very |prone to|
|000035f0| 20 6d 61 6b 69 6e 67 20 | 65 72 72 6f 72 73 2e 20 | making |errors. |
|00003600| 20 49 74 20 66 69 6e 61 | 6c 6c 79 20 6f 63 63 75 | It fina|lly occu|
|00003610| 72 65 64 20 74 6f 20 74 | 68 65 73 65 0d 0a 61 6e |red to t|hese..an|
|00003620| 63 65 73 74 72 61 6c 20 | 70 72 6f 67 72 61 6d 6d |cestral |programm|
|00003630| 65 72 73 20 74 68 61 74 | 20 74 68 65 79 20 63 6f |ers that| they co|
|00003640| 75 6c 64 20 67 69 76 65 | 20 74 68 65 20 74 61 73 |uld give| the tas|
|00003650| 6b 20 6f 66 20 66 69 67 | 75 72 69 6e 67 0d 0a 6f |k of fig|uring..o|
|00003660| 75 74 20 74 68 65 20 70 | 72 6f 70 65 72 20 70 61 |ut the p|roper pa|
|00003670| 74 74 65 72 6e 73 20 74 | 6f 20 74 68 65 20 63 6f |tterns t|o the co|
|00003680| 6d 70 75 74 65 72 20 69 | 74 73 65 6c 66 2c 20 61 |mputer i|tself, a|
|00003690| 6e 64 20 61 73 73 65 6d | 62 6c 79 0d 0a 6c 61 6e |nd assem|bly..lan|
|000036a0| 67 75 61 67 65 20 70 72 | 6f 67 72 61 6d 6d 69 6e |guage pr|ogrammin|
|000036b0| 67 20 77 61 73 20 62 6f | 72 6e 2e 0d 0a 0d 0a 41 |g was bo|rn.....A|
|000036c0| 73 73 65 6d 62 6c 79 20 | 6c 61 6e 67 75 61 67 65 |ssembly |language|
|000036d0| 20 72 65 70 72 65 73 65 | 6e 74 73 20 65 61 63 68 | represe|nts each|
|000036e0| 20 6f 66 20 74 68 65 20 | 6d 61 6e 79 20 6f 70 65 | of the |many ope|
|000036f0| 72 61 74 69 6f 6e 73 20 | 74 68 61 74 20 74 68 65 |rations |that the|
|00003700| 0d 0a 63 6f 6d 70 75 74 | 65 72 20 63 61 6e 20 64 |..comput|er can d|
|00003710| 6f 20 77 69 74 68 20 61 | 20 2a 6d 6e 65 6d 6f 6e |o with a| *mnemon|
|00003720| 69 63 2a 2c 20 61 20 73 | 68 6f 72 74 2c 20 65 61 |ic*, a s|hort, ea|
|00003730| 73 79 20 74 6f 20 72 65 | 6d 65 6d 62 65 72 0d 0a |sy to re|member..|
|00003740| 73 65 72 69 65 73 20 6f | 66 20 6c 65 74 74 65 72 |series o|f letter|
|00003750| 73 2e 20 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c |s. For |example,|
|00003760| 20 69 6e 20 62 6f 6f 6c | 65 61 6e 20 61 6c 67 65 | in bool|ean alge|
|00003770| 62 72 61 2c 20 74 68 65 | 20 6c 6f 67 69 63 61 6c |bra, the| logical|
|00003780| 0d 0a 6f 70 65 72 61 74 | 69 6f 6e 20 77 68 69 63 |..operat|ion whic|
|00003790| 68 20 69 6e 76 65 72 74 | 73 20 74 68 65 20 73 74 |h invert|s the st|
|000037a0| 61 74 65 20 6f 66 20 61 | 20 62 69 74 20 69 73 20 |ate of a| bit is |
|000037b0| 63 61 6c 6c 65 64 20 22 | 6e 6f 74 22 2c 20 61 6e |called "|not", an|
|000037c0| 64 0d 0a 68 65 6e 63 65 | 20 74 68 65 20 61 73 73 |d..hence| the ass|
|000037d0| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 65 |embly la|nguage e|
|000037e0| 71 75 69 76 61 6c 65 6e | 74 20 6f 66 20 74 68 65 |quivalen|t of the|
|000037f0| 20 70 72 65 63 65 64 69 | 6e 67 20 6d 61 63 68 69 | precedi|ng machi|
|00003800| 6e 65 0d 0a 6c 61 6e 67 | 75 61 67 65 20 70 61 74 |ne..lang|uage pat|
|00003810| 74 65 72 6e 20 69 73 3a | 0d 0a 0d 0a 20 20 20 20 |tern is:|.... |
|00003820| 4e 4f 54 42 20 5b 35 35 | 35 35 5d 0d 0a 0d 0a 54 |NOTB [55|55]....T|
|00003830| 68 65 20 62 72 61 63 6b | 65 74 73 20 61 72 6f 75 |he brack|ets arou|
|00003840| 6e 64 20 74 68 65 20 35 | 35 35 35 20 72 6f 75 67 |nd the 5|555 roug|
|00003850| 68 6c 79 20 6d 65 61 6e | 20 22 74 68 65 20 6d 65 |hly mean| "the me|
|00003860| 6d 6f 72 79 20 6c 6f 63 | 61 74 69 6f 6e 0d 0a 61 |mory loc|ation..a|
|00003870| 64 64 72 65 73 73 65 64 | 20 62 79 22 2e 20 20 54 |ddressed| by". T|
|00003880| 68 65 20 22 42 22 20 61 | 74 20 74 68 65 20 65 6e |he "B" a|t the en|
|00003890| 64 20 6f 66 20 22 4e 4f | 54 42 22 20 69 6e 64 69 |d of "NO|TB" indi|
|000038a0| 63 61 74 65 73 20 74 68 | 61 74 20 77 65 0d 0a 77 |cates th|at we..w|
|000038b0| 61 6e 74 20 74 6f 20 6f | 70 65 72 61 74 65 20 6f |ant to o|perate o|
|000038c0| 6e 20 61 20 62 79 74 65 | 20 6f 66 20 6d 65 6d 6f |n a byte| of memo|
|000038d0| 72 79 2c 20 6e 6f 74 20 | 61 20 77 6f 72 64 2e 0d |ry, not |a word..|
|000038e0| 0a 0d 0a 55 6e 66 6f 72 | 74 75 6e 61 74 65 6c 79 |...Unfor|tunately|
|000038f0| 2c 20 74 68 65 20 38 30 | 38 38 20 63 61 6e 27 74 |, the 80|88 can't|
|00003900| 20 6d 61 6b 65 20 68 65 | 61 64 20 6e 6f 72 20 74 | make he|ad nor t|
|00003910| 61 69 6c 20 6f 66 20 74 | 68 65 20 73 74 72 69 6e |ail of t|he strin|
|00003920| 67 20 6f 66 0d 0a 63 68 | 61 72 61 63 74 65 72 73 |g of..ch|aracters|
|00003930| 20 22 4e 4f 54 42 22 2e | 20 20 57 68 61 74 27 73 | "NOTB".| What's|
|00003940| 20 6e 65 65 64 65 64 20 | 69 73 20 61 20 73 70 65 | needed |is a spe|
|00003950| 63 69 61 6c 20 70 72 6f | 67 72 61 6d 20 74 6f 20 |cial pro|gram to |
|00003960| 72 75 6e 20 6f 6e 0d 0a | 74 68 65 20 38 30 38 38 |run on..|the 8088|
|00003970| 20 77 68 69 63 68 20 63 | 6f 6e 76 65 72 74 73 20 | which c|onverts |
|00003980| 74 68 65 20 73 74 72 69 | 6e 67 20 22 4e 4f 54 42 |the stri|ng "NOTB|
|00003990| 22 20 69 6e 74 6f 20 74 | 68 65 20 70 61 74 74 65 |" into t|he patte|
|000039a0| 72 6e 20 46 36 20 31 36 | 2e 0d 0a 54 68 69 73 20 |rn F6 16|...This |
|000039b0| 70 72 6f 67 72 61 6d 20 | 69 73 20 63 61 6c 6c 65 |program |is calle|
|000039c0| 64 20 61 6e 20 61 73 73 | 65 6d 62 6c 65 72 2e 20 |d an ass|embler. |
|000039d0| 20 41 20 67 6f 6f 64 20 | 61 6e 61 6c 6f 67 79 20 | A good |analogy |
|000039e0| 69 73 20 74 68 61 74 20 | 61 6e 0d 0a 61 73 73 65 |is that |an..asse|
|000039f0| 6d 62 6c 65 72 20 70 72 | 6f 67 72 61 6d 20 69 73 |mbler pr|ogram is|
|00003a00| 20 6c 69 6b 65 20 61 20 | 6d 65 61 74 20 67 72 69 | like a |meat gri|
|00003a10| 6e 64 65 72 20 77 68 69 | 63 68 20 74 61 6b 65 73 |nder whi|ch takes|
|00003a20| 20 69 6e 20 61 73 73 65 | 6d 62 6c 79 0d 0a 6c 61 | in asse|mbly..la|
|00003a30| 6e 67 75 61 67 65 20 61 | 6e 64 20 67 69 76 65 73 |nguage a|nd gives|
|00003a40| 20 6f 75 74 20 6d 61 63 | 68 69 6e 65 20 6c 61 6e | out mac|hine lan|
|00003a50| 67 75 61 67 65 2e 0d 0a | 0d 0a 54 79 70 69 63 61 |guage...|..Typica|
|00003a60| 6c 6c 79 2c 20 61 6e 20 | 61 73 73 65 6d 62 6c 65 |lly, an |assemble|
|00003a70| 72 20 72 65 61 64 73 20 | 61 20 66 69 6c 65 20 6f |r reads |a file o|
|00003a80| 66 20 61 73 73 65 6d 62 | 6c 79 20 6c 61 6e 67 75 |f assemb|ly langu|
|00003a90| 61 67 65 20 61 6e 64 0d | 0a 74 72 61 6e 73 6c 61 |age and.|.transla|
|00003aa0| 74 65 73 20 69 74 20 6f | 6e 65 20 6c 69 6e 65 20 |tes it o|ne line |
|00003ab0| 61 74 20 61 20 74 69 6d | 65 2c 20 6f 75 74 70 75 |at a tim|e, outpu|
|00003ac0| 74 69 6e 67 20 61 20 66 | 69 6c 65 20 6f 66 20 6d |ting a f|ile of m|
|00003ad0| 61 63 68 69 6e 65 0d 0a | 6c 61 6e 67 75 61 67 65 |achine..|language|
|00003ae0| 2e 20 20 4f 66 74 65 6e | 20 74 69 6d 65 73 20 74 |. Often| times t|
|00003af0| 68 65 20 69 6e 70 75 74 | 20 66 69 6c 65 20 69 73 |he input| file is|
|00003b00| 20 63 61 6c 6c 65 64 20 | 74 68 65 20 2a 73 6f 75 | called |the *sou|
|00003b10| 72 63 65 20 66 69 6c 65 | 2a 0d 0a 61 6e 64 20 74 |rce file|*..and t|
|00003b20| 68 65 20 6f 75 74 70 75 | 74 20 66 69 6c 65 20 69 |he outpu|t file i|
|00003b30| 73 20 63 61 6c 6c 65 64 | 20 74 68 65 20 2a 6f 62 |s called| the *ob|
|00003b40| 6a 65 63 74 20 66 69 6c | 65 2a 2e 20 20 54 68 65 |ject fil|e*. The|
|00003b50| 20 6d 61 63 68 69 6e 65 | 0d 0a 6c 61 6e 67 75 61 | machine|..langua|
|00003b60| 67 65 20 70 61 74 74 65 | 72 6e 73 20 70 72 6f 64 |ge patte|rns prod|
|00003b70| 75 63 65 64 20 61 72 65 | 20 63 61 6c 6c 65 64 20 |uced are| called |
|00003b80| 74 68 65 20 2a 6f 62 6a | 65 63 74 20 63 6f 64 65 |the *obj|ect code|
|00003b90| 2a 2e 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |*.......|........|
|00003ba0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00003bb0| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 20 20 20 20 |........|.... |
|00003bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003be0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003bf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c00| 20 20 20 39 0d 0a 0d 0a | 0d 0a 41 6c 73 6f 20 70 | 9....|..Also p|
|00003c10| 72 6f 64 75 63 65 64 20 | 64 75 72 69 6e 67 20 74 |roduced |during t|
|00003c20| 68 65 20 61 73 73 65 6d | 62 6c 79 20 70 72 6f 63 |he assem|bly proc|
|00003c30| 65 73 73 20 69 73 20 61 | 20 2a 6c 69 73 74 69 6e |ess is a| *listin|
|00003c40| 67 2a 2c 20 77 68 69 63 | 68 0d 0a 73 75 6d 6d 61 |g*, whic|h..summa|
|00003c50| 72 69 7a 65 73 20 74 68 | 65 20 72 65 73 75 6c 74 |rizes th|e result|
|00003c60| 73 20 6f 66 20 74 68 65 | 20 61 73 73 65 6d 62 6c |s of the| assembl|
|00003c70| 79 20 70 72 6f 63 65 73 | 73 2e 20 20 54 68 65 20 |y proces|s. The |
|00003c80| 6c 69 73 74 69 6e 67 0d | 0a 73 68 6f 77 73 20 65 |listing.|.shows e|
|00003c90| 61 63 68 20 6c 69 6e 65 | 20 66 72 6f 6d 20 74 68 |ach line| from th|
|00003ca0| 65 20 73 6f 75 72 63 65 | 20 66 69 6c 65 2c 20 61 |e source| file, a|
|00003cb0| 6c 6f 6e 67 20 77 69 74 | 68 20 74 68 65 20 73 68 |long wit|h the sh|
|00003cc0| 6f 72 74 68 61 6e 64 0d | 0a 22 6e 79 62 62 6c 65 |orthand.|."nybble|
|00003cd0| 20 63 6f 64 65 22 20 72 | 65 70 72 65 73 65 6e 74 | code" r|epresent|
|00003ce0| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 6f 62 6a |ation of| the obj|
|00003cf0| 65 63 74 20 63 6f 64 65 | 20 70 72 6f 64 75 63 65 |ect code| produce|
|00003d00| 64 2e 20 20 49 6e 20 74 | 68 65 0d 0a 65 76 65 6e |d. In t|he..even|
|00003d10| 74 20 74 68 61 74 20 74 | 68 65 20 61 73 73 65 6d |t that t|he assem|
|00003d20| 62 6c 65 72 20 77 61 73 | 20 75 6e 61 62 6c 65 20 |bler was| unable |
|00003d30| 74 6f 20 75 6e 64 65 72 | 73 74 61 6e 64 20 61 6e |to under|stand an|
|00003d40| 79 20 6f 66 20 74 68 65 | 20 73 6f 75 72 63 65 0d |y of the| source.|
|00003d50| 0a 6c 69 6e 65 73 2c 20 | 69 74 20 69 6e 73 65 72 |.lines, |it inser|
|00003d60| 74 73 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |ts error| message|
|00003d70| 73 20 69 6e 20 74 68 65 | 20 6c 69 73 74 69 6e 67 |s in the| listing|
|00003d80| 2c 20 70 6f 69 6e 74 69 | 6e 67 20 6f 75 74 20 74 |, pointi|ng out t|
|00003d90| 68 65 0d 0a 70 72 6f 62 | 6c 65 6d 2e 0d 0a 0d 0a |he..prob|lem.....|
|00003da0| 54 68 65 20 70 72 69 6d | 65 76 61 6c 20 61 73 73 |The prim|eval ass|
|00003db0| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 70 |embly la|nguage p|
|00003dc0| 72 6f 67 72 61 6d 6d 65 | 72 73 20 68 61 64 20 74 |rogramme|rs had t|
|00003dd0| 6f 20 77 72 69 74 65 20 | 74 68 65 69 72 0d 0a 61 |o write |their..a|
|00003de0| 73 73 65 6d 62 6c 65 72 | 20 70 72 6f 67 72 61 6d |ssembler| program|
|00003df0| 73 20 69 6e 20 6d 61 63 | 68 69 6e 65 20 6c 61 6e |s in mac|hine lan|
|00003e00| 67 75 61 67 65 2c 20 62 | 65 63 61 75 73 65 20 74 |guage, b|ecause t|
|00003e10| 68 65 79 20 68 61 64 20 | 6e 6f 20 6f 74 68 65 72 |hey had |no other|
|00003e20| 0d 0a 63 68 6f 69 63 65 | 2e 20 20 4e 6f 74 20 62 |..choice|. Not b|
|00003e30| 65 69 6e 67 20 61 20 6d | 61 73 6f 63 68 69 73 74 |eing a m|asochist|
|00003e40| 2c 20 49 20 77 72 6f 74 | 65 20 43 48 41 53 4d 20 |, I wrot|e CHASM |
|00003e50| 69 6e 20 42 41 53 49 43 | 2e 20 20 57 68 65 6e 20 |in BASIC|. When |
|00003e60| 79 6f 75 0d 0a 74 68 69 | 6e 6b 20 61 62 6f 75 74 |you..thi|nk about|
|00003e70| 20 69 74 2c 20 74 68 65 | 72 65 27 73 20 61 20 73 | it, the|re's a s|
|00003e80| 6f 72 74 20 6f 66 20 63 | 69 72 63 75 6c 61 72 20 |ort of c|ircular |
|00003e90| 6c 6f 67 69 63 20 69 6e | 20 61 63 74 69 6f 6e 20 |logic in| action |
|00003ea0| 68 65 72 65 2e 0d 0a 53 | 6f 6d 65 20 70 72 6f 67 |here...S|ome prog|
|00003eb0| 72 61 6d 6d 65 72 73 20 | 61 74 20 4d 69 63 72 6f |rammers |at Micro|
|00003ec0| 73 6f 66 74 20 77 72 6f | 74 65 20 74 68 65 20 42 |soft wro|te the B|
|00003ed0| 41 53 49 43 20 69 6e 74 | 65 72 70 72 65 74 65 72 |ASIC int|erpreter|
|00003ee0| 20 69 6e 0d 0a 61 73 73 | 65 6d 62 6c 79 20 6c 61 | in..ass|embly la|
|00003ef0| 6e 67 75 61 67 65 2c 20 | 61 6e 64 20 49 20 75 73 |nguage, |and I us|
|00003f00| 65 64 20 42 41 53 49 43 | 20 74 6f 20 77 72 69 74 |ed BASIC| to writ|
|00003f10| 65 20 61 6e 20 61 73 73 | 65 6d 62 6c 65 72 2e 0d |e an ass|embler..|
|00003f20| 0a 53 6f 6d 65 64 61 79 | 2c 20 49 20 68 6f 70 65 |.Someday|, I hope|
|00003f30| 20 74 6f 20 75 73 65 20 | 74 68 65 20 70 72 65 73 | to use |the pres|
|00003f40| 65 6e 74 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 43 |ent vers|ion of C|
|00003f50| 48 41 53 4d 20 74 6f 0d | 0a 70 72 6f 64 75 63 65 |HASM to.|.produce|
|00003f60| 20 61 20 6d 61 63 68 69 | 6e 65 20 6c 61 6e 67 75 | a machi|ne langu|
|00003f70| 61 67 65 20 76 65 72 73 | 69 6f 6e 2c 20 77 68 69 |age vers|ion, whi|
|00003f80| 63 68 20 77 69 6c 6c 20 | 72 75 6e 20 61 62 6f 75 |ch will |run abou|
|00003f90| 74 20 61 0d 0a 68 75 6e | 64 72 65 64 20 74 69 6d |t a..hun|dred tim|
|00003fa0| 65 73 20 66 61 73 74 65 | 72 2c 20 61 6e 64 20 61 |es faste|r, and a|
|00003fb0| 74 20 74 68 65 20 73 61 | 6d 65 20 74 69 6d 65 20 |t the sa|me time |
|00003fc0| 62 72 69 6e 67 20 74 68 | 69 73 20 63 72 61 7a 79 |bring th|is crazy|
|00003fd0| 0d 0a 70 72 6f 63 65 73 | 73 20 66 75 6c 6c 20 63 |..proces|s full c|
|00003fe0| 69 72 63 6c 65 2e 0d 0a | 0d 0a 54 48 45 20 38 30 |ircle...|..THE 80|
|00003ff0| 38 38 0d 0a 0d 0a 54 68 | 65 20 70 72 65 63 65 64 |88....Th|e preced|
|00004000| 69 6e 67 20 64 69 73 63 | 75 73 73 69 6f 6e 73 20 |ing disc|ussions |
|00004010| 68 61 76 65 20 28 49 20 | 68 6f 70 65 29 20 67 69 |have (I |hope) gi|
|00004020| 76 65 6e 20 79 6f 75 20 | 73 6f 6d 65 20 76 65 72 |ven you |some ver|
|00004030| 79 0d 0a 67 65 6e 65 72 | 61 6c 20 62 61 63 6b 67 |y..gener|al backg|
|00004040| 72 6f 75 6e 64 2c 20 61 | 20 77 6f 72 6c 64 20 76 |round, a| world v|
|00004050| 69 65 77 20 69 66 20 79 | 6f 75 20 77 69 6c 6c 2c |iew if y|ou will,|
|00004060| 20 61 62 6f 75 74 20 61 | 73 73 65 6d 62 6c 79 20 | about a|ssembly |
|00004070| 61 6e 64 0d 0a 6d 61 63 | 68 69 6e 65 20 6c 61 6e |and..mac|hine lan|
|00004080| 67 75 61 67 65 20 70 72 | 6f 67 72 61 6d 6d 69 6e |guage pr|ogrammin|
|00004090| 67 2e 20 20 41 74 20 74 | 68 69 73 20 70 6f 69 6e |g. At t|his poin|
|000040a0| 74 2c 20 49 27 64 20 6c | 69 6b 65 20 74 6f 20 67 |t, I'd l|ike to g|
|000040b0| 65 74 0d 0a 69 6e 74 6f | 20 61 20 6c 69 74 74 6c |et..into| a littl|
|000040c0| 65 20 6d 6f 72 65 20 64 | 65 74 61 69 6c 2c 20 62 |e more d|etail, b|
|000040d0| 65 67 69 6e 6e 69 6e 67 | 20 62 79 20 65 78 61 6d |eginning| by exam|
|000040e0| 69 6e 69 6e 67 20 74 68 | 65 20 69 6e 74 65 72 6e |ining th|e intern|
|000040f0| 61 6c 0d 0a 73 74 72 75 | 63 74 75 72 65 20 6f 66 |al..stru|cture of|
|00004100| 20 74 68 65 20 38 30 38 | 38 20 6d 69 63 72 6f 70 | the 808|8 microp|
|00004110| 72 6f 63 65 73 73 6f 72 | 2c 20 66 72 6f 6d 20 74 |rocessor|, from t|
|00004120| 68 65 20 70 72 6f 67 72 | 61 6d 6d 65 72 27 73 20 |he progr|ammer's |
|00004130| 70 6f 69 6e 74 0d 0a 6f | 66 20 76 69 65 77 2e 20 |point..o|f view. |
|00004140| 20 54 68 69 73 20 64 69 | 73 63 75 73 73 69 6f 6e | This di|scussion|
|00004150| 20 69 73 20 61 20 63 6f | 6e 64 65 6e 73 61 74 69 | is a co|ndensati|
|00004160| 6f 6e 20 6f 66 20 69 6e | 66 6f 72 6d 61 74 69 6f |on of in|formatio|
|00004170| 6e 20 77 68 69 63 68 0d | 0a 49 20 6f 62 74 61 69 |n which.|.I obtai|
|00004180| 6e 65 64 20 66 72 6f 6d | 20 22 54 68 65 20 38 30 |ned from| "The 80|
|00004190| 38 36 20 42 6f 6f 6b 22 | 20 77 68 69 63 68 20 77 |86 Book"| which w|
|000041a0| 61 73 20 77 72 69 74 74 | 65 6e 20 62 79 20 52 75 |as writt|en by Ru|
|000041b0| 73 73 65 6c 6c 0d 0a 52 | 65 63 74 6f 72 20 61 6e |ssell..R|ector an|
|000041c0| 64 20 47 65 6f 72 67 65 | 20 41 6c 65 78 79 2c 20 |d George| Alexy, |
|000041d0| 61 6e 64 20 70 75 62 6c | 69 73 68 65 64 20 62 79 |and publ|ished by|
|000041e0| 20 4f 73 62 6f 72 6e 65 | 2f 4d 63 47 72 61 77 2d | Osborne|/McGraw-|
|000041f0| 48 69 6c 6c 2e 0d 0a 4f | 6e 63 65 20 79 6f 75 27 |Hill...O|nce you'|
|00004200| 76 65 20 64 69 67 65 73 | 74 65 64 20 74 68 69 73 |ve diges|ted this|
|00004210| 2c 20 49 27 64 20 72 65 | 63 6f 6d 65 6e 64 20 67 |, I'd re|comend g|
|00004220| 6f 69 6e 67 20 74 6f 20 | 54 68 65 20 38 30 38 36 |oing to |The 8086|
|00004230| 20 42 6f 6f 6b 0d 0a 66 | 6f 72 20 61 20 64 65 65 | Book..f|or a dee|
|00004240| 70 65 72 20 74 72 65 61 | 74 6d 65 6e 74 2e 20 20 |per trea|tment. |
|00004250| 54 6f 20 75 73 65 20 74 | 68 65 20 43 48 41 53 4d |To use t|he CHASM|
|00004260| 20 61 73 73 65 6d 62 6c | 65 72 2c 20 79 6f 75 27 | assembl|er, you'|
|00004270| 72 65 20 67 6f 69 6e 67 | 0d 0a 74 6f 20 6e 65 65 |re going|..to nee|
|00004280| 64 20 54 68 65 20 38 30 | 38 36 20 42 6f 6f 6b 20 |d The 80|86 Book |
|00004290| 61 6e 79 77 61 79 2c 20 | 74 6f 20 74 65 6c 6c 20 |anyway, |to tell |
|000042a0| 79 6f 75 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |you the |differen|
|000042b0| 74 20 38 30 38 38 0d 0a | 69 6e 73 74 72 75 63 74 |t 8088..|instruct|
|000042c0| 69 6f 6e 73 20 61 6e 64 | 20 74 68 65 69 72 20 6d |ions and| their m|
|000042d0| 6e 65 6d 6f 6e 69 63 73 | 2e 0d 0a 0d 0a 49 6e 73 |nemonics|.....Ins|
|000042e0| 69 64 65 20 74 68 65 20 | 38 30 38 38 20 61 72 65 |ide the |8088 are|
|000042f0| 20 61 20 6e 75 6d 62 65 | 72 20 6f 66 20 2a 72 65 | a numbe|r of *re|
|00004300| 67 69 73 74 65 72 73 2a | 20 65 61 63 68 20 6f 66 |gisters*| each of|
|00004310| 20 77 68 69 63 68 20 63 | 61 6e 0d 0a 68 6f 6c 64 | which c|an..hold|
|00004320| 20 61 20 31 36 20 62 69 | 74 20 70 61 74 74 65 72 | a 16 bi|t patter|
|00004330| 6e 2e 20 20 49 6e 20 61 | 73 73 65 6d 62 6c 79 20 |n. In a|ssembly |
|00004340| 6c 61 6e 67 75 61 67 65 | 2c 20 65 61 63 68 20 6f |language|, each o|
|00004350| 66 20 74 68 65 0d 0a 72 | 65 67 69 73 74 65 72 73 |f the..r|egisters|
|00004360| 20 68 61 73 20 61 20 74 | 77 6f 20 6c 65 74 74 65 | has a t|wo lette|
|00004370| 72 20 6d 6e 65 6d 6f 6e | 69 63 20 6e 61 6d 65 2e |r mnemon|ic name.|
|00004380| 20 20 54 68 65 72 65 20 | 61 72 65 20 31 34 0d 0a | There |are 14..|
|00004390| 72 65 67 69 73 74 65 72 | 73 2c 20 61 6e 64 20 74 |register|s, and t|
|000043a0| 68 65 69 72 20 6d 6e 65 | 6d 6f 6e 69 63 73 20 61 |heir mne|monics a|
|000043b0| 72 65 3a 0d 0a 0d 0a 41 | 58 20 42 58 20 43 58 20 |re:....A|X BX CX |
|000043c0| 44 58 20 20 20 20 20 53 | 50 20 42 50 20 20 20 20 |DX S|P BP |
|000043d0| 53 49 20 44 49 20 20 20 | 20 20 43 53 20 44 53 20 |SI DI | CS DS |
|000043e0| 53 53 20 45 53 20 20 20 | 20 50 43 20 53 54 0d 0a |SS ES | PC ST..|
|000043f0| 0d 0a 45 61 63 68 20 6f | 66 20 74 68 65 20 72 65 |..Each o|f the re|
|00004400| 67 69 73 74 65 72 73 20 | 61 72 65 20 61 20 6c 69 |gisters |are a li|
|00004410| 74 74 6c 65 20 64 69 66 | 66 65 72 65 6e 74 20 61 |ttle dif|ferent a|
|00004420| 6e 64 20 68 61 76 65 20 | 64 69 66 66 65 72 65 6e |nd have |differen|
|00004430| 74 0d 0a 69 6e 74 65 6e | 64 65 64 20 75 73 65 73 |t..inten|ded uses|
|00004440| 2c 20 62 75 74 20 74 68 | 65 79 20 63 61 6e 20 62 |, but th|ey can b|
|00004450| 65 20 67 72 6f 75 70 65 | 64 20 69 6e 74 6f 20 73 |e groupe|d into s|
|00004460| 6f 6d 65 20 62 72 6f 61 | 64 20 63 6c 61 73 73 65 |ome broa|d classe|
|00004470| 73 2e 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |s.......|........|
|00004480| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 0d 0a |........|........|
|00004490| 0d 0a 0d 0a 0d 0a 0d 0a | 0d 0a 0d 0a 20 20 20 20 |........|.... |
|000044a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000044e0| 20 20 20 31 30 0d 0a 0d | 0a 0d 0a 54 68 65 20 2a | 10...|...The *|
|000044f0| 67 65 6e 65 72 61 6c 20 | 70 75 72 70 6f 73 65 2a |general |purpose*|
|00004500| 20 72 65 67 69 73 74 65 | 72 73 20 28 41 58 20 42 | registe|rs (AX B|
|00004510| 58 20 43 58 20 44 58 29 | 20 61 72 65 20 6a 75 73 |X CX DX)| are jus|
|00004520| 74 20 74 68 61 74 2e 0d | 0a 54 68 65 73 65 20 61 |t that..|.These a|
|00004530| 72 65 20 72 65 67 69 73 | 74 65 72 73 20 77 68 69 |re regis|ters whi|
|00004540| 63 68 20 68 6f 6c 64 20 | 70 61 74 74 65 72 6e 73 |ch hold |patterns|
|00004550| 20 70 75 6c 6c 65 64 20 | 69 6e 20 66 72 6f 6d 20 | pulled |in from |
|00004560| 6d 65 6d 6f 72 79 0d 0a | 77 68 69 63 68 20 61 72 |memory..|which ar|
|00004570| 65 20 74 6f 20 62 65 20 | 77 6f 72 6b 65 64 20 6f |e to be |worked o|
|00004580| 6e 20 77 69 74 68 69 6e | 20 74 68 65 20 38 30 38 |n within| the 808|
|00004590| 38 2e 20 20 59 6f 75 20 | 63 61 6e 20 75 73 65 20 |8. You |can use |
|000045a0| 74 68 65 73 65 0d 0a 72 | 65 67 69 73 74 65 72 73 |these..r|egisters|
|000045b0| 20 66 6f 72 20 6a 75 73 | 74 20 61 62 6f 75 74 20 | for jus|t about |
|000045c0| 61 6e 79 74 68 69 6e 67 | 20 79 6f 75 20 77 61 6e |anything| you wan|
|000045d0| 74 2e 0d 0a 0d 0a 45 61 | 63 68 20 6f 66 20 74 68 |t.....Ea|ch of th|
|000045e0| 65 20 67 65 6e 65 72 61 | 6c 20 70 75 72 70 6f 73 |e genera|l purpos|
|000045f0| 65 20 72 65 67 69 73 74 | 65 72 73 20 63 61 6e 20 |e regist|ers can |
|00004600| 62 65 20 62 72 6f 6b 65 | 6e 20 64 6f 77 6e 20 69 |be broke|n down i|
|00004610| 6e 74 6f 20 74 77 6f 0d | 0a 38 20 62 69 74 20 72 |nto two.|.8 bit r|
|00004620| 65 67 69 73 74 65 72 73 | 2c 20 77 68 69 63 68 20 |egisters|, which |
|00004630| 68 61 76 65 20 6e 61 6d | 65 73 20 6f 66 20 74 68 |have nam|es of th|
|00004640| 65 69 72 20 6f 77 6e 2e | 20 20 54 68 75 73 2c 20 |eir own.| Thus, |
|00004650| 74 68 65 20 43 58 0d 0a | 72 65 67 69 73 74 65 72 |the CX..|register|
|00004660| 20 69 73 20 62 72 6f 6b | 65 6e 20 64 6f 77 6e 20 | is brok|en down |
|00004670| 69 6e 74 6f 20 74 68 65 | 20 43 48 20 61 6e 64 20 |into the| CH and |
|00004680| 43 4c 20 72 65 67 69 73 | 74 65 72 73 2e 20 20 54 |CL regis|ters. T|
|00004690| 68 65 20 22 48 22 0d 0a | 61 6e 64 20 22 4c 22 20 |he "H"..|and "L" |
|000046a0| 73 74 61 6e 64 20 66 6f | 72 20 68 69 67 68 20 61 |stand fo|r high a|
|000046b0| 6e 64 20 6c 6f 77 20 72 | 65 73 70 65 63 74 69 76 |nd low r|espectiv|
|000046c0| 65 6c 79 2e 20 20 45 61 | 63 68 20 67 65 6e 65 72 |ely. Ea|ch gener|
|000046d0| 61 6c 0d 0a 70 75 72 70 | 6f 73 65 20 72 65 67 69 |al..purp|ose regi|
|000046e0| 73 74 65 72 20 62 72 65 | 61 6b 73 20 64 6f 77 6e |ster bre|aks down|
|000046f0| 20 69 6e 74 6f 20 61 20 | 68 69 67 68 2f 6c 6f 77 | into a |high/low|
|00004700| 20 70 61 69 72 2e 0d 0a | 0d 0a 54 68 65 20 41 58 | pair...|..The AX|
|00004710| 20 72 65 67 69 73 74 65 | 72 2c 20 61 6e 64 20 69 | registe|r, and i|
|00004720| 74 27 73 20 38 20 62 69 | 74 20 6c 6f 77 20 68 61 |t's 8 bi|t low ha|
|00004730| 6c 66 2c 20 74 68 65 20 | 41 4c 20 72 65 67 69 73 |lf, the |AL regis|
|00004740| 74 65 72 2c 20 61 72 65 | 0d 0a 73 6f 6d 65 77 68 |ter, are|..somewh|
|00004750| 61 74 20 73 70 65 63 69 | 61 6c 2e 20 20 4d 61 69 |at speci|al. Mai|
|00004760| 6e 6c 79 20 66 6f 72 20 | 68 69 73 74 6f 72 69 63 |nly for |historic|
|00004770| 61 6c 20 72 65 61 73 6f | 6e 73 2c 20 74 68 65 73 |al reaso|ns, thes|
|00004780| 65 20 72 65 67 69 73 74 | 65 72 73 0d 0a 61 72 65 |e regist|ers..are|
|00004790| 20 72 65 66 65 72 72 65 | 64 20 74 6f 20 61 73 20 | referre|d to as |
|000047a0| 74 68 65 20 31 36 20 62 | 69 74 20 61 6e 64 20 38 |the 16 b|it and 8|
|000047b0| 20 62 69 74 20 2a 61 63 | 63 75 6d 75 6c 61 74 6f | bit *ac|cumulato|
|000047c0| 72 73 2a 2e 20 20 53 6f | 6d 65 0d 0a 6f 70 65 72 |rs*. So|me..oper|
|000047d0| 61 74 69 6f 6e 73 20 6f | 66 20 74 68 65 20 38 30 |ations o|f the 80|
|000047e0| 38 38 20 63 61 6e 20 6f | 6e 6c 79 20 62 65 20 63 |88 can o|nly be c|
|000047f0| 61 72 72 69 65 64 20 6f | 75 74 20 6f 6e 20 74 68 |arried o|ut on th|
|00004800| 65 20 63 6f 6e 74 65 6e | 74 73 20 6f 66 0d 0a 74 |e conten|ts of..t|
|00004810| 68 65 20 61 63 63 75 6d | 75 6c 61 74 6f 72 73 2c |he accum|ulators,|
|00004820| 20 61 6e 64 20 6d 61 6e | 79 20 6f 74 68 65 72 73 | and man|y others|
|00004830| 20 61 72 65 20 66 61 73 | 74 65 72 20 77 68 65 6e | are fas|ter when|
|00004840| 20 75 73 65 64 20 69 6e | 0d 0a 63 6f 6e 6a 75 6e | used in|..conjun|
|00004850| 63 74 69 6f 6e 20 77 69 | 74 68 20 74 68 65 73 65 |ction wi|th these|
|00004860| 20 72 65 67 69 73 74 65 | 72 73 2e 0d 0a 0d 0a 41 | registe|rs.....A|
|00004870| 6e 6f 74 68 65 72 20 67 | 72 6f 75 70 20 6f 66 20 |nother g|roup of |
|00004880| 72 65 67 69 73 74 65 72 | 73 20 61 72 65 20 74 68 |register|s are th|
|00004890| 65 20 2a 73 65 67 6d 65 | 6e 74 2a 20 72 65 67 69 |e *segme|nt* regi|
|000048a0| 73 74 65 72 73 20 28 43 | 53 20 44 53 20 53 53 0d |sters (C|S DS SS.|
|000048b0| 0a 45 53 29 2e 20 20 54 | 68 65 73 65 20 72 65 67 |.ES). T|hese reg|
|000048c0| 69 73 74 65 72 73 20 68 | 6f 6c 64 20 73 65 67 6d |isters h|old segm|
|000048d0| 65 6e 74 20 76 61 6c 75 | 65 73 20 66 6f 72 20 75 |ent valu|es for u|
|000048e0| 73 65 20 69 6e 20 63 61 | 6c 63 75 6c 61 74 69 6e |se in ca|lculatin|
|000048f0| 67 0d 0a 6d 65 6d 6f 72 | 79 20 61 64 64 72 65 73 |g..memor|y addres|
|00004900| 73 65 73 2e 20 20 54 68 | 65 20 43 53 2c 20 6f 72 |ses. Th|e CS, or|
|00004910| 20 63 6f 64 65 20 73 65 | 67 6d 65 6e 74 20 72 65 | code se|gment re|
|00004920| 67 69 73 74 65 72 2c 20 | 69 73 20 75 73 65 64 0d |gister, |is used.|
|00004930| 0a 65 76 65 72 79 20 20 | 74 69 6d 65 20 74 68 65 |.every |time the|
|00004940| 20 38 30 38 38 20 61 63 | 63 65 73 73 65 73 20 6d | 8088 ac|cesses m|
|00004950| 65 6d 6f 72 79 20 74 6f | 20 72 65 61 64 20 61 6e |emory to| read an|
|00004960| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 0d 0a 70 61 | instruc|tion..pa|
|00004970| 74 74 65 72 6e 2e 20 20 | 54 68 65 20 20 44 53 2c |ttern. |The DS,|
|00004980| 20 6f 72 20 64 61 74 61 | 20 73 65 67 6d 65 6e 74 | or data| segment|
|00004990| 20 72 65 67 69 73 74 65 | 72 2c 20 69 73 20 75 73 | registe|r, is us|
|000049a0| 65 64 20 66 6f 72 20 62 | 72 69 6e 67 69 6e 67 0d |ed for b|ringing.|
|000049b0| 0a 64 61 74 61 20 70 61 | 74 74 65 72 6e 73 20 69 |.data pa|tterns i|
|000049c0| 6e 2e 20 20 54 68 65 20 | 53 53 20 72 65 67 69 73 |n. The |SS regis|
|000049d0| 74 65 72 20 69 73 20 75 | 73 65 64 20 74 6f 20 61 |ter is u|sed to a|
|000049e0| 63 63 65 73 73 20 74 68 | 65 20 73 74 61 63 6b 0d |ccess th|e stack.|
|000049f0| 0a 28 6d 6f 72 65 20 61 | 62 6f 75 74 20 74 68 65 |.(more a|bout the|
|00004a00| 20 73 74 61 63 6b 20 6c | 61 74 65 72 29 2e 20 20 | stack l|ater). |
|00004a10| 54 68 65 20 45 53 20 69 | 73 20 74 68 65 20 65 78 |The ES i|s the ex|
|00004a20| 74 72 61 20 73 65 67 6d | 65 6e 74 0d 0a 72 65 67 |tra segm|ent..reg|
|00004a30| 69 73 74 65 72 2e 20 20 | 41 20 76 65 72 79 20 66 |ister. |A very f|
|00004a40| 65 77 20 73 70 65 63 69 | 61 6c 20 69 6e 73 74 72 |ew speci|al instr|
|00004a50| 75 63 74 69 6f 6e 73 20 | 75 73 65 20 74 68 65 20 |uctions |use the |
|00004a60| 45 53 20 72 65 67 69 73 | 74 65 72 20 74 6f 0d 0a |ES regis|ter to..|
|00004a70| 61 63 63 65 73 73 20 6d | 65 6d 6f 72 79 2c 20 70 |access m|emory, p|
|00004a80| 6c 75 73 20 79 6f 75 20 | 63 61 6e 20 6f 76 65 72 |lus you |can over|
|00004a90| 69 64 65 20 75 73 65 20 | 6f 66 20 74 68 65 20 44 |ide use |of the D|
|00004aa0| 53 20 72 65 67 69 73 74 | 65 72 20 61 6e 64 0d 0a |S regist|er and..|
|00004ab0| 73 75 62 73 74 69 74 75 | 74 65 20 74 68 65 20 45 |substitu|te the E|
|00004ac0| 53 20 72 65 67 69 73 74 | 65 72 2c 20 69 66 20 79 |S regist|er, if y|
|00004ad0| 6f 75 20 6e 65 65 64 20 | 74 6f 20 6d 61 69 6e 74 |ou need |to maint|
|00004ae0| 61 69 6e 20 74 77 6f 20 | 73 65 70 61 72 61 74 65 |ain two |separate|
|00004af0| 0d 0a 64 61 74 61 20 61 | 72 65 61 73 2e 0d 0a 0d |..data a|reas....|
|00004b00| 0a 54 68 65 20 2a 70 6f | 69 6e 74 65 72 2a 20 28 |.The *po|inter* (|
|00004b10| 53 50 20 42 50 29 20 61 | 6e 64 20 2a 69 6e 64 65 |SP BP) a|nd *inde|
|00004b20| 78 2a 20 28 44 49 20 53 | 49 29 20 72 65 67 69 73 |x* (DI S|I) regis|
|00004b30| 74 65 72 73 20 61 72 65 | 20 75 73 65 64 20 74 6f |ters are| used to|
|00004b40| 0d 0a 70 72 6f 76 69 64 | 65 20 69 6e 64 69 72 65 |..provid|e indire|
|00004b50| 63 74 20 61 64 64 72 65 | 73 73 69 6e 67 2c 20 77 |ct addre|ssing, w|
|00004b60| 68 69 63 68 20 69 73 20 | 61 6e 20 76 65 72 79 20 |hich is |an very |
|00004b70| 70 6f 77 65 72 66 75 6c | 20 74 65 63 68 6e 69 71 |powerful| techniq|
|00004b80| 75 65 0d 0a 66 6f 72 20 | 61 63 63 65 73 73 69 6e |ue..for |accessin|
|00004b90| 67 20 6d 65 6d 6f 72 79 | 2e 20 20 49 6e 64 69 72 |g memory|. Indir|
|00004ba0| 65 63 74 20 61 64 64 72 | 65 73 73 69 6e 67 20 69 |ect addr|essing i|
|00004bb0| 73 20 62 65 79 6f 6e 64 | 20 74 68 65 20 73 63 6f |s beyond| the sco|
|00004bc0| 70 65 20 6f 66 0d 0a 74 | 68 69 73 20 6c 69 74 74 |pe of..t|his litt|
|00004bd0| 6c 65 20 70 72 69 6d 65 | 72 2c 20 62 75 74 20 69 |le prime|r, but i|
|00004be0| 73 20 64 69 73 63 75 73 | 73 65 64 20 69 6e 20 54 |s discus|sed in T|
|00004bf0| 68 65 20 38 30 38 36 20 | 42 6f 6f 6b 2e 20 20 54 |he 8086 |Book. T|
|00004c00| 68 65 20 53 50 0d 0a 72 | 65 67 69 73 74 65 72 20 |he SP..r|egister |
|00004c10| 69 73 20 75 73 65 64 20 | 74 6f 20 69 6d 70 6c 65 |is used |to imple|
|00004c20| 6d 65 6e 74 20 61 20 73 | 74 61 63 6b 20 69 6e 20 |ment a s|tack in |
|00004c30| 6d 65 6d 6f 72 79 2e 20 | 28 61 67 61 69 6e 2c 20 |memory. |(again, |
|00004c40| 6d 6f 72 65 0d 0a 61 62 | 6f 75 74 20 74 68 65 20 |more..ab|out the |
|00004c50| 73 74 61 63 6b 20 6c 61 | 74 65 72 29 20 20 42 65 |stack la|ter) Be|
|00004c60| 73 69 64 65 73 20 74 68 | 65 69 72 20 73 70 65 63 |sides th|eir spec|
|00004c70| 69 61 6c 20 66 75 6e 63 | 74 69 6f 6e 2c 20 74 68 |ial func|tion, th|
|00004c80| 65 20 42 50 2c 0d 0a 44 | 49 20 61 6e 64 20 53 49 |e BP,..D|I and SI|
|00004c90| 20 72 65 67 69 73 74 65 | 72 73 20 63 61 6e 20 62 | registe|rs can b|
|00004ca0| 65 20 75 73 65 64 20 61 | 73 20 61 64 64 69 74 69 |e used a|s additi|
|00004cb0| 6f 6e 61 6c 20 67 65 6e | 65 72 61 6c 20 70 75 72 |onal gen|eral pur|
|00004cc0| 70 6f 73 65 0d 0a 72 65 | 67 69 73 74 65 72 73 2e |pose..re|gisters.|
|00004cd0| 20 20 41 6c 74 68 6f 75 | 67 68 20 69 74 27 73 20 | Althou|gh it's |
|00004ce0| 70 68 79 73 69 63 61 6c | 6c 79 20 70 6f 73 73 69 |physical|ly possi|
|00004cf0| 62 6c 65 20 74 6f 20 64 | 69 72 65 63 74 6c 79 0d |ble to d|irectly.|
|00004d00| 0a 6d 61 6e 69 70 75 6c | 61 74 65 20 74 68 65 20 |.manipul|ate the |
|00004d10| 76 61 6c 75 65 20 69 6e | 20 74 68 65 20 53 50 20 |value in| the SP |
|00004d20| 72 65 67 69 73 74 65 72 | 2c 20 69 74 27 73 20 62 |register|, it's b|
|00004d30| 65 73 74 20 74 6f 20 6c | 65 61 76 65 20 69 74 0d |est to l|eave it.|
|00004d40| 0a 61 6c 6f 6e 65 2c 20 | 73 69 6e 63 65 20 79 6f |.alone, |since yo|
|00004d50| 75 20 63 6f 75 6c 64 20 | 77 69 70 65 20 6f 75 74 |u could |wipe out|
|00004d60| 20 74 68 65 20 73 74 61 | 63 6b 2e 0d 0a 0d 0a 46 | the sta|ck.....F|
|00004d70| 69 6e 61 6c 6c 79 2c 20 | 74 68 65 72 65 20 61 72 |inally, |there ar|
|00004d80| 65 20 74 77 6f 20 72 65 | 67 69 73 74 65 72 73 20 |e two re|gisters |
|00004d90| 77 68 69 63 68 20 61 72 | 65 20 72 65 6c 61 74 69 |which ar|e relati|
|00004da0| 76 65 6c 79 0d 0a 69 6e | 61 63 63 65 73 73 61 62 |vely..in|accessab|
|00004db0| 6c 65 20 74 6f 20 64 69 | 72 65 63 74 20 6d 61 6e |le to di|rect man|
|00004dc0| 69 70 75 6c 61 74 69 6f | 6e 2e 20 20 54 68 65 20 |ipulatio|n. The |
|00004dd0| 66 69 72 73 74 20 69 73 | 20 74 68 65 20 2a 70 72 |first is| the *pr|
|00004de0| 6f 67 72 61 6d 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |ogram...|........|
|00004df0| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00004e00| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 20 |........|....... |
|00004e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004e30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004e50| 20 20 20 20 20 20 31 31 | 0d 0a 0d 0a 63 6f 75 6e | 11|....coun|
|00004e60| 74 65 72 2a 2c 20 50 43 | 2e 20 20 54 68 69 73 20 |ter*, PC|. This |
|00004e70| 72 65 67 69 73 74 65 72 | 20 61 6c 77 61 79 73 20 |register| always |
|00004e80| 63 6f 6e 74 61 69 6e 73 | 20 74 68 65 20 6f 66 66 |contains| the off|
|00004e90| 73 65 74 20 70 61 72 74 | 20 6f 66 0d 0a 74 68 65 |set part| of..the|
|00004ea0| 20 61 64 64 72 65 73 73 | 20 6f 66 20 74 68 65 20 | address| of the |
|00004eb0| 6e 65 78 74 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |next ins|truction|
|00004ec0| 20 74 6f 20 62 65 20 65 | 78 65 63 75 74 65 64 2e | to be e|xecuted.|
|00004ed0| 20 20 41 6c 74 68 6f 75 | 67 68 0d 0a 79 6f 75 27 | Althou|gh..you'|
|00004ee0| 72 65 20 6e 6f 74 20 61 | 6c 6c 6f 77 65 64 20 74 |re not a|llowed t|
|00004ef0| 6f 20 6a 75 73 74 20 6d | 6f 76 65 20 76 61 6c 75 |o just m|ove valu|
|00004f00| 65 73 20 69 6e 74 6f 20 | 74 68 69 73 20 72 65 67 |es into |this reg|
|00004f10| 69 73 74 65 72 2c 20 79 | 6f 75 0d 0a 2a 63 61 6e |ister, y|ou..*can|
|00004f20| 2a 20 69 6e 64 69 72 65 | 63 74 6c 79 20 61 66 66 |* indire|ctly aff|
|00004f30| 65 63 74 20 69 74 27 73 | 20 63 6f 6e 74 65 6e 74 |ect it's| content|
|00004f40| 73 2c 20 61 6e 64 20 68 | 65 6e 63 65 20 74 68 65 |s, and h|ence the|
|00004f50| 20 6e 65 78 74 0d 0a 69 | 6e 73 74 72 75 63 74 69 | next..i|nstructi|
|00004f60| 6f 6e 20 74 6f 20 62 65 | 20 65 78 65 63 75 74 65 |on to be| execute|
|00004f70| 64 2c 20 75 73 69 6e 67 | 20 6f 70 65 72 61 74 69 |d, using| operati|
|00004f80| 6f 6e 73 20 77 68 69 63 | 68 20 61 72 65 20 65 71 |ons whic|h are eq|
|00004f90| 75 69 76 61 6c 65 6e 74 | 0d 0a 74 6f 20 42 41 53 |uivalent|..to BAS|
|00004fa0| 49 43 27 73 20 47 4f 54 | 4f 20 61 6e 64 20 47 4f |IC's GOT|O and GO|
|00004fb0| 53 55 42 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |SUB inst|ructions|
|00004fc0| 2e 20 20 4f 63 63 61 73 | 69 6f 6e 61 6c 6c 79 2c |. Occas|ionally,|
|00004fd0| 20 79 6f 75 20 77 69 6c | 6c 0d 0a 73 65 65 20 74 | you wil|l..see t|
|00004fe0| 68 65 20 50 43 20 72 65 | 66 65 72 72 65 64 20 74 |he PC re|ferred t|
|00004ff0| 6f 20 61 73 20 74 68 65 | 20 2a 49 50 2a 2c 20 77 |o as the| *IP*, w|
|00005000| 68 69 63 68 20 73 74 61 | 6e 64 73 20 66 6f 72 20 |hich sta|nds for |
|00005010| 69 6e 73 74 72 75 63 74 | 69 6f 6e 0d 0a 70 6f 69 |instruct|ion..poi|
|00005020| 6e 74 65 72 2e 0d 0a 0d | 0a 54 68 65 20 6c 61 73 |nter....|.The las|
|00005030| 74 20 72 65 67 69 73 74 | 65 72 20 69 73 20 61 6c |t regist|er is al|
|00005040| 73 6f 20 72 65 6c 61 74 | 69 76 65 6c 79 20 69 6e |so relat|ively in|
|00005050| 61 63 63 65 73 73 61 62 | 6c 65 2e 20 20 54 68 69 |accessab|le. Thi|
|00005060| 73 20 69 73 20 74 68 65 | 0d 0a 2a 73 74 61 74 75 |s is the|..*statu|
|00005070| 73 2a 20 72 65 67 69 73 | 74 65 72 2c 20 53 54 2e |s* regis|ter, ST.|
|00005080| 20 20 54 68 69 73 20 6f | 6e 65 20 68 61 73 20 61 | This o|ne has a|
|00005090| 20 2a 74 77 6f 2a 20 61 | 6c 74 65 72 6e 61 74 65 | *two* a|lternate|
|000050a0| 20 6e 61 6d 65 73 2c 20 | 73 6f 0d 0a 77 61 74 63 | names, |so..watc|
|000050b0| 68 20 66 6f 72 20 46 4c | 20 28 66 6c 61 67 20 72 |h for FL| (flag r|
|000050c0| 65 67 69 73 74 65 72 29 | 20 61 6e 64 20 50 53 57 |egister)| and PSW|
|000050d0| 20 28 70 72 6f 67 72 61 | 6d 20 73 74 61 74 75 73 | (progra|m status|
|000050e0| 20 77 6f 72 64 29 2e 20 | 20 54 68 65 0d 0a 6c 61 | word). | The..la|
|000050f0| 74 74 65 72 20 69 73 20 | 73 6f 6d 65 77 68 61 74 |tter is |somewhat|
|00005100| 20 73 74 65 65 70 65 64 | 20 69 6e 20 68 69 73 74 | steeped| in hist|
|00005110| 6f 72 79 2c 20 73 69 6e | 63 65 20 74 68 69 73 20 |ory, sin|ce this |
|00005120| 77 61 73 20 74 68 65 20 | 6e 61 6d 65 0d 0a 67 69 |was the |name..gi|
|00005130| 76 65 6e 20 74 6f 20 61 | 20 73 70 65 63 69 61 6c |ven to a| special|
|00005140| 20 6c 6f 63 61 74 69 6f | 6e 20 69 6e 20 6d 65 6d | locatio|n in mem|
|00005150| 6f 72 79 20 77 68 69 63 | 68 20 73 65 72 76 65 64 |ory whic|h served|
|00005160| 20 61 20 73 69 6d 69 6c | 61 72 0d 0a 66 75 6e 63 | a simil|ar..func|
|00005170| 74 69 6f 6e 20 6f 6e 20 | 74 68 65 20 61 6e 74 69 |tion on |the anti|
|00005180| 71 75 65 20 49 42 4d 20 | 33 36 30 20 6d 61 69 6e |que IBM |360 main|
|00005190| 66 72 61 6d 65 2e 0d 0a | 0d 0a 54 68 65 20 73 74 |frame...|..The st|
|000051a0| 61 74 75 73 20 72 65 67 | 69 73 74 65 72 20 63 6f |atus reg|ister co|
|000051b0| 6e 73 69 73 74 73 20 6f | 66 20 61 20 73 65 72 69 |nsists o|f a seri|
|000051c0| 65 73 20 6f 66 20 6f 6e | 65 20 62 69 74 20 2a 66 |es of on|e bit *f|
|000051d0| 6c 61 67 73 2a 20 77 68 | 69 63 68 0d 0a 63 61 6e |lags* wh|ich..can|
|000051e0| 20 61 66 66 65 63 74 20 | 68 6f 77 20 74 68 65 20 | affect |how the |
|000051f0| 38 30 38 38 20 77 6f 72 | 6b 73 2e 20 20 54 68 65 |8088 wor|ks. The|
|00005200| 72 65 20 61 72 65 20 73 | 70 65 63 69 61 6c 20 69 |re are s|pecial i|
|00005210| 6e 73 74 72 75 63 74 69 | 6f 6e 73 0d 0a 77 68 69 |nstructi|ons..whi|
|00005220| 63 68 20 61 6c 6c 6f 77 | 20 79 6f 75 20 74 6f 20 |ch allow| you to |
|00005230| 73 65 74 20 6f 72 20 63 | 6c 65 61 72 20 65 61 63 |set or c|lear eac|
|00005240| 68 20 6f 66 20 74 68 65 | 73 65 20 66 6c 61 67 73 |h of the|se flags|
|00005250| 2e 20 20 49 6e 0d 0a 61 | 64 64 69 74 69 6f 6e 2c |. In..a|ddition,|
|00005260| 20 6d 61 6e 79 20 69 6e | 73 74 72 75 63 74 69 6f | many in|structio|
|00005270| 6e 73 20 61 66 66 65 63 | 74 20 74 68 65 20 73 74 |ns affec|t the st|
|00005280| 61 74 65 20 6f 66 20 74 | 68 65 20 66 6c 61 67 73 |ate of t|he flags|
|00005290| 2c 0d 0a 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |,..depen|ding on |
|000052a0| 74 68 65 20 6f 75 74 63 | 6f 6d 65 20 6f 66 20 74 |the outc|ome of t|
|000052b0| 68 65 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 2e 20 |he instr|uction. |
|000052c0| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 6f 6e | For exa|mple, on|
|000052d0| 65 20 6f 66 0d 0a 74 68 | 65 20 62 69 74 73 20 6f |e of..th|e bits o|
|000052e0| 66 20 74 68 65 20 73 74 | 61 74 75 73 20 72 65 67 |f the st|atus reg|
|000052f0| 69 73 74 65 72 20 69 73 | 20 63 61 6c 6c 65 64 20 |ister is| called |
|00005300| 74 68 65 20 5a 65 72 6f | 20 66 6c 61 67 2e 20 20 |the Zero| flag. |
|00005310| 41 6e 79 0d 0a 6f 70 65 | 72 61 74 69 6f 6e 20 77 |Any..ope|ration w|
|00005320| 68 69 63 68 20 65 6e 64 | 73 20 75 70 20 67 65 6e |hich end|s up gen|
|00005330| 65 72 61 74 69 6e 67 20 | 61 20 62 69 74 20 70 61 |erating |a bit pa|
|00005340| 74 74 65 72 6e 20 6f 66 | 20 61 6c 6c 20 30 27 73 |ttern of| all 0's|
|00005350| 0d 0a 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 |..automa|tically |
|00005360| 73 65 74 73 20 74 68 65 | 20 5a 65 72 6f 20 66 6c |sets the| Zero fl|
|00005370| 61 67 20 6f 6e 2e 0d 0a | 0d 0a 53 65 74 74 69 6e |ag on...|..Settin|
|00005380| 67 20 74 68 65 20 66 6c | 61 67 73 20 64 6f 65 73 |g the fl|ags does|
|00005390| 6e 27 74 20 73 65 65 6d | 20 74 6f 20 64 6f 20 6d |n't seem| to do m|
|000053a0| 75 63 68 2c 20 75 6e 74 | 69 6c 20 79 6f 75 20 6b |uch, unt|il you k|
|000053b0| 6e 6f 77 20 74 68 61 74 | 0d 0a 74 68 65 72 65 20 |now that|..there |
|000053c0| 61 20 77 68 6f 6c 65 20 | 73 65 74 20 6f 66 20 63 |a whole |set of c|
|000053d0| 6f 6e 64 69 74 69 6f 6e | 61 6c 20 62 72 61 6e 63 |ondition|al branc|
|000053e0| 68 69 6e 67 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |hing ins|truction|
|000053f0| 73 20 77 68 69 63 68 0d | 0a 63 61 75 73 65 20 74 |s which.|.cause t|
|00005400| 68 65 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |he equiv|alent to|
|00005410| 20 61 20 42 41 53 49 43 | 20 47 4f 54 4f 20 69 66 | a BASIC| GOTO if|
|00005420| 20 74 68 65 20 70 61 72 | 74 69 63 75 6c 61 72 20 | the par|ticular |
|00005430| e6 6d e3 67 0d 0a 70 61 | 74 74 65 72 6e 20 74 68 |.m.g..pa|ttern th|
|00005440| 65 79 20 6c 6f 6f 6b 20 | 66 6f 72 20 69 73 20 73 |ey look |for is s|
|00005450| 65 74 2e 20 20 49 6e 20 | 61 73 73 65 6d 62 6c 79 |et. In |assembly|
|00005460| 20 6c 61 6e 67 75 61 67 | 65 2c 20 74 68 65 20 6f | languag|e, the o|
|00005470| 6e 6c 79 20 77 61 79 0d | 0a 74 6f 20 6d 61 6b 65 |nly way.|.to make|
|00005480| 20 61 20 64 65 63 69 73 | 69 6f 6e 20 61 6e 64 20 | a decis|ion and |
|00005490| 62 72 61 6e 63 68 20 61 | 63 63 6f 72 64 69 6e 67 |branch a|ccording|
|000054a0| 6c 79 20 69 73 20 76 69 | 61 20 74 68 69 73 20 66 |ly is vi|a this f|
|000054b0| 6c 61 67 20 74 65 73 74 | 69 6e 67 0d 0a 6d 65 63 |lag test|ing..mec|
|000054c0| 68 61 6e 69 73 6d 2e 0d | 0a 0d 0a 41 6c 74 68 6f |hanism..|...Altho|
|000054d0| 75 67 68 20 73 6f 6d 65 | 20 69 6e 73 74 72 75 63 |ugh some| instruc|
|000054e0| 74 69 6f 6e 73 20 69 6d | 70 6c 69 63 69 74 6c 79 |tions im|plicitly|
|000054f0| 20 61 66 66 65 63 74 20 | 74 68 65 20 66 6c 61 67 | affect |the flag|
|00005500| 73 2c 20 74 68 65 72 65 | 20 61 72 65 0d 0a 61 20 |s, there| are..a |
|00005510| 73 65 72 69 65 73 20 6f | 66 20 69 6e 73 74 72 75 |series o|f instru|
|00005520| 63 74 69 6f 6e 73 20 77 | 68 6f 73 65 20 2a 6f 6e |ctions w|hose *on|
|00005530| 6c 79 2a 20 65 66 66 65 | 63 74 20 69 73 20 74 6f |ly* effe|ct is to|
|00005540| 20 73 65 74 20 74 68 65 | 20 66 6c 61 67 73 2c 0d | set the| flags,.|
|00005550| 0a 62 61 73 65 64 20 6f | 6e 20 73 6f 6d 65 20 74 |.based o|n some t|
|00005560| 65 73 74 20 6f 72 20 63 | 6f 6d 70 61 72 69 73 69 |est or c|omparisi|
|00005570| 6f 6e 2e 20 20 49 74 27 | 73 20 76 65 72 79 20 63 |on. It'|s very c|
|00005580| 6f 6d 6d 6f 6e 20 74 6f | 20 73 65 65 20 6f 6e 65 |ommon to| see one|
|00005590| 0d 0a 6f 66 20 74 68 65 | 73 65 20 63 6f 6d 70 61 |..of the|se compa|
|000055a0| 72 69 73 69 6f 6e 20 6f | 70 65 72 61 74 69 6f 6e |rision o|peration|
|000055b0| 73 20 75 73 65 64 20 74 | 6f 20 73 65 74 20 74 68 |s used t|o set th|
|000055c0| 65 20 66 6c 61 67 73 20 | 6a 75 73 74 20 62 65 66 |e flags |just bef|
|000055d0| 6f 72 65 0d 0a 61 20 63 | 6f 6e 64 69 74 69 6f 6e |ore..a c|ondition|
|000055e0| 61 6c 20 62 72 61 6e 63 | 68 2e 20 20 54 61 6b 65 |al branc|h. Take|
|000055f0| 6e 20 74 6f 67 65 74 68 | 65 72 2c 20 74 68 65 20 |n togeth|er, the |
|00005600| 74 77 6f 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |two inst|ructions|
|00005610| 20 61 72 65 0d 0a 65 78 | 61 63 74 6c 79 20 65 71 | are..ex|actly eq|
|00005620| 75 69 76 61 6c 65 6e 74 | 20 74 6f 20 42 41 53 49 |uivalent| to BASI|
|00005630| 43 27 73 3a 0d 0a 0d 0a | 49 46 20 28 63 6f 6d 70 |C's:....|IF (comp|
|00005640| 61 72 69 73 69 6f 6e 29 | 20 54 48 45 4e 20 47 4f |arision)| THEN GO|
|00005650| 54 4f 20 28 6c 69 6e 65 | 6e 75 6d 62 65 72 29 0d |TO (line|number).|
|00005660| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00005670| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00005680| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00005690| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000056a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000056b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000056c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000056d0| 20 20 20 20 20 20 20 20 | 31 32 0d 0a 0d 0a 0d 0a | |12......|
|000056e0| 41 53 53 45 4d 42 4c 59 | 20 4c 41 4e 47 55 41 47 |ASSEMBLY| LANGUAG|
|000056f0| 45 20 53 59 4e 54 41 58 | 0d 0a 0d 0a 49 6e 20 67 |E SYNTAX|....In g|
|00005700| 65 6e 65 72 61 6c 2c 20 | 65 61 63 68 20 6c 69 6e |eneral, |each lin|
|00005710| 65 20 6f 66 20 61 6e 20 | 61 73 73 65 6d 62 6c 79 |e of an |assembly|
|00005720| 20 6c 61 6e 67 75 61 67 | 65 20 70 72 6f 67 72 61 | languag|e progra|
|00005730| 6d 20 74 72 61 6e 73 6c | 61 74 65 73 0d 0a 74 6f |m transl|ates..to|
|00005740| 20 61 20 73 65 74 20 6f | 66 20 70 61 74 74 65 72 | a set o|f patter|
|00005750| 6e 73 20 77 68 69 63 68 | 20 73 70 65 63 69 66 79 |ns which| specify|
|00005760| 20 6f 6e 65 20 66 75 6e | 64 61 6d 65 6e 74 61 6c | one fun|damental|
|00005770| 20 6f 70 65 72 61 74 69 | 6f 6e 20 66 6f 72 0d 0a | operati|on for..|
|00005780| 74 68 65 20 38 30 38 38 | 20 74 6f 20 63 61 72 72 |the 8088| to carr|
|00005790| 79 20 6f 75 74 2e 0d 0a | 0d 0a 45 61 63 68 20 6c |y out...|..Each l|
|000057a0| 69 6e 65 20 6d 61 79 20 | 63 6f 6e 73 69 73 74 20 |ine may |consist |
|000057b0| 6f 66 20 6f 6e 65 20 6f | 72 20 6d 6f 72 65 20 6f |of one o|r more o|
|000057c0| 66 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |f the fo|llowing |
|000057d0| 70 61 72 74 73 3a 0d 0a | 0d 0a 46 69 72 73 74 2c |parts:..|..First,|
|000057e0| 20 61 20 6c 61 62 65 6c | 2c 20 77 68 69 63 68 20 | a label|, which |
|000057f0| 69 73 20 6a 75 73 74 20 | 61 20 6d 61 72 6b 65 72 |is just |a marker|
|00005800| 20 66 6f 72 20 74 68 65 | 20 61 73 73 65 6d 62 6c | for the| assembl|
|00005810| 65 72 20 74 6f 20 75 73 | 65 2e 0d 0a 49 66 20 79 |er to us|e...If y|
|00005820| 6f 75 20 77 61 6e 74 20 | 74 6f 20 62 72 61 6e 63 |ou want |to branc|
|00005830| 68 20 74 6f 20 61 6e 20 | 69 6e 73 74 72 75 63 74 |h to an |instruct|
|00005840| 69 6f 6e 20 66 72 6f 6d | 20 73 6f 6d 65 20 6f 74 |ion from| some ot|
|00005850| 68 65 72 20 70 61 72 74 | 20 6f 66 0d 0a 74 68 65 |her part| of..the|
|00005860| 20 70 72 6f 67 72 61 6d | 2c 20 79 6f 75 20 70 75 | program|, you pu|
|00005870| 74 20 61 20 6c 61 62 65 | 6c 20 6f 6e 20 74 68 65 |t a labe|l on the|
|00005880| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 2e 20 20 57 | instruc|tion. W|
|00005890| 68 65 6e 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 0d |hen you |want to.|
|000058a0| 0a 62 72 61 6e 63 68 2c | 20 79 6f 75 20 72 65 66 |.branch,| you ref|
|000058b0| 65 72 20 74 6f 20 74 68 | 65 20 6c 61 62 65 6c 2e |er to th|e label.|
|000058c0| 20 20 49 6e 20 67 65 6e | 65 72 61 6c 2c 20 74 68 | In gen|eral, th|
|000058d0| 65 20 6c 61 62 65 6c 20 | 63 61 6e 20 62 65 20 61 |e label |can be a|
|000058e0| 6e 79 0d 0a 73 74 72 69 | 6e 67 20 6f 66 20 63 68 |ny..stri|ng of ch|
|000058f0| 61 72 61 63 74 65 72 73 | 20 79 6f 75 20 77 61 6e |aracters| you wan|
|00005900| 74 2e 20 20 41 20 67 6f | 6f 64 20 70 72 61 63 74 |t. A go|od pract|
|00005910| 69 63 65 20 69 73 20 74 | 6f 20 75 73 65 20 61 20 |ice is t|o use a |
|00005920| 6e 61 6d 65 0d 0a 77 68 | 69 63 68 20 72 65 6d 69 |name..wh|ich remi|
|00005930| 6e 64 73 20 79 6f 75 20 | 77 68 61 74 20 74 68 61 |nds you |what tha|
|00005940| 74 20 70 61 72 74 69 63 | 75 6c 61 72 20 70 61 72 |t partic|ular par|
|00005950| 74 20 6f 66 20 74 68 65 | 20 70 72 6f 67 72 61 6d |t of the| program|
|00005960| 20 64 6f 65 73 2e 0d 0a | 43 48 41 53 4d 20 77 69 | does...|CHASM wi|
|00005970| 6c 6c 20 61 73 73 75 6d | 65 20 74 68 61 74 20 61 |ll assum|e that a|
|00005980| 6e 79 20 73 74 72 69 6e | 67 20 6f 66 20 63 68 61 |ny strin|g of cha|
|00005990| 72 61 63 74 65 72 73 20 | 77 68 69 63 68 20 73 74 |racters |which st|
|000059a0| 61 72 74 73 20 69 6e 0d | 0a 74 68 65 20 66 69 72 |arts in.|.the fir|
|000059b0| 73 74 20 63 6f 6c 75 6d | 6e 20 6f 66 20 61 20 6c |st colum|n of a l|
|000059c0| 69 6e 65 20 69 73 20 69 | 6e 74 65 6e 64 65 64 20 |ine is i|ntended |
|000059d0| 74 6f 20 62 65 20 61 20 | 6c 61 62 65 6c 2e 0d 0a |to be a |label...|
|000059e0| 0d 0a 41 66 74 65 72 20 | 74 68 65 20 6c 61 62 65 |..After |the labe|
|000059f0| 6c 2c 20 6f 72 20 69 66 | 20 74 68 65 20 74 65 78 |l, or if| the tex|
|00005a00| 74 20 6f 66 20 74 68 65 | 20 6c 69 6e 65 20 73 74 |t of the| line st|
|00005a10| 61 72 74 73 20 74 6f 20 | 74 68 65 20 72 69 67 68 |arts to |the righ|
|00005a20| 74 0d 0a 6f 66 20 74 68 | 65 20 66 69 72 73 74 20 |t..of th|e first |
|00005a30| 63 6f 6c 75 6d 6e 2c 20 | 61 74 20 74 68 65 20 62 |column, |at the b|
|00005a40| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 74 68 65 20 |eginning| of the |
|00005a50| 74 65 78 74 2c 20 63 6f | 6d 65 73 20 61 6e 0d 0a |text, co|mes an..|
|00005a60| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 6d 6e 65 6d |instruct|ion mnem|
|00005a70| 6f 6e 69 63 2e 20 20 54 | 68 69 73 20 73 70 65 63 |onic. T|his spec|
|00005a80| 69 66 69 65 73 20 74 68 | 65 20 6f 70 65 72 61 74 |ifies th|e operat|
|00005a90| 69 6f 6e 20 74 68 61 74 | 20 74 68 65 20 6c 69 6e |ion that| the lin|
|00005aa0| 65 0d 0a 69 73 20 61 73 | 6b 69 6e 67 20 66 6f 72 |e..is as|king for|
|00005ab0| 2e 20 20 46 6f 72 20 61 | 20 6c 69 73 74 20 6f 66 |. For a| list of|
|00005ac0| 20 74 68 65 20 32 30 30 | 2d 6f 64 64 20 6d 6e 65 | the 200|-odd mne|
|00005ad0| 6d 6f 6e 69 63 73 2c 20 | 61 6c 6f 6e 67 20 77 69 |monics, |along wi|
|00005ae0| 74 68 0d 0a 74 68 65 20 | 69 6e 73 74 72 75 63 74 |th..the |instruct|
|00005af0| 69 6f 6e 73 20 74 68 65 | 79 20 73 74 61 6e 64 20 |ions the|y stand |
|00005b00| 66 6f 72 2c 20 73 65 65 | 20 54 68 65 20 38 30 38 |for, see| The 808|
|00005b10| 36 20 42 6f 6f 6b 2e 0d | 0a 0d 0a 4d 6f 73 74 20 |6 Book..|...Most |
|00005b20| 6f 66 20 74 68 65 20 38 | 30 38 38 20 69 6e 73 74 |of the 8|088 inst|
|00005b30| 72 75 63 74 69 6f 6e 73 | 20 72 65 71 75 69 72 65 |ructions| require|
|00005b40| 20 74 68 61 74 20 79 6f | 75 20 73 70 65 63 69 66 | that yo|u specif|
|00005b50| 79 20 6f 6e 65 20 6f 72 | 0d 0a 6d 6f 72 65 20 2a |y one or|..more *|
|00005b60| 6f 70 65 72 61 6e 64 73 | 2a 2e 20 20 54 68 65 20 |operands|*. The |
|00005b70| 6f 70 65 72 61 6e 64 73 | 20 61 72 65 20 77 68 61 |operands| are wha|
|00005b80| 74 20 74 68 65 20 6f 70 | 65 72 61 74 69 6f 6e 20 |t the op|eration |
|00005b90| 69 73 20 74 6f 20 77 6f | 72 6b 0d 0a 6f 6e 2c 20 |is to wo|rk..on, |
|00005ba0| 61 6e 64 20 61 72 65 20 | 6c 69 73 74 65 64 20 61 |and are |listed a|
|00005bb0| 66 74 65 72 20 74 68 65 | 20 69 6e 73 74 72 75 63 |fter the| instruc|
|00005bc0| 74 69 6f 6e 20 6d 6e 65 | 6d 6f 6e 69 63 2e 0d 0a |tion mne|monic...|
|00005bd0| 0d 0a 54 68 65 72 65 20 | 61 72 65 20 61 20 6e 75 |..There |are a nu|
|00005be0| 6d 62 65 72 20 6f 66 20 | 70 6f 73 73 69 62 6c 65 |mber of |possible|
|00005bf0| 20 6f 70 65 72 61 6e 64 | 73 2e 20 20 50 72 6f 62 | operand|s. Prob|
|00005c00| 61 62 6c 79 20 74 68 65 | 20 6d 6f 73 74 20 63 6f |ably the| most co|
|00005c10| 6d 6d 6f 6e 0d 0a 61 72 | 65 20 72 65 67 69 73 74 |mmon..ar|e regist|
|00005c20| 65 72 73 2c 20 73 70 65 | 63 69 66 69 65 64 20 62 |ers, spe|cified b|
|00005c30| 79 20 74 68 65 69 72 20 | 74 77 6f 20 6c 65 74 74 |y their |two lett|
|00005c40| 65 72 20 6d 6e 65 6d 6f | 6e 69 63 73 2e 0d 0a 0d |er mnemo|nics....|
|00005c50| 0a 41 6e 6f 74 68 65 72 | 20 6f 70 65 72 61 6e 64 |.Another| operand|
|00005c60| 20 74 79 70 65 20 69 73 | 20 2a 69 6d 6d 65 64 69 | type is| *immedi|
|00005c70| 61 74 65 20 64 61 74 61 | 2a 2c 20 61 20 70 61 74 |ate data|*, a pat|
|00005c80| 74 65 72 6e 20 6f 66 20 | 62 69 74 73 20 74 6f 20 |tern of |bits to |
|00005c90| 62 65 0d 0a 70 75 74 20 | 73 6f 6d 65 77 68 65 72 |be..put |somewher|
|00005ca0| 65 20 6f 72 20 63 6f 6d | 70 61 72 65 64 20 6f 72 |e or com|pared or|
|00005cb0| 20 63 6f 6d 62 69 6e 65 | 64 20 77 69 74 68 20 73 | combine|d with s|
|00005cc0| 6f 6d 65 20 6f 74 68 65 | 72 20 70 61 74 74 65 72 |ome othe|r patter|
|00005cd0| 6e 2e 0d 0a 47 65 6e 65 | 72 61 6c 6c 79 20 69 6d |n...Gene|rally im|
|00005ce0| 6d 65 64 69 61 74 65 20 | 64 61 74 61 20 69 73 20 |mediate |data is |
|00005cf0| 73 70 65 63 69 66 69 65 | 64 20 62 79 20 69 74 27 |specifie|d by it'|
|00005d00| 73 20 6e 79 62 62 6c 65 | 20 63 6f 64 65 0d 0a 72 |s nybble| code..r|
|00005d10| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 2c 20 6d |epresent|ation, m|
|00005d20| 61 72 6b 65 64 20 61 73 | 20 73 75 63 68 20 62 79 |arked as| such by|
|00005d30| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 69 74 20 77 69 | followi|ng it wi|
|00005d40| 74 68 20 74 68 65 20 6c | 65 74 74 65 72 0d 0a 22 |th the l|etter.."|
|00005d50| 48 22 2e 20 20 53 6f 6d | 65 20 61 73 73 65 6d 62 |H". Som|e assemb|
|00005d60| 6c 65 72 73 20 61 6c 6c | 6f 77 20 61 6c 74 65 72 |lers all|ow alter|
|00005d70| 6e 61 74 65 20 77 61 79 | 73 20 74 6f 20 73 70 65 |nate way|s to spe|
|00005d80| 63 69 66 79 20 69 6d 6d | 65 64 69 61 74 65 0d 0a |cify imm|ediate..|
|00005d90| 64 61 74 61 20 77 68 69 | 63 68 20 65 6d 70 68 61 |data whi|ch empha|
|00005da0| 73 69 7a 65 20 74 68 65 | 20 70 61 74 74 65 72 6e |size the| pattern|
|00005db0| 27 73 20 69 6e 74 65 6e | 64 65 64 20 75 73 65 2e |'s inten|ded use.|
|00005dc0| 20 20 43 48 41 53 4d 0d | 0a 72 65 63 6f 67 6e 69 | CHASM.|.recogni|
|00005dd0| 7a 65 73 20 66 69 76 65 | 20 64 69 66 66 65 72 65 |zes five| differe|
|00005de0| 6e 74 20 77 61 79 73 20 | 74 6f 20 72 65 70 72 65 |nt ways |to repre|
|00005df0| 73 65 6e 74 20 69 6d 6d | 65 64 69 61 74 65 20 64 |sent imm|ediate d|
|00005e00| 61 74 61 2e 0d 0a 0d 0a | 41 20 6d 65 6d 6f 72 79 |ata.....|A memory|
|00005e10| 20 6c 6f 63 61 74 69 6f | 6e 20 63 61 6e 20 62 65 | locatio|n can be|
|00005e20| 20 75 73 65 64 20 61 73 | 20 61 6e 20 6f 70 65 72 | used as| an oper|
|00005e30| 61 6e 64 2e 20 20 57 65 | 27 76 65 20 73 65 65 6e |and. We|'ve seen|
|00005e40| 20 6f 6e 65 20 77 61 79 | 0d 0a 74 6f 20 64 6f 20 | one way|..to do |
|00005e50| 74 68 69 73 2c 20 62 79 | 20 65 6e 63 6c 6f 73 69 |this, by| enclosi|
|00005e60| 6e 67 20 69 74 27 73 20 | 61 64 64 72 65 73 73 20 |ng it's |address |
|00005e70| 69 6e 20 62 72 61 63 6b | 65 74 73 2e 20 20 28 59 |in brack|ets. (Y|
|00005e80| 6f 75 20 63 61 6e 20 6e | 6f 77 0d 0a 73 65 65 20 |ou can n|ow..see |
|00005e90| 77 68 79 20 74 68 65 20 | 62 72 61 63 6b 65 74 73 |why the |brackets|
|00005ea0| 20 61 72 65 20 6e 65 65 | 64 65 64 2e 20 20 57 69 | are nee|ded. Wi|
|00005eb0| 74 68 6f 75 74 20 74 68 | 65 6d 2c 20 79 6f 75 20 |thout th|em, you |
|00005ec0| 63 6f 75 6c 64 6e 27 74 | 0d 0a 64 69 73 74 69 6e |couldn't|..distin|
|00005ed0| 67 75 69 73 68 20 62 65 | 74 77 65 65 6e 20 61 6e |guish be|tween an|
|00005ee0| 20 61 64 64 72 65 73 73 | 20 61 6e 64 20 69 6d 6d | address| and imm|
|00005ef0| 65 64 69 61 74 65 20 64 | 61 74 61 2e 29 20 20 49 |ediate d|ata.) I|
|00005f00| 66 20 79 6f 75 27 76 65 | 0d 0a 61 73 6b 65 64 20 |f you've|..asked |
|00005f10| 74 68 65 20 61 73 73 65 | 6d 62 6c 65 72 20 74 6f |the asse|mbler to|
|00005f20| 20 73 65 74 20 61 73 69 | 64 65 20 61 20 73 65 63 | set asi|de a sec|
|00005f30| 74 69 6f 6e 20 6f 66 20 | 6d 65 6d 6f 72 79 20 66 |tion of |memory f|
|00005f40| 6f 72 20 64 61 74 61 0d | 0a 0d 0a 0d 0a 0d 0a 0d |or data.|........|
|00005f50| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00005f60| 0a 0d 0a 0d 0a 0d 0a 0d | 0a 0d 0a 0d 0a 0d 0a 0d |........|........|
|00005f70| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005f80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005fb0| 20 20 20 20 20 20 20 20 | 31 33 0d 0a 0d 0a 28 6d | |13....(m|
|00005fc0| 6f 72 65 20 6f 6e 20 74 | 68 69 73 20 6c 61 74 74 |ore on t|his latt|
|00005fd0| 65 72 29 2c 20 61 6e 64 | 20 70 75 74 20 61 20 6c |er), and| put a l|
|00005fe0| 61 62 65 6c 20 6f 6e 20 | 74 68 65 20 72 65 71 75 |abel on |the requ|
|00005ff0| 65 73 74 2c 20 79 6f 75 | 20 63 61 6e 0d 0a 73 70 |est, you| can..sp|
|00006000| 65 63 69 66 79 20 74 68 | 61 74 20 70 6f 69 6e 74 |ecify th|at point|
|00006010| 20 69 6e 20 6d 65 6d 6f | 72 79 20 62 79 20 75 73 | in memo|ry by us|
|00006020| 69 6e 67 20 74 68 65 20 | 6c 61 62 65 6c 2e 20 20 |ing the |label. |
|00006030| 46 69 6e 61 6c 6c 79 2c | 20 74 68 65 72 65 0d 0a |Finally,| there..|
|00006040| 61 72 65 20 61 20 6e 75 | 6d 62 65 72 20 6f 66 20 |are a nu|mber of |
|00006050| 69 6e 64 69 72 65 63 74 | 20 77 61 79 73 20 74 6f |indirect| ways to|
|00006060| 20 61 64 64 72 65 73 73 | 20 6d 65 6d 6f 72 79 20 | address| memory |
|00006070| 6c 6f 63 61 74 69 6f 6e | 73 2c 20 77 68 69 63 68 |location|s, which|
|00006080| 0d 0a 79 6f 75 20 63 61 | 6e 20 72 65 61 64 20 61 |..you ca|n read a|
|00006090| 62 6f 75 74 20 69 6e 20 | 54 68 65 20 38 30 38 36 |bout in |The 8086|
|000060a0| 20 42 6f 6f 6b 2e 0d 0a | 0d 0a 54 68 65 20 6c 61 | Book...|..The la|
|000060b0| 73 74 20 6d 61 6a 6f 72 | 20 74 79 70 65 20 6f 66 |st major| type of|
|000060c0| 20 6f 70 65 72 61 6e 64 | 73 20 61 72 65 20 6c 61 | operand|s are la|
|000060d0| 62 65 6c 73 2e 20 20 42 | 72 61 6e 63 68 69 6e 67 |bels. B|ranching|
|000060e0| 0d 0a 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 20 72 |..instru|ctions r|
|000060f0| 65 71 75 69 72 65 20 61 | 6e 20 6f 70 65 72 61 6e |equire a|n operan|
|00006100| 64 20 74 6f 20 74 65 6c | 6c 20 74 68 65 6d 20 77 |d to tel|l them w|
|00006110| 68 65 72 65 20 74 6f 20 | 62 72 61 6e 63 68 20 2a |here to |branch *|
|00006120| 74 6f 2a 2e 0d 0a 49 6e | 20 61 73 73 65 6d 62 6c |to*...In| assembl|
|00006130| 79 20 6c 61 6e 67 75 61 | 67 65 2c 20 79 6f 75 20 |y langua|ge, you |
|00006140| 73 70 65 63 69 66 79 20 | 6c 6f 63 61 74 69 6f 6e |specify |location|
|00006150| 73 20 77 68 69 63 68 20 | 6d 61 79 20 62 65 20 62 |s which |may be b|
|00006160| 72 61 6e 63 68 65 64 0d | 0a 74 6f 20 62 79 20 70 |ranched.|.to by p|
|00006170| 75 74 74 69 6e 67 20 61 | 20 6c 61 62 65 6c 20 6f |utting a| label o|
|00006180| 6e 20 74 68 65 6d 2e 20 | 20 59 6f 75 20 63 61 6e |n them. | You can|
|00006190| 20 74 68 65 6e 20 75 73 | 65 20 74 68 65 20 6c 61 | then us|e the la|
|000061a0| 62 65 6c 20 61 73 20 61 | 6e 0d 0a 6f 70 65 72 61 |bel as a|n..opera|
|000061b0| 6e 64 20 6f 6e 20 62 72 | 61 6e 63 68 65 73 2e 0d |nd on br|anches..|
|000061c0| 0a 0d 0a 4f 66 74 65 6e | 20 74 69 6d 65 73 2c 20 |...Often| times, |
|000061d0| 74 68 65 20 6f 72 64 65 | 72 20 69 6e 20 77 68 69 |the orde|r in whi|
|000061e0| 63 68 20 74 68 65 20 6f | 70 65 72 61 6e 64 73 20 |ch the o|perands |
|000061f0| 61 72 65 20 6c 69 73 74 | 65 64 20 63 61 6e 20 62 |are list|ed can b|
|00006200| 65 0d 0a 69 6d 70 6f 72 | 74 61 6e 74 2e 20 20 46 |e..impor|tant. F|
|00006210| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 20 77 68 65 6e |or examp|le, when|
|00006220| 20 6d 6f 76 69 6e 67 20 | 61 20 70 61 74 74 65 72 | moving |a patter|
|00006230| 6e 20 66 72 6f 6d 20 6f | 6e 65 20 70 6c 61 63 65 |n from o|ne place|
|00006240| 20 74 6f 0d 0a 61 6e 6f | 74 68 65 72 2c 20 79 6f | to..ano|ther, yo|
|00006250| 75 20 6e 65 65 64 20 74 | 6f 20 73 70 65 63 69 66 |u need t|o specif|
|00006260| 79 20 77 68 65 72 65 20 | 74 68 65 20 70 61 74 74 |y where |the patt|
|00006270| 65 72 6e 20 69 73 20 74 | 6f 20 63 6f 6d 65 20 66 |ern is t|o come f|
|00006280| 72 6f 6d 2c 0d 0a 61 6e | 64 20 77 68 65 72 65 20 |rom,..an|d where |
|00006290| 69 74 27 73 20 67 6f 69 | 6e 67 2e 20 20 54 68 65 |it's goi|ng. The|
|000062a0| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 20 69 6e 20 67 | convent|ion in g|
|000062b0| 65 6e 65 72 61 6c 20 75 | 73 65 20 69 73 20 74 68 |eneral u|se is th|
|000062c0| 61 74 20 74 68 65 0d 0a | 66 69 72 73 74 20 6f 70 |at the..|first op|
|000062d0| 65 72 61 6e 64 20 69 73 | 20 74 68 65 20 2a 64 65 |erand is| the *de|
|000062e0| 73 74 69 6e 61 74 69 6f | 6e 2a 20 61 6e 64 20 74 |stinatio|n* and t|
|000062f0| 68 65 20 73 65 63 6f 6e | 64 20 69 73 20 74 68 65 |he secon|d is the|
|00006300| 0d 0a 2a 73 6f 75 72 63 | 65 2a 2e 20 20 54 68 75 |..*sourc|e*. Thu|
|00006310| 73 2c 20 74 6f 20 6d 6f | 76 65 20 74 68 65 20 70 |s, to mo|ve the p|
|00006320| 61 74 74 65 72 6e 20 69 | 6e 20 74 68 65 20 44 58 |attern i|n the DX|
|00006330| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 6f 20 74 | registe|r into t|
|00006340| 68 65 0d 0a 41 58 20 72 | 65 67 69 73 74 65 72 2c |he..AX r|egister,|
|00006350| 20 79 6f 75 20 77 6f 75 | 6c 64 20 77 72 69 74 65 | you wou|ld write|
|00006360| 3a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 4d 4f 56 |:.... | MOV|
|00006370| 20 41 58 2c 44 58 0d 0a | 0d 0a 54 68 69 73 20 6d | AX,DX..|..This m|
|00006380| 61 79 20 74 61 6b 65 20 | 73 6f 6d 65 20 67 65 74 |ay take |some get|
|00006390| 74 69 6e 67 20 75 73 65 | 64 20 74 6f 2c 20 73 69 |ting use|d to, si|
|000063a0| 6e 63 65 20 77 68 65 6e | 20 72 65 61 64 69 6e 67 |nce when| reading|
|000063b0| 20 66 72 6f 6d 20 6c 65 | 66 74 0d 0a 74 6f 20 72 | from le|ft..to r|
|000063c0| 69 67 68 74 20 69 74 20 | 73 65 65 6d 73 20 72 65 |ight it |seems re|
|000063d0| 61 73 6f 6e 61 62 6c 65 | 20 74 6f 20 61 73 73 75 |asonable| to assu|
|000063e0| 6d 65 20 74 68 61 74 20 | 74 68 65 20 74 72 61 6e |me that |the tran|
|000063f0| 73 66 65 72 20 67 6f 65 | 73 20 69 6e 0d 0a 74 68 |sfer goe|s in..th|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.