public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Robert Floyd <robert.floyd@inet.com>
To: Stan Katz <stan@ctc-control.com>
Cc: crossgcc@sources.redhat.com
Subject: Re: Invalid Operands with Inline assembly
Date: Tue, 31 Oct 2000 14:46:00 -0000	[thread overview]
Message-ID: <39FF4B40.6CE3189D@inet.com> (raw)
In-Reply-To: <A7FF74878269D411A56F00A0C9ACE7CE75A6@golden.ctc-control.com>

Hi Stan,

I used your example and everything compiles and links just great.  With
one slight problem that you might be aware of with your Hitachi SH
experience...

I have asm files that initialize the chip, turns on an LED to RED and
sends out a boot string over the serial port to my PC.  These actually
work.  I used the example that you set up for me as a C file with inline
assembly that I wanted to link into my working assembly language files. 
Well after the chip runs thru all the asm code (which I can see is
working ok because the LED comes on and the boot string comes out over
the serial port), I simply... 

bra pmain	! branch to global _main in another object file

This pmain is a label in the asm file, i.e. pmain:   .long _main

But instead the chip seems to branch off into the weeds because after
several seconds the chip resets, (watchdog timeout?).  I actually went
thru the code, looked at the srec file and can see that the linker did
put in the right address for _main.  But oddly enough, nothing happens
except it eventually resets itself.  Do you think that I should be
branching to the dummy global ___main instead?  Thanks for any advice on
this.

Robert F.


Stan Katz wrote:
> 
> Robert Floyd [ mailto:robert.floyd@inet.com]wrote:
> > Stan,
> >
> > Well, I want to say thanks for bearing with me on this...I guess I am
> > going to have to show my ignorance now...
> >
> > Your example is confusing to me because you are not assigning your
> > pointers with anything.  Either it is obviously elementary and so you
> > left out the assignments or else there is some magic going on
> > here that
> > I am unaware by simply putting in unassigned pointers. Maybe you can
> > enlighten me on this...thanks so much.
> >
> 
> Robert, I apologise, the problem was mine. In the snippet the variable
> declarations should have been :
> 
>    register long pointer = TxChar;
>    register long *string = pHelloStr;
> 
> which is where the assignment of the values to the registers
> is handled by the compiler.
> 
> Stan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

       reply	other threads:[~2000-10-31 14:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <A7FF74878269D411A56F00A0C9ACE7CE75A6@golden.ctc-control.com>
2000-10-31 14:46 ` Robert Floyd [this message]
2000-10-31 16:59 Stan Katz
2000-11-01  6:09 ` Sobhy Gad
2000-11-01 13:56 ` Robert Floyd
  -- strict thread matches above, loose matches on Subject: below --
2000-10-27 13:37 Stan Katz
2000-10-26 12:12 Stan Katz
2000-10-27 11:01 ` Robert Floyd
     [not found] <A7FF74878269D411A56F00A0C9ACE7CE75A2@golden.ctc-control.com>
2000-10-26 11:39 ` Robert Floyd
2000-10-26  4:46 David Korn
2000-10-25 14:23 Robert Floyd
2000-10-26  0:12 ` Keith Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39FF4B40.6CE3189D@inet.com \
    --to=robert.floyd@inet.com \
    --cc=crossgcc@sources.redhat.com \
    --cc=stan@ctc-control.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).