public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: assembly macro syntax...
@ 2002-02-18  9:14 Noonan, Michael E (Michael)
  2002-02-18 19:30 ` Dylan Cuthbert
  0 siblings, 1 reply; 5+ messages in thread
From: Noonan, Michael E (Michael) @ 2002-02-18  9:14 UTC (permalink / raw)
  To: Noonan, Michael E (Michael), 'help-gcc@gnu.org'


> I have a simple question for anyone who knows how to write assembly macros
> for the GNU compiler.  I am trying to port macros that target the Diab
> compiler for PPC and am having a hell of a time figuring out the correct
> syntax.  The macros are used to test the PPC exception handler by forcing
> the respective exceptions.  Here are a couple of the Diab format assembly
> macros for reference...
> 
> VOID  excpTestPage (ULONG input)
> {
>    asm (" lwz r4,0(r3)");
> }   
> 
> VOID  excpTestIsi (VOID)
> {
>    asm (" .long 0x4BC00001");  // branch to 0x0F00_0000 + ip
> }   
> 
> VOID  excpTestTrap (ULONG input)
> {
>    asm (" twgti r3,5"); // trap if input is greater than 5
> }
> 
> I have scoured the GCC manual and cannot figure it out from the given
> info.
> 
> Any help is greatly appreciated.  Thanks, Mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: assembly macro syntax...
  2002-02-18  9:14 assembly macro syntax Noonan, Michael E (Michael)
@ 2002-02-18 19:30 ` Dylan Cuthbert
  2002-02-19  1:47   ` Dylan Cuthbert
  0 siblings, 1 reply; 5+ messages in thread
From: Dylan Cuthbert @ 2002-02-18 19:30 UTC (permalink / raw)
  To: Noonan, Michael E (Michael), help-gcc

check out my page which some info and links on it regarding gcc's asm
statement- http://www.geocities.com/dylan_cuthbert.html

Regards
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com
----- Original Message -----
From: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>
To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>; <help-gcc@gnu.org>
Sent: Tuesday, February 19, 2002 1:51 AM
Subject: RE: assembly macro syntax...


>
> > I have a simple question for anyone who knows how to write assembly
macros
> > for the GNU compiler.  I am trying to port macros that target the Diab
> > compiler for PPC and am having a hell of a time figuring out the correct
> > syntax.  The macros are used to test the PPC exception handler by
forcing
> > the respective exceptions.  Here are a couple of the Diab format
assembly
> > macros for reference...
> >
> > VOID  excpTestPage (ULONG input)
> > {
> >    asm (" lwz r4,0(r3)");
> > }
> >
> > VOID  excpTestIsi (VOID)
> > {
> >    asm (" .long 0x4BC00001");  // branch to 0x0F00_0000 + ip
> > }
> >
> > VOID  excpTestTrap (ULONG input)
> > {
> >    asm (" twgti r3,5"); // trap if input is greater than 5
> > }
> >
> > I have scoured the GCC manual and cannot figure it out from the given
> > info.
> >
> > Any help is greatly appreciated.  Thanks, Mike

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: assembly macro syntax...
  2002-02-18 19:30 ` Dylan Cuthbert
@ 2002-02-19  1:47   ` Dylan Cuthbert
  0 siblings, 0 replies; 5+ messages in thread
From: Dylan Cuthbert @ 2002-02-19  1:47 UTC (permalink / raw)
  To: Dylan Cuthbert, Noonan, Michael E (Michael), help-gcc


sorry about that... remove the .html from the URL:

http://www.geocities.com/dylan_cuthbert

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com

----- Original Message -----
From: "Dylan Cuthbert" <dylan@q-games.com>
To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>; <help-gcc@gnu.org>
Sent: Tuesday, February 19, 2002 10:58 AM
Subject: Re: assembly macro syntax...


> check out my page which some info and links on it regarding gcc's asm
> statement- http://www.geocities.com/dylan_cuthbert.html
>
> Regards
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com
> ----- Original Message -----
> From: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>
> To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>;
<help-gcc@gnu.org>
> Sent: Tuesday, February 19, 2002 1:51 AM
> Subject: RE: assembly macro syntax...
>
>
> >
> > > I have a simple question for anyone who knows how to write assembly
> macros
> > > for the GNU compiler.  I am trying to port macros that target the Diab
> > > compiler for PPC and am having a hell of a time figuring out the
correct
> > > syntax.  The macros are used to test the PPC exception handler by
> forcing
> > > the respective exceptions.  Here are a couple of the Diab format
> assembly
> > > macros for reference...
> > >
> > > VOID  excpTestPage (ULONG input)
> > > {
> > >    asm (" lwz r4,0(r3)");
> > > }
> > >
> > > VOID  excpTestIsi (VOID)
> > > {
> > >    asm (" .long 0x4BC00001");  // branch to 0x0F00_0000 + ip
> > > }
> > >
> > > VOID  excpTestTrap (ULONG input)
> > > {
> > >    asm (" twgti r3,5"); // trap if input is greater than 5
> > > }
> > >
> > > I have scoured the GCC manual and cannot figure it out from the given
> > > info.
> > >
> > > Any help is greatly appreciated.  Thanks, Mike
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: assembly macro syntax...
  2002-02-19 15:26 Noonan, Michael E (Michael)
@ 2002-02-19 22:17 ` Dylan Cuthbert
  0 siblings, 0 replies; 5+ messages in thread
From: Dylan Cuthbert @ 2002-02-19 22:17 UTC (permalink / raw)
  To: Noonan, Michael E (Michael), help-gcc


You are missing the "commas" in that assembly code (just as the error is
telling you).

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com

----- Original Message -----
From: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>
To: "'Dylan Cuthbert'" <dylan@q-games.com>; "Noonan, Michael E (Michael)"
<mnoonan1@lucent.com>; <help-gcc@gnu.org>
Sent: Wednesday, February 20, 2002 12:40 AM
Subject: RE: assembly macro syntax...


>
> ok...  i have gotten a little further and have a new issue...  basically
all
> the macros that i converted are compiling without error, but there when i
> try and use the output of any of them, the compiler chokes on it with the
> error message shown below.  The actual code is also shown....  and all it
> does is read from a gpr and then prints the result (output).  If i co the
> printf statement, it compiles without error.
>
> Any help is appreciated.  Thanks, Mike
>
>    __asm__ ( "mr %0 %1" : "=&r" (output) : "r" (1) );
>
> //   __asm__ ( "or %0 %1 %2" : "=g" (output) : "g" (1), "g" (1) );
>
>    dprintf (DPRINT_LF, "Current r1 Stack: 0x%x.", output );
>
>
> [d:\exs2_rom\hdl\smc]make vxWorks
> mkvers2 build.c build.sav -b
> Mkvers2, ver. 4.1, Jun 28 2001 Mnoo
> Output File :  build.c
> Source File :  build.sav
> Build Info  :  0.0.0:289-
> Builder Name:
> ccppc -BC:\Tornado/host/x86-win32/lib/gcc-lib/  -c build.c -o build.o
> ccppc -BC:\Tornado/host/x86-win32/lib/gcc-lib/  -mstrict-align
> -DVXWORKS_HDL_BUILD -nostdinc -g -O2 -fvolatil
>
e -fno-builtin -fno-for-scope -Wall -I./h -IC:\Tornado\target\config\smc8260
> -I..\h -I..\h\diag -I..\h\drv -I
> . -IC:\Tornado\target\config\all -IC:\Tornado\target/h
> -IC:\Tornado\target/src/config -IC:\Tornado\target/src
> /drv -DCPU=PPCEC603    -msoft-float -c ..\src\diag/excpTest.c
> d:\TEMP\cca00272.s: Assembler messages:
> d:\TEMP\cca00272.s:935: Error: syntax error; found `1' but expected `,'
> d:\TEMP\cca00272.s:935: Error: junk at end of line: `11'
> ccppc: Internal compiler error: program as got fatal signal 1
> make: *** [excpTest.o] Error 0x1
> [d:\exs2_rom\hdl\smc]
>
>
>
>
> -----Original Message-----
> From: Dylan Cuthbert [mailto:dylan@q-games.com]
> Sent: Monday, February 18, 2002 10:31 PM
> To: Dylan Cuthbert; Noonan, Michael E (Michael); help-gcc@gnu.org
> Subject: Re: assembly macro syntax...
>
>
>
> sorry about that... remove the .html from the URL:
>
> http://www.geocities.com/dylan_cuthbert
>
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com
>
> ----- Original Message -----
> From: "Dylan Cuthbert" <dylan@q-games.com>
> To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>;
<help-gcc@gnu.org>
> Sent: Tuesday, February 19, 2002 10:58 AM
> Subject: Re: assembly macro syntax...
>
>
> > check out my page which some info and links on it regarding gcc's asm
> > statement- http://www.geocities.com/dylan_cuthbert.html
> >
> > Regards
> > ---------------------------------
> > Q-Games, Dylan Cuthbert.
> > http://www.q-games.com
> > ----- Original Message -----
> > From: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>
> > To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>;
> <help-gcc@gnu.org>
> > Sent: Tuesday, February 19, 2002 1:51 AM
> > Subject: RE: assembly macro syntax...
> >
> >
> > >
> > > > I have a simple question for anyone who knows how to write assembly
> > macros
> > > > for the GNU compiler.  I am trying to port macros that target the
Diab
> > > > compiler for PPC and am having a hell of a time figuring out the
> correct
> > > > syntax.  The macros are used to test the PPC exception handler by
> > forcing
> > > > the respective exceptions.  Here are a couple of the Diab format
> > assembly
> > > > macros for reference...
> > > >
> > > > VOID  excpTestPage (ULONG input)
> > > > {
> > > >    asm (" lwz r4,0(r3)");
> > > > }
> > > >
> > > > VOID  excpTestIsi (VOID)
> > > > {
> > > >    asm (" .long 0x4BC00001");  // branch to 0x0F00_0000 + ip
> > > > }
> > > >
> > > > VOID  excpTestTrap (ULONG input)
> > > > {
> > > >    asm (" twgti r3,5"); // trap if input is greater than 5
> > > > }
> > > >
> > > > I have scoured the GCC manual and cannot figure it out from the
given
> > > > info.
> > > >
> > > > Any help is greatly appreciated.  Thanks, Mike
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: assembly macro syntax...
@ 2002-02-19 15:26 Noonan, Michael E (Michael)
  2002-02-19 22:17 ` Dylan Cuthbert
  0 siblings, 1 reply; 5+ messages in thread
From: Noonan, Michael E (Michael) @ 2002-02-19 15:26 UTC (permalink / raw)
  To: 'Dylan Cuthbert', Noonan, Michael E (Michael), help-gcc


ok...  i have gotten a little further and have a new issue...  basically all
the macros that i converted are compiling without error, but there when i
try and use the output of any of them, the compiler chokes on it with the
error message shown below.  The actual code is also shown....  and all it
does is read from a gpr and then prints the result (output).  If i co the
printf statement, it compiles without error.

Any help is appreciated.  Thanks, Mike

   __asm__ ( "mr %0 %1" : "=&r" (output) : "r" (1) );

//   __asm__ ( "or %0 %1 %2" : "=g" (output) : "g" (1), "g" (1) );

   dprintf (DPRINT_LF, "Current r1 Stack: 0x%x.", output );


[d:\exs2_rom\hdl\smc]make vxWorks
mkvers2 build.c build.sav -b
Mkvers2, ver. 4.1, Jun 28 2001 Mnoo
Output File :  build.c
Source File :  build.sav
Build Info  :  0.0.0:289-
Builder Name:
ccppc -BC:\Tornado/host/x86-win32/lib/gcc-lib/  -c build.c -o build.o
ccppc -BC:\Tornado/host/x86-win32/lib/gcc-lib/  -mstrict-align
-DVXWORKS_HDL_BUILD -nostdinc -g -O2 -fvolatil
e -fno-builtin -fno-for-scope -Wall -I./h -IC:\Tornado\target\config\smc8260
-I..\h -I..\h\diag -I..\h\drv -I
. -IC:\Tornado\target\config\all -IC:\Tornado\target/h
-IC:\Tornado\target/src/config -IC:\Tornado\target/src
/drv -DCPU=PPCEC603    -msoft-float -c ..\src\diag/excpTest.c
d:\TEMP\cca00272.s: Assembler messages:
d:\TEMP\cca00272.s:935: Error: syntax error; found `1' but expected `,'
d:\TEMP\cca00272.s:935: Error: junk at end of line: `11'
ccppc: Internal compiler error: program as got fatal signal 1
make: *** [excpTest.o] Error 0x1
[d:\exs2_rom\hdl\smc]




-----Original Message-----
From: Dylan Cuthbert [mailto:dylan@q-games.com]
Sent: Monday, February 18, 2002 10:31 PM
To: Dylan Cuthbert; Noonan, Michael E (Michael); help-gcc@gnu.org
Subject: Re: assembly macro syntax...



sorry about that... remove the .html from the URL:

http://www.geocities.com/dylan_cuthbert

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com

----- Original Message -----
From: "Dylan Cuthbert" <dylan@q-games.com>
To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>; <help-gcc@gnu.org>
Sent: Tuesday, February 19, 2002 10:58 AM
Subject: Re: assembly macro syntax...


> check out my page which some info and links on it regarding gcc's asm
> statement- http://www.geocities.com/dylan_cuthbert.html
>
> Regards
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com
> ----- Original Message -----
> From: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>
> To: "Noonan, Michael E (Michael)" <mnoonan1@lucent.com>;
<help-gcc@gnu.org>
> Sent: Tuesday, February 19, 2002 1:51 AM
> Subject: RE: assembly macro syntax...
>
>
> >
> > > I have a simple question for anyone who knows how to write assembly
> macros
> > > for the GNU compiler.  I am trying to port macros that target the Diab
> > > compiler for PPC and am having a hell of a time figuring out the
correct
> > > syntax.  The macros are used to test the PPC exception handler by
> forcing
> > > the respective exceptions.  Here are a couple of the Diab format
> assembly
> > > macros for reference...
> > >
> > > VOID  excpTestPage (ULONG input)
> > > {
> > >    asm (" lwz r4,0(r3)");
> > > }
> > >
> > > VOID  excpTestIsi (VOID)
> > > {
> > >    asm (" .long 0x4BC00001");  // branch to 0x0F00_0000 + ip
> > > }
> > >
> > > VOID  excpTestTrap (ULONG input)
> > > {
> > >    asm (" twgti r3,5"); // trap if input is greater than 5
> > > }
> > >
> > > I have scoured the GCC manual and cannot figure it out from the given
> > > info.
> > >
> > > Any help is greatly appreciated.  Thanks, Mike
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-20  1:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-18  9:14 assembly macro syntax Noonan, Michael E (Michael)
2002-02-18 19:30 ` Dylan Cuthbert
2002-02-19  1:47   ` Dylan Cuthbert
2002-02-19 15:26 Noonan, Michael E (Michael)
2002-02-19 22:17 ` Dylan Cuthbert

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).