Static Programming Rules

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

bmset #$4,emr.l

;allowed

move.l emr,d2

move.l #$4,emr

;allowed

move.l emr,d0

move.l #$4,emr

;allowed

move.l d0,emr

move.l d1,emr

;allowed

move.l emr,d0

add d0,d1,d2

;overflow may set DOVF bit

nop

 

;not allowed

move.l emr,d3

adr

d3,d4

;overflow may set DOVF bit

nop

d0,emr

;not allowed

move.l

bmset

#$01,emr.l

;read and write EMR register

nop

d0,emr

;allowed

move.l

sub d0,d1,d2

;overflow may set DOVF bit

nop

 

;not allowed

move.l emr,d3

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

SC140 DSP Core Reference Manual

7-27

Page 277
Image 277
Freescale Semiconductor SC140 specifications Rule SR.4a, Example 7-45. Dovf Update to SR Read or Write