Dovf update to sr read or write -27, Dovf update grouped with move-like sr updates -27, Rule sr.4a – Freescale Semiconductor StarCore SC140 User Manual

Page 277

Advertising
background image

Static Programming Rules

SC140 DSP Core Reference Manual

7-27

Example 7-45. DOVF Update to SR Read or Write

bmset #$4,emr.l
move.l emr,d2

;allowed

move.l #$4,emr
move.l emr,d0

;allowed

move.l #$4,emr
move.l d0,emr

;allowed

move.l d1,emr
move.l emr,d0

;allowed

add d0,d1,d2

;overflow may set DOVF bit

nop
move.l emr,d3

;not allowed

adr d3,d4

;overflow may set DOVF bit

nop
move.l d0,emr

;not allowed

bmset #$01,emr.l

;read and write EMR register

nop
move.l d0,emr

;allowed

sub d0,d1,d2

;overflow may set DOVF bit

nop
move.l emr,d3

;not allowed

clr d0

;DOVF bit not affected

move.l emr,d3

;allowed

sub d1, d1, d0

;This is a CLR. The DOVF bit is not affected

move.l emr, d3

;allowed

Rule SR.4a

Instructions that affect the DOVF status bit in EMR can’t be grouped with a MOVE-like instruction to SR
or with an RTE-like instruction (RTE/D ).

The

only exception for this rule is for Bit-Mask instructions on SR for which it is ensured that the

value of the OVE bit in SR is not changed.

Example 7-46. DOVF Update grouped with Move-like SR updates

bmclr #$0010,sr.h

mac d1,d2,d3

; Not allowed

bmchg #$0010,sr.h

mac d1,d2,d3

; Not allowed

bmclr #$0001,sr.h

mac d1,d2,d3

; Allowed (OVE not changed)

bmchg #$0010,sr.l

mac d2,d2,d3

; Allowed (OVE not changed)

move.l #$100000,sr mac d0,d1,d2

; Not allowed

move.l d0,sr

mac d0,d1,d2

; Not allowed

pop sr

mac d0,d1,d2

; Not allowed

rted

mac d0,d1,d2

; Not allowed

Advertising