
; PicBasic Pro Compiler 2.46, (c) 1998, 2005 microEngineering Labs, Inc. All Rights Reserved.  
PM_USED			EQU	1

	INCLUDE	"16F628.INC"

RAM_START       		EQU	00020h
RAM_END         		EQU	0014Fh
RAM_BANKS       		EQU	00003h
BANK0_START     		EQU	00020h
BANK0_END       		EQU	0007Fh
BANK1_START     		EQU	000A0h
BANK1_END       		EQU	000EFh
BANK2_START     		EQU	00120h
BANK2_END       		EQU	0014Fh
EEPROM_START    		EQU	02100h
EEPROM_END      		EQU	0217Fh

R0              		EQU	RAM_START + 000h
R1              		EQU	RAM_START + 002h
R2              		EQU	RAM_START + 004h
R3              		EQU	RAM_START + 006h
R4              		EQU	RAM_START + 008h
R5              		EQU	RAM_START + 00Ah
R6              		EQU	RAM_START + 00Ch
R7              		EQU	RAM_START + 00Eh
R8              		EQU	RAM_START + 010h
T1              		EQU	RAM_START + 012h
FLAGS           		EQU	RAM_START + 014h
GOP             		EQU	RAM_START + 015h
RM1             		EQU	RAM_START + 016h
RM2             		EQU	RAM_START + 017h
RR1             		EQU	RAM_START + 018h
RR2             		EQU	RAM_START + 019h
_command         		EQU	RAM_START + 01Ah
_dahtime         		EQU	RAM_START + 01Bh
_dittime         		EQU	RAM_START + 01Ch
_element         		EQU	RAM_START + 01Dh
_GPSmin          		EQU	RAM_START + 01Eh
_GPSsec          		EQU	RAM_START + 01Fh
_Keyflag         		EQU	RAM_START + 020h
_newchar         		EQU	RAM_START + 021h
_pointer         		EQU	RAM_START + 022h
_slotseconds     		EQU	RAM_START + 023h
_verify          		EQU	RAM_START + 024h
_X               		EQU	RAM_START + 025h
_Y               		EQU	RAM_START + 026h
_PORTL           		EQU	 PORTB
_PORTH           		EQU	 PORTA
_TRISL           		EQU	 TRISB
_TRISH           		EQU	 TRISA
#define _program         	_PORTA_3
#define _Serial_in       	_PORTA_4
#define _PTT             	_PORTB_0
#define _Key             	_PORTB_1
#define _Serial_out      	_PORTB_2
#define _Sidetone        	_PORTB_3
#define _EL_pwr          	_PORTB_4
#define _Low_pwr         	_PORTB_5
#define _Med_pwr         	_PORTB_6
#define _High_pwr        	_PORTB_7
#define _PORTA_3         	 PORTA, 003h
#define _PORTA_4         	 PORTA, 004h
#define _PORTB_0         	 PORTB, 000h
#define _PORTB_1         	 PORTB, 001h
#define _PORTB_2         	 PORTB, 002h
#define _PORTB_3         	 PORTB, 003h
#define _PORTB_4         	 PORTB, 004h
#define _PORTB_5         	 PORTB, 005h
#define _PORTB_6         	 PORTB, 006h
#define _PORTB_7         	 PORTB, 007h
#define _GPSmin_0        	_GPSmin, 000h

; EEPROM data.
	ORG EEPROM_START

	DE	076h
	DE	076h
	DE	076h
	DE	057h
	DE	05Ah
	ORG EEPROM_START + 00064h
	DE	001h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	001h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h
	DE	00000h

	INCLUDE	"SYNC2.MAC"
	INCLUDE	"PBPPIC14.LIB"

	MOVE?CB	007h, CMCON
	MOVE?CB	01Ch, TRISA
	MOVE?CB	000h, TRISB
	MOVE?CB	03Ch, _element
	MOVE?CB	005h, _dittime
	MOVE?CB	00Fh, _dahtime

	LABEL?L	_Start	
	CMPNE?TCL	_program, 001h, L00002
	GOTO?L	_main
	LABEL?L	L00002	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	MOVE?CB	000h, _pointer

	LABEL?L	_loopecho	
	READ?BB	_pointer, _command
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?B	_command
	ADD?BCB	_pointer, 001h, _pointer
	CMPNE?BCL	_pointer, 063h, L00004
	GOTO?L	_doneecho
	LABEL?L	L00004	
	CMPNE?BCL	_command, 05Ah, L00006
	GOTO?L	_doneecho
	LABEL?L	L00006	
	GOTO?L	_loopecho

	LABEL?L	_doneecho	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	043h
	SEROUT?C	068h
	SEROUT?C	067h
	SEROUT?C	020h
	SEROUT?C	06Dh
	SEROUT?C	073h
	SEROUT?C	067h
	SEROUT?C	03Fh
	SEROUT?C	020h
	SEROUT?C	079h
	SEROUT?C	02Fh
	SEROUT?C	06Eh
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERTIME?C	02710h
	SERIN?BL	_verify, _main
	CMPEQ?BCL	_verify, 079h, L00008
	GOTO?L	_GPSslots
	LABEL?L	L00008	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	045h
	SEROUT?C	06Eh
	SEROUT?C	074h
	SEROUT?C	020h
	SEROUT?C	06Dh
	SEROUT?C	073h
	SEROUT?C	067h
	SEROUT?C	020h
	SEROUT?C	074h
	SEROUT?C	068h
	SEROUT?C	065h
	SEROUT?C	06Eh
	SEROUT?C	020h
	SEROUT?C	05Ah
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	MOVE?CB	000h, _pointer

	LABEL?L	_prog	
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERIN?B	_newchar
	WRITE?BB	_pointer, _newchar
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?B	_newchar
	CMPNE?BCL	_newchar, 05Ah, L00010
	GOTO?L	_doneecho
	LABEL?L	L00010	
	ADD?BCB	_pointer, 001h, _pointer
	CMPNE?BCL	_pointer, 063h, L00012
	GOTO?L	_loopecho
	LABEL?L	L00012	
	GOTO?L	_prog

	LABEL?L	_GPSslots	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	020h
	SEROUT?C	020h
	SEROUT?C	020h
	SEROUT?C	045h
	SEROUT?C	076h
	SEROUT?C	065h
	SEROUT?C	06Eh
	SEROUT?C	020h
	SEROUT?C	04Fh
	SEROUT?C	064h
	SEROUT?C	064h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	MOVE?CB	064h, _pointer
	LABEL?L	L00014	
	CMPGT?BCL	_pointer, 06Fh, L00015
	SUB?BCW	_pointer, 064h, T1
	MUL?CWB	005h, T1, _slotseconds
	READ?BB	_pointer, _X
	ADD?BCW	_pointer, 00Ch, T1
	READ?WB	T1, _Y
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUTD?B	_slotseconds
	SEROUT?C	020h
	SEROUT?C	073h
	SEROUT?C	065h
	SEROUT?C	063h
	SEROUT?C	020h
	SEROUTD?B	_X
	SEROUT?C	020h
	SEROUTD?B	_Y
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	NEXT?BCL	_pointer, 001h, L00014
	LABEL?L	L00015	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	043h
	SEROUT?C	068h
	SEROUT?C	067h
	SEROUT?C	020h
	SEROUT?C	047h
	SEROUT?C	050h
	SEROUT?C	053h
	SEROUT?C	03Fh
	SEROUT?C	020h
	SEROUT?C	079h
	SEROUT?C	02Fh
	SEROUT?C	06Eh
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERIN?B	_verify
	CMPEQ?BCL	_verify, 079h, L00016
	GOTO?L	_main
	LABEL?L	L00016	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	035h
	SEROUT?C	020h
	SEROUT?C	073h
	SEROUT?C	065h
	SEROUT?C	063h
	SEROUT?C	020h
	SEROUT?C	073h
	SEROUT?C	06Ch
	SEROUT?C	06Fh
	SEROUT?C	074h
	SEROUT?C	073h
	SEROUT?C	02Ch
	SEROUT?C	020h
	SEROUT?C	030h
	SEROUT?C	02Dh
	SEROUT?C	035h
	SEROUT?C	035h
	SEROUT?C	020h
	SEROUT?C	069h
	SEROUT?C	066h
	SEROUT?C	020h
	SEROUT?C	065h
	SEROUT?C	076h
	SEROUT?C	065h
	SEROUT?C	06Eh
	SEROUT?C	020h
	SEROUT?C	06Dh
	SEROUT?C	069h
	SEROUT?C	06Eh
	SEROUT?C	073h
	SEROUT?C	02Ch
	SEROUT?C	020h
	SEROUT?C	036h
	SEROUT?C	030h
	SEROUT?C	02Dh
	SEROUT?C	031h
	SEROUT?C	031h
	SEROUT?C	035h
	SEROUT?C	020h
	SEROUT?C	069h
	SEROUT?C	066h
	SEROUT?C	020h
	SEROUT?C	06Fh
	SEROUT?C	064h
	SEROUT?C	064h
	SEROUT?C	020h
	SEROUT?C	06Dh
	SEROUT?C	069h
	SEROUT?C	06Eh
	SEROUT?C	073h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	073h
	SEROUT?C	065h
	SEROUT?C	074h
	SEROUT?C	02Fh
	SEROUT?C	063h
	SEROUT?C	06Ch
	SEROUT?C	072h
	SEROUT?C	03Fh
	SEROUT?C	020h
	SEROUT?C	073h
	SEROUT?C	02Fh
	SEROUT?C	063h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERIN?B	_verify
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	073h
	SEROUT?C	065h
	SEROUT?C	063h
	SEROUT?C	03Fh
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	CMPNE?BCL	_verify, 073h, L00018
	GOTO?L	_Setslot
	LABEL?L	L00018	
	CMPNE?BCL	_verify, 063h, L00020
	GOTO?L	_Clrslot
	LABEL?L	L00020	
	GOTO?L	_GPSslots

	LABEL?L	_Setslot	
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERIND?B	_slotseconds
	AND?BCB	_slotseconds, 07Fh, _slotseconds
	MOD?BCB	_slotseconds, 005h, _X
	CMPEQ?BCL	_X, 000h, L00022
	GOTO?L	_GPSslots
	LABEL?L	L00022	
	DIV?BCB	_slotseconds, 005h, _pointer
	ADD?BCB	_pointer, 064h, _pointer
	MOVE?CB	001h, _X
	WRITE?BB	_pointer, _X
	GOTO?L	_GPSslots

	LABEL?L	_Clrslot	
	SERPIN?T	_Serial_in
	SERMODE?C	006h
	SERIND?B	_slotseconds
	AND?BCB	_slotseconds, 07Fh, _slotseconds
	MOD?BCB	_slotseconds, 005h, _X
	CMPEQ?BCL	_X, 000h, L00024
	GOTO?L	_GPSslots
	LABEL?L	L00024	
	DIV?BCB	_slotseconds, 005h, _pointer
	ADD?BCB	_pointer, 064h, _pointer
	MOVE?CB	000h, _X
	WRITE?BB	_pointer, _X
	GOTO?L	_GPSslots

	LABEL?L	_main	
	SERPIN?T	_Serial_out
	SERMODE?C	006h
	SEROUT?C	00Dh
	SEROUT?C	00Ah
	SEROUT?C	072h
	SEROUT?C	075h
	SEROUT?C	06Eh
	SEROUT?C	02Eh
	SEROUT?C	02Eh
	SEROUT?C	02Eh
	GOSUB?L	_HighP
	GOSUB?L	_Keyup
	MOVE?CB	000h, _pointer

	LABEL?L	_Loop	
	READ?BB	_pointer, _command
	CMPNE?BCL	_command, 061h, L00026
	GOSUB?L	_send_a
	LABEL?L	L00026	
	CMPNE?BCL	_command, 062h, L00028
	GOSUB?L	_send_b
	LABEL?L	L00028	
	CMPNE?BCL	_command, 063h, L00030
	GOSUB?L	_send_c
	LABEL?L	L00030	
	CMPNE?BCL	_command, 064h, L00032
	GOSUB?L	_send_d
	LABEL?L	L00032	
	CMPNE?BCL	_command, 065h, L00034
	GOSUB?L	_send_e
	LABEL?L	L00034	
	CMPNE?BCL	_command, 066h, L00036
	GOSUB?L	_send_f
	LABEL?L	L00036	
	CMPNE?BCL	_command, 067h, L00038
	GOSUB?L	_send_g
	LABEL?L	L00038	
	CMPNE?BCL	_command, 068h, L00040
	GOSUB?L	_send_h
	LABEL?L	L00040	
	CMPNE?BCL	_command, 069h, L00042
	GOSUB?L	_send_i
	LABEL?L	L00042	
	CMPNE?BCL	_command, 06Ah, L00044
	GOSUB?L	_send_j
	LABEL?L	L00044	
	CMPNE?BCL	_command, 06Bh, L00046
	GOSUB?L	_send_k
	LABEL?L	L00046	
	CMPNE?BCL	_command, 06Ch, L00048
	GOSUB?L	_send_l
	LABEL?L	L00048	
	CMPNE?BCL	_command, 06Dh, L00050
	GOSUB?L	_send_m
	LABEL?L	L00050	
	CMPNE?BCL	_command, 06Eh, L00052
	GOSUB?L	_send_n
	LABEL?L	L00052	
	CMPNE?BCL	_command, 06Fh, L00054
	GOSUB?L	_send_o
	LABEL?L	L00054	
	CMPNE?BCL	_command, 070h, L00056
	GOSUB?L	_send_p
	LABEL?L	L00056	
	CMPNE?BCL	_command, 071h, L00058
	GOSUB?L	_send_q
	LABEL?L	L00058	
	CMPNE?BCL	_command, 072h, L00060
	GOSUB?L	_send_r
	LABEL?L	L00060	
	CMPNE?BCL	_command, 073h, L00062
	GOSUB?L	_send_s
	LABEL?L	L00062	
	CMPNE?BCL	_command, 074h, L00064
	GOSUB?L	_send_t
	LABEL?L	L00064	
	CMPNE?BCL	_command, 075h, L00066
	GOSUB?L	_send_u
	LABEL?L	L00066	
	CMPNE?BCL	_command, 076h, L00068
	GOSUB?L	_send_v
	LABEL?L	L00068	
	CMPNE?BCL	_command, 077h, L00070
	GOSUB?L	_send_w
	LABEL?L	L00070	
	CMPNE?BCL	_command, 078h, L00072
	GOSUB?L	_send_x
	LABEL?L	L00072	
	CMPNE?BCL	_command, 079h, L00074
	GOSUB?L	_send_y
	LABEL?L	L00074	
	CMPNE?BCL	_command, 07Ah, L00076
	GOSUB?L	_send_z
	LABEL?L	L00076	
	CMPNE?BCL	_command, 031h, L00078
	GOSUB?L	_send_1
	LABEL?L	L00078	
	CMPNE?BCL	_command, 032h, L00080
	GOSUB?L	_send_2
	LABEL?L	L00080	
	CMPNE?BCL	_command, 033h, L00082
	GOSUB?L	_send_3
	LABEL?L	L00082	
	CMPNE?BCL	_command, 034h, L00084
	GOSUB?L	_send_4
	LABEL?L	L00084	
	CMPNE?BCL	_command, 035h, L00086
	GOSUB?L	_send_5
	LABEL?L	L00086	
	CMPNE?BCL	_command, 036h, L00088
	GOSUB?L	_send_6
	LABEL?L	L00088	
	CMPNE?BCL	_command, 037h, L00090
	GOSUB?L	_send_7
	LABEL?L	L00090	
	CMPNE?BCL	_command, 038h, L00092
	GOSUB?L	_send_8
	LABEL?L	L00092	
	CMPNE?BCL	_command, 039h, L00094
	GOSUB?L	_send_9
	LABEL?L	L00094	
	CMPNE?BCL	_command, 030h, L00096
	GOSUB?L	_send_0
	LABEL?L	L00096	
	CMPNE?BCL	_command, 020h, L00098
	GOSUB?L	_space
	LABEL?L	L00098	
	CMPNE?BCL	_command, 02Fh, L00100
	GOSUB?L	_slash
	LABEL?L	L00100	
	CMPNE?BCL	_command, 042h, L00102
	GOSUB?L	_WPM10
	LABEL?L	L00102	
	CMPNE?BCL	_command, 043h, L00104
	GOSUB?L	_WPM15
	LABEL?L	L00104	
	CMPNE?BCL	_command, 044h, L00106
	GOSUB?L	_WPM21
	LABEL?L	L00106	
	CMPNE?BCL	_command, 048h, L00108
	GOSUB?L	_HighP
	LABEL?L	L00108	
	CMPNE?BCL	_command, 04Bh, L00110
	GOSUB?L	_Keydown
	LABEL?L	L00110	
	CMPNE?BCL	_command, 04Ch, L00112
	GOSUB?L	_LowP
	LABEL?L	L00112	
	CMPNE?BCL	_command, 04Dh, L00114
	GOSUB?L	_MediumP
	LABEL?L	L00114	
	CMPNE?BCL	_command, 050h, L00116
	GOSUB?L	_PTTon
	LABEL?L	L00116	
	CMPNE?BCL	_command, 051h, L00118
	GOSUB?L	_PTToff
	LABEL?L	L00118	
	CMPNE?BCL	_command, 053h, L00120
	GOSUB?L	_Second
	LABEL?L	L00120	
	CMPNE?BCL	_command, 054h, L00122
	GOSUB?L	_Tenth
	LABEL?L	L00122	
	CMPNE?BCL	_command, 055h, L00124
	GOSUB?L	_Keyup
	LABEL?L	L00124	
	CMPNE?BCL	_command, 057h, L00126
	GOSUB?L	_WaitTrig
	LABEL?L	L00126	
	CMPNE?BCL	_command, 058h, L00128
	GOSUB?L	_ExtraP
	LABEL?L	L00128	
	CMPNE?BCL	_command, 05Ah, L00130
	GOTO?L	_main
	LABEL?L	L00130	
	ADD?BCB	_pointer, 001h, _pointer
	CMPNE?BCL	_pointer, 063h, L00132
	GOTO?L	_main
	LABEL?L	L00132	
	GOTO?L	_Loop

	LABEL?L	_send_a	
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_b	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_c	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_d	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_e	
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_f	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_g	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_h	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_i	
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_j	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_k	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_l	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_m	
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_n	
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_o	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_p	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_q	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_r	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_s	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_t	
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_u	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_v	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_w	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_x	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_y	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_z	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_1	
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_2	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_3	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_4	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_5	
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_6	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_7	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_8	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_9	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_send_0	
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	GOSUB?L	_dah
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_slash	
	GOSUB?L	_dah
	GOSUB?L	_dit
	GOSUB?L	_dit
	GOSUB?L	_dah
	GOSUB?L	_dit
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_dit	
	MOVE?CT	001h, _Key
	SOUNDPIN?T	_Sidetone
	SOUND?CB	06Eh, _dittime
	MOVE?CT	000h, _Key
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_dah	
	MOVE?CT	001h, _Key
	SOUNDPIN?T	_Sidetone
	SOUND?CB	06Eh, _dahtime
	MOVE?CT	000h, _Key
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_space	
	PAUSE?B	_element
	PAUSE?B	_element
	PAUSE?B	_element
	RETURN?	

	LABEL?L	_WPM10	
	MOVE?CB	078h, _element
	MOVE?CB	00Ah, _dittime
	MOVE?CB	01Eh, _dahtime
	RETURN?	

	LABEL?L	_WPM15	
	MOVE?CB	054h, _element
	MOVE?CB	007h, _dittime
	MOVE?CB	015h, _dahtime
	RETURN?	

	LABEL?L	_WPM21	
	MOVE?CB	03Ch, _element
	MOVE?CB	005h, _dittime
	MOVE?CB	00Fh, _dahtime
	RETURN?	

	LABEL?L	_HighP	
	MOVE?CT	001h, _High_pwr
	MOVE?CT	000h, _Med_pwr
	MOVE?CT	000h, _Low_pwr
	MOVE?CT	000h, _EL_pwr
	RETURN?	

	LABEL?L	_MediumP	
	MOVE?CT	000h, _High_pwr
	MOVE?CT	001h, _Med_pwr
	MOVE?CT	000h, _Low_pwr
	MOVE?CT	000h, _EL_pwr
	RETURN?	

	LABEL?L	_LowP	
	MOVE?CT	000h, _High_pwr
	MOVE?CT	000h, _Med_pwr
	MOVE?CT	001h, _Low_pwr
	MOVE?CT	000h, _EL_pwr
	RETURN?	

	LABEL?L	_ExtraP	
	MOVE?CT	000h, _High_pwr
	MOVE?CT	000h, _Med_pwr
	MOVE?CT	000h, _Low_pwr
	MOVE?CT	001h, _EL_pwr
	RETURN?	

	LABEL?L	_WaitTrig	
	SERIN2DPIN?T	_Serial_in
	SERIN2MODE?C	040BCh

	LABEL?L	L00001	
	SERIN2WAIT?CL	052h, L00001
	SERIN2WAIT?CL	04Dh, L00001
	SERIN2WAIT?CL	043h, L00001
	SERIN2WAIT?CL	02Ch, L00001
	SERIN2COUNT?C	002h
	SERIN2SKIP?	
	SERIN2COUNT?C	002h
	SERIN2DEC?B	_GPSmin
	SERIN2COUNT?C	002h
	SERIN2DEC?B	_GPSsec
	CMPEQ?TCL	_GPSmin_0, 000h, _Skipadd
	ADD?BCB	_GPSsec, 03Ch, _GPSsec

	LABEL?L	_Skipadd	
	MOD?BCB	_GPSsec, 005h, _X
	CMPEQ?BCL	_X, 000h, L00134
	GOTO?L	_Minusone
	LABEL?L	L00134	
	DIV?BCB	_GPSsec, 005h, _Y
	ADD?BCB	_Y, 064h, _Y
	READ?BB	_Y, _X
	CMPEQ?BCL	_X, 000h, L00136
	GOTO?L	_Slotmatch
	LABEL?L	L00136	

	LABEL?L	_Minusone	
	SUB?BCB	_GPSsec, 001h, _GPSsec
	MOD?BCB	_GPSsec, 005h, _X
	CMPEQ?BCL	_X, 000h, L00138
	GOTO?L	_WaitTrig
	LABEL?L	L00138	
	DIV?BCB	_GPSsec, 005h, _Y
	ADD?BCB	_Y, 064h, _Y
	READ?BB	_Y, _X
	CMPEQ?BCL	_X, 000h, L00140
	GOTO?L	_Slotmatch
	LABEL?L	L00140	
	GOTO?L	_WaitTrig

	LABEL?L	_Slotmatch	
	RETURN?	

	LABEL?L	_Keydown	
	MOVE?CT	001h, _Key
	MOVE?CB	001h, _Keyflag
	RETURN?	

	LABEL?L	_Keyup	
	MOVE?CT	000h, _Key
	MOVE?CB	000h, _Keyflag
	RETURN?	

	LABEL?L	_Second	
	CMPNE?BCL	_Keyflag, 001h, L00142
	SOUNDPIN?T	_Sidetone
	SOUND?CC	06Eh, 053h
	GOTO?L	L00143
	LABEL?L	L00142	
	PAUSE?C	003E8h
	LABEL?L	L00143	
	RETURN?	

	LABEL?L	_Tenth	
	CMPNE?BCL	_Keyflag, 001h, L00144
	SOUNDPIN?T	_Sidetone
	SOUND?CC	06Eh, 008h
	GOTO?L	L00145
	LABEL?L	L00144	
	PAUSE?C	064h
	LABEL?L	L00145	
	RETURN?	

	LABEL?L	_PTTon	
	MOVE?CT	001h, _PTT
	RETURN?	

	LABEL?L	_PTToff	
	MOVE?CT	000h, _PTT
	RETURN?	
	END?	

	END
