comp.lang.ada
 help / color / mirror / Atom feed
* porting from Meridian Ada to Gnat
@ 1996-07-11  0:00 DRW HOLTON
  1996-07-12  0:00 ` Jerry van Dijk
  0 siblings, 1 reply; 2+ messages in thread
From: DRW HOLTON @ 1996-07-11  0:00 UTC (permalink / raw)



I'm porting a DOS program from Meridian Open Ada (ver. 4.1.4) to Gnat
and have come up against a minor problem. The program uses the Port
package from the DOS Environment Library to access the 80x86 I/O
ports. For example the specification of the in_bye function is:

	function in_word (port_number : integer) return integer;

I would like re-write this package for Gnat (unless someone has
already done so, in which case please let me know!), which should be
really simple since there is a close correspondence between the
subprograms in the package and 80x86 assembly language instructions
(e.g. in_word is just a variant of the IN instruction). However I
don't know how best to go about doing this - should I write small
assembly language (or even C) modules and import them? Can I inline
the assembly language directly in the Ada package? I would prefer the
latter option since it is more self contained, but don't know how to
do it or even if it is possible. (In case it's important, I'm using
the ez2load distribution of gnat 3.05.)

I'd be grateful for any pointers or help. Please cc me any answers
since news isn't always reliable here.

TIA,

	Rob




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

* Re: porting from Meridian Ada to Gnat
  1996-07-11  0:00 porting from Meridian Ada to Gnat DRW HOLTON
@ 1996-07-12  0:00 ` Jerry van Dijk
  0 siblings, 0 replies; 2+ messages in thread
From: Jerry van Dijk @ 1996-07-12  0:00 UTC (permalink / raw)



van Dijk, you moron, why can't you pay attention:

>	   return Integer (Inport_Word (Integer (Port_Number)));

should, of course, be:

return Integer (Inport_Word 
  (Unsigned_16 (Unsigned_32 (Port_Number) And 16#FF#)));

-- 
-----------------------------------------------------------------------
--  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
--  Banking Consultant   --              Member Team-Ada             -- 
--  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --
-- 
-----------------------------------------------------------------------
--  Jerry van Dijk       --   e-mail: jerry@jvdsys.nextjk.stuyts.nl  --
--  Banking Consultant   --              Member Team-Ada             -- 
--  Ordina Finance BV    --    Located at Haarlem, The Netherlands   --




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

end of thread, other threads:[~1996-07-12  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-11  0:00 porting from Meridian Ada to Gnat DRW HOLTON
1996-07-12  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