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,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!novia!news-xxxfer.readnews.com!news-out.readnews.com!postnews7.readnews.com!not-for-mail Date: Wed, 09 Feb 2011 10:49:37 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <4d4ff70e$0$6886$9b4e6d93@newsspool2.arcor-online.net> <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.googlegroups.com> <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> <1f229967-d3cf-42b6-8087-c97ee08652f3@i40g2000yqh.googlegroups.com> <4d51169e$0$7657$9b4e6d93@newsspool1.arcor-online.net> <1bnp0pw1c8r5b$.guxc48qweiwe.dlg@40tude.net> <4d51a1c0$0$19486$882e7ee2@usenet-news.net> <0c9a8fbb-465e-4a9b-a9e6-dba67b648283@t19g2000prd.googlegroups.com> <6cf0950a-d2a3-4df4-9f19-23474d568c28@q40g2000prh.googlegroups.com> In-Reply-To: <6cf0950a-d2a3-4df4-9f19-23474d568c28@q40g2000prh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d52b82f$0$19486$882e7ee2@usenet-news.net> NNTP-Posting-Host: 41137e18.usenet-news.net X-Trace: DXC=Q`YDL;I[d]c4X5m;JENQ\hQFZ3T]GPM]gmX0AG3X_jUoHL[6Z1g^FC`VjKk:Lk^BNacR12TN^Bg7n:KNd2lZeh5li1WZZ``>cDd X-Complaints-To: abuse@usenet-news.net Xref: g2news1.google.com comp.lang.ada:17090 Date: 2011-02-09T10:49:37-05:00 List-Id: On 2/8/2011 9:33 PM, Adam Beneschan wrote: > Dmitry asks, "How do you set the third > bit?", and you say, "Well, if the third bit is a Ready bit in a > hardware I/O register, I'd define a struct with bit components [yes, I > think C has those] and just assign 1 to the component, which would be > more readable than using a mask." This can be considerably more complicated depending on the hardware and the compiler; you are trying to assign to a single bit, but the compiler may do this by reading an entire word, setting the bit in the result, and assigning the entire word back. That could have dire effects if writing adjacent bits does something.