.386p

fm_TEXT segment para public use32 'CODE'
                assume cs:_TEXT
                assume ds:nothing
LockedIncrement proc    near
                mov     eax,[esp+4]
                lock inc dword ptr [eax]
                ret
LockedIncrement endp

LockedDecrement proc    near
                mov eax,[esp+4]
                lock dec dword ptr [eax]
                ret
LockedDecrement endp

LockedExchange  proc    near
                mov eax,[esp+4]
                mov ecx,[esp+8]
                lock xchg ecx,[eax]
                ret
LockedExchange  endp
                public LockedIncrement
                public LockedDecrement
                public LockedExchange

fm_TEXT    ends

                end
