0% found this document useful (0 votes)
3 views

lecture_9

The document provides an overview of logical operations in the 8085 microprocessor, including AND, OR, XOR, and NOT operations. It explains how these operations affect the accumulator and the status flags (S, Z, P, CY, AC) based on the results of the operations. Examples are provided to illustrate the execution of these operations with specific data values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

lecture_9

The document provides an overview of logical operations in the 8085 microprocessor, including AND, OR, XOR, and NOT operations. It explains how these operations affect the accumulator and the status flags (S, Z, P, CY, AC) based on the results of the operations. Examples are provided to illustrate the execution of these operations with specific data values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

‫أﻋداد اﻟدﻛﺗور أﺣﻣد ﺟﺑﺎر‬ ‫اﻟﻣﻌﺎﻟﺞ اﻟدﻗﯾق ‪8085‬‬

‫ﻣﻌﮭﺪ أﻋﺪاد اﻟﻤﺪرﺑﯿﻦ اﻟﺘﻘﻨﯿﯿﻦ‬


‫ﻗﺴﻢ اﻟﺘﻘﻨﯿﺎت اﻻﻟﻜﺘﺮوﻧﯿﺔ ‪ -‬اﻟﻤﺮﺣﻠﺔ اﻟﺜﺎﻧﯿﺔ‬
‫)اﻟﻤﺤﺎظﺮة اﻟﺘﺎﺳﻌﺔ(‬
‫)اﯾﻌﺎزات اﻟﻤﻌﺎﻟﺞ اﻟدﻗﯾق‪/8085‬اﻟﻣﻧطﻘﯾﺔ(‬
‫· اﻟﺑواﺑﺔ ‪AND‬‬
‫‪ ANA R‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (AND‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ﺳﺠﻞ اﻟﻤﺬﻛﻮر واﻟﻤﺮﻛﻢ ﯾؤﺛر ﻋﻠﻰ اﻷﻋﻼم )‪(P,S,Z‬‬
‫وﯾﺟﻌل‬ ‫اﻟﻧﺗﯾﺟﺔ‬ ‫وﺣﺳب‬ ‫وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫‪ ANA M‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (AND‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ﻣﻮﻗﻊ ذاﻛﺮة )ﯾﺴﺘﺪل ﻋﻠﻰ )‪ (AC=1‬و )‪.(CY=0‬‬
‫اﻟﻤﻮﻗﻊ ﻣﻦ زوج اﻟﺴﺠﻼت‪ (HL‬وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫)‪ ANI data (8b‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (AND‬ﺑﯿﻦ اﻟﺒﯿﺎﻧﺎت اﻟﻔﻮرﯾﺔ وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ‬
‫وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬

‫· اﻟﺑواﺑﺔ ‪OR‬‬
‫‪ ORA R‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (OR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت اﻟﺴﺠﻞ اﻟﻤﺬﻛﻮر واﻟﻤﺮﻛﻢ ﯾؤﺛر ﻋﻠﻰ اﻷﻋﻼم )‪(P,S,Z‬‬
‫وﯾﺟﻌل‬ ‫اﻟﻧﺗﯾﺟﺔ‬ ‫وﺣﺳب‬ ‫وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫‪ ORA M‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (OR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ﻣﻮﻗﻊ ذاﻛﺮة )ﯾﺴﺘﺪل ﻋﻠﻰ )‪ (AC=0‬و )‪.(CY=0‬‬
‫اﻟﻤﻮﻗﻊ ﻣﻦ زوج اﻟﺴﺠﻼت‪ (HL‬وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫)‪ ORI data(8b‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (OR‬ﺑﯿﻦ ﺑﯿﺎﻧﺎت ﻓﻮرﯾﺔ وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ وﯾﺨﺰن‬
‫اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬

‫· اﻟﺑواﺑﺔ ‪XOR‬‬
‫‪ XRA R‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (XOR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت اﻟﺴﺠﻞ اﻟﻤﺬﻛﻮر واﻟﻤﺮﻛﻢ ﯾؤﺛر ﻋﻠﻰ اﻷﻋﻼم )‪(P,S,Z‬‬
‫وﯾﺟﻌل‬ ‫اﻟﻧﺗﯾﺟﺔ‬ ‫وﺣﺳب‬ ‫وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫‪ XRA M‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (XOR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ﻣﻮﻗﻊ ذاﻛﺮة )ﯾﺴﺘﺪل ﻋﻠﻰ )‪ (AC=0‬و )‪.(CY=0‬‬
‫اﻟﻤﻮﻗﻊ ﻣﻦ زوج اﻟﺴﺠﻼت‪ (HL‬وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬
‫)‪ XRI data(8b‬ﯾﻘﻮم ﺑﺄﺟﺮاء ﻋﻤﻠﯿﺔ ﻣﻨﻄﻘﯿﺔ )‪ (XOR‬ﺑﯿﻦ ﺑﯿﺎﻧﺎت ﻓﻮرﯾﺔ وﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ‬
‫وﯾﺨﺰن اﻟﻨﺎﺗﺞ ﺑﺎﻟﻤﺮﻛﻢ‪.‬‬

‫· اﻟﺑواﺑﺔ ‪NOT‬‬
‫‪ CMA‬ﯾﻘﻮم ھﺬا اﻷﯾﻌﺎز ﺑﺎﯾﺠﺎد اﻟﻤﺘﻤﻢ ﻟﻤﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ )" ﻧﻔﻲ" أي ﻛﻞ ‪ 1‬ﯾﺼﺒﺢ ‪ ، 0‬ﻻ ﯾؤﺛر ﻋﻠﻰ اﻷﻋﻼم‪.‬‬
‫وﻛﻞ ‪ 0‬ﯾﺼﺒﺢ ‪.(1‬‬

‫ﻟﻠﻣرﺣﻠﺔ اﻟﺛﺎﻧﯾﺔ‪ /‬ﻗﺳم اﻟﺗﻘﻧﯾﺎت اﻻﻟﻛﺗروﻧﯾﺔ ﻓﻲ ﻣﻌﮭد أﻋداد اﻟﻣدرﺑﯾن‬ ‫‪35‬‬


‫أﻋداد اﻟدﻛﺗور أﺣﻣد ﺟﺑﺎر‬ ‫اﻟﻣﻌﺎﻟﺞ اﻟدﻗﯾق ‪8085‬‬

‫ﻣﺜﺎل‪/‬ﻧﻔﺬ ﻋﻤﻠﯿﺔ ‪AND‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ‪A=C9H , B=B3H‬‬


‫‪ANA B‬‬ ‫‪A=A.B‬‬
‫‪C9‬‬ ‫‪1100 1001‬‬
‫‪B3‬‬ ‫)‪1011 0011 (AND‬‬
‫‪81‬‬ ‫‪1000 0001‬‬
‫ﻣﻼﺣﻈﮫ‪ :‬اﻷﻋﻼم )‪ (S, Z, P‬ﺗﺘﺄﺛﺮ ﺑﺎﻟﻨﺘﯿﺠﮫ ﺑﯿﻨﻤﺎ ‪.Cy=0 AC=1‬‬
‫‪S=1, Z=0, P=1‬‬

‫ﻣﺜﺎل‪:‬اذا ﻛﺎﻧﺖ ﻣﺤﺘﻮﯾﺎت ‪ A= 3E‬ﻧﻔﺬ ﻋﻤﻠﯿﺔ ‪ AND‬ﻣﻊ اﻟﺒﯿﺎﻧﺎت ‪.9Dh‬‬


‫‪ANI ,9Dh‬‬ ‫‪A=3E.9D‬‬ ‫‪0011 1110‬‬
‫)‪1001 1101 (AND‬‬
‫‪A=1C‬‬ ‫‪0001 1100‬‬
‫‪P=0 , Z=0 , S=0 , CY=0, AC=1‬‬

‫ﻣﺜﺎل‪/‬ﻧﻔﺬ ﻋﻤﻠﯿﮫ ‪ OR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ‪A=C9H ,C=78H‬‬


‫‪ORA C‬‬ ‫‪A=C9+78‬‬ ‫‪1100 1001‬‬
‫)‪0111 1000 (OR‬‬
‫‪A=F9‬‬ ‫‪1111 1001‬‬
‫ﻣﻼﺣﻈﮫ‪:‬اﻷﻋﻼم ‪ S, Z, P‬ﺗﺘﺄﺛﺮ ﺑﺎﻟﻨﺘﯿﺠﮫ ﺑﯿﻨﻤﺎ ‪CY=0 , AC=0‬‬
‫‪P=1, S=1, Z=0‬‬

‫ﻣﺜﺎل‪/‬ﻧﻔﺬ ﻋﻤﻠﯿﮫ ‪OR‬اﻟﻤﻨﻄﻘﯿﺔ ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت ‪A=3E‬واﻟﺒﯿﺎﻧﺎت‪9DH‬‬


‫‪ORI ,9DH‬‬ ‫‪0011 1110‬‬
‫)‪A=3E+9D 1001 1101 (OR‬‬
‫‪A=BF‬‬ ‫‪1011 1111‬‬
‫ﻣﻼﺣﻈﮫ‪:‬اﻷﻋﻼم ‪ S, Z, P‬ﺗﺘﺄﺛﺮ ﺑﺎﻟﻨﺘﯿﺠﮫ ﺑﯿﻨﻤﺎ ‪CY=0 , AC=0‬‬
‫‪P=0, S=1, Z=0‬‬

‫• ﻣﺜﺎل‪/‬ﻧﻔﺬ ﻋﻤﻠﯿﮫ‪XOR‬ﺑﯿﻦ ﻣﺤﺘﻮﯾﺎت‪A=C9H , C=78H‬‬


‫‪XRA C‬‬ ‫‪A=C9 78‬‬ ‫‪1100 1001‬‬
‫‪0111 1000‬‬
‫‪A=B1‬‬ ‫‪1011 0001‬‬
‫ﻣﻼﺣﻈﮫ‪:‬اﻷﻋﻼم ‪ s,z,p‬ﺗﺘﺄﺛﺮ ﺑﺎﻟﻨﺘﯿﺠﮫ ﺑﯿﻨﻤﺎ ‪cy=0 ,‬‬
‫‪Ac=0, P=1, S=1, Z=0‬‬

‫ﻟﻠﻣرﺣﻠﺔ اﻟﺛﺎﻧﯾﺔ‪ /‬ﻗﺳم اﻟﺗﻘﻧﯾﺎت اﻻﻟﻛﺗروﻧﯾﺔ ﻓﻲ ﻣﻌﮭد أﻋداد اﻟﻣدرﺑﯾن‬ ‫‪36‬‬


‫أﻋداد اﻟدﻛﺗور أﺣﻣد ﺟﺑﺎر‬ ‫اﻟﻣﻌﺎﻟﺞ اﻟدﻗﯾق ‪8085‬‬

‫ﻣﺜﺎل ‪ :‬أذا ﻛﺎﻧﺖ ﻣﺤﺘﻮﯾﺎت اﻟﻤﺮﻛﻢ ) ‪، (A=89H‬أوﺟﺪ اﻟﻤﺘﻤﻢ ﻟﮫ ؟‬


‫‪CMA‬‬ ‫‪A=89h‬‬ ‫‪1000 1001‬‬
‫‪A=76‬‬ ‫‪0111 0110‬‬
‫ﻻ ﯾﺆﺛﺮ ﻋﻠﻰ اﻷﻋﻼم‬

‫ﻣﺜﺎل ‪ :‬أﻛﺘﺐ ﺑﺮﻧﺎﻣﺞ ﺑﻠﻐﺔ اﻟﻤﻌﺎﻟﺞ اﻟﺪﻗﯿﻖ ‪ 8085‬ﻷﯾﺠﺎد أﺧﺮاج اﻟﻌﻤﻠﯿﺔ اﻟﻤﻨﻄﻘﯿﺔ اﻷﺗﯿﺔ‪:‬‬

‫"""""""""""‬
‫‪Y = (A + B). (C‬‬ ‫!)‪B‬‬ ‫‪, if: A=C4 , B=32 , C=F9 , D=E2‬‬

‫‪Program‬‬ ‫‪Result‬‬
‫‪MVI A , C4H‬‬ ‫‪A=C4H‬‬
‫‪MVI B , 32H‬‬ ‫‪B=32H‬‬
‫‪MVI C , F9H‬‬ ‫‪C=F9H‬‬
‫‪MVI D , E2H‬‬ ‫‪D=E2H‬‬
‫‪ORA B‬‬ ‫‪A+B=C4+32=F6‬‬
‫‪MOV H,A‬‬ ‫‪H=F6H‬‬
‫‪MOV A,C‬‬ ‫‪A=F9‬‬
‫‪XRA D‬‬ ‫‪A‬‬ ‫‪D=F9 E2=1B‬‬
‫‪CMA‬‬ ‫‪A=E4‬‬
‫‪ANA H‬‬ ‫‪A.H=E4.F6=E4‬‬
‫‪HLT‬‬

‫!!!!!‪Homework‬‬
‫)‪A‬‬

‫)‪B‬‬

‫ﻟﻠﻣرﺣﻠﺔ اﻟﺛﺎﻧﯾﺔ‪ /‬ﻗﺳم اﻟﺗﻘﻧﯾﺎت اﻻﻟﻛﺗروﻧﯾﺔ ﻓﻲ ﻣﻌﮭد أﻋداد اﻟﻣدرﺑﯾن‬ ‫‪37‬‬

You might also like