Compiler produces different code for same line
GEAG said:I doubt that the compiler would do this to a write to IO in the system.
Why wouldn't it? Did you tell the compiler that that's I/O, instead of plain memory?