Motorola DSP56305 User Manual Page 40

  • Download
  • Add to my manuals
  • Print
  • Page
    / 112
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 39
Program Control
Conditional DALU Instructions
MOTOROLA Optimizing DSP56300/DSP56600 Applications 3-11
5. In order to activate the new task T2, the Operating System
dispatcher should first restore the task T2 programming
model:
move #T2_task_reg_area,r7 ;Load pointer.
move x:(r7)+,x0 ;Restore registers...
....
move r7,n0 ;save pointer
move x:(r7)+,r7 ;Restore r7 w/ T2 data
move x:(r7)+,x:OS_r7_temp ;Keep r7.
move n0,r7 ;restore pointer
move x:(r7)+,n0 ;Restore n0
move x:(r7)+,n1 ;Restore n1
....
move x:(r7)+,lc
move x:(r7)+,la
6. The second thing the Operating System dispatcher should do
is to restore the stack status:
move x:(r7)+,sc
move sc,x:OS_SC_temp
move x:-(r0),sp ;Restore SP.
move x:-(r0),ep ;Restore EP.
move #2,sc ;reset Stack Counter.
rep #14
move ssh,x:OS_dummy
move x:OS_sc_temp,sc ;Restore sc.
move x:OS_r7_temp,r7 ;Restore r7.
7. The last thing the Operating System dispatcher should do is
to execute an RTI instruction, which will give control back to
the new task T2:
;Activate T2:
rti
3.5 CONDITIONAL DALU INSTRUCTIONS
The DSP56300/600 instruction set has a group of arithmetic
instructions that could be executed conditionally, depending on the
value of bits in the CCR (Condition Code Register). For example, the
instruction:
add x0,a IFne
adds register X0 to the accumulator A only if the Zero bit in the CCR
is not set. Otherwise, the instruction is executed as a NOP. The
instruction in the above example does not update the CCR, thus
keeping the status unaltered for subsequent use. The user may
Page view 39
1 2 ... 35 36 37 38 39 40 41 42 43 44 45 ... 111 112

Comments to this Manuals

No comments