You are on page 1of 4

PHILIPPINE COLLEGE OF SCIENCE AND TECHNOLOGY

Old Nalsian Road, Nalsian, Calasiao, Pangasinan, Philippines 2418


Tel. No. (075)522-8032/Fax No. (075)523-0894/Website: www.philcst.edu.ph
ISO 9001:2015 CERTIFIED, Member: Philippine Association of Colleges and Universities (PACU),
Philippine Association of Maritime Institutions (PAMI)

Assignment 3

Overview of Z8 Microcontroller Family

1. Draw the Z8 Microcontroller Unit Block Diagram?

2. What are the standard Z8 registers? Discuss each.

Registers can be accessed as either 8-bit or 16-bit registers using Direct, Indirect, or Indexed Addressing. All 236
general-purpose registers can be referenced or modified by any instruction that accesses an 8-bit
register,without the need for special instructions. Registers accessed as 16 bits are treated as evenodd register
pairs (there are 118 valid pairs). In this case, the data’s Most Significant Byte (MSB) is stored in the even
numbered register, while the Least Significant Byte (LSB) goes into the next higher odd numbered register

General-Purpose Registers
General-Purpose Registers (GPR) are undefined after the device
is powered up. The registers keep their last value after any reset,
as long as the reset occurs in the VCC voltage-specified operating
range. It will not keep its last state from a VLV reset if VCC drops
below 1.8v.
RAM Protect
The upper portion of the register file address space 80H to EFH
(excluding the control registers) may be protected from reading
and writing. The RAM Protect bit option is mask-programmable
and is selected by the customer when the ROM code is submit
ted. After the mask option is selected, the user activates this fea
ture from the internal ROM code to turn off/on the RAM Protect by
loading either a 0 or 1 into the IMR register, bit D6. A 1 in D6
enables RAM Protect. Only devices that use registers 80H to
EFH offer this feature.
Working Register Groups
Z8 instructions can access 8-bit registers and register pairs (16-
bit words) using either 4-bit or 8-bit address fields. 8-bit address
fields refer to the actual address of the register. For example,
Register 58H is accessed by calling upon its 8-bit binary equiv
alent, 01011000 (58H).
With 4-bit addressing, the register file is logically divided into
16 Working Register Groups of 16 registers each, as shown in
Table 2-2. These 16 registers are known as Working Registers.
A Register Pointer (one of the control registers, FDH) contains
the base address of the active Working Register Group. The high
nibble of the Register Pointer determines the current Working
Register Group.

3. What are the six addressing modes of Z8? Discuss each.

Register-  are temporary storage locations inside the CPU that hold data and addresses. The register file is the
component that contains all the general purpose registers of the microprocessor. A few CPUs also place
special registers such as the PC and the status register in the register file.

Indirect register -  In register indirect addressing mode, the data to be operated is available inside a memory
location and that memory location is indirectly specified by a register pair

Immediate - has a constant value or an expression. When an instruction with


two operands uses immediate addressing, the first operand may be a register or memory location, and the
second operand is an immediate constant. The first operand defines the length of the data.

Direct address - means that the value for a given instruction in assembly programming is pointed to by a given
value. This means the value is variable, based on what is stored in memory at a given address

Indexed (with a short 8-bit displacement) - is a way to optimize the performance of a database by minimizing
the number of disk accesses required when a query is processed. It is a data structure technique which is used
to quickly locate and access the data in a database

Programcounter relative -  commonly called the instruction pointer (IP) in Intel x86 and
Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter,
or just part of the instruction sequencer, is a processor register that indicates where a computer is in
its program

4. Z8 instructions can be divided functionally into eight groups. Give Example of each.

 Load

 Arithmetic

 Block Transfer
 Logical

 Rotate and Shift

 Program Control

 CPU Control
5. Draw the Z8 flag register and explain how each flag be set or cleared.

 CarryFlag - is set to 1
whenever the result of an arithmetic
operation generates a carry or a borrow the high order bit 7. Oth
erwise, the Carry Flag is cleared to 0.

 Zero Flag - For arithmetic and logical operations, the Zero Flag is set to 1 if
the result is zero. Otherwise, the Zero Flag is cleared to 0

 Sign Flag - The Sign Flag stores the value of the most significant bit of a re
sult following an arithmetic, logical, Rotate, or Shift operation.

 Overflow Flag - For signed arithmetic, Rotate, and Shift operations, the Over
flow Flag is set to 1 when the result is greater than the maximum
possible number (>127) or less than the minimum possible num
ber (<–128) that can be represented in two’s-complement form.
The Overflow Flag is set to 0 if no overflow occurs.

 Decimal Adjust Flag - The Decimal Adjust Flag is used for BCD arithmetic. Since the
algorithm for correcting BCD operations is different for additionand subtraction, this flag specifies what
type of instruction was last executed so that the subsequent Decimal Adjust (DA) operation can function
properly. Normally, the Decimal Adjust Flag cannot be used as a test condition.

 Half Carry Flag - The Half Carry Flag is set to 1 whenever an addition generates a
carry bit 3 (Overflow) or a subtraction generates a borrow bit 3.
The Half Carry Flag is used by the Decimal Adjust (DA) instruc
tion to convert the binary result of a previous addition or subtrac
tion into the correct decimal (BCD) result. As in the case of the
Decimal Adjust Flag, the user does not normally access this flag

You might also like