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=0.7 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: mockturtle Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Thu, 3 Feb 2011 00:08:50 -0800 (PST) Organization: http://groups.google.com Message-ID: Reply-To: comp.lang.ada@googlegroups.com NNTP-Posting-Host: 158.110.27.77 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1296720531 14347 127.0.0.1 (3 Feb 2011 08:08:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 Feb 2011 08:08:51 +0000 (UTC) In-Reply-To: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=158.110.27.77; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 User-Agent: G2/1.0 Xref: g2news2.google.com comp.lang.ada:17807 Date: 2011-02-03T00:08:50-08:00 List-Id: > Below is an > example of code I would like to be able to implement. >=20 > ... > unsigned int print(char *message, unsigned int line) > { > char *vidmem =3D (char *) 0xb8000; > unsigned int i=3D 0; > I do not have any experience about this part of Ada, but maybe I can give y= ou a "pointer" to some bootstrapping information. Maybe you could want to = use an attribute representation clause for Vidmem'Address (see Section 13.= 3 of the RM) . With some improvisation, I would write something like=20 type Vidmem_Array is array (natural range <>) of Character; Vidmem : Vidmem_Array (0 .. Max_Size); for Vidmem'Address use 16#000B_8000#; Note that with this approach you need to know the maximum size of your "bu= ffer". Otherwise, you could go through System.Address (see 13.7 and follow= ing of the RM). As disclaimed above, I am not an expert on this, so maybe someone could wan= t to integrate/correct/whatever the information above. =20 =20 > i=3D(line*80*2); >=20 > while(*message!=3D0) // 24h > { > vidmem[i]=3D *message; > *message++; > i++; > vidmem[i]=3D 0x7; > i++; > }; >=20 > return(1); > }; > ...