Assembly Hebrew

  • Published on
    08-Nov-2014

  • View
    181

  • Download
    7

Embed Size (px)

Transcript

<p> " ) (1-5</p> <p> " </p> <p> " </p> <p> " </p> <p> -" -</p> <p> - </p> <p> )(</p> <p> 1043311 " .2006 . , ,' ,16-, " ,39513- .61394The Centre For Educational Technology, 16 Klausner St., Ramat-Aviv, P.O.Box 39513, Tel-Aviv, 61394. Printed in Israel.</p> <p> , / . , , , , , , , , , , . , , , ) (.</p> <p> 77 11 14 42</p> <p> 1 1.1 1.2 1.3 1.4</p> <p>4747 48 64 63 74 77 84</p> <p> 2 2.1 2.2 2.3 2.4 2.5 2.6</p> <p>8585 97 103 107</p> <p> 3 3.1 3.2 3.3 3.4</p> <p>109109 110 115 123 131 138 139</p> <p> 4 8086 8086- 8086</p> <p>4.1 4.2 4.3 4.4 4.5 4.6</p> <p> EQU</p> <p>141141 141 144 163 182 188 202</p> <p> 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7</p> <p>215215 221 224 225 226 229 235 240 243</p> <p> 6 , )(Immediate addressing )(Register addressing )(Direct addressing mode )(Indirect Addressing Register )(Direct Indexed Mode )(Base Relative Addressing - )(Based Indexed Addressing Modes</p> <p>6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9</p> <p>249249 250 253 264 271 277 281 284 302</p> <p> 7 , 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9</p> <p>311311 313 313 316 318 319 321 325 327</p> <p> 8 MOVS</p> <p>8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9</p> <p> (Store a String) STOS (Load a String) LODS (CoMPare String) CMPS (SCAn String) SCAS XLAT</p> <p>329329 329 338 346 350</p> <p> 9 - DOS 8086</p> <p>9.1 9.2 9.3 9.4 9.5</p> <p> INOUT-</p> <p>353353 356 358 375</p> <p> 10 " " )(pipelining</p> <p>10.1 10.3</p> <p> 10.2 10.4 </p> <p>7</p> <p> 1.1 . ),(Software , . , . : .1 , "" , , : , , . .2 , : ) ,Linux ,Windows( ,, ; , , "" , , , "" )( : , , , , . , ).(hardware : , , . , . : , ) ( , , . , , , : , .</p> <p>8</p> <p> ) ;(machine language 0 1- . ) ""( . . - , - 0 .1- , . ) ,(Assembly language "-" . " " ) .*(Mnemonic codes , , . : ) ADD (ADDition ) CMP .(CoMPare , . "" ) .(Assembler . , " " ).(Low level languages , , . : IBM . , ) (High Level Languages Visual Basic ,C++ ,JAVA ,C ,. , , . : ,A=9 A , 9 , "."A</p> <p> "" "" ," : ".</p> <p>*</p> <p>9</p> <p> , . "" ) .(Compilation - "" ) .(Compiler , . - "" ) .(Interpretation . "" ). (Interpreter</p> <p> 1.1 </p> <p> 1.1 : .C . ? : result = count1 + count2 + count3</p> <p>10</p> <p> , . , ;result: = count1 + count2 + count3 , C: ;result = count1 + count2 + count3 , . , , ) .(Personal Computer PC ; . . .1.1</p> <p> 1.1</p> <p> mov AX, count1 add add AX, count2 AX, count3</p> <p> 101000010000000000000 00000011000001100000001000000000</p> <p> count1AX- ,AX+count2 AX- ,AX+count3 AX- AXresult-</p> <p>00000011000001100000010000000000</p> <p>mov result, AX</p> <p>000000110000011000000000</p> <p> MOV , ADD AX "" , , . ,1.1 . . )( . ,</p> <p>11</p> <p> - , . . ) ( , . ; , . , , , , . Linux ,Windows :. ) (Embedded System , , :- , , . . , , : , , . , , , . - , , . , , .</p> <p> 1.2 , . 1.2 . )( , </p> <p>12</p> <p> , . , ,L6 ) , , ( - , . , ,L5 . ,L5 , , , . , ,L4 , , . , , .L3 , , ,L2 . , .L1 ; ) ( , .L0</p> <p> 1.2 </p> <p>13</p> <p> : . , . , . , ; . : .1 Instruction Set Architecture .ISA : ) , , (; ; , . ,HAS . : ; ; . </p> <p> .2 ,Hardware System Architecture</p> <p> , : , , . , , " " . 1951 EDVAC " " , . , . : ) (Processor ; ) (Memory ; </p> <p>14 </p> <p> "" ) (buses . -</p> <p> 1.3 </p> <p> "" , . .</p> <p> 1.3 . , , . : </p> <p> , . . ,</p> <p>15</p> <p> / . / . : ) (fetch ) (execute " -".</p> <p> 1.3.1 "" "" .</p> <p> . "" - 100; 6 . , . : . ; . . 0.99- , , , . , ,: , . , , ) (99 ,98 , .0</p> <p>16</p> <p> . , -: ) ( </p> <p> 1.4 </p> <p> , . , , 6 ) ( . "" ) ;(register . . " " ) Instruction Pointer .(IP " " ) Instruction Register .(IR .</p> <p>17</p> <p> ; : .1 - ) Arithmetic Logic Unit ,(ALU , : , . .2 AX .BX- - . .3 " " ) Flag register (FR . , : ?X = Y - .1.5</p> <p> 1.5 </p> <p> , .</p> <p>18</p> <p> 1.3.2 , , . "" ) ;(operator ,MOV : C =. "" ) ;(operand : ;A=8 ;A:=8 :C :</p> <p> )=( : A .8 ; : A=A+B C ;A:=A+B C .C B = A : :C : + :</p> <p> , for if ; , , . , . , 0.2- . : ][ ] [ ] [ ] [ ] [ ][ : : :</p> <p>19</p> <p> , . . , : , )(AX, BX </p> <p> , . , 6 . , . 0.99- - -, : 01 AX 02 BX , : ][xx] [yy] [zz ] [xx )(; ] [yy [zz]- . , 06 01 12 : 06 , ) ( , 12 01- , 01 : ,AX12- .</p> <p> 1.3.3 , : ) ( , . , , .</p> <p>20</p> <p> , " " " " . : , , . : ][xx] [yy] [zz : AX, BX . : , AX BX . , : , , , 01 .05 .</p> <p>21</p> <p> 1.2</p> <p> 01 02 03 04 05</p> <p> :</p> <p>01 01 27 02 01 02 04 99 27</p> <p> 27 AX BX AX 27 99 , 99 ?98 , : 99 98 , : 03 01 99 " 99 "AX 05 98 01 AX 98</p> <p> . 01 : , : ; ;AX ; ; ? : - . .</p> <p>22</p> <p> : 01- , 01 ; 01 3 (yy) 4- 5 (zz) 6- ) 1( AX . , , . , 02 05 ., , . 01 01 23 : 01 AX 23 01 AX 23 :</p> <p> . : + : AX BX ; : . . , , .1.3 06 :.07-</p> <p>23</p> <p> 1.3</p> <p> 06 07</p> <p> + + :</p> <p>06 01 27 07 01 02</p> <p> AX + 27 AX- AX + BX AX-</p> <p> , , , .</p> <p> , ;00 . 1.1</p> <p> : 23 A 54 B A + B A- A B- .</p> <p> A .B- , A- B- AX BX- .AX </p> <p>24</p> <p> AX .A , 98 99- . 98 A 99 .B : 04 98 23 04 99 54 03 01 98 03 02 99 07 01 02 05 98 01 00 23 98 54 99 98 AX 99 BX AX+BX AX AX 98 </p> <p> , , .0 . .1.6</p> <p> 1.6 1.1</p> <p>25</p> <p> , IP ,0 . ,6 98 ,99- A ,B- .</p> <p> , . .1 04 98 23 -</p> <p> . : , ) 0 IP( .IR IP ,1- ) (. .</p> <p> 1.7.</p> <p> 04 98 23 :</p> <p> 1.7</p> <p> . </p> <p>26</p> <p> 23 .98 1.7.</p> <p> 04 98 23</p> <p> 1.7</p> <p> .2 04 99 54</p> <p> - , . : . ,: ) 1 (IP IP ,1- ) , .(02 , : . :</p> <p>27</p> <p> 04 99 54</p> <p> 1.8</p> <p> . 54 .99 :</p> <p> 04 99 54</p> <p> 1.8</p> <p>28</p> <p> .3 03 01 98</p> <p> ) 02 (IP IP ,1- ) (. : 98 .AX :</p> <p> - 03 01 98</p> <p> 1.9</p> <p> .4 03 02 99</p> <p> , . 54 98 .BX .1.10</p> <p> .5 07 01 02</p> <p> , AX .54 + 23 .1.11</p> <p>29</p> <p> - 03 02 99</p> <p> 1.10</p> <p> - 07 01 02</p> <p> 1.11</p> <p> .6 05 98 01</p> <p> 77 .98 - .1.12</p> <p>30</p> <p> - 05 98 01</p> <p> 1.12</p> <p> .7 00</p> <p> , IP 06 . .</p> <p> 1.2 . 99 98 .99 . 2- .99</p> <p> 1.3 : 34 A 15 B A1- A+B B- A 98 B .99</p> <p>31</p> <p> 1.4 . : 15 A 32 B A+B+19 A- . ) ( - . , 0 A B- 98.99-</p> <p> 1.3.4 , , ) ( . : A = B A=2 B=2 </p> <p> , . )( ) 00- ,(07 92 . : )( </p> <p> .</p> <p>32</p> <p> . . , , , FR ; , . : = FR 1 FR 0</p> <p> : AX .BX AX .BX , . </p> <p> :</p> <p> 1.3</p> <p> 08 09</p> <p> = ? = ?</p> <p> 1 , 0- . A .B- , A=2 .B=2 .</p> <p>33</p> <p> , . , . 1 ; ,0 , . : FR = 1 IP</p> <p> , ) 0 (99- . , , .IP- , ,1 IP , . 10 ; : 10 , 10 07 : ,1 IP ;07 .07</p> <p> , ) ( . , . - , .</p> <p>34</p> <p> 11 ; : 11 , 11 07 : IP ;07 , .07</p> <p> 1.2</p> <p> 1.5 : A B- 2 A 2 B . . 98 A 99 .B</p> <p> 1.5</p> <p> 0 1 2 3 4 5 6 7</p> <p> 03 01 98 03 02 99 09 01 02 10 06 04 99 02 11 07 04 98 02 00</p> <p> 98 AX 99 BX AX=BX 1 ,1 IP 06 2 99 IP 07 2 98 </p> <p>35</p> <p> ) :(1.6 A B- A .B-</p> <p> A=B AB</p> <p> 1.6</p> <p> 98 AX 99 BX AX = BX 1 ,1 IP- 06 2 98 </p> <p> 98 AX 99 BX AX = BX 1 ,0 IP- 04 2 99 IP 07 </p> <p> A 40 B .30 .1.13</p> <p> A B</p> <p> 1.13</p> <p>36</p> <p> A B - .1 03 01 98 03 02 99 - . :</p> <p> 1.14 - </p> <p> .2 09 01 02 , . , .0 :</p> <p>37</p> <p> - 09 01 02</p> <p> 1.15</p> <p> .3 10 06 . ,FR=0 ) ( ) , .(04 :</p> <p> - 10 06</p> <p> 1.16</p> <p>38</p> <p> .5 04 99 02 - - . :</p> <p> - 04 99 02</p> <p> 1.17</p> <p> .6 11 07 ) IP .(1- . ; IP ,1- ) .(06 , :</p> <p>39</p> <p> 11 07</p> <p> 1.18</p> <p> IP .07 :</p> <p> 11 07</p> <p> 1.18</p> <p>40</p> <p> .7 00 07 , .</p> <p> A = B - A B- .40</p> <p> .1 03 01 98 03 02 99 ) .(B A , :</p> <p> 1.19 - </p> <p> .2 :09 01 02 - , - A ,B- "" , .1 :</p> <p>41</p> <p> - 02 01 09</p> <p> 1.20</p> <p> .3 10 06 ,FR=1- , IP : , IP) 1- (04 , IP .06 - :</p> <p> - 10 06</p> <p> 1.21</p> <p>42</p> <p> .4 04 98 02 - , 02 .98 ) (00 .</p> <p> 1.5 , , : B5 A 10 BB+5 A = B A A*2 . A- 98 B- .99</p> <p> 1.4 . ) .(1.4 : ) (Data bus ) (Address bus ) (Control bus : </p> <p> )" "( . , . . .</p> <p>43</p> <p> . , , ,0 : ;0 );(read 0 ; .</p> <p> 1.22 </p> <p> . , 23 98 , : 98 ; ;23 ).(write</p> <p> 1.23 </p> <p>44</p> <p> - . ; , . , ) (3V .0V , , ; ) .(1.24 . 8086 ) ( 5 " "4 3.6 ) ( . ) (ADD 10 , 8086 500,000 4 360,000,000 .</p> <p> 1.24 </p> <p> - , , . , . . , , . , .: 07 02 01 , . , ) , -( .- , , . , . .</p> <p>45</p> <p> , / . / . , / . : / . . , , , . ; , )(.</p> <p> 1.25 </p> <p> , 50- . . ,- )( . , )(.</p> <p>46</p> <p> .: , ? - , ? , , ? - . </p> <p>47</p> <p> 2.1 , : ) - , ( , , , , . , . ) ( : ; , , , , 0 .1- 100101 : .1111 : ; " : " ) (1- " " ) .( 0- , . , . . . : 1 , 100- 1 ;100- : , ) .(200 , , . , - . , . . , 0 100- ) , ( . </p> <p>48</p> <p> , , 85 95- " " , . , " " 89 .93 , , , . . - . , , .- , . .</p> <p> 2.2 . , - 2000 3000-"* . , , - . , b , b ,2 ,1 ,0 ,b1 ) .(digits . ,b :</p> <p>a0an1an2a0 - : anbn + an1bn-1 + an2bn2 + + a0b0 ai , .0 ai &lt; b 3500-" )( . , b b1, b2, b3 , b0,' . - , . :http://lib.cet.ac.il/pages/item.asp?item=7878*</p> <p>49</p> <p> , ) (109457362 : : 9 106 + 4 105 + 5 104 + 7 103 + 3 102 + 6 101 + 2 100 , : 9000000 + 400000 + 50000 + 7000 + 300 + 60 + 2 , ai , .0 ai &lt; 9 : , , ) (16 ) .(8</p> <p> 2.2.1 ) ( , b 10 : 0 1 2 3 4 5 6 7 8 9 , , ,582710 , .2.1 582710</p> <p> 2.1</p> <p>1000 100 10 1 5 8</p> <p> 2 7</p> <p> 7 ; 1 ; 2 ; 10 ; 8 ; 100 ;</p> <p>50</p> <p> ;5 1000 . , . ,5287 ) 5 (1000 ) 7 .(1 ) 0- ( . :10 582710 = 5 103 + 8 102 + 2 101 + 7 100 , 10 ,5827 .10 , , 582710 .5827 , . , 0.001 .293.46 . - ' '+ ' ' . " " ) ""(. : ? ,: 0.461 = 4 0.1 + 6 0.01 + 1 0.001 ,10 : 4 ,101 = 0.1 6 ,102 = 0.01 1 .103 = 0 001</p> <p>51</p> <p> : ,10 ,10 . 10 , 10 . , K 10 :</p> <p>= K10 = (an1an2...a2a1a0a1a2...am )10 = an110n1 + an210n2 + ... + a2102 + a1101 + a0100 + + a1101 + a2102 + ... + am10m ai ) i (. n ) - 0 (n1 m ) - 1 .(m ' '+ ''.</p> <p> 2.1 7 : 0.02357 . 408.87 . 273589 . 4782 .</p> <p> 2.2.2 , b = 2 0 : 1- . , 1012 10110110002- . ) ( ) bit .( binary digit , 10112 4 ) 4( . , ) (2 : , .1012 , .b = 2 2.2 .1001012</p> <p>52</p> <p> 1001012</p> <p> 2.2</p> <p>5 25 1 24 0</p> <p>4 23 0</p> <p>3 22 1</p> <p>2 21 0</p> <p>1 20 1</p> <p>0</p> <p> 2.2 . : 10110112 110101102</p> <p> . . . , , ' '+ '' . , , 0 , ,1- , '' ' .'+ ,2.3 , .3.2</p> <p> 2.3 : 100010012 . 11010112 .</p> <p> 2.2.3 . , , . , , ) (16 , , .</p> <p>53</p> <p> , . , . - .</p> <p> . K , : K = an12n1 + an22n2 + + ai 2i + + a12...</p>