LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2004, 10:29 PM   #1
Annie0716
LQ Newbie
 
Registered: Jul 2004
Posts: 10

Rep: Reputation: 0
Unhappy What's wrong with my indirect addressing


I am using MOTOROLA MCF5249, M68K.
Now, I want to get two data from different location, as the following codes show.

The problem is, when I use indirect addressing to get data from one sequence, just like the #15, the data I get is absolutly correct. But when I try to get data from two different sequences, the data, I get from the 2nd one, is always 0.

Could anyone tell me what's wrong with it?

Thank you!

long *in, *win_cos_l;/*the pointers to different data squence*/

/*#16*/
#define EEEE
#ifdef EEEE
__asm__("
move.l %2,%%a0;
move.l %3,%%a1;

move.l (%%a0)+,%%d0; /*win_cos_l[0]*/
move.l (%%a0)+,%%d0; /*win_cos_l[1]*/
move.l (%%a0)+,%%d0; /*win_cos_l[2]*/
move.l (%%a0)+,%%d0; /*win_cos_l[3]*/
move.l (%%a0)+,%%d0; /*win_cos_l[4]*/
move.l (%%a0)+,%%d0; /*win_cos_l[5]*/
move.l (%%a0)+,%%d0; /*win_cos_l[6]*/
move.l (%%a0)+,%%d0; /*win_cos_l[7]*/
move.l (%%a0)+,%%d0; /*win_cos_l[8]*/
move.l (%%a0)+,%%d0; /*win_cos_l[9]*/
move.l (%%a0)+,%%d0; /*win_cos_l[10]*/
move.l (%%a0)+,%%d0; /*win_cos_l[11]*/
move.l (%%a0)+,%%d0; /*win_cos_l[12]*/
move.l (%%a0)+,%%d0; /*win_cos_l[13]*/
move.l (%%a0)+,%%d0; /*win_cos_l[14]*/
move.l (%%a0)+,%%d0; /*win_cos_l[15]*/
move.l (%%a0)+,%%d0; /*win_cos_l[16]*/
move.l (%%a0)+,%%d0; /*win_cos_l[17]*/
move.l (%%a0)+,%%d0; /*win_cos_l[18]*/
move.l (%%a0)+,%%d0; /*win_cos_l[19]*/
move.l (%%a0)+,%%d0; /*win_cos_l[20]*/
move.l (%%a0)+,%%d0; /*win_cos_l[21]*/
move.l (%%a0)+,%%d0; /*win_cos_l[22]*/
move.l (%%a0)+,%%d0; /*win_cos_l[23]*/
move.l (%%a0)+,%%d0; /*win_cos_l[24]*/
move.l (%%a0)+,%%d0; /*win_cos_l[25]*/
move.l (%%a0)+,%%d0; /*win_cos_l[26]*/

move.l %%d0,%0;

move.l (%%a1)+,%%d1; /*in[0]*/
move.l (%%a1)+,%%d1; /*in[1]*/
move.l (%%a1)+,%%d1; /*in[2]*/
move.l (%%a1)+,%%d1; /*in[3]*/
move.l (%%a1)+,%%d1; /*in[4]*/
move.l (%%a1)+,%%d1; /*in[5]*/
move.l (%%a1)+,%%d1; /*in[6]*/
move.l (%%a1)+,%%d1; /*in[7]*/
move.l (%%a1)+,%%d1; /*in[8]*/
move.l (%%a1)+,%%d1; /*in[9]*/
move.l (%%a1)+,%%d1; /*in[10]*/
move.l (%%a1)+,%%d1; /*in[11]*/
move.l (%%a1)+,%%d1; /*in[12]*/
move.l (%%a1)+,%%d1; /*in[13]*/
move.l (%%a1)+,%%d1; /*in[14]*/
move.l (%%a1)+,%%d1; /*in[15]*/
move.l (%%a1)+,%%d1; /*in[16]*/
move.l (%%a1)+,%%d1; /*in[17]*/
move.l (%%a1)+,%%d1; /*in[18]*/
move.l (%%a1)+,%%d1; /*in[19]*/
move.l (%%a1)+,%%d1; /*in[20]*/
move.l (%%a1)+,%%d1; /*in[21]*/
move.l (%%a1)+,%%d1; /*in[22]*/
move.l (%%a1)+,%%d1; /*in[23]*/
move.l (%%a1)+,%%d1; /*in[24]*/
move.l (%%a1)+,%%d1; /*in[25]*/
move.l (%%a1)+,%%d1; /*in[26]*/

move.l %%d1,%1;
"
:"=m"(*win1),"=m"(*in1)
:"r"(win_cos_l),"r"(in)
:"%a0","%a1","%d0","%d1");

printf("*win1= %d; ", *win1);
printf("*in1= %d; ", *in1);
#endif

/*#15*/
#define EEEE
#ifdef EEEE
__asm__("
move.l %2,%%a0;

move.l (%%a0)+,%%d0; /*win_cos_l[0]*/
move.l (%%a0)+,%%d0; /*win_cos_l[1]*/
move.l (%%a0)+,%%d0; /*win_cos_l[2]*/
move.l (%%a0)+,%%d0; /*win_cos_l[3]*/
move.l (%%a0)+,%%d0; /*win_cos_l[4]*/
move.l (%%a0)+,%%d0; /*win_cos_l[5]*/
move.l (%%a0)+,%%d0; /*win_cos_l[6]*/
move.l (%%a0)+,%%d0; /*win_cos_l[7]*/
move.l (%%a0)+,%%d0; /*win_cos_l[8]*/
move.l (%%a0)+,%%d0; /*win_cos_l[9]*/
move.l (%%a0)+,%%d0; /*win_cos_l[10]*/
move.l (%%a0)+,%%d0; /*win_cos_l[11]*/
move.l (%%a0)+,%%d0; /*win_cos_l[12]*/
move.l (%%a0)+,%%d0; /*win_cos_l[13]*/
move.l (%%a0)+,%%d0; /*win_cos_l[14]*/
move.l (%%a0)+,%%d0; /*win_cos_l[15]*/
move.l (%%a0)+,%%d0; /*win_cos_l[16]*/
move.l (%%a0)+,%%d0; /*win_cos_l[17]*/
move.l (%%a0)+,%%d0; /*win_cos_l[18]*/
move.l (%%a0)+,%%d0; /*win_cos_l[19]*/
move.l (%%a0)+,%%d0; /*win_cos_l[20]*/
move.l (%%a0)+,%%d0; /*win_cos_l[21]*/
move.l (%%a0)+,%%d0; /*win_cos_l[22]*/
move.l (%%a0)+,%%d0; /*win_cos_l[23]*/
move.l (%%a0)+,%%d0; /*win_cos_l[24]*/
move.l (%%a0)+,%%d0; /*win_cos_l[25]*/
move.l (%%a0)+,%%d0; /*win_cos_l[26]*/

move.l %%d0,%0;
move.l (%%a0)+,%%d0; /*win_cos_l[27]*/
move.l %%d0,%1;
"
:"=m"(*win1),"=m"(*win2)
:"r"(win_cos_l)
:"%a0","%d0");

printf("*win1= %d; ", *win1);
printf("*win2= %d; ", *win2);
#endif
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Absolute addressing Glemu Programming 2 10-13-2005 02:49 PM
Problem with IP Addressing orko Linux - Networking 3 01-14-2005 03:54 PM
Reverting to (slow) indirect rendering IGP 340M xslider Linux - Software 7 12-21-2004 07:08 AM
question for addressing tuanuhcl Linux - Networking 4 11-16-2004 10:12 PM
RedHat 9 IP Addressing TenderFoot Red Hat 7 06-28-2004 05:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration