/*
 * TTA script  Version 0.0 23FEB84
 */

/*
 * The only emulator dependent portion of this script is the
 * if-endif section located in general-triggers-events under the
 * bus field.  It determines the proper keynotes script describing
 * valid bus signal names for the given processor.  If a new processor
 * deviates from any of the listed symbol menus, a new entry must be added.
 */

/*
 * TNIX/Unix/VMS Version
 * Keyshell Version Number 3
 */

/*
 * Include files used by the preprocessor
 */

#ifndef _TNIX
tta
#else
#include <defines>
main
#endif
{
>
> \uCommonly used TTA features/applications are:\n
>
> \kstatus\e - Displays current programming of the TTA.
> \kbkpt\e - Sets up breakpoint on address or data only.
> \kview acq\e - Displays contents of TTA acquisition memory.
> \ktrace prg\e - Traces a code segment.
> \kcounting\e - Performs: counting of events, time spent in a range,
>             total elapsed time from start to breakpoint, count while
>             true and start counting after trigger occurs.
> \krun code\e - Executes user code.
>
> \uMore general control is available under:\n
>
> \kgeneral\e - Performs detailed setup of triggers, breakpoints, acquisition 
>             and arming. \uDDL users would typically use\n \kgeneral\e.
>

msg (^TTA - top level);
f1;status; {
>
> \kall\e - Displays current programming for every TTA feature.
>
> \ktriggers\e - Displays event and counter programming only.
>
> \kevents\e - Displays event programming only.
>
> \kcounters\e - Displays counter programming only.
>
> \kbkpts\e - Displays breakpoint programming only.
>
> \kacq\e - Displays acquisition programming only.
>

	msg (^View current TTA setup:);
	f1;all;cmd (^ts ), exec, break;
	f2;triggers;{
>
		cmd (^ts ),
		msg (^Which trigger? %%), exec, break (2);
		f1;1 ; cmd (1 );
		f2;2 ; cmd (2 );
		f3;3 ; cmd (3 );
		f4;4 ; cmd (4 );
		f5;all; cmd ( );
		f7;manual; man(ts);
		f8;done; break;
		};
	f3;events; {
>
		cmd (^ts -e ),
		msg (^Which event? %%), exec, break (2);
		f1;1 ; cmd (1 );
		f2;2 ; cmd (2 );
		f3;3 ; cmd (3 );
		f4;4 ; cmd (4 );
		f5;all; cmd ( );
		f7;manual; man (ts); 
		f8;done; break;
		};
	f4;counters; {
>
		cmd (^ts -c ),
		msg (^Which counter? %%), exec, break (2);
		f1;1 ; cmd (1 );
		f2;2 ; cmd (2 );
		f3;3 ; cmd (3 );
		f4;4 ; cmd (4 );
		f5;all; cmd ( );
		f7;manual; man (ts); 
		f8;done; break;
		};
	f5;bkpts;cmd (^bre ),exec, break;
	f6;acq;cmd (^acq ),exec, break;
	f7;manual; man (ts);
	f8;done; break;
};
f2;bkpt; {
>
> This tree sets up a breakpoint on a single address or data value only.
> Use \kgeneral\e \ktriggers\e for more complex event definition.
>
> \kstatus\e - Displays current breakpoint programming.
>
> \kset\e - Sets up a simple address only or data only breakpoint.
>
> \kremove\e - Removes a breakpoint.
>
	msg (^Select: %%), next;
	f1;status; cmd (^bre), exec, break(0);
	f2;set; {
>
		cmd (^eve -s ),
		msg (^Select breakpoint: %%), next;
		f1;1; cmd (1 clr );
		f2;2; cmd (2 clr );
		f3;3; cmd (3 clr );
		f4;4; cmd (4 clr );
		f7;manual; man(eve);
		f8;done; cmd (^), break;
		},{
>
		msg (^Break on what? %%);
		f1;address; {
>
			cmd (a=), msg (^Enter breakpoint address: %P),exec, break (2);
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man(eve);
			f8;done; cmd (^), break (2);
			};
		f2;data; {
>
			cmd (d=), msg (^Enter data value: %P), exec, break(2);
			f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f7;manual; man(eve);
			f8;done; cmd (^), break (2);
			};
		f7;manual; man(eve);
		f8;done; cmd (^), break;
		};
	f3;remove; {
>
		cmd (^eve ),
		msg (^Remove which breakpoint: %%), exec, break;
		f1;1; cmd (1 clr;bre 1 clr);
		f2;2; cmd (2 clr; bre 2 clr);
		f3;3; cmd (3 clr; bre 3 clr);
		f4;4; cmd (4 clr; bre 4 clr);
		f5;all; cmd (all clr; bre all clr);
		f7;manual; man(eve);
		f8;done; cmd (^), break;
		};
	f7;manual; man(eve);
	f8;done; break;
	};
f3;view acq; {
>
> The TTA has an acquisition memory that can store up to 255 transactions.
> 
> \kcurrent\e - Displays acquisitions stored during latest emulator start/stop.
>
> \kall 255\e - Displays entire acquisition memory contents.
>
> \klast n\e - Displays last n TTA acquisitions.
>

	cmd (^disp ),
	msg (^Display what part of acquisition memory: %%), next;
	f1;current; cmd ( );
	f2;all 255; cmd (-a );
	f3;last n; {
>
		cmd ( ), msg (^View last n acquisitions. Enter n: %P), next (2);
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man (disp);
		f8;done; break;
		};
	f7;manual; man(disp);
	f8;done; cmd (^), break;
	}, {
>
	cmd ( ) ,
	msg (^Output to? %%);
	f1; screen; cmd ( ),exec, break;
	f2; file; {
>
		cmd (>), msg (^Enter filename: %F),exec,break (2);
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man (disp);
		f8;done; break;
		};
	f3;printer; 
#ifdef _TNIX
		cmd (| lp1r), 
#else
		cmd (| lpr), 
#endif
		exec, break;
	f7;manual; man(disp);
	f8;done; cmd (^), break;
	};
f4;trace prgm; {
>
>  The TTA can cause a register trace line to be printed to the terminal
>  whenever a TTA event is detected.  This is useful if you wish to
>  "trace" behavior within a certain address range.  The emulator
>  runs real-time until the event is detected; it is stopped
>  while the register line is printed, then started up again.
>
> \kstatus\e - Reviews current event and breakpoint usage.
>
> \ksetup\e -  Prompts the user for the range of addresses to be traced.
>
	msg (^Select:);
	f1;status; msg (^Review current event and breakpoint usage),
		cmd (^ts -e; bre),exec;
	f2;setup; {
>
		cmd (^eve -c ),
		msg (^Use which event? %%), next;
		f1;1; cmd (1 clr a=);
		f2;2; cmd (2 clr a=);
		f3;3; cmd (3 clr a=);
		f4;4; cmd (4 clr a=);
		f7;manual; man(eve);
		f8;done;break;
		},{
>
		msg (^Trace from starting address of: %P), next;
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man(eve);
		f8;done; cmd, break(2);
		},{
>
		msg ( to ending address of: %P), exec, break (2); 
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man(eve);
		f8;done; break;
		};
	f7;manual;man(eve);
	f8;done; cmd (^), break;
	};
f5;counting; {
>
> \kcount eve\e - Counts the number of times event n occurs during an
>             emulator session.
>
> \ktime code\e - Times a segment of code from a starting address defined
>             on event 1, to an ending address defined on event 2.
>
> \kuntil bkpt\e - Counts all source clocks that occur during execution.
>
> \kwhile true\e - Counts all source clocks that occur while a trigger is true.
>
> \kafter trigger\e - Counts all source clocks that occur after a selected
>             trigger has occurred.
>

	msg (^Select:);
	f1;count events; {
>
>\kstatus\e - Displays the current event and breakpoint status.
>
>\kyes\e - Current event and breakpoint status are satisfactory.  Proceed.
>
>\kno\e - Current event and breakpoint status are unsatisfactory.  Return
>            to tta top level.
>
>       \mnote\n - To define event, use \kgeneral\e key at tta top level.
>
		msg (^Event and breakpoint defined? %%);
		f1;status; cmd (^ts -e;bre),exec;
		f2;yes; cmd (^), next;
		f3;no; msg (^Please define event and breakpoint before continuing), sly (sleep 3), break (2);
		f8;done; break;
		},{
> 
		cmd (^cou ),
		msg (^Use which counter? %%), next;
		f1;1; cmd (1 clr s=);
		f2;2; cmd (2 clr s=);
		f3;3; cmd (3 clr s=);
		f4;4; cmd (4 clr s=);
		f7;manual; man (cou);
		f8;done; break;
		},{
>
		msg ( to count which event? %%),exec, next;
		f1;1; cmd (ev1);
		f2;2; cmd (ev2);
		f3;3; cmd (ev3);
		f4;4; cmd (ev4);
		f7;manual; man(cou);
		f8;done; break;
		},{
>
> The program will be executed and the counter contents will be
> automatically retrieved.
> 
> \kgo PC\e - Start execution at the current Program Counter location.
>            (where your program stopped last).  You can determine where 
>            that is by typing in the 'ds' command.
>
> \kgo addr\e - Prompts you for the address to start execution from.
>
		msg (^Get results.  Select: %%);
		f1;go PC; cmd (^g), exec, next;
		f2;go addr; {
>
			cmd (^g ), 
			msg (^Enter address: %P), exec, next(2);
		 	f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f8;done; break;
			};
		f8;done;break;
		},{
>
		msg (^Retrieving current counter contents),
		cmd (^ts -c),exec,break ;
		f8;done; break;
		};
	f2;time code; {
>
> The TTA will use triggers 1 and 2 to define the boundary points of
> a code segment, and will measure the elapsed time from event 1 to
> event 2.  \uAny current programming on events 1 and 2 will be lost.\n
>
		cmd (^tclr 1 2), exec,
		cmd (^eve 1 a=),
		msg (^Time code segment from starting address of %P), exec,
		 next;
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man (eve);
		f8;done; break;
		},{
>
		cmd (^eve -s 2 a=),
		msg (^ to ending address of %P), exec,
		cmd (^cou 2 clr v=0 o=arm g=seqh s=), next;
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man (eve);
		f8;done; break;
		},{
>
> Once you have gone through this tree, you may find that the current
> value of the counter is either 0 or 65535.
>
> A current counter value of 0 may indicate one of the following:
> -  Event 1 never occurred.  
> -  The counter source clock is too large.  Select a smaller unit.
>    
> A current counter value of 65535 indicates that the source clock
> is too small.  Select a larger unit.
>
		msg (^Select time unit: %%),
		exec, next;
		f1;200nsec; cmd (200nsec);
		f2;2usec; cmd (2usec);
		f3;20usec; cmd (20usec);
		f4;200usec; cmd (200usec);
		f5;2msec; cmd (2msec);
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> The program will be executed, and the counter contents will be
> automatically retrieved.  
>
> \kgo PC\e - Start execution at the current Program Counter location.
>            (where your program stopped last).  You can determine where 
>            that is by typing in the 'ds' command.
>
> \kgo addr\e - Prompts you for the address to start execution from.
>
		msg (^Get results.  Select: %%);
		f1;go PC; cmd (^g), exec, next;
		f2;go addr; {
>
			cmd (^g ), 
			msg (^Enter address: %P), exec, next(2);
		 	f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f8;done; break;
			};
		f8;done;break;
		},{
		msg (^Retrieving current counter contents),
		cmd (^ts 2 -c|grep urrent),exec,break ;
		f7;manual; man (cou);
		f8;done; break;
		};
	f3;until bkpt;{
>
> The selected counter will count all occurrences of the indicated
> source clock during the execution of the program.
>
		cmd (^cou ),
		msg (^Use which counter? %%), next;
		f1;1; cmd (1 clr v=0 o=arm  s=);
		f2;2; cmd (2 clr v=0 o=arm  s=);
		f3;3; cmd (3 clr v=0 o=arm  s=);
		f4;4; cmd (4 clr v=0 o=arm  s=);
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Valid source parameters are:
>
>    \m200nsec\n....200 nsec clock intervals    \mev1\n....event 1
>    \m2usec\n......2 usec clock intervals      \mev2\n....event 2
>    \m20usec\n.....20 usec clock intervals     \mev3\n....event 3
>    \m200usec\n....200 usec clock intervals    \mev4\n....event 4
>    \m2msec\n......2 msec clock intervals      \macq\n....acquisitions
>    \mtrig1\n......trigger 1                   \mcyc\n....emulator bus cycle
>    \mtrig2\n......trigger 2                   \mqua\n....event qualifier
>    \mtrig3\n......trigger 3                   \memuclk\n.emulator clocks
>    \mtrig4\n......trigger 4
>
> Events are tested and cleared on every processor cycle, while triggers
> are not cleared until the trigger condition is false.  For example, if
> the event is the occurrence of the data byte 00, and 3 consecutive 00
> occur, there will be 3 events and 1 trigger seen.
>
		msg (^Enter source: ) ,
		call, sly (shiftkey 4), return,
		msg (%P), exec, next;
		f1;;hist;
		f2;;hist;
		f3;;hist;
		f4;;hist;
		f5;;hist;
		f6;;hist;
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Your program will be executed, and the counter contents will be
> automatically retrieved.  
>
> \kgo PC\e - Start execution at the current Program Counter location.
>             (where your program stopped last).  You can determine where 
>             that is by typing in the 'ds' command.
>
> \kgo addr\e - Prompts you for the address to start execution from.
>
		msg (^Get results.  Select: %%);
		f1;go PC; cmd (^g), exec, next;
		f2;go addr; {
>
			cmd (^g ), 
			msg (^Enter address: %P), exec, next(2);
		 	f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f8;done; break;
			};
		f8;done;break;
		},{
>
		msg (^Retrieving current counter contents),
		cmd (^ts -c),exec,break ;
		f7;manual; man (cou);
		f8;done; break;
		};
	f4;while true;{
>
> The counter will count all occurrences of the indicated source clock 
> that occur while the indicated trigger is true.  For example, count all
> interrupts received while probe bit 0 is true.
> 
		cmd (^cou ),
		msg (^Count while which trigger is true? %%), next;
		f1;trig 1; cmd (2 clr v=0 o=arm g=trigh  s=);
		f2;trig 2; cmd (3 clr v=0 o=arm g=trigh  s=);
		f3;trig 3; cmd (4 clr v=0 o=arm g=trigh  s=);
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Valid source parameters are:
>
>    \m200nsec\n....200 nsec clock intervals    \mev1\n....event 1
>    \m2usec\n......2 usec clock intervals      \mev2\n....event 2
>    \m20usec\n.....20 usec clock intervals     \mev3\n....event 3
>    \m200usec\n....200 usec clock intervals    \mev4\n....event 4
>    \m2msec\n......2 msec clock intervals      \macq\n....acquisitions
>    \mtrig1\n......trigger 1                   \mcyc\n....emulator bus cycle
>    \mtrig2\n......trigger 2                   \mqua\n....event qualifier
>    \mtrig3\n......trigger 3                   \memuclk\n.emulator clocks
>    \mtrig4\n......trigger 4
>
> Events are tested and cleared on every processor cycle, while triggers
> are not cleared until the trigger condition is false.  For example, if
> the event is the occurrence of the data byte 00, and 3 consecutive 00
> occur, there will be 3 events and 1 trigger seen.
>
		msg (^Enter source: ) ,
		call, sly (shiftkey 4), return,
		msg (%P), exec, next;
		f1;;hist;
		f2;;hist;
		f3;;hist;
		f4;;hist;
		f5;;hist;
		f6;;hist;
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Your program will be executed, and the counter contents will be
> automatically retrieved.  
>
> \kgo PC\e - Start execution at the current Program Counter location.
>             (where your program stopped last).  You can determine where 
>             that is by typing in the 'ds' command.
>
> \kgo addr\e - Prompts you for the address to start execution from.
>
		msg (^Get results.  Select: %%);
		f1;go PC; cmd (^g), exec, next;
		f2;go addr; {
>
			cmd (^g ), 
			msg (^Enter address: %P), exec, next(2);
		 	f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f8;done; break;
			};
		f8;done;break;
		},{
		msg (^Retrieving current counter contents),
		cmd (^ts -c),exec,break ;
		f7;manual; man (cou);
		f8;done; break;
		};
	f5;after trigger;{
>
> The counter will count all occurrences of the indicated source clock 
> after the indicated trigger.
> 
		cmd (^cou ),
		msg (^Start counting after which trigger occurs? %%), next;
		f1;trig 1; cmd (2 clr v=0 o=arm g=seqh  s=);
		f2;trig 2; cmd (3 clr v=0 o=arm g=seqh  s=);
		f3;trig 3; cmd (4 clr v=0 o=arm g=seqh  s=);
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Valid source parameters are:
>
>    \m200nsec\n....200 nsec clock intervals    \mev1\n....event 1
>    \m2usec\n......2 usec clock intervals      \mev2\n....event 2
>    \m20usec\n.....20 usec clock intervals     \mev3\n....event 3
>    \m200usec\n....200 usec clock intervals    \mev4\n....event 4
>    \m2msec\n......2 msec clock intervals      \macq\n....acquisitions
>    \mtrig1\n......trigger 1                   \mcyc\n....emulator bus cycle
>    \mtrig2\n......trigger 2                   \mqua\n....event qualifier
>    \mtrig3\n......trigger 3                   \memuclk\n.emulator clocks
>    \mtrig4\n......trigger 4
>
> Events are tested and cleared on every processor cycle, while triggers
> are not cleared until the trigger condition is false.  For example, if
> the event is the occurrence of the data byte 00, and 3 consecutive 00
> occur, there will be 3 events and 1 trigger seen.
>
		msg (^Enter source: ) ,
		call, sly (shiftkey 4), return,
		msg (%P), exec, next;
		f1;;hist;
		f2;;hist;
		f3;;hist;
		f4;;hist;
		f5;;hist;
		f6;;hist;
		f7;manual; man (cou);
		f8;done; break;
		},{
>
> Your program will be executed, and the counter contents will be
> automatically retrieved.  
>
> \kgo PC\e - Start execution at the current Program Counter location.
>             (where your program stopped last).  You can determine where 
>             that is by typing in the 'ds' command.
>
> \kgo addr\e - Prompts you for the address to start execution from.
>
		msg (^Get results.  Select: %%);
		f1;go PC; cmd (^g), exec, next;
		f2;go addr; {
>
			cmd (^g ), 
			msg (^Enter address: %P), exec, next(2);
		 	f1;; hist;
			f2;; hist;
			f3;; hist;
			f4;; hist;
			f5;; hist;
			f6;; hist;
			f8;done; break;
			};
		f8;done;break;
		},{
		msg (^Retrieving current counter contents),
		cmd (^ts -c),exec,break ;
		f7;manual; man (cou);
		f8;done; break;
		};
	f7;manual; man(cou);
	f8;done;break;
	};
f6;run code; {
>
> \kgo PC\e - Start program at address currently pointed to by program counter.
>            (that is, start up where it stopped)
>
> \kgo addr\e - Start program at an address specified by the user.
>
> If your emulator requires special register manipulation before execution
> can begin, either enter it manually or return to the debug level and use
> the emulator dependent run key.
>
	msg (^Select: %%);
	f1;go PC; cmd (^g), exec, break;
	f2;go addr; {
>
		cmd (^g ), msg (^Enter start address: %P), exec, break(2);
		f1;; hist;
		f2;; hist;
		f3;; hist;
		f4;; hist;
		f5;; hist;
		f6;; hist;
		f7;manual; man (g);
		f8;done; break;
		};
	f7;manual; man(g);
	f8;done;break;
	};
f7;general;  {
>
> \ktriggers\e - Sets up or clears events and/or counters
>
> \kbkpt only\e - Sets up or clears breakpoint capability only
>
> \kacqmem\e - Selects qualification, trigger position for acquisition memory
>
> \kclear\e - Clears triggers, events only, counters only, bkpts only,
>            acquisition only or everything
>
> \k1 arms 2\e - Delays the activation of trigger 2 until trigger 1 has
>            occurred.  \uAssumes event 1 and event 2 are already set up.\n
>            Trigger 2 will cause the breakpoint.
>

	msg (^Setup programming for:);
	f1;triggers; {
>
> \kevent\e - Defines any combination of address, data, selected bus
>            signals, probe inputs, counter feedback patterns or
>            event qualifier inputs.
>
> \kcounter\e - Allows general counter control.
>
		msg (^Define:);
		f1;event; {
>
> \k1-4\e - Allow you to select a specific event.
>
> \kall clr\e - Allows you to clear all four events.
>
			cmd (^eve ), msg (^Which event? %%), next;
			f1;1 ; cmd (1 );
			f2;2 ; cmd (2 );
			f3;3 ; cmd (3 );
			f4;4 ; cmd (4 );
			f5;all clr; cmd (all clr ), exec, msg (^Define:), break;
			f7;manual; man(eve);
			f8;done; break;
			}, {
>
> \kclear\e - Clears selected event, and returns to event/counter level.
>
> \kredefine\e - Clears selected event and continues on.
>
> \kmod field\e - Does not alter current programming of selected event
>             and will add/modify fields as indicated.
>
			msg (^Select: %%),next;
			f1;clear; cmd (clr ), exec, msg (^Define:), break;
			f2;redefine; cmd (clr );
			f3;mod field; cmd ( );
			f7;manual;man(eve);
			f8;done; break;
			}, {
> The event portion of each trigger has 6 fields:
>
> \kaddress\e - Defines address: equal to, not equal to, range, don't cares
> \kdata\e - Has the same capabilities as the address field.
> \kbus\e - Defines selected emulator bus signals.
> \kprobe\e - 8 external probe bits are available for the user through
>           the Data Acquisition Interface.  
> \kevt qual\e - A pulse from an external device may be fed into the TTA
>           through the event qualifier BNC on the Data Acquisition Interface.
> \kctr\e - The 4 counter outputs are fed back into each event detector.
> 
> Default condition for all fields is don't care.  You may use as many
> fields as needed to define a single event.
>

			msg (^Use f8 to end event definition.  Select field: %%);
			f1;address; { 
> 
> \kequal to\e - Finds all occurrences of the specific address.
>
> \kin range\e - Finds all occurrences of addresses in the specified range.
>
> \kdont care\e - Allows the entry of don't care bits (x), any radix.
>
> \knot equal\e - Finds all addresses not equal to the indicated address.
>
> \knot range\e - Finds all addresses not in the indicated range.
>
> Numeric values (0f000) and expressions (0f000+2be-3a) may be used for
> each type of address detection except dont care.  If symbolic debug
> is used, symbolic references are acceptable.  Numbers are assumed to be
> hexadecimal unless a radix is specified.
>
				msg (^Select address comparison: %%),
				cmd ( );
				f1;equal to; {
>
> Examples of valid input are: 1234, LABEL_1, LABEL_1+23
>
					cmd (a=),
					msg (^Enter address: %P), break (2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f2;in range; {
>
> Examples of valid input are: START, START+OFFSET-3, 0f000.
>
					cmd (a=), 
					msg (^From starting address: %P), next;
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					},{
>
> Examples of valid input are: START, START+OFFSET-3, 0f000.
>
					msg ( to ending address: %P),break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f3;dont care; {
>
> Examples of valid input are: 123X, 00001x1x00000x0xY, 0xxf0
>
					cmd (a=),
					msg (^Enter address, e.g., 12X4: %P), break(2);	
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f4;not equal; {
>
> Examples of valid input are: START, START+OFFSET-3, 0f000.
>
					cmd (an=),
					msg (^Enter address: %P), break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f5;not range; {
>
> Examples of valid input are: START, START+OFFSET-3, 0f000.
>
					cmd (an=), 
					msg (^From starting address: %P), next;
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					},{
>
					msg ( to ending address: %P),break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f2;data; { 
> 
> \kequal to\e - Finds all occurrences of the specific data value.
>
> \kin range\e - Finds all occurrences of data values in the specified range.
>
> \kdont care\e - Allows the entry of don't care bits (x), any radix.
>
> \knot equal\e - Finds all data values not equal to the indicated value.
>
> \knot range\e - Finds all data values not in the indicated range.
>
> Numeric values (0f0) and expressions (0f0+2b-3a) may be used for
> each type of data detection except \kdont care\e.  Numbers are assumed to 
> be hexadecimal unless a radix is specifed.
>
				cmd ( ), msg (^Select data comparison: %%);
				f1;equal to; {
>
> Examples of valid input are:  0f0, 43-0f.
>
					cmd (d=),
					msg (^Enter data value: %P), break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f2;in range; {
>
> Examples of valid input are:  0f0, 43-0f.
>
					cmd (d=), 
					msg (^From starting data: %P), next;
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					},{
>
> Examples of valid input are:  0f0, 43-0f.
>
					msg ( to ending data: %P),break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f3;dont care; {
>
> Examples of valid input are:  0fX, 000011xx.
>
					cmd (d=),
					msg (^Enter data, e.g., 2X: %P), 
					break(2);	
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f4;not equal; {
>
> Examples of valid input are:  0f0, 43-0f.
>
					cmd (dn=),
					msg (^Enter data: %P), break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f5;not range; {
					cmd (dn=), 
>
> Examples of valid input are:  0f0, 43-0f.
>
					msg (^From starting data: %P), next;
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					},{
>
> Examples of valid input are:  0f0, 43-0f.
>
					msg ( to ending data: %P),break(2);
					f1;; hist ;
					f2;; hist ;
					f3;; hist ;
					f4;; hist ;
					f5;; hist ;
					f6;; hist ;
					f7;manual; man(eve);
					f8;done; cmd, break(3);
					};
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f3;bus; {
#if (_micro == _8086uP || _micro == _8087uP)
>
> Valid 8086/8087 bus signal symbols are:
>
>    \mf\n.....First Fetch             \mint\n...Interrupt    
>    \mfs\n....Subsequent fetch        \mia\n....Interrupt acknowledge   
>    \mir\n....I/O read                \mes\n....Extra segment
>    \miw\n....I/O write               \mss\n....Stack segment
>    \mrd\n....Memory read             \mcs\n....Code segment 
>    \mwt\n....Memory write            \mds\n....Data segment 
>    \mht\n....Halt                    \mbhe\n...Bus High Enable
>    \mlck\n...Lock                    \mtst\n...Test
>
> TTA looks for \usimultaneous\n occurrences of listed symbols.
>
> Example:  b=cs wt   (Memory write to a code segment)
>
#else
#if (_micro == _Z8001uP || _micro == _Z8002uP)

>
> Valid Z8001/2 bus signal symbols are:
>
>    \mf\n......Fetch                   \mrf\n....refresh
>    \mf2\n.....Second fetch            \ms\n.....any system mode operation
>    \mrd\n.....Memory read             \mn\n.....any normal mode operation
>    \mwt\n.....Memory write            \md\n.....any data operation
>    \mnio\n....normal I/O              \mst\n....any stack operation
>    \msio\n....special I/O             \mcd\n....any code operation
>    \mby\n.....byte operation          \mnc\n....normal code
>    \mwd\n.....word operation          \mnd\n....normal data
>    \mvi\n.....vectored interrupt      \mns\n....normal stack
>    \mvia\n....VI acknowledge          \msc\n....system code
>    \mnvi\n....non-vectored interrupt  \msd\n....system data
>    \mnvia\n...NVI acknowledge         \mss\n....system stack
>    \mnmia\n...non-maskable interrupt  \mmi\n....micro-input
>
> TTA looks for \usimultaneous\n occurrences of listed symbols.
>
> Example:  b=d wt   (Memory write to any data space)
>
#else
#if (_micro == _68000uP)
>
> Valid 68000 bus signal symbols are:
>
>    \mup\n.....user program           \mu\n.......any user mode operation
>    \mud\n.....user data              \ms\n.......any supervisor mode operation
>    \msp\n.....supervisor program     \mp\n.......any program memory operation
>    \msd\n.....supervisor data        \md\n.......any data operation
>    \mby\n.....byte operation         \minta\n....interrupt acknowledge
>    \mwd\n.....word operation         \miplx\n....interrupt level, x=0,..,7
>    \mrd\n.....read operation         \mvpa\n.....Valid peripheral address
>    \mwt\n.....write operation        \mberr\n....bus error
>    \mhlt\n....halt
>
> TTA looks for \usimultaneous\n occurrences of listed symbols.
>
> Example:  b=d wt   (write to any data space)
>
#else
>
> Valid bus symbols are:
> 
>        \mf\n....fetch                 \mnf\n...not a fetch
>        \mm\n....memory access         \mi\n....input/output access  \u***\n
>        \mrd\n...read operation        \mwt\n...write operation
>
> \u***\n If processor supports IO ports.
>
> TTA detects \usimultaneous\n occurrences of listed bus signals.
>
> For example, b=m rd   (all memory reads)
>
#endif
#endif
#endif
				cmd (b=), 
				msg (^Enter bus signal symbols: ), 
				call, sly (shiftkey 4), return,
				msg (%P), break;
				f1;; hist ;
				f2;; hist ;
				f3;; hist ;
				f4;; hist ;
				f5;; hist ;
				f6;; hist ;
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f4;probe; {
> 
> The TTA allows the user to input up to 8 additional bus signals
> to the event recognizers via the 8-bit probe input on the Data
> Acquisition Interface on the back panel of your 8540.
>
> The probe field value is expected to be a binary value.  Don't
> care bits are allowed.
>
> Examples of valid inputs are: 0xxxxxx10, 4xH.
>
				cmd (p=), 
				msg (^Enter probe pattern in binary, bit 7-0, e.g. 0xxx1xxx0: %P), break;
				f1;; hist ;
				f2;; hist ;
				f3;; hist ;
				f4;; hist ;
				f5;; hist ;
				f6;; hist ;
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f5;evt qual; {
>
> The TTA allows the user to qualify a TTA event from an external device,
> such as a logic analyzer, through the BNC input labelled \uevent qualifier\n
> on the Data Acquisition Interface on the back panel of your 8540.
>
> Valid inputs for this field are 0 or 1.
>

				cmd (q=), 
				msg (^Enter event qualifier level, 0 or 1: %%), 
				break;
				f1;0; cmd(0 );
				f2;1; cmd(1 );
				f3;; hist ;
				f4;; hist ;
				f5;; hist ;
				f6;; hist ;
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f6;ctr; {
>
> Outputs from the 4 TTA counters are fed into the event recognizers.
> By controlling the behavior of these outputs by using the "o=" counter
> field, you can control the arming/disarming of events.
>
> This field accepts a 4 digit pattern, representing the desired counter
> output pattern on counters 1, 2, 3 and 4, in that order.
>
> For example, a pattern of 1x0x, indicates a counter 1 output level of 1,
> a counter 3 output of 0, and no interest in counters 2 and 4.
>
				cmd (c=), 
				msg (^Enter counter feedback pattern, counters 1234, e.g. X10X: %P), break;
				f1;; hist ;
				f2;; hist ;
				f3;; hist ;
				f4;; hist ;
				f5;; hist ;
				f6;; hist ;
				f7;manual; man(eve);
				f8;done; cmd, msg, break (2);
				};
			f7;manual; man (eve);
			f8;end event;  next;
			}, {
>
> Answer \kyes\e if you wish to capture the first occurrence of 
> this event.
>
> Answer \kno\e if a subsequent occurrence of this event is more 
> important.
>
			msg (^Trigger on first occurrence? %%);
			f1;yes; cmd (;), next;
			f2;no; {
>
> A decimal number in the range 1 through 65535 is expected.
>
> Enter 1 less than the actual number of occurrences desired.
>
				cmd (; cou $1 s=ev$1 o=delay v=), 
				msg (^Stop on which occurrence: %P),
				cmd (;), next (2);
				f7;manual; man (cou);
				f8;done; break;
				};
			f7;manual; man(eve);
			f8;done; break;
			},{
>
> Answer \kyes\e if you wish to either stop execution when this 
> event occurs or to print a register trace line and continue execution.
>
> Answer \kno\e if you wish to generate trigger signals at real-time
> speeds, or to use this definition in combination with other triggers.
>
			msg (^Set breakpoint? %%);
			f1;yes; {
> \kstop\e - Causes program execution to stop when the event is detected.
>            You may indicate on which occurrence the breakpoint is
>            to be generated.  (For example, break on the 5th occurrence 
>            of event 1.)
>
> \kcontinue\e - Causes program execution to pause while a register
>            trace is printed out, then execution is resumed again.
>
				cmd ( ), msg (^Select: %%);
				f1;stop; cmd ( bre $1), exec, break (2);
				f2;continue; cmd (bre $1 -c), exec, break (2);
				f7;manual; man(eve);
				f8;done; break;
				};
			f2;no;  cmd ( ), exec, break;
			f7;manual; man(eve);
			f8;done; break;
			};
		f2;counter; {
>
> The TTA has 4 general purpose counters, each with 5 programmable fields:
> initial value, output, gating, source and restart.
>
> This tree allows you to program a counter on a field by field basis.
>
			cmd (^cou ), msg (^Which counter? %%), next;
			f1;1 ; cmd (1 );
			f2;2 ; cmd (2 );
			f3;3 ; cmd (3 );
			f4;4 ; cmd (4 );
			f5;all clr; cmd (all clr ), exec, msg (^Define:), break;
			f7;manual; man(cou);
			f8;done; break;
			}, {
>
> \kclear\e - Clears selected counter, and returns to counter level.
>
> \kredefine\e - Clears selected counter and continues on.
>
> \kmod field\e - Does not alter current programming of selected counter
>             and will add/modify fields as indicated.
>
			msg (^Select: %%),next;
			f1;clear; cmd (clr ), exec, msg (^Define:), break;
			f2;redefine; cmd (clr );
			f3;mod field; cmd ( );
			f7;manual; man(cou);
			f8;done; break;
			}, {
>
> The counter portion of each trigger has 5 fields:
>
> \kvalue\e - Sets the initial value of the counter.
>
> \ksource\e - Selects the source clock.
>
> \koutput\e - Controls the counter output level.
>
> \kgate\e - Controls when the counter counts.
>
> \krestart\e - Reloads/restarts the counter, dependent upon gate control.
>
> \kquit level\e - Terminates tree without executing command.
>
> \kend counter\e - Executes command built thus far.
>
			msg (^Use f8 to end counter definition.  Select field: %%);
			f1;value; {
>
> The counter value is assumed to be a decimal number in the range 0
> through 65535.  Use proper radix for other number bases.
> This field defines the initial contents of the counter.
>
> The resolution of the counters is affected by the gate and restart fields
> if the counter is decrementing, as follows:
>
>       \uGATE\n       \uRESTART\n       \uMinimum value\n
>       off          off           as entered
>       on           off           2 
>       on           on            4
>
				cmd ( v=), msg (^Enter initial value: %P), break;
				f1;;hist;
				f2;;hist;
				f3;;hist;
				f4;;hist;
				f5;;hist;
				f6;;hist;
				f7;manual; man(cou);
				f8;done; cmd, break(2);
				};
			f2;source; {
>
> The source field selects what this counter should count.
>
> Valid source parameters are:
>    \m200nsec\n....200 nsec clock intervals    \mev1\n....event 1
>    \m2usec\n......2 usec clock intervals      \mev2\n....event 2
>    \m20usec\n.....20 usec clock intervals     \mev3\n....event 3
>    \m200usec\n....200 usec clock intervals    \mev4\n....event 4
>    \m2msec\n......2 msec clock intervals      \macq\n....acquisitions
>    \mtrig1\n......trigger 1                   \mcyc\n....emulator bus cycle
>    \mtrig2\n......trigger 2                   \mqua\n....event qualifier
>    \mtrig3\n......trigger 3                   \memuclk\n.emulator clocks
>    \mtrig4\n......trigger 4
>
				cmd ( s=), msg (^Enter source: ),
				call, sly (shiftkey 4), return,
				msg (%P), break;
				f1;;hist;
				f2;;hist;
				f3;;hist;
				f4;;hist;
				f5;;hist;
				f6;;hist;
				f7;manual; man(cou);
				f8;done; cmd, break(2);
				};
			f3;output; {
>
> The counter outputs feed back into the event recognizers (eve q= field)
> and can be used to control when an event is enabled.  This field also
> controls whether the counter increments or decrements.
>
> \karm\e - event is always enabled.  Counter always counts up.
>
> \kdelay\e - event is disabled until counter reaches 0. Counter decrements.
>
> \ktimeout\e - event is enabled until counter reaches 0. Counter decrements.
>
> \kpulse\e - event is enabled for the interval between 2 source edges, from
>             the time when the counter reaches 0 until the next clock.
>             Counter decrements.
>
				cmd ( o=), msg (^Enter output: ),
				call, sly (shiftkey 4), return,
				msg (%%), break;
				f1;arm; cmd (arm);
				f2;delay; cmd (delay);
				f3;timeout; cmd (timeout);
				f4;pulse; cmd (pulse);
				f6;;hist;
				f7;manual; man(cou);
				f8;done; cmd, break(2);
				};
			f4;gate; {
>
> Gating controls when a counter can count.
>
> \kclr\e - clears gating.  Counter is enabled at start of program execution.
>
> \ktrigh\e - Enables counter only while previous trigger is true.
>
> \kseqh\e - Enables counter when previous trigger occurs; counter remains
>            enabled thereafter.
>
> \kself\e - Enables counter only while its own trigger is true.
>
> \uNOTE:\n - gating is not allowed on trigger 1.  This field affects
>  the value field.  See keynotes under \kvalue\e.
>

				cmd ( g=), msg (^Enter gate: ),
				call, sly (shiftkey 4), return,
				msg (%%), break;
				f1;clr; cmd (off);
				f2;trigh; cmd (trigh);
				f3;seqh; cmd (seqh);
				f4;self; cmd (self);
				f7;manual; man(cou);
				f8;done; cmd, break(2);
				};
			f5;restart; {
>
> This field cause a counter to be reloaded and restarted when the
> selected gate is asserted.
>
> \kon\e - activates restart
>
> \koff\e - deactivates restart
>
				cmd ( r=), msg (^Restart.  Select: ),
				call, sly (shiftkey 4), return,
				msg (%%), break;
				f1;on; cmd (on);
				f2;off; cmd (off);
				f7;manual; man(cou);
				f8;done; cmd, break(2);
				};
			f6;quit level; cmd (^), break;
			f7;manual; man (cou);
			f8;end counter;  exec, break;
			};
		f7;manual;man (cou);
		f8;done; break;
		};
	f2;bkpt only; {
>
> The breakpoint capability only of each trigger is affected here.
> Event or counter definitions should be accomplished under the
> \ktriggers\e softkey.
>
		cmd (^bre ), msg (^Which breakpoint? %%), next;
		f1;1 ; cmd (1 );
		f2;2 ; cmd (2 );
		f3;3 ; cmd (3 );
		f4;4 ; cmd (4 );
		f5;all; cmd (all );
		f7;manual; man (bre);
		f8;done; break;
		}, {
>
> \kclear\e - Removes breakpoint.
>
> \kstop\e - Causes program execution to stop when trigger occurs.
>
> \ktrace\e - Causes program execution to pause when trigger occurs
>             while a register trace line prints out, then resumes execution.
> 
		msg (^Select: %%),
		exec, msg (^), next;
		f1;clear; cmd (clr );
		f2;stop ; cmd (-s );
		f3;trace; cmd (-c );
		f7;manual; man (bre);
		f8;done; break;
		};
	f3;acqmem; {
>
> The default state of the TTA acquisition memory is to acquire all 
> transactions until program execution stops.  The memory is 255 
> transactions deep.
>
> You may choose to acquire all transactions or only those defined by
> event 4 (for example, store all memory writes to a data structure).
>
> You have the option of acquiring up until the program stops or of
> stopping acquisition before the program stops.  In the latter case, 
> the triggering event will be that defined by trigger 4.  For example,
> you can acquire 128 acquisitions on either side of the 65,535th
> occurrence of event 4.
> 
		msg (^Acquire: %%);
		f1;all; cmd (^acq all ), next;
		f2;event 4; {
>
> Answer \kyes\e if event 4 defines the qualifying event.
>
> Answer \kno\e if event 4 is not satisfactory.
>
			msg (^Reviewing current event 4 setup),
			cmd (^ts -e 4), exec, next;
			},
			{
			msg (^Is this what you would like to acquire? %%);
			f1;yes; cmd (^acq ev4 ), next(2);
			f2;no;   msg (^Use \[triggers\] key to setup event 4),
			sly (sleep 3),  break (2);
			f7;manual;  man(acq);
			f8;done; break;
		};
		f7;manual; man(acq);
		f8;done; break;
		}, {
>
> \kprg stops\e - Acquisition will start when execution starts and stop
>             when execution ends.  The most recent 255 transactions
>             will be in the acquisition memory.
>
> \kpre\e - acquisition starts when execution starts and stops on the
>             first acquisition after trigger 4 occurs.
>
> \kcenter\e - acquisition starts when execution starts and stops on the
>             128th acquisition after trigger 4 occurs.
>
> \kpost\e - acquisition starts when execution starts and stops on the
>             255th acquisition after trigger 4 occurs.
>
		msg (^Stop acquiring when: %%);
		f1;prg stops; cmd ( ), exec, break;
 		f2;pre; cmd ( for 1 acq aftertrig4), exec, break;
		f3;center; cmd ( for 128 acq aftertrig4), exec, break;
		f4;post; cmd ( for 255 acq aftertrig4), exec, break;
		f7;manual; man (acq);
		f8;done;break;
		};
	f4;clear; {
>
> This section allows you to return the TTA to its default programming.
> Default conditions are:
>    Breakpoints are off.
>    Events are true on every cycle.
>    Counters are inactive.  Triggers are true on every cycle.
>    All transactions are acquired.
>
> \ktriggers\e - Will clear event, counter and breakpoint programming.
> \keve only\e - Will clear event programming only.
> \kcou only\e - Will clear counter programming only.
> \kbkpt only\e - Will remove program breakpoint generation only.  Trigger
>             pulses will still occur to the Data Acquisition Interface.
> \kacq\e - Will cause all transactions to be stored.
> \kclear all\e - Will return entire TTA to default conditions.
>
		msg (^Clear TTA programming);
		f1;triggers; {
>
> Event, counter and breakpoint will be cleared.
>
			cmd (^tclr ), msg (^Which trigger? %%), 
			exec, msg (^), next;
			f1;1 ; cmd (1 );
			f2;2 ; cmd (2 );
			f3;3 ; cmd (3 );
			f4;4 ; cmd (4 );
			f5;all; cmd (1 2 3 4 );
			f7;manual; man (tclr);
			f8;done; break;
			};
		f2;eve only; {
>
> Indicated event only will be cleared.  Breakpoint will NOT be cleared.
>
			cmd (^eve ), msg (^Which event? %%), 
			exec, next;
			f1;1 ; cmd (1 clr);
			f2;2 ; cmd (2 clr);
			f3;3 ; cmd (3 clr);
			f4;4 ; cmd (4 clr);
			f5;all; cmd (all clr);
			f7;manual; man (eve);
			f8;done; break;
			};
		f3;cou only; {
>
> Indicated counter only will be cleared.  Breakpoint will NOT be cleared.
>
			cmd (^cou ), msg (^Which counter? %%), exec, next;
			f1;1 ; cmd (1 clr);
			f2;2 ; cmd (2 clr);
			f3;3 ; cmd (3 clr);
			f4;4 ; cmd (4 clr);
			f5;all; cmd (all clr);
			f7;manual; man(cou);
			f8;done; break;
			};
		f4;bkpt only; {
>
> Indicated breakpoint will be cleared.  Event and counter will NOT be
> cleared.
>
			cmd (^bre ), msg (^Which breakpoint? %%), exec, next;
			f1;1 ; cmd (1 clr);
			f2;2 ; cmd (2 clr);
			f3;3 ; cmd (3 clr);
			f4;4 ; cmd (4 clr);
			f5;all; cmd (all clr), msg (^Clear TTA programming);
			f7;manual; man(bre);
			f8;done; break;
			};
		f5;acq; cmd (^acq all), exec;
		f6;clear all; cmd (^tclr -a), exec;
		f8;done; break;
		};
	f5;1 arms 2; {
>
> The TTA can be set up such that any event can arm another event.
> This application uses event 1 to arm event 2.  \uDefine the events\n
> \uusing the \ktriggers\e key on the previous level.\n
>
> Answer \kyes\e if the events are satisfactory.
>
> Answer \kno\e if the events are not satisfactory.
>
		msg (^Event 1 = arming event, 2 = stopping event.  Are above events OK? ),
		cmd (^ts -e 1 2), exec, msg ( %%);
		f1;yes;
		cmd (^cou 1 clr v=1 s=ev1 o=delay), exec,
	      	cmd (^eve -s 2 c=1xxx), exec,
		cmd (^cou 2 clr), exec, break;
		f2;no;
		cmd ( ),
		msg (^Use \[general/triggers\] to define events. ),
		sly (sleep 3), break;
		f7;manual; man (cou);
		f8;done;break;
		};
	f8;done; break;
	};
f8;done; 
#ifndef _TNIX
	break;
#else
	{
	cmd, msg (^Returning to Debug top level.),
	sly (history off),
	sly (newexp keynotes _kdir/dbug.n),
	sly (unsave _kdir/dbug.s),
	break;
	};
#endif
}
