EASy68K
http://www.easy68k.com/EASy68Kforum/

movem register masks.
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=8&t=859
Page 1 of 1

Author:  not86 [ Sat Jul 17, 2010 8:16 pm ]
Post subject:  movem register masks.

I am running ver 5.4.0 of the assembler and the "pushes" and "pops"
using A7 to store and retrieve registers use the same mask....which is
incorrect.
The "push" and "pop" masks are different and are found on opposite sides
of the page in the Moto User's Manual (B77 and B78). Reversal of the masks produces random register restores for A and D registers.

Author:  lee [ Sun Jul 18, 2010 2:46 pm ]
Post subject: 

Can you give an example. I'm not seeing it.

Lee.

Author:  profkelly [ Mon Jul 19, 2010 6:15 pm ]
Post subject: 

Yes, an example please. I did a quick test and the masks are correct for the instructions listed.

Code:
00001000  48E7 FF00                 10          MOVEM.L D0-D7,-(A7)
00001004  4CDF 00FF                 11          MOVEM.L (A7)+,D0-D7

Author:  not86 [ Sun Jul 25, 2010 8:22 am ]
Post subject:  MOvemem

Hi Doctor Kelly, Sorry, I should have enclosed:

movememw. d0-d2/a0-a2 -(a7) (for a 'push')
movememw. d0-d2/a0-a2 (a7)+ (for a 'pop')

I seem to remember the mask being 03030 for both opes when assembled.

Motjo 7-25-10
Your package and services are absolutely great....would like to have been born into a more computer current time and space. : )

Author:  profkelly [ Sun Jul 25, 2010 11:27 am ]
Post subject: 

It is possible to produce register lists that are the same for push and pop by selecting the proper combination of data and address registers. This is expected and does not indicate an error in assembly. By removing the address registers from the list we can clearly see a different register list is being generated for push and pop operations.
Code:
00001000  48A7 300C                 10          movem.w d2-d3/a4-a5,-(a7)
00001004  4C9F 300C                 11          movem.w (a7)+,d2-d3/a4-a5
00001000  48A7 3000                 12          movem.w d2-d3,-(a7)
00001004  4C9F 000C                 13          movem.w (a7)+,d2-d3

Author:  clive [ Mon Jul 26, 2010 11:53 pm ]
Post subject:  Re: MOvemem

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

Author:  not86 [ Sat Jul 31, 2010 8:35 pm ]
Post subject: 

movem aupposed error:

Dear Dr. Kelly,

I am glad to see that the error was in syntax...I wasthinking that the Assembler would correct positional notation as long as the destination
register was intact.

THank you.

Motjo

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/