Briefly explain following 8085 logical instructions: CMP, ANA, ORA, XRA, CMA, CMC, STC. Also write an assembly language code in gnusim8085 to find 1's and 2's complement of 8 bit number.


1. CMP: - (compare register or memory with accumulator) The contents of the operand register or memory are M compared with the contents of the accumulator. Both contents are preserved. The result of the comparison is shown by setting the flags of the PSW as follows:

if (A) < reg/mem: carry flag is set.
if (A) = reg/mem:

zero flag is set.
if (A) > reg/mem: carry and zero flags are reset.


Eg: - CMP B
          CMP M


2. ANA: - logical AND operation is performed with the specified register or memory with accumulator.
Eg: - ANA B
          ANA M


3. ORA: - Logical OR operation is performed between the accumulator and specified register and memory location.

Eg: - ORA B
          ORA M


4.XRA: - The content of the accumulator are exclusive OR with a specified register or memory location.

Eg: - XRA B
          XRA M


5. CMA: - The content of the accumulator is complemented.
Eg: - CMA


6. CMC: - The carry flag is complemented.
Eg: - CMC


7. STC: - This instruction sets the carry flag.
Eg: - STC


    write an assembly language code in gnusim8085 to find 1's and 2's complement of 8 bit number. 


8)Briefly explain the following 8085 arithmetic instructions: ADD, ADC, SUB, SBB, INR, DCR. Also write an assembly language code in gnusim8085 that performs addition and subtraction of given two 16 bit numbers. Ans :-  (Click here to View)

 10)Briefly explain the following 8085 shift instructions: RAL, RAR. Also, write an assembly language code in gnusim8085 to multiply and divide 8-bit numbers by value 4. Ans:-  (Click here to View)

No comments:

Get new posts by email:


APY Logo