Static Programming Rules

Example 7-43. SR Write to SR Status Bit Use

bmclr

#$ffff,sr.h

;change SR

move.w

#$1234,d0

;allowed, not affected by SR

bmclr

#$ffff,sr.h

;change SR

rol

d0

;not allowed, affected by SR[C]

bmclr

#$ffff,sr.h

;change SR

nop

d0

;not allowed, affected by SR[C]

rol

bmclr

#$ffff,sr.h

;change SR

nop

 

 

nop

d0

;allowed

rol

bmclr

#<1,sr.l

;change SR

nop

d0

;not allowed, affected by SR[EXP]

push

bmclr

#<1,sr.h

;change SR

nop

 

;not allowed, affected by SR[T]

ift clr d0

bmtstc #$0001,sr.l

;read SR, affects SR[T], not a SR write

add

d1,d5,d1

;allowed

pop

sr

;allowed

bmset

#$a,sr.l

move.l

d0,sr

;allowed

move.l

sr,d5

bmset

#$a,sr.h

;not allowed

and.w #$1234,(sp-8)

bmset

#$a,sr.l

;not allowed

and.w #$1234,(sp-8)

bmset

#$a,sr.l

;allowed

bmset

#$b,sr.h

move.l

d1,sr

;not allowed

move.l

d0,(sp+4)

move.l

d1,sr

;allowed

move.l

d0,(r0+4)

move.l d1,sr

;change SR

nop

 

;allowed, clear not effected by SR

clr d0

 

move.l d1,sr

;change SR

nop

 

;not allowed, sub effected by S0,S1

sub d1,d2,d3

move.l d1,sr

;change SR

nop

 

;allowed, this is a CLR

sub d1,d1,d3

SC140 DSP Core Reference Manual

7-25

Page 275
Image 275
Freescale Semiconductor SC140 specifications Example 7-43. SR Write to SR Status Bit Use