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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7c0437014cb20f71 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: System.Address_to_Access_Conversions Date: 1998/07/13 Message-ID: #1/1 X-Deja-AN: 371049584 References: <6odddl$k94$1@nnrp1.dejanews.com> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1998-07-13T00:00:00+00:00 List-Id: jsanchor@my-dejanews.com writes: > > > I tried casting > Ptr_to_Data := Ptr_to_Data_Type(Data_Ptr); --It compiled..but when I ran it > SEGMENTATION FAULT ERROR showed up. > Can anybody suggest how do I get the correct access type to point to memory. You have the correct Ada syntax (that's why it compiled), but the Operating System is not letting you write to that address (that's what SEGMENTAION FAULT means). The cure depends on what OS you are using. Most will NOT let you write directly to arbitrary addresses (I assume this is a hardware device register?) from user code. You will need to write a piece of code that runs in kernel mode (normally called a "device driver"). If you give us more details about what's at that memory location, what OS and CPU you are using, we might be able to help. > > Thank you in advance. > Jay S. > You're welcome -- Stephe