home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / softcrc / libs / asmtutor.arj < prev    next >
ARJ Archive  |  1997-07-22  |  71.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: ASMTUTOR.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: 133, version 6, minimum version to extract: 1, slash-switched, compression method: stored, file type: comment header, original name: "ASMTUTOR.ARJ", original file date: 1988-08-03 03:30:36, compressed file size: 586582236, uncompressed file size: 0, os: MS-DOS default
100% xdgMime application/x-arj default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 60 ea 85 00 1e 06 01 00 | 10 00 02 dc dc 88 f6 22 |`.......|......."|
|00000010| dc 88 f6 22 00 00 00 00 | 00 00 00 00 00 00 00 00 |..."....|........|
|00000020| 00 00 41 53 4d 54 55 54 | 4f 52 2e 41 52 4a 00 0a |..ASMTUT|OR.ARJ..|
|00000030| 20 20 20 20 41 72 63 68 | 69 76 65 20 46 72 6f 6d | Arch|ive From|
|00000040| 0a 20 48 20 41 20 43 20 | 4b 20 45 20 52 27 73 20 |. H A C |K E R's |
|00000050| 20 20 43 20 44 0a 20 20 | 20 20 20 43 72 65 61 74 | C D. | Creat|
|00000060| 65 64 20 42 79 0a 20 20 | 57 68 69 74 65 20 45 61 |ed By. |White Ea|
|00000070| 67 6c 65 20 5b 52 43 44 | 5d 0a 20 20 20 20 20 20 |gle [RCD|]. |
|00000080| 20 20 31 39 39 37 0a 0a | 00 fe eb 4e c8 00 00 60 | 1997..|...N...`|
|00000090| ea 2c 00 1e 06 01 00 10 | 00 00 dc d2 b0 7c 0b 00 |.,......|.....|..|
|000000a0| 1c 01 00 00 1c 01 00 13 | 3a cb 9e 00 00 20 00 00 |........|:.... ..|
|000000b0| 00 41 53 4d 54 55 54 4f | 52 2e 54 58 54 00 00 f4 |.ASMTUTO|R.TXT...|
|000000c0| 8a d9 36 00 00 0c 0d 0a | 0a 0d 0a 0d 0a 0a 0a 20 |..6.....|....... |
|000000d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000000e0| 20 20 20 49 42 4d 20 50 | 65 72 73 6f 6e 61 6c 20 | IBM P|ersonal |
|000000f0| 43 6f 6d 70 75 74 65 72 | 20 41 73 73 65 6d 62 6c |Computer| Assembl|
|00000100| 79 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |y.. | |
|00000110| 20 20 20 20 20 20 20 20 | 20 20 20 20 4c 61 6e 67 | | Lang|
|00000120| 75 61 67 65 20 54 75 74 | 6f 72 69 61 6c 0d 0a 0d |uage Tut|orial...|
|00000130| 0a 0a 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00000140| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 4a 6f 73 | | Jos|
|00000150| 68 75 61 20 41 75 65 72 | 62 61 63 68 0d 0a 20 20 |hua Auer|bach.. |
|00000160| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000170| 20 20 20 20 20 20 20 20 | 59 61 6c 65 20 55 6e 69 | |Yale Uni|
|00000180| 76 65 72 73 69 74 79 0d | 0a 20 20 20 20 20 20 20 |versity.|. |
|00000190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000001a0| 20 59 61 6c 65 20 43 6f | 6d 70 75 74 65 72 20 43 | Yale Co|mputer C|
|000001b0| 65 6e 74 65 72 0d 0a 20 | 20 20 20 20 20 20 20 20 |enter.. | |
|000001c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000001d0| 31 37 35 20 57 68 69 74 | 6e 65 79 20 41 76 65 6e |175 Whit|ney Aven|
|000001e0| 75 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ue.. | |
|000001f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 50 | | P|
|00000200| 2e 20 4f 2e 20 42 6f 78 | 20 32 31 31 32 0d 0a 20 |. O. Box| 2112.. |
|00000210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000220| 20 20 20 20 4e 65 77 20 | 48 61 76 65 6e 2c 20 43 | New |Haven, C|
|00000230| 6f 6e 6e 65 63 74 69 63 | 75 74 20 30 36 35 32 30 |onnectic|ut 06520|
|00000240| 0d 0a 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00000250| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 6e 73 74 | | Inst|
|00000260| 61 6c 6c 61 74 69 6f 6e | 20 43 6f 64 65 20 59 55 |allation| Code YU|
|00000270| 0d 0a 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|00000280| 20 20 20 20 49 6e 74 65 | 67 72 61 74 65 64 20 50 | Inte|grated P|
|00000290| 65 72 73 6f 6e 61 6c 20 | 43 6f 6d 70 75 74 65 72 |ersonal |Computer|
|000002a0| 73 20 50 72 6f 6a 65 63 | 74 0d 0a 20 20 20 20 20 |s Projec|t.. |
|000002b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002c0| 20 20 20 43 6f 6d 6d 75 | 6e 69 63 61 74 69 6f 6e | Commu|nication|
|000002d0| 73 20 47 72 6f 75 70 0d | 0a 20 20 20 20 20 20 20 |s Group.|. |
|000002e0| 20 20 20 20 20 20 20 20 | 20 20 43 6f 6d 6d 75 6e | | Commun|
|000002f0| 69 63 61 74 69 6f 6e 73 | 20 61 6e 64 20 44 61 74 |ications| and Dat|
|00000300| 61 20 42 61 73 65 20 44 | 69 76 69 73 69 6f 6e 0d |a Base D|ivision.|
|00000310| 0a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 53 65 | | Se|
|00000330| 73 73 69 6f 6e 20 43 33 | 31 36 0d 0a 0d 0a 0a 0a |ssion C3|16......|
|00000340| 0d 0a 54 68 69 73 20 74 | 61 6c 6b 20 69 73 20 66 |..This t|alk is f|
|00000350| 6f 72 20 70 65 6f 70 6c | 65 20 77 68 6f 20 61 72 |or peopl|e who ar|
|00000360| 65 20 6a 75 73 74 20 67 | 65 74 74 69 6e 67 20 73 |e just g|etting s|
|00000370| 74 61 72 74 65 64 20 77 | 69 74 68 20 74 68 65 20 |tarted w|ith the |
|00000380| 50 43 20 4d 41 43 52 4f | 0d 0a 41 73 73 65 6d 62 |PC MACRO|..Assemb|
|00000390| 6c 65 72 2e 20 20 4d 61 | 79 62 65 20 79 6f 75 20 |ler. Ma|ybe you |
|000003a0| 61 72 65 20 6a 75 73 74 | 20 63 6f 6e 74 65 6d 70 |are just| contemp|
|000003b0| 6c 61 74 69 6e 67 20 64 | 6f 69 6e 67 20 73 6f 6d |lating d|oing som|
|000003c0| 65 20 63 6f 64 69 6e 67 | 20 69 6e 0d 0a 61 73 73 |e coding| in..ass|
|000003d0| 65 6d 62 6c 65 72 2c 20 | 6d 61 79 62 65 20 79 6f |embler, |maybe yo|
|000003e0| 75 20 68 61 76 65 20 74 | 72 69 65 64 20 69 74 20 |u have t|ried it |
|000003f0| 77 69 74 68 20 6d 69 78 | 65 64 20 73 75 63 63 65 |with mix|ed succe|
|00000400| 73 73 2e 20 20 49 66 20 | 79 6f 75 20 61 72 65 20 |ss. If |you are |
|00000410| 68 65 72 65 20 74 6f 0d | 0a 67 65 74 20 61 69 6d |here to.|.get aim|
|00000420| 65 64 20 69 6e 20 74 68 | 65 20 72 69 67 68 74 20 |ed in th|e right |
|00000430| 64 69 72 65 63 74 69 6f | 6e 2c 20 74 6f 20 67 65 |directio|n, to ge|
|00000440| 74 20 6f 66 66 20 74 6f | 20 61 20 67 6f 6f 64 20 |t off to| a good |
|00000450| 73 74 61 72 74 20 77 69 | 74 68 20 74 68 65 0d 0a |start wi|th the..|
|00000460| 61 73 73 65 6d 62 6c 65 | 72 2c 20 74 68 65 6e 20 |assemble|r, then |
|00000470| 79 6f 75 20 68 61 76 65 | 20 63 6f 6d 65 20 66 6f |you have| come fo|
|00000480| 72 20 74 68 65 20 72 69 | 67 68 74 20 72 65 61 73 |r the ri|ght reas|
|00000490| 6f 6e 2e 20 20 49 20 63 | 61 6e 27 74 20 70 72 6f |on. I c|an't pro|
|000004a0| 6d 69 73 65 20 79 6f 75 | 27 6c 6c 0d 0a 67 65 74 |mise you|'ll..get|
|000004b0| 20 77 68 61 74 20 79 6f | 75 20 77 61 6e 74 2c 20 | what yo|u want, |
|000004c0| 62 75 74 20 49 27 6c 6c | 20 64 6f 20 6d 79 20 62 |but I'll| do my b|
|000004d0| 65 73 74 2e 0d 0a 0a 4f | 6e 20 74 68 65 20 6f 74 |est....O|n the ot|
|000004e0| 68 65 72 20 68 61 6e 64 | 2c 20 69 66 20 79 6f 75 |her hand|, if you|
|000004f0| 20 68 61 76 65 20 61 6c | 72 65 61 64 79 20 74 75 | have al|ready tu|
|00000500| 72 6e 65 64 20 6f 75 74 | 20 73 6f 6d 65 20 77 6f |rned out| some wo|
|00000510| 72 6b 69 6e 67 20 61 73 | 73 65 6d 62 6c 65 72 0d |rking as|sembler.|
|00000520| 0a 63 6f 64 65 2c 20 74 | 68 65 6e 20 74 68 69 73 |.code, t|hen this|
|00000530| 20 74 61 6c 6b 20 69 73 | 20 6c 69 6b 65 6c 79 20 | talk is| likely |
|00000540| 74 6f 20 62 65 20 6f 6e | 20 74 68 65 20 65 6c 65 |to be on| the ele|
|00000550| 6d 65 6e 74 61 72 79 20 | 73 69 64 65 20 66 6f 72 |mentary |side for|
|00000560| 20 79 6f 75 2e 20 20 49 | 66 0d 0a 79 6f 75 20 77 | you. I|f..you w|
|00000570| 61 6e 74 20 74 6f 20 72 | 65 76 69 65 77 20 61 20 |ant to r|eview a |
|00000580| 66 65 77 20 62 61 73 69 | 63 73 20 61 6e 64 20 68 |few basi|cs and h|
|00000590| 61 76 65 20 6e 6f 20 77 | 68 65 72 65 20 65 6c 73 |ave no w|here els|
|000005a0| 65 20 70 72 65 73 73 69 | 6e 67 20 74 6f 20 67 6f |e pressi|ng to go|
|000005b0| 2c 20 74 68 65 6e 0d 0a | 62 79 20 61 6c 6c 20 6d |, then..|by all m|
|000005c0| 65 61 6e 73 20 73 74 61 | 79 2e 0d 0a 0d 0a 0a 0a |eans sta|y.......|
|000005d0| 57 68 79 20 4c 65 61 72 | 6e 20 41 73 73 65 6d 62 |Why Lear|n Assemb|
|000005e0| 6c 65 72 3f 0d 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |ler?.___|________|
|000005f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 0d 57 68 79 20 4c 65 |________|_.Why Le|
|00000600| 61 72 6e 20 41 73 73 65 | 6d 62 6c 65 72 3f 0d 57 |arn Asse|mbler?.W|
|00000610| 68 79 20 4c 65 61 72 6e | 20 41 73 73 65 6d 62 6c |hy Learn| Assembl|
|00000620| 65 72 3f 0d 57 68 79 20 | 4c 65 61 72 6e 20 41 73 |er?.Why |Learn As|
|00000630| 73 65 6d 62 6c 65 72 3f | 0d 0a 0a 0a 54 68 65 20 |sembler?|....The |
|00000640| 72 65 61 73 6f 6e 73 20 | 66 6f 72 20 4c 45 41 52 |reasons |for LEAR|
|00000650| 4e 49 4e 47 20 61 73 73 | 65 6d 62 6c 65 72 20 61 |NING ass|embler a|
|00000660| 72 65 20 6e 6f 74 20 74 | 68 65 20 73 61 6d 65 20 |re not t|he same |
|00000670| 61 73 20 74 68 65 20 72 | 65 61 73 6f 6e 73 20 66 |as the r|easons f|
|00000680| 6f 72 0d 0a 55 53 49 4e | 47 20 69 74 20 69 6e 20 |or..USIN|G it in |
|00000690| 61 20 70 61 72 74 69 63 | 75 6c 61 72 20 61 70 70 |a partic|ular app|
|000006a0| 6c 69 63 61 74 69 6f 6e | 2e 20 20 42 75 74 2c 20 |lication|. But, |
|000006b0| 77 65 20 68 61 76 65 20 | 74 6f 20 73 74 61 72 74 |we have |to start|
|000006c0| 20 77 69 74 68 20 73 6f | 6d 65 20 6f 66 0d 0a 74 | with so|me of..t|
|000006d0| 68 65 20 72 65 61 73 6f | 6e 73 20 66 6f 72 20 75 |he reaso|ns for u|
|000006e0| 73 69 6e 67 20 69 74 20 | 61 6e 64 20 74 68 65 6e |sing it |and then|
|000006f0| 20 49 20 74 68 69 6e 6b | 20 74 68 65 20 72 65 61 | I think| the rea|
|00000700| 73 6f 6e 73 20 66 6f 72 | 20 6c 65 61 72 6e 69 6e |sons for| learnin|
|00000710| 67 20 69 74 20 77 69 6c | 6c 0d 0a 62 65 63 6f 6d |g it wil|l..becom|
|00000720| 65 20 63 6c 65 61 72 2e | 0d 0a 0a 46 69 72 73 74 |e clear.|...First|
|00000730| 2c 20 6c 65 74 27 73 20 | 64 69 73 70 6f 73 65 20 |, let's |dispose |
|00000740| 6f 66 20 61 20 62 61 64 | 20 72 65 61 73 6f 6e 20 |of a bad| reason |
|00000750| 66 6f 72 20 75 73 69 6e | 67 20 69 74 2e 20 20 44 |for usin|g it. D|
|00000760| 6f 6e 27 74 20 75 73 65 | 20 69 74 20 6a 75 73 74 |on't use| it just|
|00000770| 0d 0a 62 65 63 61 75 73 | 65 20 79 6f 75 20 74 68 |..becaus|e you th|
|00000780| 69 6e 6b 20 69 74 20 69 | 73 20 67 6f 69 6e 67 20 |ink it i|s going |
|00000790| 74 6f 20 65 78 65 63 75 | 74 65 20 66 61 73 74 65 |to execu|te faste|
|000007a0| 72 2e 20 20 41 20 70 61 | 72 74 69 63 75 6c 61 72 |r. A pa|rticular|
|000007b0| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 0d 0a 6f 72 | sequenc|e of..or|
|000007c0| 64 69 6e 61 72 79 20 62 | 72 65 61 64 2d 61 6e 64 |dinary b|read-and|
|000007d0| 2d 62 75 74 74 65 72 20 | 63 6f 6d 70 75 74 61 74 |-butter |computat|
|000007e0| 69 6f 6e 73 20 77 72 69 | 74 74 65 6e 20 69 6e 20 |ions wri|tten in |
|000007f0| 50 41 53 43 41 4c 2c 20 | 43 2c 20 46 4f 52 54 52 |PASCAL, |C, FORTR|
|00000800| 41 4e 2c 20 6f 72 0d 0a | 63 6f 6d 70 69 6c 65 64 |AN, or..|compiled|
|00000810| 20 42 41 53 49 43 20 63 | 61 6e 20 64 6f 20 74 68 | BASIC c|an do th|
|00000820| 65 20 6a 6f 62 20 6a 75 | 73 74 20 61 62 6f 75 74 |e job ju|st about|
|00000830| 20 61 73 20 66 61 73 74 | 20 61 73 20 74 68 65 20 | as fast| as the |
|00000840| 73 61 6d 65 20 61 6c 67 | 6f 72 69 74 68 6d 0d 0a |same alg|orithm..|
|00000850| 63 6f 64 65 64 20 69 6e | 20 61 73 73 65 6d 62 6c |coded in| assembl|
|00000860| 65 72 2e 20 20 4f 66 20 | 63 6f 75 72 73 65 2c 20 |er. Of |course, |
|00000870| 69 6e 74 65 72 70 72 65 | 74 69 76 65 20 42 41 53 |interpre|tive BAS|
|00000880| 49 43 20 69 73 20 73 6c | 6f 77 65 72 2c 20 62 75 |IC is sl|ower, bu|
|00000890| 74 20 69 66 20 79 6f 75 | 0d 0a 68 61 76 65 20 61 |t if you|..have a|
|000008a0| 20 42 41 53 49 43 20 61 | 70 70 6c 69 63 61 74 69 | BASIC a|pplicati|
|000008b0| 6f 6e 20 77 68 69 63 68 | 20 72 75 6e 73 20 74 6f |on which| runs to|
|000008c0| 6f 20 73 6c 6f 77 20 79 | 6f 75 20 70 72 6f 62 61 |o slow y|ou proba|
|000008d0| 62 6c 79 20 77 61 6e 74 | 20 74 6f 20 74 72 79 20 |bly want| to try |
|000008e0| 63 6f 6d 2d 0d 0a 0a 0a | 49 42 4d 20 50 43 20 41 |com-....|IBM PC A|
|000008f0| 73 73 65 6d 62 6c 79 20 | 4c 61 6e 67 75 61 67 65 |ssembly |Language|
|00000900| 20 54 75 74 6f 72 69 61 | 6c 20 20 20 20 20 20 20 | Tutoria|l |
|00000910| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000930| 20 20 31 0d 0a 0d 0c 0d | 0a 0a 70 69 6c 69 6e 67 | 1.....|..piling|
|00000940| 20 69 74 20 62 65 66 6f | 72 65 20 79 6f 75 20 74 | it befo|re you t|
|00000950| 68 69 6e 6b 20 74 6f 6f | 20 6d 75 63 68 20 61 62 |hink too| much ab|
|00000960| 6f 75 74 20 74 72 61 6e | 73 6c 61 74 69 6e 67 20 |out tran|slating |
|00000970| 70 61 72 74 73 20 6f 66 | 20 69 74 20 74 6f 0d 0a |parts of| it to..|
|00000980| 61 6e 6f 74 68 65 72 20 | 6c 61 6e 67 75 61 67 65 |another |language|
|00000990| 2e 0d 0a 0a 4f 6e 20 74 | 68 65 20 6f 74 68 65 72 |....On t|he other|
|000009a0| 20 68 61 6e 64 2c 20 68 | 69 67 68 20 6c 65 76 65 | hand, h|igh leve|
|000009b0| 6c 20 6c 61 6e 67 75 61 | 67 65 73 20 64 6f 20 74 |l langua|ges do t|
|000009c0| 65 6e 64 20 74 6f 20 69 | 73 6f 6c 61 74 65 20 79 |end to i|solate y|
|000009d0| 6f 75 20 66 72 6f 6d 20 | 74 68 65 0d 0a 6d 61 63 |ou from |the..mac|
|000009e0| 68 69 6e 65 2e 20 20 54 | 68 61 74 20 69 73 20 62 |hine. T|hat is b|
|000009f0| 6f 74 68 20 74 68 65 69 | 72 20 73 74 72 65 6e 67 |oth thei|r streng|
|00000a00| 74 68 20 61 6e 64 20 74 | 68 65 69 72 20 77 65 61 |th and t|heir wea|
|00000a10| 6b 6e 65 73 73 2e 20 20 | 55 73 75 61 6c 6c 79 2c |kness. |Usually,|
|00000a20| 20 77 68 65 6e 0d 0a 69 | 6d 70 6c 65 6d 65 6e 74 | when..i|mplement|
|00000a30| 65 64 20 6f 6e 20 61 20 | 6d 69 63 72 6f 2c 20 61 |ed on a |micro, a|
|00000a40| 20 68 69 67 68 20 6c 65 | 76 65 6c 20 6c 61 6e 67 | high le|vel lang|
|00000a50| 75 61 67 65 20 70 72 6f | 76 69 64 65 73 20 61 6e |uage pro|vides an|
|00000a60| 20 65 73 63 61 70 65 20 | 6d 65 63 68 61 6e 69 73 | escape |mechanis|
|00000a70| 6d 0d 0a 74 6f 20 74 68 | 65 20 75 6e 64 65 72 6c |m..to th|e underl|
|00000a80| 79 69 6e 67 20 6f 70 65 | 72 61 74 69 6e 67 20 73 |ying ope|rating s|
|00000a90| 79 73 74 65 6d 20 6f 72 | 20 74 6f 20 74 68 65 20 |ystem or| to the |
|00000aa0| 62 61 72 65 20 6d 61 63 | 68 69 6e 65 2e 20 20 53 |bare mac|hine. S|
|00000ab0| 6f 2c 20 66 6f 72 0d 0a | 65 78 61 6d 70 6c 65 2c |o, for..|example,|
|00000ac0| 20 42 41 53 49 43 20 68 | 61 73 20 69 74 73 20 50 | BASIC h|as its P|
|00000ad0| 45 45 4b 20 61 6e 64 20 | 50 4f 4b 45 2e 20 20 42 |EEK and |POKE. B|
|00000ae0| 75 74 2c 20 74 68 65 20 | 72 6f 75 74 65 20 74 6f |ut, the |route to|
|00000af0| 20 74 68 65 20 62 61 72 | 65 20 6d 61 63 68 69 6e | the bar|e machin|
|00000b00| 65 0d 0a 69 73 20 6f 66 | 74 65 6e 20 61 20 63 69 |e..is of|ten a ci|
|00000b10| 72 63 75 69 74 6f 75 73 | 20 6f 6e 65 2c 20 6c 65 |rcuitous| one, le|
|00000b20| 61 64 69 6e 67 20 74 6f | 20 74 72 69 63 6b 79 20 |ading to| tricky |
|00000b30| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 77 68 69 63 |programm|ing whic|
|00000b40| 68 20 69 73 20 68 61 72 | 64 20 74 6f 0d 0a 66 6f |h is har|d to..fo|
|00000b50| 6c 6c 6f 77 2e 0d 0a 0a | 46 6f 72 20 74 68 6f 73 |llow....|For thos|
|00000b60| 65 20 6f 66 20 75 73 20 | 77 6f 72 6b 69 6e 67 20 |e of us |working |
|00000b70| 6f 6e 20 50 43 27 73 20 | 63 6f 6e 6e 65 63 74 65 |on PC's |connecte|
|00000b80| 64 20 74 6f 20 53 48 41 | 52 45 2d 63 6c 61 73 73 |d to SHA|RE-class|
|00000b90| 20 6d 61 69 6e 66 72 61 | 6d 65 73 2c 20 77 65 20 | mainfra|mes, we |
|00000ba0| 61 72 65 0d 0a 67 65 6e | 65 72 61 6c 6c 79 20 63 |are..gen|erally c|
|00000bb0| 6f 6e 63 65 72 6e 65 64 | 20 77 69 74 68 20 74 68 |oncerned| with th|
|00000bc0| 72 65 65 20 69 6e 74 65 | 72 66 61 63 65 73 3a 20 |ree inte|rfaces: |
|00000bd0| 20 74 68 65 20 6b 65 79 | 62 6f 61 72 64 2c 20 74 | the key|board, t|
|00000be0| 68 65 20 73 63 72 65 65 | 6e 2c 20 61 6e 64 0d 0a |he scree|n, and..|
|00000bf0| 74 68 65 20 63 6f 6d 6d | 75 6e 69 63 61 74 69 6f |the comm|unicatio|
|00000c00| 6e 20 6c 69 6e 65 20 6f | 72 20 6c 69 6e 65 73 2e |n line o|r lines.|
|00000c10| 20 20 41 6c 6c 20 74 68 | 72 65 65 20 6f 66 20 74 | All th|ree of t|
|00000c20| 68 65 73 65 20 65 6e 74 | 69 74 69 65 73 20 72 61 |hese ent|ities ra|
|00000c30| 69 73 65 20 6d 61 63 68 | 69 6e 65 0d 0a 64 65 70 |ise mach|ine..dep|
|00000c40| 65 6e 64 65 6e 74 20 69 | 73 73 75 65 73 20 77 68 |endent i|ssues wh|
|00000c50| 69 63 68 20 61 72 65 20 | 69 6d 70 65 72 66 65 63 |ich are |imperfec|
|00000c60| 74 6c 79 20 61 64 64 72 | 65 73 73 65 64 20 62 79 |tly addr|essed by|
|00000c70| 20 74 68 65 20 75 6e 64 | 65 72 6c 79 69 6e 67 20 | the und|erlying |
|00000c80| 6f 70 65 72 61 74 2d 0d | 0a 69 6e 67 20 73 79 73 |operat-.|.ing sys|
|00000c90| 74 65 6d 20 6f 72 20 62 | 79 20 68 69 67 68 20 6c |tem or b|y high l|
|00000ca0| 65 76 65 6c 20 6c 61 6e | 67 75 61 67 65 73 2e 0d |evel lan|guages..|
|00000cb0| 0a 0a 53 6f 6d 65 74 69 | 6d 65 73 2c 20 74 68 65 |..Someti|mes, the|
|00000cc0| 20 73 79 73 74 65 6d 20 | 6f 72 20 74 68 65 20 6c | system |or the l|
|00000cd0| 61 6e 67 75 61 67 65 20 | 64 6f 65 73 20 74 6f 6f |anguage |does too|
|00000ce0| 20 6c 69 74 74 6c 65 20 | 66 6f 72 20 79 6f 75 2e | little |for you.|
|00000cf0| 20 20 46 6f 72 0d 0a 65 | 78 61 6d 70 6c 65 2c 20 | For..e|xample, |
|00000d00| 77 69 74 68 20 74 68 65 | 20 61 73 79 6e 63 68 20 |with the| asynch |
|00000d10| 61 64 61 70 74 65 72 2c | 20 74 68 65 20 73 79 73 |adapter,| the sys|
|00000d20| 74 65 6d 20 70 72 6f 76 | 69 64 65 73 20 6e 6f 20 |tem prov|ides no |
|00000d30| 69 6e 74 65 72 72 75 70 | 74 20 68 61 6e 64 6c 65 |interrup|t handle|
|00000d40| 72 2c 0d 0a 6e 6f 20 62 | 75 66 66 65 72 2c 20 61 |r,..no b|uffer, a|
|00000d50| 6e 64 20 6e 6f 20 66 6c | 6f 77 20 63 6f 6e 74 72 |nd no fl|ow contr|
|00000d60| 6f 6c 2e 20 20 54 68 65 | 20 61 70 70 6c 69 63 61 |ol. The| applica|
|00000d70| 74 69 6f 6e 20 69 73 20 | 73 74 75 63 6b 20 77 69 |tion is |stuck wi|
|00000d80| 74 68 20 74 68 65 20 72 | 65 73 70 6f 6e 2d 0d 0a |th the r|espon-..|
|00000d90| 73 69 62 69 6c 69 74 79 | 20 66 6f 72 20 6d 6f 6e |sibility| for mon|
|00000da0| 69 74 6f 72 69 6e 67 20 | 74 68 61 74 20 70 6f 72 |itoring |that por|
|00000db0| 74 20 61 6e 64 20 6e 6f | 74 20 6d 69 73 73 69 6e |t and no|t missin|
|00000dc0| 67 20 61 6e 79 20 63 68 | 61 72 61 63 74 65 72 73 |g any ch|aracters|
|00000dd0| 2c 20 74 68 65 6e 0d 0a | 64 65 63 69 64 69 6e 67 |, then..|deciding|
|00000de0| 20 77 68 61 74 20 74 6f | 20 64 6f 20 77 69 74 68 | what to| do with|
|00000df0| 20 61 6c 6c 20 65 72 72 | 6f 72 73 2e 20 20 42 41 | all err|ors. BA|
|00000e00| 53 49 43 20 64 6f 65 73 | 20 61 20 72 65 61 73 6f |SIC does| a reaso|
|00000e10| 6e 61 62 6c 65 20 6a 6f | 62 20 6f 6e 20 73 6f 6d |nable jo|b on som|
|00000e20| 65 0d 0a 6f 66 20 74 68 | 69 73 2c 20 62 75 74 20 |e..of th|is, but |
|00000e30| 74 68 61 74 20 69 73 20 | 6f 6e 6c 79 20 42 41 53 |that is |only BAS|
|00000e40| 49 43 2e 20 20 4d 6f 73 | 74 20 6f 74 68 65 72 20 |IC. Mos|t other |
|00000e50| 6c 61 6e 67 75 61 67 65 | 73 20 64 6f 20 6c 65 73 |language|s do les|
|00000e60| 73 2e 0d 0a 0a 53 6f 6d | 65 74 69 6d 65 73 2c 20 |s....Som|etimes, |
|00000e70| 74 68 65 20 73 79 73 74 | 65 6d 20 6d 61 79 20 64 |the syst|em may d|
|00000e80| 6f 20 74 6f 6f 20 6d 75 | 63 68 20 66 6f 72 20 79 |o too mu|ch for y|
|00000e90| 6f 75 2e 20 20 53 79 73 | 74 65 6d 20 73 75 70 70 |ou. Sys|tem supp|
|00000ea0| 6f 72 74 20 66 6f 72 20 | 74 68 65 20 6b 65 79 2d |ort for |the key-|
|00000eb0| 0d 0a 62 6f 61 72 64 20 | 69 73 20 61 6e 20 65 78 |..board |is an ex|
|00000ec0| 61 6d 70 6c 65 2e 20 20 | 41 74 20 74 68 65 20 68 |ample. |At the h|
|00000ed0| 61 72 64 77 61 72 65 20 | 6c 65 76 65 6c 2c 20 61 |ardware |level, a|
|00000ee0| 6c 6c 20 38 33 20 6b 65 | 79 73 20 6f 6e 20 74 68 |ll 83 ke|ys on th|
|00000ef0| 65 20 6b 65 79 62 6f 61 | 72 64 0d 0a 73 65 6e 64 |e keyboa|rd..send|
|00000f00| 20 75 6e 69 71 75 65 20 | 63 6f 64 65 73 20 77 68 | unique |codes wh|
|00000f10| 65 6e 20 74 68 65 79 20 | 61 72 65 20 70 72 65 73 |en they |are pres|
|00000f20| 73 65 64 2c 20 68 65 6c | 64 20 64 6f 77 6e 2c 20 |sed, hel|d down, |
|00000f30| 61 6e 64 20 72 65 6c 65 | 61 73 65 64 2e 20 20 42 |and rele|ased. B|
|00000f40| 75 74 2c 0d 0a 73 6f 6d | 65 6f 6e 65 20 68 61 73 |ut,..som|eone has|
|00000f50| 20 64 65 63 69 64 65 64 | 20 74 68 61 74 20 63 65 | decided| that ce|
|00000f60| 72 74 61 69 6e 20 6b 65 | 79 73 2c 20 6c 69 6b 65 |rtain ke|ys, like|
|00000f70| 20 4e 75 6d 20 4c 6f 63 | 6b 20 61 6e 64 20 53 63 | Num Loc|k and Sc|
|00000f80| 72 6f 6c 6c 20 4c 6f 63 | 6b 20 61 72 65 0d 0a 67 |roll Loc|k are..g|
|00000f90| 6f 69 6e 67 20 74 6f 20 | 64 6f 20 63 65 72 74 61 |oing to |do certa|
|00000fa0| 69 6e 20 74 68 69 6e 67 | 73 20 62 65 66 6f 72 65 |in thing|s before|
|00000fb0| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00000fc0| 20 65 76 65 6e 20 73 65 | 65 73 20 74 68 65 6d 20 | even se|es them |
|00000fd0| 61 6e 64 20 63 61 6e 27 | 74 0d 0a 74 68 65 72 65 |and can'|t..there|
|00000fe0| 66 6f 72 65 20 62 65 20 | 75 73 65 64 20 61 73 20 |fore be |used as |
|00000ff0| 6f 72 64 69 6e 61 72 79 | 20 6b 65 79 73 2e 0d 0a |ordinary| keys...|
|00001000| 0a 53 6f 6d 65 74 69 6d | 65 73 2c 20 74 68 65 20 |.Sometim|es, the |
|00001010| 73 79 73 74 65 6d 20 64 | 6f 65 73 20 61 62 6f 75 |system d|oes abou|
|00001020| 74 20 74 68 65 20 72 69 | 67 68 74 20 61 6d 6f 75 |t the ri|ght amou|
|00001030| 6e 74 20 6f 66 20 73 74 | 75 66 66 20 62 75 74 20 |nt of st|uff but |
|00001040| 64 6f 65 73 20 69 74 20 | 6c 65 73 73 0d 0a 65 66 |does it |less..ef|
|00001050| 66 69 63 69 65 6e 74 6c | 79 20 74 68 65 6e 20 69 |ficientl|y then i|
|00001060| 74 20 73 68 6f 75 6c 64 | 2e 20 20 53 79 73 74 65 |t should|. Syste|
|00001070| 6d 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 74 68 |m suppor|t for th|
|00001080| 65 20 73 63 72 65 65 6e | 20 69 73 20 69 6e 20 74 |e screen| is in t|
|00001090| 68 69 73 0d 0a 63 6c 61 | 73 73 2e 20 20 49 66 20 |his..cla|ss. If |
|000010a0| 79 6f 75 20 75 73 65 20 | 6f 6e 6c 79 20 74 68 65 |you use |only the|
|000010b0| 20 6f 66 66 69 63 69 61 | 6c 20 69 6e 74 65 72 66 | officia|l interf|
|000010c0| 61 63 65 20 74 6f 20 74 | 68 65 20 73 63 72 65 65 |ace to t|he scree|
|000010d0| 6e 20 79 6f 75 20 73 6f | 6d 65 74 69 6d 65 73 0d |n you so|metimes.|
|000010e0| 0a 73 6c 6f 77 20 79 6f | 75 72 20 61 70 70 6c 69 |.slow yo|ur appli|
|000010f0| 63 61 74 69 6f 6e 20 64 | 6f 77 6e 20 75 6e 61 63 |cation d|own unac|
|00001100| 63 65 70 74 61 62 6c 79 | 2e 20 20 49 20 73 61 69 |ceptably|. I sai|
|00001110| 64 20 62 65 66 6f 72 65 | 2c 20 64 6f 6e 27 74 20 |d before|, don't |
|00001120| 75 73 65 20 61 73 73 65 | 6d 2d 0d 0a 62 6c 65 72 |use asse|m-..bler|
|00001130| 20 6a 75 73 74 20 74 6f | 20 73 70 65 65 64 20 74 | just to| speed t|
|00001140| 68 69 6e 67 73 20 75 70 | 2c 20 62 75 74 20 74 68 |hings up|, but th|
|00001150| 65 72 65 20 49 20 77 61 | 73 20 74 61 6c 6b 69 6e |ere I wa|s talkin|
|00001160| 67 20 61 62 6f 75 74 20 | 6d 61 69 6e 6c 69 6e 65 |g about |mainline|
|00001170| 20 63 6f 64 65 2c 0d 0a | 77 68 69 63 68 20 67 65 | code,..|which ge|
|00001180| 6e 65 72 61 6c 6c 79 20 | 63 61 6e 27 74 20 62 65 |nerally |can't be|
|00001190| 20 73 70 65 65 64 65 64 | 20 75 70 20 6d 75 63 68 | speeded| up much|
|000011a0| 20 62 79 20 61 73 73 65 | 6d 62 6c 65 72 20 63 6f | by asse|mbler co|
|000011b0| 64 69 6e 67 2e 20 20 41 | 20 63 72 69 74 69 63 61 |ding. A| critica|
|000011c0| 6c 0d 0a 73 79 73 74 65 | 6d 20 69 6e 74 65 72 66 |l..syste|m interf|
|000011d0| 61 63 65 20 69 73 20 61 | 20 64 69 66 66 65 72 65 |ace is a| differe|
|000011e0| 6e 74 20 6d 61 74 74 65 | 72 3a 20 20 73 6f 6d 65 |nt matte|r: some|
|000011f0| 74 69 6d 65 73 20 77 65 | 20 6d 61 79 20 68 61 76 |times we| may hav|
|00001200| 65 20 74 6f 20 75 73 65 | 0d 0a 61 73 73 65 6d 62 |e to use|..assemb|
|00001210| 6c 65 72 20 74 6f 20 62 | 79 70 61 73 73 20 61 20 |ler to b|ypass a |
|00001220| 68 6f 70 65 6c 65 73 73 | 6c 79 20 69 6e 65 66 66 |hopeless|ly ineff|
|00001230| 69 63 69 65 6e 74 20 69 | 6d 70 6c 65 6d 65 6e 74 |icient i|mplement|
|00001240| 61 74 69 6f 6e 2e 20 20 | 57 65 20 64 6f 6e 27 74 |ation. |We don't|
|00001250| 20 77 61 6e 74 0d 0a 74 | 6f 20 64 6f 20 74 68 69 | want..t|o do thi|
|00001260| 73 20 69 66 20 77 65 20 | 63 61 6e 20 61 76 6f 69 |s if we |can avoi|
|00001270| 64 20 69 74 2c 20 62 75 | 74 20 73 6f 6d 65 74 69 |d it, bu|t someti|
|00001280| 6d 65 73 20 77 65 20 63 | 61 6e 27 74 2e 0d 0a 0a |mes we c|an't....|
|00001290| 41 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |Assembly| languag|
|000012a0| 65 20 63 6f 64 65 20 63 | 61 6e 20 6f 76 65 72 63 |e code c|an overc|
|000012b0| 6f 6d 65 20 74 68 65 73 | 65 20 64 65 66 69 63 69 |ome thes|e defici|
|000012c0| 65 6e 63 69 65 73 2e 20 | 20 49 6e 20 73 6f 6d 65 |encies. | In some|
|000012d0| 20 63 61 73 65 73 2c 20 | 79 6f 75 0d 0a 63 61 6e | cases, |you..can|
|000012e0| 20 61 6c 73 6f 20 6f 76 | 65 72 63 6f 6d 65 20 74 | also ov|ercome t|
|000012f0| 68 65 73 65 20 64 65 66 | 69 63 69 65 6e 63 69 65 |hese def|iciencie|
|00001300| 73 20 62 79 20 6a 75 64 | 69 63 69 6f 75 73 20 75 |s by jud|icious u|
|00001310| 73 65 20 6f 66 20 74 68 | 65 20 65 73 63 61 70 65 |se of th|e escape|
|00001320| 20 76 61 6c 76 65 73 0d | 0a 77 68 69 63 68 20 79 | valves.|.which y|
|00001330| 6f 75 72 20 68 69 67 68 | 20 6c 65 76 65 6c 20 6c |our high| level l|
|00001340| 61 6e 67 75 61 67 65 20 | 70 72 6f 76 69 64 65 73 |anguage |provides|
|00001350| 2e 20 20 49 6e 20 42 41 | 53 49 43 2c 20 79 6f 75 |. In BA|SIC, you|
|00001360| 20 63 61 6e 20 50 45 45 | 4b 20 61 6e 64 20 50 4f | can PEE|K and PO|
|00001370| 4b 45 0d 0a 61 6e 64 20 | 49 4e 50 20 61 6e 64 20 |KE..and |INP and |
|00001380| 4f 55 54 20 79 6f 75 72 | 20 77 61 79 20 61 72 6f |OUT your| way aro|
|00001390| 75 6e 64 20 61 20 67 72 | 65 61 74 20 6d 61 6e 79 |und a gr|eat many|
|000013a0| 20 69 73 73 75 65 73 2e | 20 20 49 6e 20 6d 61 6e | issues.| In man|
|000013b0| 79 20 6f 74 68 65 72 20 | 6c 61 6e 2d 0d 0a 67 75 |y other |lan-..gu|
|000013c0| 61 67 65 73 20 79 6f 75 | 20 63 61 6e 20 69 73 73 |ages you| can iss|
|000013d0| 75 65 20 73 79 73 74 65 | 6d 20 63 61 6c 6c 73 20 |ue syste|m calls |
|000013e0| 61 6e 64 20 69 6e 74 65 | 72 72 75 70 74 73 20 61 |and inte|rrupts a|
|000013f0| 6e 64 20 75 73 75 61 6c | 6c 79 20 6d 61 6e 61 67 |nd usual|ly manag|
|00001400| 65 2c 20 6f 6e 65 0d 0a | 77 61 79 20 6f 72 20 6f |e, one..|way or o|
|00001410| 74 68 65 72 2c 20 74 6f | 20 6d 6f 64 69 66 79 20 |ther, to| modify |
|00001420| 73 79 73 74 65 6d 20 6d | 65 6d 6f 72 79 2e 20 20 |system m|emory. |
|00001430| 57 72 69 74 69 6e 67 20 | 68 61 6e 64 6c 65 72 73 |Writing |handlers|
|00001440| 20 74 6f 20 74 61 6b 65 | 20 72 65 61 6c 2d 74 69 | to take| real-ti|
|00001450| 6d 65 0d 0a 68 61 72 64 | 77 61 72 65 20 69 6e 74 |me..hard|ware int|
|00001460| 65 72 72 75 70 74 73 20 | 66 72 6f 6d 20 74 68 65 |errupts |from the|
|00001470| 20 6b 65 79 62 6f 61 72 | 64 20 6f 72 20 61 73 79 | keyboar|d or asy|
|00001480| 6e 63 68 20 70 6f 72 74 | 2c 20 74 68 6f 75 67 68 |nch port|, though|
|00001490| 2c 20 69 73 20 73 74 69 | 6c 6c 0d 0a 67 6f 69 6e |, is sti|ll..goin|
|000014a0| 67 20 74 6f 20 62 65 20 | 61 20 70 72 6f 62 6c 65 |g to be |a proble|
|000014b0| 6d 20 69 6e 20 6d 6f 73 | 74 20 6c 61 6e 67 75 61 |m in mos|t langua|
|000014c0| 67 65 73 2e 20 20 53 6f | 6d 65 20 6c 61 6e 67 75 |ges. So|me langu|
|000014d0| 61 67 65 73 20 63 6c 61 | 69 6d 20 74 6f 20 6c 65 |ages cla|im to le|
|000014e0| 74 20 79 6f 75 0d 0a 64 | 6f 20 69 74 20 62 75 74 |t you..d|o it but|
|000014f0| 20 49 20 68 61 76 65 20 | 79 65 74 20 74 6f 20 73 | I have |yet to s|
|00001500| 65 65 20 61 6e 20 61 63 | 63 65 70 74 61 62 6c 79 |ee an ac|ceptably|
|00001510| 20 63 6c 65 61 6e 20 69 | 6d 70 6c 65 6d 65 6e 74 | clean i|mplement|
|00001520| 61 74 69 6f 6e 20 64 6f | 6e 65 20 74 68 61 74 0d |ation do|ne that.|
|00001530| 0a 77 61 79 2e 0d 0a 0a | 54 68 65 20 72 65 61 6c |.way....|The real|
|00001540| 20 72 65 61 73 6f 6e 20 | 77 68 69 6c 65 20 61 73 | reason |while as|
|00001550| 73 65 6d 62 6c 65 72 20 | 69 73 20 62 65 74 74 65 |sembler |is bette|
|00001560| 72 20 74 68 61 6e 20 22 | 74 72 69 63 6b 79 20 50 |r than "|tricky P|
|00001570| 4f 4b 45 73 22 20 66 6f | 72 20 77 72 69 74 69 6e |OKEs" fo|r writin|
|00001580| 67 0d 0a 6d 61 63 68 69 | 6e 65 2d 64 65 70 65 6e |g..machi|ne-depen|
|00001590| 64 65 6e 74 20 63 6f 64 | 65 2c 20 74 68 6f 75 67 |dent cod|e, thoug|
|000015a0| 68 2c 20 69 73 20 74 68 | 65 20 73 61 6d 65 20 72 |h, is th|e same r|
|000015b0| 65 61 73 6f 6e 20 77 68 | 79 20 50 41 53 43 41 4c |eason wh|y PASCAL|
|000015c0| 20 69 73 20 62 65 74 74 | 65 72 0d 0a 74 68 61 6e | is bett|er..than|
|000015d0| 20 61 73 73 65 6d 62 6c | 65 72 20 66 6f 72 20 77 | assembl|er for w|
|000015e0| 72 69 74 69 6e 67 20 61 | 20 70 61 79 72 6f 6c 6c |riting a| payroll|
|000015f0| 20 70 61 63 6b 61 67 65 | 3a 20 20 69 74 20 69 73 | package|: it is|
|00001600| 20 65 61 73 69 65 72 20 | 74 6f 20 6d 61 69 6e 74 | easier |to maint|
|00001610| 61 69 6e 2e 0d 0a 0a 0a | 49 42 4d 20 50 43 20 41 |ain.....|IBM PC A|
|00001620| 73 73 65 6d 62 6c 79 20 | 4c 61 6e 67 75 61 67 65 |ssembly |Language|
|00001630| 20 54 75 74 6f 72 69 61 | 6c 20 20 20 20 20 20 20 | Tutoria|l |
|00001640| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001650| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001660| 20 20 32 0d 0a 0d 0c 0d | 0a 0a 4c 65 74 20 74 68 | 2.....|..Let th|
|00001670| 65 20 68 69 67 68 20 6c | 65 76 65 6c 20 6c 61 6e |e high l|evel lan|
|00001680| 67 75 61 67 65 20 64 6f | 20 77 68 61 74 20 69 74 |guage do| what it|
|00001690| 20 64 6f 65 73 20 62 65 | 73 74 2c 20 62 75 74 20 | does be|st, but |
|000016a0| 72 65 63 6f 67 6e 69 7a | 65 20 74 68 61 74 20 74 |recogniz|e that t|
|000016b0| 68 65 72 65 0d 0a 61 72 | 65 20 73 6f 6d 65 20 74 |here..ar|e some t|
|000016c0| 68 69 6e 67 73 20 77 68 | 69 63 68 20 61 72 65 20 |hings wh|ich are |
|000016d0| 62 65 73 74 20 64 6f 6e | 65 20 69 6e 20 61 73 73 |best don|e in ass|
|000016e0| 65 6d 62 6c 65 72 20 63 | 6f 64 65 2e 20 20 54 68 |embler c|ode. Th|
|000016f0| 65 20 61 73 73 65 6d 62 | 6c 65 72 2c 0d 0a 75 6e |e assemb|ler,..un|
|00001700| 6c 69 6b 65 20 74 68 65 | 20 74 72 69 63 6b 79 20 |like the| tricky |
|00001710| 50 4f 4b 45 2c 20 63 61 | 6e 20 6d 61 6b 65 20 6a |POKE, ca|n make j|
|00001720| 75 64 69 63 69 6f 75 73 | 20 75 73 65 20 6f 66 20 |udicious| use of |
|00001730| 65 71 75 61 74 65 73 2c | 20 6d 61 63 72 6f 73 2c |equates,| macros,|
|00001740| 20 6c 61 62 65 6c 73 2c | 0d 0a 61 6e 64 20 61 70 | labels,|..and ap|
|00001750| 70 72 6f 70 72 69 61 74 | 65 6c 79 20 70 6c 61 63 |propriat|ely plac|
|00001760| 65 64 20 63 6f 6d 6d 65 | 6e 74 73 20 74 6f 20 73 |ed comme|nts to s|
|00001770| 68 6f 77 20 77 68 61 74 | 20 69 73 20 72 65 61 6c |how what| is real|
|00001780| 6c 79 20 67 6f 69 6e 67 | 20 6f 6e 20 69 6e 20 74 |ly going| on in t|
|00001790| 68 69 73 0d 0a 6d 61 63 | 68 69 6e 65 2d 64 65 70 |his..mac|hine-dep|
|000017a0| 65 6e 64 65 6e 74 20 72 | 65 61 6c 6d 20 77 68 65 |endent r|ealm whe|
|000017b0| 72 65 20 69 74 20 74 68 | 72 69 76 65 73 2e 0d 0a |re it th|rives...|
|000017c0| 0a 53 6f 2c 20 74 68 65 | 72 65 20 61 72 65 20 74 |.So, the|re are t|
|000017d0| 69 6d 65 73 20 77 68 65 | 6e 20 69 74 20 62 65 63 |imes whe|n it bec|
|000017e0| 6f 6d 65 73 20 61 70 70 | 72 6f 70 72 69 61 74 65 |omes app|ropriate|
|000017f0| 20 74 6f 20 77 72 69 74 | 65 20 69 6e 20 61 73 73 | to writ|e in ass|
|00001800| 65 6d 62 6c 65 72 3b 20 | 67 69 76 2d 0d 0a 65 6e |embler; |giv-..en|
|00001810| 20 74 68 61 74 2c 20 69 | 66 20 79 6f 75 20 61 72 | that, i|f you ar|
|00001820| 65 20 61 20 72 65 73 70 | 6f 6e 73 69 62 6c 65 20 |e a resp|onsible |
|00001830| 70 72 6f 67 72 61 6d 6d | 65 72 20 6f 72 20 6d 61 |programm|er or ma|
|00001840| 6e 61 67 65 72 2c 20 79 | 6f 75 20 77 69 6c 6c 20 |nager, y|ou will |
|00001850| 77 61 6e 74 20 74 6f 0d | 0a 62 65 20 22 61 73 73 |want to.|.be "ass|
|00001860| 65 6d 62 6c 65 72 2d 6c | 69 74 65 72 61 74 65 22 |embler-l|iterate"|
|00001870| 20 73 6f 20 79 6f 75 20 | 63 61 6e 20 64 65 63 69 | so you |can deci|
|00001880| 64 65 20 77 68 65 6e 20 | 61 73 73 65 6d 62 6c 65 |de when |assemble|
|00001890| 72 20 63 6f 64 65 20 73 | 68 6f 75 6c 64 20 62 65 |r code s|hould be|
|000018a0| 0d 0a 77 72 69 74 74 65 | 6e 2e 0d 0a 0a 57 68 61 |..writte|n....Wha|
|000018b0| 74 20 64 6f 20 49 20 6d | 65 61 6e 20 62 79 20 22 |t do I m|ean by "|
|000018c0| 61 73 73 65 6d 62 6c 65 | 72 2d 6c 69 74 65 72 61 |assemble|r-litera|
|000018d0| 74 65 3f 22 20 20 49 20 | 64 6f 6e 27 74 20 6a 75 |te?" I |don't ju|
|000018e0| 73 74 20 6d 65 61 6e 20 | 75 6e 64 65 72 73 74 61 |st mean |understa|
|000018f0| 6e 64 69 6e 67 0d 0a 74 | 68 65 20 38 30 38 36 20 |nding..t|he 8086 |
|00001900| 61 72 63 68 69 74 65 63 | 74 75 72 65 3b 20 49 20 |architec|ture; I |
|00001910| 74 68 69 6e 6b 2c 20 65 | 76 65 6e 20 69 66 20 79 |think, e|ven if y|
|00001920| 6f 75 20 64 6f 6e 27 74 | 20 77 72 69 74 65 20 6d |ou don't| write m|
|00001930| 75 63 68 20 61 73 73 65 | 6d 62 6c 65 72 20 63 6f |uch asse|mbler co|
|00001940| 64 65 0d 0a 79 6f 75 72 | 73 65 6c 66 2c 20 79 6f |de..your|self, yo|
|00001950| 75 20 6f 75 67 68 74 20 | 74 6f 20 75 6e 64 65 72 |u ought |to under|
|00001960| 73 74 61 6e 64 20 74 68 | 65 20 61 63 74 75 61 6c |stand th|e actual|
|00001970| 20 70 72 6f 63 65 73 73 | 20 6f 66 20 74 75 72 6e | process| of turn|
|00001980| 69 6e 67 20 6f 75 74 20 | 61 73 73 65 6d 2d 0d 0a |ing out |assem-..|
|00001990| 62 6c 65 72 20 63 6f 64 | 65 20 61 6e 64 20 74 68 |bler cod|e and th|
|000019a0| 65 20 76 61 72 69 6f 75 | 73 20 77 61 79 73 20 74 |e variou|s ways t|
|000019b0| 6f 20 69 6e 63 6f 72 70 | 6f 72 61 74 65 20 69 74 |o incorp|orate it|
|000019c0| 20 69 6e 74 6f 20 61 6e | 20 61 70 70 6c 69 63 61 | into an| applica|
|000019d0| 74 69 6f 6e 2e 20 20 59 | 6f 75 0d 0a 6f 75 67 68 |tion. Y|ou..ough|
|000019e0| 74 20 74 6f 20 62 65 20 | 61 62 6c 65 20 74 6f 20 |t to be |able to |
|000019f0| 74 65 6c 6c 20 67 6f 6f | 64 20 61 73 73 65 6d 62 |tell goo|d assemb|
|00001a00| 6c 65 72 20 63 6f 64 65 | 20 66 72 6f 6d 20 62 61 |ler code| from ba|
|00001a10| 64 2c 20 61 6e 64 20 61 | 70 70 72 6f 70 72 69 61 |d, and a|ppropria|
|00001a20| 74 65 0d 0a 61 73 73 65 | 6d 62 6c 65 72 20 63 6f |te..asse|mbler co|
|00001a30| 64 65 20 66 72 6f 6d 20 | 69 6e 61 70 70 72 6f 70 |de from |inapprop|
|00001a40| 72 69 61 74 65 2e 0d 0a | 0d 0a 0a 0a 53 74 65 70 |riate...|....Step|
|00001a50| 73 20 74 6f 20 62 65 63 | 6f 6d 69 6e 67 20 41 53 |s to bec|oming AS|
|00001a60| 53 45 4d 42 4c 45 52 2d | 4c 49 54 45 52 41 54 45 |SEMBLER-|LITERATE|
|00001a70| 0d 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|00001a80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001a90| 5f 5f 5f 5f 5f 0d 53 74 | 65 70 73 20 74 6f 20 62 |_____.St|eps to b|
|00001aa0| 65 63 6f 6d 69 6e 67 20 | 41 53 53 45 4d 42 4c 45 |ecoming |ASSEMBLE|
|00001ab0| 52 2d 4c 49 54 45 52 41 | 54 45 0d 53 74 65 70 73 |R-LITERA|TE.Steps|
|00001ac0| 20 74 6f 20 62 65 63 6f | 6d 69 6e 67 20 41 53 53 | to beco|ming ASS|
|00001ad0| 45 4d 42 4c 45 52 2d 4c | 49 54 45 52 41 54 45 0d |EMBLER-L|ITERATE.|
|00001ae0| 53 74 65 70 73 20 74 6f | 20 62 65 63 6f 6d 69 6e |Steps to| becomin|
|00001af0| 67 20 41 53 53 45 4d 42 | 4c 45 52 2d 4c 49 54 45 |g ASSEMB|LER-LITE|
|00001b00| 52 41 54 45 0d 0a 0a 0a | 31 2e 20 20 4c 65 61 72 |RATE....|1. Lear|
|00001b10| 6e 20 74 68 65 20 38 30 | 38 36 20 61 72 63 68 69 |n the 80|86 archi|
|00001b20| 74 65 63 74 75 72 65 20 | 61 6e 64 20 6d 6f 73 74 |tecture |and most|
|00001b30| 20 6f 66 20 74 68 65 20 | 69 6e 73 74 72 75 63 74 | of the |instruct|
|00001b40| 69 6f 6e 20 73 65 74 2e | 20 20 4c 65 61 72 6e 0d |ion set.| Learn.|
|00001b50| 0a 20 20 20 20 77 68 61 | 74 20 79 6f 75 20 6e 65 |. wha|t you ne|
|00001b60| 65 64 20 74 6f 20 6b 6e | 6f 77 20 61 6e 64 20 69 |ed to kn|ow and i|
|00001b70| 67 6e 6f 72 65 20 77 68 | 61 74 20 79 6f 75 20 64 |gnore wh|at you d|
|00001b80| 6f 6e 27 74 2e 20 20 52 | 65 61 64 69 6e 67 3a 20 |on't. R|eading: |
|00001b90| 20 54 68 65 20 38 30 38 | 36 0d 0a 20 20 20 20 50 | The 808|6.. P|
|00001ba0| 72 69 6d 65 72 20 62 79 | 20 53 74 65 70 68 65 6e |rimer by| Stephen|
|00001bb0| 20 4d 6f 72 73 65 2c 20 | 70 75 62 6c 69 73 68 65 | Morse, |publishe|
|00001bc0| 64 20 62 79 20 48 61 79 | 64 65 6e 2e 20 20 59 6f |d by Hay|den. Yo|
|00001bd0| 75 20 6e 65 65 64 20 74 | 6f 20 72 65 61 64 20 6f |u need t|o read o|
|00001be0| 6e 6c 79 0d 0a 20 20 20 | 20 74 77 6f 20 63 68 61 |nly.. | two cha|
|00001bf0| 70 74 65 72 73 2c 20 74 | 68 65 20 6f 6e 65 20 6f |pters, t|he one o|
|00001c00| 6e 20 6d 61 63 68 69 6e | 65 20 6f 72 67 61 6e 69 |n machin|e organi|
|00001c10| 7a 61 74 69 6f 6e 20 61 | 6e 64 20 74 68 65 20 6f |zation a|nd the o|
|00001c20| 6e 65 20 6f 6e 20 74 68 | 65 0d 0a 20 20 20 20 69 |ne on th|e.. i|
|00001c30| 6e 73 74 72 75 63 74 69 | 6f 6e 20 73 65 74 2e 0d |nstructi|on set..|
|00001c40| 0a 0a 32 2e 20 20 4c 65 | 61 72 6e 20 61 62 6f 75 |..2. Le|arn abou|
|00001c50| 74 20 61 20 66 65 77 20 | 73 69 6d 70 6c 65 20 44 |t a few |simple D|
|00001c60| 4f 53 20 66 75 6e 63 74 | 69 6f 6e 20 63 61 6c 6c |OS funct|ion call|
|00001c70| 73 2e 20 20 4b 6e 6f 77 | 20 77 68 61 74 20 73 65 |s. Know| what se|
|00001c80| 72 76 69 63 65 73 20 74 | 68 65 0d 0a 20 20 20 20 |rvices t|he.. |
|00001c90| 6f 70 65 72 61 74 69 6e | 67 20 73 79 73 74 65 6d |operatin|g system|
|00001ca0| 20 70 72 6f 76 69 64 65 | 73 2e 20 20 49 66 20 61 | provide|s. If a|
|00001cb0| 70 70 72 6f 70 72 69 61 | 74 65 2c 20 6c 65 61 72 |ppropria|te, lear|
|00001cc0| 6e 20 61 20 6c 69 74 74 | 6c 65 20 61 62 6f 75 74 |n a litt|le about|
|00001cd0| 20 6f 74 68 65 72 0d 0a | 20 20 20 20 73 79 73 74 | other..| syst|
|00001ce0| 65 6d 73 20 74 6f 6f 2e | 20 20 49 74 20 77 69 6c |ems too.| It wil|
|00001cf0| 6c 20 61 69 64 20 70 6f | 72 74 61 62 69 6c 69 74 |l aid po|rtabilit|
|00001d00| 79 20 6c 61 74 65 72 20 | 6f 6e 2e 20 20 52 65 61 |y later |on. Rea|
|00001d10| 64 69 6e 67 3a 20 20 61 | 70 70 65 6e 64 69 63 65 |ding: a|ppendice|
|00001d20| 73 20 44 0d 0a 20 20 20 | 20 61 6e 64 20 45 20 6f |s D.. | and E o|
|00001d30| 66 20 74 68 65 20 50 43 | 20 44 4f 53 20 6d 61 6e |f the PC| DOS man|
|00001d40| 75 61 6c 2e 0d 0a 0a 33 | 2e 20 20 4c 65 61 72 6e |ual....3|. Learn|
|00001d50| 20 65 6e 6f 75 67 68 20 | 61 62 6f 75 74 20 74 68 | enough |about th|
|00001d60| 65 20 4d 41 43 52 4f 20 | 61 73 73 65 6d 62 6c 65 |e MACRO |assemble|
|00001d70| 72 20 61 6e 64 20 74 68 | 65 20 4c 49 4e 4b 65 72 |r and th|e LINKer|
|00001d80| 20 74 6f 20 77 72 69 74 | 65 20 73 6f 6d 65 0d 0a | to writ|e some..|
|00001d90| 20 20 20 20 73 69 6d 70 | 6c 65 20 74 68 69 6e 67 | simp|le thing|
|00001da0| 73 20 74 68 61 74 20 72 | 65 61 6c 6c 79 20 77 6f |s that r|eally wo|
|00001db0| 72 6b 2e 20 20 48 65 72 | 65 2c 20 74 6f 6f 2c 20 |rk. Her|e, too, |
|00001dc0| 74 68 65 20 6d 61 69 6e | 20 74 68 69 6e 67 20 69 |the main| thing i|
|00001dd0| 73 20 66 69 67 75 72 69 | 6e 67 0d 0a 20 20 20 20 |s figuri|ng.. |
|00001de0| 6f 75 74 20 77 68 61 74 | 20 79 6f 75 20 64 6f 6e |out what| you don|
|00001df0| 27 74 20 6e 65 65 64 20 | 74 6f 20 6b 6e 6f 77 2e |'t need |to know.|
|00001e00| 20 20 57 68 61 74 65 76 | 65 72 20 79 6f 75 20 64 | Whatev|er you d|
|00001e10| 6f 2c 20 64 6f 6e 27 74 | 20 73 74 75 64 79 20 74 |o, don't| study t|
|00001e20| 68 65 20 73 61 6d 2d 0d | 0a 20 20 20 20 70 6c 65 |he sam-.|. ple|
|00001e30| 20 70 72 6f 67 72 61 6d | 73 20 64 69 73 74 72 69 | program|s distri|
|00001e40| 62 75 74 65 64 20 77 69 | 74 68 20 74 68 65 20 61 |buted wi|th the a|
|00001e50| 73 73 65 6d 62 6c 65 72 | 20 75 6e 6c 65 73 73 20 |ssembler| unless |
|00001e60| 79 6f 75 20 68 61 76 65 | 20 6e 6f 74 68 69 6e 67 |you have| nothing|
|00001e70| 0d 0a 20 20 20 20 62 65 | 74 74 65 72 21 0d 0a 0a |.. be|tter!...|
|00001e80| 34 2e 20 20 41 74 20 74 | 68 65 20 73 61 6d 65 20 |4. At t|he same |
|00001e90| 74 69 6d 65 20 61 73 20 | 79 6f 75 20 61 72 65 20 |time as |you are |
|00001ea0| 6c 65 61 72 6e 69 6e 67 | 20 74 68 65 20 61 73 73 |learning| the ass|
|00001eb0| 65 6d 62 6c 65 72 20 69 | 74 73 65 6c 66 2c 20 79 |embler i|tself, y|
|00001ec0| 6f 75 20 77 69 6c 6c 0d | 0a 20 20 20 20 6e 65 65 |ou will.|. nee|
|00001ed0| 64 20 74 6f 20 6c 65 61 | 72 6e 20 61 20 66 65 77 |d to lea|rn a few|
|00001ee0| 20 74 6f 6f 6c 73 20 61 | 6e 64 20 63 6f 6e 63 65 | tools a|nd conce|
|00001ef0| 70 74 73 20 74 6f 20 70 | 72 6f 70 65 72 6c 79 20 |pts to p|roperly |
|00001f00| 63 6f 6d 62 69 6e 65 20 | 79 6f 75 72 20 61 73 73 |combine |your ass|
|00001f10| 65 6d 2d 0d 0a 20 20 20 | 20 62 6c 65 72 20 63 6f |em-.. | bler co|
|00001f20| 64 65 20 77 69 74 68 20 | 74 68 65 20 6f 74 68 65 |de with |the othe|
|00001f30| 72 20 74 68 69 6e 67 73 | 20 79 6f 75 20 64 6f 2e |r things| you do.|
|00001f40| 20 20 49 66 20 79 6f 75 | 20 70 6c 61 6e 20 74 6f | If you| plan to|
|00001f50| 20 63 61 6c 6c 20 61 73 | 73 65 6d 62 6c 65 72 0d | call as|sembler.|
|00001f60| 0a 20 20 20 20 73 75 62 | 72 6f 75 74 69 6e 65 73 |. sub|routines|
|00001f70| 20 66 72 6f 6d 20 61 20 | 68 69 67 68 20 6c 65 76 | from a |high lev|
|00001f80| 65 6c 20 6c 61 6e 67 75 | 61 67 65 2c 20 79 6f 75 |el langu|age, you|
|00001f90| 20 77 69 6c 6c 20 6e 65 | 65 64 20 74 6f 20 73 74 | will ne|ed to st|
|00001fa0| 75 64 79 20 74 68 65 0d | 0a 20 20 20 20 69 6e 74 |udy the.|. int|
|00001fb0| 65 72 66 61 63 65 20 6e | 6f 74 65 73 20 70 72 6f |erface n|otes pro|
|00001fc0| 76 69 64 65 64 20 69 6e | 20 79 6f 75 72 20 6c 61 |vided in| your la|
|00001fd0| 6e 67 75 61 67 65 20 6d | 61 6e 75 61 6c 2e 20 20 |nguage m|anual. |
|00001fe0| 55 73 75 61 6c 6c 79 2c | 20 74 68 69 73 20 66 6f |Usually,| this fo|
|00001ff0| 72 6d 73 0d 0a 20 20 20 | 20 61 6e 20 61 70 70 65 |rms.. | an appe|
|00002000| 6e 64 69 78 20 6f 66 20 | 73 6f 6d 65 20 73 6f 72 |ndix of |some sor|
|00002010| 74 2e 20 20 49 66 20 79 | 6f 75 20 70 6c 61 6e 20 |t. If y|ou plan |
|00002020| 74 6f 20 70 61 63 6b 61 | 67 65 20 79 6f 75 72 20 |to packa|ge your |
|00002030| 61 73 73 65 6d 62 6c 65 | 72 20 72 6f 75 2d 0d 0a |assemble|r rou-..|
|00002040| 20 20 20 20 74 69 6e 65 | 73 20 61 73 20 2e 43 4f | tine|s as .CO|
|00002050| 4d 20 70 72 6f 67 72 61 | 6d 73 20 79 6f 75 20 77 |M progra|ms you w|
|00002060| 69 6c 6c 20 6e 65 65 64 | 20 74 6f 20 6c 65 61 72 |ill need| to lear|
|00002070| 6e 20 74 6f 20 64 6f 20 | 74 68 69 73 2e 20 20 59 |n to do |this. Y|
|00002080| 6f 75 20 73 68 6f 75 6c | 64 0d 0a 20 20 20 20 61 |ou shoul|d.. a|
|00002090| 6c 73 6f 20 6c 65 61 72 | 6e 20 74 6f 20 75 73 65 |lso lear|n to use|
|000020a0| 20 44 45 42 55 47 2e 0d | 0a 0a 35 2e 20 20 52 65 | DEBUG..|..5. Re|
|000020b0| 61 64 20 74 68 65 20 54 | 65 63 68 6e 69 63 61 6c |ad the T|echnical|
|000020c0| 20 52 65 66 65 72 65 6e | 63 65 2c 20 62 75 74 20 | Referen|ce, but |
|000020d0| 76 65 72 79 20 73 65 6c | 65 63 74 69 76 65 6c 79 |very sel|ectively|
|000020e0| 2e 20 20 54 68 65 20 6d | 6f 73 74 20 69 6d 70 6f |. The m|ost impo|
|000020f0| 72 74 61 6e 74 0d 0a 20 | 20 20 20 74 68 69 6e 67 |rtant.. | thing|
|00002100| 73 20 74 6f 20 6b 6e 6f | 77 20 61 72 65 20 74 68 |s to kno|w are th|
|00002110| 65 20 68 65 61 64 65 72 | 20 63 6f 6d 6d 65 6e 74 |e header| comment|
|00002120| 73 20 69 6e 20 74 68 65 | 20 42 49 4f 53 20 6c 69 |s in the| BIOS li|
|00002130| 73 74 69 6e 67 2e 20 20 | 4e 65 78 74 2c 20 79 6f |sting. |Next, yo|
|00002140| 75 0d 0a 20 20 20 20 77 | 69 6c 6c 20 77 61 6e 74 |u.. w|ill want|
|00002150| 20 74 6f 20 6c 65 61 72 | 6e 20 61 62 6f 75 74 20 | to lear|n about |
|00002160| 74 68 65 20 52 53 20 32 | 33 32 20 70 6f 72 74 20 |the RS 2|32 port |
|00002170| 61 6e 64 20 6d 61 79 62 | 65 20 61 62 6f 75 74 20 |and mayb|e about |
|00002180| 74 68 65 20 76 69 64 65 | 6f 0d 0a 20 20 20 20 61 |the vide|o.. a|
|00002190| 64 61 70 74 65 72 73 2e | 0d 0a 0a 0a 0d 0a 0a 49 |dapters.|.......I|
|000021a0| 42 4d 20 50 43 20 41 73 | 73 65 6d 62 6c 79 20 4c |BM PC As|sembly L|
|000021b0| 61 6e 67 75 61 67 65 20 | 54 75 74 6f 72 69 61 6c |anguage |Tutorial|
|000021c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000021e0| 20 20 20 20 20 20 20 20 | 20 33 0d 0a 0d 0c 0d 0a | | 3......|
|000021f0| 0a 4e 6f 74 69 63 65 20 | 74 68 61 74 20 74 68 65 |.Notice |that the|
|00002200| 20 6b 65 79 20 74 68 69 | 6e 67 20 69 6e 20 61 6c | key thi|ng in al|
|00002210| 6c 20 66 69 76 65 20 70 | 68 61 73 65 73 20 69 73 |l five p|hases is|
|00002220| 20 62 65 69 6e 67 20 73 | 65 6c 65 63 74 69 76 65 | being s|elective|
|00002230| 2e 20 20 49 74 20 69 73 | 0d 0a 65 61 73 79 20 74 |. It is|..easy t|
|00002240| 6f 20 63 6f 6e 63 6c 75 | 64 65 20 74 68 61 74 20 |o conclu|de that |
|00002250| 74 68 65 72 65 20 69 73 | 20 74 6f 6f 20 6d 75 63 |there is| too muc|
|00002260| 68 20 74 6f 20 6c 65 61 | 72 6e 20 75 6e 6c 65 73 |h to lea|rn unles|
|00002270| 73 20 79 6f 75 20 63 61 | 6e 20 74 68 72 6f 77 20 |s you ca|n throw |
|00002280| 61 77 61 79 0d 0a 77 68 | 61 74 20 79 6f 75 20 64 |away..wh|at you d|
|00002290| 6f 6e 27 74 20 6e 65 65 | 64 2e 20 20 4d 6f 73 74 |on't nee|d. Most|
|000022a0| 20 6f 66 20 74 68 65 20 | 72 65 73 74 20 6f 66 20 | of the |rest of |
|000022b0| 74 68 69 73 20 74 61 6c | 6b 20 69 73 20 67 6f 69 |this tal|k is goi|
|000022c0| 6e 67 20 74 6f 20 64 65 | 61 6c 20 77 69 74 68 0d |ng to de|al with.|
|000022d0| 0a 74 68 69 73 20 76 65 | 72 79 20 69 6d 70 6f 72 |.this ve|ry impor|
|000022e0| 74 61 6e 74 20 71 75 65 | 73 74 69 6f 6e 20 6f 66 |tant que|stion of|
|000022f0| 20 77 68 61 74 20 79 6f | 75 20 6e 65 65 64 20 61 | what yo|u need a|
|00002300| 6e 64 20 64 6f 6e 27 74 | 20 6e 65 65 64 20 74 6f |nd don't| need to|
|00002310| 20 6c 65 61 72 6e 20 69 | 6e 0d 0a 65 61 63 68 20 | learn i|n..each |
|00002320| 70 68 61 73 65 2e 20 20 | 49 6e 20 73 6f 6d 65 20 |phase. |In some |
|00002330| 63 61 73 65 73 2c 20 49 | 20 77 69 6c 6c 20 68 61 |cases, I| will ha|
|00002340| 76 65 20 74 6f 20 6c 65 | 61 76 65 20 79 6f 75 20 |ve to le|ave you |
|00002350| 74 6f 20 64 6f 20 61 6c | 6d 6f 73 74 20 61 6c 6c |to do al|most all|
|00002360| 20 6f 66 0d 0a 74 68 65 | 20 6c 65 61 72 6e 69 6e | of..the| learnin|
|00002370| 67 2c 20 69 6e 20 6f 74 | 68 65 72 73 2c 20 49 20 |g, in ot|hers, I |
|00002380| 77 69 6c 6c 20 74 65 61 | 63 68 20 61 20 66 65 77 |will tea|ch a few|
|00002390| 20 73 61 6c 69 65 6e 74 | 20 70 6f 69 6e 74 73 2c | salient| points,|
|000023a0| 20 65 6e 6f 75 67 68 2c | 20 49 20 68 6f 70 65 2c | enough,| I hope,|
|000023b0| 0d 0a 74 6f 20 67 65 74 | 20 79 6f 75 20 73 74 61 |..to get| you sta|
|000023c0| 72 74 65 64 2e 20 20 49 | 20 68 6f 70 65 20 79 6f |rted. I| hope yo|
|000023d0| 75 20 75 6e 64 65 72 73 | 74 61 6e 64 20 74 68 61 |u unders|tand tha|
|000023e0| 74 20 61 6c 6c 20 49 20 | 63 61 6e 20 64 6f 20 69 |t all I |can do i|
|000023f0| 6e 20 61 6e 20 68 6f 75 | 72 20 69 73 0d 0a 67 65 |n an hou|r is..ge|
|00002400| 74 20 79 6f 75 20 73 74 | 61 72 74 65 64 20 6f 6e |t you st|arted on|
|00002410| 20 74 68 65 20 77 61 79 | 2e 0d 0a 0d 0a 0a 0a 50 | the way|.......P|
|00002420| 68 61 73 65 20 31 3a 20 | 20 4c 65 61 72 6e 20 74 |hase 1: | Learn t|
|00002430| 68 65 20 61 72 63 68 69 | 74 65 63 74 75 72 65 20 |he archi|tecture |
|00002440| 61 6e 64 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |and inst|ruction |
|00002450| 73 65 74 0d 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |set.____|________|
|00002460| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002470| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002480| 5f 5f 5f 5f 5f 5f 5f 5f | 0d 50 68 61 73 65 20 31 |________|.Phase 1|
|00002490| 3a 20 20 4c 65 61 72 6e | 20 74 68 65 20 61 72 63 |: Learn| the arc|
|000024a0| 68 69 74 65 63 74 75 72 | 65 20 61 6e 64 20 69 6e |hitectur|e and in|
|000024b0| 73 74 72 75 63 74 69 6f | 6e 20 73 65 74 0d 50 68 |structio|n set.Ph|
|000024c0| 61 73 65 20 31 3a 20 20 | 4c 65 61 72 6e 20 74 68 |ase 1: |Learn th|
|000024d0| 65 20 61 72 63 68 69 74 | 65 63 74 75 72 65 20 61 |e archit|ecture a|
|000024e0| 6e 64 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 20 73 |nd instr|uction s|
|000024f0| 65 74 0d 50 68 61 73 65 | 20 31 3a 20 20 4c 65 61 |et.Phase| 1: Lea|
|00002500| 72 6e 20 74 68 65 20 61 | 72 63 68 69 74 65 63 74 |rn the a|rchitect|
|00002510| 75 72 65 20 61 6e 64 20 | 69 6e 73 74 72 75 63 74 |ure and |instruct|
|00002520| 69 6f 6e 20 73 65 74 0d | 0a 0a 0a 54 68 65 20 4d |ion set.|...The M|
|00002530| 6f 72 73 65 20 62 6f 6f | 6b 20 6d 69 67 68 74 20 |orse boo|k might |
|00002540| 73 65 65 6d 20 6c 69 6b | 65 20 61 20 6c 6f 74 20 |seem lik|e a lot |
|00002550| 6f 66 20 62 6f 6f 6b 20 | 74 6f 20 62 75 79 20 66 |of book |to buy f|
|00002560| 6f 72 20 6a 75 73 74 20 | 74 77 6f 20 72 65 61 6c |or just |two real|
|00002570| 6c 79 0d 0a 69 6d 70 6f | 72 74 61 6e 74 20 63 68 |ly..impo|rtant ch|
|00002580| 61 70 74 65 72 73 3b 20 | 6f 74 68 65 72 20 62 6f |apters; |other bo|
|00002590| 6f 6b 73 20 64 65 76 6f | 74 65 20 61 20 6c 6f 74 |oks devo|te a lot|
|000025a0| 20 6d 6f 72 65 20 73 70 | 61 63 65 20 74 6f 20 74 | more sp|ace to t|
|000025b0| 68 65 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 0d 0a |he instr|uction..|
|000025c0| 73 65 74 20 61 6e 64 20 | 67 69 76 65 20 79 6f 75 |set and |give you|
|000025d0| 20 61 20 62 69 67 20 62 | 65 61 75 74 69 66 75 6c | a big b|eautiful|
|000025e0| 20 72 65 66 65 72 65 6e | 63 65 20 70 61 67 65 20 | referen|ce page |
|000025f0| 6f 6e 20 65 61 63 68 20 | 69 6e 73 74 72 75 63 74 |on each |instruct|
|00002600| 69 6f 6e 2e 20 20 41 6e | 64 2c 0d 0a 73 6f 6d 65 |ion. An|d,..some|
|00002610| 20 6f 66 20 74 68 65 20 | 6f 74 68 65 72 20 74 68 | of the |other th|
|00002620| 69 6e 67 73 20 69 6e 20 | 74 68 65 20 4d 6f 72 73 |ings in |the Mors|
|00002630| 65 20 62 6f 6f 6b 2c 20 | 61 6c 74 68 6f 75 67 68 |e book, |although|
|00002640| 20 69 6e 74 65 72 65 73 | 74 69 6e 67 2c 20 72 65 | interes|ting, re|
|00002650| 61 6c 6c 79 0d 0a 61 72 | 65 6e 27 74 20 76 65 72 |ally..ar|en't ver|
|00002660| 79 20 76 69 74 61 6c 20 | 61 6e 64 20 61 72 65 20 |y vital |and are |
|00002670| 63 6f 76 65 72 65 64 20 | 74 6f 6f 20 73 6b 65 74 |covered |too sket|
|00002680| 63 68 69 6c 79 20 74 6f | 20 62 65 20 6f 66 20 61 |chily to| be of a|
|00002690| 6e 79 20 72 65 61 6c 20 | 68 65 6c 70 2e 0d 0a 54 |ny real |help...T|
|000026a0| 68 65 20 72 65 61 73 6f | 6e 20 49 20 6c 69 6b 65 |he reaso|n I like|
|000026b0| 20 74 68 65 20 4d 6f 72 | 73 65 20 62 6f 6f 6b 20 | the Mor|se book |
|000026c0| 69 73 20 74 68 61 74 20 | 79 6f 75 20 63 61 6e 20 |is that |you can |
|000026d0| 6a 75 73 74 20 72 65 61 | 64 20 69 74 3b 20 69 74 |just rea|d it; it|
|000026e0| 20 68 61 73 20 61 0d 0a | 76 65 72 79 20 63 6f 6e | has a..|very con|
|000026f0| 76 65 72 73 61 74 69 6f | 6e 61 6c 20 73 74 79 6c |versatio|nal styl|
|00002700| 65 2c 20 69 74 20 69 73 | 20 76 65 72 79 20 6c 75 |e, it is| very lu|
|00002710| 63 69 64 2c 20 69 74 20 | 74 65 6c 6c 73 20 79 6f |cid, it |tells yo|
|00002720| 75 20 77 68 61 74 20 79 | 6f 75 20 72 65 61 6c 6c |u what y|ou reall|
|00002730| 79 0d 0a 6e 65 65 64 20 | 74 6f 20 6b 6e 6f 77 2c |y..need |to know,|
|00002740| 20 61 6e 64 20 61 20 6c | 69 74 74 6c 65 20 62 69 | and a l|ittle bi|
|00002750| 74 20 6d 6f 72 65 20 77 | 68 69 63 68 20 69 73 20 |t more w|hich is |
|00002760| 62 79 20 77 61 79 20 6f | 66 20 62 61 63 6b 67 72 |by way o|f backgr|
|00002770| 6f 75 6e 64 3b 20 62 65 | 63 61 75 73 65 0d 0a 6e |ound; be|cause..n|
|00002780| 6f 74 68 69 6e 67 20 72 | 65 61 6c 6c 79 20 67 65 |othing r|eally ge|
|00002790| 74 73 20 62 65 6c 61 62 | 6f 72 65 64 20 74 6f 20 |ts belab|ored to |
|000027a0| 6d 75 63 68 2c 20 79 6f | 75 20 63 61 6e 20 67 72 |much, yo|u can gr|
|000027b0| 61 63 65 66 75 6c 6c 79 | 20 66 6f 72 67 65 74 20 |acefully| forget |
|000027c0| 74 68 65 20 74 68 69 6e | 67 73 0d 0a 79 6f 75 20 |the thin|gs..you |
|000027d0| 64 6f 6e 27 74 20 75 73 | 65 2e 20 20 41 6e 64 2c |don't us|e. And,|
|000027e0| 20 49 20 76 65 72 79 20 | 6d 75 63 68 20 72 65 63 | I very |much rec|
|000027f0| 6f 6d 6d 65 6e 64 20 52 | 45 41 44 49 4e 47 20 4d |ommend R|EADING M|
|00002800| 6f 72 73 65 20 72 61 74 | 68 65 72 20 74 68 61 6e |orse rat|her than|
|00002810| 20 73 74 75 64 79 2d 0d | 0a 69 6e 67 20 69 74 2e | study-.|.ing it.|
|00002820| 20 20 47 65 74 20 74 68 | 65 20 62 69 67 20 70 69 | Get th|e big pi|
|00002830| 63 74 75 72 65 20 61 74 | 20 74 68 69 73 20 70 6f |cture at| this po|
|00002840| 69 6e 74 2e 0d 0a 0a 4e | 6f 77 2c 20 79 6f 75 20 |int....N|ow, you |
|00002850| 77 61 6e 74 20 74 6f 20 | 63 6f 6e 63 65 6e 74 72 |want to |concentr|
|00002860| 61 74 65 20 6f 6e 20 74 | 68 6f 73 65 20 74 68 69 |ate on t|hose thi|
|00002870| 6e 67 73 20 77 68 69 63 | 68 20 61 72 65 20 77 6f |ngs whic|h are wo|
|00002880| 72 74 68 20 66 69 78 69 | 6e 67 20 69 6e 20 6d 65 |rth fixi|ng in me|
|00002890| 6d 2d 0d 0a 6f 72 79 2e | 20 20 41 66 74 65 72 20 |m-..ory.| After |
|000028a0| 79 6f 75 20 72 65 61 64 | 20 4d 6f 72 73 65 2c 20 |you read| Morse, |
|000028b0| 79 6f 75 20 73 68 6f 75 | 6c 64 20 72 65 6c 61 74 |you shou|ld relat|
|000028c0| 65 20 77 68 61 74 20 79 | 6f 75 20 68 61 76 65 20 |e what y|ou have |
|000028d0| 6c 65 61 72 6e 65 64 20 | 74 6f 20 74 68 69 73 0d |learned |to this.|
|000028e0| 0a 6f 75 74 6c 69 6e 65 | 2e 0d 0a 0a 31 2e 20 20 |.outline|....1. |
|000028f0| 59 6f 75 20 77 61 6e 74 | 20 74 6f 20 66 69 78 20 |You want| to fix |
|00002900| 69 6e 20 79 6f 75 72 20 | 6d 69 6e 64 20 74 68 65 |in your |mind the|
|00002910| 20 69 64 65 61 20 6f 66 | 20 74 68 65 20 66 6f 75 | idea of| the fou|
|00002920| 72 20 73 65 67 6d 65 6e | 74 20 72 65 67 69 73 74 |r segmen|t regist|
|00002930| 65 72 73 0d 0a 20 20 20 | 20 43 4f 44 45 2c 20 44 |ers.. | CODE, D|
|00002940| 41 54 41 2c 20 53 54 41 | 43 4b 2c 20 61 6e 64 20 |ATA, STA|CK, and |
|00002950| 45 58 54 52 41 2e 20 20 | 54 68 69 73 20 70 61 72 |EXTRA. |This par|
|00002960| 74 20 69 73 20 70 72 65 | 74 74 79 20 65 61 73 79 |t is pre|tty easy|
|00002970| 20 74 6f 20 67 72 61 73 | 70 2e 20 20 54 68 65 0d | to gras|p. The.|
|00002980| 0a 20 20 20 20 38 30 38 | 36 20 61 6e 64 20 74 68 |. 808|6 and th|
|00002990| 65 20 38 30 38 38 20 75 | 73 65 20 32 30 20 62 69 |e 8088 u|se 20 bi|
|000029a0| 74 20 61 64 64 72 65 73 | 73 65 73 20 66 6f 72 20 |t addres|ses for |
|000029b0| 6d 65 6d 6f 72 79 2c 20 | 6d 65 61 6e 69 6e 67 20 |memory, |meaning |
|000029c0| 74 68 61 74 20 74 68 65 | 79 0d 0a 20 20 20 20 63 |that the|y.. c|
|000029d0| 61 6e 20 61 64 64 72 65 | 73 73 20 75 70 20 74 6f |an addre|ss up to|
|000029e0| 20 31 20 6d 65 67 61 62 | 79 74 65 20 6f 66 20 6d | 1 megab|yte of m|
|000029f0| 65 6d 6f 72 79 2e 20 20 | 42 75 74 2c 20 74 68 65 |emory. |But, the|
|00002a00| 20 72 65 67 69 73 74 65 | 72 73 20 61 6e 64 20 74 | registe|rs and t|
|00002a10| 68 65 0d 0a 20 20 20 20 | 61 64 64 72 65 73 73 20 |he.. |address |
|00002a20| 66 69 65 6c 64 73 20 69 | 6e 20 61 6c 6c 20 74 68 |fields i|n all th|
|00002a30| 65 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 20 61 |e instru|ctions a|
|00002a40| 72 65 20 6e 6f 20 6d 6f | 72 65 20 74 68 61 74 20 |re no mo|re that |
|00002a50| 31 36 20 62 69 74 73 20 | 6c 6f 6e 67 2e 0d 0a 20 |16 bits |long... |
|00002a60| 20 20 20 53 6f 2c 20 68 | 6f 77 20 74 6f 20 61 64 | So, h|ow to ad|
|00002a70| 64 72 65 73 73 20 61 6c | 6c 20 6f 66 20 74 68 61 |dress al|l of tha|
|00002a80| 74 20 6d 65 6d 6f 72 79 | 3f 20 20 54 68 65 69 72 |t memory|? Their|
|00002a90| 20 73 6f 6c 75 74 69 6f | 6e 20 69 73 20 74 6f 20 | solutio|n is to |
|00002aa0| 70 75 74 0d 0a 20 20 20 | 20 74 6f 67 65 74 68 65 |put.. | togethe|
|00002ab0| 72 20 74 77 6f 20 31 36 | 20 62 69 74 20 71 75 61 |r two 16| bit qua|
|00002ac0| 6e 74 69 74 69 65 73 20 | 6c 69 6b 65 20 74 68 69 |ntities |like thi|
|00002ad0| 73 3a 0d 0a 0a 20 20 20 | 20 20 20 63 61 6c 63 75 |s:... | calcu|
|00002ae0| 6c 61 74 69 6f 6e 20 20 | 53 53 53 53 30 20 20 20 |lation |SSSS0 |
|00002af0| 2d 2d 2d 2d 20 76 61 6c | 75 65 20 69 6e 20 74 68 |---- val|ue in th|
|00002b00| 65 20 72 65 6c 65 76 61 | 6e 74 20 73 65 67 6d 65 |e releva|nt segme|
|00002b10| 6e 74 20 72 65 67 69 73 | 74 65 72 20 53 48 4c 20 |nt regis|ter SHL |
|00002b20| 34 0d 0a 20 20 20 20 20 | 20 64 65 70 69 63 74 65 |4.. | depicte|
|00002b30| 64 20 69 6e 20 20 20 41 | 41 41 41 20 20 20 2d 2d |d in A|AAA --|
|00002b40| 2d 2d 20 61 70 70 61 72 | 65 6e 74 20 61 64 64 72 |-- appar|ent addr|
|00002b50| 65 73 73 20 66 72 6f 6d | 20 72 65 67 69 73 74 65 |ess from| registe|
|00002b60| 72 20 6f 72 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |r or ins|truction|
|00002b70| 0d 0a 20 20 20 20 20 20 | 68 65 78 61 64 65 63 69 |.. |hexadeci|
|00002b80| 6d 61 6c 20 2d 2d 2d 2d | 2d 2d 2d 2d 0d 0a 20 20 |mal ----|----.. |
|00002b90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ba0| 20 52 52 52 52 52 20 20 | 20 2d 2d 2d 2d 20 72 65 | RRRRR | ---- re|
|00002bb0| 61 6c 20 61 64 64 72 65 | 73 73 20 70 6c 61 63 65 |al addre|ss place|
|00002bc0| 64 20 6f 6e 20 61 64 64 | 72 65 73 73 20 62 75 73 |d on add|ress bus|
|00002bd0| 0d 0a 0a 20 20 20 20 49 | 6e 20 6f 74 68 65 72 20 |... I|n other |
|00002be0| 77 6f 72 64 73 2c 20 61 | 6e 79 20 74 69 6d 65 20 |words, a|ny time |
|00002bf0| 6d 65 6d 6f 72 79 20 69 | 73 20 61 63 63 65 73 73 |memory i|s access|
|00002c00| 65 64 2c 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d |ed, your| program|
|00002c10| 20 77 69 6c 6c 20 73 75 | 70 70 6c 79 20 61 0d 0a | will su|pply a..|
|00002c20| 20 20 20 20 73 69 78 74 | 65 65 6e 20 62 69 74 20 | sixt|een bit |
|00002c30| 61 64 64 72 65 73 73 2e | 20 20 41 6e 6f 74 68 65 |address.| Anothe|
|00002c40| 72 20 73 69 78 74 65 65 | 6e 20 62 69 74 20 61 64 |r sixtee|n bit ad|
|00002c50| 64 72 65 73 73 20 69 73 | 20 61 63 71 75 69 72 65 |dress is| acquire|
|00002c60| 64 20 66 72 6f 6d 20 61 | 0d 0a 20 20 20 20 73 65 |d from a|.. se|
|00002c70| 67 6d 65 6e 74 20 72 65 | 67 69 73 74 65 72 2c 20 |gment re|gister, |
|00002c80| 6c 65 66 74 20 73 68 69 | 66 74 65 64 20 66 6f 75 |left shi|fted fou|
|00002c90| 72 20 62 69 74 73 20 28 | 6f 6e 65 20 6e 69 62 62 |r bits (|one nibb|
|00002ca0| 6c 65 29 20 61 6e 64 20 | 61 64 64 65 64 20 74 6f |le) and |added to|
|00002cb0| 20 69 74 0d 0a 20 20 20 | 20 74 6f 20 66 6f 72 6d | it.. | to form|
|00002cc0| 20 74 68 65 20 72 65 61 | 6c 20 61 64 64 72 65 73 | the rea|l addres|
|00002cd0| 73 2e 20 20 59 6f 75 20 | 63 61 6e 20 63 6f 6e 74 |s. You |can cont|
|00002ce0| 72 6f 6c 20 74 68 65 20 | 76 61 6c 75 65 73 20 69 |rol the |values i|
|00002cf0| 6e 20 74 68 65 20 73 65 | 67 6d 65 6e 74 0d 0a 20 |n the se|gment.. |
|00002d00| 20 20 20 72 65 67 69 73 | 74 65 72 73 20 61 6e 64 | regis|ters and|
|00002d10| 20 74 68 75 73 20 61 63 | 63 65 73 73 20 61 6e 79 | thus ac|cess any|
|00002d20| 20 70 61 72 74 20 6f 66 | 20 6d 65 6d 6f 72 79 20 | part of| memory |
|00002d30| 79 6f 75 20 77 61 6e 74 | 2e 20 20 42 75 74 20 74 |you want|. But t|
|00002d40| 68 65 20 73 65 67 6d 65 | 6e 74 0d 0a 20 20 20 20 |he segme|nt.. |
|00002d50| 72 65 67 69 73 74 65 72 | 73 20 61 72 65 20 73 70 |register|s are sp|
|00002d60| 65 63 69 61 6c 69 7a 65 | 64 3a 20 20 6f 6e 65 20 |ecialize|d: one |
|00002d70| 66 6f 72 20 63 6f 64 65 | 2c 20 6f 6e 65 20 66 6f |for code|, one fo|
|00002d80| 72 20 6d 6f 73 74 20 64 | 61 74 61 20 61 63 63 65 |r most d|ata acce|
|00002d90| 73 73 65 73 2c 0d 0a 20 | 20 20 20 6f 6e 65 20 66 |sses,.. | one f|
|00002da0| 6f 72 20 74 68 65 20 73 | 74 61 63 6b 20 28 77 68 |or the s|tack (wh|
|00002db0| 69 63 68 20 77 65 27 6c | 6c 20 6d 65 6e 74 69 6f |ich we'l|l mentio|
|00002dc0| 6e 20 61 67 61 69 6e 29 | 20 61 6e 64 20 6f 6e 65 |n again)| and one|
|00002dd0| 20 22 65 78 74 72 61 22 | 20 6f 6e 65 20 66 6f 72 | "extra"| one for|
|00002de0| 0d 0a 20 20 20 20 61 64 | 64 69 74 69 6f 6e 61 6c |.. ad|ditional|
|00002df0| 20 64 61 74 61 20 61 63 | 63 65 73 73 65 73 2e 0d | data ac|cesses..|
|00002e00| 0a 0a 20 20 20 20 4d 6f | 73 74 20 70 65 6f 70 6c |.. Mo|st peopl|
|00002e10| 65 2c 20 77 68 65 6e 20 | 74 68 65 79 20 66 69 72 |e, when |they fir|
|00002e20| 73 74 20 6c 65 61 72 6e | 20 61 62 6f 75 74 20 74 |st learn| about t|
|00002e30| 68 69 73 20 61 64 64 72 | 65 73 73 69 6e 67 20 73 |his addr|essing s|
|00002e40| 63 68 65 6d 65 20 62 65 | 63 6f 6d 65 0d 0a 20 20 |cheme be|come.. |
|00002e50| 20 20 6f 62 73 65 73 73 | 65 64 20 77 69 74 68 20 | obsess|ed with |
|00002e60| 63 6f 6e 76 65 72 74 69 | 6e 67 20 65 76 65 72 79 |converti|ng every|
|00002e70| 74 68 69 6e 67 20 74 6f | 20 72 65 61 6c 20 32 30 |thing to| real 20|
|00002e80| 20 62 69 74 20 61 64 64 | 72 65 73 73 65 73 2e 20 | bit add|resses. |
|00002e90| 20 41 66 74 65 72 20 61 | 0d 0a 20 20 20 20 77 68 | After a|.. wh|
|00002ea0| 69 6c 65 2c 20 74 68 6f | 75 67 68 2c 20 79 6f 75 |ile, tho|ugh, you|
|00002eb0| 20 67 65 74 20 75 73 65 | 20 74 6f 20 74 68 69 6e | get use| to thin|
|00002ec0| 6b 69 6e 67 20 69 6e 20 | 73 65 67 6d 65 6e 74 2f |king in |segment/|
|00002ed0| 6f 66 66 73 65 74 20 66 | 6f 72 6d 2e 20 20 59 6f |offset f|orm. Yo|
|00002ee0| 75 0d 0a 0a 0a 49 42 4d | 20 50 43 20 41 73 73 65 |u....IBM| PC Asse|
|00002ef0| 6d 62 6c 79 20 4c 61 6e | 67 75 61 67 65 20 54 75 |mbly Lan|guage Tu|
|00002f00| 74 6f 72 69 61 6c 20 20 | 20 20 20 20 20 20 20 20 |torial | |
|00002f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002f20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 34 | | 4|
|00002f30| 0d 0a 0d 0c 0d 0a 0a 20 | 20 20 20 74 65 6e 64 20 |....... | tend |
|00002f40| 74 6f 20 67 65 74 20 79 | 6f 75 72 20 73 65 67 6d |to get y|our segm|
|00002f50| 65 6e 74 20 72 65 67 69 | 73 74 65 72 73 20 73 65 |ent regi|sters se|
|00002f60| 74 20 75 70 20 61 74 20 | 74 68 65 20 62 65 67 69 |t up at |the begi|
|00002f70| 6e 6e 69 6e 67 20 6f 66 | 20 74 68 65 20 70 72 6f |nning of| the pro|
|00002f80| 2d 0d 0a 20 20 20 20 67 | 72 61 6d 2c 20 63 68 61 |-.. g|ram, cha|
|00002f90| 6e 67 65 20 74 68 65 6d | 20 61 73 20 6c 69 74 74 |nge them| as litt|
|00002fa0| 6c 65 20 61 73 20 70 6f | 73 73 69 62 6c 65 2c 20 |le as po|ssible, |
|00002fb0| 61 6e 64 20 74 68 69 6e | 6b 20 6a 75 73 74 20 69 |and thin|k just i|
|00002fc0| 6e 20 74 65 72 6d 73 20 | 6f 66 0d 0a 20 20 20 20 |n terms |of.. |
|00002fd0| 73 79 6d 62 6f 6c 69 63 | 20 6c 6f 63 61 74 69 6f |symbolic| locatio|
|00002fe0| 6e 73 20 69 6e 20 79 6f | 75 72 20 70 72 6f 67 72 |ns in yo|ur progr|
|00002ff0| 61 6d 2c 20 61 73 20 77 | 69 74 68 20 61 6e 79 20 |am, as w|ith any |
|00003000| 61 73 73 65 6d 62 6c 79 | 20 6c 61 6e 67 75 61 67 |assembly| languag|
|00003010| 65 2e 0d 0a 0a 20 20 20 | 20 20 20 45 58 41 4d 50 |e.... | EXAMP|
|00003020| 4c 45 3a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |LE:.. | |
|00003030| 4d 4f 56 20 20 41 58 2c | 44 41 54 41 53 45 47 0d |MOV AX,|DATASEG.|
|00003040| 0a 20 20 20 20 20 20 20 | 20 20 20 20 4d 4f 56 20 |. | MOV |
|00003050| 20 44 53 2c 41 58 20 20 | 20 20 20 20 20 20 20 20 | DS,AX | |
|00003060| 3b 53 65 74 20 76 61 6c | 75 65 20 6f 66 20 44 61 |;Set val|ue of Da|
|00003070| 74 61 20 73 65 67 6d 65 | 6e 74 0d 0a 20 20 20 20 |ta segme|nt.. |
|00003080| 20 20 20 20 20 20 20 41 | 53 53 55 4d 45 20 44 53 | A|SSUME DS|
|00003090| 3a 44 41 54 41 53 45 47 | 20 20 20 3b 54 65 6c 6c |:DATASEG| ;Tell|
|000030a0| 20 61 73 73 65 6d 62 6c | 65 72 20 44 53 20 69 73 | assembl|er DS is|
|000030b0| 20 75 73 61 62 6c 65 0d | 0a 20 20 20 20 20 20 20 | usable.|. |
|000030c0| 20 20 20 20 2e 2e 2e 2e | 2e 2e 2e 0d 0a 20 20 20 | ....|..... |
|000030d0| 20 20 20 20 20 20 20 20 | 4d 4f 56 20 20 41 58 2c | |MOV AX,|
|000030e0| 50 4c 41 43 45 20 20 20 | 20 20 20 20 3b 41 63 63 |PLACE | ;Acc|
|000030f0| 65 73 73 20 73 74 6f 72 | 61 67 65 20 73 79 6d 62 |ess stor|age symb|
|00003100| 6f 6c 69 63 61 6c 6c 79 | 20 62 79 20 31 36 20 62 |olically| by 16 b|
|00003110| 69 74 20 61 64 64 72 65 | 73 73 0d 0a 0a 20 20 20 |it addre|ss... |
|00003120| 20 49 6e 20 74 68 65 20 | 61 62 6f 76 65 20 65 78 | In the |above ex|
|00003130| 61 6d 70 6c 65 2c 20 74 | 68 65 20 61 73 73 65 6d |ample, t|he assem|
|00003140| 62 6c 65 72 20 6b 6e 6f | 77 73 20 74 68 61 74 20 |bler kno|ws that |
|00003150| 6e 6f 20 73 70 65 63 69 | 61 6c 20 69 73 73 75 65 |no speci|al issue|
|00003160| 73 20 61 72 65 0d 0a 20 | 20 20 20 69 6e 76 6f 6c |s are.. | invol|
|00003170| 76 65 64 20 62 65 63 61 | 75 73 65 20 74 68 65 20 |ved beca|use the |
|00003180| 6d 61 63 68 69 6e 65 20 | 67 65 6e 65 72 61 6c 6c |machine |generall|
|00003190| 79 20 75 73 65 73 20 74 | 68 65 20 44 53 20 72 65 |y uses t|he DS re|
|000031a0| 67 69 73 74 65 72 20 74 | 6f 20 63 6f 6d 70 6c 65 |gister t|o comple|
|000031b0| 74 65 0d 0a 20 20 20 20 | 61 20 6e 6f 72 6d 61 6c |te.. |a normal|
|000031c0| 20 64 61 74 61 20 72 65 | 66 65 72 65 6e 63 65 2e | data re|ference.|
|000031d0| 0d 0a 0a 20 20 20 20 49 | 66 20 79 6f 75 20 68 61 |... I|f you ha|
|000031e0| 64 20 75 73 65 64 20 45 | 53 20 69 6e 73 74 65 61 |d used E|S instea|
|000031f0| 64 20 6f 66 20 44 53 20 | 69 6e 20 74 68 65 20 61 |d of DS |in the a|
|00003200| 62 6f 76 65 20 65 78 61 | 6d 70 6c 65 2c 20 74 68 |bove exa|mple, th|
|00003210| 65 20 61 73 73 65 6d 62 | 6c 65 72 0d 0a 20 20 20 |e assemb|ler.. |
|00003220| 20 77 6f 75 6c 64 20 68 | 61 76 65 20 6b 6e 6f 77 | would h|ave know|
|00003230| 6e 20 77 68 61 74 20 74 | 6f 20 64 6f 2c 20 61 6c |n what t|o do, al|
|00003240| 73 6f 2e 20 20 49 6e 20 | 66 72 6f 6e 74 20 6f 66 |so. In |front of|
|00003250| 20 74 68 65 20 4d 4f 56 | 20 69 6e 73 74 72 75 63 | the MOV| instruc|
|00003260| 74 69 6f 6e 0d 0a 20 20 | 20 20 77 68 69 63 68 20 |tion.. | which |
|00003270| 61 63 63 65 73 73 65 64 | 20 74 68 65 20 6c 6f 63 |accessed| the loc|
|00003280| 61 74 69 6f 6e 20 50 4c | 41 43 45 2c 20 69 74 20 |ation PL|ACE, it |
|00003290| 77 6f 75 6c 64 20 68 61 | 76 65 20 70 6c 61 63 65 |would ha|ve place|
|000032a0| 64 20 74 68 65 20 45 53 | 20 73 65 67 6d 65 6e 74 |d the ES| segment|
|000032b0| 0d 0a 20 20 20 20 70 72 | 65 66 69 78 2e 20 20 54 |.. pr|efix. T|
|000032c0| 68 69 73 20 77 6f 75 6c | 64 20 74 65 6c 6c 20 74 |his woul|d tell t|
|000032d0| 68 65 20 6d 61 63 68 69 | 6e 65 20 74 68 61 74 20 |he machi|ne that |
|000032e0| 45 53 20 73 68 6f 75 6c | 64 20 62 65 20 75 73 65 |ES shoul|d be use|
|000032f0| 64 2c 20 69 6e 73 74 65 | 61 64 20 6f 66 0d 0a 20 |d, inste|ad of.. |
|00003300| 20 20 20 44 53 2c 20 74 | 6f 20 63 6f 6d 70 6c 65 | DS, t|o comple|
|00003310| 74 65 20 74 68 65 20 61 | 64 64 72 65 73 73 2e 0d |te the a|ddress..|
|00003320| 0a 0a 20 20 20 20 53 6f | 6d 65 20 63 6f 6e 76 65 |.. So|me conve|
|00003330| 6e 74 69 6f 6e 73 20 6d | 61 6b 65 20 69 74 20 65 |ntions m|ake it e|
|00003340| 73 70 65 63 69 61 6c 6c | 79 20 65 61 73 79 20 74 |speciall|y easy t|
|00003350| 6f 20 66 6f 72 67 65 74 | 20 61 62 6f 75 74 20 73 |o forget| about s|
|00003360| 65 67 6d 65 6e 74 20 72 | 65 67 69 73 2d 0d 0a 20 |egment r|egis-.. |
|00003370| 20 20 20 74 65 72 73 2e | 20 20 46 6f 72 20 65 78 | ters.| For ex|
|00003380| 61 6d 70 6c 65 2c 20 61 | 6e 79 20 70 72 6f 67 72 |ample, a|ny progr|
|00003390| 61 6d 20 6f 66 20 74 68 | 65 20 43 4f 4d 20 74 79 |am of th|e COM ty|
|000033a0| 70 65 20 67 65 74 73 20 | 63 6f 6e 74 72 6f 6c 20 |pe gets |control |
|000033b0| 77 69 74 68 20 61 6c 6c | 0d 0a 20 20 20 20 66 6f |with all|.. fo|
|000033c0| 75 72 20 73 65 67 6d 65 | 6e 74 20 72 65 67 69 73 |ur segme|nt regis|
|000033d0| 74 65 72 73 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ters con|taining |
|000033e0| 74 68 65 20 73 61 6d 65 | 20 76 61 6c 75 65 2e 20 |the same| value. |
|000033f0| 20 54 68 69 73 20 70 72 | 6f 67 72 61 6d 20 65 78 | This pr|ogram ex|
|00003400| 65 2d 0d 0a 20 20 20 20 | 63 75 74 65 73 20 69 6e |e-.. |cutes in|
|00003410| 20 61 20 73 69 6d 70 6c | 69 66 69 65 64 20 36 34 | a simpl|ified 64|
|00003420| 4b 20 61 64 64 72 65 73 | 73 20 73 70 61 63 65 2e |K addres|s space.|
|00003430| 20 20 59 6f 75 20 63 61 | 6e 20 67 6f 20 6f 75 74 | You ca|n go out|
|00003440| 73 69 64 65 20 74 68 69 | 73 0d 0a 20 20 20 20 61 |side thi|s.. a|
|00003450| 64 64 72 65 73 73 20 73 | 70 61 63 65 20 69 66 20 |ddress s|pace if |
|00003460| 79 6f 75 20 77 61 6e 74 | 20 62 75 74 20 79 6f 75 |you want| but you|
|00003470| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 6f 2e 0d | don't h|ave to..|
|00003480| 0a 0a 32 2e 20 20 59 6f | 75 20 77 69 6c 6c 20 77 |..2. Yo|u will w|
|00003490| 61 6e 74 20 74 6f 20 6c | 65 61 72 6e 20 77 68 61 |ant to l|earn wha|
|000034a0| 74 20 6f 74 68 65 72 20 | 72 65 67 69 73 74 65 72 |t other |register|
|000034b0| 73 20 61 72 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |s are av|ailable |
|000034c0| 61 6e 64 20 6c 65 61 72 | 6e 0d 0a 20 20 20 20 74 |and lear|n.. t|
|000034d0| 68 65 69 72 20 70 65 72 | 73 6f 6e 61 6c 69 74 69 |heir per|sonaliti|
|000034e0| 65 73 3a 0d 0a 0a 20 20 | 20 20 00 20 20 20 41 58 |es:... | . AX|
|000034f0| 20 61 6e 64 20 44 58 20 | 61 72 65 20 67 65 6e 65 | and DX |are gene|
|00003500| 72 61 6c 20 70 75 72 70 | 6f 73 65 20 72 65 67 69 |ral purp|ose regi|
|00003510| 73 74 65 72 73 2e 20 20 | 54 68 65 79 20 62 65 63 |sters. |They bec|
|00003520| 6f 6d 65 20 73 70 65 63 | 69 61 6c 20 6f 6e 6c 79 |ome spec|ial only|
|00003530| 0d 0a 20 20 20 20 20 20 | 20 20 77 68 65 6e 20 61 |.. | when a|
|00003540| 63 63 65 73 73 69 6e 67 | 20 6d 61 63 68 69 6e 65 |ccessing| machine|
|00003550| 20 61 6e 64 20 73 79 73 | 74 65 6d 20 69 6e 74 65 | and sys|tem inte|
|00003560| 72 66 61 63 65 73 2e 0d | 0a 0a 20 20 20 20 00 20 |rfaces..|.. . |
|00003570| 20 20 43 58 20 69 73 20 | 61 20 67 65 6e 65 72 61 | CX is |a genera|
|00003580| 6c 20 70 75 72 70 6f 73 | 65 20 72 65 67 69 73 74 |l purpos|e regist|
|00003590| 65 72 20 77 68 69 63 68 | 20 69 73 20 73 6c 69 67 |er which| is slig|
|000035a0| 68 74 6c 79 20 73 70 65 | 63 69 61 6c 69 7a 65 64 |htly spe|cialized|
|000035b0| 20 66 6f 72 0d 0a 20 20 | 20 20 20 20 20 20 63 6f | for.. | co|
|000035c0| 75 6e 74 69 6e 67 2e 0d | 0a 0a 20 20 20 20 00 20 |unting..|.. . |
|000035d0| 20 20 42 58 20 69 73 20 | 61 20 67 65 6e 65 72 61 | BX is |a genera|
|000035e0| 6c 20 70 75 72 70 6f 73 | 65 20 72 65 67 69 73 74 |l purpos|e regist|
|000035f0| 65 72 20 77 68 69 63 68 | 20 69 73 20 73 6c 69 67 |er which| is slig|
|00003600| 68 74 6c 79 20 73 70 65 | 63 69 61 6c 69 7a 65 64 |htly spe|cialized|
|00003610| 20 66 6f 72 0d 0a 20 20 | 20 20 20 20 20 20 66 6f | for.. | fo|
|00003620| 72 6d 69 6e 67 20 62 61 | 73 65 2d 64 69 73 70 6c |rming ba|se-displ|
|00003630| 61 63 65 6d 65 6e 74 20 | 61 64 64 72 65 73 73 65 |acement |addresse|
|00003640| 73 2e 0d 0a 0a 20 20 20 | 20 00 20 20 20 41 58 2d |s.... | . AX-|
|00003650| 44 58 20 63 61 6e 20 62 | 65 20 64 69 76 69 64 65 |DX can b|e divide|
|00003660| 64 20 69 6e 20 68 61 6c | 66 2c 20 66 6f 72 6d 69 |d in hal|f, formi|
|00003670| 6e 67 20 41 48 2c 20 41 | 4c 2c 20 42 48 2c 20 42 |ng AH, A|L, BH, B|
|00003680| 4c 2c 20 43 48 2c 20 43 | 4c 2c 20 44 48 2c 0d 0a |L, CH, C|L, DH,..|
|00003690| 20 20 20 20 20 20 20 20 | 44 4c 2e 0d 0a 0a 20 20 | |DL.... |
|000036a0| 20 20 00 20 20 20 53 49 | 20 61 6e 64 20 44 49 20 | . SI| and DI |
|000036b0| 61 72 65 20 73 74 72 69 | 63 74 6c 79 20 31 36 20 |are stri|ctly 16 |
|000036c0| 62 69 74 2e 20 20 54 68 | 65 79 20 63 61 6e 20 62 |bit. Th|ey can b|
|000036d0| 65 20 75 73 65 64 20 74 | 6f 20 66 6f 72 6d 20 69 |e used t|o form i|
|000036e0| 6e 64 65 78 65 64 0d 0a | 20 20 20 20 20 20 20 20 |ndexed..| |
|000036f0| 61 64 64 72 65 73 73 65 | 73 20 28 6c 69 6b 65 20 |addresse|s (like |
|00003700| 42 58 29 20 61 6e 64 20 | 74 68 65 79 20 61 72 65 |BX) and |they are|
|00003710| 20 61 6c 73 6f 20 75 73 | 65 64 20 74 6f 20 70 6f | also us|ed to po|
|00003720| 69 6e 74 20 74 6f 20 73 | 74 72 69 6e 67 73 2e 0d |int to s|trings..|
|00003730| 0a 0a 20 20 20 20 00 20 | 20 20 53 50 20 69 73 20 |.. . | SP is |
|00003740| 68 61 72 64 6c 79 20 65 | 76 65 72 20 6d 61 6e 69 |hardly e|ver mani|
|00003750| 70 75 6c 61 74 65 64 2e | 20 20 49 74 20 69 73 20 |pulated.| It is |
|00003760| 74 68 65 72 65 20 74 6f | 20 70 72 6f 76 69 64 65 |there to| provide|
|00003770| 20 61 20 73 74 61 63 6b | 2e 0d 0a 0a 20 20 20 20 | a stack|.... |
|00003780| 00 20 20 20 42 50 20 69 | 73 20 61 20 6d 61 6e 69 |. BP i|s a mani|
|00003790| 70 75 6c 61 62 6c 65 20 | 63 6f 75 73 69 6e 20 74 |pulable |cousin t|
|000037a0| 6f 20 53 50 2e 20 20 55 | 73 65 20 69 74 20 74 6f |o SP. U|se it to|
|000037b0| 20 61 63 63 65 73 73 20 | 64 61 74 61 20 77 68 69 | access |data whi|
|000037c0| 63 68 20 68 61 73 0d 0a | 20 20 20 20 20 20 20 20 |ch has..| |
|000037d0| 62 65 65 6e 20 70 75 73 | 68 65 64 20 6f 6e 74 6f |been pus|hed onto|
|000037e0| 20 74 68 65 20 73 74 61 | 63 6b 2e 0d 0a 0a 20 20 | the sta|ck.... |
|000037f0| 20 20 00 20 20 20 4d 6f | 73 74 20 73 69 78 74 65 | . Mo|st sixte|
|00003800| 65 6e 20 62 69 74 20 6f | 70 65 72 61 74 69 6f 6e |en bit o|peration|
|00003810| 73 20 61 72 65 20 6c 65 | 67 61 6c 20 28 65 76 65 |s are le|gal (eve|
|00003820| 6e 20 69 66 20 75 6e 75 | 73 75 61 6c 29 20 77 68 |n if unu|sual) wh|
|00003830| 65 6e 20 70 65 72 2d 0d | 0a 20 20 20 20 20 20 20 |en per-.|. |
|00003840| 20 66 6f 72 6d 65 64 20 | 69 6e 20 53 49 2c 20 44 | formed |in SI, D|
|00003850| 49 2c 20 53 50 2c 20 6f | 72 20 42 50 2e 0d 0a 0d |I, SP, o|r BP....|
|00003860| 0a 0a 0a 0d 0a 0a 49 42 | 4d 20 50 43 20 41 73 73 |......IB|M PC Ass|
|00003870| 65 6d 62 6c 79 20 4c 61 | 6e 67 75 61 67 65 20 54 |embly La|nguage T|
|00003880| 75 74 6f 72 69 61 6c 20 | 20 20 20 20 20 20 20 20 |utorial | |
|00003890| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000038a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000038b0| 35 0d 0a 0d 0c 0d 0a 0a | 33 2e 20 20 59 6f 75 20 |5.......|3. You |
|000038c0| 77 69 6c 6c 20 77 61 6e | 74 20 74 6f 20 6c 65 61 |will wan|t to lea|
|000038d0| 72 6e 20 74 68 65 20 63 | 6c 61 73 73 69 66 69 63 |rn the c|lassific|
|000038e0| 61 74 69 6f 6e 73 20 6f | 66 20 6f 70 65 72 61 74 |ations o|f operat|
|000038f0| 69 6f 6e 73 20 61 76 61 | 69 6c 61 62 6c 65 0d 0a |ions ava|ilable..|
|00003900| 20 20 20 20 57 49 54 48 | 4f 55 54 20 67 65 74 74 | WITH|OUT gett|
|00003910| 69 6e 67 20 68 75 6e 67 | 20 75 70 20 69 6e 20 74 |ing hung| up in t|
|00003920| 68 65 20 64 65 74 61 69 | 6c 73 20 6f 66 20 68 6f |he detai|ls of ho|
|00003930| 77 20 38 30 38 36 20 6f | 70 63 6f 64 65 73 20 61 |w 8086 o|pcodes a|
|00003940| 72 65 20 63 6f 6e 2d 0d | 0a 20 20 20 20 73 74 72 |re con-.|. str|
|00003950| 75 63 74 65 64 2e 0d 0a | 0a 20 20 20 20 38 30 38 |ucted...|. 808|
|00003960| 36 20 6f 70 63 6f 64 65 | 73 20 61 72 65 20 63 6f |6 opcode|s are co|
|00003970| 6d 70 6c 65 78 2e 20 20 | 46 6f 72 74 75 6e 61 74 |mplex. |Fortunat|
|00003980| 65 6c 79 2c 20 74 68 65 | 20 61 73 73 65 6d 62 6c |ely, the| assembl|
|00003990| 65 72 20 6f 70 63 6f 64 | 65 73 20 75 73 65 64 20 |er opcod|es used |
|000039a0| 74 6f 0d 0a 20 20 20 20 | 61 73 73 65 6d 62 6c 65 |to.. |assemble|
|000039b0| 20 74 68 65 6d 20 61 72 | 65 20 73 69 6d 70 6c 65 | them ar|e simple|
|000039c0| 2e 20 20 57 68 65 6e 20 | 79 6f 75 20 72 65 61 64 |. When |you read|
|000039d0| 20 61 20 62 6f 6f 6b 20 | 6c 69 6b 65 20 4d 6f 72 | a book |like Mor|
|000039e0| 73 65 2c 20 79 6f 75 20 | 77 69 6c 6c 0d 0a 20 20 |se, you |will.. |
|000039f0| 20 20 6c 65 61 72 6e 20 | 73 6f 6d 65 20 74 68 69 | learn |some thi|
|00003a00| 6e 67 73 20 77 68 69 63 | 68 20 61 72 65 20 77 6f |ngs whic|h are wo|
|00003a10| 72 74 68 20 6b 6e 6f 77 | 69 6e 67 20 62 75 74 20 |rth know|ing but |
|00003a20| 4e 4f 54 20 77 6f 72 74 | 68 20 64 77 65 6c 6c 69 |NOT wort|h dwelli|
|00003a30| 6e 67 20 6f 6e 2e 0d 0a | 0a 20 20 20 20 61 2e 20 |ng on...|. a. |
|00003a40| 20 38 30 38 36 20 61 6e | 64 20 38 30 38 38 20 69 | 8086 an|d 8088 i|
|00003a50| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 63 61 6e 20 |nstructi|ons can |
|00003a60| 62 65 20 62 72 6f 6b 65 | 6e 20 75 70 20 69 6e 74 |be broke|n up int|
|00003a70| 6f 20 73 75 62 66 69 65 | 6c 64 73 20 61 6e 64 20 |o subfie|lds and |
|00003a80| 62 69 74 73 0d 0a 20 20 | 20 20 20 20 20 20 77 69 |bits.. | wi|
|00003a90| 74 68 20 6e 61 6d 65 73 | 20 6c 69 6b 65 20 52 2f |th names| like R/|
|00003aa0| 4d 2c 20 4d 4f 44 2c 20 | 53 20 61 6e 64 20 57 2e |M, MOD, |S and W.|
|00003ab0| 20 54 68 65 73 65 20 70 | 61 72 74 73 20 6f 66 20 | These p|arts of |
|00003ac0| 74 68 65 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 0d |the inst|ruction.|
|00003ad0| 0a 20 20 20 20 20 20 20 | 20 6d 6f 64 69 66 79 20 |. | modify |
|00003ae0| 74 68 65 20 62 61 73 69 | 63 20 6f 70 65 72 61 74 |the basi|c operat|
|00003af0| 69 6f 6e 20 69 6e 20 73 | 75 63 68 20 77 61 79 73 |ion in s|uch ways|
|00003b00| 20 61 73 20 77 68 65 74 | 68 65 72 20 69 74 20 69 | as whet|her it i|
|00003b10| 73 20 38 20 62 69 74 20 | 6f 72 0d 0a 20 20 20 20 |s 8 bit |or.. |
|00003b20| 20 20 20 20 31 36 20 62 | 69 74 2c 20 69 66 20 31 | 16 b|it, if 1|
|00003b30| 36 20 62 69 74 2c 20 77 | 68 65 74 68 65 72 20 61 |6 bit, w|hether a|
|00003b40| 6c 6c 20 31 36 20 62 69 | 74 73 20 6f 66 20 74 68 |ll 16 bi|ts of th|
|00003b50| 65 20 64 61 74 61 20 61 | 72 65 20 67 69 76 65 6e |e data a|re given|
|00003b60| 2c 0d 0a 20 20 20 20 20 | 20 20 20 77 68 65 74 68 |,.. | wheth|
|00003b70| 65 72 20 74 68 65 20 69 | 6e 73 74 72 75 63 74 69 |er the i|nstructi|
|00003b80| 6f 6e 20 69 73 20 72 65 | 67 69 73 74 65 72 20 74 |on is re|gister t|
|00003b90| 6f 20 72 65 67 69 73 74 | 65 72 2c 20 72 65 67 69 |o regist|er, regi|
|00003ba0| 73 74 65 72 20 74 6f 0d | 0a 20 20 20 20 20 20 20 |ster to.|. |
|00003bb0| 20 6d 65 6d 6f 72 79 2c | 20 6f 72 20 6d 65 6d 6f | memory,| or memo|
|00003bc0| 72 79 20 74 6f 20 72 65 | 67 69 73 74 65 72 2c 20 |ry to re|gister, |
|00003bd0| 66 6f 72 20 6f 70 65 72 | 61 6e 64 73 20 77 68 69 |for oper|ands whi|
|00003be0| 63 68 20 61 72 65 20 72 | 65 67 69 73 74 65 72 73 |ch are r|egisters|
|00003bf0| 2c 0d 0a 20 20 20 20 20 | 20 20 20 77 68 69 63 68 |,.. | which|
|00003c00| 20 72 65 67 69 73 74 65 | 72 2c 20 66 6f 72 20 6f | registe|r, for o|
|00003c10| 70 65 72 61 6e 64 73 20 | 77 68 69 63 68 20 61 72 |perands |which ar|
|00003c20| 65 20 6d 65 6d 6f 72 79 | 2c 20 77 68 61 74 20 62 |e memory|, what b|
|00003c30| 61 73 65 20 61 6e 64 20 | 69 6e 64 65 78 0d 0a 20 |ase and |index.. |
|00003c40| 20 20 20 20 20 20 20 72 | 65 67 69 73 74 65 72 73 | r|egisters|
|00003c50| 20 73 68 6f 75 6c 64 20 | 62 65 20 75 73 65 64 20 | should |be used |
|00003c60| 69 6e 20 66 69 6e 64 69 | 6e 67 20 74 68 65 20 64 |in findi|ng the d|
|00003c70| 61 74 61 2e 0d 0a 0a 20 | 20 20 20 62 2e 20 20 41 |ata.... | b. A|
|00003c80| 6c 73 6f 2c 20 73 6f 6d | 65 20 69 6e 73 74 72 75 |lso, som|e instru|
|00003c90| 63 74 69 6f 6e 73 20 61 | 72 65 20 61 63 74 75 61 |ctions a|re actua|
|00003ca0| 6c 6c 79 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 |lly repr|esented |
|00003cb0| 62 79 20 73 65 76 65 72 | 61 6c 20 64 69 66 66 65 |by sever|al diffe|
|00003cc0| 72 2d 0d 0a 20 20 20 20 | 20 20 20 20 65 6e 74 20 |r-.. | ent |
|00003cd0| 6d 61 63 68 69 6e 65 20 | 6f 70 63 6f 64 65 73 20 |machine |opcodes |
|00003ce0| 64 65 70 65 6e 64 69 6e | 67 20 6f 6e 20 77 68 65 |dependin|g on whe|
|00003cf0| 74 68 65 72 20 74 68 65 | 79 20 64 65 61 6c 20 77 |ther the|y deal w|
|00003d00| 69 74 68 20 69 6d 6d 65 | 64 69 61 74 65 0d 0a 20 |ith imme|diate.. |
|00003d10| 20 20 20 20 20 20 20 64 | 61 74 61 20 6f 72 20 6e | d|ata or n|
|00003d20| 6f 74 2c 20 6f 72 20 6f | 6e 20 6f 74 68 65 72 20 |ot, or o|n other |
|00003d30| 69 73 73 75 65 73 2c 20 | 61 6e 64 20 74 68 65 72 |issues, |and ther|
|00003d40| 65 20 61 72 65 20 73 6f | 6d 65 20 65 78 70 65 64 |e are so|me exped|
|00003d50| 69 74 65 64 20 66 6f 72 | 6d 73 0d 0a 20 20 20 20 |ited for|ms.. |
|00003d60| 20 20 20 20 77 68 69 63 | 68 20 61 73 73 75 6d 65 | whic|h assume|
|00003d70| 20 74 68 61 74 20 6f 6e | 65 20 6f 66 20 74 68 65 | that on|e of the|
|00003d80| 20 61 72 67 75 6d 65 6e | 74 73 20 69 73 20 74 68 | argumen|ts is th|
|00003d90| 65 20 6d 6f 73 74 20 63 | 6f 6d 6d 6f 6e 6c 79 20 |e most c|ommonly |
|00003da0| 75 73 65 64 0d 0a 20 20 | 20 20 20 20 20 20 6f 70 |used.. | op|
|00003db0| 65 72 61 6e 64 2c 20 6c | 69 6b 65 20 41 58 20 69 |erand, l|ike AX i|
|00003dc0| 6e 20 74 68 65 20 63 61 | 73 65 20 6f 66 20 61 72 |n the ca|se of ar|
|00003dd0| 69 74 68 6d 65 74 69 63 | 2e 0d 0a 0a 20 20 20 20 |ithmetic|.... |
|00003de0| 54 68 65 72 65 20 69 73 | 20 6e 6f 20 70 6f 69 6e |There is| no poin|
|00003df0| 74 20 69 6e 20 6d 65 6d | 6f 72 69 7a 69 6e 67 20 |t in mem|orizing |
|00003e00| 61 6e 79 20 6f 66 20 74 | 68 69 73 20 64 65 74 61 |any of t|his deta|
|00003e10| 69 6c 3b 20 6a 75 73 74 | 20 64 69 73 74 69 6c 6c |il; just| distill|
|00003e20| 20 74 68 65 0d 0a 20 20 | 20 20 62 6f 74 74 6f 6d | the.. | bottom|
|00003e30| 20 6c 69 6e 65 2c 20 77 | 68 69 63 68 20 69 73 2c | line, w|hich is,|
|00003e40| 20 77 68 61 74 20 6b 69 | 6e 64 73 20 6f 66 20 6f | what ki|nds of o|
|00003e50| 70 65 72 61 6e 64 20 63 | 6f 6d 62 69 6e 61 74 69 |perand c|ombinati|
|00003e60| 6f 6e 73 20 45 58 49 53 | 54 20 69 6e 20 74 68 65 |ons EXIS|T in the|
|00003e70| 0d 0a 20 20 20 20 69 6e | 73 74 72 75 63 74 69 6f |.. in|structio|
|00003e80| 6e 20 73 65 74 20 61 6e | 64 20 77 68 61 74 20 6b |n set an|d what k|
|00003e90| 69 6e 64 73 20 64 6f 6e | 27 74 2e 20 20 49 66 20 |inds don|'t. If |
|00003ea0| 79 6f 75 20 61 73 6b 20 | 74 68 65 20 61 73 73 65 |you ask |the asse|
|00003eb0| 6d 62 6c 65 72 20 74 6f | 20 41 44 44 0d 0a 20 20 |mbler to| ADD.. |
|00003ec0| 20 20 74 77 6f 20 74 68 | 69 6e 67 73 20 61 6e 64 | two th|ings and|
|00003ed0| 20 74 68 65 20 74 77 6f | 20 74 68 69 6e 67 73 20 | the two| things |
|00003ee0| 61 72 65 20 74 68 69 6e | 67 73 20 66 6f 72 20 77 |are thin|gs for w|
|00003ef0| 68 69 63 68 20 74 68 65 | 72 65 20 69 73 20 61 20 |hich the|re is a |
|00003f00| 6c 65 67 61 6c 20 41 44 | 44 0d 0a 20 20 20 20 69 |legal AD|D.. i|
|00003f10| 6e 73 74 72 75 63 74 69 | 6f 6e 20 73 6f 6d 65 77 |nstructi|on somew|
|00003f20| 68 65 72 65 20 69 6e 20 | 74 68 65 20 69 6e 73 74 |here in |the inst|
|00003f30| 72 75 63 74 69 6f 6e 20 | 73 65 74 2c 20 74 68 65 |ruction |set, the|
|00003f40| 20 61 73 73 65 6d 62 6c | 65 72 20 77 69 6c 6c 20 | assembl|er will |
|00003f50| 66 69 6e 64 0d 0a 20 20 | 20 20 74 68 65 20 72 69 |find.. | the ri|
|00003f60| 67 68 74 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 20 |ght inst|ruction |
|00003f70| 61 6e 64 20 66 69 6c 6c | 20 69 6e 20 61 6c 6c 20 |and fill| in all |
|00003f80| 74 68 65 20 6d 6f 64 69 | 66 69 65 72 20 66 69 65 |the modi|fier fie|
|00003f90| 6c 64 73 20 66 6f 72 20 | 79 6f 75 2e 0d 0a 0a 20 |lds for |you.... |
|00003fa0| 20 20 20 49 20 67 75 65 | 73 73 20 69 66 20 79 6f | I gue|ss if yo|
|00003fb0| 75 20 6d 65 6d 6f 72 69 | 7a 65 64 20 61 6c 6c 20 |u memori|zed all |
|00003fc0| 74 68 65 20 6f 70 63 6f | 64 65 20 63 6f 6e 73 74 |the opco|de const|
|00003fd0| 72 75 63 74 69 6f 6e 20 | 72 75 6c 65 73 20 79 6f |ruction |rules yo|
|00003fe0| 75 20 6d 69 67 68 74 0d | 0a 20 20 20 20 68 61 76 |u might.|. hav|
|00003ff0| 65 20 61 20 63 72 61 63 | 6b 20 61 74 20 62 65 69 |e a crac|k at bei|
|00004000| 6e 67 20 61 62 6c 65 20 | 74 6f 20 64 69 73 61 73 |ng able |to disas|
|00004010| 73 65 6d 62 6c 65 20 68 | 65 78 20 64 75 6d 70 73 |semble h|ex dumps|
|00004020| 20 62 79 20 65 79 65 2c | 20 6c 69 6b 65 20 79 6f | by eye,| like yo|
|00004030| 75 0d 0a 20 20 20 20 6d | 61 79 20 68 61 76 65 20 |u.. m|ay have |
|00004040| 6c 65 61 72 6e 65 64 20 | 74 6f 20 64 6f 20 73 6f |learned |to do so|
|00004050| 6d 65 77 68 61 74 20 77 | 69 74 68 20 33 37 30 20 |mewhat w|ith 370 |
|00004060| 61 73 73 65 6d 62 6c 65 | 72 2e 20 20 49 20 73 75 |assemble|r. I su|
|00004070| 62 6d 69 74 20 74 6f 20 | 79 6f 75 0d 0a 20 20 20 |bmit to |you.. |
|00004080| 20 74 68 61 74 20 74 68 | 69 73 20 66 65 61 74 2c | that th|is feat,|
|00004090| 20 69 66 20 65 76 65 72 | 20 6d 61 73 74 65 72 65 | if ever| mastere|
|000040a0| 64 20 62 79 20 61 6e 79 | 6f 6e 65 2c 20 77 6f 75 |d by any|one, wou|
|000040b0| 6c 64 20 62 65 20 69 6e | 20 74 68 65 20 73 61 6d |ld be in| the sam|
|000040c0| 65 20 63 6c 61 73 73 0d | 0a 20 20 20 20 61 73 20 |e class.|. as |
|000040d0| 70 6c 61 79 69 6e 67 20 | 74 68 65 20 22 4d 69 6e |playing |the "Min|
|000040e0| 75 74 65 20 57 61 6c 74 | 7a 22 20 69 6e 20 61 20 |ute Walt|z" in a |
|000040f0| 6d 69 6e 75 74 65 3b 20 | 61 20 63 75 72 69 6f 73 |minute; |a curios|
|00004100| 69 74 79 20 6f 6e 6c 79 | 2e 0d 0a 0a 20 20 20 20 |ity only|.... |
|00004110| 48 65 72 65 20 69 73 20 | 74 68 65 20 62 61 73 69 |Here is |the basi|
|00004120| 63 20 6d 61 74 72 69 78 | 20 79 6f 75 20 73 68 6f |c matrix| you sho|
|00004130| 75 6c 64 20 72 65 6d 65 | 6d 62 65 72 3a 0d 0a 0d |uld reme|mber:...|
|00004140| 0a 0a 0a 0d 0a 0a 0a 0d | 0a 0a 0a 0d 0a 0a 0a 0d |........|........|
|00004150| 0a 0a 0a 0d 0a 0a 0a 0d | 0a 0a 49 42 4d 20 50 43 |........|..IBM PC|
|00004160| 20 41 73 73 65 6d 62 6c | 79 20 4c 61 6e 67 75 61 | Assembl|y Langua|
|00004170| 67 65 20 54 75 74 6f 72 | 69 61 6c 20 20 20 20 20 |ge Tutor|ial |
|00004180| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000041a0| 20 20 20 20 36 0d 0a 0d | 0c 0d 0a 0a 20 20 20 20 | 6...|.... |
|000041b0| 20 20 20 20 20 54 77 6f | 20 6f 70 65 72 61 6e 64 | Two| operand|
|000041c0| 73 3a 20 20 20 20 20 20 | 20 20 20 20 4f 6e 65 20 |s: | One |
|000041d0| 6f 70 65 72 61 6e 64 3a | 0d 0a 20 20 20 20 20 20 |operand:|.. |
|000041e0| 20 20 20 20 52 20 3c 2d | 2d 20 4d 20 20 20 20 20 | R <-|- M |
|000041f0| 20 20 20 20 20 20 20 20 | 20 20 20 52 0d 0a 20 20 | | R.. |
|00004200| 20 20 20 20 20 20 20 20 | 4d 20 3c 2d 2d 20 52 20 | |M <-- R |
|00004210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 4d | | M|
|00004220| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 52 20 3c 2d |.. | R <-|
|00004230| 2d 20 52 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |- R | |
|00004240| 20 20 20 53 20 2a 0d 0a | 20 20 20 20 20 20 20 20 | S *..| |
|00004250| 20 20 52 7c 4d 20 3c 2d | 2d 20 49 0d 0a 20 20 20 | R|M <-|- I.. |
|00004260| 20 20 20 20 20 20 20 52 | 7c 4d 20 3c 2d 2d 20 53 | R||M <-- S|
|00004270| 20 20 2a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 53 | *.. | S|
|00004280| 20 3c 2d 2d 20 52 7c 4d | 20 20 2a 0d 0a 0a 20 20 | <-- R|M| *... |
|00004290| 20 20 20 20 2a 20 2d 2d | 20 64 61 74 61 20 6d 6f | * --| data mo|
|000042a0| 76 69 6e 67 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |ving ins|truction|
|000042b0| 73 20 28 4d 4f 56 2c 20 | 50 55 53 48 2c 20 50 4f |s (MOV, |PUSH, PO|
|000042c0| 50 29 20 6f 6e 6c 79 0d | 0a 20 20 20 20 20 20 53 |P) only.|. S|
|000042d0| 20 2d 2d 20 73 65 67 6d | 65 6e 74 20 72 65 67 69 | -- segm|ent regi|
|000042e0| 73 74 65 72 20 28 43 53 | 2c 20 44 53 2c 20 45 53 |ster (CS|, DS, ES|
|000042f0| 2c 20 53 53 29 0d 0a 20 | 20 20 20 20 20 52 20 2d |, SS).. | R -|
|00004300| 2d 20 6f 72 64 69 6e 61 | 72 79 20 72 65 67 69 73 |- ordina|ry regis|
|00004310| 74 65 72 20 28 41 58 2c | 20 42 58 2c 20 43 58 2c |ter (AX,| BX, CX,|
|00004320| 20 44 58 2c 20 53 49 2c | 20 44 49 2c 20 42 50 2c | DX, SI,| DI, BP,|
|00004330| 20 53 50 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | SP,.. | |
|00004340| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004350| 20 20 20 20 41 48 2c 20 | 41 4c 2c 20 42 48 2c 20 | AH, |AL, BH, |
|00004360| 42 4c 2c 20 43 48 2c 20 | 43 4c 2c 20 44 48 2c 20 |BL, CH, |CL, DH, |
|00004370| 44 4c 29 0d 0a 20 20 20 | 20 20 20 4d 20 2d 2d 20 |DL).. | M -- |
|00004380| 6f 6e 65 20 6f 66 20 74 | 68 65 20 66 6f 6c 6c 6f |one of t|he follo|
|00004390| 77 69 6e 67 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |wing.. | |
|000043a0| 20 20 20 20 20 70 75 72 | 65 20 61 64 64 72 65 73 | pur|e addres|
|000043b0| 73 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.. | |
|000043c0| 20 20 5b 42 58 5d 2b 6f | 66 66 73 65 74 0d 0a 20 | [BX]+o|ffset.. |
|000043d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5b 42 | | [B|
|000043e0| 50 5d 2b 6f 66 66 73 65 | 74 0d 0a 20 20 20 20 20 |P]+offse|t.. |
|000043f0| 20 20 20 20 20 20 20 20 | 20 20 61 6e 79 20 6f 66 | | any of|
|00004400| 20 74 68 65 20 61 62 6f | 76 65 20 69 6e 64 65 78 | the abo|ve index|
|00004410| 65 64 20 62 79 20 53 49 | 0d 0a 20 20 20 20 20 20 |ed by SI|.. |
|00004420| 20 20 20 20 20 20 20 20 | 20 61 6e 79 20 6f 66 20 | | any of |
|00004430| 74 68 65 20 66 69 72 73 | 74 20 74 68 72 65 65 20 |the firs|t three |
|00004440| 69 6e 64 65 78 65 64 20 | 62 79 20 44 49 0d 0a 0a |indexed |by DI...|
|00004450| 34 2e 20 20 4f 66 20 63 | 6f 75 72 73 65 2c 20 79 |4. Of c|ourse, y|
|00004460| 6f 75 20 77 61 6e 74 20 | 74 6f 20 6c 65 61 72 6e |ou want |to learn|
|00004470| 20 74 68 65 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 | the ope|rations |
|00004480| 74 68 65 6d 73 65 6c 76 | 65 73 2e 20 20 41 73 20 |themselv|es. As |
|00004490| 49 27 76 65 20 73 75 67 | 2d 0d 0a 20 20 20 20 67 |I've sug|-.. g|
|000044a0| 65 73 74 65 64 2c 20 79 | 6f 75 20 77 61 6e 74 20 |ested, y|ou want |
|000044b0| 74 6f 20 6c 65 61 72 6e | 20 74 68 65 20 6f 70 20 |to learn| the op |
|000044c0| 63 6f 64 65 73 20 61 73 | 20 74 68 65 20 61 73 73 |codes as| the ass|
|000044d0| 65 6d 62 6c 65 72 20 70 | 72 65 73 65 6e 74 73 20 |embler p|resents |
|000044e0| 74 68 65 6d 2c 0d 0a 20 | 20 20 20 6e 6f 74 20 61 |them,.. | not a|
|000044f0| 73 20 74 68 65 20 43 50 | 55 20 6d 61 63 68 69 6e |s the CP|U machin|
|00004500| 65 20 6c 61 6e 67 75 61 | 67 65 20 70 72 65 73 65 |e langua|ge prese|
|00004510| 6e 74 73 20 74 68 65 6d | 2e 20 20 53 6f 2c 20 65 |nts them|. So, e|
|00004520| 76 65 6e 20 74 68 6f 75 | 67 68 20 74 68 65 72 65 |ven thou|gh there|
|00004530| 0d 0a 20 20 20 20 61 72 | 65 20 6d 61 6e 79 20 4d |.. ar|e many M|
|00004540| 4f 56 20 6f 70 20 63 6f | 64 65 73 20 79 6f 75 20 |OV op co|des you |
|00004550| 64 6f 6e 27 74 20 6e 65 | 65 64 20 74 6f 20 6c 65 |don't ne|ed to le|
|00004560| 61 72 6e 20 74 68 65 6d | 2e 20 20 42 61 73 69 63 |arn them|. Basic|
|00004570| 61 6c 6c 79 2c 20 68 65 | 72 65 20 69 73 0d 0a 20 |ally, he|re is.. |
|00004580| 20 20 20 74 68 65 20 69 | 6e 73 74 72 75 63 74 69 | the i|nstructi|
|00004590| 6f 6e 20 73 65 74 3a 0d | 0a 0a 20 20 20 20 61 2e |on set:.|.. a.|
|000045a0| 20 20 4f 72 64 69 6e 61 | 72 79 20 74 77 6f 20 6f | Ordina|ry two o|
|000045b0| 70 65 72 61 6e 64 20 69 | 6e 73 74 72 75 63 74 69 |perand i|nstructi|
|000045c0| 6f 6e 73 2e 20 20 54 68 | 65 73 65 20 69 6e 73 74 |ons. Th|ese inst|
|000045d0| 72 75 63 74 69 6f 6e 73 | 20 70 65 72 66 6f 72 6d |ructions| perform|
|000045e0| 20 61 6e 0d 0a 20 20 20 | 20 20 20 20 20 6f 70 65 | an.. | ope|
|000045f0| 72 61 74 69 6f 6e 20 61 | 6e 64 20 6c 65 61 76 65 |ration a|nd leave|
|00004600| 20 74 68 65 20 72 65 73 | 75 6c 74 20 69 6e 20 70 | the res|ult in p|
|00004610| 6c 61 63 65 20 6f 66 20 | 6f 6e 65 20 6f 66 20 74 |lace of |one of t|
|00004620| 68 65 20 6f 70 65 72 61 | 6e 64 73 2e 0d 0a 20 20 |he opera|nds... |
|00004630| 20 20 20 20 20 20 54 68 | 65 79 20 61 72 65 0d 0a | Th|ey are..|
|00004640| 0a 20 20 20 20 20 20 20 | 20 31 29 20 20 41 44 44 |. | 1) ADD|
|00004650| 20 61 6e 64 20 41 44 43 | 20 2d 2d 20 61 64 64 69 | and ADC| -- addi|
|00004660| 74 69 6f 6e 2c 20 77 69 | 74 68 20 6f 72 20 77 69 |tion, wi|th or wi|
|00004670| 74 68 6f 75 74 20 69 6e | 63 6c 75 64 69 6e 67 20 |thout in|cluding |
|00004680| 61 20 63 61 72 72 79 20 | 66 72 6f 6d 0d 0a 20 20 |a carry |from.. |
|00004690| 20 20 20 20 20 20 20 20 | 20 20 61 20 70 72 65 76 | | a prev|
|000046a0| 69 6f 75 73 20 61 64 64 | 69 74 69 6f 6e 0d 0a 0a |ious add|ition...|
|000046b0| 20 20 20 20 20 20 20 20 | 32 29 20 20 53 55 42 20 | |2) SUB |
|000046c0| 61 6e 64 20 53 42 42 20 | 2d 2d 20 73 75 62 74 72 |and SBB |-- subtr|
|000046d0| 61 63 74 69 6f 6e 2c 20 | 77 69 74 68 20 6f 72 20 |action, |with or |
|000046e0| 77 69 74 68 6f 75 74 20 | 69 6e 63 6c 75 64 69 6e |without |includin|
|000046f0| 67 20 61 20 62 6f 72 72 | 6f 77 0d 0a 20 20 20 20 |g a borr|ow.. |
|00004700| 20 20 20 20 20 20 20 20 | 66 72 6f 6d 20 61 20 70 | |from a p|
|00004710| 72 65 76 69 6f 75 73 20 | 73 75 62 74 72 61 63 74 |revious |subtract|
|00004720| 69 6f 6e 0d 0a 0a 20 20 | 20 20 20 20 20 20 33 29 |ion... | 3)|
|00004730| 20 20 43 4d 50 20 2d 2d | 20 63 6f 6d 70 61 72 65 | CMP --| compare|
|00004740| 2e 20 20 49 74 20 69 73 | 20 75 73 65 66 75 6c 20 |. It is| useful |
|00004750| 74 6f 20 74 68 69 6e 6b | 20 6f 66 20 74 68 69 73 |to think| of this|
|00004760| 20 61 73 20 61 20 73 75 | 62 74 72 61 63 74 69 6f | as a su|btractio|
|00004770| 6e 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 77 |n.. | w|
|00004780| 69 74 68 20 74 68 65 20 | 61 6e 73 77 65 72 20 62 |ith the |answer b|
|00004790| 65 69 6e 67 20 74 68 72 | 6f 77 6e 20 61 77 61 79 |eing thr|own away|
|000047a0| 20 61 6e 64 20 6e 65 69 | 74 68 65 72 20 6f 70 65 | and nei|ther ope|
|000047b0| 72 61 6e 64 20 61 63 74 | 75 61 6c 6c 79 0d 0a 20 |rand act|ually.. |
|000047c0| 20 20 20 20 20 20 20 20 | 20 20 20 63 68 61 6e 67 | | chang|
|000047d0| 65 64 0d 0a 0a 20 20 20 | 20 20 20 20 20 34 29 20 |ed... | 4) |
|000047e0| 20 41 4e 44 2c 20 4f 52 | 2c 20 58 4f 52 20 2d 2d | AND, OR|, XOR --|
|000047f0| 20 74 79 70 69 63 61 6c | 20 62 6f 6f 6c 65 61 6e | typical| boolean|
|00004800| 20 6f 70 65 72 61 74 69 | 6f 6e 73 0d 0a 0a 20 20 | operati|ons... |
|00004810| 20 20 20 20 20 20 35 29 | 20 20 54 45 53 54 20 2d | 5)| TEST -|
|00004820| 2d 20 6c 69 6b 65 20 61 | 6e 20 41 4e 44 2c 20 65 |- like a|n AND, e|
|00004830| 78 63 65 70 74 20 74 68 | 65 20 61 6e 73 77 65 72 |xcept th|e answer|
|00004840| 20 69 73 20 74 68 72 6f | 77 6e 20 61 77 61 79 20 | is thro|wn away |
|00004850| 61 6e 64 20 6e 65 69 2d | 0d 0a 20 20 20 20 20 20 |and nei-|.. |
|00004860| 20 20 20 20 20 20 74 68 | 65 72 20 6f 70 65 72 61 | th|er opera|
|00004870| 6e 64 20 69 73 20 63 68 | 61 6e 67 65 64 2e 0d 0a |nd is ch|anged...|
|00004880| 0a 20 20 20 20 20 20 20 | 20 36 29 20 20 4d 4f 56 |. | 6) MOV|
|00004890| 20 2d 2d 20 6d 6f 76 65 | 20 64 61 74 61 20 66 72 | -- move| data fr|
|000048a0| 6f 6d 20 73 6f 75 72 63 | 65 20 74 6f 20 74 61 72 |om sourc|e to tar|
|000048b0| 67 65 74 0d 0a 0a 20 20 | 20 20 20 20 20 20 37 29 |get... | 7)|
|000048c0| 20 20 4c 44 53 2c 20 4c | 45 53 2c 20 4c 45 41 20 | LDS, L|ES, LEA |
|000048d0| 2d 2d 20 73 6f 6d 65 20 | 73 70 65 63 69 61 6c 69 |-- some |speciali|
|000048e0| 7a 65 64 20 66 6f 72 6d | 73 20 6f 66 20 4d 4f 56 |zed form|s of MOV|
|000048f0| 20 77 69 74 68 20 73 69 | 64 65 0d 0a 20 20 20 20 | with si|de.. |
|00004900| 20 20 20 20 20 20 20 20 | 65 66 66 65 63 74 73 0d | |effects.|
|00004910| 0a 0a 20 20 20 20 62 2e | 20 20 4f 72 64 69 6e 61 |.. b.| Ordina|
|00004920| 72 79 20 6f 6e 65 20 6f | 70 65 72 61 6e 64 20 69 |ry one o|perand i|
|00004930| 6e 73 74 72 75 63 74 69 | 6f 6e 73 2e 20 20 54 68 |nstructi|ons. Th|
|00004940| 65 73 65 20 63 61 6e 20 | 74 61 6b 65 20 61 6e 79 |ese can |take any|
|00004950| 20 6f 66 20 74 68 65 20 | 6f 70 65 72 2d 0d 0a 20 | of the |oper-.. |
|00004960| 20 20 20 20 20 20 20 61 | 6e 64 20 66 6f 72 6d 73 | a|nd forms|
|00004970| 20 64 65 73 63 72 69 62 | 65 64 20 61 62 6f 76 65 | describ|ed above|
|00004980| 2e 20 20 55 73 75 61 6c | 6c 79 2c 20 74 68 65 20 |. Usual|ly, the |
|00004990| 70 65 72 66 6f 72 6d 20 | 74 68 65 20 6f 70 65 72 |perform |the oper|
|000049a0| 61 74 69 6f 6e 20 61 6e | 64 0d 0a 20 20 20 20 20 |ation an|d.. |
|000049b0| 20 20 20 6c 65 61 76 65 | 20 74 68 65 20 72 65 73 | leave| the res|
|000049c0| 75 6c 74 20 69 6e 20 74 | 68 65 20 73 74 61 74 65 |ult in t|he state|
|000049d0| 64 20 70 6c 61 63 65 3a | 0d 0a 0a 20 20 20 20 20 |d place:|... |
|000049e0| 20 20 20 31 29 20 20 49 | 4e 43 20 2d 2d 20 69 6e | 1) I|NC -- in|
|000049f0| 63 72 65 6d 65 6e 74 20 | 63 6f 6e 74 65 6e 74 73 |crement |contents|
|00004a00| 0d 0a 0a 0d 0a 0a 49 42 | 4d 20 50 43 20 41 73 73 |......IB|M PC Ass|
|00004a10| 65 6d 62 6c 79 20 4c 61 | 6e 67 75 61 67 65 20 54 |embly La|nguage T|
|00004a20| 75 74 6f 72 69 61 6c 20 | 20 20 20 20 20 20 20 20 |utorial | |
|00004a30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004a50| 37 0d 0a 0d 0c 0d 0a 0a | 20 20 20 20 20 20 20 20 |7.......| |
|00004a60| 32 29 20 20 44 45 43 20 | 2d 2d 20 64 65 63 72 65 |2) DEC |-- decre|
|00004a70| 6d 65 6e 74 20 63 6f 6e | 74 65 6e 74 73 0d 0a 0a |ment con|tents...|
|00004a80| 20 20 20 20 20 20 20 20 | 33 29 20 20 4e 45 47 20 | |3) NEG |
|00004a90| 2d 2d 20 74 77 6f 73 20 | 63 6f 6d 70 6c 65 6d 65 |-- twos |compleme|
|00004aa0| 6e 74 0d 0a 0a 20 20 20 | 20 20 20 20 20 34 29 20 |nt... | 4) |
|00004ab0| 20 4e 4f 54 20 2d 2d 20 | 6f 6e 65 73 20 63 6f 6d | NOT -- |ones com|
|00004ac0| 70 6c 65 6d 65 6e 74 0d | 0a 0a 20 20 20 20 20 20 |plement.|.. |
|00004ad0| 20 20 35 29 20 20 50 55 | 53 48 20 2d 2d 20 76 61 | 5) PU|SH -- va|
|00004ae0| 6c 75 65 20 67 6f 65 73 | 20 6f 6e 20 73 74 61 63 |lue goes| on stac|
|00004af0| 6b 20 28 6f 70 65 72 61 | 6e 64 20 6c 6f 63 61 74 |k (opera|nd locat|
|00004b00| 69 6f 6e 20 69 74 73 65 | 6c 66 20 75 6e 63 68 61 |ion itse|lf uncha|
|00004b10| 6e 67 65 64 29 0d 0a 0a | 20 20 20 20 20 20 20 20 |nged)...| |
|00004b20| 36 29 20 20 50 4f 50 20 | 2d 2d 20 76 61 6c 75 65 |6) POP |-- value|
|00004b30| 20 74 61 6b 65 6e 20 66 | 72 6f 6d 20 73 74 61 63 | taken f|rom stac|
|00004b40| 6b 2c 20 72 65 70 6c 61 | 63 65 73 20 63 75 72 72 |k, repla|ces curr|
|00004b50| 65 6e 74 20 76 61 6c 75 | 65 0d 0a 0a 20 20 20 20 |ent valu|e... |
|00004b60| 63 2e 20 20 4e 6f 77 20 | 79 6f 75 20 74 6f 75 63 |c. Now |you touc|
|00004b70| 68 20 6f 6e 20 73 6f 6d | 65 20 69 6e 73 74 72 75 |h on som|e instru|
|00004b80| 63 74 69 6f 6e 73 20 77 | 68 69 63 68 20 64 6f 20 |ctions w|hich do |
|00004b90| 6e 6f 74 20 66 6f 6c 6c | 6f 77 20 74 68 65 20 67 |not foll|ow the g|
|00004ba0| 65 6e 65 72 61 6c 0d 0a | 20 20 20 20 20 20 20 20 |eneral..| |
|00004bb0| 6f 70 65 72 61 6e 64 20 | 72 75 6c 65 73 20 62 75 |operand |rules bu|
|00004bc0| 74 20 77 68 69 63 68 20 | 72 65 71 75 69 72 65 20 |t which |require |
|00004bd0| 74 68 65 20 75 73 65 20 | 6f 66 20 63 65 72 74 61 |the use |of certa|
|00004be0| 69 6e 20 72 65 67 69 73 | 74 65 72 73 2e 20 20 54 |in regis|ters. T|
|00004bf0| 68 65 0d 0a 20 20 20 20 | 20 20 20 20 69 6d 70 6f |he.. | impo|
|00004c00| 72 74 61 6e 74 20 6f 6e | 65 73 20 61 72 65 0d 0a |rtant on|es are..|
|00004c10| 0a 20 20 20 20 20 20 20 | 20 31 29 20 20 54 68 65 |. | 1) The|
|00004c20| 20 6d 75 6c 74 69 70 6c | 79 20 61 6e 64 20 64 69 | multipl|y and di|
|00004c30| 76 69 64 65 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |vide ins|truction|
|00004c40| 73 0d 0a 0a 20 20 20 20 | 20 20 20 20 32 29 20 20 |s... | 2) |
|00004c50| 54 68 65 20 22 61 64 6a | 75 73 74 22 20 69 6e 73 |The "adj|ust" ins|
|00004c60| 74 72 75 63 74 69 6f 6e | 73 20 77 68 69 63 68 20 |truction|s which |
|00004c70| 68 65 6c 70 20 69 6e 20 | 70 65 72 66 6f 72 6d 69 |help in |performi|
|00004c80| 6e 67 20 61 72 69 74 68 | 6d 65 74 69 63 0d 0a 20 |ng arith|metic.. |
|00004c90| 20 20 20 20 20 20 20 20 | 20 20 20 6f 6e 20 41 53 | | on AS|
|00004ca0| 43 49 49 20 6f 72 20 70 | 61 63 6b 65 64 20 64 65 |CII or p|acked de|
|00004cb0| 63 69 6d 61 6c 20 64 61 | 74 61 0d 0a 0a 20 20 20 |cimal da|ta... |
|00004cc0| 20 20 20 20 20 33 29 20 | 20 54 68 65 20 73 68 69 | 3) | The shi|
|00004cd0| 66 74 20 61 6e 64 20 72 | 6f 74 61 74 65 20 69 6e |ft and r|otate in|
|00004ce0| 73 74 72 75 63 74 69 6f | 6e 73 2e 20 20 54 68 65 |structio|ns. The|
|00004cf0| 73 65 20 68 61 76 65 20 | 61 20 72 65 73 74 72 69 |se have |a restri|
|00004d00| 63 74 69 6f 6e 20 6f 6e | 0d 0a 20 20 20 20 20 20 |ction on|.. |
|00004d10| 20 20 20 20 20 20 74 68 | 65 20 73 65 63 6f 6e 64 | th|e second|
|00004d20| 20 6f 70 65 72 61 6e 64 | 3a 20 20 69 74 20 6d 75 | operand|: it mu|
|00004d30| 73 74 20 65 69 74 68 65 | 72 20 62 65 20 74 68 65 |st eithe|r be the|
|00004d40| 20 69 6d 6d 65 64 69 61 | 74 65 20 76 61 6c 75 65 | immedia|te value|
|00004d50| 20 31 20 6f 72 0d 0a 20 | 20 20 20 20 20 20 20 20 | 1 or.. | |
|00004d60| 20 20 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 | the c|ontents |
|00004d70| 6f 66 20 74 68 65 20 43 | 4c 20 72 65 67 69 73 74 |of the C|L regist|
|00004d80| 65 72 2e 0d 0a 0a 20 20 | 20 20 20 20 20 20 34 29 |er.... | 4)|
|00004d90| 20 20 49 4e 20 61 6e 64 | 20 4f 55 54 20 77 68 69 | IN and| OUT whi|
|00004da0| 63 68 20 73 65 6e 64 20 | 6f 72 20 72 65 63 65 69 |ch send |or recei|
|00004db0| 76 65 20 64 61 74 61 20 | 66 72 6f 6d 20 6f 6e 65 |ve data |from one|
|00004dc0| 20 6f 66 20 74 68 65 20 | 31 30 32 34 0d 0a 20 20 | of the |1024.. |
|00004dd0| 20 20 20 20 20 20 20 20 | 20 20 68 61 72 64 77 61 | | hardwa|
|00004de0| 72 65 20 70 6f 72 74 73 | 2e 0d 0a 0a 20 20 20 20 |re ports|.... |
|00004df0| 20 20 20 20 35 29 20 20 | 43 42 57 20 61 6e 64 20 | 5) |CBW and |
|00004e00| 43 57 44 20 2d 2d 20 63 | 6f 6e 76 65 72 74 20 62 |CWD -- c|onvert b|
|00004e10| 79 74 65 20 74 6f 20 77 | 6f 72 64 20 6f 72 20 77 |yte to w|ord or w|
|00004e20| 6f 72 64 20 74 6f 20 64 | 6f 75 62 6c 65 77 6f 72 |ord to d|oublewor|
|00004e30| 64 20 62 79 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |d by.. | |
|00004e40| 20 20 73 69 67 6e 20 65 | 78 74 65 6e 73 69 6f 6e | sign e|xtension|
|00004e50| 0d 0a 0a 20 20 20 20 64 | 2e 20 20 46 6c 6f 77 20 |... d|. Flow |
|00004e60| 6f 66 20 63 6f 6e 74 72 | 6f 6c 20 69 6e 73 74 72 |of contr|ol instr|
|00004e70| 75 63 74 69 6f 6e 73 2e | 20 20 54 68 65 73 65 20 |uctions.| These |
|00004e80| 64 65 73 65 72 76 65 20 | 73 74 75 64 79 20 69 6e |deserve |study in|
|00004e90| 20 74 68 65 6d 73 65 6c | 76 65 73 0d 0a 20 20 20 | themsel|ves.. |
|00004ea0| 20 20 20 20 20 61 6e 64 | 20 77 65 20 77 69 6c 6c | and| we will|
|00004eb0| 20 64 69 73 63 75 73 73 | 20 74 68 65 6d 20 61 20 | discuss| them a |
|00004ec0| 6c 69 74 74 6c 65 20 6d | 6f 72 65 2e 20 20 54 68 |little m|ore. Th|
|00004ed0| 65 79 20 69 6e 63 6c 75 | 64 65 0d 0a 0a 20 20 20 |ey inclu|de... |
|00004ee0| 20 20 20 20 20 31 29 20 | 20 43 41 4c 4c 2c 20 52 | 1) | CALL, R|
|00004ef0| 45 54 20 2d 2d 20 63 61 | 6c 6c 20 61 6e 64 20 72 |ET -- ca|ll and r|
|00004f00| 65 74 75 72 6e 0d 0a 0a | 20 20 20 20 20 20 20 20 |eturn...| |
|00004f10| 32 29 20 20 49 4e 54 2c | 20 49 52 45 54 20 2d 2d |2) INT,| IRET --|
|00004f20| 20 69 6e 74 65 72 72 75 | 70 74 20 61 6e 64 20 72 | interru|pt and r|
|00004f30| 65 74 75 72 6e 2d 66 72 | 6f 6d 2d 69 6e 74 65 72 |eturn-fr|om-inter|
|00004f40| 72 75 70 74 0d 0a 0a 20 | 20 20 20 20 20 20 20 33 |rupt... | 3|
|00004f50| 29 20 20 4a 4d 50 20 2d | 2d 20 6a 75 6d 70 20 6f |) JMP -|- jump o|
|00004f60| 72 20 22 62 72 61 6e 63 | 68 22 0d 0a 0a 20 20 20 |r "branc|h"... |
|00004f70| 20 20 20 20 20 34 29 20 | 20 4c 4f 4f 50 2c 20 4c | 4) | LOOP, L|
|00004f80| 4f 4f 50 4e 5a 2c 20 4c | 4f 4f 50 5a 20 2d 2d 20 |OOPNZ, L|OOPZ -- |
|00004f90| 73 70 65 63 69 61 6c 20 | 28 61 6e 64 20 75 73 65 |special |(and use|
|00004fa0| 66 75 6c 29 20 69 6e 73 | 74 72 75 63 74 69 6f 6e |ful) ins|truction|
|00004fb0| 73 20 77 68 69 63 68 0d | 0a 20 20 20 20 20 20 20 |s which.|. |
|00004fc0| 20 20 20 20 20 69 6d 70 | 6c 65 6d 65 6e 74 20 61 | imp|lement a|
|00004fd0| 20 63 6f 75 6e 74 65 64 | 20 6c 6f 6f 70 20 73 69 | counted| loop si|
|00004fe0| 6d 69 6c 61 72 20 74 6f | 20 74 68 65 20 33 37 30 |milar to| the 370|
|00004ff0| 20 42 43 54 20 69 6e 73 | 74 72 75 63 74 69 6f 6e | BCT ins|truction|
|00005000| 0d 0a 0a 20 20 20 20 20 | 20 20 20 35 29 20 20 76 |... | 5) v|
|00005010| 61 72 69 6f 75 73 20 63 | 6f 6e 64 69 74 69 6f 6e |arious c|ondition|
|00005020| 61 6c 20 6a 75 6d 70 20 | 69 6e 73 74 72 75 63 74 |al jump |instruct|
|00005030| 69 6f 6e 73 0d 0a 0a 20 | 20 20 20 65 2e 20 20 53 |ions... | e. S|
|00005040| 74 72 69 6e 67 20 69 6e | 73 74 72 75 63 74 69 6f |tring in|structio|
|00005050| 6e 73 2e 20 20 54 68 65 | 73 65 20 69 6d 70 6c 65 |ns. The|se imple|
|00005060| 6d 65 6e 74 20 61 20 6c | 69 6d 69 74 65 64 20 73 |ment a l|imited s|
|00005070| 74 6f 72 61 67 65 2d 74 | 6f 2d 73 74 6f 72 61 67 |torage-t|o-storag|
|00005080| 65 0d 0a 20 20 20 20 20 | 20 20 20 69 6e 73 74 72 |e.. | instr|
|00005090| 75 63 74 69 6f 6e 20 73 | 75 62 73 65 74 20 61 6e |uction s|ubset an|
|000050a0| 64 20 61 72 65 20 71 75 | 69 74 65 20 70 6f 77 65 |d are qu|ite powe|
|000050b0| 72 66 75 6c 2e 20 20 41 | 6c 6c 20 6f 66 20 74 68 |rful. A|ll of th|
|000050c0| 65 6d 20 68 61 76 65 20 | 74 68 65 0d 0a 20 20 20 |em have |the.. |
|000050d0| 20 20 20 20 20 70 72 6f | 70 65 72 74 79 20 74 68 | pro|perty th|
|000050e0| 61 74 0d 0a 0a 20 20 20 | 20 20 20 20 20 31 29 20 |at... | 1) |
|000050f0| 20 54 68 65 20 73 6f 75 | 72 63 65 20 6f 66 20 64 | The sou|rce of d|
|00005100| 61 74 61 20 69 73 20 64 | 65 73 63 72 69 62 65 64 |ata is d|escribed|
|00005110| 20 62 79 20 74 68 65 20 | 63 6f 6d 62 69 6e 61 74 | by the |combinat|
|00005120| 69 6f 6e 20 44 53 20 61 | 6e 64 20 53 49 2e 0d 0a |ion DS a|nd SI...|
|00005130| 0a 20 20 20 20 20 20 20 | 20 32 29 20 20 54 68 65 |. | 2) The|
|00005140| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 6f 66 20 | destina|tion of |
|00005150| 64 61 74 61 20 69 73 20 | 64 65 73 63 72 69 62 65 |data is |describe|
|00005160| 64 20 62 79 20 74 68 65 | 20 63 6f 6d 62 69 6e 61 |d by the| combina|
|00005170| 74 69 6f 6e 20 45 53 20 | 61 6e 64 0d 0a 20 20 20 |tion ES |and.. |
|00005180| 20 20 20 20 20 20 20 20 | 20 44 49 2e 0d 0a 0a 20 | | DI.... |
|00005190| 20 20 20 20 20 20 20 33 | 29 20 20 41 73 20 70 61 | 3|) As pa|
|000051a0| 72 74 20 6f 66 20 74 68 | 65 20 6f 70 65 72 61 74 |rt of th|e operat|
|000051b0| 69 6f 6e 2c 20 74 68 65 | 20 53 49 20 61 6e 64 2f |ion, the| SI and/|
|000051c0| 6f 72 20 44 49 20 72 65 | 67 69 73 74 65 72 28 73 |or DI re|gister(s|
|000051d0| 29 20 69 73 28 61 72 65 | 29 0d 0a 20 20 20 20 20 |) is(are|).. |
|000051e0| 20 20 20 20 20 20 20 69 | 6e 63 72 65 6d 65 6e 74 | i|ncrement|
|000051f0| 65 64 20 6f 72 20 64 65 | 63 72 65 6d 65 6e 74 65 |ed or de|cremente|
|00005200| 64 20 73 6f 20 74 68 65 | 20 6f 70 65 72 61 74 69 |d so the| operati|
|00005210| 6f 6e 20 63 61 6e 20 62 | 65 20 72 65 70 65 61 74 |on can b|e repeat|
|00005220| 65 64 2e 0d 0a 0a 0d 0a | 0a 49 42 4d 20 50 43 20 |ed......|.IBM PC |
|00005230| 41 73 73 65 6d 62 6c 79 | 20 4c 61 6e 67 75 61 67 |Assembly| Languag|
|00005240| 65 20 54 75 74 6f 72 69 | 61 6c 20 20 20 20 20 20 |e Tutori|al |
|00005250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005260| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005270| 20 20 20 38 0d 0a 0d 0c | 0d 0a 0a 20 20 20 20 20 | 8....|... |
|00005280| 20 20 20 54 68 65 79 20 | 69 6e 63 6c 75 64 65 0d | They |include.|
|00005290| 0a 0a 20 20 20 20 20 20 | 20 20 31 29 20 20 43 4d |.. | 1) CM|
|000052a0| 50 53 42 2f 43 4d 50 53 | 57 20 2d 2d 20 63 6f 6d |PSB/CMPS|W -- com|
|000052b0| 70 61 72 65 20 62 79 74 | 65 20 6f 72 20 77 6f 72 |pare byt|e or wor|
|000052c0| 64 0d 0a 0a 20 20 20 20 | 20 20 20 20 32 29 20 20 |d... | 2) |
|000052d0| 4c 4f 44 53 42 2f 4c 4f | 44 53 57 20 2d 2d 20 6c |LODSB/LO|DSW -- l|
|000052e0| 6f 61 64 20 62 79 74 65 | 20 6f 72 20 77 6f 72 64 |oad byte| or word|
|000052f0| 20 69 6e 74 6f 20 41 4c | 20 6f 72 20 41 58 0d 0a | into AL| or AX..|
|00005300| 0a 20 20 20 20 20 20 20 | 20 33 29 20 20 53 54 4f |. | 3) STO|
|00005310| 53 42 2f 53 54 4f 53 57 | 20 2d 2d 20 73 74 6f 72 |SB/STOSW| -- stor|
|00005320| 65 20 62 79 74 65 20 6f | 72 20 77 6f 72 64 20 66 |e byte o|r word f|
|00005330| 72 6f 6d 20 41 4c 20 6f | 72 20 41 58 0d 0a 0a 20 |rom AL o|r AX... |
|00005340| 20 20 20 20 20 20 20 34 | 29 20 20 4d 4f 56 53 42 | 4|) MOVSB|
|00005350| 2f 4d 4f 56 53 57 20 2d | 2d 20 6d 6f 76 65 20 62 |/MOVSW -|- move b|
|00005360| 79 74 65 20 6f 72 20 77 | 6f 72 64 0d 0a 0a 20 20 |yte or w|ord... |
|00005370| 20 20 20 20 20 20 35 29 | 20 20 53 43 41 53 42 2f | 5)| SCASB/|
|00005380| 53 43 41 53 57 20 2d 2d | 20 63 6f 6d 70 61 72 65 |SCASW --| compare|
|00005390| 20 62 79 74 65 20 6f 72 | 20 77 6f 72 64 20 77 69 | byte or| word wi|
|000053a0| 74 68 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 41 |th conte|nts of A|
|000053b0| 4c 20 6f 72 20 41 58 0d | 0a 0a 20 20 20 20 20 20 |L or AX.|.. |
|000053c0| 20 20 36 29 20 20 52 45 | 50 2f 52 45 50 45 2f 52 | 6) RE|P/REPE/R|
|000053d0| 45 50 4e 45 20 2d 2d 20 | 61 20 70 72 65 66 69 78 |EPNE -- |a prefix|
|000053e0| 20 77 68 69 63 68 20 63 | 61 6e 20 62 65 20 63 6f | which c|an be co|
|000053f0| 6d 62 69 6e 65 64 20 77 | 69 74 68 20 61 6e 79 20 |mbined w|ith any |
|00005400| 6f 66 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |of.. | |
|00005410| 74 68 65 20 61 62 6f 76 | 65 20 69 6e 73 74 72 75 |the abov|e instru|
|00005420| 63 74 69 6f 6e 73 20 74 | 6f 20 6d 61 6b 65 20 74 |ctions t|o make t|
|00005430| 68 65 6d 20 65 78 65 63 | 75 74 65 20 72 65 70 65 |hem exec|ute repe|
|00005440| 61 74 65 64 6c 79 20 61 | 63 72 6f 73 73 20 61 0d |atedly a|cross a.|
|00005450| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 73 74 72 |. | str|
|00005460| 69 6e 67 20 6f 66 20 64 | 61 74 61 20 77 68 6f 73 |ing of d|ata whos|
|00005470| 65 20 6c 65 6e 67 74 68 | 20 69 73 20 68 65 6c 64 |e length| is held|
|00005480| 20 69 6e 20 43 58 2e 0d | 0a 0a 20 20 20 20 66 2e | in CX..|.. f.|
|00005490| 20 20 46 6c 61 67 20 69 | 6e 73 74 72 75 63 74 69 | Flag i|nstructi|
|000054a0| 6f 6e 73 3a 20 43 4c 49 | 2c 20 53 54 49 2c 20 43 |ons: CLI|, STI, C|
|000054b0| 4c 44 2c 20 53 54 44 2c | 20 43 4c 43 2c 20 53 54 |LD, STD,| CLC, ST|
|000054c0| 43 2e 20 20 54 68 65 73 | 65 20 63 61 6e 20 73 65 |C. Thes|e can se|
|000054d0| 74 20 6f 72 0d 0a 20 20 | 20 20 20 20 20 20 63 6c |t or.. | cl|
|000054e0| 65 61 72 20 74 68 65 20 | 69 6e 74 65 72 72 75 70 |ear the |interrup|
|000054f0| 74 20 28 65 6e 61 62 6c | 65 64 29 20 64 69 72 65 |t (enabl|ed) dire|
|00005500| 63 74 69 6f 6e 20 28 66 | 6f 72 20 73 74 72 69 6e |ction (f|or strin|
|00005510| 67 20 6f 70 65 72 61 74 | 69 6f 6e 73 29 20 6f 72 |g operat|ions) or|
|00005520| 0d 0a 20 20 20 20 20 20 | 20 20 63 61 72 72 79 20 |.. | carry |
|00005530| 66 6c 61 67 73 2e 0d 0a | 0a 20 20 20 20 54 68 65 |flags...|. The|
|00005540| 20 61 64 64 72 65 73 73 | 69 6e 67 20 73 75 6d 6d | address|ing summ|
|00005550| 61 72 79 20 61 6e 64 20 | 74 68 65 20 69 6e 73 74 |ary and |the inst|
|00005560| 72 75 63 74 69 6f 6e 20 | 73 75 6d 6d 61 72 79 20 |ruction |summary |
|00005570| 67 69 76 65 6e 20 61 62 | 6f 76 65 20 6d 61 73 6b |given ab|ove mask|
|00005580| 73 20 61 0d 0a 20 20 20 | 20 6c 6f 74 20 6f 66 20 |s a.. | lot of |
|00005590| 61 6e 6e 6f 79 69 6e 67 | 20 6c 69 74 74 6c 65 20 |annoying| little |
|000055a0| 65 78 63 65 70 74 69 6f | 6e 73 2e 20 20 46 6f 72 |exceptio|ns. For|
|000055b0| 20 65 78 61 6d 70 6c 65 | 2c 20 79 6f 75 20 63 61 | example|, you ca|
|000055c0| 6e 27 74 20 50 4f 50 20 | 43 53 2c 20 61 6e 64 0d |n't POP |CS, and.|
|000055d0| 0a 20 20 20 20 61 6c 74 | 68 6f 75 67 68 20 74 68 |. alt|hough th|
|000055e0| 65 20 52 20 3c 2d 2d 20 | 4d 20 66 6f 72 6d 20 6f |e R <-- |M form o|
|000055f0| 66 20 4c 45 53 20 69 73 | 20 6c 65 67 61 6c 2c 20 |f LES is| legal, |
|00005600| 74 68 65 20 4d 20 3c 2d | 2d 20 52 20 66 6f 72 6d |the M <-|- R form|
|00005610| 20 69 73 6e 27 74 20 65 | 74 63 2e 0d 0a 20 20 20 | isn't e|tc... |
|00005620| 20 65 74 63 2e 20 20 4d | 79 20 61 64 76 69 63 65 | etc. M|y advice|
|00005630| 20 69 73 0d 0a 0a 20 20 | 20 20 61 2e 20 20 47 6f | is... | a. Go|
|00005640| 20 66 6f 72 20 74 68 65 | 20 67 65 6e 65 72 61 6c | for the| general|
|00005650| 20 72 75 6c 65 73 0d 0a | 0a 20 20 20 20 62 2e 20 | rules..|. b. |
|00005660| 20 44 6f 6e 27 74 20 74 | 72 79 20 74 6f 20 6d 65 | Don't t|ry to me|
|00005670| 6d 6f 72 69 7a 65 20 74 | 68 65 20 65 78 63 65 70 |morize t|he excep|
|00005680| 74 69 6f 6e 73 0d 0a 0a | 20 20 20 20 63 2e 20 20 |tions...| c. |
|00005690| 52 65 6c 79 20 6f 6e 20 | 63 6f 6d 6d 6f 6e 20 73 |Rely on |common s|
|000056a0| 65 6e 73 65 20 61 6e 64 | 20 74 68 65 20 61 73 73 |ense and| the ass|
|000056b0| 65 6d 62 6c 65 72 20 74 | 6f 20 74 65 61 63 68 20 |embler t|o teach |
|000056c0| 79 6f 75 20 61 62 6f 75 | 74 0d 0a 20 20 20 20 20 |you abou|t.. |
|000056d0| 20 20 20 65 78 63 65 70 | 74 69 6f 6e 73 20 6f 76 | excep|tions ov|
|000056e0| 65 72 20 74 69 6d 65 2e | 20 20 41 20 6c 6f 74 20 |er time.| A lot |
|000056f0| 6f 66 20 74 68 65 20 65 | 78 63 65 70 74 69 6f 6e |of the e|xception|
|00005700| 73 20 63 6f 76 65 72 20 | 74 68 69 6e 67 73 20 79 |s cover |things y|
|00005710| 6f 75 0d 0a 20 20 20 20 | 20 20 20 20 77 6f 75 6c |ou.. | woul|
|00005720| 64 6e 27 74 20 77 61 6e | 74 20 74 6f 20 64 6f 20 |dn't wan|t to do |
|00005730| 61 6e 79 77 61 79 2e 0d | 0a 0a 35 2e 20 20 41 20 |anyway..|..5. A |
|00005740| 66 65 77 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |few inst|ructions|
|00005750| 20 61 72 65 20 72 69 63 | 68 20 65 6e 6f 75 67 68 | are ric|h enough|
|00005760| 20 61 6e 64 20 75 73 65 | 66 75 6c 20 65 6e 6f 75 | and use|ful enou|
|00005770| 67 68 20 74 6f 20 77 61 | 72 72 65 6e 74 20 63 61 |gh to wa|rrent ca|
|00005780| 72 65 66 75 6c 0d 0a 20 | 20 20 20 73 74 75 64 79 |reful.. | study|
|00005790| 2e 20 20 48 65 72 65 20 | 61 72 65 20 61 20 66 65 |. Here |are a fe|
|000057a0| 77 20 66 69 6e 61 6c 20 | 73 74 75 64 79 20 67 75 |w final |study gu|
|000057b0| 69 64 65 6c 69 6e 65 73 | 3a 0d 0a 0a 20 20 20 20 |idelines|:... |
|000057c0| 61 2e 20 20 49 74 20 69 | 73 20 77 65 6c 6c 20 77 |a. It i|s well w|
|000057d0| 6f 72 74 68 20 74 68 65 | 20 74 69 6d 65 20 6c 65 |orth the| time le|
|000057e0| 61 72 6e 69 6e 67 20 74 | 6f 20 75 73 65 20 74 68 |arning t|o use th|
|000057f0| 65 20 73 74 72 69 6e 67 | 20 69 6e 73 74 72 75 63 |e string| instruc|
|00005800| 74 69 6f 6e 0d 0a 20 20 | 20 20 20 20 20 20 73 65 |tion.. | se|
|00005810| 74 20 65 66 66 65 63 74 | 69 76 65 6c 79 2e 20 20 |t effect|ively. |
|00005820| 41 6d 6f 6e 67 20 74 68 | 65 20 6d 6f 73 74 20 75 |Among th|e most u|
|00005830| 73 65 66 75 6c 20 61 72 | 65 0d 0a 0a 20 20 20 20 |seful ar|e... |
|00005840| 20 20 20 20 20 20 20 20 | 20 20 20 20 52 45 50 20 | | REP |
|00005850| 4d 4f 56 53 42 20 20 20 | 20 20 20 20 20 20 20 20 |MOVSB | |
|00005860| 3b 6d 6f 76 65 73 20 61 | 20 73 74 72 69 6e 67 0d |;moves a| string.|
|00005870| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005880| 20 52 45 50 20 53 54 4f | 53 42 20 20 20 20 20 20 | REP STO|SB |
|00005890| 20 20 20 20 20 3b 69 6e | 69 74 69 61 6c 69 7a 65 | ;in|itialize|
|000058a0| 73 20 6d 65 6d 6f 72 79 | 0d 0a 20 20 20 20 20 20 |s memory|.. |
|000058b0| 20 20 20 20 20 20 20 20 | 20 20 52 45 50 4e 45 20 | | REPNE |
|000058c0| 53 43 41 53 42 20 20 20 | 20 20 20 20 20 20 3b 6c |SCASB | ;l|
|000058d0| 6f 6f 6b 20 75 70 20 6f | 63 63 75 72 61 6e 63 65 |ook up o|ccurance|
|000058e0| 20 6f 66 20 63 68 61 72 | 61 63 74 65 72 20 69 6e | of char|acter in|
|000058f0| 20 73 74 72 69 6e 67 0d | 0a 20 20 20 20 20 20 20 | string.|. |
|00005900| 20 20 20 20 20 20 20 20 | 20 52 45 50 45 20 43 4d | | REPE CM|
|00005910| 50 53 42 20 20 20 20 20 | 20 20 20 20 20 3b 63 6f |PSB | ;co|
|00005920| 6d 70 61 72 65 20 74 77 | 6f 20 73 74 72 69 6e 67 |mpare tw|o string|
|00005930| 73 0d 0a 0a 20 20 20 20 | 62 2e 20 20 53 69 6d 69 |s... |b. Simi|
|00005940| 6c 61 72 6c 79 2c 20 69 | 66 20 79 6f 75 20 68 61 |larly, i|f you ha|
|00005950| 76 65 20 6e 65 76 65 72 | 20 77 72 69 74 74 65 6e |ve never| written|
|00005960| 20 66 6f 72 20 61 20 73 | 74 61 63 6b 20 6d 61 63 | for a s|tack mac|
|00005970| 68 69 6e 65 20 62 65 66 | 6f 72 65 2c 0d 0a 20 20 |hine bef|ore,.. |
|00005980| 20 20 20 20 20 20 79 6f | 75 20 77 69 6c 6c 20 6e | yo|u will n|
|00005990| 65 65 64 20 74 6f 20 65 | 78 65 72 63 69 73 65 20 |eed to e|xercise |
|000059a0| 50 55 53 48 20 61 6e 64 | 20 50 4f 50 20 61 6e 64 |PUSH and| POP and|
|000059b0| 20 67 65 74 20 76 65 72 | 79 20 63 6f 6d 66 6f 72 | get ver|y comfor|
|000059c0| 74 61 62 6c 65 0d 0a 20 | 20 20 20 20 20 20 20 77 |table.. | w|
|000059d0| 69 74 68 20 74 68 65 6d | 20 62 65 63 61 75 73 65 |ith them| because|
|000059e0| 20 74 68 65 79 20 61 72 | 65 20 67 6f 69 6e 67 20 | they ar|e going |
|000059f0| 74 6f 20 62 65 20 67 6f | 6f 64 20 66 72 69 65 6e |to be go|od frien|
|00005a00| 64 73 2e 20 20 49 66 20 | 79 6f 75 20 61 72 65 0d |ds. If |you are.|
|00005a10| 0a 20 20 20 20 20 20 20 | 20 75 73 65 64 20 74 6f |. | used to|
|00005a20| 20 74 68 65 20 33 37 30 | 2c 20 77 69 74 68 20 6c | the 370|, with l|
|00005a30| 6f 74 73 20 6f 66 20 67 | 65 6e 65 72 61 6c 20 70 |ots of g|eneral p|
|00005a40| 75 72 70 6f 73 65 20 72 | 65 67 69 73 74 65 72 73 |urpose r|egisters|
|00005a50| 2c 20 79 6f 75 20 6d 61 | 79 0d 0a 20 20 20 20 20 |, you ma|y.. |
|00005a60| 20 20 20 66 69 6e 64 20 | 79 6f 75 72 73 65 6c 66 | find |yourself|
|00005a70| 20 66 65 65 6c 69 6e 67 | 20 63 72 61 6d 70 65 64 | feeling| cramped|
|00005a80| 20 61 74 20 66 69 72 73 | 74 2c 20 77 69 74 68 20 | at firs|t, with |
|00005a90| 6d 61 6e 79 20 66 65 77 | 65 72 20 72 65 67 69 73 |many few|er regis|
|00005aa0| 74 65 72 73 0d 0a 20 20 | 20 20 20 20 20 20 61 6e |ters.. | an|
|00005ab0| 64 20 6d 61 6e 79 20 69 | 6e 73 74 72 75 63 74 69 |d many i|nstructi|
|00005ac0| 6f 6e 73 20 68 61 76 69 | 6e 67 20 72 65 67 69 73 |ons havi|ng regis|
|00005ad0| 74 65 72 20 72 65 73 74 | 72 69 63 74 69 6f 6e 73 |ter rest|rictions|
|00005ae0| 2e 20 20 42 75 74 2c 20 | 79 6f 75 20 68 61 76 65 |. But, |you have|
|00005af0| 0d 0a 20 20 20 20 20 20 | 20 20 61 20 68 69 64 64 |.. | a hidd|
|00005b00| 65 6e 20 61 6c 6c 79 3a | 20 20 79 6f 75 20 6e 65 |en ally:| you ne|
|00005b10| 65 64 20 61 20 72 65 67 | 69 73 74 65 72 20 61 6e |ed a reg|ister an|
|00005b20| 64 20 79 6f 75 20 64 6f | 6e 27 74 20 77 61 6e 74 |d you do|n't want|
|00005b30| 20 74 6f 20 74 68 72 6f | 77 0d 0a 20 20 20 20 20 | to thro|w.. |
|00005b40| 20 20 20 61 77 61 79 20 | 77 68 61 74 27 73 20 69 | away |what's i|
|00005b50| 6e 20 69 74 3f 20 20 4a | 75 73 74 20 50 55 53 48 |n it? J|ust PUSH|
|00005b60| 20 69 74 2c 20 61 6e 64 | 20 77 68 65 6e 20 79 6f | it, and| when yo|
|00005b70| 75 20 61 72 65 20 64 6f | 6e 65 2c 20 50 4f 50 20 |u are do|ne, POP |
|00005b80| 69 74 0d 0a 20 20 20 20 | 20 20 20 20 62 61 63 6b |it.. | back|
|00005b90| 2e 20 20 54 68 69 73 20 | 63 61 6e 20 6c 65 61 64 |. This |can lead|
|00005ba0| 20 74 6f 20 61 62 75 73 | 65 2e 20 20 4e 65 76 65 | to abus|e. Neve|
|00005bb0| 72 20 68 61 76 65 20 6d | 6f 72 65 20 74 68 61 6e |r have m|ore than|
|00005bc0| 20 74 77 6f 0d 0a 20 20 | 20 20 20 20 20 20 22 65 | two.. | "e|
|00005bd0| 78 70 65 64 69 65 6e 74 | 22 20 50 55 53 48 65 73 |xpedient|" PUSHes|
|00005be0| 20 69 6e 20 65 66 66 65 | 63 74 20 61 6e 64 20 6e | in effe|ct and n|
|00005bf0| 65 76 65 72 20 6c 65 61 | 76 65 20 73 6f 6d 65 74 |ever lea|ve somet|
|00005c00| 68 69 6e 67 20 50 55 53 | 48 65 64 0d 0a 20 20 20 |hing PUS|Hed.. |
|00005c10| 20 20 20 20 20 61 63 72 | 6f 73 73 20 61 20 6d 61 | acr|oss a ma|
|00005c20| 6a 6f 72 20 68 65 61 64 | 65 72 20 63 6f 6d 6d 65 |jor head|er comme|
|00005c30| 6e 74 20 6f 72 20 66 6f | 72 20 6d 6f 72 65 20 74 |nt or fo|r more t|
|00005c40| 68 61 6e 20 31 35 20 69 | 6e 73 74 72 75 63 74 69 |han 15 i|nstructi|
|00005c50| 6f 6e 73 20 6f 72 0d 0a | 0a 0a 49 42 4d 20 50 43 |ons or..|..IBM PC|
|00005c60| 20 41 73 73 65 6d 62 6c | 79 20 4c 61 6e 67 75 61 | Assembl|y Langua|
|00005c70| 67 65 20 54 75 74 6f 72 | 69 61 6c 20 20 20 20 20 |ge Tutor|ial |
|00005c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005ca0| 20 20 20 20 39 0d 0a 0d | 0c 0d 0a 0a 20 20 20 20 | 9...|.... |
|00005cb0| 20 20 20 20 73 6f 2e 20 | 20 41 6e 20 65 78 63 65 | so. | An exce|
|00005cc0| 70 74 69 6f 6e 20 69 73 | 20 74 68 65 20 73 61 76 |ption is| the sav|
|00005cd0| 69 6e 67 20 61 6e 64 20 | 72 65 73 74 6f 72 69 6e |ing and |restorin|
|00005ce0| 67 20 6f 66 20 72 65 67 | 69 73 74 65 72 73 20 61 |g of reg|isters a|
|00005cf0| 74 0d 0a 20 20 20 20 20 | 20 20 20 65 6e 74 72 61 |t.. | entra|
|00005d00| 6e 63 65 20 74 6f 20 61 | 6e 64 20 65 78 69 74 20 |nce to a|nd exit |
|00005d10| 66 72 6f 6d 20 61 20 73 | 75 62 72 6f 75 74 69 6e |from a s|ubroutin|
|00005d20| 65 3b 20 68 65 72 65 2c | 20 69 66 20 74 68 65 20 |e; here,| if the |
|00005d30| 73 75 62 72 6f 75 74 69 | 6e 65 20 69 73 0d 0a 20 |subrouti|ne is.. |
|00005d40| 20 20 20 20 20 20 20 6c | 6f 6e 67 2c 20 79 6f 75 | l|ong, you|
|00005d50| 20 73 68 6f 75 6c 64 20 | 70 72 6f 62 61 62 6c 79 | should |probably|
|00005d60| 20 50 55 53 48 20 65 76 | 65 72 79 74 68 69 6e 67 | PUSH ev|erything|
|00005d70| 20 77 68 69 63 68 20 74 | 68 65 20 63 61 6c 6c 65 | which t|he calle|
|00005d80| 72 20 6d 61 79 20 6e 65 | 65 64 0d 0a 20 20 20 20 |r may ne|ed.. |
|00005d90| 20 20 20 20 73 61 76 65 | 64 2c 20 77 68 65 74 68 | save|d, wheth|
|00005da0| 65 72 20 79 6f 75 20 77 | 69 6c 6c 20 75 73 65 20 |er you w|ill use |
|00005db0| 74 68 65 20 72 65 67 69 | 73 74 65 72 20 6f 72 20 |the regi|ster or |
|00005dc0| 6e 6f 74 2c 20 61 6e 64 | 20 50 4f 50 20 69 74 20 |not, and| POP it |
|00005dd0| 69 6e 0d 0a 20 20 20 20 | 20 20 20 20 72 65 76 65 |in.. | reve|
|00005de0| 72 73 65 20 6f 72 64 65 | 72 20 61 74 20 74 68 65 |rse orde|r at the|
|00005df0| 20 65 6e 64 2e 0d 0a 0a | 20 20 20 20 20 20 20 20 | end....| |
|00005e00| 42 65 20 61 77 61 72 65 | 20 74 68 61 74 20 43 41 |Be aware| that CA|
|00005e10| 4c 4c 20 61 6e 64 20 49 | 4e 54 20 70 75 73 68 20 |LL and I|NT push |
|00005e20| 72 65 74 75 72 6e 20 61 | 64 64 72 65 73 73 20 69 |return a|ddress i|
|00005e30| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 6f 6e 20 74 68 |nformati|on on th|
|00005e40| 65 0d 0a 20 20 20 20 20 | 20 20 20 73 74 61 63 6b |e.. | stack|
|00005e50| 20 61 6e 64 20 52 45 54 | 20 61 6e 64 20 49 52 45 | and RET| and IRE|
|00005e60| 54 20 70 6f 70 20 69 74 | 20 6f 66 66 2e 20 20 49 |T pop it| off. I|
|00005e70| 74 20 69 73 20 61 20 67 | 6f 6f 64 20 69 64 65 61 |t is a g|ood idea|
|00005e80| 20 74 6f 20 62 65 63 6f | 6d 65 0d 0a 20 20 20 20 | to beco|me.. |
|00005e90| 20 20 20 20 66 61 6d 69 | 6c 69 61 72 20 77 69 74 | fami|liar wit|
|00005ea0| 68 20 74 68 65 20 73 74 | 72 75 63 74 75 72 65 20 |h the st|ructure |
|00005eb0| 6f 66 20 74 68 65 20 73 | 74 61 63 6b 2e 0d 0a 0a |of the s|tack....|
|00005ec0| 20 20 20 20 63 2e 20 20 | 49 6e 20 70 72 61 63 74 | c. |In pract|
|00005ed0| 69 63 65 2c 20 74 6f 20 | 69 6e 76 6f 6b 65 20 73 |ice, to |invoke s|
|00005ee0| 79 73 74 65 6d 20 73 65 | 72 76 69 63 65 73 20 79 |ystem se|rvices y|
|00005ef0| 6f 75 20 77 69 6c 6c 20 | 75 73 65 20 74 68 65 20 |ou will |use the |
|00005f00| 49 4e 54 0d 0a 20 20 20 | 20 20 20 20 20 69 6e 73 |INT.. | ins|
|00005f10| 74 72 75 63 74 69 6f 6e | 2e 20 20 49 74 20 69 73 |truction|. It is|
|00005f20| 20 71 75 69 74 65 20 70 | 6f 73 73 69 62 6c 65 20 | quite p|ossible |
|00005f30| 74 6f 20 75 73 65 20 74 | 68 69 73 20 69 6e 73 74 |to use t|his inst|
|00005f40| 72 75 63 74 69 6f 6e 20 | 65 66 66 65 63 2d 0d 0a |ruction |effec-..|
|00005f50| 20 20 20 20 20 20 20 20 | 74 69 76 65 6c 79 20 69 | |tively i|
|00005f60| 6e 20 61 20 63 6f 6f 6b | 62 6f 6f 6b 20 66 61 73 |n a cook|book fas|
|00005f70| 68 69 6f 6e 20 77 69 74 | 68 6f 75 74 20 6b 6e 6f |hion wit|hout kno|
|00005f80| 77 69 6e 67 20 70 72 65 | 63 69 73 65 6c 79 20 68 |wing pre|cisely h|
|00005f90| 6f 77 20 69 74 0d 0a 20 | 20 20 20 20 20 20 20 77 |ow it.. | w|
|00005fa0| 6f 72 6b 73 2e 0d 0a 0a | 20 20 20 20 64 2e 20 20 |orks....| d. |
|00005fb0| 54 68 65 20 74 72 61 6e | 73 66 65 72 20 6f 66 20 |The tran|sfer of |
|00005fc0| 63 6f 6e 74 72 6f 6c 20 | 69 6e 73 74 72 75 63 74 |control |instruct|
|00005fd0| 69 6f 6e 73 20 28 43 41 | 4c 4c 2c 20 52 45 54 2c |ions (CA|LL, RET,|
|00005fe0| 20 4a 4d 50 29 20 64 65 | 73 65 72 76 65 20 63 61 | JMP) de|serve ca|
|00005ff0| 72 65 2d 0d 0a 20 20 20 | 20 20 20 20 20 66 75 6c |re-.. | ful|
|00006000| 20 73 74 75 64 79 20 74 | 6f 20 61 76 6f 69 64 20 | study t|o avoid |
|00006010| 63 6f 6e 66 75 73 69 6f | 6e 2e 20 20 59 6f 75 20 |confusio|n. You |
|00006020| 77 69 6c 6c 20 6c 65 61 | 72 6e 20 74 68 61 74 20 |will lea|rn that |
|00006030| 74 68 65 73 65 20 63 61 | 6e 20 62 65 0d 0a 20 20 |these ca|n be.. |
|00006040| 20 20 20 20 20 20 63 6c | 61 73 73 69 66 69 65 64 | cl|assified|
|00006050| 20 61 73 20 66 6f 6c 6c | 6f 77 73 3a 0d 0a 0a 20 | as foll|ows:... |
|00006060| 20 20 20 20 20 20 20 31 | 29 20 20 61 6c 6c 20 74 | 1|) all t|
|00006070| 68 72 65 65 20 68 61 76 | 65 20 74 68 65 20 63 61 |hree hav|e the ca|
|00006080| 70 61 62 69 6c 69 74 79 | 20 6f 66 20 62 65 69 6e |pability| of bein|
|00006090| 67 20 65 69 74 68 65 72 | 20 4e 45 41 52 20 28 43 |g either| NEAR (C|
|000060a0| 53 20 72 65 67 69 73 74 | 65 72 0d 0a 20 20 20 20 |S regist|er.. |
|000060b0| 20 20 20 20 20 20 20 20 | 75 6e 63 68 61 6e 67 65 | |unchange|
|000060c0| 64 29 20 6f 72 20 46 41 | 52 20 28 43 53 20 72 65 |d) or FA|R (CS re|
|000060d0| 67 69 73 74 65 72 20 63 | 68 61 6e 67 65 64 29 0d |gister c|hanged).|
|000060e0| 0a 0a 20 20 20 20 20 20 | 20 20 32 29 20 20 4a 4d |.. | 2) JM|
|000060f0| 50 73 20 61 6e 64 20 43 | 41 4c 4c 73 20 63 61 6e |Ps and C|ALLs can|
|00006100| 20 62 65 20 44 49 52 45 | 43 54 20 28 74 61 72 67 | be DIRE|CT (targ|
|00006110| 65 74 20 69 73 20 61 73 | 73 65 6d 62 6c 65 64 20 |et is as|sembled |
|00006120| 69 6e 74 6f 20 69 6e 73 | 74 72 75 63 2d 0d 0a 20 |into ins|truc-.. |
|00006130| 20 20 20 20 20 20 20 20 | 20 20 20 74 69 6f 6e 29 | | tion)|
|00006140| 20 6f 72 20 49 4e 44 49 | 52 45 43 54 20 28 74 61 | or INDI|RECT (ta|
|00006150| 72 67 65 74 20 66 65 74 | 63 68 65 64 20 66 72 6f |rget fet|ched fro|
|00006160| 6d 20 6d 65 6d 6f 72 79 | 20 6f 72 20 72 65 67 69 |m memory| or regi|
|00006170| 73 74 65 72 29 0d 0a 0a | 20 20 20 20 20 20 20 20 |ster)...| |
|00006180| 33 29 20 20 69 66 20 4e | 45 41 52 20 61 6e 64 20 |3) if N|EAR and |
|00006190| 44 49 52 45 43 54 2c 20 | 61 20 4a 4d 50 20 63 61 |DIRECT, |a JMP ca|
|000061a0| 6e 20 62 65 20 53 48 4f | 52 54 20 28 6c 65 73 73 |n be SHO|RT (less|
|000061b0| 20 74 68 61 6e 20 31 32 | 38 20 62 79 74 65 73 0d | than 12|8 bytes.|
|000061c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 61 77 61 |. | awa|
|000061d0| 79 29 20 6f 72 20 4c 4f | 4e 47 0d 0a 0a 20 20 20 |y) or LO|NG... |
|000061e0| 20 20 20 20 20 49 6e 20 | 67 65 6e 65 72 61 6c 2c | In |general,|
|000061f0| 20 74 68 65 20 74 68 69 | 72 64 20 69 73 73 75 65 | the thi|rd issue|
|00006200| 20 69 73 20 6e 6f 74 20 | 77 6f 72 74 68 20 77 6f | is not |worth wo|
|00006210| 72 72 79 69 6e 67 20 61 | 62 6f 75 74 2e 20 20 4f |rrying a|bout. O|
|00006220| 6e 20 61 20 66 6f 72 2d | 0d 0a 20 20 20 20 20 20 |n a for-|.. |
|00006230| 20 20 77 61 72 64 20 6a | 75 6d 70 20 77 68 69 63 | ward j|ump whic|
|00006240| 68 20 69 73 20 63 6c 65 | 61 72 6c 79 20 56 45 52 |h is cle|arly VER|
|00006250| 59 20 73 68 6f 72 74 2c | 20 79 6f 75 20 63 61 6e |Y short,| you can|
|00006260| 20 74 65 6c 6c 20 74 68 | 65 20 61 73 73 65 6d 62 | tell th|e assemb|
|00006270| 6c 65 72 0d 0a 20 20 20 | 20 20 20 20 20 69 74 20 |ler.. | it |
|00006280| 69 73 20 73 68 6f 72 74 | 20 61 6e 64 20 73 61 76 |is short| and sav|
|00006290| 65 20 6f 6e 65 20 62 79 | 74 65 20 6f 66 20 63 6f |e one by|te of co|
|000062a0| 64 65 3a 0d 0a 0a 20 20 | 20 20 20 20 20 20 20 20 |de:... | |
|000062b0| 20 20 20 20 20 20 20 20 | 20 4a 4d 50 20 53 48 4f | | JMP SHO|
|000062c0| 52 54 20 20 43 4c 4f 53 | 45 42 59 0d 0a 0a 20 20 |RT CLOS|EBY... |
|000062d0| 20 20 20 20 20 20 4f 6e | 20 61 20 62 61 63 6b 77 | On| a backw|
|000062e0| 61 72 64 20 6a 75 6d 70 | 2c 20 74 68 65 20 61 73 |ard jump|, the as|
|000062f0| 73 65 6d 62 6c 65 72 20 | 63 61 6e 20 66 69 67 75 |sembler |can figu|
|00006300| 72 65 20 69 74 20 6f 75 | 74 20 66 6f 72 20 79 6f |re it ou|t for yo|
|00006310| 75 2e 20 20 4f 6e 20 61 | 0d 0a 20 20 20 20 20 20 |u. On a|.. |
|00006320| 20 20 66 6f 72 77 61 72 | 64 20 6a 75 6d 70 20 6f | forwar|d jump o|
|00006330| 66 20 64 75 62 69 6f 75 | 73 20 6c 65 6e 67 74 68 |f dubiou|s length|
|00006340| 2c 20 6c 65 74 20 74 68 | 65 20 61 73 73 65 6d 62 |, let th|e assemb|
|00006350| 6c 65 72 20 64 65 66 61 | 75 6c 74 20 74 6f 20 61 |ler defa|ult to a|
|00006360| 20 4c 4f 4e 47 0d 0a 20 | 20 20 20 20 20 20 20 66 | LONG.. | f|
|00006370| 6f 72 6d 3b 20 61 74 20 | 77 6f 72 73 74 20 79 6f |orm; at |worst yo|
|00006380| 75 20 77 61 73 74 65 20 | 6f 6e 65 20 62 79 74 65 |u waste |one byte|
|00006390| 2e 0d 0a 0a 20 20 20 20 | 20 20 20 20 41 6c 73 6f |.... | Also|
|000063a0| 20 6c 65 61 76 65 20 74 | 68 65 20 61 73 73 65 6d | leave t|he assem|
|000063b0| 62 6c 65 72 20 74 6f 20 | 77 6f 72 72 79 20 61 62 |bler to |worry ab|
|000063c0| 6f 75 74 20 68 6f 77 20 | 74 68 65 20 74 61 72 67 |out how |the targ|
|000063d0| 65 74 20 61 64 64 72 65 | 73 73 20 69 73 0d 0a 20 |et addre|ss is.. |
|000063e0| 20 20 20 20 20 20 20 74 | 6f 20 62 65 20 72 65 70 | t|o be rep|
|000063f0| 72 65 73 65 6e 74 65 64 | 2c 20 69 6e 20 61 62 73 |resented|, in abs|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.