8085 Microprocessor Logical Instructions YASH PAL, March 18, 2026March 18, 2026 8085 Microprocessor Logical Instructions – Logic instructions perform logic operations such as AND, OR, Exclusive-OR, NOT, rotate, and compare on the data of registers, memory locations, and immediate data. All logical instructions have one operand in the accumulator. The result is also stored in the accumulator. Logical Instructions of 8085 Microprocessor ANDing Operations ORing Operations Ex-ORing Operations Complement Operation Compare Operations Rotate Operations ANDing Operations ANA RLogically AND the contents of the accumulator with the contents of register R.OperationA ← A AND RLength1 byteAddressing modeRegister addressing modeFlagsAll flags are affected with CY = 0 and AC = 1. ANA MLogically AND the contents of the accumulator with the contents of the memory location pointed by register pair HL.OperationA ← A AND [HL]Length1 byteAddressing modeIndirect addressing modeFlagsAll flags are affected with CY = 0 and AC = 1. ANI data (8 bit)Logically AND the 8-bit immediate data with the contents of the accumulator.OperationA AND dataLength2 byteAddressing modeImmediate addressing modeFlagsAll flags are affected with CY = 0 and AC = 1. ORing Operations ORA RLogically OR the contents of the accumulator with the contents of register R.OperationA ← A OR RLength1 byteAddressing modeRegister addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. ORA MLogically OR the contents of the accumulator with the contents of the memory location pointed by register pair HL.OperationA ← A OR [HL]Length1 byteAddressing modeIndirect addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. ORI data (8-bit)Logically OR the contents of the accumulator with the immediate 8-bit data.OperationA ← A OR dataLength2 byteAddressing modeImmediate addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. Ex-ORing Operations XRA RLogically EX-OR the contents of register R with the accumulator contents. The result is stored in the accumulator.OperationA ← A ExOR RLength1 byteAddressing modeRegister addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. XRA MLogically EX-OR the contents of the memory location pointed by the HL register pair with the accumulator contents. The result is stored in the accumulator.OperationA ← A ExOR [HL]Length1 byteAddressing modeIndirect addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. XRI data (8-bit)Logically EX-OR the 8-bit immediate data with the accumulator contents and store the result in the accumulator.OperationA ← A ExOR dataLength2 byteAddressing modeImmediate addressing modeFlagsAll flags are affected according to the result with CY = 0 and AC = 1. Complement Operation CMAComplement the contents of the accumulator.OperationA ← ALength1 byteAddressing modeImplicit addressing modeFlagsNo flag is affected. Compare Operations CMP RCompare (subtract) the contents of register R with the contents of the accumulator. The result of the subtraction operation is not stored.OperationA – RLength1 byteAddressing modeRegister addressing modeFlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:A > R if CY = 0, Z = 0A = R if CY = 0, Z = 1A < R if CY = 1, Z = 0 CMP MCompare (subtract) the contents of the memory location pointed by register pair HL with the contents of the accumulator. The result is not stored.OperationA – [HL]Length1 byteAddressing modeIndirect addressing modeFlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:A > M if CY = 0, Z = 0A = M if CY = 0, Z = 1A < M if CY = 1, Z = 0 CPI data (8 bit)Compare (subtract) the immediate data with the contents of the accumulator. The result is not stored.OperationA – dataLength2 byteAddressing modeImmediate addressing modeFlagsAll flags are affected according to the result. The result of the comparison can be obtained with the help of flags as follows:A > data if CY = 0, Z = 0A = data if CY = 0, Z = 1A < data if CY = 1, Z = 0 Rotate Operations RLC operation RLCRotate the accumulator left without carryOperationAs shown in the above imageLength1 byteAddressing modeImplicit addressing modeFlagsOnly the CY flag is affected according to the most significant bit (D7). RAL Operation RALRotate the accumulator left with carryOperationAs shown in the above imageLength1 byteAddressing modeImplicit addressing modeFlagsOnly the CY flag is affected according to the most significant bit (D7). RRC Operation RRCRotate the accumulator right without carryOperationAs shown in the above imageLength1 byteAddressing modeImplicit addressing modeFlagsOnly the CY flag is affected according to the most significant bit (D0). RAR Operation RRCRotate the accumulator right with carryOperationAs shown in the above imageLength1 byteAddressing modeImplicit addressing modeFlagsOnly the CY flag is affected according to the least significant bit (D0). Note: The rotate instructions are primarily used in arithmetic multiply and divide operations and for serial data transfer. engineering subjects Microprocessor microprocessor