From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7c65ca5609a07b8c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-21 12:24:46 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!nnx.oleane.net!oleane!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Carroll-Tech" Newsgroups: comp.lang.ada Subject: Hardware Interrupts Date: Sat, 21 Feb 2004 13:39:40 -0700 Organization: Cuivre, Argent, Or Message-ID: References: <20040221110026.E93C54C40C5@lovelace.ada-france.org> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1077394969 29129 212.85.156.195 (21 Feb 2004 20:22:49 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 21 Feb 2004 20:22:49 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:5710 Date: 2004-02-21T13:39:40-07:00 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).