Presentation is loading. Please wait.

Presentation is loading. Please wait.

Parul Polytechnic Institute Subject Code : 3330705 Name Of Subject : Microprocessor and assembly language programming Name of Unit : 8085 instruction set.

Similar presentations


Presentation on theme: "Parul Polytechnic Institute Subject Code : 3330705 Name Of Subject : Microprocessor and assembly language programming Name of Unit : 8085 instruction set."— Presentation transcript:

1 Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name of Unit : 8085 instruction set Topic : Logical Instruction Name of Faculty : H.M.Avaiya & N.D.Dhameliya Name of Students: (i) Jaisingvani Vinita(094) (ii) Jawangjale Priyanka(110)

2 (1) Logical Instructions ANA R ANA M AND specified data in register or memory with accumulator. Store the result in accumulator (A). Example: ANA B, ANA M

3 B10C DE HL A B0FC DE HL A0A AFTER EXECUTION ANA B A=A and R B0FC DE HL AAA BEFORE EXECUTION CY AC CY 0AC1 AFTER EXECUTION BEFORE EXECUTION CY AC CY 0AC1 A11 A55 H20L 50 H 20L 50 B3 2050H ANA M A=A and M 2050H =AAH =0FH =0AH =55H =B3H =11H

4 (2) Logical Instructions ANI 8-bit data AND 8-bit data with accumulator (A). Store the result in accumulator (A) Example: ANI 3FH

5 CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 1 A33 ANI 3FH A=A and DATA(8) =B3H =3FH =33H

6 (3) Logical Instructions XRA Register (8-bit) XOR specified register with accumulator. Store the result in accumulator. Example: XRA C

7 B10C DE HL A BC2D DE HL A87 AFTER EXECUTION XRA C A=A xor R BC2D DE HL AAA BEFORE EXECUTION CY AC CY 0AC =AAH =2DH =87H

8 (4) Logical Instructions XRA M XOR data in memory (memory location pointed by H-L pair) with Accumulator. Store the result in Accumulator. Example: XRA M

9 H20L50 A55 AFTER EXECUTION XRA M A=A xor M BEFORE EXECUTION CY AC CY 0AC =55H =B3H =E6H H20L50 AE6 B3 2050H

10 (5) Logical Instructions XRI 8-bit data XOR 8-bit immediate data with accumulator (A). Store the result in accumulator. Example: XRI 39H

11 CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 0 A8A XRI 39H A=A xor DATA(8) =B3H =39H =8AH

12 (6) Logical Instructions ORA Register OR specified register with accumulator (A). Store the result in accumulator. Example: ORA B

13 AFTER EXECUTION BEFORE EXECUTION CY AC ORA B A=A or R =AAH =12H =BAH B12C DE HL AAA B12C DE HL ABA CY0AC 0

14 (7) Logical Instructions ORA M OR specified register with accumulator (A). Store the result in accumulator. Example: ORA M

15 AFTER EXECUTION BEFORE EXECUTION CY AC ORA M A=A or M =55H =B3H =F7H H20L50 A55 AF7 CY 0AC 0 H20L50 B3 2050H

16 (8) Logical Instructions ORI 8-bit data OR 8-bit data with accumulator (A). Store the result in accumulator. Example: ORI 08H

17 CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 0 ABB ORI 08H A=A or DATA(8) =B3H =08H =BBH

18 (9) Logical Instructions CMP Register CMP M Compare specified data in register or memory with accumulator (A). Store the result in accumulator. Example: CMP D or CMP M

19 B10C DE HL A BC DB9E HL AB8 AFTER EXECUTION CMP D A-R BC DB9E HL AB8 BEFORE EXECUTION CY Z 0Z0 AFTER EXECUTION BEFORE EXECUTION CY Z 0Z 1 AB8 A H20L 50H 20L 50 B8 2050H CMP M A-M 2050H A>R: CY=0,Z=0 A=R: CY=0,Z=1 AM: CY=0,Z=0 A=M: CY=0,Z=1 A

20 (10) Logical Instructions CPI 8-bit data Compare 8-bit immediate data with accumulator (A). Store the result in accumulator. Example: CPI 30H

21 CY Z ABA AFTER EXECUTION BEFORE EXECUTION CY 0AC 0 ABA CPI 30H A-DATA A>DATA: CY=0,Z=0 A=DATA: CY=0,Z=1 A

22 (11) Logical Instructions STC It sets the carry flag to 1. Example: STC

23 CY0 AFTER EXECUTION BEFORE EXECUTION CY1 STC CY=1

24 (12) Logical Instructions CMC It complements the carry flag. Example: CMC

25 CY1 AFTER EXECUTION BEFORE EXECUTION CY0 CMC

26 (13) Logical Instructions CMA It complements each bit of the accumulator. Example: CMA

27 (14) Logical Instructions RLC Rotate accumulator left Each binary bit of the accumulator is rotated left by one position. Bit D7 is placed in the position of D0 as well as in the Carry flag. CY is modified according to bit D7. Example: RLC.

28 B7B6B5B4B3B2B1B0CY B6B5B4B3B2B1B0B7 AFTER EXECUTION BEFORE EXECUTION

29 (15) Logical Instructions RRC Rotate accumulator right Each binary bit of the accumulator is rotated right by one position. Bit D0 is placed in the position of D7 as well as in the Carry flag. CY is modified according to bit D0. Example: RRC.

30 B7B6B5B4B3B2B1B0CY B0B7B6B5B4B3B2B1B0 AFTER EXECUTION BEFORE EXECUTION

31 (16) Logical Instructions RAL Rotate accumulator left through carry Each binary bit of the accumulator is rotated left by one position through the Carry flag. Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. CY is modified according to bit D7. Example: RAL.

32 B7B6B5B4B3B2B1B0CY B6B5B4B3B2B1B0CYB7 AFTER EXECUTION BEFORE EXECUTION

33 (17) Logical Instructions RAR Rotate accumulator right through carry Each binary bit of the accumulator is rotated left by one position through the Carry flag. Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. CY is modified according to bit D7. Example: RAR

34 B7B6B5B4B3B2B1B0CY B7B6B5B4B3B2B1B0 AFTER EXECUTION BEFORE EXECUTION

35 Concept of Subroutine Concept of Subroutine In 8085 microprocessor a subroutine is a separate program written aside from main program,this program is basically the program which requires to be executed several times in the main program. The microprocessor can call subroutine any time using CALL instruction. after the subroutine is executed the subroutine hands over the program to main program using RET instruction.

36 THANK YOU


Download ppt "Parul Polytechnic Institute Subject Code : 3330705 Name Of Subject : Microprocessor and assembly language programming Name of Unit : 8085 instruction set."

Similar presentations


Ads by Google