Open main menu

CDOT Wiki β

Changes

Inline Assembly Language

152 bytes added, 00:52, 21 February 2018
Clobber
If memory is altered by the asm code, the string "memory" should be added to the clobber list. This will cause the compiler to mistrust values that were loaded from memory before the assembly language code was executed -- for example, if register r12 is loaded with an integer from memory before the assembly code is executed, it will be reloaded from memory afterward, because the value in memory may have been modified by the assembly code. If a memory clobber is not specified, the compiler will assume that values previously loaded from memory still match the values in memory. In most cases, the <code>volatile</code> keyword should be used along with the memory clobber flag.
 
If the [[Register#Status_Register|condition code (status register or flag register)]] is altered, the string "cc" should be added to the clobber list.
== Resources ==