comp.lang.ada
 help / color / mirror / Atom feed
* Low_Level_IO, what is it?
@ 2012-06-03 15:04 heresy-me
       [not found] ` <c42ns75dn57ma9o2mr4mfealkn93d656g0@invalid.netcom.com>
  2012-06-04 11:55 ` anon
  0 siblings, 2 replies; 5+ messages in thread
From: heresy-me @ 2012-06-03 15:04 UTC (permalink / raw)


Low_Level_IO, a Ada package name that I saw in some older Ada book.But
I cannot found it in Ada12 Reference.
What is Low_Level_IO?



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

* Re: Low_Level_IO, what is it?
       [not found] ` <c42ns75dn57ma9o2mr4mfealkn93d656g0@invalid.netcom.com>
@ 2012-06-04  5:29   ` Yannick Duchêne (Hibou57)
  2012-06-06 23:20     ` Randy Brukardt
  2012-06-07  0:08     ` Adam Beneschan
  0 siblings, 2 replies; 5+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-06-04  5:29 UTC (permalink / raw)


Le Sun, 03 Jun 2012 17:59:59 +0200, Dennis Lee Bieber  
<wlfraed@ix.netcom.com> a écrit:

> On Sun, 3 Jun 2012 08:04:05 -0700 (PDT), heresy-me@hotmail.com declaimed
> the following in comp.lang.ada:
>
>> Low_Level_IO, a Ada package name that I saw in some older Ada book.But
>> I cannot found it in Ada12 Reference.
>> What is Low_Level_IO?
>
> 	Most likely a description of an "idealized" interface to machine
> specific I/O operations, intended for use in an pure Ada run-time --
> instead of the more common POSIX/C run-time bindings (as used by GNAT)
> on top of a full OS.
>
> 	Ah, yes... Ada 83
> http://archive.adaic.com/docs/style-guide/83style/html/sty-07-07.html#7.7.4


A further link gives its incomplete definition:

    package LOW_LEVEL_IO is
       --  declarations of the possible types for DEVICE and DATA;
       --  declarations of overloaded procedures for these types:
       procedure SEND_CONTROL    (DEVICE : device_type; DATA : in out  
data_type);
       procedure RECEIVE_CONTROL (DEVICE : device_type; DATA : in out  
data_type);
    end;

Also, the casing is funny.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



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

* Re: Low_Level_IO, what is it?
  2012-06-03 15:04 Low_Level_IO, what is it? heresy-me
       [not found] ` <c42ns75dn57ma9o2mr4mfealkn93d656g0@invalid.netcom.com>
@ 2012-06-04 11:55 ` anon
  1 sibling, 0 replies; 5+ messages in thread
From: anon @ 2012-06-04 11:55 UTC (permalink / raw)


The Low_Level_IO (Ada 83) package was Ada to device package that was 
removed in "Ada 95" for a number of reason. One is that very few Ada's 
used the package because it is easier to use existing libraries for 
most I/O and just bind that routine to Ada. This was due perhaps because 
most Ada's in the 1980's and even today are not design for barebone 
operations. So, today most programmers just use In-line assembly to 
access Low_Level_IO devices.

A barebone version of "Send_Control" routine for Low_Level_IO could be 
easy as 

  procedure SEND_CONTROL ( DEVICE : device_type; DATA : in out data_type ) ;
    begin
      if DEVICE = KEYBOARD then
        ... -- output data to keyboard
      elsif DEVICE = VIDEO then
        ... --  output data to video
      elsif DEVICE = DISK then
        ... --  output data to disk
      elsif DEVICE = UART then
        ... --  output data to uart
      elsif DEVICE = ...  then
        ... --  output data to ...
      else
        raise IO_Error ; -- or some other exception
      end if ;
    end SEND_CONTROL ;


And a simple of "Send_Control" routine for Low_Level_IO or OS could look 
something like 

  procedure SEND_CONTROL ( DEVICE : device_type; DATA : in out data_type ) ;
    begin
      if DEVICE = KEYBOARD then
        ... --  get access rights to keyboard
        ... --  call OS library to output data to keyboard
      elsif DEVICE = VIDEO then
        ... --  get access rights to video
        ... --  call OS, library to output data to video
      elsif DEVICE = DISK then
        ... --  get access rights to disk
        ... --  call OS library to output data to disk
      elsif DEVICE = UART then
        ... --  get access rights to uart
        ... --  call OS library to output data to uart
      elsif DEVICE = ...  then
        ... --  get access rights to ...
        ... --  call OS library to output data to ...
      else
        raise IO_Error ; -- or some other exception
      end if ;
      ... --  release access rights to device
    exception
                  -- handle routine for access rights not granted
      when Denied_Error =>
          ...
    end SEND_CONTROL ;



In <ddadb84d-e42c-490f-932d-dd4b5eb81708@h10g2000pbi.googlegroups.com>, heresy-me@hotmail.com writes:
>Low_Level_IO, a Ada package name that I saw in some older Ada book.But
>I cannot found it in Ada12 Reference.
>What is Low_Level_IO?




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

* Re: Low_Level_IO, what is it?
  2012-06-04  5:29   ` Yannick Duchêne (Hibou57)
@ 2012-06-06 23:20     ` Randy Brukardt
  2012-06-07  0:08     ` Adam Beneschan
  1 sibling, 0 replies; 5+ messages in thread
From: Randy Brukardt @ 2012-06-06 23:20 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

"Yannick Duch�ne (Hibou57)" <yannick_duchene@yahoo.fr> wrote in message 
news:op.wfc5jfaaule2fv@douda-yannick...
>Le Sun, 03 Jun 2012 17:59:59 +0200, Dennis Lee Bieber 
><wlfraed@ix.netcom.com> a �crit:
>
>> On Sun, 3 Jun 2012 08:04:05 -0700 (PDT), heresy-me@hotmail.com declaimed
>> the following in comp.lang.ada:
>>
>>> Low_Level_IO, a Ada package name that I saw in some older Ada book.But
>>> I cannot found it in Ada12 Reference.
>>> What is Low_Level_IO?
>>
>> Most likely a description of an "idealized" interface to machine
>> specific I/O operations, intended for use in an pure Ada run-time --
>> instead of the more common POSIX/C run-time bindings (as used by GNAT)
>> on top of a full OS.
>>
>> Ah, yes... Ada 83
>> http://archive.adaic.com/docs/style-guide/83style/html/sty-07-07.html#7.7.4
>
>
>A further link gives its incomplete definition:
>
>    package LOW_LEVEL_IO is
>       --  declarations of the possible types for DEVICE and DATA;
>       --  declarations of overloaded procedures for these types:
>       procedure SEND_CONTROL    (DEVICE : device_type; DATA : in out 
> data_type);
>       procedure RECEIVE_CONTROL (DEVICE : device_type; DATA : in out 
> data_type);
>    end;
>
>Also, the casing is funny.

Haw, nothing funny about this; that's the "standard" way of writing Ada 83 
code. Large amounts of original Ada 83 code was written in this style. It 
was so ugly that the "standard" casing was changed in Ada 95. (Before that, 
most of us invented our own styles, so it was a real mess to integrate 
someone else's code.)

As far a Low_Level_IO itself, the package was always optional in Ada 83, and 
there was hardly anyone who ever implemented it (we had packages of our own 
design for this purpose, they were much closer to the Intel instruction 
set). So it was removed from Ada 95.

                                      Randy.









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

* Re: Low_Level_IO, what is it?
  2012-06-04  5:29   ` Yannick Duchêne (Hibou57)
  2012-06-06 23:20     ` Randy Brukardt
@ 2012-06-07  0:08     ` Adam Beneschan
  1 sibling, 0 replies; 5+ messages in thread
From: Adam Beneschan @ 2012-06-07  0:08 UTC (permalink / raw)


On Sunday, June 3, 2012 10:29:29 PM UTC-7, Hibou57 (Yannick Duchêne) wrote:

> A further link gives its incomplete definition:
> 
>     package LOW_LEVEL_IO is
>        --  declarations of the possible types for DEVICE and DATA;
>        --  declarations of overloaded procedures for these types:
>        procedure SEND_CONTROL    (DEVICE : device_type; DATA : in out  
> data_type);
>        procedure RECEIVE_CONTROL (DEVICE : device_type; DATA : in out  
> data_type);
>     end;
> 
> Also, the casing is funny.

As Randy explained, using upper-case letters for identifiers and lower-case for keywords was standard back in Ada 83.  A further point: The names "device_type" and "data_type" are supposed to be in italics.  The linked that you followed didn't show them that way, but they're italicized in the printed Ada 83 standard.  These are not the exact names that are supposed to be used---the implementor is supposed to provide their own names for these types.  Maybe that's another reason why you thought the casing was funny.

                             -- Adam





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

end of thread, other threads:[~2012-06-07  0:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-03 15:04 Low_Level_IO, what is it? heresy-me
     [not found] ` <c42ns75dn57ma9o2mr4mfealkn93d656g0@invalid.netcom.com>
2012-06-04  5:29   ` Yannick Duchêne (Hibou57)
2012-06-06 23:20     ` Randy Brukardt
2012-06-07  0:08     ` Adam Beneschan
2012-06-04 11:55 ` anon

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