beautypg.com

Figure 2 – Zilog Z8F0130 User Manual

Page 21

background image

eZ8

CPU Core

User Manual

UM012820-0810

Architectural Overview

6

Interrupts, the Software Trap (TRAP) instruction, and Illegal Instruction
Traps all write value of the Flags Register to the stack. Executing an Inter-
rupt Return (IRET) instruction restores the value saved on the stack into
the Flags Register.

Carry Flag

The Carry flag (C) is 1 when the result of an arithmetic operation gener-
ates a carry out or a borrow into the most significant bit (Bit 7) of the data.
Otherwise, the Carry flag is 0. Some bit rotate or shift instructions also
affect the Carry flag. There are three instructions available for directly
changing the value of the Carry Flag:

Complement Carry Flag (CCF)

Reset Carry Flag (RCF)

Set Carry Flag (SCF)

Figure 2. Flags Register

C

Z

S

V

D

H F2 F1

Flags Register

Bit

0

Bit

7

Half Carry Flag

Decimal Adjust Flag

Overflow Flag

Sign Flag

Zero Flag

Carry Flag

User Flags