Saturday, 5 May 2012

8085 Logical instructions


Flags affected: After preforming these instructions carry flag will reset(except CMA) and sign, zero, parity flags are affected and these flags status depends on the result present in accumulator.

1.ANA instruction-logical And with accumulator
ANA R
this instructions performs bit wise AND operation between content of specified register and the accumulator and stores the result in accumulator.

2.ANI instruction-logical AND immediate data with accumulator
ANA 8-bit data
This instruction performs bit wise AND operation between 8-bit immediate data and accumulator content and stores the result in accumulator

3.ORA instruction-logical OR with accumulator
ORA R
This instruction performs bit wise OR operation between content of accumulator and specified register and stores result in accumulator.

4.ORI instruction-logical OR with immediate data
ORI 8-bit data
This instruction performs bit wise OR operation between content of accumulator and 8-bit immediate data specified in the instruction and stores the result in accumulator.

5.XRA instruction-logical exclusive OR operation with accumulator
XRA R
This instruction performs bit wise exclusive OR operation between content of accumulator and specified register in the instruction and stores the result in accumulator.

6.XRI instruction-Logical exclusive OR with 8-bit data
XRI 8-bit data
This instruction performs bit wise logical exclusive OR between immediate data and accumulator and stores the result in accumulator.

7.CMA instruction-complement accumulator
This instruction performs bit wise inversion of content of accumulator and result will be stored in accumulator.

8.RLC instruction-rotate accumulator left
This instruction rotates left the content of accumulator by one bit. The MSB of accumulator is shifted out and copied into LSB. Copy of MSB is kept in carry flag also.
9.RAL instruction-rotate accumulator left through carry
This instruction rotates left the content of accumulator along with carry by one bit. This instruction shifts the MSB of accumulator out and copies it into carry flag and content of carry flag is stored in LSB.
10.RRC instruction- rotate accumulator right
This instruction rotates the content of accumulator right by one bit. This instruction shifts the LSB of accumulator out and copies that into MSB. Copy of LSB is also stored in the carry flag
11.RAR instruction- rotate accumulator right through carry
This instruction rotates the content of accumulator through carry right by one bit. This instruction shifts the LSB of accumulator out and copies it into carry and content of carry is stored in the MSB.
12.CMP instruction- compare with accumulator
CMP R ; compare the content of specified register R with accumulator
CMP M ; compare content of memory location pointed by HL register pair with accumulator.
Depending on the content of R or M carry flag and zero flag are affected. This in turn subtracts content of R/M from accumulator but result is not stored any where, only flags are affected
ACC < R/M – CY flag is set, Z flag is reset
ACC = R/M - CY flag is reset, Z flag is set
ACC > R/M – CY is reset, Z flag is reset

13.CPI instruction- compare immediate data with accumulator
CPI 8-bit data
This instruction compares 8-bit data with the content of accumulator( this in turn subtracts 8-bit data from accumulator but result is not stored any where, only flags are affected). Depending on the content Carry flag and Zero flag are affected.
ACC < 8-bit data – CY flag is set, Z flag is reset
ACC = 8-bit data - CY flag is reset, Z flag is set
ACC > 8-bit data – CY is reset, Z flag is reset

Back                                                Contents                                           Next

No comments:

Post a Comment