Timex M851 Watch User Manual


 
M851 WristApp Design Guide Rev 1.2
Timex Corporation 42
; load into A the byte value stored at offset VARIABLE_OFFSET
ld IX, [CORECurrentASDAddress]
ld A, [IX + VARIABLE_OFFSET]
The following code show how to access a variable in the ASD during background execution:
; load into A the byte value stored at offset VARIABLE_OFFSET
ld IX, [COREbackgroundASDAddress]
ld A, [IX + VARIABLE_OFFSET]
APPLICATION NOTES:
Since this area take up valuable heap space, care must be taken to allocate variables here the will
be used throughout the lifetime of the application. For temporary variables (variables that will be
used only during a state execution, consider storing them under foreground common variables
provided by the kernel.
During application initialization, the application is responsible for clearing the variables in the
ASD to a known value (usually 0). Care must be taken not to overwrite any variables where the
kernel has stored all the resource indexes.
4.8 Application Database Data
Database data is stored in the Application Database Data (ADD). ADD can be located in either internal or
external memory. If the data stored in the ADD is small and fixed in size, it should be located in internal
memory. ADD should be external if it is large and may require changes in its allocation size.
NOTE: By convention, ADD should be stored in external memory.
This section is updated with new information from the PC during a communications download.
The system variable CORECurrentADDAddress is available to the foreground application to access its
database. If the ADD is internal, CORECurrentADDAddress specifies the starting address of the ADD
memory block. If the ADD is external, CORECurrentADDAddress specifies the absolute address in
EEPROM of the start of the database.
Background handlers will use the system variable COREBackgroundADDAddress to access database
data.
If the ADD is stored in external memory, application must allocate in the ASD a buffer to store data
retrieved from external memory. This will allow the application to provide utilities to process the data
located in a fixed offset in the ASD. For messages to be scrolled, the kernel provides a 101 byte scroll
buffer which the background scroll routines can directly manipulate. The scroll buffer is reference using
the label COREWorkBuffer.
APPLICATION NOTES:
The application can use the database utilities provided by the kernel. This allows accessing
database records using random access or linked list methods.
4.9 System Variables
The kernel provides a number of global system variables that are accessible by all application and system
modules. The system variables is used for the following purposes: