About the Datalink
What is it?
Download Protocol
Display Segments
Memory Map
150 vs 150s
EEProms

Wristapp Programming
Reference
Creating Wristapps
Wristapp Format
The State Table
[This Page] Wristapp Routines
Wristapps

Wristapp Programming
Tutorials
1 - Hello World
2 - Getting Input
3 - Better Input
4 - Showing Selection
5 - PassWord
6 - Day Find
7 - Playing with Sound
8 - Using Callbacks
9 - Hex Dump
10 - EEPROM Dumper
11 - Spend Watch
12 - Sound Schemes
13 - Random Numbers
14 - Hourly Chimes
15 - Lottery Picker

Sound Schemes
Sound Hardware
Sound Scheme Format

Home Send Mail

Classes of Callable Functions

I have broken down the system routines into 14 basic categories.  For each function listed, you will find the name of the routine followed by two hex addresses separated by a slash.  The first address is the location of the routine for the Datalink 150 and the second is the location for that routine on the 150s.
Anniversary support General routines for accessing the Anniversary data in the EEProms and setting all of the flags and display to indicate the anniversaries.
Appointment support General routines for accessing the appointment data in the EEProms and setting all of the flags and display segments for appointments.
Blinking routines ????
Event support ????
Format Routines Routines for converting numbers into the corresponding display digits.
Indiglo support Routines for turning on and off the indiglo light as well as managing the timers for the light
INST Support ????
Internal Not quite sure why you would ever call these routines, but the MIGHT be useful sometimes.
Line routines ????
Packet/EEProm Support ????
Scanning support ????
Scrolling Messages ????
Sound Support ????
Update functions ????

Anniversary support routines

Routine FIND_ANNIV_TODAY - $40CD/$40BC
Parameters None
Purpose This finds the next anniversary entry which is greater than or equal to today

Routine FIND_ANNIV_SCAN - $40D3/$40C2
Parameters ANNIVSCAN_MONTH, ANNIVSCAN_YEAR, ANNIVSCAN_DAY - Date to scan for anniversary entry
Purpose This finds the next anniversary entry which is greater than or equal to the scan date

Routine ANNIV_NEXT_ENTRY - $40E1/$40D0
Parameters ANNIV_CURRENT - The current anniversary entry
Purpose Advance to the next anniversary entry. If we hit the end of the list, we need to wrap the year and go to the next one

Routine ANNIV_PREV_ENTRY - $4117/$4106
Parameters ANNIV_CURRENT - The current anniversary entry
Purpose Advance to the previous anniversary entry. If we hit the end of the list, we need to wrap the year and go to the end again

Routine FIND_ANNIV_ENTRY - $415F/$414E
Parameters ANNIVTEST_MONTH, ANNIVTEST_DAY, ANNIVTEST_YEAR - Date of anniversary to find
Purpose This finds the next anniversary entry which is greater than or equal to the specified date

Routine CHECK_ANNIVERSARIES - $41FC/$41EB
Parameters None
Purpose This code checks all anniversaries to see if any occur today

Routine SET_ANNIVTEST_TODAY - $423A/$4229
Parameters None
Purpose Latches the current month, date, year into the ANNIVTEST_ locations

Routine INIT_ANNIVERSARY_DATA - $4282/$4271
Parameters None
Purpose This clears the ANNIVERSARY occurance flags and latches in the current date for the anniversary check routine

Routine TEST_ANNIVERSARY - $4288/$4277
Parameters EXTRACTBUF - Anniversery data to be checked
ANNIVTEST_MONTH, ANNIVTEST_DAY, ANNIVTEST_YEAR - Current date to check against
Purpose This tests the anniversery against the current day and sets the 4,ANNIV_FLAGS and 5,ANNIV_FLAGS flags appropriately.

Routine ANNIV_COPY_INFO - $4308/$42F7
Parameters ANNIV_YEAR - The year to fake the appointment as
Purpose This copies the current appointment information into the ANNIVSCAN variables

Routine READ_ANNIV_CURRENT - $4317/$4306
Parameters ANNIV_CURRENT - the anniversary entry to be read
Purpose This reads in the current anniversary entry into EXTRACTBUF

Routine READ_ANNIV_FIRST - $4326/$4315
Parameters None
Purpose This reads the first anniversary entry into EXTRACTBUF

Routine READ_ANNIV_NEXT - $4335/$4324
Parameters None
Purpose This reads the next anniversary entry into EXTRACTBUF

Scanning support

Routine TEST_SCAN_START - $4346/$4335
Parameters SCAN_MONTH - Month, Day, Year of appointment to compare
SCAN_DAY SCAN_YEAR TMAPP_MONTH - Current Month, Day, Year
TMAPP_DAY TMAPP_YEAR
Purpose Sets 0,SCAN_FLAGS to indicate that the current scan date is out of range.

Routine FIX_SCAN_YEAR - $4371/$4360
Parameters SCAN_YEAR - Year to be adjusted
Purpose Adjusts SCAN_YEAR to account for years past 2000

Routine TEST_SCAN_END - $437E/$436D
Parameters SCAN_MONTH, SCAN_DAY, SCAN_YEAR - Current scan date
SCAN_END_MONTH, SCAN_END_DAY, SCAN_END_YEAR - Limit of the scan range
Purpose Tests to seee if the current scan date is past the end range for the scan. If so, it sets 0,SCAN_FLAGS

Routine RESTORE_SCAN_YEAR - $43AE/$439D
Parameters SCAN_YEAR - Year to be adjusted
Purpose Restores SCAN_YEAR to be in the 0-99 range (After a call to FIX_SCAN_YEAR)

Routine INCREMENT_SCAN_DATE - $43B9/$43A8
Parameters SCAN_MONTH, SCAN_DAY, SCAN_YEAR
Purpose Increments the current scan day by one

Routine GET_SCAN_MONTHLEN - $43E0/$43CF
Parameters None
Purpose This computes the end of the month based on SCAN_MONTH and SCAN_YEAR

Routine DECREMENT_SCAN_DATE - $43F4/$43E3
Parameters SCAN_MONTH, SCAN_YEAR
Purpose Decrements the scan data by one

Appointment support

Routine FIND_APPT_NOW - $4415/$4404
Parameters None
Purpose This finds and reads in an appointment which will occur next after the current time in the current time zone. The appointment is put into EXTRACTBUF and all appropriate variables are set.

Routine FIND_APPT_SCAN - $441B/$440A
Parameters SCAN_MONTH,DAY,YEAR
Purpose This finds and reads in an appointment which will occur next after the current scan values. The appointment is put into EXTRACTBUF and all appropriate variables are set.

Routine SET_APPTFIND_SCAN - $4422/$4411
Parameters SCAN_MONTH, SCAN_DAY, SCAN_YEAR
Purpose This copies over the current SCAN variables into the APPTFIND variables

Routine READ_APPT_NEXT - $442C/$441B
Parameters APPT_CURRENT, APPT_LAST - current and last appointment entries
Purpose This reads in the next appointment into EXTRACTBUF

Routine APPT_LATCH_ENTRYDATA - $4468/$4457
APPT_LATCH_ENTRYONLY - $446C/$445B
Parameters EXTRACTBUF - current appointment entry APPTEST_YEAR - year of the entry
Purpose These copy the current appointment data into the corresponding system variables The ENTRYONLY routine doesn't copy over the year because it presumably has already been copied.

Routine READ_APPT_PREV - $447C/$446B
Parameters APPT_CURRENT, APPT_LAST - current and last appointment entries
Purpose This reads in the previous appointment into EXTRACTBUF

Routine FIND_APPT_ENTRY - $44C6/$44B5
Parameters APPTFIND_YEAR,DAY,MONTH,QHOUR,HOUR
Purpose This finds an appointment that matches or exceeds the APPTFIND values

Routine APPT_LATCH_ENTDYDATA - $45A5/$4594
Parameters APPT_ENTRY - Entry to latch appointment information for
Purpose This copies the current appointment entry into the corresponding system variables so that we can continue comparing appointments

Routine CHECK_APPOINTMENTS - $45B9/$45A8
Parameters APPT_QHOUR_NOW - The current quarterhour
APPT_BASEYEAR - The base year for the first appointment
Purpose This tests to see if any appointments are ready to go off. It posts a nested app for any appointments

Routine SET_APPTFIND_NOW - $462A/$4619
Parameters None
Purpose Sets the appointment find variables to the current time

Routine READ_APPT_FIRST - $4686/$4675
Parameters APPT_FIRST
Purpose Read in the first appointment

Routine READ_APPT_LAST - $469D/$468C
Parameters APPT_LAST - the entry of the last appointment
Purpose This reads in the last appointment entry

Routine CHECK_APPT_TIME - $46B7/$46A6
Parameters None
Purpose This checks to see if any appointments are ready to go off

Routine READ_APPT_PACKET1 - $473A/$4729
Parameters None
Purpose This reads the first appointment packet into EXTRACTBUF

Routine READ_NEXT_APPT_PACKET - $4749/$4738
Parameters None
Purpose This reads in the next appointment packet into EXTRACTBUF

Routine READ_APPT_CURRENT - $475A/$4749
Parameters APPT_CURRENT - the appointment entry to be read
Purpose This reads in the current appointment entry into EXTRACTBUF

Internal

Routine ANNIV_GETMONTHLEN - $426A/$4259
Parameters ANNIV_MONTH - Month to calculate
ANNIVTEST_YEAR - Year to caclulate
Purpose This computes the number of days in the given month

Routine ACQUIRE_TIME - $4F22/$4F11
Parameters None
Purpose This acquires the right to change the time. All alarms and anniversaries will temporarily be ignored until RELEASE_TIME has been called

Routine RELEASE_TIME - $4F2E/$4F1D
Parameters None
Purpose This releases the lock on time and allows all alarms and anniversaries to be checked once again.

Indiglo support

Routine QUEUE_INDIGLO_OFF - $49D9/$4C38
Parameters None
Purpose Queue up the timer for shutting off the indiglo if the indiglo is enabled and we are in night mode.

Routine INDIGLO_OFF - $4E8E/$4E7D
Parameters None
Purpose This routine turns off the indiglo light

Routine NIGHTMODE_INDIGLO_ON - $49E6/$4C45
Parameters None
Purpose Queue up the timer for shutting off the indiglo if the indiglo is enabled and we are in night mode. The INDIGLO_ON routine just simply turns the indiglo on immediately

Routine INDIGLO_ON - $49EC/$4C4B
Parameters None
Purpose Queue up the timer for shutting off the indiglo if the indiglo is enabled and we are in night mode. The INDIGLO_ON routine just simply turns the indiglo on immediately

Sound Support

Routine SNDSTART - $4E4A/$4E39
Parameters SYSSOUND - Current sound to be playing
Purpose Start playing the current sound in SYSSOUND

Routine STOP_ALL_SOUND - $4E68/$4E57
Parameters None
Purpose Keep the sound hardware running or reset everything else

Routine PLAYCONF - $4E7A/$4E69
Parameters None
Purpose Play a confirmation sound

Routine PLAYBUTTON - $4E80/$4E6F
Parameters None
Purpose Play the button beep sound if no other sound is currently playing

Routine PLAY_HOURLY - $4EB1/$4EA0
Parameters None
Purpose Plays the hourly sound if nothing else is playing and sounds are enabled

Routine SNDSTOP - $4F3A/$4F29
Parameters None
Purpose This stops whatever sound is currently playing

Routine PLAY_BUTTON_SAFE - $4F46/$4F35
Parameters None
Purpose This will play the button beep sound if it hasn't just been played

Event support

Routine POSTEVENT - $4E89/$4E78
Parameters A - Event to be posted.
Purpose Post a event to the internal processing queue This posts an event to run through the processing loop for the current applet. Typical user events are in the $30-$3F range.

Routine CALL_NESTEDAPP - $4F4D/$4F3C
Parameters A - Nested application number.
This is one of the three defined apps:
9 = APP2_ALARM - Alarm (while another app is running)
10 = APP2_APPT - Appointment (while another app is running)
11 = APP2_WRIST - Wristapp (while another app is running)
X - Parameter to pass to the nested application
Purpose This sets up to call a nested application while the current one is running. Up to 5 apps may be nested (although there are only 3 potential ones defined). If more than 5 have been called the oldest one will be forgotten. When the nested app is called, NESTED_APP will be set to the application number passed in and NESTED_PARM will contain the X parameter passed in

Packet/EEProm Support

Routine UNPACK_PHONENUM - $4FBF/$4FAE
Parameters EXTRACTBUF+1 - Pointer to 6 bytes of compressed phone number information
Returns BUF_PHONENUM - Contains 12 byte unpacked number
Purpose This gets a compressed phone number and puts it in the phone number buffer Phone numbers are compressed into nibbles instead of bytes, allowing a number to be packed in half the space. As a result, a number can contain only 16 possible characters: "01234567890CFHPW " Any other characters are encoded as a space before being sent down. The presumption is that the characters allow for the number and indicators for: Cell Fax Home Pager Work

Routine UNPACK_STRING - $4FF0/$4FDF
Parameters PARM_UNPACKOFF - Offset into the start of the compressed buffer
EXTRACTBUF - packed data
Returns MSGBUF - Contains the unpacked string
Purpose This gets a compressed string and puts it into the scrolling message buffer Strings are packed 6 bits across so that 4 unpacked characters can fit in 3 bytes This routine will unpack enough bits so that the resultant message buffer is exactly 32 bytes long. It is assumed that the end of the buffer message is stored in the packed string.

Routine READ_PACKET - $503E/$502D
Parameters PARM_LEN - Number of bytes to copy
PARM_PACKET - Packet number to read
X - Packet group to search (0,2,4,6)
0 = APPT Entries
2 = List entries
4 = Phone Number
6 = Anniversaries
Purpose Reads the requested packet into EXTRACTBUF

Routine FIND_PACKET - $5044/$5033
Returns INST_ADDRHI:INST_ADDRLO - points to the start of the packet
Parameters PARM_PACKET - Packet number to locate
X - Packet group to search (0,2,4,6)
0 = APPT Entries
2 = List entries
4 = Phone Number
6 = Anniversaries
Purpose This advances to the given packet in the packet group

Routine DO_TRANSFER - $505F/$504E
Parameters PARM_LEN - Number of bytes to copy
INST_ADDRHI - Address of source data to copy
Purpose This transfers the data from the indicated location to EXTRACTBUF The source can be the EEPROM or somewhere else in memory

Routine TOGGLE_ENTRYFLAG - $5077/$5066
Parameters None
Purpose This toggles the high bit of the first byte in an entry

Routine INIT_EEPROMPOINTERS - $5080/$506F
Parameters None
Purpose Initializes all of the EEProm data pointers to reflect empty data for all of the applications

Routine RESET_EEPROMENTRIES - $508D/$507C
Parameters None
Purpose Re-Initializes all of the EEProm data pointers to reflect empty data for all of the applications

Routine REINIT_APP_DATA - $50A7/$5096
Parameters None
Purpose This routine is called after new data has been loaded into the EEPROM

INST Support

Routine MAKE_INST_LDA - $50B4/$50A3
MAKE_INST_LDA_X - $50B8/$50A7
MAKE_INST_STA - $50BC/$50AB
Parameters None
Purpose These routines make the INST2 opcodes to be an LDA or STA $nnnn,X instruction

Routine ADD_INSTADDR - $50C7/$50B6
Parameters A - value to add to the current INST_ADDR base address
Purpose This takes an offset value and subsomes it into the already constructed instruction starting at INST_OPCODE

Routine SET_INSTADDR_0110 - $50D7/$50C6
Parameters X - R
Purpose This routine sets INST_ADDRHI:INST_ADDRLO to be 0110

Routine GET_INST_BYTE - $50EB/$50DA
Parameters INST_ADDRHI:INST_ADDRLO - the pointer to the byte to get
Purpose This routine gets the single byte from the indicated location either in the EEPROM or somewhere in memory.

Routine WRITE_FLAG_BYTE - $510A/$50F9
Parameters INST_ADDRHI:INST_ADDRLO - the pointer to the byte to write to
Purpose This routine writes a single byte to the indicated location either in the EEPROM or somewhere in memory. ?????? This adjusts an address relative to the Sound buffers.
Parameters A - Offset into the sound data area

Routine FILL_EXTRACTBUF - $513E/$512D
Parameters PARM_LEN - Number of bytes to be copied
INST_ADDRHI:INST_ADDRLO - Address in Prom to read
Returns EXTRACTBUF - Contains the bytes read in from the EEPROM
Purpose This copies data from the EEPROM to the EXTRACTBUFF Note that this buffer is only 31 bytes long although this routine can support up to 256 bytes.

Routine SAVE_EXTRACTBUF - $515D/$514C
Parameters PARM_LEN - Number of bytes to be copied
INST_ADDRHI:INST_ADDRLO - Address in Prom to write
EXTRACTBUF - Contains the bytes to write to the EEPROM
Purpose This copies data from the EXTRACTBUFF to the EEPROM Note that this buffer is only 31 bytes long although this routine can support up to 256 bytes.

Routine SYSTEM_RESET - $519B/$518A
Parameters None
Purpose This routine is the main reset routine for starting up the watch. It cleans up all of memory and starts the processing once again

Routine INIT_SOUNDS - $5265/$51F2
Parameters None
Purpose This routine initializes the default sounds

Routine ENABLE_EYE - $53A6/$5367
Parameters None
Purpose This routine enables the received on the watch to download from the screen. It also seems to wait for SERIAL_DATA/SERIAL_CONTROL to settle down

Routine DISABLE_EYE - $53BD/$537E
Parameters None
Purpose This disables the eye for normal watch operation

Routine SET_SYS_07 - $53C8/$5389
Parameters None
Purpose ???? This routine resets the SYS_07 hardware

Routine CLEAR_SYS_07 - $53CF/$5390
Parameters None
Purpose ???? This routine resets the SYS_07 hardware Clears 1,HW_FLAGS

Routine RESET_SYS_07 - $53D5/$5396
Parameters None
Purpose ???? This routine resets the SYS_07 hardware

Routine INITHW_SYS_07 - $53DC/$539D
Parameters SYSTEMP2 - 0 or $c1 to indicate how the hardware is to be reset
Purpose ???? This routine initializes the SYS_07 hardware

Routine SETHW_07_08_C1 - $53F4/$53B5
Parameters A - $C1 - Value to be poked into SYS_08
Purpose ???? Resets the SYS_07, SYS_08 hardware. There is a timing loop associated with this reset operation.

Routine WRITE_ACQUIRE - $543C/$542B
Parameters None
Purpose This routine acquires the EEPROM for writing. It will also turn off any playing sound as well as the INDIGLO in order to conserve power while doing the writing.

Routine WRITE_RELEASE - $5448/$5437
Parameters None
Purpose This routine releases the EEPROM for writing. If the Indiglo had been previously on, it is turned back on.

Routine MAKE_INST2_LDA_X - $5453/$5442 MAKE_INST2_STA_X - $5457/$5446
Parameters None
Purpose These routines make the INST2 opcodes to be an LDA or STA $nnnn,X instruction

Routine PROM_READ - $5462/$5451
Parameters INST2_COUNT - Number of bytes to be copied
PROM_ADDRHI:PROM_ADDRLO - Address in Prom to read
INST2_ADDRHI:INST2_ADDRLO - Address to copy data to
Purpose This copies data from the EEPROM to the indicated buffer

Routine PROM_WRITE - $5488/$5477
Parameters INST2_COUNT - Number of bytes to be copied
PROM_ADDRHI:PROM_ADDRLO - Address in Prom to write
INST2_ADDRHI:INST2_ADDRLO - Address to copy data from
Purpose This copies data to the EEPROM from the indicated buffer

Routine SET_INDIGLO - $5504/$54F3
Parameters 0,HW_FLAGS - Biindicates request for on or off
Purpose This routine turns on/off the indiglo light

Scrolling Messages

Routine PUTSCROLLMSG - $5522/$5511
Parameters MSGBUF - the message to scroll terminated by SEPARATOR
Purpose Initialize a scrolling message

Routine SCROLLMSG - $5545/$5534
Parameters MSGBUF - Message to be scroll terminated by a SEPARATOR character
Purpose Start the scrolling cycle for the current message

Routine SCROLLMSG_CONT - $5549/$5538
Parameters MSGBUF - Message to be scroll terminated by a SEPARATOR character
SCROLL_TICS - The current tic count in the cycle
Purpose Start the scrolling cycle for the current message, but don't reset the scrolling cycle wait count.

Blinking routines

Routine START_BLINKX - $55BB/$55AA
Parameters A - Blinking function to be selected
0 BLINK_YEAR Blink the year in the right place according to the current time format
1 BLINK_SECONDS Blink two characters point to by UPDATE_PARM on the right two digits of the middle line - Used for the seconds
2 BLINK_AMPM Blink AM/PM on the right most digits of the middle line (A or P pointed to by UPDATE_PARM)
3 BLINK_MONTH Blink the month in the right place according to the current time format
4 BLINK_HMONTH Blink the month in the right place according to the current time format for a half date (no year)
5 BLINK_DAY Blink the day in the right place according to the current time format
6 BLINK_HDAY Blink the day in the right place according to the current time format for half dates
7 BLINK_MID12 Blink the left two blank padded digits on the middle line (value pointed to by UPDATE_PARM)
8 BLINK_HOUR Blink the Hour (left two segments on the middle line) and AM/PM indicator (hour point to by UPDATE_PARM)
9 BLINK_MID34 Blink the middle two zero padded digits on the middle line (value pointed to by UPDATE_PARM)
10 BLINK_SEGMENT Blink a single segment indicated by UPDATE_POS and mask in UPDATE_VAL
11 BLINK_DIGIT Blink solid black cursor for the digit (UPDATE_POS is the location on the bottom line)
12 BLINK_TZONE Blink the timezone information (Pointed to by UPDATE_PARM)
13 BLINK_TOP34 Blink the middle zero padded two digits on the top line (value pointed to by UPDATE_PARM)

X - single byte parameter to the particular blinking function

Purpose Establish and call the specified blinking rountine

Routine START_BLINKP - $55BF/$55AE
Parameters A - Blinking function to be selected
0 BLINK_YEAR Blink the year in the right place according to the current time format
1 BLINK_SECONDS Blink two characters point to by UPDATE_PARM on the right two digits of the middle line - Used for the seconds
2 BLINK_AMPM Blink AM/PM on the right most digits of the middle line (A or P pointed to by UPDATE_PARM)
3 BLINK_MONTH Blink the month in the right place according to the current time format
4 BLINK_HMONTH Blink the month in the right place according to the current time format for a half date (no year)
5 BLINK_DAY Blink the day in the right place according to the current time format
6 BLINK_HDAY Blink the day in the right place according to the current time format for half dates
7 BLINK_MID12 Blink the left two blank padded digits on the middle line (value pointed to by UPDATE_PARM)
8 BLINK_HOUR Blink the Hour (left two segments on the middle line) and AM/PM indicator (hour point to by UPDATE_PARM)
9 BLINK_MID34 Blink the middle two zero padded digits on the middle line (value pointed to by UPDATE_PARM)
10 BLINK_SEGMENT Blink a single segment indicated by UPDATE_POS and mask in UPDATE_VAL
11 BLINK_DIGIT Blink solid black cursor for the digit (UPDATE_POS is the location on the bottom line)
12 BLINK_TZONE Blink the timezone information (Pointed to by UPDATE_PARM)
13 BLINK_TOP34 Blink the middle zero padded two digits on the top line (value pointed to by UPDATE_PARM)

X - Address of parameter to the particular blinking function

Purpose Establish and call the specified blinking rountine

Update functions

Routine START_UPDATEX - $57C3/$56C4
Parameters A - Update function to be selected
0 UPD_YEAR Update the year
1 UPD_MONTH Update the Month
1 UPD_HMONTH Update the Month in Half date format
3 UPD_DAY Update the day
4 UPD_HDAY Update the day in half date format
5 UPD_MID12 Update MID12
6 UPD_HOUR Update the hour
7 UPD_MID34 Update MID34
8 UPD_DIGIT Update the digit at UPDATE_POS

X - single byte parameter to the particular update function

Purpose Establish and call the specified update function

Routine START_UPDATEP - $57C7/$56C8
Parameters A - Update function to be selected
0 UPD_YEAR Update the year
1 UPD_MONTH Update the Month
1 UPD_HMONTH Update the Month in Half date format
3 UPD_DAY Update the day
4 UPD_HDAY Update the day in half date format
5 UPD_MID12 Update MID12
6 UPD_HOUR Update the hour
7 UPD_MID34 Update MID34
8 UPD_DIGIT Update the digit at UPDATE_POS

X - Pointer to parameters for the update function

Purpose This establishes an update function. Update functions are called every 8/10th of a second. This function will update a number in an upward or downward direction based on the setting of 0,SYSFLAGS

Format Routines

These routines are useful for formatting numbers into the corresponding character representation.
Routine FMTXLEAD0 - $593E/$583F
Parameters X - value to be formatted.
0-9 results in 0 followed by the digit
10-99 results in number for both digits
Purpose Formats into DATDIGIT1/2 with leading zeros

Routine FMTBLANK0 - $594D/$584E
Parameters X - value to be formatted.
0 results in all blanks.
1-9 results in blank followed by the digit
10-99 results in number for both digits
Purpose Formats a number into DATDIGIT1/2

Routine FMTX - $5951/$5852
Parameters X - value to be formatted.
0-9 results in blank followed by the digit
10-99 results in number for both digits
Purpose Formats a number into DATDIGIT1/2

Routine FMTSPACE - $595C/$585D
Parameters None
Purpose This routine simply puts spaces into DATDIGIT1 DATDIGIT2

Routine FMTBLANK0B - $5963/$5864
Parameters X - value to be formatted.
0 results in all blanks.
1-9 results in blank followed by the digit
10-99 results in number for both digits
Purpose Formats a number into DATDIGIT1/2. This routine does not appear to be used anywhere and seems to do exactly the same thing as FMTBLANK0

Routine FIXLEAD0 - $5A2A/$592B
Parameters None
Purpose If the first digit is a zero, replace it with a blank

Line routines

These routines are useful for putting strings on the display
Routine PUTLINE3 - $56D5/$59E7
Parameters A = Position
S1 S2 S3 S4 S5 S6 S7 S8
$47 $3D $33 $27 $1D $13 $09 $0a

X = Character in Timex Ascii to display

Purpose Put a single character on the bottom line of the display This routine pokes in a single digit on the display. Note that the last digit is backwards and upside down in the hardware.

Routine PUTLINE1 - $570D/$5A33
Parameters A = Position
T1 T2 T3 T4 T5 T6
$46 $3E $34 $2C $22 $14

X = Character in Timex Ascii to display

Purpose Put a single character on the top line of the display

Routine PUTLINE2 - $5745/$5A6B
Parameters A = Position
M1 M2 M3 M4 M5 M6
$46 $3E $34 $2C $22 $14

X = Character in Timex Ascii to display

Purpose Put a single character on the second line of the display

Routine SETALL - $5776/$5A9C
Parameters None
Purpose Turns on all segments on the entire display

Routine CLEARALL - $577A/$5AA0
Parameters None
Purpose Clear the entire display

Routine CLEARBOT - $5787/$5AAD
Parameters None
Purpose Clear the bottom line of the display

Routine CLEAR_RANGE - $5793/$5ABF
Parameters A - Initial offset to be clearing from
X - Number of words to clear
Purpose Turn off all bits on the display at the given offsets

Routine CLEARSYM - $579F/$5ACB
Parameters None
Purpose Turns off all the non digit symbols segments (including dots, dashes and colons)

Routine BANNER8 - $5845/$5746
Parameters A = Offset from 0110 for the start of an 8 character timex string
Purpose Display an 8 character string

Routine PUTMSGXBOT - $5849/$574A
Parameters A = Message selector number.
Valid values from 0 to 27. They correspond to the same strings passed into PUTMSGBOT scaled down by 8
Purpose Display an 8 character system string on the bottom line

Routine PUTMSGBOT - $584C/$574D
Parameters A = Offset into message selector string.
Valid values from from $00 to $d8 at 8 Byte offsets.
$E0 is the start of the 6 byte top/mid message strings.
$00 SYS8_MON "MON     "
$08 SYS8_TUE "TUE     "
$10 SYS8_WED "WED     "
$18 SYS8_THU "THU     "
$20 SYS8_FRI "FRI     "
$28 SYS8_SAT "SAT     "
$30 SYS8_SUN "SUN     "
$38 SYS8_VERDATE " 802003 "
$40 SYS8_VERSION "  V2.0  "
$48 SYS8_MODE "  MODE  "
$50 SYS8_SET_MODE "SET MODE"
$58 SYS8_SET "SET     "
$60 SYS8_TO "TO      "
$68 SYS8_FOR "FOR     "
$70 SYS8_ENTRIES "ENTRIES "
$78 SYS8_UPCOMING "UPCOMING"
$80 SYS8_ENTRY " ENTRY  "
$88 SYS8_SCAN " SCAN   "
$90 SYS8_SCAN_RIGHT "    SCAN"
$98 SYS8_SYNCING " SYNCING"
$a0 SYS8_PROGRESS "PROGRESS"
$a8 SYS8_DATA_OK " DATA OK"
$b0 SYS8_RESEND "-RESEND-"
$b8 SYS8_ABORTED " ABORTED"
$c0 SYS8_MISMATCH "MISMATCH"
$c8 SYS8_SPLIT " SPLIT  "
$d0 SYS8_START ">=START "
$d8 SYS8_STOP ">=STOP  "
Purpose Display an 8 character system string on the bottom line

Routine PUTDOWTOP - $5872/$5773
Parameters X - Day of week (0-6)
Purpose Displays the two character representation of the day of the week in the upper left of the display

Routine PUT6TOP - $587E/$577F
Parameters A = Offset from WRIST_MAIN for the start of a 6 byte data item to be put on the top line of the screen. This uses a different encoding for characters where: we have 32 different values which correspond to:
0123456789ABCDEFGH:LMNPRTUWYr -+
e.g. $12=':', $13='L'. It appears that things wrap when you get to $20
Purpose Display a 6 character string on the top line

Routine PUTMSG1 - $5882/$5783
Parameters A = Offset into message selector string.
Valid values from from $00 to $a8 at 6 Byte offsets.
$00 SYS6_SET " SET  "
$06 SYS6_HOLDTO "HOLDTO"
$0C SYS6_ALARM "ALARM "
$12 SYS6_ENTER "ENTER "
$18 SYS6_HR "    HR"
$1E SYS6_SWITCH "SWITCH"
$24 SYS6_TIME " TIME "
$2A SYS6_FORMAT "FORMAT"
$30 SYS6_DAILY "DAILY "
$36 SYS6_APPT " APPT "
$3c SYS6_NO "  NO  "
$42 SYS6_APPTS "APPTS "
$48 SYS6_END_OF "END OF"
$4e SYS6_LIST " LIST "
$54 SYS6_DELETE "DELETE"
$5a SYS6_ANN " ANN  "
$60 SYS6_PHONE "PHONE "
$66 SYS6_DONE " DONE "
$6c SYS6_PRI "PRI   "
$72 SYS6_COMM " COMM "
$78 SYS6_READY "READY "
$7e SYS6_IN "  IN  "
$84 SYS6_ERROR "ERROR "
$8a SYS6_CEASED "CEASED"
$90 SYS6_PC "PC-   "
$96 SYS6_WATCH "WATCH "
$9c SYS6_CHRONO "CHRONO"
$A2 SYS6_TIMER "TIMER "
$a8 SYS6_000000 "000000"
Purpose Display an 6 character system string on the top line

Routine PUT6MID - $58A8/$57A9
Parameters A = Offset from WRIST_MAIN for the start of a 6 byte data item to be put on the top line of the screen. This uses a different encoding for characters where: we have 32 different values which correspond to:
0123456789ABCDEFGH:LMNPRTUWYr -+
e.g. $12=':', $13='L'. Beyond $20 you get random junk.
Purpose Display a 6 character string on the second line

Routine PUTMSG2 - $58AC/$57AD
Parameters A = Offset into message selector string.
Valid values from from $00 to $a8 at 6 Byte offsets and the strings are the same as for PUTMSG1
Purpose Display an 6 character system string on the top line

Routine CLEARTOP - $58D2/$57D3
Parameters None
Purpose Puts blanks into all 6 top digits (Blanks out the top line)

Routine CLEARMID - $58D8/$57D9
Parameters None
Purpose Puts blanks into all 6 Middle digits (Blanks out the middle line)

Routine CLRTOP12 - $58DE/$57DF
Parameters None
Purpose Puts blanks into top Digits 1 and 2

Routine PUTTOP12 - $58E0/$57E1
Parameters None
Purpose Puts DATDIGIT1/2 into TOP Digits 1 and 2

Routine CLRTOP34 - $58EE/$57EF
Parameters None
Purpose Puts blanks into TOP Digits 3 and 4

Routine PUTTOP34 - $58F0/$57F1
Parameters None
Purpose Puts DATDIGIT1/2 into TOP Digits 3 and 4

Routine CLRTOP56 - $58FE/$57FF
Parameters None
Purpose Puts blanks into TOP Digits 5 and 6

Routine PUTTOP56 - $5900/$5801
Parameters None
Purpose Puts DATDIGIT1/2 into TOP Digits 5 and 6

Routine CLRMID12 - $590E/$580F
Parameters None
Purpose Puts blanks into Middle Digits 1 and 2

Routine PUTMID12 - $5910/$5811
Parameters None
Purpose Puts DATDIGIT1/2 into Middle Digits 1 and 2

Routine CLRMID34 - $591E/$581F
Parameters None
Purpose Puts blanks into Middle Digits 3 and 4

Routine PUTMID34 - $5920/$5821
Parameters None
Purpose Puts DATDIGIT1/2 into Middle Digits 3 and 4

Routine CLRMID56 - $592E/$582F
Parameters None
Purpose Puts blanks into Middle digits 5 and 6

Routine PUTMID56 - $5930/$5831
Parameters None
Purpose Puts DATDIGIT1/2 into Middle Digits 5 and 6

Routine SAYEOLMSG - $5979/$587A
Parameters None
Purpose Puts 'END OF LIST' on the display

Routine SAYHOLDTODELETE - $598A/$588B
Parameters None
Purpose Puts 'HOLD TO DELETE ENTRY' on the display

Routine PUT_PHONENUM - $59A2/$58A3
Parameters None
Purpose Puts a phone number on the top two lines of the display (Up to 12 digits). If there is a non blank character as the third digit, a - is turned on between the 3rd and 4th digits to separate out what is presumably the area code

Routine PUTYEARMID - $59D9/$58DA
Parameters X - Year to be formatted on the display
Purpose Puts the current year on the right half of the middle display. If the year passed in is less than 50, it is assumed to be 20xx, above 50 it is processed as 19xx giving a range of 1950-2049

Routine CLEAR_HMONTH - $59F8/$58F9
Parameters None
Purpose blank out the 2 character day for a half date (no year) based on the current time zone date format

Routine PUT_HMONTHX - $59FD/$58FE
Parameters X - Day to be displayed
Purpose Put the leading space 2 digit month in the appropriate spot on the display based on the current time zone date format for a half date (no year)

Routine CLEAR_HDAY - $5A11/$5912
Parameters None
Purpose blank out the 2 character day for a half date (no year) based on the current time zone date format

Routine PUT_HDAYX - $5A16/$5917
Parameters X - Day to be displayed
Purpose Put the leading zero 2 digit day in the appropriate spot on the display based on the current time zone date format for a half date (no year)

Routine CLEAR_MONTH - $5A36/$5937
Parameters None
Purpose blank out the 2 character month based on the current time zone date format

Routine CLEAR_DAY - $5A4F/$5950
Parameters None
Purpose blank out the 2 character day based on the current time zone date format

Routine PUTBOT678 - $5A86/$5987
Parameters X - Pointer to 3 byte location containing bytes to put on the display (pointed to by x) 3 bytes in TIMEX ascii.
Because the X register is used to index to them, they must be located in the first 256 bytes of memory.
Purpose Puts three digits into the lower corner of the display. Typically this is the time zone information.

Routine CLEAR_YEAR - $5A6F/$5970
Parameters None
Purpose blank out the 2 character year based on the current time zone date format

Routine IPUT_MONTHX - $5A3B/$593C
Parameters X - Month to be displayed
Purpose Put the leading space 2 digit month in the appropriate spot on the display based on the current time zone date format

Routine IPUT_DAYX - $5A54/$5955
Parameters X - Day to be displayed
Purpose Put the leading zero 2 digit day in the appropriate spot on the display based on the current time zone date format

Routine IPUT_YEARX - $5A74/$5975
Parameters X - Year to be displayed
Purpose Put the leading zero 2 digit year in the appropriate spot on the display based on the current time zone date format

Routine PUTHALFDATESEP - $5AA0/$59A1
Parameters None
Purpose Show the separator character for a half date (no year) based on the current date format

Routine PUTDATESEP - $5AAB/$59AC
Parameters None
Purpose Show the separator characters for a full date based on the current date format

Routine PUT_LETTERX - $5ACE/$59CF
Parameters A - Character to be displayed X - Offset on the bottom line to put character
Purpose Put a single character at the appropriate spot on the bottom line

Routine PUT_HOURX - $5AD9/$59DA
Parameters X - Hour to be displayed
Purpose Put the hour on the first two digits of the middle line along with the colon

Routine UPDATE_SECONDS - $625E/$6267
Parameters None
Purpose This routine checks the current TIC count and updates the seconds based on that TIC. If the minute rolls over, we also set the flags so that the rest of the system can respond to it.

Routine SHOW_TIME_DISPLAY - $676A/$6773
Parameters None
Purpose Display the time information based on the current time zone and whether or not we might be in time set mode. All symbols are updated

Routine PUT_YEARX - $67CC/$67D5
Parameters X - Year to be displayed
Purpose Put the leading zero 2 digit year in the appropriate spot on the display based on the current time zone date format

Routine PUT_MONTHX - $67D0/$67D9
Parameters X - Month to be displayed
Purpose Put the leading space 2 digit month in the appropriate spot on the display based on the current time zone date format

Routine PUT_DAYX - $67D4/$67DD
Parameters X - Day to be displayed
Purpose Put the leading zero 2 digit day in the appropriate spot on the display based on the current time zone date format

Routine SAY_HOURX - $67D8/$67E1
Parameters X - Hour to be displayed
Purpose Puts up the hour on the display along with an AM/PM indicator and a Colon. This code respects the current 12/24 hour format.

Routine CLEAR_PM - $6815/$681C
Parameters NONE
Purpose Turn off the PM indicator.

Routine CLEAR_AM - $681C/$6825
Parameters NONE
Purpose Turn off the AM indicator.

Routine PUT_MINUTEX - $6823/$682C
Parameters X - minute (0-59) to be displayed
Purpose This puts the minute in the middle two digits on the middle line followed by a period

Routine SHOWSEC_TENS - $6830/$6839
Parameters SECOND_TENS - Value to be put on the display
Purpose Puts the character at SECOND_TENS onto the next to the last digit on the middle line

Routine SHOWSEC_ONES - $6838/$6841
Parameters SECOND_ONES - Value to be put on the display
Purpose Puts the character at SECOND_ONES onto the last digit on the middle line

Routine SHOWNIGHT_SYM - $6840/$6849
Parameters None
Purpose Displays the night symbol if we are in night mode

Routine SAY_HOLD_TO - $6855/$685E
Parameters None
Purpose Puts 'HOLD-TO' on the top line

Routine FIX_TMAPP_DAY - $6861/$686A
Parameters None
Returns A - limited day of the month
Purpose Based on TMAPP_MONTH, TMAPP_YEAR, this rountine limits the day of the month to a legal one

Routine TMAPP_COPYTZ1 - $6881/$688A
Parameters None
Purpose Copies the Hour, Minute, Month, Day, and Year information for Time Zone 1 to the corresponding TMAPP variables.

Routine TMAPP_COPYTZ2 - $688C/$6895
Parameters None
Purpose Copies the Hour, Minute, Month, Day, and Year information for Time Zone 2 to the corresponding TMAPP variables.

Routine GETTZNAME - $6897/$68A0
Parameters None
Returns X - Pointer to the 3 character name of the current time zone

Routine GET_MONTHDAYX - $689F/$68A8
Parameters X - pointer to two byte location to retrieve Month and Day
Returns A - The current year for the current time zone
Purpose Returns the year for the current time zone

Routine GET_YEAR - $68B2/$68BB
Parameters None
Returns A - The current year for the current time zone
Purpose Returns the year for the current time zone

Routine GET_HOURFORMAT - $68BB/$68C4
Parameters None
Returns X - 12 or 24 depending on the time format
Purpose Returns the 12/24 hour time format for the current time zone

Routine GET_DATEFMT - $68CB/$68D4
Parameters None
Returns A - Date format mask for the current time zone
One of:
0 = DATEFMT_MMDDYY = Date Format is MM-DD-YY
1 = DATEFMT_DDMMYY = Date Format is DD-MM-YY
2 = DATEFMT_YYMMDD = Date Format is YY-MM-DD
and One of
0 = DATEFMT_SEPDASH = Dates are separated by dashes
4 = DATEFMT_SEPDOTS = Dates are separated by periods
Purpose Returns the date format for the current time zone

Routine CALC_DOW_X - $68D5/$68DE
Parameters X - Pointer to Month, Day, Year block
Purpose Computes the Day of the Week from the Month, Day, Year information

Routine COPY_MDY - $68DB/$68E4
Parameters X - pointer to Month, Day, Year block to copy
Purpose Copies over the Month, Day, and Year information in preparation for calling CALC_DOW

Routine ACQUIRE - $68E8/$68F1
Parameters None
Purpose Disable interrupts for a short piece of code

Routine RELEASE - $68F2/$68FB
Parameters None
Purpose Reenable interrupts

Routine GET_MONTHLEN - $68F9/$6902
Parameters PARM_MONTH, PARM_YEAR contain the month and year to look for
Returns A - Number of days in the month
Purpose Computes the number of days in a given month

Routine CHECK_TZ - $690E/$6917
Parameters None
Purpose Determine which time zone is to be displayed.
Carry flag clear = TZ1
Carry flag set = TZ2

Routine CALC_DOW - $691C/$6925
Parameters CURRENT_MONTH, CURRENT_DAY, CURRENT_YEAR - holds the information to calculate from
Returns A - Day of Week (0=Monday...6=Sunday)
Purpose Calculates the day of the week from the given information

Routine LIST_DISPLAY_CURRENT - $6ABB/$6AC4
Parameters None
Purpose Display the current list entry. List entries are up to 31 bytes long with Byte 0: Completion status. Negative numbers indicate that it is not yet done
Byte 1: The priority of the event. 0 indicates no priority
Bytes 2-26: The packed text of the message (Up to 32 bytes unpacked)
Bytes 27-31 - Wasted since they can never be unpacked

Routine INCA_WRAPX - $6B0D/$6B16
Parameters A - Number to be incremented X - Range to hold number within
Purpose Advance to the next value wrapped within a range

Routine DELAY_X - $6B31/$6B3A
Parameters X - Delay interval (Measured in ?) - Note that 1 is the only value ever passed in here
Purpose Delay for a fixed amount of time

Routine DELAY_X16 - $6B43/$6B4C
Parameters X - interval to delay for ($C8 is the only value ever passed in)
Purpose Delay for a fixed amount of time

Routine GETBCDHI - $6B52/$6B5B
Parameters X - Hex value to be converted (Range 0-99)
Returns A - High byte of number in timex ascii

Routine GETBCDLOW - $6B5A/$6B63
Parameters X - Hex value to be converted (Range 0-99)
Returns A - Low byte of number in timex ascii

Routine ALARM_CHECK - $6BC4/$6C9C
Parameters None
Purpose This routine is called once a minute to check for and raise any alarms

Routine SHOWNOTE_SYM - $6C62/$6C56
Parameters None
Purpose Displays the NOTE symbol if there is a note to be displayed

Routine SHOWALARM_SYM - $6C76/$6C6A
Parameters None
Purpose Displays the ALARM symbol if there are any enabled alarms which are not masked This will also start the alarm symbol blinking if we are in alarm backup mode

Routine ALARM_DISPLAY_CURRENT - $6EF4/$6EFD
Parameters None
Purpose Display the current alarm information on the entire display. Daily is put on the top line and the NOTE/ALARM symbols are displayed accordingly

Routine ALARM_SHOW_HOURLYNOTE - $6F39/$6F42
Parameters None
Purpose Set the note symbol to the state of the hourly chimes

Routine ALARM_SHOW_ALARMSYM - $6F4A/$6F53
Parameters ALARM_FLAGS - status of alarm to show
Purpose Set the alarm symbol to the state of the current alarm

Routine ALARM_SHOW_AMPM - $6F5B/$6F64
Parameters ALARM_FLAGS - indicates whether a 12 hour format is in AM or PM
Purpose Set the alarm symbol to the state of the current alarm

Routine MASK_ALARMS - $6FF3/$6FFC
Parameters None
Purpose This temporarily disables all alarms by turning on the mask bit (0x02) for all five alarms.

Routine UNMASK_ALARMS - $7000/$7009
Parameters None
Purpose This reenables all alarms by turning off the mask bit (0x02) for all five alarms.

Routine ANNIV_SHOW_DATE - $7184/$718D
Parameters None
Purpose Displays date for the current anniversary entry

Routine ANNIV_SHOW_SCAN_DATE - $719F/$71A8
Parameters None
Purpose Displays date for the current anniversary scan date

Routine ANNIV_SHOW_CURRENT - $71AC/$71B5
Parameters None
Purpose Displays the current anniversary entry

Routine SHOWREMIND_SYM - $71D6/$71DF
Parameters None
Purpose Displays the reminder symbol if there are any anniversarys within this week. If one is today, this will toggle the remind symbol each time this routine is called

Routine OFFREMIND_SYM - $71EE/$71F7
Parameters None
Purpose Turns off the reminder symbol

Routine SAY_NO_ANN_ENTRIES - $71F5/$71FE
Parameters None
Purpose Displays the message NO ANN ENTRIES on the display

Routine APPT_SHOW_TIME - $73D7/$73E0
Parameters SCAN_QHOUR - the quarter hour to display
Purpose This shows the appointment time on the display (including AM/PM indicator)

Routine APPT_SHOW_DATE - $7439/$7442
Parameters SCAN_MONTH,SCAN_DAY
Purpose This shows the appointment date on the display (including the day of the week)

Routine APPT_SHOW_SCAN - $7454/$745D
Parameters SCAN_MONTH,SCAN_DAY
Purpose This shows the scan date on the display (including the day of the week) with the year and a message indicating that we are scanning

Routine APPT_SHOW_CURRENT - $7461/$746A
Parameters None
Purpose This shows the next upcoming appointment (if any)

Routine APPT_SHOW_UPCOMING - $748E/$7497
Parameters None
Purpose This shows the next upcoming appointment (if any)

Routine SAY_NO_APPT_ENTRIES - $74BD/$74C6
Parameters None
Purpose This puts NO APPT ENTRIES on the display

Routine COMM_CHECK_CRC - $7C56/$7C3C
Parameters None
Returns A - 0 CRC for the current packet matched
$ff - CRC for the current packet did not match
Purpose Compute and validate a CRC for the current packet

1