9 – urom_movebpdec, 10 – urom_copybuffer, Ds4830a user’s guide – Maxim Integrated DS4830A Optical Microcontroller User Manual
Page 236

DS4830A User’s Guide
236
25.3.9 – UROM_moveBPdec
Function
UROM_moveBPdec
Summary
Reads the byte/word value pointed to by BP[OFFS], then decrements OFFS.
Inputs
BP[OFFS]: Address to read from data space (include 8000h offset if reading from flash).
Outputs
GR: Data byte/word read. OFFS is decremented.
Destroys
None
Notes:
• Before calling this function, DPC should be set appropriately to configure BP[OFFS] for byte or word mode.
• The address passed to this function should be based on the data memory mapping for the utility ROM, as
shown in Figure 25-1. When a byte mode address is used, CDA0 must be set appropriately to access
either the upper or lower half of program flash memory.
• This function automatically selects BP[OFFS] as the data pointer before reading the byte/word value.
• Implemented as: move GR, @
BP[OFFS--]
25.3.10 – UROM_copyBuffer
Function
UROM_copyBuffer
Summary
LC[0] bytes/words (up to 256) from DP[0] to BP[OFFS].
Inputs
DP[0]: Starting address to copy from.
BP[OFFS]: Starting address to copy to.
LC[0]: Number of bytes/words to copy.
Outputs
OFFS is incremented by LC[0]. DP[0] is incremented by LC[0].
Destroys
LC[0]
Notes:
•
This function can be used to copy from program flash to data RAM, or from one part of data RAM to another.
It cannot
be used to copy data into flash memory; the UROM_writeFlash function should be used for this
purpose.
• Before calling this function, DPC should be set appropriately to configure DP[0] and BP[OFFS] for byte or
word mode. Both DP[0] and BP[OFFS] should be configured to the same mode (byte or word) for correct
buffer copying.
• The addresses passed to this function should be based on the data memory mapping for the utility ROM, as
shown in Figure 25-1. When a byte mode address is used, CDA0 must be set appropriately to access either
the upper or lower half of program flash memory.
• This function automatically selects the data pointers before reading the byte/word values.