h6. [[OS SWI Calls]] h6(. » [[OS_ReadVarVal]] h6((. » [[OS_ReadVarVal Variable Types|Variable Types]] h6(((. » Code h2. Code h4. Notes R1 points to a block containing the following: |_<^{width:4em}. Offset |_<^. Contents | |>^. +0 |<^. This is where the OS jumps when the variable is to be written. Will normally be a branch instruction | |>^. +4 |<^. This is where the OS jumps when the variable is to be read - your code may start here | h4. When the Write entry is called: |_<^{width:4em}. Entry | | |<^. R2 |<^. Length of value | |_<^{width:4em}. Exit || |\2<^. R1, R2, R4, R10, R11 & R12 may be corrupted | h4. When the Read entry is called: |_<^{width:4em}. Entry || |<^. - |<^. - | |_<^{width:4em}. Exit | | |<^. R0 |<^. Pointer to value | |<^. R1 |<^. May be corrupted | |<^. R2 |<^. Length of value | The two entry points are called in SVC mode, so if you call a SWI then R14 will be corrupted. Note that [[OS_ReadVarVal]] is marked as being re-entrant, so in theory your code could be called while threaded. However, the PRM makes no mention of this, neither warning that it could happen, nor stating that the kernel makes sure that it does not happen. h4. See also * [[OS_ReadVarVal]] * [[OS_ReadVarVal Variable Types]]