Page 50 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 50

Introduction to Microprocessors


                  Notes          3.3.4.2 Conditional Jump Instructions

                                 Conditional jumps allow the processor to make decisions on certain conditions which are indicated
                                 by the flags. After every logic and arithmetic operation, flags are set or reset to reflect the status of
                                 the result. The conditional jump instructions check the flag status and make decisions about the
                                 sequence of the program. The 8085 has five flags, out of which auxiliary carry flag (AC) is used
                                 internally. The other four flags are used by the jump instructions. They are:
                                 (a) Carry flag (CY)

                                 (b) Zero flag (Z)
                                 (c) Sign flag (S)
                                 (d) Parity flag (P).
                                 Two jump instructions are associated with each flag. The sequence of a program can be changed
                                 either – because the condition is present or the condition is absent. All conditional jump instructions
                                 are 3-byte instructions. The first byte is the opcode, the second byte specifies the low-order memory
                                 address and the third byte specifies the high-order memory address. The high-order memory
                                 address denotes page number and low-order memory address denotes the line number. The
                                 conditional jump instructions are stated in Table 3.6.

                                                    Table 3.6: List of Conditional Jump Instructions

                                     Opcode   Operand    Description          Remarks

                                     JC       16-bit     Jump on Carry        If result generates carryand CY = 1.
                                     JNC      16-bit     Jump on No Carry     When CY = 0
                                     JZ       16-bit     Jump on Zero         If result is zero and Z = 1

                                     JNZ      16-bit     Jump on No Zero      When Z = 0
                                     JP       16-bit     Jump on Plus         If (MSB) D  = 0 and S = 0
                                                                                      7
                                     JM       16-bit     Jump on Minus        If (MSB) D  = 1 and S = 1
                                                                                      7
                                     JPE      16-bit     Jump on Even Parity  When P = 1

                                     JPO      16-bit     Jump on Odd Parity   When P = 0


                                                Conditional jumps are an important aspect of the decision-making process in
                                                the programming. These instructions test for a certain condition (e.g. Zero or
                                                Carry flag) and alter the program sequence when the condition is met. In
                                                addition, the instruction set includes an instruction called unconditional jump.

                                 3.3.5 Call, Return, and Restart
                                 These instructions change the sequence of a program either by calling a subroutine or returning
                                 from a subroutine. The conditional Call and Return instructions also can test condition flags.

                                 3.3.6 Machine Control Operations
                                 These instructions control machine functions such as Halt, Interrupt, or do nothing.

                                 The microprocessor operations related to data manipulation can be summarized in four functions:
                                   1. Copying data
                                   2. Performing arithmetic operations



        44                               LOVELY PROFESSIONAL UNIVERSITY
   45   46   47   48   49   50   51   52   53   54   55