comp.lang.ada
 help / color / mirror / Atom feed
* Re: How to use Assembly in Ada
  1999-02-19  0:00 How to use Assembly in Ada Josh Highley
  1999-02-19  0:00 ` How do I use Assembly from Ada? Josh Highley
  1999-02-19  0:00 ` How to use Assembly in Ada Josh Highley
@ 1999-02-19  0:00 ` steve quinlan
  1999-02-20  0:00 ` Jerry van Dijk
  3 siblings, 0 replies; 5+ messages in thread
From: steve quinlan @ 1999-02-19  0:00 UTC (permalink / raw)


I think something like this will work :

You define an Ada procedure or function with the parameters defined which
you want to pass to/from the assembler routine.

You would have a pragma import (Assembler, Ada_name, "link_name");
 link_name is optional if the assembler entry point name is the same as the
Ada name. But it might have to have a period or something. Sometimes pragma
import (C ..)  works just as well for assembler code.

You need to know the passing conventions of the compiler -- what registers
does it pass those parameters in? Vendors are supposed to document their
calling conventions, but I don't know where it would be in the GNAT
documentation. You can compile some sample calls with the option to get
assembler listings and check how they do it. Then, you write your assembler
routines to access/return values in the registers which the compiler has
used for the parameters of interest.

Now, assemble your assembler routine, compile the Ada,  passing the object
file generated by the assembler to the linker when you link the Ada program
and -- Voila'.







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

* Re: How to use Assembly in Ada
  1999-02-19  0:00 How to use Assembly in Ada Josh Highley
  1999-02-19  0:00 ` How do I use Assembly from Ada? Josh Highley
@ 1999-02-19  0:00 ` Josh Highley
  1999-02-19  0:00 ` steve quinlan
  1999-02-20  0:00 ` Jerry van Dijk
  3 siblings, 0 replies; 5+ messages in thread
From: Josh Highley @ 1999-02-19  0:00 UTC (permalink / raw)


I should clarify that I already know Assembly, I just need to know how 
to access assembly code from Ada.

Thanks,

Josh Highley
joshhighley@hotmail.com





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

* How to use Assembly in Ada
@ 1999-02-19  0:00 Josh Highley
  1999-02-19  0:00 ` How do I use Assembly from Ada? Josh Highley
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Josh Highley @ 1999-02-19  0:00 UTC (permalink / raw)


   To put it simply, I want to use assembly code to position the cursor 
at a certain row and column.  I'd like to pass the row and column 
parameters to the assembly code from an Ada program.  From what I've 
read, I'll need to use pragmas.  However, I've checked the ARM but I 
couldn't get much useful info from it.  If anyone knows of some short 
and sweet examples or a source with a good explanation of what I need to 
do, then I would be forever grateful.

I using GNAT 3.10, AdaGIDE 6.18, and Win95 but my program is for good 
ol' DOS.

Thanks, 

Josh Highley
joshhighley@hotmail.com
http://angelfire.com/mo/joshhighley





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

* How do I use Assembly from Ada?
  1999-02-19  0:00 How to use Assembly in Ada Josh Highley
@ 1999-02-19  0:00 ` Josh Highley
  1999-02-19  0:00 ` How to use Assembly in Ada Josh Highley
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Josh Highley @ 1999-02-19  0:00 UTC (permalink / raw)


   To put it simply, I want to use assembly code to position the cursor 
at a certain row and column.  I'd like to pass the row and column 
parameters to the assembly code from an Ada program.  I already know 
assembly code and, from what I've read, I'll need to use pragmas in Ada. 
However, I've checked the ARM but I couldn't get much useful info from 
it.  If anyone knows of some short and sweet examples or a source with a 
good explanation of what I need to do, then I would be forever grateful.

I'm using GNAT 3.10, AdaGIDE 6.18, and Win95 but my program is for good 
ol' DOS.

Thanks, 

Josh Highley
joshhighley@hotmail.com
http://angelfire.com/mo/joshhighley





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

* Re: How to use Assembly in Ada
  1999-02-19  0:00 How to use Assembly in Ada Josh Highley
                   ` (2 preceding siblings ...)
  1999-02-19  0:00 ` steve quinlan
@ 1999-02-20  0:00 ` Jerry van Dijk
  3 siblings, 0 replies; 5+ messages in thread
From: Jerry van Dijk @ 1999-02-20  0:00 UTC (permalink / raw)


Josh Highley (joshhighley@hotmail.com) wrote:

: I using GNAT 3.10, AdaGIDE 6.18, and Win95 but my program is for good 
: ol' DOS.

It looks like you are confusing things here.

If you are using AdaGIDE with GNAT 3.10 on Win95 you are most likely
using the Win95 compiler. This compiler will not generate DOS code.
Unless:
a) you mean your programs are meant for the console instead of a GUI or
b) you installed the djgpp port of GNAT and use that in conjunction with
   with AdaGIDE.
In any case, the DOS assembly code is 16-bit, while GNAT is 32-bit (also
the DOS version, which is DPMI based).

If your problem is using the console:
a) Win32 -> use my NT_Console package (homepage, old site)
b) DOS   -> use my conio_02 package (standard with EZ2LOAD)

If your assembly code is 32-bit DPMI code and you are using the DOS
compiler, check the DJGPP information on how to use it.
If your assembly code is 16-bit DOS, first study how to use it in
a 32-bit protected mode environment.

If your assembly code is 32-but Win32 code, give us an example, so we
can help.

Jerry.

--
-- Jerry van Dijk | Leiden, Holland
-- Team Ada       | jdijk@acm.org
-- see http://stad.dsl.nl/~jvandyk




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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-19  0:00 How to use Assembly in Ada Josh Highley
1999-02-19  0:00 ` How do I use Assembly from Ada? Josh Highley
1999-02-19  0:00 ` How to use Assembly in Ada Josh Highley
1999-02-19  0:00 ` steve quinlan
1999-02-20  0:00 ` Jerry van Dijk

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