Re: A whole lotta WRITE_REGISTER_ULONG

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alexander Grigoriev (alegr_at_earthlink.net)
Date: 03/13/04


Date: Sat, 13 Mar 2004 07:31:48 -0800

WRITE_REGISTER_ULONG _may_ be a macro in some configurations. And NOT in
other.

And without 'volatile' qualifier, the compiler might optimize the whole
write loop down to the last write, which would not work for OP.

"Tim Roberts" <timr@probo.com> wrote in message
news:jm6550lhddfpeedpegg872ub9jemop5j1e@4ax.com...
> thojens@gmx.de (Thorsten Jens) wrote:
> >
>
> Where did you read that? It is bogus advice. WRITE_REGISTER_ULONG is a
> macro that expands to exactly the code you have there.
>
> OK, it's not EXACTLY the same. The macro casts the address to a (volatile
> PULONG), but the "volatile" doesn't change anything in this circumstance.
> Your code will compile to EXACTLY the same assembler code as if you had
> used the macro.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc



Relevant Pages

  • Re: Question about compilation/evaluation environments
    ... I guess it depends on what you mean by evaluating some code. ... In this case, the form is the macro function, aka macro ... invocation of compiled code produced by a compiler. ... ANY OF THESE FACILITIES MIGHT SHARE THE SAME EXECUTION ...
    (comp.lang.lisp)
  • Re: How to define a const and initialize it?
    ... > do the same work as const int MYCONST will do.... ... But the thing is that macro substitution takes ... C++ compiler isn't even aware of its existence. ... This Item might better be called "prefer the compiler to the preprocessor," because #define is often ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Preprocessor and sizeof()
    ... coming from a compiler vendor baffled me even more. ... "standard", i.e. poor) ... its headers and libraries, and in some cases is required to, as some ... into an issue with one such case, namely the offsetof macro. ...
    (comp.lang.c)
  • Re: hanging macros
    ... >> won't work unless the compiler knows the definition of A at the ... Recently I had occasion to use macros in a loop ... What I wanted was a macro expanding into something like ... macro output spliced into an existing loop form. ...
    (comp.lang.lisp)
  • Re: Sacla loop: a new loop implementation
    ... the compiler is able to deduce enough about the type of thing ... That requires only that type information is *sometimes* ... > necessary information for the macro to expand. ... "statically typed language". ...
    (comp.lang.lisp)