Page 49 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 49
Unit 3: Assembly Language Programming of 8085
5. Logical operations simulate eight 2-input gates or inverters. Notes
6. The individual bits in the Accumulator are set or reset when logical operations are
performed.
7. The Sign (S), Parity (P) and Zero (Z) flags are altered and Carry flag (CY) is reset when
logical operations are performed.
8. NOT operation (CMA) does not affect any flags.
3.3.4 Branching Operations
The computer is based on the concept of flexibility and versatility. The results depend on
computer’s ability to transfer control or branch of the operation and instructions in a program.
This is not in a sequential order. This can be achieved through Branch Operation. They allow the
microprocessor to change the sequence of program either unconditionally or under certain test
conditions. Branch instructions instruct the microprocessor to break the sequential execution
manner and go to a different memory location and continue executing machine codes in sequential
manner from that new location. The address of the new memory location is either specified
explicitly or supplied by the microprocessor or any hardware device. These instructions act on
the program counter and it is possible to execute a block of instructions many times.
The jump instructions specify the memory location explicitly. This is a 3-byte instruction in which
nd
rd
the first byte is opcode and 2 and 3 bytes are 16-bit memory address. Jump instructions can be
of two categories:
(1) Unconditional Jump
(2) Conditional Jump
During the source of writing the program for a particular problem, if the program needs to jump
to an instruction which appears in the later part of the program then instead of giving the address,
a label or name can be given in the jump instruction. Later when that part of the program is
written, the same label can be referred at the statement to which the execution has to jump.
3.3.4.1 Unconditional Jump Instructions
A jump instruction is used to break the normal sequential execution and branch to a different
part of the program. This can be achieved by loading the address of the next out-of-sequence
instruction into the program counter. This forces the processor to fetch the contents of this new
location as its next instruction. The new address is usually specified in the jump instruction.
When the jump instruction is executed, no flag is affected. There is only one unconditional jump
instruction. The unconditional jump instruction enables the programmer to set up continuous
loop, i.e. endless loop. The unconditional jump instruction is listed in Table 3.5.
Table 3.5: List of Unconditional Jump Instructions
Opcode Operand Description
JMP 16-bit Jump
(a) It is a 3-byte instruction.
(b) Second and third bytes specify the 16-bit memory address.
(c) The second byte specifies the low-order and the third byte
specifies the high-order memory address.
LOVELY PROFESSIONAL UNIVERSITY 43