MOVEP replacement - Help needed...

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2618
Joined: Thu Dec 15, 2005 2:15 am

MOVEP replacement - Help needed...

Postby Maartau » Thu May 09, 2013 2:42 pm

Back to some fixes & that time I'm wondering how could I replace those "MOVEP" as this one doesn't exist anymore on 68060 ?

:cheers:
You do not have the required permissions to view the files attached to this post.

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 514
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

Re: MOVEP replacement - Help needed...

Postby ljbk » Thu May 09, 2013 4:12 pm

Hi !

Steem_002.gif case is a digi-sound update rout for the YM2149 soundchip.
I suppose you did not insert a 68060 on a STF :lol: , so you should first be carefull if your HW supports shadow addressing.
I not or to be on the safe side you should do:
...
move.l label+4(pc,d3),(a5)
move.b label(pc,d3),(a5)
move.b label+1(pc,d3),2(a5)
move.b label+2(pc,d3),(a5)
move.b label+3(pc,d3),2(a5)
move.l (a7)+,d3
...
This is slow but we are talking about a 68060 ...

Another easy solution is to re-arrange the digi-sound table so that you can do 3 times:
move.l$xx(pc,d3),(a5)


Steem_001.gif case seems related to the ACIAs but i am not sure.
Anyway the movep there will do:
- highest D0 byte to 0(a1);
- next D0 byte to 1(a1);
- next D0 byte to 2(a1);
- lowest D0 byte to 3(a1);
So you can always do the move.b / lsr.l #8,d0 / move.b / lsr.l #8,d0 ...


Paulo.

Edit:
lsr.l => ror.l because you need to keep d0 value ...
Then a tst.l d0 is needed.
Sorry about that ... :oops:
Last edited by ljbk on Fri May 10, 2013 10:10 am, edited 1 time in total.

seedy1812
Atari User
Atari User
Posts: 33
Joined: Tue May 18, 2010 2:04 pm

Re: MOVEP replacement - Help needed...

Postby seedy1812 » Fri May 10, 2013 9:07 pm

looking at the first one

move.l $24(PC.D3.w),(A5)

you only need 2 bytes out of this as it will write 2 word to 8800 (select register )then 8802 (write data) which could be done as

move.b $24+0(PC,D3.w),(A5)
move.b $24+2(PC,D3.w),2(A5)

then the

move.l $1c(PC,D3.w),D3
movep.l D3,0(A5)

if after the first instruction D3 = 0x11223344

then you get

move.b 0x11 -> 8800
move.b 0x22 -> 8802
move.b 0x33 -> 8800
move.b 0x44 -> 8802

which If we merge the read and writes ( the timings are based on 68000)

move.b $1c+0(PC,D3.w),(a5) / 18 cycles
move.b $1c+1(PC,D3.w),2(a5) / 22 cycles
move.b $1c+2(PC,D3.w),(a5) / 18 cycles
move.b $1c+3(PC,D3.w),2(a5) / 22 cycles == 80 cycles for all 4 lines

if you are thinking of rewriting the code then there might be a quicker way

We could write 2 long words to 8800
eg 11xx22xx and 33xx44xx

If we assume that the bits marked xx do not interfere with the hardware registers

move.l $1d(PC,d3.w) , d3 // 18 cycles
move.l d3,(A5) // 12 cycles
lsl.l #8,d3 // 6+2*8 = 22 cycles
move.l d3,(a5) // 12 cycles == 64 cycles

This would mean instead of 11223344 it would be written out as 11332244

Both Gif 1 and Gif 2 are movep to 8800

Now Gif 1 is interestering as move.l(A0)+,d0 changes the flags and movep does not why not change the flow

lea $25c44c(pc),a0
.loop
move.l (a0)+,d0
beq .end

move.l d0,(a1)
lsl.l #8,d0
move.l d0,(a1)

bra.s .loop
.end

move.l d0,(a1)
lsl.l #8,d0
move.l d0,(a1)

Its just a different way of unrolling the loop




Just food for thought ..

:)

{edit}
as at the end d0 Is 0

then
.end
move.l d0,(a1)

you don't need it twice as its all 0 :D


as I read it ,

lea $25c44c(pc),a0
.loop
move.l (a0)+,d0

move.l d0,(a1)
beq .end
lsl.l #8,d0
move.l d0,(a1)

bra.s .loop
.end


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests