11. INR: - The contents of the designated register or memory) are incremented by 1 and the result is stored in the same place. If the operand is a memory location, its location is specified by the contents of the HL registers.

Eg: -INR B( the content of register B is incremented by 1.
       INR M( the content of memory location pointed by HL pair in incremented by 1)


12. INX: - Increment register pair by 1.

Eg: INX H (It means the location pointed by the HL pair is incremented by 1)



13.DCR: - The contents of the designated register or memory are M decremented by 1 and the
result is stored in the same place. If the operand is a memory location, its location is specified by the contents of the HL registers.

Eg: - DCR B(content of register B is decremented by 1)
         DCR M(the content of memory location pointed by the HL pointer is decremented by 1.)

14. DCX: - decrement the register pair by 1.


Eg: DCX H( it decreases the memory location pointed by HL pair by 1.



15. DAA: - Decimal adjust accumulator.

The contents of the accumulator are changed from a binary value to two 4-bit binary coded decimal (BCD) digits. This is the only instruction that uses the auxiliary flag to perform the binary to BCD conversion, and the
conversion procedure is described below. S, Z, AC, P, CY flags are altered to reflect the results of the operation.
If the value of the low-order 4-bits in the accumulator is greater than 9 or if AC flag is set, the instruction adds 6 to the low-order four bits. If the value of the high-order 4-bits in the accumulator is greater than 9 or if the Carry flag is set, the instruction adds 6 to the high-order four bits.

{ 20 comments... read them below or Comment }

  1. Register contents is FF if it is incremented then what is the result.

    ReplyDelete
    Replies
    1. register contains 00 and carry flag is set to 1

      Delete
    2. but i have read in INR and DCR inst all flags are changes except carry flag.. i also getting the doubt why carry flag is not changed in INR

      Delete
    3. I also have the same doubt.
      What is the effect on carry flag??

      Delete
    4. Carry flag is not set because it is not designed like that. Why do you think one would require carry when increment or decrementing? Carry is used only during addition and subtraction hence is faithfully generated during that operations.

      Delete
    5. right abhishek.keep this concept in mind bcz its famous in GATE

      Delete
  2. XRA A
    LXI B,0007H
    LOOP: DCX B
    JNZ LOOP

    How many tyms loop will be executed? If answer is 1. Why so?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. The program has a very tiny mistake.

      Except using DCX instruction, the instruction DCR is there. So, If we take DCR B, the loop gets executed only 1 time...

      Delete
    3. This comment has been removed by the author.

      Delete
    4. Infinite times. DCX does not affect the flags. DCR does.

      Delete
    5. Infinite times. DCX does not affect the flags. DCR does.

      Delete
    6. XRA A means XORing A with A wch gives 00000000 thus making ZERO FLAG as SET.. Thus only 1 Time loop will execute..

      Delete
  3. It will execute one times only Bcoz after XRA A zero flag will be set and as we know DRX,INX and CMA does not affects status of any flag. So zero will remains set and bcoz of ZNZ it will execute one time only.

    ReplyDelete
  4. What type of addressing would INR A be?

    ReplyDelete
  5. DVR B (B=00H) KA result accumulater me kaya aaye ga jaldi please

    ReplyDelete
  6. Why INR R operation does not effect flag register but DCR R operation effects flag register?

    ReplyDelete
  7. How to increment by 2 bytes

    ReplyDelete

Labels

- Copyright © 8085 Microprocessor -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -