comp.lang.ada
 help / color / mirror / Atom feed
* Re: Assembler in Ada?
  1999-01-13  0:00 Assembler in Ada? Thomas Larsson
@ 1999-01-13  0:00 ` Matthew Heaney
  1999-01-14  0:00   ` Bill Ghrist
  1999-01-22  0:00 ` news.oxy.com
  1 sibling, 1 reply; 24+ messages in thread
From: Matthew Heaney @ 1999-01-13  0:00 UTC (permalink / raw)


Thomas Larsson <thomas.larsson@mbox5.swipnet.se> writes:

> I would like to write some assembler into my Ada program (to change
> video mode, use mouse etc).
> 
> How do I do that? (I have tried to figured out how, but I can't)
> Can I do it in a way similar to assembler in C or Pascal?
> \x18eg: _asm {
>               mov cx,100
>       LP:     loop LP
>       }
> 
> I would appreciate a small example program.
> 
> Thanks for your help
> Thomas
> 
> PS. I do the programming in Win98, not UNIX

Read RM95 13.8.

Which compiler are you using?  There should be a section of the manual
called "machine code insertions," or something like that.  Start there.  

Here's an excerpt from the GNAT reference manual, the section titled
Machine Code Insertions:

(start of excerpt)
   Package `Machine_Code' provides machine code support as described in
the Ada 95 Reference Manual in two separate forms:
   * Machine code statements, consisting of qualified expressions that
     fit the requirements of RM section 13.8.

   * An intrinsic callable procedure, providing an alternative
     mechanism of including machine instructions in a subprogram.

   The two features are similar, and both closely related to the
mechanism provided by the asm instruction in the GNU C cmpiler. Full
understanding and use of the facilities in this package requires
understanding the asm instruction as described in `Using and Porting
GNU CC' by Richard Stallman.  Calls to the function `Asm' and the
procedure `Asm' have identical semantic restrictions and effects as
described below.  Both are provided so that the procedure call can be
used as a statement, and the function call can be used to form a
code_statement.

   The first example given in the GNU CC documentation is the C `asm'
instruction:
        asm ("fsinx %1 %0" : "=f" (result) : "f" (angle));

The equivalent can be written for GNAT as:

        Asm ("fsinx %1 %0",
             My_Float'Asm_Output ("=f", result),
             My_Float'Asm_Input  ("f",  angle));
(end of excerpt)
-- 
Those who believe in the supernatural should be required to learn
computer programming.  This would force them to discover that things
which appear at first to be completely mysterious and incomprehensible,
in fact have a logical (and usually simple) explanation.  --J.B.R. Yant




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

* Assembler in Ada?
@ 1999-01-13  0:00 Thomas Larsson
  1999-01-13  0:00 ` Matthew Heaney
  1999-01-22  0:00 ` news.oxy.com
  0 siblings, 2 replies; 24+ messages in thread
From: Thomas Larsson @ 1999-01-13  0:00 UTC (permalink / raw)


I would like to write some assembler into my Ada program (to change
video mode, use mouse etc).

How do I do that? (I have tried to figured out how, but I can't)
Can I do it in a way similar to assembler in C or Pascal?
\x18eg:	_asm {
		mov cx,100
	LP:	loop LP
	}

I would appreciate a small example program.

Thanks for your help
Thomas

PS. I do the programming in Win98, not UNIX




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

* Re: Assembler in Ada?
  1999-01-13  0:00 ` Matthew Heaney
@ 1999-01-14  0:00   ` Bill Ghrist
       [not found]     ` <369ED5E0.DB29E68C@usc.edu>
  0 siblings, 1 reply; 24+ messages in thread
From: Bill Ghrist @ 1999-01-14  0:00 UTC (permalink / raw)


This raises a related issue, which is the one frustrating thing that I
have found while trying to use GNAT to teach myself Ada and evaluate it
for possible future use.  Trying to interpret the assembler listing that
is produced by using the gcc -S switch is like trying to read something
in Klingon.  Does anybody know whether there is a straightforward
description of the x86 assembly syntax used by GNAT/gcc?  When I have
asked this in the past, all I got was pointers to something like the
`Using and Porting GNU CC' document, but this is at least a couple of
layers of abstraction removed from the information I am looking for. 
What I really want is a "gcc x86" to "Intel ASM86" dictionary (or any of
the other dialects such as Microsoft or Borland - everything but "gcc
x86" is close enough to Intel syntax as to be pretty obvious).  Has
anyone done one of these? 

Regards,
Bill Ghrist

Matthew Heaney wrote:
> 
> Thomas Larsson <thomas.larsson@mbox5.swipnet.se> writes:
> 
> > I would like to write some assembler into my Ada program (to change
> > video mode, use mouse etc).
> >
> > How do I do that? (I have tried to figured out how, but I can't)
> > Can I do it in a way similar to assembler in C or Pascal?
> > \x18eg: _asm {
> >               mov cx,100
> >       LP:     loop LP
> >       }
> >
> > I would appreciate a small example program.
> >
> > Thanks for your help
> > Thomas
> >
> > PS. I do the programming in Win98, not UNIX
> 
> Read RM95 13.8.
> 
> Which compiler are you using?  There should be a section of the manual
> called "machine code insertions," or something like that.  Start there.
> 
> Here's an excerpt from the GNAT reference manual, the section titled
> Machine Code Insertions:
> 
> (start of excerpt)
>    Package `Machine_Code' provides machine code support as described in
> the Ada 95 Reference Manual in two separate forms:
>    * Machine code statements, consisting of qualified expressions that
>      fit the requirements of RM section 13.8.
> 
>    * An intrinsic callable procedure, providing an alternative
>      mechanism of including machine instructions in a subprogram.
> 
>    The two features are similar, and both closely related to the
> mechanism provided by the asm instruction in the GNU C cmpiler. Full
> understanding and use of the facilities in this package requires
> understanding the asm instruction as described in `Using and Porting
> GNU CC' by Richard Stallman.  Calls to the function `Asm' and the
> procedure `Asm' have identical semantic restrictions and effects as
> described below.  Both are provided so that the procedure call can be
> used as a statement, and the function call can be used to form a
> code_statement.
> 
>    The first example given in the GNU CC documentation is the C `asm'
> instruction:
>         asm ("fsinx %1 %0" : "=f" (result) : "f" (angle));
> 
> The equivalent can be written for GNAT as:
> 
>         Asm ("fsinx %1 %0",
>              My_Float'Asm_Output ("=f", result),
>              My_Float'Asm_Input  ("f",  angle));
> (end of excerpt)
> --
> Those who believe in the supernatural should be required to learn
> computer programming.  This would force them to discover that things
> which appear at first to be completely mysterious and incomprehensible,
> in fact have a logical (and usually simple) explanation.  --J.B.R. Yant




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

* Re: Will this help? (Re: Assembler in Ada?
       [not found]     ` <369ED5E0.DB29E68C@usc.edu>
@ 1999-01-15  0:00       ` Bill Ghrist
  0 siblings, 0 replies; 24+ messages in thread
From: Bill Ghrist @ 1999-01-15  0:00 UTC (permalink / raw)
  To: Weston T. Pan

Yes, thanks; this is the sort of thing that I was looking for.

Regards,
Bill Ghrist

Weston T. Pan wrote:
> 
> Not complete, but it's a start...
> 
> http://www.castle.net/~avly/djasm.html
>




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

* Re: Assembler in Ada?
  1999-01-13  0:00 Assembler in Ada? Thomas Larsson
  1999-01-13  0:00 ` Matthew Heaney
@ 1999-01-22  0:00 ` news.oxy.com
  1999-01-24  0:00   ` dewar
  1999-01-24  0:00   ` dewar
  1 sibling, 2 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-22  0:00 UTC (permalink / raw)



Thomas Larsson wrote in message <369C5E08.69727537@mbox5.swipnet.se>...
>I would like to write some assembler into my Ada program (to change
>video mode, use mouse etc).
>
>How do I do that? (I have tried to figured out how, but I can't)
>Can I do it in a way similar to assembler in C or Pascal?
>\x18eg: _asm {
> mov cx,100
> LP: loop LP
> }
>
>I would appreciate a small example program.
>
>Thanks for your help
>Thomas
>
>PS. I do the programming in Win98, not UNIX


Below there are several examples of using Assembler with GNAT 3.10p1
(Windows NT 4.0).
Hope that they will be of some help for those who found that it is difficult
to understand how to use Assembler with GNAT.

I enjoy playing with GNAT 3.10p1 and find that it is really good.
But unfortunately I should admit the poor quality of GNAT documentation
regarding using of the assembler with it.  ACT people perfectly well know
one generic rule that should be followed to make any software system work:
ALL THE REFERENCIES FROM THE SOFTWARE MODULES SHOULD BE RESOLVED WITHIN THE
GIVEN SET OF MODULES THAT MAKE UP
THE SYSTEM. One won't be able to build the system if that rule is not
obeyed.
To my great surprise they forgot to apply this rule to the documentation so
it does not work.ALL THE REFERENCIES FROM ANY PIECE OF THE SYSTEM
DOCUMENTATION SHOULD BE RESOLVED WITHIN THE SET OF MANUALS THAT COME WITH
THE GIVEN SYSTEM. Otherwise the documentation does not work.

If you open GNAT ref. Manual at the Machine Code Insertion you will find
that just from the second paragraph ACT suggest you to go far away - to the
"Using and Porting GNU CC" which is not included in the documentation that
comes with GNAT. "Happy" GNAT users! (especially new ones). They want to
know how to use Assembler with GNAT but they are suggested to learn how to
use and port GCC. Moreover they are even directed where to find this manual.
Just wonderful!
There also no info regarding control over passing parameters, names of the
registers, how the template string is
passed to the GCC Assembler e.t.c.

Another thing that they forgot to do is to supply several small examples,
which can help to understand the rules. As a professor Rober Devar should
know that very complex and difficult things could be easily explained to
students using well designed simple examples.

Hope that ACT will be able to improve this in the GNAT 3.11p documentation
and close this issue.
DOCUMENTATION SHOULD BE SELF-CONTAINED!

Hope that my examples will be of some help.

Regards to all,
Vladimir Olensky (vladimir_olensky@yahoo.com)

 (Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.


**********************************************
There are two ways using Assembler:
1. Inline Assembler code
2. External Assembler code (xxx.S file) which is compiled by tha same GCC

Here I will give only two small examples in order not to overload
this posting too much. Later I can give some more
if there will be new requests.

*************************************************
--------------------------------
-- Inline assembler code example.
-- Author: Vladimir Olensky
---------------------------------
WITH Ada.Text_IO; USE Ada.Text_IO;
WITH Ada.Integer_Text_IO; USE Ada.Integer_Text_IO;

-- first you need to use System.Machine_Code package
WITH System.Machine_Code; USE System.Machine_Code;

PROCEDURE Asm_Tst1 IS

   -- new line - Unix stile - LF
   --            CRLF is causing GCC assembler to crash !!!
   nl: CONSTANT Character  := Character'Val(10);

   A:INTEGER:=15;
   B:INTEGER:=20;
   C:INTEGER:=0;

BEGIN
   Put_Line(" Inline assembler test");
   New_Line;
   -------------------------------------------
    Asm (
             "movl  %1,    %%eax"  & nl &    -- note nl here
         "    addl  %2,    %%eax"  & nl &    -- to construct proper string
template.
         "    movl  %%eax, %0",              -- Without that it won't work
         INTEGER'Asm_Output("=g", C),   -- Asm_Output("=g", C) compiler
choose output register for C
                                       -- Asm_Input( "g", A) -compiler
choose register for for A
        (INTEGER'Asm_Input( "g", A),INTEGER'Asm_Input("g", B)),
         "eax",  -- register eax will be spoiled by my code
          False  -- compiler, do not optimise my code !
          );
   --------------------------------------
   Put(C);
END Asm_Tst1;

-- Asm_tst1 output = 35
-------------
extras from assembler listing with my comments:
 ....
/APP    - my asm inline code
    movl  $15,    %eax    / move A to ax
    addl  $20,    %eax    / add B to A
    movl  %eax, %edx   / save result to C ( compiler have chosen edx)
/NO_APP
        / call to Put(C)
 movl _ada__integer_text_io__default_base,%eax
 pushl %eax
 movl _ada__integer_text_io__default_width,%eax
 pushl %eax
 pushl %edx     / push C
 call _ada__integer_text_io__put$2
 ....

*********************************************
another example with manual register control

--------------------------------
-- Inline assembler code example.
-- Author: Vladimir Olensky
---------------------------------

WITH Ada.Text_IO; USE Ada.Text_IO;
WITH Ada.Integer_Text_IO; USE Ada.Integer_Text_IO;

-- first you need to use System.Machine_Code package
WITH System.Machine_Code; USE System.Machine_Code;

PROCEDURE Asm_Tst1 IS

   -- new line - Unix stile --LF
   --            CRLF is causing GCC asembler to crash !!!
   nl: CONSTANT Character  := Character'Val(10);

   A:INTEGER:=15;
   B:INTEGER:=20;
   C:INTEGER:=0;

BEGIN
   Put_Line(" Inline assembler test");
   New_Line;
   -------------------------------------------
    Asm (
      -- we add two registers where we directed compiler to put A and B
         "    addl  %%ebx,    %%eax",
        INTEGER'Asm_Output("=a", C),   -- Asm_Output("=a", C) compiler, use
eax to output C
                                       -- Asm_Input( "a", A) -compiler, use
eax for for A
                                       -- Asm_Input( "b", B) -compiler, use
ebx for for B
        (INTEGER'Asm_Input( "a", A),INTEGER'Asm_Input("b", B)),
         "",  -- do not need to use anything, compiler already knows
everything
         False  -- compiler, do not optimise my code !
          );
   --------------------------------------

   Put(C);
END Asm_Tst1;
-- Asm_tst1 output = 35
----------
extras from the assembler listing with my comments:
 ...
 call _ada__text_io__new_line$2  / call to New_Line
 movl $15,%eax   / INTEGER'Asm_Input( "a", A)
 movl $20,%ebx   / INTEGER'Asm_Input("b", B)
/APP
     addl  %ebx,    %eax         / My inline assembler code
/NO_APP
 / call to the Put(C)
 movl %eax,%edx                 / compiler moves C to edx
 movl _ada__integer_text_io__default_base,%eax  / as eax will used for
defauly dase
 pushl %eax
 movl _ada__integer_text_io__default_width,%ebx
 pushl %ebx
 pushl %edx                                            / push C
 call _ada__integer_text_io__put$2
  ...
********************************
From the last example you can see that it is necessary to be very careful
when
manually controlling passing varaibles to the registers. It can be less
effective.
Just compare two examples and you will see that the last one has one
instruction more.
There are a lot of pitfalls here. Be careful!







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

* Re: Assembler in Ada?
  1999-01-22  0:00 ` news.oxy.com
  1999-01-24  0:00   ` dewar
@ 1999-01-24  0:00   ` dewar
  1999-01-25  0:00     ` news.oxy.com
  1 sibling, 1 reply; 24+ messages in thread
From: dewar @ 1999-01-24  0:00 UTC (permalink / raw)


In article <78a32f$dbr$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
> If you open GNAT ref. Manual at the Machine Code
> Insertion you will find that just from the second
> paragraph ACT suggest you to go far away - to the
> "Using and Porting GNU CC" which is not included in the
> documentation that
> comes with GNAT. "Happy" GNAT users! (especially new
> ones). They want to
> know how to use Assembler with GNAT but they are
> suggested to learn how to
> use and port GCC. Moreover they are even directed where
> to find this manual.

We definitely try NOT to duplicate documentation of this
type that is available in the gcc manual. There are for
example dozens of switches described in the gcc manual that
are of course relevant for GNAT, but we do not duplicate
the description in the GNAT manual.

The only time we duplicate information in the GCC manual
(which serious GNAT users should have a copy of) is for
commonly used features. We do not consider assembly
language insertions to be in this category.

In addition, this feature in GNAT is powerful but you
really need to understand quite a bit about it to use it
on a given machine, and the understanding comes from the
gcc manual.

And yes, to use GNAT at this level, you definitely need to
learn how to use gcc (though not necessarily to port it!)

It would be possible to give more examples, but they would
probably not be as illuminating as you think, because they
would give a very limited view of what is in fact a very
powerful facility.

Robert Dewar
Ada Core Technologies


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-22  0:00 ` news.oxy.com
@ 1999-01-24  0:00   ` dewar
  1999-01-25  0:00     ` news.oxy.com
  1999-01-24  0:00   ` dewar
  1 sibling, 1 reply; 24+ messages in thread
From: dewar @ 1999-01-24  0:00 UTC (permalink / raw)


In article <78a32f$dbr$1@remarQ.com>,
>     Asm (
>              "movl  %1,    %%eax"  & nl &    -- note nl

This is a bad idea, use one Asm call per instruction.
Also you probably do NOT want to use an explicit register
here. It is allowed, but it usually at the wrong level.
It is true one does this more on the ia32 than other
machines, but it is poor as an example.

You do not need to set the clobbers argument in this case
to %%eax, it won't cause trouble to do so, but there is no
need, and in an example it is confusing.

>           False  -- compiler, do not optimise my code

It is quite wrong to mark this as volatile, this is not
a volatile instruction.


> From the last example you can see that it is necessary to
> be very careful when
> manually controlling passing varaibles to the registers.

It is generally a bad idea to write asm code at this level
(a level where you rely on detailed knowledge of the ABI
for passing parameters), and it is not necessary.

Once again, we recommend that anyone interested in using
this feature read the documentation in the GCC manual. The
design of the ASM feature in Ada has been chosen to be a
very thin binding to the corresponding C feature, so that
documentation and examples apply without any confusion.

Robert Dewar
Ada Core Technologies


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-24  0:00   ` dewar
@ 1999-01-25  0:00     ` news.oxy.com
  1999-01-25  0:00       ` Richard Kenner
  1999-01-25  0:00       ` robert_dewar
  0 siblings, 2 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-25  0:00 UTC (permalink / raw)


First of all I am glad to get response from Robert Dewar.
I would like him to be involved into some more useful discussion threads
compared with the "bracket wars" and some other small issues that usually
are internal issues of any particular organization/company.
Below are some of my comments to his reply.


dewar@gnat.com wrote in message <78fv79$7mj$1@nnrp1.dejanews.com>...


>The only time we duplicate information in the GCC manual
>(which serious GNAT users should have a copy of) is for
>commonly used features. We do not consider assembly
>language insertions to be in this category.


This passage can be easily understood  that the public distribution of GNAT
is not intended for serious GNAT users, as it does not include GCC manual.
But everything in your hands. Just include this manual  into public GNAT
distribution and then every serious GNAT user will have that manual at hand.
In my previous message I just wanted to point out that that the GNAT
documentation set is insufficient:
"ALL THE REFERENCIES FROM ANY PIECE OF THE SYSTEM
DOCUMENTATION SHOULD BE RESOLVED WITHIN THE SET OF MANUALS THAT COMES WITH
THE GIVEN SYSTEM. Otherwise the documentation does not work."

>We definitely try NOT to duplicate documentation of this
>type that is available in the gcc manual. There are for
>example dozens of switches described in the gcc manual that
>are of course relevant for GNAT, but we do not duplicate
>the description in the GNAT manual.

No need to rewrite or duplicate GCC manual. If you have references to the
GCC manual it should come with GNAT documentation set especially taking
into account that GNAT is built on top of GCC.
Se above mentioned rule.

>In addition, this feature in GNAT is powerful but you
>really need to understand quite a bit about it to use it
>on a given machine, and the understanding comes from the
>gcc manual.


Again , include GCC manual or part of it into the GNAT distribution.

>
>And yes, to use GNAT at this level, you definitely need to
>learn how to use gcc (though not necessarily to port it!)


And once more, include GCC manual into the GNAT distribution !
It is so obvious and simple !

>It would be possible to give more examples, but they would
>probably not be as illuminating as you think, because they
>would give a very limited view of what is in fact a very
>powerful facility.


No more is needed.
To my point of view several small examples and explanations in GNAT user
guide would be very useful. The idea is not to teach users deeply how to use
Assembler with GNAT but give them some initial understanding of how to use
this feature and clear understanding of what is written in Machine Code
Insertion section of GNAT reference manual. Those who want to know more will
then study GCC manual (if it will be included in GNAT distribution).
Many lectures delivered in Universities begin with the simple sentence:
"Let's consider the following example". Then you can hear some brief
explanations and then the theory behind that example.
This is the easiest way to make complex things to be felt very simple.
I hope that one of the ACT targets is make GNAT easier to understand and
work with.
Personally, I have very high opinion about GNAT and approach taken to GNAT
open source design. I would like that ACT people would make GNAT better and
better with each new release.
And do not take critical opinions of the GNAT weak sides as a personal or
team  offence. They are suggestions for improvement. Just make GNAT better
taking them into account. Sometimes such statements should more polemic to
cause some kind of reaction from the other side.

Sometimes people deeply involved into some system development (especially
software systems) have all the time to think about very specific issues so
they have less time to think more broader and generally and as a result some
obvious things may slip their minds.
Greatest example of such is the death of the one of the first US nuclear
submarine in deep waters at the yearly of the 60's.
Nuclear reactor has stopped for some reason. Crew was not able to start it
again and tried to rise submarine to the ocean surface but could not do this
because it was not possible to free ballast tanks from water using highly
compressed air.
Designers of this extremely complex submarine forgot the fundamental physics
law that is studied in the school. When compressed gas is letting out from
gas tank it's temperature is going down. Temperature difference is the
function of pressure difference. As a result of this law air pipes to water
tanks were frozen (as any gas contains some amount of water) when the crew
tried to push the water out of ballast tanks and several attempts were
unsuccessful. Submarine was going down into the deeps of the ocean and was
crashed by the water pressure. About 150 people have died in a part of the
second.


Hope to discuss more general things later. As a matter of fact this one
(assembler , not nuclear submarine)  was not very big issue. There are some
others that are of much great importance for Ada future.


Best regards,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.











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

* Re: Assembler in Ada?
  1999-01-25  0:00     ` news.oxy.com
@ 1999-01-25  0:00       ` Richard Kenner
  1999-01-25  0:00         ` news.oxy.com
  1999-01-25  0:00       ` robert_dewar
  1 sibling, 1 reply; 24+ messages in thread
From: Richard Kenner @ 1999-01-25  0:00 UTC (permalink / raw)


In article <78hj3k$2tn$1@remarQ.com> "news.oxy.com" <Vladimir_Olensky@oxy.com> writes:
>But everything in your hands. Just include this manual  into public GNAT
>distribution and then every serious GNAT user will have that manual at hand.
>In my previous message I just wanted to point out that that the GNAT
>documentation set is insufficient:
>"ALL THE REFERENCIES FROM ANY PIECE OF THE SYSTEM
>DOCUMENTATION SHOULD BE RESOLVED WITHIN THE SET OF MANUALS THAT COMES WITH
>THE GIVEN SYSTEM. Otherwise the documentation does not work."

You also need a manual for the assembler and the architecture of the CPU
in order to use machine code insertions.  Are you proposing those
be included as well?




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

* Re: Assembler in Ada?
  1999-01-24  0:00   ` dewar
@ 1999-01-25  0:00     ` news.oxy.com
  1999-01-25  0:00       ` robert_dewar
  1999-01-25  0:00       ` robert_dewar
  0 siblings, 2 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-25  0:00 UTC (permalink / raw)


I have a feeling that the very idea of my two small examples was not
understood at all.
I should mention that I am not surprised at all - reading other Robert Dewar
discussions (in particular in "brackets war") I expected something like
this.

First of all my examples were not intended to illustrate good programming
style in assembler with GNAT. It is a big separate topic.
Their aim were to explain how to understand what has been written in Machine
Code Insertion Section of the GNAT reference manual (that probably is not
very clear for some people without appropriate examples) and trying to be
simple and short as possible.
So these examples should be considered from only that point of view.

First you need to explain meaning of what is being said in the manual as
simple as possible and only after that you may give an examples of good
style assembler with GNAT (These are very, very different tasks and
sometimes require completely different approaches). Neither of that has been
done in GNAT documentation.
It sounds very funny to hear from people who did not do something
(intentionally or not) that someone, who filled that gap, did not do it very
good. It is better to say thanks that this has been done and make necessary
improvements in documentation and provide further better examples.

I consider this forum as the place where people can help each other, share
their knowledge and experiences and are not trying to use it to argue that
they are the best, the cleverest, the most bright minds which are always
right. For that we may set up another discussion thread.

See my other comments below.

dewar@gnat.com wrote in message <78fvjm$82t$1@nnrp1.dejanews.com>...
>In article <78a32f$dbr$1@remarQ.com>,
>>     Asm (
>>              "movl  %1,    %%eax"  & nl &    -- note nl
>
>This is a bad idea, use one Asm call per instruction.


If some person states that something is bad that does not mean all the times
that it is bad in reality.
I agree that it is not very convenient to insert "nl" to construct Asm
string template. This should be done by GNAT itself !! (e.g. using array of
strings for Asm call template instead if single string template or have
proper interpretation of multi line assembler code in Asm procedure call).
This is again one of the weak sides of the GNAT that needs to be improved.
Just look at the Borland Delphi and some other systems how this is done.
Everything is handled properly for multi-line Asm insertions. Everything is
very simple. Everything is very well documented. No need for any kind of
"nl" things.
Moreover, one Asm call per instruction is not convenient as you need to
construct several Asm calls to pass you parameters in and out so I do not
consider that as good and productive approach. Do what is more convinient
for users and not for ACT.

>Also you probably do NOT want to use an explicit register
>here. It is allowed, but it usually at the wrong level.
>It is true one does this more on the ia32 than other
>machines, but it is poor as an example.


Wrong, wrong and again wrong.
If anyone goes down to assembler level , he/she does this to get direct
access to processor registers and set of operations that can be performed on
them and machine memory otherwise there is no need to go down to such low
level. Do things at the higher level. I just wanted to show how to use
registers and that this is possible. Example from the GNAT reference manual
with one Asm instruction does not give the slightest idea about that.
Usually assembler programming is done for very specific things for which
translator can not generate efficient machine code and this is done by
people who know why they are using assembler.
After Intel starts production of the "Merced" chip which has 128 general
purpose registers and 128 floating point registers there will be new
generation of the compilers that will use that registers very efficiently
for bigger size procedures written in high level languages.
After that the need for the assembler code insertion will be much less than
now. Only for extremely specific things. Those who will be the first will
have advantage on the market.


>You do not need to set the clobbers argument in this case
>to %%eax, it won't cause trouble to do so, but there is no
>need, and in an example it is confusing.


Again, this is just an example how to preserve registers that will be
spoiled by the Asm code and nothing more.
Usually you do not need to preserve eax at all.
There are two ways to preserve registers: - by Asm code itself or by using
clobbers. Each one may be more convenient in different circumstances.


>>           False  -- compiler, do not optimise my code
>
>It is quite wrong to mark this as volatile, this is not
>a volatile instruction.


Again, this is just an example  how to say translator not to try to improve
your code and nothing more.
There is no need to go into deep details.

>> From the last example you can see that it is necessary to
>> be very careful when
>> manually controlling passing varaibles to the registers.
>
>It is generally a bad idea to write asm code at this level
>(a level where you rely on detailed knowledge of the ABI
>for passing parameters), and it is not necessary.


Again, it was no more than example that shows how it is possible to pass
parameters via registers and it is not covered by GNAT documentation. Do not
take it more seriously.
More generally if you are doing assembler coding you know why you do this.
If you passing parameters via registers you know why you are doing that.
This is for what assembler is used.
One thing that I did not mentioned earlier is that then you are using Asm
calls then you loose portability become ties to the specific processor thus
loosing Ada program portability for different hardware platforms.


>Once again, we recommend that anyone interested in using
>this feature read the documentation in the GCC manual. The
>design of the ASM feature in Ada has been chosen to be a
>very thin binding to the corresponding C feature, so that
>documentation and examples apply without any confusion.


Again, include this manual or part of it in GNAT public distribution.
See the rule mentioned in the previous messages regarding this issue.
Make GNAT more comfortable for users.


Regards to all,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.

















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

* Re: Assembler in Ada?
  1999-01-25  0:00       ` Richard Kenner
@ 1999-01-25  0:00         ` news.oxy.com
  0 siblings, 0 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-25  0:00 UTC (permalink / raw)



Richard Kenner wrote in message <78huri$o0i$1@news.nyu.edu>...
>In article <78hj3k$2tn$1@remarQ.com> "news.oxy.com"
<Vladimir_Olensky@oxy.com> writes:
>>But everything in your hands. Just include this manual  into public GNAT
>>distribution and then every serious GNAT user will have that manual at
hand.
>>In my previous message I just wanted to point out that that the GNAT
>>documentation set is insufficient:
>>"ALL THE REFERENCIES FROM ANY PIECE OF THE SYSTEM
>>DOCUMENTATION SHOULD BE RESOLVED WITHIN THE SET OF MANUALS THAT COMES WITH
>>THE GIVEN SYSTEM. Otherwise the documentation does not work."
>
>You also need a manual for the assembler and the architecture of the CPU
>in order to use machine code insertions.  Are you proposing those
>be included as well?

There is no need to exaggerate things.
It is clear from the original Thomas Larsson question what we are talking
about.

People that want to know how to use assembler with GNAT already know
assembler itself and the architecture of the CPU. They want to have the
answer to the specific question - how this is implemented in GNAT.  ACT
should help them providing self contained documentation set.
People that do not know Assembler will never ever think of that.
So I do not think there is any need to include such kind of things.
There are a lot of books and online documentation on that issue.



Regards,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.








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

* Re: Assembler in Ada?
  1999-01-25  0:00     ` news.oxy.com
  1999-01-25  0:00       ` Richard Kenner
@ 1999-01-25  0:00       ` robert_dewar
  1999-01-26  0:00         ` news.oxy.com
  1 sibling, 1 reply; 24+ messages in thread
From: robert_dewar @ 1999-01-25  0:00 UTC (permalink / raw)


In article <78hj3k$2tn$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
> This passage can be easily understood  that the public
> distribution of GNAT is not intended for serious GNAT
> users, as it does not include GCC manual. But everything
> in your hands. Just include this manual  into public GNAT
> distribution and then every serious GNAT user will have
> that manual at hand.

In fact the public distribution of GNAT is intended
primarily for student use, and it seems inappropriate
to include the gcc manual, since this will be of use
only to a very small fraction of advanced users who can
perfectly well go and get the GCC manual for themselves
(indeed it is available in a very nice bound form from
FSF, available at your local bookstores, including Barnes
and Noble).

> In my previous message I just wanted to point out that
> that the GNAT documentation set is insufficient:
> "ALL THE REFERENCIES FROM ANY PIECE OF THE SYSTEM
> DOCUMENTATION SHOULD BE RESOLVED WITHIN THE SET OF
> MANUALS THAT COMES WITH
> THE GIVEN SYSTEM. Otherwise the documentation does not
> work."

I am not sure why you think SHOUTING at me is likely to
convince me :-) But indeed the documentation supplied with
GNAT is far from complete for most users. In particular,
we make no attempt at all to provide informal documentation
on how to use Ada 95, and that of course is something most
users will need.


> And once more, include GCC manual into the GNAT
> distribution ! It is so obvious and simple !

It is also obvious and simple for the few people who need
it to obtain it for themselves. There are many things we
could include in the distribution that might be useful to
a few people (lots of useful bindings come to mind), but
we have to make a decision on each item as to whether
enough people will use it to make it worth while.

In our judgment, unchanged by your arguments, the GCC
manual is of interest to too small a segment of GNAT users
to be worth including in all distributions.

> And do not take critical opinions of the GNAT weak sides
> as a personal or team  offence. They are suggestions for
> improvement. Just make GNAT better taking them into
> account. Sometimes such statements should more polemic to
> cause some kind of reaction from the other side.

I do not regard these as critical opinions, merely
suggestions, which we always welcome, and may or may not
follow depending on our judgment. A polemic style will
neither help nor hurt in getting your suggestions accepted,
since they are evaluated on their technical merits by us.

<<irrelevant stuff about submarines snipped>>

> Hope to discuss more general things later. As a matter of
> fact this one (assembler , not nuclear submarine)  was
> not very big issue. There are some others that are of
> much great importance for Ada future.

I would prefer to keep the discussion more focussed on
technical issues relating to Ada.

By the way, I appreciate that you may have more difficulty
downloading from your location than some others, but in
fact keeping distributions small and avoiding the inclusion
of unnecessary items that are easily obtained separately
is especially important in such circumstances.

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-25  0:00     ` news.oxy.com
@ 1999-01-25  0:00       ` robert_dewar
  1999-01-26  0:00         ` news.oxy.com
  1999-01-25  0:00       ` robert_dewar
  1 sibling, 1 reply; 24+ messages in thread
From: robert_dewar @ 1999-01-25  0:00 UTC (permalink / raw)


In article <78hvth$m36$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:

> It sounds very funny to hear from people who did not do
> something (intentionally or not) that someone, who filled
> that gap, did not do it very good. It is better to say
> thanks that this has been done and make necessary
> improvements in documentation and provide further better
> examples.

The most useful thing you can do is to read the gcc manual
carefully, and make suggestions as to how the documentation
there on the use of the asm feature can be improved. Then
send those suggestions to the FSF, or to us, we can pass
them on!> >
> Wrong, wrong and again wrong.
> If anyone goes down to assembler level , he/she does this
> to get direct access to processor registers and set of
> operations that can be performed on them and machine
> memory otherwise there is no need to go down to such low
> level.

You definitely need to read the GCC manual, I think you
have missed the whole point of how this feature integrates
with the RTL approach used in the backend of gcc. Yes, this
is quite a complicated feature to understand and use, but
also very powerful.

> Again, this is just an example how to preserve registers
> that will be spoiled by the Asm code and nothing more.
> Usually you do not need to preserve eax at all.

Again, read the GCC manual to better understand how the
clobbers argument works, sounds like you are a bit confused
(which is not surprising this is tricky stuff!)

> Again, this is just an example  how to say translator not
> to try to improve your code and nothing more.
> There is no need to go into deep details.

Again, you are confused as to the semantics here. Volatile
does not say "do not optimize", it is a semantic statement
about side effects of an instruction (for example, an IN or
OUT instruction on the ia32 would typically be labeled as
volatile).


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-25  0:00     ` news.oxy.com
  1999-01-25  0:00       ` robert_dewar
@ 1999-01-25  0:00       ` robert_dewar
  1 sibling, 0 replies; 24+ messages in thread
From: robert_dewar @ 1999-01-25  0:00 UTC (permalink / raw)


In article <78hvth$m36$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
> I have a feeling that the very idea of my two small
> examples was not understood at all.
> I should mention that I am not surprised at all - reading
> other Robert Dewar
> discussions (in particular in "brackets war") I expected
> something like this.

By the way, my only reference to "brackets wars" was a
warning not to start a thread on the silly subject of which
way brackets should be written in C. Perhaps Vladimir
missed the point :-)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-25  0:00       ` robert_dewar
@ 1999-01-26  0:00         ` news.oxy.com
  1999-01-27  0:00           ` Samuel Tardieu
  1999-01-27  0:00           ` dewar
  0 siblings, 2 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-26  0:00 UTC (permalink / raw)



robert_dewar@my-dejanews.com wrote in message
<78igfq$32g$1@nnrp1.dejanews.com>...


>>>The only time we duplicate information in the GCC manual
>>>(which serious GNAT users should have a copy of) is for
>>>commonly used features.

>> This passage can be easily understood  that the public
>> distribution of GNAT is not intended for serious GNAT
>> users, as it does not include GCC manual.

>In fact the public distribution of GNAT is intended
>primarily for student use, and it seems inappropriate
>to include the gcc manual, since this will be of use
>only to a very small fraction of advanced users who can
>perfectly well go and get the GCC manual for themselves


> ... But indeed the documentation supplied with
>GNAT is far from complete for most users. In particular,
>we make no attempt at all to provide informal documentation
>on how to use Ada 95, and that of course is something most
>users will need.


I have the impression that there are a lot of users of GNAT that are not
students but much more advanced users as well as people (in non military
areas) that want to experiment with Ada and consider public releases of Ada
as some initial stage in evaluating different aspects and approaches
(including choice of compiler systems and tools) to the design of their
systems (hard/soft). As result of such evaluation they may or may not choose
Ada as their primary platform for system development. If they choose GNAT
for that then they will buy commercial support from ACT for their
development.
I think that ACT should do whatever possible to help making such decisions.
Making all the valuable Ada information easily available is one of the ways
to do this. People should spend less time trying to find information that
they need.
There are several ways to do this. One of them is include that in
distribution and provide several installation options, so that those who
want, can install additional documents. Your GNAT 3.11p (my
congratulations!!! - all users seem to be very happy !!!) is about 18 MB so
+- (1-2)Mb does not make big difference. This is a standard approach (e.g.
OA special edition can be install with or without additional components) for
systems distributions.
The other approach is to make several links from your site. Not only for
students to get access to public version of GNAT but also for more advanced
users so that they could spend less time finding specific information and
Ada tools that they may need (as a matter of fact you already have links to
a variety of Ada tools).
Anyway it is ACT decision how to address that issues. So I hope ACT will do
their best to make Ada users happy.



>> Hope to discuss more general things later. As a matter of
>> fact this one (assembler , not nuclear submarine)  was
>> not very big issue. There are some others that are of
>> much great importance for Ada future.
>
>I would prefer to keep the discussion more focussed on
>technical issues relating to Ada.


This is OK but future of Ada depends not only on the quality of the language
itself and it's technical issues.
If nothing extraordinary will be done to improve situation in the near
future (easy to use RAD environment - "Ada Delphi") then it will be very
difficult for Ada to cross the boundaries of it's living domain. Other much
less perfect languages with great commercial support that have a lot more
easy to use development tools just won't allow Ada to occupy their place.
This is giants battle and it is not a fact that most perfect creatures will
win (Ada is perfect but small). There are a lot of other things that
interfere this battle and can change it's result.
I desperately want Ada to win that battle but I see how many things it does
not have for that. A lot depends from the right approach taken by the Ada
Companies, in particular by ACT. Much less depends on Ada enthusiasts.
I have a feeling that many people think that it is enough just to be the
perfect language alone to win that battle but this is a greatest mistake
I've ever seen.
For most users the most decisive factor is availability of very easy to use
RAD tools based on "HOT" language to build their applications. A lot of them
are not professional programmers, rather occasional programmers.
Future will show who was right and who was wrong.
Anyway this topic is being well discussed in the thread "how to make Ada
more popular" but it is amazing that there are almost no comments from major
Ada companies as if this is not there concern.


>By the way, I appreciate that you may have more difficulty
>downloading from your location than some others.

As a matter of fact the easiest way to obtain up-to-date information in
Russia is download it from the Internet.
You won't find here books that are not "HOT" which you can find on US
market. Ada here is not "HOT" Only very limited number of people that know
what is Ada.




Regards,
Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.












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

* Re: Assembler in Ada?
  1999-01-25  0:00       ` robert_dewar
@ 1999-01-26  0:00         ` news.oxy.com
  1999-01-26  0:00           ` Larry Kilgallen
  1999-01-27  0:00           ` robert_dewar
  0 siblings, 2 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-26  0:00 UTC (permalink / raw)


I would like to stress once more that I did not have intention to go into
very deep details.
Idea was only to illustrate how to interpret Asm section of GNAT reference
manual and nothing more.
No doubt that any serious user will study all the deep implementation
details if there will be the need to use assembler within Ada program code
for any real working system.
For me it is much more convenient to use separate assembler file (xxx.s)
which can be compiled separately and would be linked to Ada program via it's
Ada interface package (xxx.ads) using Import pragma.


robert_dewar@my-dejanews.com wrote in message
<78iho6$4d3$1@nnrp1.dejanews.com>...
>In article <78hvth$m36$1@remarQ.com>,
>  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:


>> If anyone goes down to assembler level , he/she does this
>> to get direct access to processor registers and set of
>> operations that can be performed on them and machine
>> memory otherwise there is no need to go down to such low
>> level.
>
>You definitely need to read the GCC manual, I think you
>have missed the whole point of how this feature integrates
>with the RTL approach used in the backend of gcc. Yes, this
>is quite a complicated feature to understand and use, but
>also very powerful.

As a matter of fact my opinion was based on experience with Pascal for
PDP-11, DEC Assembler for PDP-11, DEC Modula-2, MASM, TASM, TopSpeed
Modula-2 (which was my favorite environments when I was working in Russia
manned space program -Mir, Souz e.t.c.), Microsoft C++ and Borland Delphi.
Most all of them (except DEC) are Intel based systems for use under
Microsoft OS (DOS, Window) so it was quite natural for me to use approaches
from that world.
If the GCC backend integration with RTL uses different approach this is
fine. If it is more universal and portable then no doubt it will be used
when needed.


Regards,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.












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

* Re: Assembler in Ada?
  1999-01-26  0:00         ` news.oxy.com
@ 1999-01-26  0:00           ` Larry Kilgallen
  1999-01-27  0:00             ` dewar
  1999-01-27  0:00           ` robert_dewar
  1 sibling, 1 reply; 24+ messages in thread
From: Larry Kilgallen @ 1999-01-26  0:00 UTC (permalink / raw)


In article <78kigc$8bj$1@remarQ.com>, "news.oxy.com" <Vladimir_Olensky@oxy.com> writes:
> I would like to stress once more that I did not have intention to go into
> very deep details.
> Idea was only to illustrate how to interpret Asm section of GNAT reference
> manual and nothing more.

I admit to not having read the manual under discussion, but how deep
can one go before diverging as the assembly languages for SPARC, Intel,
Alpha, PowerPC, etc. are all different.  I certainly would not want to
waste paper by printing pages devoted to a feature I will not use for
a processor I do not own.

To consider a processor I do own, the standard assembly language for
Alpha is slightly different for VMS than for DEC Unix.  I would hope
ACT concentrates on a language that is source-compatible across the
operating systems.  Any nominations ?

Larry Kilgallen




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

* Re: Assembler in Ada?
  1999-01-26  0:00         ` news.oxy.com
  1999-01-26  0:00           ` Larry Kilgallen
@ 1999-01-27  0:00           ` robert_dewar
  1 sibling, 0 replies; 24+ messages in thread
From: robert_dewar @ 1999-01-27  0:00 UTC (permalink / raw)


In article <78kigc$8bj$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
> I would like to stress once more that I did not have
> intention to go into very deep details.

That is of course reasonable, but my comment was even at
the level you chose to describe at, you made several very
definite and confusing mistakes. This is not easy stuff.
Wrong examples are worse than none!

For at least ONE accurate example, see the GNAT
documentation, and do very definitely get hold of the gcc
manual if you really want to use asm insertions.

Better still, try to avoid their use. They can almost
always be avoided.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-26  0:00           ` Larry Kilgallen
@ 1999-01-27  0:00             ` dewar
  0 siblings, 0 replies; 24+ messages in thread
From: dewar @ 1999-01-27  0:00 UTC (permalink / raw)


In article <1999Jan26.104457.1@eisner>,
  Kilgallen@eisner.decus.org.nospam wrote:
> To consider a processor I do own, the standard assembly
> language for Alpha is slightly different for VMS than for
> DEC Unix.  I would hope ACT concentrates on a language
> that is source-compatible across the
> operating systems.  Any nominations ?

That's a bit confused, probably from not knowing the
structure of how gcc works. gcc generates standard format
assembly language. This means that of course the assembly
language support is keyed to that assembler. This is a
fundamental requirement in the gcc context.

Yes, it would be nice if these divergences did not happen,
but gcc follows the standard even if it is non-standard :-)

I incidentally definitely agree on the issue of assembler
examples. The trouble is that examples can only be useful
if they use an assembly language the reader knows. For
example, Vladimir presents (slightly garbled) examples that
are in any case completely meaningless if you do not speak
ia32/unix style assembly language.

What would be nice here is really comprehensive
documentation for this feature across all possible
architectures, but I am afraid that

(a) this would be a giant tome

(b) no one is going to get around to writing it

(c) probably no one would read it either

In practice, the documentation that is available has proved
sufficient for a lot of people to successfully use this
feature, especially with a little bit of help from us or
others!

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-26  0:00         ` news.oxy.com
  1999-01-27  0:00           ` Samuel Tardieu
@ 1999-01-27  0:00           ` dewar
  1 sibling, 0 replies; 24+ messages in thread
From: dewar @ 1999-01-27  0:00 UTC (permalink / raw)


In article <78kev8$k1f$1@remarQ.com>,
  "news.oxy.com" <Vladimir_Olensky@oxy.com> wrote:
> I have the impression that there are a lot of users of
> GNAT that are not students but much more advanced users
> as well as people (in non military areas) that want to
> experiment with Ada and consider public releases of Ada
> as some initial stage in evaluating different aspects and
> approaches (including choice of compiler systems and
> tools) to the design of their systems (hard/soft). As
> result of such evaluation they may or may not choose
> Ada as their primary platform for system development. If
> they choose GNAT for that then they will buy commercial
> support from ACT for their development.

That may be true, but we discourage using the public
version for serious evaluation of GNAT or of Ada 95. That
is because a serious project will find that they can do a
much more successful evaluation if they use a fully
supported product for the evaluation. We encourage anyone
doing such an evaluation to contact sales@gnat.com or
sales@act-europe.fr to arrange for an evaluation contract.
Our experience is that this is by far the most effective
way to introduce the use of GNAT and Ada 95. The use of
unsupported software can be frustrating for anyone, and
indeed, it is often during the initial periods of trying
to use a new product that support is most needed.

> I think that ACT should do whatever possible to help
> making such decisions.

As above, we would definitely prefer that people seriously
evaluating Ada 95 use a supported product from us or from
one of our competitors for this purpose.

In the case of the particular issue at hand, the successful
and judicious use of assembler inserts, this is indeed an
area where it is useful to have help from gcc knowledgable
experts, and we have helped a small number of customers in
this area. Only a small number, because most customers of
ours completely avoid the use of assembly language.

We find that people trying to do this on their own often
make mistakes similar to those that Vladimir made in his
incorrect examples. In particular, understanding the
clobbers and volatile arguments is tricky. These are indeed
documented in the gcc manual, but unless you have a
reasonable understanding of the context of RTL, this
documentation may not be entirely clear.


> This is OK but future of Ada depends not only on the
> quality of the language itself and it's technical issues.
> If nothing extraordinary will be done to improve
> situation in the near future (easy to use RAD environment

<<more snipped>>

Many people have various ideas on how to make Ada succeed.
Useful thinking in this area needs a lot of experience in
how the market really works. Vladimir, I suggest you do a
thorough back search of the dejanews archives to see
discussions of this issue in the past.

The reason incidentally that you have been disappointed in
no one really wanting to discuss your ideas, and certainly
in the vendors not responding is that there is nothing new
in your ideas, and these ideas and many other ideas have
been discussed to death in the past!

Certainly we appreciate your enthusiasm for Ada. Are you by
the way in touch with Sergey Rybin, who is the principle
architect of AIS-for-GNAT, and lives in Moscow? Sounds like
it would be a good idea.

Figuring out cost-effective ways of spreading Ada is of
course important. Certainly we and other vendors spend a
lot of effort on this subject. It is a lot harder than you
might suppose, it is all too easy to spend lots of money
in this area and accomplish very little or even less than
nothing!

Robert Dewar
Ada Core Technologies

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Assembler in Ada?
  1999-01-27  0:00           ` Samuel Tardieu
@ 1999-01-27  0:00             ` news.oxy.com
  1999-01-27  0:00               ` Marin David Condic
  0 siblings, 1 reply; 24+ messages in thread
From: news.oxy.com @ 1999-01-27  0:00 UTC (permalink / raw)



Samuel Tardieu wrote in message <87btjku7qq.fsf@zaphod.enst.fr>...
>Vladimir> The other approach is to make several links from your
>Vladimir> site. Not only for students to get access to public version
>Vladimir> of GNAT but also for more advanced users so that they could
>Vladimir> spend less time finding specific information and Ada tools
>Vladimir> that they may need (as a matter of fact you already have
>Vladimir> links to a variety of Ada tools).  Anyway it is ACT decision
>Vladimir> how to address that issues.
>
>Why ACT decision? If you feel that some collections of links would be
>useful, why don't you setup one yourself and publicize the address? It
>will not take you more time than writing posts saying "We need it".


I can not do this simply because I am corporate Intranet user and our
Company Intranet is protected by the firewall from external world. So it is
closed for access from Internet. Only Company WEB Server is accessible
(www.oxy.com) that contain general Company info.
I think that almost all companies protect themselves in such way.

Just posting such kind of info does not make any sense. It will be once
read, and then you will never find it again (little exaggeration of course
but close to reality).  As a matter of fact I sent some useful links to
people that needed help (just look at the thread "double linked lists).
Another one was to the Adaptive Communication Environment (ACE) created by
Douglas C. Schmidt which is Associate Professor and Director of the Center
for Distributed Object Computing in the Department of Computer Science in
Washington University in Saint Louis
(http://siesta.cs.wustl.edu/~schmidt/ACE.html) . I would like see it to be
implemented in  Ada 95. There is need of some kind of ready to use universal
communication components.

The other thing comes to my mind also. Just imagine that Microsoft would
react the same way for [potential] users needs. Would it have such success?
Would it help to promote Microsoft products? Just look at the Microsoft WEB
. You will find links to huge amount of free, shareware and commercial
software written for MS-Windows. This is extremely convenient. They know
what they are doing and why.


Regards,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.







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

* Re: Assembler in Ada?
  1999-01-27  0:00             ` news.oxy.com
@ 1999-01-27  0:00               ` Marin David Condic
  1999-01-28  0:00                 ` news.oxy.com
  0 siblings, 1 reply; 24+ messages in thread
From: Marin David Condic @ 1999-01-27  0:00 UTC (permalink / raw)


news.oxy.com wrote:
> 
<snip>
> 
> The other thing comes to my mind also. Just imagine that Microsoft would
> react the same way for [potential] users needs. Would it have such success?
> Would it help to promote Microsoft products? Just look at the Microsoft WEB
> . You will find links to huge amount of free, shareware and commercial
> software written for MS-Windows. This is extremely convenient. They know
> what they are doing and why.
> 
This is a valid point. It really doesn't help a business to tell the
customer that they are "irrational" or that they are capable of handling
it themselves, if only they weren't so ignorant. What makes a business
successful is to look for ways to make the customer's lives easier. If a
customer is ignorant or irrational, find a way to work with that.
Chances are, you end up discovering that they have a point.

I remember hearing tell of a large discount retail chain that was so
dedicated to making the customer happy that they bragged about how they
once took a set of auto tires in on a return from a dissatisfied
customer. The chain didn't even sell auto tires! But the point was that
they send someone away smiling who had come in unhappy and that this
mentality makes for repeat business, etc. (The company in question was
also enormously successful in a financial sense as well, so it isn't a
case of being so "nice" that you give away the business...)

So what would be wrong with posting links to additional documentation in
the cs.nyu.edu website? For that matter, what would be wrong with
posting links to other gcc based compilers? All it can do is get people
more hooked on using the gcc based products. How can that be a bad thing
if your business is selling gcc based services?

MDC
-- 
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
Ph: 561.796.8997         Fx: 561.796.4669
***To reply, remove "bogon" from the domain name.***

    "Airplanes are interesting toys but of no military value."

        --  Marechal Ferdinand Foch, Professor of Strategy,
            Ecole Superieure de Guerre.




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

* Re: Assembler in Ada?
  1999-01-26  0:00         ` news.oxy.com
@ 1999-01-27  0:00           ` Samuel Tardieu
  1999-01-27  0:00             ` news.oxy.com
  1999-01-27  0:00           ` dewar
  1 sibling, 1 reply; 24+ messages in thread
From: Samuel Tardieu @ 1999-01-27  0:00 UTC (permalink / raw)


Vladimir> The other approach is to make several links from your
Vladimir> site. Not only for students to get access to public version
Vladimir> of GNAT but also for more advanced users so that they could
Vladimir> spend less time finding specific information and Ada tools
Vladimir> that they may need (as a matter of fact you already have
Vladimir> links to a variety of Ada tools).  Anyway it is ACT decision
Vladimir> how to address that issues.

Why ACT decision? If you feel that some collections of links would be
useful, why don't you setup one yourself and publicize the address? It 
will not take you more time than writing posts saying "We need it".

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




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

* Re: Assembler in Ada?
  1999-01-27  0:00               ` Marin David Condic
@ 1999-01-28  0:00                 ` news.oxy.com
  0 siblings, 0 replies; 24+ messages in thread
From: news.oxy.com @ 1999-01-28  0:00 UTC (permalink / raw)



Marin David Condic wrote in message <36AF5601.E571D844@pwfl.com>...
>news.oxy.com wrote:
>>


Thanks for support!

Probably one of the problems is that writing good compiler systems and
working with data structures is quite different than working with the needs
of the [potential/future] users and analyzing market/financial prospective
and demands.


Regards,

Vladimir Olensky
(vladimir_olensky@yahoo.com)
(Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.







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

end of thread, other threads:[~1999-01-28  0:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-13  0:00 Assembler in Ada? Thomas Larsson
1999-01-13  0:00 ` Matthew Heaney
1999-01-14  0:00   ` Bill Ghrist
     [not found]     ` <369ED5E0.DB29E68C@usc.edu>
1999-01-15  0:00       ` Will this help? (Re: " Bill Ghrist
1999-01-22  0:00 ` news.oxy.com
1999-01-24  0:00   ` dewar
1999-01-25  0:00     ` news.oxy.com
1999-01-25  0:00       ` robert_dewar
1999-01-26  0:00         ` news.oxy.com
1999-01-26  0:00           ` Larry Kilgallen
1999-01-27  0:00             ` dewar
1999-01-27  0:00           ` robert_dewar
1999-01-25  0:00       ` robert_dewar
1999-01-24  0:00   ` dewar
1999-01-25  0:00     ` news.oxy.com
1999-01-25  0:00       ` Richard Kenner
1999-01-25  0:00         ` news.oxy.com
1999-01-25  0:00       ` robert_dewar
1999-01-26  0:00         ` news.oxy.com
1999-01-27  0:00           ` Samuel Tardieu
1999-01-27  0:00             ` news.oxy.com
1999-01-27  0:00               ` Marin David Condic
1999-01-28  0:00                 ` news.oxy.com
1999-01-27  0:00           ` dewar

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