Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: DSP context switch
Posted by: Laurent / Thadoss Mar,14.2014-13:32 

Hi Doug,

For saving/restoring the DSP context in an interrupted program area, I use the following code (maybe you've got a better solution) :

; Save registers
move r1,y:x_save_r1
move r0,y:x_save_r0
move #x_save_regs2,r1
move #x_save_regs1,r0

move r2,y:(r1)+
move r3,y:(r0)+
move r4,y:(r1)+
move r5,y:(r0)+
move r6,y:(r1)+
move x0,y:(r0)+
move x1,y:(r1)+
move y0,y:(r0)+
move y1,y:(r1)+
move a0,y:(r0)+
move a1,y:(r1)+
move a2,y:(r0)+
move b0,y:(r1)+
move b1,y:(r0)
move b2,y:(r1)




; Restore registers

move #x_save_regs2,r1
move #x_save_regs1,r0
move y:(r1)+,r2
move y:(r0)+,r3
move y:(r1)+,r4
move y:(r0)+,r5
move y:(r1)+,r6
move y:(r0)+,x0
move y:(r1)+,x1
move y:(r0)+,y0
move y:(r1)+,y1
move y:(r0)+,a0
move y:(r1)+,a1
move y:(r0)+,a2
move y:(r1)+,b0
move y:(r0),b1
move y:(r1),b2

move y:x_save_r0,r0
move y:x_save_r1,r1
rti


;---------- Y:Memory ----------------------

org y:0
x_save_r0 dc 0
x_save_r1 dc 0
x_save_regs1 ds 8
x_save_regs2 ds 8









[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
DSP context switch dml Mar,07.2014-13:36
  Re: DSP context switch sqward Mar,10.2014-02:32
    Re: DSP context switch Laurent / Thadoss Mar,14.2014-13:32
      Re: DSP context switch dml Mar,14.2014-14:52
        Re: DSP context switch Laurent / Thadoss Mar,14.2014-15:26
          Re: DSP context switch dml Mar,14.2014-16:10
    Re: DSP context switch dml Mar,14.2014-14:45


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson