comp.lang.ada
 help / color / mirror / Atom feed
* Ada asm
@ 2016-07-09  3:28 ma740988
  2016-07-09  3:35 ` Jeremiah
  2016-07-10 15:06 ` Jacob Sparre Andersen
  0 siblings, 2 replies; 3+ messages in thread
From: ma740988 @ 2016-07-09  3:28 UTC (permalink / raw)



Debated if I should post my question in comp.lang.c++ but opted for comp.lang.ada instead.  I'm perusing Ada code and I'm trying to determine the C++ equivalents for the following:


    asm'( ldf => "set_test_reg:");


    --
    -- Set System MFT Address Register located at 0x00AD)
    --
    asm'( ldf => "mtmft 0x00AD, r1"); 


I'm relatively new to Ada but I saw a link that describe the => as a positional notation.   It's not clear what the relationship between ldf and set_test_reg is.   I suspect ldf is passed into set_test_reg ..who knows.   I perused this guideline - link below but still unclear that the C++ equivalent might be.  Any help appreciated.

http://www.ibm.com/developerworks/rational/library/inline-assembly-c-cpp-guide/

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

* Re: Ada asm
  2016-07-09  3:28 Ada asm ma740988
@ 2016-07-09  3:35 ` Jeremiah
  2016-07-10 15:06 ` Jacob Sparre Andersen
  1 sibling, 0 replies; 3+ messages in thread
From: Jeremiah @ 2016-07-09  3:35 UTC (permalink / raw)


On Friday, July 8, 2016 at 11:28:58 PM UTC-4, ma74...@gmail.com wrote:
> Debated if I should post my question in comp.lang.c++ but opted for comp.lang.ada instead.  I'm perusing Ada code and I'm trying to determine the C++ equivalents for the following:
> 
> 
>     asm'( ldf => "set_test_reg:");
> 
> 
>     --
>     -- Set System MFT Address Register located at 0x00AD)
>     --
>     asm'( ldf => "mtmft 0x00AD, r1"); 
> 
> 
> I'm relatively new to Ada but I saw a link that describe the => as a positional notation.   It's not clear what the relationship between ldf and set_test_reg is.   I suspect ldf is passed into set_test_reg ..who knows.   I perused this guideline - link below but still unclear that the C++ equivalent might be.  Any help appreciated.
> 
> http://www.ibm.com/developerworks/rational/library/inline-assembly-c-cpp-guide/

It looks like it is equivalent to basic inline assembly in GCC:
https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#s4

As opposed to extended assembly you have listed in the guide you posted


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

* Re: Ada asm
  2016-07-09  3:28 Ada asm ma740988
  2016-07-09  3:35 ` Jeremiah
@ 2016-07-10 15:06 ` Jacob Sparre Andersen
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Sparre Andersen @ 2016-07-10 15:06 UTC (permalink / raw)


ma740988@gmail.com writes:

> Debated if I should post my question in comp.lang.c++ but opted for
> comp.lang.ada instead.  I'm perusing Ada code and I'm trying to
> determine the C++ equivalents for the following:
>
>     asm'( ldf => "set_test_reg:");
>
>     --
>     -- Set System MFT Address Register located at 0x00AD)
>     --
>     asm'( ldf => "mtmft 0x00AD, r1"); 

I don't know enough about C++ machine code insertion, but the Ada
definitions can be found in section 13.8 in the Ada Reference Manual,
and the implementation specifics for GCC can be found in the GNAT
Reference Manual
(https://gcc.gnu.org/onlinedocs/gnat_rm/Machine-Code-Insertions.html#Machine-Code-Insertions).

> I'm relatively new to Ada but I saw a link that describe the => as a
> positional notation.

That's a mistake.  Using "=>" is named notation.  Just listing values in
a comma-separated list is positional notation.

Greetings,

Jacob
-- 
Better save than sorry!

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

end of thread, other threads:[~2016-07-10 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-09  3:28 Ada asm ma740988
2016-07-09  3:35 ` Jeremiah
2016-07-10 15:06 ` Jacob Sparre Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox