The conversion works correctly but it can introduce error in case somebody tries to change the structure of oro_atomic_t and add some other members in the beginning of the structure.
To make sure that it always point to oro_atomic_t.counter, you have to explicitly index the counter member. Here's the change in the oro_atomic_add function
Edit: It is also better to remove the "dword ptr" so that the compiler validates the variable type against the other operand (ECX in case of your oro_atomic_add). It will show an error in case counter is not a 32 bit variable.
Code:
lock add [eax][oro_atomic_t.counter], ecx
Last edited by rxbagain; April 10th, 2009 at 01:00 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.