8085 Microprocessor

8 Instruction Set Contd.

3) Logical instructions cont..:

16).RLC (Rotate accumulator left) [An+1] <-- [An], [A0] <-- [A7],[CS] <-- [A7].

The content of the accumulator is rotated left by one bit. The seventh bit of the accumulator is moved to carry bit as well as to the zero bit of the accumulator. Only CS flag is affected.

17).RRC. (Rotate accumulator right) [A7] <-- [A0], [CS] <-- [A0], [An] <-- [An+1].

The content of the accumulator is rotated right by one bit. The zero bit of the accumulator is moved to the seventh bit as well as to carry bit. Only CS flag is affected.

 

18). RAL. (Rotate accumulator left through carry) [An+1] <-- [An], [CS] <-- [A7], [A0] <-- [CS].

 

19).RAR. (Rotate accumulator right through carry) [An] <-- [An+1], [CS] <-- [A0], [A7] <-- [CS].

4) Branching Instructions:

This group includes the instructions for conditional and unconditional jump, subroutine call and return, and restart.

Examples:

  1. MP addr (label). (Unconditional jump: jump to the instruction specified by the address). [PC] <-- Label.
  2. Conditional Jump addr (label): After the execution of the conditional jump instruction the program jumps to the instruction specified by the address (label) if the specified condition is fulfilled. The program proceeds further in the normal sequence if the specified condition is not fulfilled. If the condition is true and program jumps to the specified label, the execution of a conditional jump takes 3 machine cycles: 10 states. If condition is not true, only 2 machine cycles; 7 states are required for the execution of the instruction.
    1. JZ addr (label). (Jump if the result is zero)
    2. JNZ addr (label) (Jump if the result is not zero)
    3. JC addr (label). (Jump if there is a carry)
    4. JNC addr (label). (Jump if there is no carry)
    5. JP addr (label). (Jump if the result is plus)
    6. JM addr (label). (Jump if the result is minus)
    7. JPE addr (label) (Jump if even parity)
    8. JPO addr (label) (Jump if odd parity)
  3. CALL addr (label) (Unconditional CALL: call the subroutine identified by the operand)

CALL instruction is used to call a subroutine. Before the control is transferred to the subroutine, the address of the next instruction of the main program is saved in the stack. The content of the stack pointer is decremented by two to indicate the new stack top. Then the program jumps to subroutine starting at address specified by the label.

  1. RET (Return from subroutine).
  2. RST n (Restart) Restart is a one-word CALL instruction. The content of the program counter is saved in the stack. The program jumps to the instruction starting at restart location.