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.3 required=5.0 tests=BAYES_00,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: g2news1.google.com!news3.google.com!feeder.news-service.com!news.mixmin.net!news.ett.com.ua!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Sun, 13 Feb 2011 01:04:07 +0000 (UTC) Organization: ETT newsserver Message-ID: References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> Reply-To: anon@anon.org NNTP-Posting-Host: dialup-4.225.168.99.dial1.dallas1.level3.net X-Complaints-To: usenet@news.ett.com.ua X-Notice: Filtered by postfilter v. 0.6.1 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news1.google.com comp.lang.ada:17266 Date: 2011-02-13T01:04:07+00:00 List-Id: I have watch a number of people showing ways of using the representation clause's "attribute_definition_clause" or the "at_clause" to define a memory location. But they forget to say that aome OSs may restrict or reject access to real memory even the video memory. The main problem in using this type of programming is that most OSs used today protects their real memory. And also some OSs use framebuffers for video memory. So, you may need to alter your code to create a Ada device driver server program for your video needs with the main program being a client that links to this server to send data to the video. That way you can have both the privilege to write to the video memory and/or to correctly access the right framebuffer. In <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com>, Syntax Issues writes: >I am planning to start learning lower-level programming with ada, >however, I was unable to find a solid tutorial on writing directly to >a memory address or interfacing with assembly. Does anyone know where >I can find a reference to some tutorials/information? Below is an >example of code I would like to be able to implement. > >.... >unsigned int print(char *message, unsigned int line) >{ > char *vidmem = (char *) 0xb8000; > unsigned int i= 0; > > i=(line*80*2); > > while(*message!=0) // 24h > { > vidmem[i]= *message; > *message++; > i++; > vidmem[i]= 0x7; > i++; > }; > > return(1); >}; >.... > >