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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3cfb384718eb4f7a X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: question re Ada equivalent of C function Date: 1998/02/21 Message-ID: #1/1 X-Deja-AN: 327336976 References: <34EEFF9C.1D01FA5D@stellar1.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: 888092480 6708 bpr 206.184.139.132 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-02-21T00:00:00+00:00 List-Id: On Sat, 21 Feb 1998, David Fisher wrote: > Sorry if this is a bit basic, but learning Ada on one's own can be, er, > challenging. You're never alone on comp.lang.ada! :-) > What are the Ada equivalents of the C functions, inp and outp, used to > read a byte from or send one to a memory address? Well, that depends. If you just want to reuse some C routines, I'd suggest that you use Interfaces.C and just reuse them. Otherwise, you'll want to look at the System and System.Storage_Elements packages for what you want. If you want to access a Character at some memory address, say 16#CAFEBABE#, you'd do something like this (boilerplate omitted) ... Mem_Addr : constant Address := To_Address(16#CAFEBABE#); Mem_Mapped_Char : Character; for Mem_Mapped_Char'Address use Mem_Addr; ... which is surprisingly self-explanatory. -- Brian