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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ecc058d81d1613b5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.78.70 with SMTP id z6mr9350266paw.5.1357489451464; Sun, 06 Jan 2013 08:24:11 -0800 (PST) From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Help on record to a Newbie Date: Sun, 30 Dec 2012 18:03:07 +0200 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 X-Trace: individual.net gTOh0ik503lNFCHivXPDrgQEzB7QyGs+QmUb9QfVTxqonxqRjmTPDTcR0UUDDZ+DcD Cancel-Lock: sha1:yKssR+igH/OvqhF4RwfdQ/ZIeUQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: Path: s9ni88842pbb.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.mccarragher.com!news.mccarragher.com!news.grnet.gr!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-12-30T18:03:07+02:00 List-Id: On 12-12-28 13:52 , Cedric wrote: > I hope that my questions do not rise a flame war. I think everyone > should write his/her programs as they like. Sure. Except if they are part of a programming team that must share code. The point of that discussion was, IMO, to show you that perhaps you don't need to use a prefix in Ada, just to separate names in one module from names in other modules (as you often must do in C, for example). > The comments with "register" in it were meant to define variables > that can access processor registers. As I learnt last night, this is > normally not needed when using Ada. I would still be interested to know what you want to do, that requires access to processor registers in some other language. Of course, in assembly language one uses registers all the time, but one of the points of higher languages is to avoid that. In some processors, one accesses "special function registers" or "device registers" to do input/output on a HW level. To a program, such registers are just memory locations (addresses) with some special semantics attached. In Ada, as in other languages, one only needs to tell the compiler or linker to use a certain memory address for a certain variable, and then mark that variable as "volatile" to make sure that the compiled code actually accesses memory. (Sometimes it is necessary to worry about the "width" of the memory access, too, but then it usually best to fall back to assembly language for these small parts of the program.) > I try to find a solution with the Ada way. If you tell us what you want to do, we can help you find an Ada solution. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .