NEC PD75P402, PD75402A Internal CPU Functions Program Status Word PSW .... Bits, Carry flag CY

Models: PD75402A PD75P402

1 195
Download 195 pages 45.34 Kb
Page 50
Image 50

CHAPTER 4. INTERNAL CPU FUNCTIONS

4.7PROGRAM 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

7

6

5

4

3

2

1

0

CY SK2 SK1 SK0

0

IST0

0

0

Interrupt Status Flag

Skip Flag

Carry Flag

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

 

 

 

Carry flag manipulation

SET1 CY

Set (1) CY

dedicated

CLR1 CY

Clear (0) CY

 

 

NOT1 CY

Invert the content of CY

 

SKT CY

Skip if the content of CY is 1

 

 

 

Bit Boolean instruction

AND1 CY, fmem.bit

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

 

OR1 CY, fmem.bit

and store the result in CY

 

XOR1 CY, fmem.bit

 

 

 

 

Interrupting process

At interrupt execution

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

 

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

 

RETI

Restore from the stack memory in parallel to the other PSW

 

 

 

39

Page 50
Image 50
NEC PD75P402 Internal CPU Functions Program Status Word PSW .... Bits, Carry flag CY, Carry Flag Manipulation Instructions