comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: How do you make sounds with ADA95?
Date: 1999/06/27
Date: 1999-06-27T00:00:00+00:00	[thread overview]
Message-ID: <19990627192043.05875.00001743@ngol05.aol.com> (raw)
In-Reply-To: 7l659n$94h$1@news.fsu.edu

grant@cs.fsu.edu (Joshua Grant) writes:
> The old program loaded packages "PORT" and 
> "BIT_OPS".  Has anyone heard of these?
     Yes!  They were part of Meridian Open Ada, and their specifications were
as follows:

package Port is
   function  In_Word (Port_Number : Integer)
      return Integer;
   function  In_Byte (Port_Number : Integer)
      return Integer;
   procedure Out_Word (
       Port_Number : Integer;
       Data        : Integer);
   procedure Out_Byte (
       Port_Number : Integer;
       Data        : Integer);
end Port;

package Bit_Ops is
  --
  -- Operations on type Byte_Integer (eight bits):
  --
  function "and"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "or"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "xor"(Left, Right: Byte_Integer)
    return Byte_Integer;
  function "not"(Left: Byte_Integer)
    return Byte_Integer;
  function Shl(Left: Byte_Integer; Right: Byte_Integer)
    return Byte_Integer;
  function Shr(Left: Byte_Integer; Right: Byte_Integer)
    return Byte_Integer;
  --
  -- Operations on type Integer (sixteen bits):
  --
  function "and"(Left, Right: Integer)
    return Integer;
  function "or"(Left, Right: Integer)
    return Integer;
  function "xor"(Left, Right: Integer)
    return Integer;
  function "not"(Left: Integer)
    return Integer;
  function Shl(Left: Integer; Right: Integer)
    return Integer;
  function Shr(Left: Integer; Right: Integer)
    return Integer;
  --
  -- Operations on type Long_Integer (thirty-two bits):
  --
  function "and"(Left, Right: Long_Integer)
    return Long_Integer;
  function "or"(Left, Right: Long_Integer)
    return Long_Integer;
  function "xor"(Left, Right: Long_Integer)
    return Long_Integer;
  function "not"(Left: Long_Integer)
    return Long_Integer;
  function Shl(Left: Long_Integer; Right: Integer)
    return Long_Integer;
  function Shr(Left: Long_Integer; Right: Integer)
    return Long_Integer;
end;

     Naturally, with Ada 95, Modular Types should make Bit_Ops unnecessary. 
The subprograms in Port, as you can see, are similar to the Inp function and
the Out command in Basic.
- John Herro
You can download a shareware AdaTutor program at
http://members.aol.com/AdaTutor




  reply	other threads:[~1999-06-27  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-27  0:00 How do you make sounds with ADA95? Joshua Grant
1999-06-27  0:00 ` John Herro [this message]
1999-06-28  0:00 ` Stephen Leake
1999-06-28  0:00   ` Bruce or Tracy
1999-06-29  0:00 ` tmoran
1999-06-29  0:00   ` Martin C. Carlisle
  -- strict thread matches above, loose matches on Subject: below --
1999-06-29  0:00 Joshua Grant
1999-06-29  0:00 ` Gautier
1999-06-29  0:00 ` tmoran
1999-07-01  0:00   ` Ed Falis
1999-07-02  0:00     ` Tom Moran
1999-07-02  0:00       ` Ed Falis
replies disabled

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