beautypg.com

Program status word (psw) – NEC PD75402A User Manual

Page 50

background image

CHAPTER 4. INTERNAL CPU FUNCTIONS

39

4.7

PROGRAM STATUS WORD (PSW) ..... 8 BITS

The program status word (PSW) consists of various flags concerning closely the processor operation. Fig. 4-10

shows its configuration.

Saved to the stack memory per 8 bits at the interrupt acceptance and restored from the stack memory per 8 bits

at the RETI instruction execution (see Figs. 4-8 and 4-9).

Fig. 4-10 Program Status Word Configuration

The PSW is not assigned to the data memory space. So it is impossible to operate each flag by the memory

manipulation instruction. The carry flag (CY) alone is operable by a dedicated instruction, however.

IST0 turns 0 and SK0 to SK2 and CY turn indeterminate at RESET input.

(1)

Carry flag (CY)

The carry flag is a 1-bit flag to store the overflow occurrence information at the operation instruction with carry

(ADDC) execution.

The carry flag also has the function of the bit accumulator, so it can perform Boolean operation with the bit address

specify data memory and can store its results.

The carry flag is operated by a dedicated instruction irrespective of the other PSW bits.

The carry flag turns indeterminate with the RESET input.

Table 4-1 Carry Flag Manipulation Instructions

Instruction (Mnemonic)

Carry Flag Operation, Process

SET1 CY

CLR1 CY

NOT1 CY

SKT CY

AND1 CY, fmem.bit

OR1 CY, fmem.bit

XOR1 CY, fmem.bit

At interrupt execution

RETI

Set (1) CY

Clear (0) CY

Invert the content of CY

Skip if the content of CY is 1

Take AND/OR/XOR of the contents bit of the specified bit and CY

and store the result in CY

Save to the stack memory in 8 bits parallel to the other PSW bits

Restore from the stack memory in parallel to the other PSW

---------------------------------------------------------------------------------------------------------

Skip Flag

Interrupt Status Flag

Carry Flag

7

6

5

4

3

2

1

0

CY

SK2

SK1

SK0

0

IST0

0

0

Interrupting process

Bit Boolean instruction

Carry flag manipulation
dedicated

This manual is related to the following products: