not86 wrote:
movememw. d0-d2/a0-a2 (a7)+ (for a 'pop')
I think you have your source and destination transposed, the data should be coming from the stack when you POP.
Also you probably want to be pushing/poping LONG words, so it saves the content of the full 32-bit register.
Code:
000004F0 48E7 1800 108 movem.l d3-d4,-(sp)
000004F4 2245 109 movea.l d5,a1
000004F6 4FEF FF58 110 lea -168(sp),sp
..
00000570 4FEF 00A8 172 lea 168(sp),sp
00000574 2A09 173 move.l a1,d5
00000576 4CDF 0018 174 movem.l (sp)+,d3-d4
0000057A 4E75 175 rts
0000057C 4E56 0000 180 link A6,#0
00000580 48E7 3000 181 movem.l D2/D3,-(A7)
..
000005DA 4CDF 000C 232 movem.l (A7)+,D2/D3
000005DE 4E5E 233 unlk A6
000005E0 4E75 234 rts