Can I assume that each instruction is observed atomicity? for example,
mov dword ptr [eax], 0
The movement either move successfully or doesn't happen. there is no interrupt in the middle of the instruction executed.
Is my assumption right?
I know the current processor can execute instruction out of order, and compiles will generate codes out of order in terms of optimization. And hence the movement will be executed in the order which isn't same as I wrote. But this doesn't matter, what i concern is once the single instruction is executed, it can't be interrupted.
EDIT:
what I concern is atomicity of any single instruction, not an special instruction or a branch of read-write instructions, I just use mov for example.
- Any time when any core of processor executes an instruction(add,mov,shift, etc.), can the execution be interrupted?
- Is there any indeterminate state in the register or the memory(machine-word-size).
Or what is the smallest unit that hardware can provide atomicity?