Hardware Interrupts

From: Carroll-Tech (andrew_at_carroll-tech.net)
Date: 02/21/04


Date: Sat, 21 Feb 2004 13:39:40 -0700
To: <comp.lang.ada@ada-france.org>

Has anyone here read "Ada Concurrent Programming" by Narain Gehani?
In the book, Narain talks about address clauses. For example:

task Interrupt_handler is
    entry DONE;
    for DONE use at 16#40#;
end Interrupt_handler;

Can an address clause be done with a procedure or function instead of a
task entry?
What about arguments?
How can I capture a return value, if there is one?

I want to call the BIOS interrupt (INT11h) to get the equipment list
word. In my Assembly book it says that INT11h "returns" a word
containing the equipment list. I'm assuming that a '1' at a given bit
within the word means the equipment is in the computer and '0' is not.

Here is my code so far
-------------------------------------------------------
with ada.text_io; use ada.text_io;
with system.interrupts; use system.interrupts;

procedure getequipment is
 type equiplist is array(0..15) of boolean;
 package boolean_io is new enumeration_io(boolean);
 procedure getlist(list: out equiplist);
 for getlist use at reference(16#11#);
 mylist: equiplist;

begin
 getlist(mylist);

-- for I in 0..15 loop
-- boolean_io.put(mylist(i));
-- end loop;
end getequipment;
------------------------------------------------------

When I compile this code the compiler says several things
that I do not know how to fix.

getequipment.adb:2:12: warning: "system.interrupts" is an internal GNAT unit
getequipment.adb:2:12: warning: use of this unit is non-portable and
version-dependent
getequipment.adb:7:09: missing body for "getlist"
getequipment.adb:8:13: address clause can only be given for imported
subprogram

Any ideas?

Maybe there is an easier way to call INT11h from Ada?
I looked into System.Machine_Code and the ASM procedure but that seems
pretty
complex (per GNAT reference manual explanation).



Relevant Pages

  • Re: File declarations in the Environment and Data division
    ... ENVIRONMENT DIVISION. ... SELECT FileA ASSIGN "FileA.dat" ... I'm assuming the fact that the "FileA" in the SELECT clause of the ... entry in the FILE section is significant (as opposed to ...
    (comp.lang.cobol)
  • Re: SAME AS (02 Standard) Clause - and circulatiy
    ... SRof the SAME AS clause says, ... "The description of data-name-1, including its subordinate data items, ... entry or any group item to which this entry is subordinate." ... specific could then refer to the "Circular Reference" warning.) ...
    (comp.lang.cobol)
  • Re: Creating a dialogBox dynamically...
    ... One could also argue that, in many cases, an END-~ clause and _nothing_ ... """In some cases the delimited scope statement with which an explicit ... The ENTRY statement is not a label and thus does not terminate the ... UnicodeText section, ...
    (comp.lang.cobol)
  • Full text search and Nullable column in query
    ... find matching rows for the TEXT clause, and then go through the NUMBER ... entries of these rows to extract those satisfying the NUMBER clause. ... the NUMBER entry is null, and only a few where the NUMBER entry is not ... that is not a standard SQL database concept. ...
    (comp.databases)
  • Re: Right justifying (arbitrary) alphanumeric input
    ... data description entry that contains format 2 of the OCCURS clause may only ... the definition of the COBOL character set on page III-3 includes the ... definition nor the redefinition shall include a variable-occurrence data ...
    (comp.lang.cobol)