Program status word (psw) – Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual

Page 75

Advertising
background image

High-Speed Microcontroller User’s

Guide: Network Microcontroller

Supplement

75

Program Status Word (PSW)

R = Unrestricted read, W = Unrestricted write, -n = Value after reset

7

6

5

4

3

2

1

0

SFR D0h

CY

AC

F0

RS1

RS0

0V

F1

P

RW-0

RW-0

RW-0

RW-0

RW-0

RW-0

RW-0

RW-0

CY
Bit 7

AC
Bit 6

F0
Bit 5

RS1, RS0
Bits 4-3

Carry flag. This bit is set if the last arithmetic operation resulted in a carry (during addition) or a borrow
(during subtraction). Otherwise, it is cleared to 0 by all arithmetic operations.

Auxiliary carry flag. This bit is set to 1 if the last arithmetic operation resulted in a carry into (during
addition) or a borrow from (during subtraction) the high-order nibble. Otherwise, it is cleared to 0 by all

arithmetic operations.

User flag 0. This is a bit-addressable, general-purpose flag for software control.

Register bank select 1-0. These bits select which register bank is addressed during register accesses.

RS1

RS0

REGISTER

BANK

ADDRESS

0

0

0

00h–07h

0

1

1

08h–0Fh

1

0

2

10h–17h

1

1

3

18h–1Fh

OV
Bit 2

F1
Bit 1

P
Bit 0

Overflow flag. This bit is set to 1 if there is a carry-out of bit 6 but not out of bit 7, or if there is a carry-
out of bit 7 but not out of bit 6 for addition. When adding signed integers, OV indicates a negative num-

ber resulted as the sum of two positive operands or a positive sum from two negative operands. OV is

set if a borrow is needed into bit 6 but not into bit 7, or if a borrow is needed into bit 7 but not into bit 6

for subtraction. When subtracting signed integers, OV indicates a negative number produced when a

negative value is subtracted from a positive value or a positive result when a positive value is subtract-

ed from a negative value. OV is also set if the product is greater than 0FFh for multiplication. This bit is

always cleared for division operations.

User flag 1. This is a bit-addressable, general-purpose flag for software control.

Parity flag. This bit is set to 1 if there is an odd number of 1’s in the accumulator and is cleared to 0 if
there is an even number of 1’s in the accumulator.

Maxim Integrated

Advertising