4 ms·
Ehm, no, once you are in assembly, you do whatever you want to do. There is no compiler to mess things up for you. (Although, it's leaving that to you hehe... :
by jacobush 7y ago
Ehm, no, once you are in assembly, you do whatever you want to do. There is no compiler to mess things up for you. (Although, it's leaving that to you hehe... :-)
- notimetorelax 7y agoI think the compiler still needs to know that the value might be modified from the outside. Otherwise it might optimize the read operation away from the codepath.
- simcop2387 7y agoYou'd have to do all the reads in ASM too then, but it would still be possible. It'd be terrible ergonomically.
- srfilipek 7y agoYes, that is part of creating inline assembly in C or C++ code: http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html