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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,971b114e178846f7,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Rolf" Newsgroups: comp.lang.ada Subject: Named Address Spaces Date: 20 Sep 2005 08:46:29 -0700 Organization: http://groups.google.com Message-ID: <1127231189.761731.126800@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 194.97.67.1 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1127231195 25064 127.0.0.1 (20 Sep 2005 15:46:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 20 Sep 2005 15:46:35 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10) Gecko/20050717 Firefox/1.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=194.97.67.1; posting-account=X6JcNAwAAACCYFUClJvh1OjD0lgttvkm Xref: g2news1.google.com comp.lang.ada:4955 Date: 2005-09-20T08:46:29-07:00 List-Id: Some embedded processors have separate address spaces, like IO, EEPROM, FLASH, ROM, RAM, external memory. Accessing variables in the different address spaces requires special assembler instructions for these processors. The AVR processors for example have special instructions for reading and writing IO ports and for reading flash memory they transfer byte by byte to a special register. Obviously the compiler has to know about these special instructions. I am more concerned about the programmer visible implications of separate address spaces. It is still the programmer's responsibility to decide where to place a variable, e.g. EEPROM or flash. To my knowledge, the language has no construct to specifiy a segment where to place a variable. GNAT has a pragma Linker_Section that helps placing a variable into a special section, but that is not standard to my knowledge (and then GNAT does not know that special sections must be accessed differently, but that is a different issue.) Flash_String : constant String := "I live in read only memory"; pragma Linker_Section (".progmem"); How do other compilers approach that problem? As Ada has many constructs that help for embedded systems, is there a standard way for placing variables and constants into specific separate address spaces? Rolf