ADDRESS SPACES

KS57C2308/P2308/C2316/P2316

 

 

PROGRAM COUNTER (PC)

A 13-bit program counter (PC) stores addresses for instruction fetches during program execution (KS57C2316 microcontroller has 14-bit program counter, PC0–PC13). Whenever a reset operation or an interrupt occurs, bits PC12 through PC0 (PC13 through PC0 for KS57C2316) are set to the vector address.

Usually, the PC is incremented by the number of bytes of the instruction being fetched. One exception is the 1-byte REF instruction which is used to reference instructions stored in the ROM.

PROGRAM STATUS WORD (PSW)

The program status word (PSW) is an 8-bit word that defines system status and program execution status and which permits an interrupted process to resume operation after an interrupt request has been serviced. PSW values are mapped as follows:

 

(MSB)

 

 

(LSB)

FB0H

IS1

IS0

EMB

ERB

 

 

 

 

 

FB1H

C

SC2

SC1

SC0

 

 

 

 

 

The PSW can be manipulated by 1-bit or 4-bit read/write and by 8-bit read instructions, depending on the specific bit or bits being addressed. The PSW can be addressed during program execution regardless of the current value of the enable memory bank (EMB) flag.

Part or all of the PSW is saved to stack prior to execution of a subroutine call or hardware interrupt. After the interrupt has been processed, the PSW values are popped from the stack back to the PSW address.

When a RESET is generated, the EMB and ERB values are set according to the RESET vector address, and the carry flag is left undefined (or the current value is retained). PSW bits IS0, IS1, SC0, SC1, and SC2 are all cleared to logical zero.

Table 2-5. Program Status Word Bit Descriptions

PSW Bit Identifier

Description

Bit Addressing

Read/Write

 

 

 

 

IS1, IS0

Interrupt status flags

1, 4

R/W

 

 

 

 

EMB

Enable memory bank flag

1

R/W

 

 

 

 

ERB

Enable register bank flag

1

R/W

 

 

 

 

C

Carry flag

1

R/W

 

 

 

 

SC2, SC1, SC0

Program skip flags

8

R

 

 

 

 

2-16

Page 24
Image 24
Samsung KS57C2308 manual Program Counter PC, MSB LSB FB0H IS1 IS0 EMB ERB FB1H SC2 SC1 SC0