* RE: Invalid Operands with Inline assembly
@ 2000-10-31 16:59 Stan Katz
2000-11-01 6:09 ` Sobhy Gad
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Stan Katz @ 2000-10-31 16:59 UTC (permalink / raw)
To: 'Robert Floyd', Stan Katz; +Cc: crossgcc
Robert Floyd [ mailto:robert.floyd@inet.com ] wrote:
>
> 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...
>
snip
Thanks for the feedback, glad to have helped
> 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.
I tend to do all this is C anyway, the only time I use assembly is when I
need to either put in some interrupt handling code (which usually calls a C
routine for processing anyway) or when I want to use the mul/mac/div
instructions to get a faster scaling routine.
> 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.
It looks as if you are branching to the address pmain, which contains a 32
bit value equivalent to _main and is executing that as code, what happens
depends on the actual value of _main but is not likely to get you back with
the PC equal to _main either. You want to branch to the value that is at the
address pmain (assuming _main is too far away to go directly there) probably
want to do something like:
mov.l pmain, r4
bra @r4
Although you may be able to use
bra _main
Try the second and if the address of _main is too far from the bra
instruction to be assembled you will get an error message from the compiler
or assembler.
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalid Operands with Inline assembly
2000-10-31 16:59 Invalid Operands with Inline assembly Stan Katz
@ 2000-11-01 6:09 ` Sobhy Gad
2000-11-01 6:10 ` SOS Sobhy Gad
2000-11-01 13:56 ` Invalid Operands with Inline assembly Robert Floyd
2 siblings, 0 replies; 5+ messages in thread
From: Sobhy Gad @ 2000-11-01 6:09 UTC (permalink / raw)
To: crossgcc-owner, crossgcc
Hi everyone,
I'm despertly trying to build gcc-win32 for the target of MIPS-16.
what ever I do, it does not work.
I just need "objcopy", "objdumb" and "as" for MIPS-16.
I mean I need asm/disass for the MIPS-16.
Please Help.
best regards
S. Gad
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* SOS
2000-10-31 16:59 Invalid Operands with Inline assembly Stan Katz
2000-11-01 6:09 ` Sobhy Gad
@ 2000-11-01 6:10 ` Sobhy Gad
2000-11-01 6:29 ` SOS jani
2000-11-01 13:56 ` Invalid Operands with Inline assembly Robert Floyd
2 siblings, 1 reply; 5+ messages in thread
From: Sobhy Gad @ 2000-11-01 6:10 UTC (permalink / raw)
To: crossgcc-owner, crossgcc
Hi everyone,
I'm despertly trying to build gcc-win32 for the target of MIPS-16.
what ever I do, it does not work.
I just need "objcopy", "objdumb" and "as" for MIPS-16.
I mean I need asm/disass for the MIPS-16.
Please Help.
best regards
S. Gad
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SOS
2000-11-01 6:10 ` SOS Sobhy Gad
@ 2000-11-01 6:29 ` jani
0 siblings, 0 replies; 5+ messages in thread
From: jani @ 2000-11-01 6:29 UTC (permalink / raw)
To: Sobhy Gad; +Cc: crossgcc
On Wed, 1 Nov 2000, Sobhy Gad wrote:
> Hi everyone,
>
> I'm despertly trying to build gcc-win32 for the target of MIPS-16.
> what ever I do, it does not work.
>
> I just need "objcopy", "objdumb" and "as" for MIPS-16.
> I mean I need asm/disass for the MIPS-16.
do you need to run objcopy & objdump on the target MIPS or on win32?
If you only need asm/disass you can just build cross binutils you don't
need gcc.
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Maybe reading this FAQ will help.
btw you didn't specify what you have succeded doing up to this point.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Invalid Operands with Inline assembly
2000-10-31 16:59 Invalid Operands with Inline assembly Stan Katz
2000-11-01 6:09 ` Sobhy Gad
2000-11-01 6:10 ` SOS Sobhy Gad
@ 2000-11-01 13:56 ` Robert Floyd
2 siblings, 0 replies; 5+ messages in thread
From: Robert Floyd @ 2000-11-01 13:56 UTC (permalink / raw)
To: Stan Katz; +Cc: crossgcc
> It looks as if you are branching to the address pmain, which contains a 32
> bit value equivalent to _main and is executing that as code, what happens
> depends on the actual value of _main but is not likely to get you back with
> the PC equal to _main either. You want to branch to the value that is at the
> address pmain (assuming _main is too far away to go directly there) probably
> want to do something like:
> mov.l pmain, r4
> bra @r4
Since _main is a global function defined in another file, I do notice
that it does link up the right address. I checked the srec again and
can see it is correct. It's just odd how it does not ever seem to get
there to the compiled 'C' portion when I burn a prom for the SH1.
I tried your example above but I get the error 'bad expression' when
using 'bra @r4'. The expression:
jmp @r4
does compile ok, however. I'll give it go again when I get to my prom
burner. Thanks for your help.
Robert
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-11-01 13:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-31 16:59 Invalid Operands with Inline assembly Stan Katz
2000-11-01 6:09 ` Sobhy Gad
2000-11-01 6:10 ` SOS Sobhy Gad
2000-11-01 6:29 ` SOS jani
2000-11-01 13:56 ` Invalid Operands with Inline assembly Robert Floyd
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).