;:ts=8
	far	code
	far	data
;/*  TT8 specific includes  */
;#include        <TT8.h>                 /* Tattletale Model 8 Definitions */
;#include        <tat332.h>              /* 68332 Tattletale (7,8) Hardware Definitions */
;#include        <sim332.h>              /* 68332 System Integration Module Definitions */
;#include        <qsm332.h>              /* 68332 Queued Serial Module Definitions */
;#include        <dio332.h>              /* 68332 Digital I/O Port Pin Definitions */
;#include        <tt8lib.h>              /* definitions and prototypes for Model 8 library */
;
;/*  general C includes  */
;#include        <stdio.h>
;#include        <stdlib.h>
;#include		<string.h>
;#include		<ctype.h>
;
;/*  includes for our particular program  */
;#include        "assert.h"
;#include        "logtime.h"
	dseg
	ds	0
_LATEST_LOGGER_TIME:
	ds.b	0
	dc.l	$ffffffff
	dc.l	$0000
	cseg
	dseg
	ds	0
_EARLIEST_LOGGER_TIME:
	ds.b	0
	dc.l	$0000
	dc.l	$0000
	cseg
;#include        "text_log.h"
;#include		"tputime.h"
;#ifdef SIMULATE_DATA
;#include		"AD7716.h"
;#endif
;
;#define         CHAR_BACKSPACE          0x08
;
;
;
;struct logger_time  {
;	long tick_offset;
;	long tick_rate;
;	short sync_set_flag;
;	#ifdef SIMULATE_DATA
;		//  when simulating data we need to also simulate the time in order to keep
;		//  keep the file names progressing properly.  Therefore, when time is simulated,
;		//  we co-opt the normal set and get time routines.  This variable is used to track
;		//  the starting time seconds as set by the user.  We leave as much as possible of
;		//  the normal time tracking code in as well, even though it isn't used.
;		long sim_start_secs;
;	#endif
;//	volatile unsigned long IRQ6_hits;
;} logger_time;
;
;void wait_for_IRQ6 (void);
;
;//  logger_time_power_on_init
;//
;//  Inits the time.  Starts by checking to see if the time is illegal, and
;//  if so, forcing it to a default value.  Then, asks the user if he
;//  wants to set the time.  If there is no response in a fixed length of time,
;//  assume the answer is no and move on.  If the user answers yes, allow him
;//  to set it
;//
;void logger_time_power_on_init (void)  {
# 53 'logtime.c' 659076214
| .2
	xdef	_logger_time_power_on_init
_logger_time_power_on_init:
	link	a6,#.3
	movem.l	d2/d3/d4/d5/a3,-(sp)
;	unsigned char answer;
;	struct tm tm;
;	struct tm* tp;
;	time_tt now;
;	int result;
;
;	//  reset the IRQ pin as an input.
;	PConfInp (F, 6);
~ answer d4 "C"
~ 'tm'
~ 1 10 20
~ tm_sec 0 "i"
~ tm_min 2 "i"
~ tm_hour 4 "i"
~ tm_mday 6 "i"
~ tm_mon 8 "i"
~ tm_year 10 "i"
~ tm_wday 12 "i"
~ tm_yday 14 "i"
~ tm_isdst 16 "i"
~ tm_hsec 18 "i"
~ tm -20 ":" 1
~ tp a3 "#:" 1
~ ''
~ 2 2 8
~ secs 0 "L"
~ ticks 4 "l"
~ now -28 ":" 2
~ result d5 "i"
^^^^^^^^;			PConfInpF6
	dc.w	$8b8
	dc.w	$6
	dc.w	$fa1f
	dc.w	$8b8
	dc.w	$6
	dc.w	$fa1d
;
;	#ifdef SIMULATE_DATA
;		logger_time.sim_start_secs = 0;
;	#endif
;
;	//  start by initing the structure we use to track the logger time and
;	//  setting the tick rate to give a resolution of 1 mS.
;	logger_time.tick_offset = 0;
^^^^^^^^	clr.l	_logger_time
;	logger_time.sync_set_flag = 0;
^	clr.w	_logger_time+8
;//	logger_time.IRQ6_hits = 0;
;	SetTickRate (40000);			//  choose a resolution for the tick rate
^^	pea	40000
	jsr	_SetTickRate
;	logger_time.tick_rate = GetTickRate ();    
^	jsr	_GetTickRate
	move.l	d0,_logger_time+4
;	TPU_InitializeTimeKeeping();
^	jsr	_TPU_InitializeTimeKeeping
;                                                             
;	
;	//  Now verify that the time is something reasonable.  If not, reset
;	//  it to a large value which this logger will realistically never see.
;	//
;	//  If the year is earlier than 1997, then it is obviously wrong, and we
;	//  should reset it.  If the high order bit of the number of seconds since
;	//  1970 is set, then the number appears negative and screws up the localtime()
;	//  routine, producing an unprintable and obviously incorrect date.  This is a
;	//  bug in the Aztec routines.  It corresponds roughly to the year 2038.
;	now = logger_time_get_time ();
^^^^^^^^^^^	lea	-28(a6),a0
	add.w	#4,sp
	move.l	a0,-(sp)
	jsr	_logger_time_get_time
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	tp = localtime (&now.secs);
^	pea	-28(a6)
	jsr	_localtime
	move.l	d0,a3
;	if ((tp->tm_year < 97) || (now.secs&0x80000000L))  {
^	cmp.w	#97,10(a3)
	add.w	#4,sp
	blt	.4
	move.l	-28(a6),d0
	and.l	#-2147483648,d0
	beq	.10001
.4
;	    log_printf("The starting date is unacceptable: %s", logger_time_get_string (&now));
^	pea	-28(a6)
	jsr	_logger_time_get_string
	add.w	#4,sp
	move.l	d0,-(sp)
	pea	.1+0
	jsr	_log_printf
;		tp->tm_mon = 0;
^	clr.w	8(a3)
;		tp->tm_mday = 1;
^	move.w	#1,6(a3)
;		tp->tm_year = 110;                      //  year = 2010
^	move.w	#110,10(a3)
;		tp->tm_hour = 0;
^	clr.w	4(a3)
;		tp->tm_min = 0;
^	clr.w	2(a3)
;		tp->tm_sec = 0;
^	clr.w	(a3)
;		logger_time_set_time (tp);
^	move.l	a3,-(sp)
	jsr	_logger_time_set_time
;		now = logger_time_get_time ();
^	lea	-28(a6),a0
	lea	12(sp),sp
	move.l	a0,-(sp)
	jsr	_logger_time_get_time
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;		//  the <return> is included by logger_time_get_string()
;		log_printf ("Resetting the time to %s", logger_time_get_string (&now));
^^	pea	-28(a6)
	jsr	_logger_time_get_string
	add.w	#4,sp
	move.l	d0,-(sp)
	pea	.1+38
	jsr	_log_printf
;	}
^;	
;	now = logger_time_get_time ();
	add.w	#8,sp
.10001
^^	lea	-28(a6),a0
	move.l	a0,-(sp)
	jsr	_logger_time_get_time
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	printf ("The time is: %s", logger_time_get_string (&now));
^	pea	-28(a6)
	jsr	_logger_time_get_string
	add.w	#4,sp
	move.l	d0,-(sp)
	pea	.1+63
	jsr	_printf
;	printf ("This will default to No in 30 seconds.\n");
^	pea	.1+79
	jsr	_printf
;	printf ("Do you want to set the time using the sync pulse? ");
^	pea	.1+119
	jsr	_printf
;	fflush (stdout);
^	pea	__iob+22
	jsr	_fflush
;
;	//  wait up to 30 seconds for the user to respond y or n
;	StopWatchStart ();
^^^	jsr	_StopWatchStart
;	answer = 'N';
^	move.l	#78,d4
;	while ((StopWatchTime()/1e6) < 30)  {
^	lea	20(sp),sp
.10002
	jsr	_StopWatchTime
	jsr	.Pflu#
	move.l	#$00000000,d3
	move.l	#$412e8480,d2
	jsr	.Pdiv#
	move.l	#$00000000,d3
	move.l	#$403e0000,d2
	jsr	.Pcmp#
	bge	.10003
;		if (SerByteAvail())  {
^	jsr	_SerByteAvail
	tst.w	d0
	beq	.10004
;			answer = SerGetByte ();
^	jsr	_SerGetByte
	move.b	d0,d4
;			putchar (answer);
^	move.l	__iob+22,a0
	cmp.l	__iob+26,a0
	bcc	.5
	move.l	__iob+22,a0
	add.l	#1,__iob+22
	move.b	d4,(a0)
	move.l	#0,d0
	move.b	d4,d0
	bra	.6
.5
	move.l	#0,d0
	move.b	d4,d0
	move.w	d0,-(sp)
	pea	__iob+22
	jsr	__flsbuf
	add.w	#6,sp
.6
;			answer = toupper (answer);
^	move.l	#0,d0
	move.b	d4,d0
	move.w	d0,-(sp)
	jsr	_toupper
	move.b	d0,d4
;			if ((answer == 'Y') || (answer == 'N'))
^;				break;  
	cmp.b	#89,d4
	add.w	#2,sp
	beq	.10003
	cmp.b	#78,d4
	beq	.10003
;			//  unknown answer; erase it and continue
;			putchar (CHAR_BACKSPACE);
^^^	move.l	__iob+22,a0
	cmp.l	__iob+26,a0
	bcc	.7
	move.l	__iob+22,a0
	add.l	#1,__iob+22
	move.b	#8,(a0)
	move.l	#0,d0
	move.l	#8,d0
	bra	.8
.7
	move.w	#8,-(sp)
	pea	__iob+22
	jsr	__flsbuf
	add.w	#6,sp
.8
;			fflush (stdout);
^	pea	__iob+22
	jsr	_fflush
;		}
^;	}
	add.w	#4,sp
.10004
^	bra	.10002
.10003
;	printf ("\n");
^	pea	.1+170
	jsr	_printf
;	if (answer == 'Y')  {
^	cmp.b	#89,d4
	add.w	#4,sp
	bne	.10005
;		printf ("The time will be set when the sync pulse is low.\n");
^	pea	.1+172
	jsr	_printf
;		result = logger_time_query_time (&tm);  
^	pea	-20(a6)
	jsr	_logger_time_query_time
	move.w	d0,d5
;		if (result == 0)  {
^	tst.w	d5
	add.w	#8,sp
	bne	.10006
;			//  REVIEW - change this back to the sync set when the disk is debugged
;			//
;			logger_time_sync_set_time (&tm);
^^^	pea	-20(a6)
	jsr	_logger_time_sync_set_time
;			printf ("The time is: ");
^	pea	.1+222
	jsr	_printf
;		}  else
^	add.w	#8,sp
	bra	.10007
.10006
;			printf ("Time was not changed; it is: ");       
^	pea	.1+236
	jsr	_printf
	add.w	#4,sp
.10007
;	}  else
^	bra	.10008
.10005
;		printf ("Time was not changed; it is: ");       
^	pea	.1+266
	jsr	_printf
	add.w	#4,sp
.10008
;	now = logger_time_get_time ();
^	lea	-28(a6),a0
	move.l	a0,-(sp)
	jsr	_logger_time_get_time
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	printf ("%s", logger_time_get_string (&now));
^	pea	-28(a6)
	jsr	_logger_time_get_string
	add.w	#4,sp
	move.l	d0,-(sp)
	pea	.1+296
	jsr	_printf
;	return; 
^	add.w	#8,sp
.9
	movem.l	(sp)+,d2/d3/d4/d5/a3
	unlk	a6
	rts
;}
^.2
.3	equ	-28
.1
	dc.b	84,104,101,32,115,116,97,114,116,105,110,103,32,100,97
	dc.b	116,101,32,105,115,32,117,110,97,99,99,101,112,116,97
	dc.b	98,108,101,58,32,37,115,0,82,101,115,101,116,116,105
	dc.b	110,103,32,116,104,101,32,116,105,109,101,32,116,111,32
	dc.b	37,115,0,84,104,101,32,116,105,109,101,32,105,115,58
	dc.b	32,37,115,0,84,104,105,115,32,119,105,108,108,32,100
	dc.b	101,102,97,117,108,116,32,116,111,32,78,111,32,105,110
	dc.b	32,51,48,32,115,101,99,111,110,100,115,46,10,0,68
	dc.b	111,32,121,111,117,32,119,97,110,116,32,116,111,32,115
	dc.b	101,116,32,116,104,101,32,116,105,109,101,32,117,115,105
	dc.b	110,103,32,116,104,101,32,115,121,110,99,32,112,117,108
	dc.b	115,101,63,32,0,10,0,84,104,101,32,116,105,109,101
	dc.b	32,119,105,108,108,32,98,101,32,115,101,116,32,119,104
	dc.b	101,110,32,116,104,101,32,115,121,110,99,32,112,117,108
	dc.b	115,101,32,105,115,32,108,111,119,46,10,0,84,104,101
	dc.b	32,116,105,109,101,32,105,115,58,32,0,84,105,109,101
	dc.b	32,119,97,115,32,110,111,116,32,99,104,97,110,103,101
	dc.b	100,59,32,105,116,32,105,115,58,32,0,84,105,109,101
	dc.b	32,119,97,115,32,110,111,116,32,99,104,97,110,103,101
	dc.b	100,59,32,105,116,32,105,115,58,32,0,37,115,0
	ds	0
;
;
;
;
;
;//  logger_time_get_time ()
;//
;//      Returns the time using the standard TT8 time structure, which
;//  includes a variable for fractions of a second.  Corrects for
;//  the inability of the TT8 to set the fractions of a second using
;//  an offset variable which was recorded when the user set the time
;//  using either the set_logger_time or the sync_set_logger_time
;//  routines
;//
;time_tt logger_time_get_time (void)  {
# 153
	bss	.10009,8
| .11
	xdef	_logger_time_get_time
_logger_time_get_time:
	link	a6,#.12
;	time_tt cTime;        
;	#ifdef SIMULATE_DATA
;		long ds;
;		long n_conversions;		
;		cTime.secs = logger_time.sim_start_secs;
;		//  integer math to get n_conversions
;		if (AD7716_get_n_channels () == 0)  {
;			cTime.ticks = 0;
;			return cTime;
;		}
;			
;		//  floating math + convert to int to get n seconds elapsed
;		n_conversions = AD7716_get_sim_count () / AD7716_get_n_channels();
;		ds = n_conversions / AD7716_get_conversion_rate ();
;		cTime.secs += ds;
;		cTime.ticks = GetTickRate() * ((n_conversions / AD7716_get_conversion_rate ()) - ds);
;		if (cTime.ticks == 0)  {
;			//  don't adjust time unless we have simulated a complete set of channels
;			if ((AD7716_get_sim_count () % AD7716_get_n_channels()) == 0)  {
;//				printf ("****logger_time_get_time: Reset sim count****\n");
;//				printf ("  ds = %ld\n", ds);
;//				printf ("  sim_count = %ld\n", AD7716_get_sim_count());
;//				printf ("  conversion rate = %f\n", AD7716_get_conversion_rate());
;				logger_time.sim_start_secs += ds;
;				AD7716_reset_sim_count ();
;			}	
;		}
;		return cTime;
;	#endif
;
;	//  REVIEW
;	//  We can't access the ttmnow() function unless the clock is faster than
;	//  1 MHz
;	ASSERT (SimGetFSys () > 1e6);
~ cTime -8 ":" 2
^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^;	ASSERT (GetTickRate () == logger_time.tick_rate);
^;	cTime = TPU_ttmnow();
^	lea	-8(a6),a0
	move.l	a0,-(sp)
	jsr	_TPU_ttmnow
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;
;//	printf ("Tick Offset, Ticks = %ld %ld\n",logger_time.tick_offset,cTime.ticks);
;	//  make sure the ticks aren't negative; correct if so
;	cTime.ticks -= logger_time.tick_offset;
^^^^	move.l	_logger_time,d0
	sub.l	d0,-4(a6)
;	if (cTime.ticks < 0)  {
^	tst.l	-4(a6)
	bge	.10010
;		cTime.secs--;
^	sub.l	#1,-8(a6)
;		cTime.ticks += GetTickRate();
^	jsr	_GetTickRate
	add.l	d0,-4(a6)
;	}
^;	return cTime;
.10010
^	lea	.10009,a0
	lea	-8(a6),a1
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	lea	.10009,a0
	move.l	a0,d0
.13
	unlk	a6
	rts
;}
^.11
.12	equ	-8
;
;
;
;
;//  logger_time_get_seconds (void)
;//
;//	Implements a safe version of the get_time function.  The "safe"
;//  version avoids calling the ttmnow() function, which sometimes screws
;//  up the counting of pulses which define the time.  The disadvantage
;//  of the safe version is that it is not capable of reading the ticks.
;//  The ticks variable is set to 0.
;//
;time_tt logger_time_get_seconds (void)  {
# 212
	bss	.10011,8
| .14
	xdef	_logger_time_get_seconds
_logger_time_get_seconds:
	link	a6,#.15
;	time_tt cTime;
;	
;	cTime.secs = RtcToCtm ();
~ cTime -8 ":" 2
^^^	jsr	_RtcToCtm
	move.l	d0,-8(a6)
;	cTime.ticks = 0;
^	clr.l	-4(a6)
;	return cTime;
^	lea	.10011,a0
	lea	-8(a6),a1
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	lea	.10011,a0
	move.l	a0,d0
.16
	unlk	a6
	rts
;}
^.14
.15	equ	-8
;	
;
;//  logger_time_set_time ()
;//
;//  sets the logger time immediately
;//
;void logger_time_set_time (struct tm* tp)  {
# 225
| .17
	xdef	_logger_time_set_time
_logger_time_set_time:
	link	a6,#.18
;	time_tt now;
;	ASSERT (SimGetFSys () > 1e6);
~ now -8 ":" 2
~~ tp 8 "#:" 1
^^;
;	#ifdef SIMULATE_DATA
;		logger_time.sim_start_secs = mktime (tp);
;		return;
;	#endif
;	
;	//  grab the tick offset immediately
;	now = TPU_ttmnow ();
^^^^^^^^	lea	-8(a6),a0
	move.l	a0,-(sp)
	jsr	_TPU_ttmnow
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	
;	//  then set the time, which doesn't change the offset
;	TPU_SetTimeTM (tp, NULL);
^^^	clr.l	-(sp)
	move.l	8(a6),-(sp)
	jsr	_TPU_SetTimeTM
;
;	//  and use previously acquired time to adjust the offset
;	logger_time.tick_offset = now.ticks;
^^^	move.l	-4(a6),_logger_time
;
;	//  don't allow changes in the tick rate
;	ASSERT (GetTickRate () == logger_time.tick_rate);
^^^;
;//      printf ("Returned from SetTimeTM\n");
;//      printf ("Requested time: %02d:%02d:%02d on %d/%d/%d\n", tp->tm_hour, tp->tm_min, tp->tm_sec,
;//                                                                                      tp->tm_mon, tp->tm_mday, tp->tm_year);
;//      printf ("Additional info wday = %d, yday = %d, isdst = %d, hsec = %d\n",
;//                              tp->tm_wday, tp->tm_yday, tp->tm_isdst, tp->tm_hsec);                                                                                   
;	return;
^^^^^^^	add.w	#8,sp
.19
	unlk	a6
	rts
;}
^.17
.18	equ	-8
;
;
;
;
;//  logger_time_get_string
;//
;//      Returns a pointer to a static character buffer which holds the ASCII
;//  string corrseponding to the time which was passed to this routine
;//
;//      Review: really should improve the format of this
;//
;const char wday[7][4] = {
	ds	0
	xdef	_wday
_wday:
;	"Sun",
	dc.b	83
	dc.b	117
	dc.b	110
	dc.b	0
;	"Mon",
	dc.b	77
	dc.b	111
	dc.b	110
	dc.b	0
;	"Tue",
	dc.b	84
	dc.b	117
	dc.b	101
	dc.b	0
;	"Wed",
	dc.b	87
	dc.b	101
	dc.b	100
	dc.b	0
;	"Thu",
	dc.b	84
	dc.b	104
	dc.b	117
	dc.b	0
;	"Fri",
	dc.b	70
	dc.b	114
	dc.b	105
	dc.b	0
;	"Sat"
;};
	dc.b	83
	dc.b	97
	dc.b	116
	dc.b	0
	cseg
;const char month[12][4] = {
	ds	0
	xdef	_month
_month:
;	"Jan",
	dc.b	74
	dc.b	97
	dc.b	110
	dc.b	0
;	"Feb",
	dc.b	70
	dc.b	101
	dc.b	98
	dc.b	0
;	"Mar",
	dc.b	77
	dc.b	97
	dc.b	114
	dc.b	0
;	"Apr",
	dc.b	65
	dc.b	112
	dc.b	114
	dc.b	0
;	"May",
	dc.b	77
	dc.b	97
	dc.b	121
	dc.b	0
;	"Jun",
	dc.b	74
	dc.b	117
	dc.b	110
	dc.b	0
;	"Jul",
	dc.b	74
	dc.b	117
	dc.b	108
	dc.b	0
;	"Aug",
	dc.b	65
	dc.b	117
	dc.b	103
	dc.b	0
;	"Sep",
	dc.b	83
	dc.b	101
	dc.b	112
	dc.b	0
;	"Oct",
	dc.b	79
	dc.b	99
	dc.b	116
	dc.b	0
;	"Nov",
	dc.b	78
	dc.b	111
	dc.b	118
	dc.b	0
;	"Dec"
;};
	dc.b	68
	dc.b	101
	dc.b	99
	dc.b	0
	cseg
;
;const short n_mdays[12] = {
	ds	0
	xdef	_n_mdays
_n_mdays:
;	31,
	dc.w	31
;	28,
	dc.w	28
;	31,
	dc.w	31
;	30,
	dc.w	30
;	31,
	dc.w	31
;	30,
	dc.w	30
;	31,
	dc.w	31
;	31,
	dc.w	31
;	30,
	dc.w	30
;	31,
	dc.w	31
;	30,
	dc.w	30
;	31
;};
	dc.w	31
	cseg
;	
;	
;char* logger_time_get_string (time_tt* t)  {
# 304
| .20
	xdef	_logger_time_get_string
_logger_time_get_string:
	movem.l	d2/a3/a4,-(sp)
	move.l	16(sp),a4
;	static char logger_time_string[64];
	bss	.10012,64
;	struct tm* tm;
;	long usec;
;	ASSERT (GetTickRate () == logger_time.tick_rate);
~ logger_time_string .10012 "[64c"
~ tm a3 "#:" 1
~ usec d2 "l"
~~ t a4 "#:" 2
^^^^;
;//      sprintf (logger_time_string, "%s ", ctime (&t->secs));
;//      sprintf (&logger_time_string[strlen(logger_time_string)], "%ld mSecs\n", t->ticks);
;	
;	//  Because of a bug in the Aztec localtime routines, dates in which the
;	//  number of seconds appears negative do not print correctly.  Short
;	//  circuit this bug here.
;	if (t->secs&0x80000000L)  {
^^^^^^^^	move.l	(a4),d0
	and.l	#-2147483648,d0
	beq	.10013
;		sprintf (logger_time_string, "Sometime after the year 2038.\n");
^	pea	.10+0
	pea	.10012
	jsr	_sprintf
;		return logger_time_string;
^	lea	.10012,a0
	move.l	a0,d0
	add.w	#8,sp
.21
	movem.l	(sp)+,d2/a3/a4
	rts
;	}       
^;	
;	tm = localtime (&(t->secs));
.10013
^^	move.l	a4,-(sp)
	jsr	_localtime
	move.l	d0,a3
;//      printf ("localtime returns the following values:\n");
;//      printf (" tm->tm_mon  = %d\n", tm->tm_mon);
;//      printf (" tm->tm_mday = %d\n", tm->tm_mday);
;//      printf (" tm->tm_year = %d\n", tm->tm_year);
;//      printf (" tm->tm_hour = %d\n", tm->tm_hour);
;//      printf (" tm->tm_min  = %d\n", tm->tm_min);
;//      printf (" tm->tm_sec  = %d\n", tm->tm_sec);
;//      printf (" tm->tm_wday = %d\n", tm->tm_wday);
;//      printf (" tm->tm_yday = %d\n", tm->tm_yday);
;//      printf ("seconds = %ld = 0x%08lX\n", t->secs, t->secs);
;	
;	if (tm->tm_year < 70)
^^^^^^^^^^^^;		tm->tm_year += 2000;
	cmp.w	#70,10(a3)
	add.w	#4,sp
	bge	.10014
^	lea	10(a3),a0
	add.w	#2000,(a0)
;	else
	bra	.10015
.10014
;		tm->tm_year += 1900;    
^^	lea	10(a3),a0
	add.w	#1900,(a0)
.10015
;	usec = (long)(1000000L * ((float)t->ticks / GetTickRate ()));	
^	jsr	_GetTickRate
	jsr	.Fflt#
	move.l	d0,d1
	move.l	4(a4),d0
	jsr	.Fflt#
	jsr	.Fdiv#
	move.l	#$49742400,d1
	jsr	.Fmul#
	jsr	.Ffix#
	move.l	d0,d2
;	sprintf (logger_time_string, "%s %s %2d %d @ %02d:%02d:%02d.%06ld\n",
^;												wday[tm->tm_wday],
;												month[tm->tm_mon],
;												tm->tm_mday,
;												tm->tm_year,
;												tm->tm_hour,
;												tm->tm_min,
;												tm->tm_sec,
;												usec);
	move.l	d2,-(sp)
	move.w	(a3),-(sp)
	move.w	2(a3),-(sp)
	move.w	4(a3),-(sp)
	move.w	10(a3),-(sp)
	move.w	6(a3),-(sp)
	move.w	8(a3),d0
	ext.l	d0
	asl.l	#2,d0
	lea	_month,a0
	add.l	a0,d0
	move.l	d0,-(sp)
	move.w	12(a3),d0
	ext.l	d0
	asl.l	#2,d0
	lea	_wday,a0
	add.l	a0,d0
	move.l	d0,-(sp)
	pea	.10+31
	pea	.10012
	jsr	_sprintf
;	return logger_time_string;
^^^^^^^^^	lea	.10012,a0
	move.l	a0,d0
	lea	30(sp),sp
	bra	.21
;}
^.20
.10
	dc.b	83,111,109,101,116,105,109,101,32,97,102,116,101,114,32
	dc.b	116,104,101,32,121,101,97,114,32,50,48,51,56,46,10
	dc.b	0,37,115,32,37,115,32,37,50,100,32,37,100,32,64
	dc.b	32,37,48,50,100,58,37,48,50,100,58,37,48,50,100
	dc.b	46,37,48,54,108,100,10,0
	ds	0
;
;//  logger_time_query_time
;//      user callable
;//
;//      Prompts user to enter the date and time.  Times out on inactivity.
;//  Verifies that entered date and time are legal.  Puts entered values
;//  in the tm structure which user supplies pointer to.  Returns 0 if
;//  the tm structure contains a good time value, and non-zero if it
;//  should be ignored
;//
;int logger_time_query_time (struct tm* tm)  {
# 359
| .23
	xdef	_logger_time_query_time
_logger_time_query_time:
	link	a6,#.24
	movem.l	d2/d3/d4/d5/a3,-(sp)
	move.l	8(a6),a3
;	int n, illegal;
;	char buffer[64];
;	ASSERT (GetTickRate () == logger_time.tick_rate);
~ n d4 "i"
~ illegal d5 "i"
~ buffer -64 "[64c"
~~ tm a3 "#:" 1
^^^;	
;	printf ("Please use Universal Coordinated Time, NOT local time.\n");
^^	pea	.22+0
	jsr	_printf
;	printf ("The time set operation will time out after 30 seconds of inactivity.\n");
^	pea	.22+56
	jsr	_printf
;	printf ("Hit <return> to abort the time set operation\n");
^	pea	.22+126
	jsr	_printf
;	printf ("Enter the current date and time: ");
^	pea	.22+172
	jsr	_printf
;	fflush (stdout);
^	pea	__iob+22
	jsr	_fflush
;	
;	//  wait no more than 30 seconds between input characters before
;	//  timing out
;	StopWatchStart ();
^^^^	jsr	_StopWatchStart
;	n = 0;
^	move.l	#0,d4
;	memset (buffer, 0, sizeof(buffer));
^	pea	64
	clr.w	-(sp)
	pea	-64(a6)
	jsr	_memset
;	while ((StopWatchTime()/1e6) < 30)  {
^	lea	30(sp),sp
.10016
	jsr	_StopWatchTime
	jsr	.Pflu#
	move.l	#$00000000,d3
	move.l	#$412e8480,d2
	jsr	.Pdiv#
	move.l	#$00000000,d3
	move.l	#$403e0000,d2
	jsr	.Pcmp#
	bge	.10017
;		if (SerByteAvail())  {
^	jsr	_SerByteAvail
	tst.w	d0
	beq	.10018
;			StopWatchStart ();
^	jsr	_StopWatchStart
;			buffer[n] = SerGetByte ();
^	jsr	_SerGetByte
	lea	-64(a6),a0
	move.b	d0,(a0,d4.w)
;			if (buffer[n] != CHAR_BACKSPACE)  {
^	lea	-64(a6),a0
	cmp.b	#8,(a0,d4.w)
	beq	.10019
;				putchar (buffer[n]);
^	move.l	__iob+22,a0
	cmp.l	__iob+26,a0
	bcc	.25
	lea	-64(a6),a0
	move.l	__iob+22,a1
	add.l	#1,__iob+22
	move.b	(a0,d4.w),(a1)
	move.l	#0,d0
	move.b	(a0,d4.w),d0
	bra	.26
.25
	lea	-64(a6),a0
	move.l	#0,d0
	move.b	(a0,d4.w),d0
	move.w	d0,-(sp)
	pea	__iob+22
	jsr	__flsbuf
	add.w	#6,sp
.26
;				if (buffer[n] == '\r')
^;					break;
	lea	-64(a6),a0
	cmp.b	#13,(a0,d4.w)
	beq	.10017
;				if (n < (sizeof(buffer)-1))
^^;					n++;
	cmp.w	#63,d4
	bcc	.10020
^	add.w	#1,d4
;				else
	bra	.10021
.10020
;					break;  
^^	bra	.10017
.10021
;			}  else  {
^	bra	.10022
.10019
;				if (n > 0)  {
^	tst.w	d4
	ble	.10023
;					putchar (buffer[n]);
^	move.l	__iob+22,a0
	cmp.l	__iob+26,a0
	bcc	.27
	lea	-64(a6),a0
	move.l	__iob+22,a1
	add.l	#1,__iob+22
	move.b	(a0,d4.w),(a1)
	move.l	#0,d0
	move.b	(a0,d4.w),d0
	bra	.28
.27
	lea	-64(a6),a0
	move.l	#0,d0
	move.b	(a0,d4.w),d0
	move.w	d0,-(sp)
	pea	__iob+22
	jsr	__flsbuf
	add.w	#6,sp
.28
;					buffer[n] = 0;
^	lea	-64(a6),a0
	clr.b	(a0,d4.w)
;					n--;
^	sub.w	#1,d4
;				}
^;			}
.10023
^.10022
;			fflush (stdout);
^	pea	__iob+22
	jsr	_fflush
;		}
^;	}
	add.w	#4,sp
.10018
^	bra	.10016
.10017
;	if ((StopWatchTime()/1e6) > 30)  {
^	jsr	_StopWatchTime
	jsr	.Pflu#
	move.l	#$00000000,d3
	move.l	#$412e8480,d2
	jsr	.Pdiv#
	move.l	#$00000000,d3
	move.l	#$403e0000,d2
	jsr	.Pcmp#
	ble	.10024
;		printf ("Timed out due to inactivity.\n");
^	pea	.22+206
	jsr	_printf
;		return -1;
^	move.l	#-1,d0
	add.w	#4,sp
.29
	movem.l	(sp)+,d2/d3/d4/d5/a3
	unlk	a6
	rts
;	}       
^;	buffer[n] = 0;
.10024
^	lea	-64(a6),a0
	clr.b	(a0,d4.w)
;	putchar ('\n');
^	move.l	__iob+22,a0
	cmp.l	__iob+26,a0
	bcc	.30
	move.l	__iob+22,a0
	add.l	#1,__iob+22
	move.b	#10,(a0)
	move.l	#0,d0
	move.l	#10,d0
	bra	.31
.30
	move.w	#10,-(sp)
	pea	__iob+22
	jsr	__flsbuf
	add.w	#6,sp
.31
;	fflush (stdout);
^	pea	__iob+22
	jsr	_fflush
;	
;	//  we reached this point either because of a timeout or
;	//  because the user hit <return>
;	n = sscanf (buffer, "%d/%d/%d %d:%d:%d", &tm->tm_mon, &tm->tm_mday, &tm->tm_year,
^^^^;												&tm->tm_hour, &tm->tm_min, &tm->tm_sec);
	move.l	a3,-(sp)
	lea	2(a3),a0
	move.l	a0,-(sp)
	lea	4(a3),a0
	move.l	a0,-(sp)
	lea	10(a3),a0
	move.l	a0,-(sp)
	lea	6(a3),a0
	move.l	a0,-(sp)
	lea	8(a3),a0
	move.l	a0,-(sp)
	pea	.22+236
	pea	-64(a6)
	jsr	_sscanf
	move.w	d0,d4
;	if (n != 6)  {
^^	cmp.w	#6,d4
	lea	36(sp),sp
	beq	.10025
;		printf ("Date not accepted - entry format is month/day/year hour:min:sec\n");
^	pea	.22+254
	jsr	_printf
;		return -1;
^	move.l	#-1,d0
	add.w	#4,sp
	bra	.29
;	}
^;	//  correct month for 0 based reference used by computer
;	tm->tm_mon--;
.10025
^^	sub.w	#1,8(a3)
;
;	//  allow multiple formats for the year
;	if (tm->tm_year > 1970)
^^^;		tm->tm_year -= 1900;
	cmp.w	#1970,10(a3)
	ble	.10026
^	lea	10(a3),a0
	sub.w	#1900,(a0)
;	if ((tm->tm_year < 70) && (tm->tm_year >= 0))
.10026
^;		tm->tm_year += 100;
	cmp.w	#70,10(a3)
	bge	.10027
	tst.w	10(a3)
	blt	.10027
^	lea	10(a3),a0
	add.w	#100,(a0)
;		
;	//  verify that the entered date and time are legal
;	illegal = 0;
.10027
^^^	move.l	#0,d5
;	if ((tm->tm_mon < 0) || (tm->tm_mon >= 12))
^;		illegal = 1;
	tst.w	8(a3)
	blt	.32
	cmp.w	#12,8(a3)
	blt	.10028
.32
^	move.l	#1,d5
;	if ((tm->tm_mday <= 0) || (tm->tm_mday > n_mdays[tm->tm_mon]))  {
.10028
^	tst.w	6(a3)
	ble	.33
	move.w	8(a3),d0
	ext.l	d0
	add.l	d0,d0
	lea	_n_mdays,a0
	move.w	(a0,d0.l),d0
	cmp.w	6(a3),d0
	bge	.10029
.33
;		if (((tm->tm_year%4) != 0) || (tm->tm_mon != 1) || (tm->tm_mday != 29))
^;			illegal = 1;
	move.w	10(a3),d0
	ext.l	d0
	divs.w	#4,d0
	swap	d0
	tst.w	d0
	bne	.34
	cmp.w	#1,8(a3)
	bne	.34
	cmp.w	#29,6(a3)
	beq	.10030
.34
^	move.l	#1,d5
;	}       
.10030
^;	if ((tm->tm_year < 0) || (tm->tm_year > 206))
.10029
^;		illegal = 1;
	tst.w	10(a3)
	blt	.35
	cmp.w	#206,10(a3)
	ble	.10031
.35
^	move.l	#1,d5
;	if ((tm->tm_hour < 0) || (tm->tm_hour > 23))
.10031
^;		illegal = 1;
	tst.w	4(a3)
	blt	.36
	cmp.w	#23,4(a3)
	ble	.10032
.36
^	move.l	#1,d5
;	if ((tm->tm_min < 0) || (tm->tm_min > 59))
.10032
^;		illegal = 1;
	tst.w	2(a3)
	blt	.37
	cmp.w	#59,2(a3)
	ble	.10033
.37
^	move.l	#1,d5
;	if ((tm->tm_sec < 0) || (tm->tm_sec > 59))
.10033
^;		illegal = 1;
	tst.w	(a3)
	blt	.38
	cmp.w	#59,(a3)
	ble	.10034
.38
^	move.l	#1,d5
;	if (illegal)  {
.10034
^	tst.w	d5
	beq	.10035
;		printf ("Date not accepted - illegal date entered\n");
^	pea	.22+319
	jsr	_printf
;		return -1;
^	move.l	#-1,d0
	add.w	#4,sp
	bra	.29
;	}
^;	return 0;
.10035
^	move.l	#0,d0
	bra	.29
;}       
^.23
.24	equ	-64
.22
	dc.b	80,108,101,97,115,101,32,117,115,101,32,85,110,105,118
	dc.b	101,114,115,97,108,32,67,111,111,114,100,105,110,97,116
	dc.b	101,100,32,84,105,109,101,44,32,78,79,84,32,108,111
	dc.b	99,97,108,32,116,105,109,101,46,10,0,84,104,101,32
	dc.b	116,105,109,101,32,115,101,116,32,111,112,101,114,97,116
	dc.b	105,111,110,32,119,105,108,108,32,116,105,109,101,32,111
	dc.b	117,116,32,97,102,116,101,114,32,51,48,32,115,101,99
	dc.b	111,110,100,115,32,111,102,32,105,110,97,99,116,105,118
	dc.b	105,116,121,46,10,0,72,105,116,32,60,114,101,116,117
	dc.b	114,110,62,32,116,111,32,97,98,111,114,116,32,116,104
	dc.b	101,32,116,105,109,101,32,115,101,116,32,111,112,101,114
	dc.b	97,116,105,111,110,10,0,69,110,116,101,114,32,116,104
	dc.b	101,32,99,117,114,114,101,110,116,32,100,97,116,101,32
	dc.b	97,110,100,32,116,105,109,101,58,32,0,84,105,109,101
	dc.b	100,32,111,117,116,32,100,117,101,32,116,111,32,105,110
	dc.b	97,99,116,105,118,105,116,121,46,10,0,37,100,47,37
	dc.b	100,47,37,100,32,37,100,58,37,100,58,37,100,0,68
	dc.b	97,116,101,32,110,111,116,32,97,99,99,101,112,116,101
	dc.b	100,32,45,32,101,110,116,114,121,32,102,111,114,109,97
	dc.b	116,32,105,115,32,109,111,110,116,104,47,100,97,121,47
	dc.b	121,101,97,114,32,104,111,117,114,58,109,105,110,58,115
	dc.b	101,99,10,0,68,97,116,101,32,110,111,116,32,97,99
	dc.b	99,101,112,116,101,100,32,45,32,105,108,108,101,103,97
	dc.b	108,32,100,97,116,101,32,101,110,116,101,114,101,100,10
	dc.b	0
	ds	0
;
;
;
;
;
;//  logger_time_sync_set_time ()
;//
;//  Sets the logger time on when IRQ6 drops low
;//  IRQ6 is on TPU pin 15
;//
;//  This routine will be most accurate if it is run with the
;//  clock turned up to high frequencies.  It does not actually
;//  turn the clock up itself because of the time lost as the
;//  phase locked loop locks to a new frequency.  The user should
;//  turn the clock up before calling this routine.
;//
;void logger_time_sync_set_time (struct tm* tp)  {
# 460
| .40
	xdef	_logger_time_sync_set_time
_logger_time_sync_set_time:
	link	a6,#.41
;	time_tt now;
;	
;	//  then set the time, which doesn't change the offset
;	TPU_SetTimeTM(tp, wait_for_IRQ6);
~ now -8 ":" 2
~~ tp 8 "#:" 1
^^^^	pea	_wait_for_IRQ6
	move.l	8(a6),-(sp)
	jsr	_TPU_SetTimeTM
;
;	//  grab the tick offset immediately
;	now = TPU_ttmnow ();
^^^	lea	-8(a6),a0
	add.w	#8,sp
	move.l	a0,-(sp)
	jsr	_TPU_ttmnow
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	logger_time.tick_offset = now.ticks;
^	move.l	-4(a6),_logger_time
;	ASSERT (GetTickRate () == logger_time.tick_rate);
^;	//	logger_time.tick_rate = GetTickRate ();
;
;	//  The flag is non-zero if we have set the time using the sync set function
;	//  Allows some level of error checking.  The user should always have called
;	//  this function at least once before disconnecting.
;	logger_time.sync_set_flag = 1;
^^^^^^	move.w	#1,_logger_time+8
;    printf ("sync_set: tick offset is %ld\n", logger_time_get_tick_offset());
^	jsr	_logger_time_get_tick_offset
	move.l	d0,-(sp)
	pea	.39+0
	jsr	_printf
;	return;
^	add.w	#8,sp
.42
	unlk	a6
	rts
;}
^.40
.41	equ	-8
.39
	dc.b	115,121,110,99,95,115,101,116,58,32,116,105,99,107,32
	dc.b	111,102,102,115,101,116,32,105,115,32,37,108,100,10,0
	ds	0
;
;
;
;
;
;//  logger_time_sync_get_time ()
;//
;//      Returns the time on the falling edge of the input to
;//      TPU pin 15
;//
;//  This routine will be most accurate if it is run with the
;//  clock turned up to high frequencies.  It does not actually
;//  turn the clock up itself because of the time lost as the
;//  phase locked loop locks to a new frequency.  The user should
;//  turn the clock up before calling this routine.
;//
;time_tt logger_time_sync_get_time (void)  {
# 495
	bss	.10036,8
| .44
	xdef	_logger_time_sync_get_time
_logger_time_sync_get_time:
	link	a6,#.45
;	time_tt temp;
;	
;	wait_for_IRQ6 ();        
~ temp -8 ":" 2
^^^	jsr	_wait_for_IRQ6
;		
;	//  collect the current time
;	temp = logger_time_get_time ();
^^^	lea	-8(a6),a0
	move.l	a0,-(sp)
	jsr	_logger_time_get_time
	move.l	d0,a0
	move.l	(sp)+,a1
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
;	
;	ASSERT (GetTickRate () == logger_time.tick_rate);
^^;
;	//  and return the time
;	return temp;
^^^	lea	.10036,a0
	lea	-8(a6),a1
	move.l	(a1)+,(a0)+
	move.l	(a1)+,(a0)+
	lea	.10036,a0
	move.l	a0,d0
.46
	unlk	a6
	rts
;}       
^.44
.45	equ	-8
;		
;
;
;
;int logger_time_verify_set (void)  {
# 512
| .47
	xdef	_logger_time_verify_set
_logger_time_verify_set:
;	ASSERT (GetTickRate () == logger_time.tick_rate);
^;	return logger_time.sync_set_flag;
^	move.w	_logger_time+8,d0
.48
	rts
;}
^.47
;
;
;
;
;
;
;
;//  wait_for_IRQ6
;//
;//  Waits for IRQ6 to go low.  The calling routine must have already
;//  set the the counter to 0.
;//
;//  This routine will not return until an interrupt occurs, and it 
;//  will not return if the user forgot to activate the interrupt,
;//  so don't forget it
;//
;void wait_for_IRQ6 (void)  {
# 532
| .49
	xdef	_wait_for_IRQ6
_wait_for_IRQ6:
;	//  make sure F6 is an input
;	PConfInp (F, 6);
^^;			PConfInpF6
	dc.w	$8b8
	dc.w	$6
	dc.w	$fa1f
	dc.w	$8b8
	dc.w	$6
	dc.w	$fa1d
;
;#asm
;;	save a0 before we start
;	move.l	a0,-(sp)
;;	load it with the address of Port F
;;	The address should be encoded as PORTF, defined in tat332.h and tt8lib.h,
;;	but the preprocessor doesn't seem to work on assembly code, so we hardwire
;;	it instead.
;	move.l	#$FFFFFA19,a0
;	
;;	wait for pin 6 to go high
;F6low
;	btst	#6,(a0)
;	beq		F6low
;	
;;	now wait for it to go low
;F6high		
;	btst	#6,(a0)
;	bne		F6high
;	
;;	restore a0 and return
;	move.l	(sp)+,a0
;#endasm
;	save a0 before we start
	move.l	a0,-(sp)
;	load it with the address of Port F
;	The address should be encoded as PORTF, defined in tat332.h and tt8lib.h,
;	but the preprocessor doesn't seem to work on assembly code, so we hardwire
;	it instead.
	move.l	#$FFFFFA19,a0
	
;	wait for pin 6 to go high
F6low
	btst	#6,(a0)
	beq		F6low
	
;	now wait for it to go low
F6high		
	btst	#6,(a0)
	bne		F6high
	
;	restore a0 and return
	move.l	(sp)+,a0
;
;/*
;	//  this is the equivalent C code to the assembler above.  The assembler
;	//  is much faster, which is important when we are trying to catch the
;	//  short pulses which some GPS units put out.
;	while (Pin (F, 6) == 0)
;		{;}
;	while (Pin (F, 6))
;		{;}
;*/		
;	return; 
^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^.50
	rts
;}
^.49
;
;
;
;
;long logger_time_get_tick_offset (void)  {
# 574
| .51
	xdef	_logger_time_get_tick_offset
_logger_time_get_tick_offset:
;	return logger_time.tick_offset;
^	move.l	_logger_time,d0
.52
	rts
;}
^.51
;
;void logger_time_set_tick_offset (long value)  {
# 578
| .53
	xdef	_logger_time_set_tick_offset
_logger_time_set_tick_offset:
	movem.l	d2,-(sp)
	move.l	8(sp),d2
;	ASSERT (value >= 0);
~~ value d2 "l"
^;	ASSERT (value < 40000L);
^;	
;	if ((value >= 0) && (value < 40000))
^^;		logger_time.tick_offset = value;
	tst.l	d2
	blt	.10037
	cmp.l	#40000,d2
	bge	.10037
^	move.l	d2,_logger_time
;		
;//	printf ("time routines: setting tick offset to %ld\n", logger_time.tick_offset);
;	return;	
.10037
^^^.54
	movem.l	(sp)+,d2
	rts
;}		
^.53
;
# 587
|
~ _n_mdays * "[12i"
~ _month * "[12[4c"
~ _wday * "[7[4c"
~ _logger_time_get_seconds * "(:" 2
~ _wait_for_IRQ6 * "(v"
~ 'logger_time'
~ 3 3 10
~ tick_offset 0 "l"
~ tick_rate 4 "l"
~ sync_set_flag 8 "i"
~ _logger_time * ":" 3
~ _TPU_InitializeTimeKeeping * "(v"
~ _TPU_SetTimeTM * "(v"
~ _TPU_ttmnow * "(:" 2
~ _log_printf * "(i"
~ 'text_log'
~ 4 5 1068
~ filename 0 "[32c"
~ data 32 "[1024c"
~ n_data 1056 "i"
~ n_filled 1058 "i"
~ oldest_data 1060 ":" 2
~ _logger_time_set_tick_offset * "(v"
~ _logger_time_get_tick_offset * "(l"
~ _logger_time_verify_set * "(i"
~ _logger_time_query_time * "(i"
~ _logger_time_get_string * "(#c"
~ _logger_time_sync_get_time * "(:" 2
~ _logger_time_sync_set_time * "(v"
~ _logger_time_set_time * "(v"
~ _logger_time_get_time * "(:" 2
~ _logger_time_power_on_init * "(v"
~ EARLIEST_LOGGER_TIME _EARLIEST_LOGGER_TIME ":" 2
~ LATEST_LOGGER_TIME _LATEST_LOGGER_TIME ":" 2
~ _toupper * "(i"
~ _memset * "(#v"
~ ''
~ 5 2 8
~ quot 0 "l"
~ rem 4 "l"
~ ''
~ 6 2 4
~ quot 0 "i"
~ rem 2 "i"
~ ldiv_t ":" 5
~ div_t ":" 6
~ '__stdio'
~ 7 8 22
~ _bp 0 "#C"
~ _bend 4 "#C"
~ _buff 8 "#C"
~ _flags 12 "I"
~ _unit 14 "c"
~ _bytbuf 15 "C"
~ _buflen 16 "L"
~ _tmpnum 20 "I"
~ __flsbuf * "(i"
~ _sscanf * "(i"
~ _sprintf * "(i"
~ _printf * "(i"
~ _fflush * "(i"
~ __iob * "[0:" 7
~ FILE ":" 7
~ fpos_t "l"
~ va_list "#c"
~ ''
~ 8 13 46
~ libVersion 0 "l"
~ ramBase 4 "#c"
~ ramSize 8 "l"
~ ramWaits 12 "i"
~ flashBase 14 "#c"
~ flashSize 18 "l"
~ flashWaits 22 "i"
~ heapBot 24 "#v"
~ heapTop 28 "#v"
~ heapCur 32 "#v"
~ statusReg 36 "I"
~ vectorBase 38 "#v"
~ stackPtr 42 "#v"
~ infoAction "c"
~ TT8info ":" 8
~ UeeErr "c"
~ _GetTickRate * "(l"
~ _SetTickRate * "(i"
~ _StopWatchTime * "(L"
~ _StopWatchStart * "(v"
~ time_tt ":" 2
~ _SerByteAvail * "(i"
~ _SerGetByte * "(i"
~ _RtcToCtm * "(L"
~ XmdmErr "c"
~ FlashErr "c"
~ ''
~ 9 4 24
~ eSR 0 "I"
~ ePC 2 "L"
~ vectofs 6 "I"
~ states 8 "[8I"
~ ''
~ 10 4 20
~ preamble 0 "[4I"
~ jump 8 "I"
~ target 10 "L"
~ postamble 14 "[3I"
~ ExcCFramePtr "#:" 10
~ ExcCFrame ":" 10
~ ExcStackFrame ":" 9
~ _localtime * "(#:" 1
~ time_t "L"
~ clock_t "L"
~ wchar_t "c"
~ ptrdiff_t "l"
~ size_t "L"
~ bool "c"
~ vfptr "#(v"
~ ptr "#c"
~ ulpv "#L"
~ ulong "L"
~ uspv "#I"
~ unsint "I"
~ ushort "I"
~ ucpv "#C"
~ uchar "C"
	xref	_TPU_InitializeTimeKeeping
	xref	_TPU_SetTimeTM
	xref	_TPU_ttmnow
	xref	_log_printf
	xref	_toupper
	xref	_memset
	xref	__flsbuf
	xref	_sscanf
	xref	_sprintf
	xref	_printf
	xref	_fflush
	xref	_GetTickRate
	xref	_SetTickRate
	xref	_StopWatchTime
	xref	_StopWatchStart
	xref	_SerByteAvail
	xref	_SerGetByte
	xref	_RtcToCtm
	xref	_localtime
	xref	.begin
	dseg
	global	_logger_time,10
	xref	__iob
	end
