SPLat Logo

ShadowWrite mm*+,cc

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

ShadowWrite mm*+,cc

Write from RAM to non-volatile shadow memory. Start at RAM address (location number) mm and write cc bytes. Data in the shadow memory is retained even when the power goes off.

The R register will be set to 0 if the write operation is successful. It will be set to 1 if the write fails.

Caution: If the start address mm plus the count cc add up to an address beyond the end of RAM, the board will generate a fatal runtime error and reset.

Notes (see the product documentation for your specific board for details):

  1. The shadow memory has a finite endurance. A shadow memory location will wear out after a certain number of write or clear operations.
  2. This instruction takes a comparatively long time. During that time the SPLat processor is doing nothing and may miss fast inputs and will not service timers. It is up to you to design your program to ensure this does not cause problems!

This instruction can be used in indexed mode, i.e. iShadowWrite.

+ From dialect 16 the address argument will be jndexed when executed inside a MultiTrack task and will be indexed if the instruction is preceded by the IasJ: precode.

Note that the index or jndex offset is I or J single bytes. This can produce unexpected results if you are saving for example jndexed floating point data.

Shadow memory is not affected by downloading a new program to the controller. That means any user setup parameters (for example) will remain unchanged. That represents both an advantage and a risk. If you change your program or we change the way we allocate RAM (defBYTE etc) you could have problem, because suddenly your parameters are no longer at the expected addresses. You should therefore consider using absolute RAM addresses (mEQU) to allocate RAM to user parameters.

Dialect exclusions: Not available in dialects before 10.

See also ShadowRead ShadowClear