Tuesday, February 16, 2010

Sap 3

V. Sample – as – possible 3 (Z – 80 microprocessor)


Z – 80 Hardware Organization

System Architecture

Internal Organization

Instruction Format

Execution of Instruction

The microprocessor unit appears on the left, and the memory appears on the right. The memory chip may be a ROM or a RAM, or any other chip which happens to contain memory. The memory is used to store instructions and data. Here, we will fetch one instruction from the memory to illustrate the role of the program counter. We assume that the program counter has valid contents. It now holds a 16-bit address which is the address of the next instruction to fetch in the memory. Every processor proceeds in three cycles:

figure 2.5


Z – 80 PINOUTs and family support Chips

The Z – 80 Instruction Set

Z80 instruction set consists of the following instructions:

  • Data move and exchange instructions.
  • Block move and search instructions.
  • Arithmetic - add, subtract, increment, decrement, decimal adjust, negate and compare.
  • Logic - AND, OR, exclusive OR, complement, shift and rotate.
  • Bit manipulation - set, reset and test bits.
  • Control transfer - conditional and unconditional: jumps, subroutine calls and returns from subroutine.
  • Input/Output instructions.
  • Other - stack operations, disabling/enabling interrupts, setting interrupt mode, etc.

Class of Instruction

Individual Description

The Z – 80 Flags

Flag is an 8-bit register containing 6 1-bit flags:

  • Carry (C), bit 0 - set if there was a carry during addition, or borrow during subtraction/comparison.
  • Subtract (N), bit 1 - this flag is set if the last operation was subtract. The flag is used by DAA instruction to do proper correction of BCD numbers.
  • Parity/Overflow (P/V), bit 2 - set if the parity (the number of set bits) in the result of logical operation is even. This flag also set when addition or subtraction results in a too large positive number or a too small negative number that cannot fit into destination operand, i.e. if the result is greater than +127 or smaller than -128. For example, adding 1 to 127 will set the overflow flag.
  • Half carry (H), bit 4 - set if there was a carry out from bit 3 to bit 4 of the result.
  • Zero (Z), bit 6 - set if the result is zero.
  • Sign (S), bit 7 - set if the result is negative.

No comments:

Post a Comment