
Philips Semiconductors
DSPCPU Operations for TM1300
PRODUCT SPECIFICATION
A-155
Read program control and status word
SYNTAX
[ IF rguard ] readpcsw
→
rdest
FUNCTION
if
rguard
then {
rdest
←
PCSW
}
ATTRIBUTES
Function unit
Operation code
Number of operands
Modifier
Modifier range
Latency
Issue slots
fcomp
158
0
No
—
1
3
DESCRIPTION
The
readpcsw
writes the current value of the PCSW (Program Control and Status Word) processor register to
rdest The layout of PCSW is shown below.
Fields in the PCSW have two chief purposes: to control aspects of processor operation and to record events that
occur during program execution. Thus,
readpcsw
can be used to determine current processor operating modes and
what events have occurred; this operation can also be used to save state before idling a task in a multi-tasking
environment.
The
readpcsw
operation optionally takes a guard, specified in rguard If a guard is present, its LSB controls the
modification of the destination register. If the LSB of rguardis 1, rdestis written; otherwise, rdestis unchanged.
EXAMPLES
Initial Values
Operation
Result
PCSW = 0x80110642
readpcsw
→
r100
r100
←
0x80110642 (trap on MSE, INV and DBZ
enabled, IEN=1 - interrupts enabled, BSX=1 - little
endian mode of operation, OFZ=1 - a denormalized
result was produced somewhere, INX=1 - an inexact
result was produced somewhere)
no change, since guard is false
r102
←
0x80000000 (trap on MSE enabled)
r20 = 0, PCSW = 0x80000000
r21 = 1, PCSW = 0x80000000
IF r20 readpcsw
→
r101
IF r21 readpcsw
→
r102
MSE
CS
IEN
BSX
IEEE MODE
OFZ
IFZ
INV
OVF
UNF
INX
DBZ
0
1
2
3
4
5
6
7
8
9
10
11
12
14
15
Misaligned store exception
Write back error
Reserved exception
Count stalls (1
Yes)
Interrupt enable (1
allow interrupts)
FP exception trap-enable bits
IEEE rounding mode
0
to nearest, 1
to zero, 2
to positive, 3
to negative
Byte sex (1
little endian)
PCSW<31:16>
PCSW<15:0>
UNDEF
Misaligned store
exception trap enable
Write back error trap enable
Trap on first exit
FP exceptions
TRP
MSE
TFE
TRP
OFZ
TRP
IFZ
TRP
INV
TRP
OVF
TRP
UNF
TRP
INX
TRP
DBZ
16
17
18
19
20
21
22
23
25
26
27
28
30
31
UNDEF
U N D E F I N E D
13
WBE
RSE
TRP
WBE
TRP
RSE
Reserved exception
trap enable
29
SEE ALSO
writepcsw
readpcsw