EASy68K  
It is currently Thu May 25, 2017 8:34 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: movem register masks.
PostPosted: Sat Jul 17, 2010 8:16 pm 
Offline

Joined: Sat Jul 17, 2010 8:05 pm
Posts: 3
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 18, 2010 2:46 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
Can you give an example. I'm not seeing it.

Lee.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2010 6:15 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1036
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

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: MOvemem
PostPosted: Sun Jul 25, 2010 8:22 am 
Offline

Joined: Sat Jul 17, 2010 8:05 pm
Posts: 3
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. : )


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 25, 2010 11:27 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1036
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

_________________
Prof. Kelly


Last edited by profkelly on Tue Jul 27, 2010 10:34 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: MOvemem
PostPosted: Mon Jul 26, 2010 11:53 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 31, 2010 8:35 pm 
Offline

Joined: Sat Jul 17, 2010 8:05 pm
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group