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

Atari coding BBS
 
Re: DSP sign extend question
Posted by: Thomas / New Beat Dec,12.2013-20:14 

I keep talking to myself, but maybe it's useful to someone sometime... :-)


move #>$80,x1 ; For 0xABCD to 0xABCD00 conversion
move #>$8000,x0 ; For 0xABCD00 to 0xFFABCD conversion
move #converted_data_buffer,r0

;// Action
do #receive_length,_loop
_get: jclr #0,X:<<HOST_SR,_get ; Wait for data...
movep X:<<HOST_RX,y0 ; y0 = 0x00ABCD
mpy x1,y0,a a0,y1 ; a = 0x00:000000:ABCD00
mpy x0,y1,b b,x:(r0)+ ; b = 0xFF:FFABCD:000000
_loop:
;// Postsync registers from do-loop
move a0,y1 ; a = 0x00:000000:ABCD00
mpy x0,y1,b b,x:(r0)+ ; b = 0xFF:FFABCD:000000
move b,x:(r0)+ ; b = 0xFF:FFABCD:000000

Note! The two first values in converted_data_buffer will be junk. This
could be handled aswell by doing a presync of the registers. I havn't tested the code but it should work.

It should be fast enough to handle even if CPU moves as fast as possible (where a0 is hostport):

move.w d0,(a0)
move.w d1,(a0)
move.w d2,(a0)
...








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

Topic Posted by  Date 
DSP sign extend question Thadoss Oct,30.2013-01:28
  Re: DSP sign extend question mikro Oct,30.2013-11:43
    Re: DSP sign extend question Thadoss Oct,30.2013-12:37
      Re: DSP sign extend question mikro Oct,30.2013-14:09
        Re: DSP sign extend question ggn Oct,30.2013-14:55
          Re: DSP sign extend question ggn Oct,30.2013-16:03
        Re: DSP sign extend question Thadoss Oct,30.2013-17:43
        Re: DSP sign extend question Thomas / New Beat Nov,07.2013-08:59
          Re: DSP sign extend question Thomas / New Beat Dec,11.2013-09:29
            Re: DSP sign extend question Thomas / New Beat Dec,12.2013-20:14


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