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)
(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
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
(2) Logical Instructions ANI 8-bit data AND 8-bit data with accumulator (A). Store the result in accumulator (A) Example: ANI 3FH
CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 1 A33 ANI 3FH A=A and DATA(8) =B3H =3FH =33H
(3) Logical Instructions XRA Register (8-bit) XOR specified register with accumulator. Store the result in accumulator. Example: XRA C
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
(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
H20L50 A55 AFTER EXECUTION XRA M A=A xor M BEFORE EXECUTION CY AC CY 0AC =55H =B3H =E6H H20L50 AE6 B3 2050H
(5) Logical Instructions XRI 8-bit data XOR 8-bit immediate data with accumulator (A). Store the result in accumulator. Example: XRI 39H
CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 0 A8A XRI 39H A=A xor DATA(8) =B3H =39H =8AH
(6) Logical Instructions ORA Register OR specified register with accumulator (A). Store the result in accumulator. Example: ORA B
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
(7) Logical Instructions ORA M OR specified register with accumulator (A). Store the result in accumulator. Example: ORA M
AFTER EXECUTION BEFORE EXECUTION CY AC ORA M A=A or M =55H =B3H =F7H H20L50 A55 AF7 CY 0AC 0 H20L50 B3 2050H
(8) Logical Instructions ORI 8-bit data OR 8-bit data with accumulator (A). Store the result in accumulator. Example: ORI 08H
CY AC AB3 AFTER EXECUTION BEFORE EXECUTION CY 0AC 0 ABB ORI 08H A=A or DATA(8) =B3H =08H =BBH
(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
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 A<R: CY=1,Z=0 A>M: CY=0,Z=0 A=M: CY=0,Z=1 A<M: CY=1,Z=0
(10) Logical Instructions CPI 8-bit data Compare 8-bit immediate data with accumulator (A). Store the result in accumulator. Example: CPI 30H
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<DATA: CY=1,Z= =BAH
(11) Logical Instructions STC It sets the carry flag to 1. Example: STC
CY0 AFTER EXECUTION BEFORE EXECUTION CY1 STC CY=1
(12) Logical Instructions CMC It complements the carry flag. Example: CMC
CY1 AFTER EXECUTION BEFORE EXECUTION CY0 CMC
(13) Logical Instructions CMA It complements each bit of the accumulator. Example: CMA
(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.
B7B6B5B4B3B2B1B0CY B6B5B4B3B2B1B0B7 AFTER EXECUTION BEFORE EXECUTION
(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.
B7B6B5B4B3B2B1B0CY B0B7B6B5B4B3B2B1B0 AFTER EXECUTION BEFORE EXECUTION
(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.
B7B6B5B4B3B2B1B0CY B6B5B4B3B2B1B0CYB7 AFTER EXECUTION BEFORE EXECUTION
(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
B7B6B5B4B3B2B1B0CY B7B6B5B4B3B2B1B0 AFTER EXECUTION BEFORE EXECUTION
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.
THANK YOU