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=2.1 required=5.0 tests=BAYES_05,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b4f26c164c846938 X-Google-Attributes: gid103376,public From: "DuckE" Subject: Re: VIDEO MEMORY ACCESS WITH POINTERS Date: 1999/11/27 Message-ID: <38409762.0@news.pacifier.com>#1/1 X-Deja-AN: 553930931 References: <81p3sh$h2m$1@news.colba.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: 27 Nov 1999 18:45:54 PST, 216.65.140.154 X-MSMail-Priority: Normal Reply-To: "DuckE" Newsgroups: comp.lang.ada Date: 1999-11-27T00:00:00+00:00 List-Id: It has been a long time since I've had to address video memory, or used a system in which you could directly access video memory. But if you can do it with C or Pascal, then this is probably the method you'd use for Ada: with system.storage_elements; procedure video_memory_example is max_video_memory : constant := 16#2000#; type video_cell is mod 2**16; type video_memory_type is array( 1 .. max_video_memory ) of video_cell; video_memory : video_memory_type; for video_memory'address use ystem.storage_elements.to_address( 16#b8000000# ); pragma volatile( video_memory ); begin video_memory( 1 ) := 16#4141#; end video_memory_example; In Ada it is convenient to make the range of memory appear as an array that is fixed at an absolute address. When you reference elements in the array, you are referencing that memory. I hope this helps, SteveD ??? wrote in message news:81p3sh$h2m$1@news.colba.net... > Simple problem: I want to able to read and write directly into the video > memory using Ada code. Ex: writting the 16bits value 0x4141 at the address > 0xb8000000. > > I'm a new user of ADA, in Pascal or C, it's very simple. But with the strong > protection of Ada, I'm lost. I know the basics of pointers in ADA (called > access), but I don't know how to directly address the value 0xb800000 to a > pointer. I've tried to assign the address using Unchecked_Conversion and it > works. But when I try to read or write the content in memory, a > constraint_error exception is raisen. > > Does anybody could help me? > >