****************************************************************************

*  THIS CODE HANDLES ONE CONTROLLER WITH UP TO 2 AUDIO MIXERS.
*  ONE MIXER FOR THE REPEATER TX AND ONE FOR THE REMOTE BASE TX.
*
*06/21/95. CHANGED XBAND CODES AND POR M1C1 OFF.
*06/30/95. ADDED FUNCTION TO LOCK ON TX AND ENABLE AUDIO FOR LOCAL MIC.
*04/04/96. CHANGED "SAY PL STATE RTNS."
*05/17/96. ADDED REPEATER OFF FOR 5,15 & 60 MINS. FUNCTION.
*05/24/96. CHANGED ALL TIMERS OFF TO TURN OFF PL ALSO.
*05/25/96. CHANGE KERCHUNK FILTER TO WORK WITH THE PL MODE. LINE 1790.
*09/27/96. CHANGED R52 AND R53 SETMIX1.
*05/19/97. FIXED PULSE TRANSISTOR OUTPUTS 1-7 AND ID. RTN. AND RE-WROTE
*          SAME RTN.
*05/19/97. FIXED TIMERTN TO NOT UPDATE LCD WHEN TALKER OR ID IS BUSY.
*06/22/97. ADDED MIXER CONTROLS FOR WB6ELR XBAND.
*12/04/08. TO DISABLE CHECK SUM RTN PUT "*"ON LINE 2715. ***ON NOW***
*12/07/08. DIAGNOSTIC POR.(1221 RIPLEDS)JUMPER CPL-GND. THEN POWER ON.
*01/02/09. ENABLED UNLOCKED INDICATOR ON TX DROP. HINOTE>LONOTE (2196)
*01/02/09. ADJUSTED TIMEOUT TIME TO 180 SECONDS.
****************************************************************************
        ORG     $FFF0
FILL1   FDB     $FFFF,$FFFF,$FFFF,$FFFF
*
        ORG     $E000
*
CHKBYTE FCB     $00
*
R_DATE  FCC     " LEVEL V1.31.3, DATE 01/02/09 "
        FCB      EOT
*                :  DISPLAY IS ONLY 40 CHARACTORS WIDE  :
*DISPLAY GUIDE-->0000000001111111111222222222233333333334
*                1234567890123456789012345678901234567890
*                ::::::::::::::::::::::::::::::::::::::::
*                VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
R_DATE1 FCC     "         CONTROLLER FOR WB6JHQ          "
        FCC     " LEVEL=V1.31.3 DATE=01/02/09 BY WB6JHQ "
        FCB     $00
*
FORMAT  FCC     "TT=XXXX F1-F6=XX XX XX XX XX XX FEAT=XX "
        FCC     "IN=X OUT=XX FLAG=XXXXXX T.O.=XX ID=XXXX"
        FCB     $00
*
CURTSY  FCC     "E"    ;COURTESY CHARACTER.
        FCB     EOT
*
RSPND   FCC     "R"    ;RESPONSE CHARACTER.
        FCB     EOT
*
SEND_O  FCC     "O"    ;SEND "O".
        FCB     EOT
SEND_K  FCC     "K"    ;SEND "K".
        FCB     EOT
*
SEND_H  FCC     "H"    ;SEND "H" FOR HIGH BYTE IN MORSE.
        FCB     EOT
*
SEND_L  FCC     "L"    ;SEND "L" FOR HIGH BYTE IN MORSE.
        FCB     EOT
*
MYCALL  FCC     " DE WB6JHQ/R "    ;UPPER CASE ASCII ONLY.
        FCB     EOT                ;A-F,0-9AND / ,?
*
MYCALL1 FCC     " DE WB6JHQ/R SUNSET "
        FCB     EOT
*
ALTID_C FCC     " NET TONIGHT DE WB6JHQ/R "    ;UPPER CASE ASCII ONLY.
        FCB     EOT                            ;A-F,0-9AND / ,?
*
ALTID_V FDB     S160,THIS,S20,IS,S20  ;MAY BE USED FOR WEATHER WARNING
        FDB     THE,S20,W,B,SIX
        FDB     J,H,Q,S80
*       FDB     RE,P,ER
        FCB     EOT
*
AP_OFF  FDB     CALL,COMPLETE
        FCB     EOT
*
APOFF   FCC     "  AP OFF "
        FCB     EOT
*
REMOFF  FCC     "   REMOTE  OFF"
        FCB     EOT
*
REMON   FCC     "   REMOTE ON"
        FCB     EOT
*
RTXOFF  FCC     "   REMOTE TX OFF"
        FCB     EOT
*
RTXON   FCC     "   REMOTE TX ON"
        FCB     EOT
*
S_BAD   FCC     "  B A D  "
        FCB     EOT
*
V_RSPND FDB     S20,ENTER,S20
        FCB     EOT
*
V_CLEAR FDB     S320
        FCB     EOT
*
POWERON FDB     S320,RE,S80,SET,S20,COMPLETE,S80,TONE400
        FDB     S320,MICRO,CONTROL,ER,S20,FOUR,THE,W,B,SIX
        FDB     J,H,Q,S20,RE,P,ER,S160
*
S_LEVEL FDB     S320,LEVEL,S20,V,ONE,POINT,THIRTY,ONE,POINT,THREE,S80
        FDB     DATE,S80,ZERO,ONE,ZERO,TWO
        FDB     TWO,THOUSAND,NINE,S20
        FCB     EOT
*
V_IDENT FDB     S320,THIS,S20,IS,S20
        FDB     THE,S20,W,B,SIX
        FDB     J,H,Q,S80
        FDB     RE,P,ER,S320
        FCB     EOT
*
RMTISON FDB     S320,THE,S20,R,M,T,S160
        FDB     R,X,IS,S40,ON,S320
        FCB     EOT
*
RMTISOF FDB     S320,THE,S20,R,M,T,S160
        FDB     IS,S20,OFF,S320
        FCB     EOT
*
RMTXON  FDB     S320,THE,R,M,T,S160
        FDB     T,X,IS,ON,S320
        FCB     EOT
*
RMTXOFF FDB     S320,THE,R,M,T,S160
        FDB     T,X,S80,IS,OFF,S320
        FCB     EOT
*
PLISON  FDB     S320,THE,P,L
        FDB     IS,ON
        FCB     EOT
*
PLISOFF FDB     S320,THE,P,L
        FDB     IS,OFF,S80
        FCB     EOT
*
V_RESET FDB     TONE400,TONE80,TONE400,S320
        FDB     RE,S80,SET,S320,COMPLETE,S320,THE,TIME,ER
        FDB     IS,SET,TWO,THREE,MINUTE,SS,S20
        FCB     EOT
*
V_RNM   FDB     TONE400,TONE80,TONE400,S320
        FDB     RE,S80,SET,S320,NORMAL,S20
        FCB     EOT
*
V_TIMEN FDB     ATTENTIO,S80,ATTENTIO,S320,THE,TIME,ER,IS,ON,S320
        FCB     EOT
*
V_TIMEF FDB     ATTENTIO,S80,ATTENTIO,S320,THE,TIME,ER,IS,OFF,S320
        FCB     EOT
*
V_TOUT  FDB     S320
        FDB     TIME,S320,OUT,S20
        FCB     EOT
*
S_ZERO  FDB     ZERO,S20
        FCB     EOT
*
S_ONE   FDB     ONE,S20
        FCB     EOT
*
S_TWO   FDB     TWO,S20
        FCB     EOT
*
S_THREE FDB     THREE,S20
        FCB     EOT
*
S_FOUR  FDB     FOUR,S20
        FCB     EOT
*
S_FIVE  FDB     FIVE,S20
        FCB     EOT
*
S_SIX   FDB     SIX,S20
        FCB     EOT
*
S_SEVEN FDB     SEVEN,S20
        FCB     EOT
*
S_EIGHT FDB     EIGHT,S20
        FCB     EOT
*
S_NINE  FDB     NINE,S20
        FCB     EOT
*
S_AA    FDB     A,S20
        FCB     EOT
*
S_BB    FDB     B,S20
        FCB     EOT
*
S_CC    FDB     C,S20
        FCB     EOT
*
S_DD    FDB     D,S20
        FCB     EOT
*
S_EE    FDB     E,S20
        FCB     EOT
*
S_FF    FDB     F,S20
        FCB     EOT
*
SPKF    FDB     S320,F,C,T,B,S20
        FCB     EOT
*
S_EQUAL FDB     EQUAL,SS,S20
        FCB     EOT
*
S_CEND  FDB     S320,CONTROL,END,S20
        FCB     EOT
*
* LCD DISPLAY DATA GOES HERE.
*
*
*PUT POWER ON RESET DEFAULTS HERE.
*
*FUNCTION BYTE ONE.
*
FCT1    EQU    $77      ;POR DEFAULTS FOR FUNCTION BYTE 1. TOTAL OF FOLLOWING BITS.
*
CTRLK   EQU    $80      ;0 . . . . . . . ;CONTROLLER LOCKED.
RPT_ON  EQU    $40      ;. 1 . . . . . . ;REPEATER ON.
CHPON   EQU    $20      ;. . 1 . . . . . ;CHOPPER ON.
FSON    EQU    $10      ;. . . 1 . . . . ;FAILSAFE ON.
RMT_ON  EQU    $08      ;. . . . * . . . ;REMOTE ON.
KFLTON  EQU    $04      ;. . . . . 1 . . ;KERCHUNK FILTER ON.
DROPON  EQU    $02      ;. . . . . . 1 . ;DROP DELAY ON.
PLON    EQU    $01      ;. . . . . . . 1 ;PL MODE ON.
*
*FUNCTION BYTE TWO.
*
FCT2    EQU    $CF      ;POR DEFAULTS FOR FUNCTION BYTE 2. TOTAL OF FOLLOWING BITS.
*
PWRFL   EQU    $80      ;1 . . . . . . . ;POWER FAILURE BIT.
MUTEON  EQU    $40      ;. 1 . . . . . . ;MUTE FUNCTION ON BIT.
TIMEADJ EQU    $20      ;. . * . . . . . ;1 HERTZ TIMER ADJUSTMENT.(D)
REST_PL EQU    $10      ;. . . 0 . . . . ;AUTO RESTORE PL MODE.
RTON    EQU    $08      ;. . . . 1 . . . ;REMOTE TELEMETRY ON.
USERFA  EQU    $04      ;. . . . . 1 . . ;USER FUNCTION ALLOWED.
RSTCOR  EQU    $02      ;. . . . . . 1 . ;TIMER RESET ON COR DROP.
NPLREQ  EQU    $01      ;. . . . . . . 1 ;NO PL REQUIRED FOR DECODE.
*
*FUNCTION BYTE THREE.
*
FCT3    EQU    $9D      ;POR DEFAULTS FOR FUNCTION BYTE 3. TOTAL OF FOLLOWING BITS.
*
RESPBIT EQU    $80      ;1 . . . . . . . ;REPONSE ENABLED BIT.
SNDROM  EQU    $40      ;. * . . . . . . ;SEND ROM DATE BIT.
ID_BIT  EQU    $20      ;. . * . . . . . ;FORCE I.D. BIT.
AUTOID  EQU    $10      ;. . . 1 . . . . ;IDENTIFIER ON.
AUTOL   EQU    $08      ;. . . . 1 . . . ;AUTO LOCKUP.
BEP_ON  EQU    $04      ;. . . . . 1 . . ;COR RESET BEEP ON.
SWPTONE EQU    $02      ;. . . . . . * . ;CONTINUOUS SWEEP TONE.   (D)
ALWSUP  EQU    $01      ;. . . . . . . 1 ;ALLOW SUPPRESS VOICE ID.
*
*FUNCTION BYTE FOUR.
*
FCT4    EQU    $20      ;POR DEFAULTS FOR FUNCTION BYTE 4. TOTAL OF FOLLOWING BITS.
*
AROFF   EQU    $80      ;0 . . . . . . . ;AUTO REPEATER OFF IN 30 SECONDS.
DBLLK   EQU    $40      ;. 0 . . . . . . ;DOUBLE LOCKED BIT.
WATCHD  EQU    $20      ;. . 1 . . . . . ;REMOTE WATCH-DOG.
SERTST  EQU    $10      ;. . . * . . . . ;SENDS SERIAL DATA CONSTANTLY.
AUTOP   EQU    $08      ;. . . . 0 . . . ;AUTOPATCH ENABLED.
RPATCH  EQU    $04      ;. . . . . 0 . . ;REVERSE PATCH ENABLED.
AHANG   EQU    $02      ;. . . . . . 0 . ;AUTO-HANGUP ENABLED.
OFFHOOK EQU    $01      ;. . . . . . . * ;SET PHONE OFF-HOOK.
*
*FUNCTION BYTE FIVE.
*
FCT5    EQU    $10      ;POR DEFAULTS FOR FUNCTION BYTE 5. TOTAL OF FOLLOWING BITS.
*
ALTID   EQU    $80      ;0 . . . . . . . ;IF ON SEND/SPEAK ALTERNATE IDENT.
D_MEML  EQU    $40      ;. 0 . . . . . . ;DISPLAY MEMORY 0000-0026 HEX.
D_MEMH  EQU    $20      ;. . 0 . . . . . ;DISPLAY MEMORY 0027-004E HEX.
D_FMT   EQU    $10      ;. . . 1 . . . . ;DISPLAY FORMATED SCREEN.
A_DSP   EQU    $08      ;. . . . 0 . . . ;AUTO LCD DISPLAY OFF.
AUD_PL  EQU    $04      ;. . . . . 0 . . ;RPT AUDIO ALLOWED WITH PL ONLY.
DIAG    EQU    $02      ;. . . . . . 0 . ;DIAGNOSTIC MODE SET.
TSTONE  EQU    $01      ;. . . . . . . 0 ;CONTINUOUS TONE GEN. A=UP,B=DWN.
*
FCT6    EQU    $00      ;POR DEFAULTS FOR FUNCTION BYTE 6. TOTAL OF FOLLOWING BITS.
*
P_ID    EQU    $80      ;0 . . . . . . . ;PULSE OUTPUT ID.
P_T7    EQU    $40      ;. 0 . . . . . . ;PULSE OUTPUT T7.
P_T6    EQU    $20      ;. . 0 . . . . . ;PULSE OUTPUT T6.
P_T5    EQU    $10      ;. . . 0 . . . . ;PULSE OUTPUT T5.
P_T4    EQU    $08      ;. . . . 0 . . . ;PULSE OUTPUT T4.
P_T3    EQU    $04      ;. . . . . 0 . . ;PULSE OUTPUT T3.
P_T2    EQU    $02      ;. . . . . . 0 . ;PULSE OUTPUT T2.
P_T1    EQU    $01      ;. . . . . . . 0 ;PULSE OUTPUT T1.
*
*FEATURE BYTE.  (REQUIRES DIAGNOSTIC BIT TO BE ON TO CHANGE.)
*
FEATI   EQU    $10      ;POR DEFAULTS FOR FEATURE BYTE. TOTAL OF FOLLOWING BITS.
*
*SPARE  EQU    $80      ;0 . . . . . . . ;SPARE.
*SPARE  EQU    $40      ;. 0 . . . . . . ;SPARE.
*SPARE. EQU    $20      ;. . 0 . . . . . ;SPARE.
MIXINST EQU    $10      ;. . . 1 . . . . ;MIXER(S) INSTALLED.
*SPARE  EQU    $08      ;. . . . 0 . . . ;SPARE.
P_INST  EQU    $04      ;. . . . . 0 . . ;AUTOPATCH INSTALLED.
L_INST  EQU    $02      ;. . . . . . 0 . ;LCD DISPLAY INSTALLED.
V_INST  EQU    $01      ;. . . . . . . 0 ;DIGITALKER INSTALLED.
*
*PUT MIXER POR DEFAULTS HERE IN AUD1,AUD2. TOTAL OF FOLLOWING BITS.
*
AUD1    EQU    $01      ; TOTAL OF FOLLOWING BITS.
*
M1C8    EQU    $80      ;0 . . . . . . . ;MIXER1 CHAN8 (J8) VOICE AUDIO
M1C7    EQU    $40      ;. 0 . . . . . . ;MIXER1 CHAN7 (J7)
M1C6    EQU    $20      ;. . 0 . . . . . ;MIXER1 CHAN6 (J6)
M1C5    EQU    $10      ;. . . 0 . . . . ;MIXER1 CHAN5 (J5)
M1C4    EQU    $08      ;. . . . 0 . . . ;MIXER1 CHAN4 (J4)
M1C3    EQU    $04      ;. . . . . 0 . . ;MIXER1 CHAN3 (J3)
M1C2    EQU    $02      ;. . . . . . 0 . ;MIXER1 CHAN2 (J2) REMOTE AUDIO
M1C1    EQU    $01      ;. . . . . . . 1 ;MIXER1 CHAN1 (J1) REPEAT AUDIO
*
AUD2    EQU    $00      ; TOTAL OF FOLLOWING BITS.
*
M2C8    EQU    $80      ;0 . . . . . . . ;MIXER2 CHAN8 (J8) VOICE AUDIO
M2C7    EQU    $40      ;. 0 . . . . . . ;MIXER2 CHAN7 (J7)
M2C6    EQU    $20      ;. . 0 . . . . . ;MIXER2 CHAN6 (J6)
M2C5    EQU    $10      ;. . . 0 . . . . ;MIXER2 CHAN5 (J5)
M2C4    EQU    $08      ;. . . . 0 . . . ;MIXER2 CHAN4 (J4)
M2C3    EQU    $04      ;. . . . . 0 . . ;MIXER2 CHAN3 (J3)
M2C2    EQU    $02      ;. . . . . . 0 . ;MIXER2 CHAN2 (J2) REMOTE AUDIO
M2C1    EQU    $01      ;. . . . . . . 0 ;MIXER2 CHAN1 (J1) REPEAT AUDIO
*
*       FUNCTION TOUCHTONE CODES GO HERE.
*
* TOUCH-TONE: 1  2  3  4  5  6  7  8  9  0  *  #  A  B  C  D
*             |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
* DECODE HEX: 1  2  3  4  5  6  7  8  9  A  B  C  D  E  F  0
*
PREFIX  EQU    $0B     ;TOUCHTONE '*' (THIS TOUCHTONE PRECEEDS ALL OTHERS)
*                      ;IE. * 1 2 3 4
*  BLANK=ACCESSABLE WHEN UNLOCKED, {*}=ALWAYS ACCESSABLE UNLESS DOUBLE LOCKED.
*  X=USER FUNCTIONS.
*  ----------------------------------------------------------------------
*                                                    |
*               HEX                                  V TOUCH-TONE
F1      EQU   $1AA1    ;LOCK CODE                   {*}( 1 0 0 1 )
F2      EQU   $1AA2    ;UNLOCK CODE                 {*}( 1 0 0 2 )
F3      EQU   $1AA3    ;RESET NORMAL MODE.          [X]( 1 0 0 3 )
F4      EQU   $1AA4    ;FORCE RESET.(POR)           [ ]( 1 0 0 4 )
F5      EQU   $1AA5    ;REPEATER ON.                [X]( 1 0 0 5 )
F6      EQU   $1AA6    ;REPEATER OFF.               [X]( 1 0 0 6 )
F7      EQU   $1AA7    ;PL MODE ON.                 [X]( 1 0 0 7 )
F8      EQU   $1AA8    ;PL MODE OFF.                [X]( 1 0 0 8 )
F9      EQU   $1AA9    ;CHOPPER (3 MIN.) TIMER ON.  [ ]( 1 0 0 9 )
F10     EQU   $1A1A    ;CHOPPER OFF (3 MIN.) OFF    [ ]( 1 0 1 0 )
F11     EQU   $1A11    ;FORCE ID 0.                 [ ]( 1 0 1 1 )
F12     EQU   $1A12    ;FORCE ID 1.                 [ ]( 1 0 1 2 )
F13     EQU   $1A13    ;SET AUTO REPEATER OFF.      [ ]( 1 0 1 3 )
F14     EQU   $1A14    ;RESET AUTO REPEATER OFF.    [ ]( 1 0 1 4 )
F15     EQU   $1A15    ;TURN ON REMOTE RECEIVER.    [X]( 1 0 1 5 )
F16     EQU   $1A16    ;TURN OFF REMOTE RX/TX.      [X]( 1 0 1 6 )
F17     EQU   $1A17    ;REMOTE TRANSMIT ENABLE.     [X]( 1 0 1 7 )
F18     EQU   $1A18    ;REMOTE TRANSMIT DISABLE.    [X]( 1 0 1 8 )
F19     EQU   $1A19    ;KERCHUNK FILTER ON.         [ ]( 1 0 1 9 )
F20     EQU   $1A2A    ;KERCHUNK FILTER OFF.        [ ]( 1 0 2 0 )
F21     EQU   $1A21    ;DROP DELAY ON.              [ ]( 1 0 2 1 )
F22     EQU   $1A22    ;DROP DELAY OFF.             [ ]( 1 0 2 2 )
F23     EQU   $1A23    ;CLEAR POWER IND. (.__.)     {*}( 1 0 2 3 )
F24     EQU   $1A24    ;SEND EPROM DATE IN M/V.     [ ]( 1 0 2 4 )
F25     EQU   $1A25    ;ADJUST 1 HERTZ TIMER.   (D) [ ]( 1 0 2 5 )
F26     EQU   $1A26    ;MUTE ON.(TX DROP ON DTMF).  [ ]( 1 0 2 6 )
F27     EQU   $1A27    ;MUTE OFF.(NO TX DROP).      [ ]( 1 0 2 7 )
F28     EQU   $1A28    ;USER FUNCTIONS ALLOWED.     [ ]( 1 0 2 8 )
F29     EQU   $1A29    ;USER FUNCTS NOT ALLOWED.    [X]( 1 0 2 9 )
F30     EQU   $1A3A    ;TIMER RESET ON COR DROP.    [ ]( 1 0 3 0 )
F31     EQU   $1A31    ;TIMER RESET ON TX DROP.     [ ]( 1 0 3 1 )
F32     EQU   $1A32    ;RESPONSE ON.(._,)           [ ]( 1 0 3 2 )
F33     EQU   $1A33    ;RESPONSE OFF.               [ ]( 1 0 3 3 )
F34     EQU   $1A34    ;AUTO RESTORE PL MODE.       [ ]( 1 0 3 4 )
F35     EQU   $1A35    ;DON'T RESTORE PL MODE.      [ ]( 1 0 3 5 )
F36     EQU   $1A36    ;REMOTE WATCH-DOG ON.        [ ]( 1 0 3 6 )
F37     EQU   $1A37    ;REMOTE WATCH-DOG OFF.       [ ]( 1 0 3 7 )
F38     EQU   $1A38    ;REMOTE TELEMETRY ON.        [ ]( 1 0 3 8 )
F39     EQU   $1A39    ;REMOTE TELEMETRY OFF.       [ ]( 1 0 3 9 )
F40     EQU   $1A4A    ;NO PL REQUIRED FOR DECODE.  [ ]( 1 0 4 0 )
F41     EQU   $1A41    ;PL REQUIRED FOR DECODE.     [ ]( 1 0 4 1 )
F42     EQU   $1A42    ;COR RESET BEEP ON.          [ ]( 1 0 4 2 )
F43     EQU   $1A43    ;COR RESET BEEP OFF.         [ ]( 1 0 4 3 )
F44     EQU   $1A44    ;SET AUTO LOCKUP.            [ ]( 1 0 4 4 )
F45     EQU   $1A45    ;RESET AUTO LOCKUP.          [ ]( 1 0 4 5 )
F46     EQU   $1A46    ;SET DOUBLE LOCKED.          {*}( 1 0 4 6 )
F47     EQU   $1A47    ;RST DOUBLE LOCKED.          {*}( 1 0 4 7 )
F48     EQU   $1A48    ;ENABLE IDENTIFIER.          [ ]( 1 0 4 8 )
F49     EQU   $1A49    ;DISABLE IDENTIFIER.         [ ]( 1 0 4 9 )
F50     EQU   $1A5A    ;FAILSAFE ON.                [ ]( 1 0 5 0 )
F51     EQU   $1A51    ;FAILSAFE OFF.               [ ]( 1 0 5 1 )
F52     EQU   $1A52    ;ALL TIMERS & PL ON.         [X]( 1 0 5 2 )
F53     EQU   $1A53    ;ALL TIMERS & PL OFF.        [X]( 1 0 5 3 )
F54     EQU   $1A54    ;SET SERIAL TEST.        (D) [ ]( 1 0 5 4 )
F55     EQU   $1A55    ;RESET SERIAL TEST.          [ ]( 1 0 5 5 )
F56     EQU   $1A56    ;INCR. MIN10 CNTR.           [ ]( 1 0 5 6 )
F57     EQU   $1A57    ;DECR. MIN10 CNTR.           [ ]( 1 0 5 7 )
F58     EQU   $1A58    ;INCR. CHOP TIMER.           [ ]( 1 0 5 8 )
F59     EQU   $1A59    ;DECR. CHOP TIMER.           [ ]( 1 0 5 9 )
F60     EQU   $1A6A    ;INCR. KERCHUNK FILTER.      [ ]( 1 0 6 0 )
F61     EQU   $1A61    ;DECR. KERCHUNK FILTER.      [ ]( 1 0 6 1 )
F62     EQU   $1A62    ;INCR. DROP DELAY CNTR.      [ ]( 1 0 6 2 )
F63     EQU   $1A63    ;DECR. DROP DELAY CNTR.      [ ]( 1 0 6 3 )
F64     EQU   $1A64    ;INCR. ID TIMER.             [ ]( 1 0 6 4 )
F65     EQU   $1A65    ;DECR. ID TIMER.             [ ]( 1 0 6 5 )
F66     EQU   $1A66    ;ALTERNATE ID SET.           [ ]( 1 0 6 6 )
F67     EQU   $1A67    ;ALTERNATE ID RESET.         [ ]( 1 0 6 7 )
F68     EQU   $1A68    ;TURN ON T6.                 [ ]( 1 0 6 8 )
F69     EQU   $1A69    ;TURN OFF T6.                [ ]( 1 0 6 9 )
F70     EQU   $1A7A    ;TURN ON T7.                 [ ]( 1 0 7 0 )
F71     EQU   $1A71    ;TURN OFF T7.                [ ]( 1 0 7 1 )
F72     EQU   $1A72    ;TURN ON T4.                 [ ]( 1 0 7 2 )
F73     EQU   $1A73    ;TURN OFF T4.                [ ]( 1 0 7 3 )
F74     EQU   $1A74    ;TURN ON T3.                 [ ]( 1 0 7 4 )
F75     EQU   $1A75    ;TURN OFF T3.                [ ]( 1 0 7 5 )
F76     EQU   $1A76    ;TURN ON T2.                 [ ]( 1 0 7 6 )
F77     EQU   $1A77    ;TURN OFF T2.                [ ]( 1 0 7 7 )
F78     EQU   $1A78    ;TURN ON T1.                 [ ]( 1 0 7 8 )
F79     EQU   $1A79    ;TURN OFF T1.                [ ]( 1 0 7 9 )
F80     EQU   $1A8A    ;TURN ON MIXER1 CHAN 8. (J8) [ ]( 1 0 8 0 )
F81     EQU   $1A81    ;TURN OFF MIXER1 CHAN 8.     [ ]( 1 0 8 1 )
F82     EQU   $1A82    ;TURN ON MIXER1 CHAN 7. (J7) [ ]( 1 0 8 2 )
F83     EQU   $1A83    ;TURN OFF MIXER1 CHAN 7.     [ ]( 1 0 8 3 )
F84     EQU   $1A84    ;TURN ON MIXER1 CHAN 6. (J6) [ ]( 1 0 8 4 )
F85     EQU   $1A85    ;TURN OFF MIXER1 CHAN 6.     [ ]( 1 0 8 5 )
F86     EQU   $1A86    ;TURN ON MIXER1 CHAN 5. (J5) [ ]( 1 0 8 6 )
F87     EQU   $1A87    ;TURN OFF MIXER1 CHAN 5.     [ ]( 1 0 8 7 )
F88     EQU   $1A88    ;TURN ON MIXER1 CHAN 4. (J4) [ ]( 1 0 8 8 )
F89     EQU   $1A89    ;TURN OFF MIXER1 CHAN 4.     [ ]( 1 0 8 9 )
F90     EQU   $1A9A    ;TURN ON MIXER1 CHAN 3. (J3) [ ]( 1 0 9 0 )
F91     EQU   $1A91    ;TURN OFF MIXER1 CHAN 3.     [ ]( 1 0 9 1 )
F92     EQU   $1A92    ;TURN ON MIXER1 CHAN 2. (J2) [ ]( 1 0 9 2 )
F93     EQU   $1A93    ;TURN OFF MIXER1 CHAN 2.     [ ]( 1 0 9 3 )
F94     EQU   $1A94    ;TURN ON MIXER1 CHAN 1. (J1) [ ]( 1 0 9 4 )
F95     EQU   $1A95    ;TURN OFF MIXER1 CHAN 1.     [ ]( 1 0 9 5 )
F96     EQU   $1A96    ;TURN ON MIXER2 CHAN 8. (J8) [ ]( 1 0 9 6 )
F97     EQU   $1A97    ;TURN OFF MIXER2 CHAN 8.     [ ]( 1 0 9 7 )
F98     EQU   $1A98    ;TURN ON MIXER2 CHAN 7. (J7) [ ]( 1 0 9 8 )
F99     EQU   $1A99    ;TURN OFF MIXER2 CHAN 7.     [ ]( 1 0 9 9 )
F100    EQU   $11AA    ;TURN ON MIXER2 CHAN 6. (J6) [ ]( 1 1 0 0 )
F101    EQU   $11A1    ;TURN OFF MIXER2 CHAN 6.     [ ]( 1 1 0 1 )
F102    EQU   $11A2    ;TURN ON MIXER2 CHAN 5. (J5) [ ]( 1 1 0 2 )
F103    EQU   $11A3    ;TURN OFF MIXER2 CHAN 5.     [ ]( 1 1 0 3 )
F104    EQU   $11A4    ;TURN ON MIXER2 CHAN 4. (J4) [ ]( 1 1 0 4 )
F105    EQU   $11A5    ;TURN OFF MIXER2 CHAN 4.     [ ]( 1 1 0 5 )
F106    EQU   $11A6    ;TURN ON MIXER2 CHAN 3. (J3) [ ]( 1 1 0 6 )
F107    EQU   $11A7    ;TURN OFF MIXER2 CHAN 3.     [ ]( 1 1 0 7 )
F108    EQU   $11A8    ;TURN ON MIXER2 CHAN 2. (J2) [ ]( 1 1 0 8 )
F109    EQU   $11A9    ;TURN OFF MIXER2 CHAN 2.     [ ]( 1 1 0 9 )
F110    EQU   $111A    ;TURN ON MIXER2 CHAN 1. (J1) [ ]( 1 1 1 0 )
F111    EQU   $1111    ;TURN OFF MIXER2 CHAN 1.     [ ]( 1 1 1 1 )
F112    EQU   $1112    ;ENABLE AUTO-HANGUP.         [ ]( 1 1 1 2 )
F113    EQU   $1113    ;DISABLE AUTO-HANGUP.        [ ]( 1 1 1 3 )
F114    EQU   $1114    ;ENABLE REVERSE PATCH.       [ ]( 1 1 1 4 )
F115    EQU   $1115    ;DISABLE REVERSE PATCH.      [ ]( 1 1 1 5 )
F116    EQU   $1116    ;ANSWER PHONE.               [ ]( 1 1 1 6 )
F117    EQU   $1117    ;HANG-UP PHONE.              [ ]( 1 1 1 7 )
F118    EQU   $1118    ;AUTOPATCH ENABLE.           [ ]( 1 1 1 8 )
F119    EQU   $1119    ;AUTOPATCH DISABLE.          [ ]( 1 1 1 9 )
F120    EQU   $112A    ;MEMORY DUMP LOW ONE TIME.   [ ]( 1 1 2 0 )
F121    EQU   $1121    ;MEMORY DUMP HIGH ONE TIME.  [ ]( 1 1 2 1 )
F122    EQU   $1122    ;SET MEM DUMP LOW. $0000-0026[ ]( 1 1 2 2 )
F123    EQU   $1123    ;RESET MEMORY DUMP LOW.      [ ]( 1 1 2 3 )
F124    EQU   $1124    ;SET MEM DUMP HI. $0027-004E [ ]( 1 1 2 4 )
F125    EQU   $1125    ;RESET MEMORY DUMP HIGH.     [ ]( 1 1 2 5 )
F126    EQU   $1126    ;SAY FUNCTION BYTES.         [ ]( 1 1 2 6 )
F127    EQU   $1127    ;CLEAR LCD.                  [ ]( 1 1 2 7 )
F128    EQU   $1128    ;LCD ON.                     [ ]( 1 1 2 8 )
F129    EQU   $1129    ;LCD OFF.                    [ ]( 1 1 2 9 )
F130    EQU   $113A    ;SET FORMATED DISPLAY.       [ ]( 1 1 3 0 )
F131    EQU   $1131    ;RESET FORMATED DISPLAY.     [ ]( 1 1 3 1 )
F132    EQU   $1132    ;ENABLE AUTO DISPLAY OFF.    [ ]( 1 1 3 2 )
F133    EQU   $1133    ;DISABLE AUTO DISPLAY OFF.   [ ]( 1 1 3 3 )
F134    EQU   $1134    ;RPT. AUDIO WITH PL ONLY.    [ ]( 1 1 3 4 )
F135    EQU   $1135    ;RPT. AUDIO WITHOUT PL.      [ ]( 1 1 3 5 )
F136    EQU   $1136    ;SAY TIMER STATE.            [ ]( 1 1 3 6 )
F137    EQU   $1137    ;RESET TALKER BUSY.          [ ]( 1 1 3 7 )
F138    EQU   $1138    ;FORCE OFF CONTROLLER.       [ ]( 1 1 3 8 )
F139    EQU   $1139    ;DO EPROM CHECKSUM.          [ ]( 1 1 3 9 )
F140    EQU   $114A    ;SET ALLOW SUPP. VOICE ID.   [ ]( 1 1 4 0 )
F141    EQU   $1141    ;RESET ALLOW SUPP. VOICE ID. [ ]( 1 1 4 1 )
F144    EQU   $1144    ;TURN OFF RPTR FOR 5 MINS.   [X]( 1 1 4 4 )
F200    EQU   $12AA    ;INCREMENT DIT LENGTH +1     [ ]( 1 2 0 0 )
F201    EQU   $12A1    ;DECREMENT DIT LENGTH -1     [ ]( 1 2 0 1 )
F202    EQU   $12A2    ;INCREMENT SPACE LENGTH +1   [ ]( 1 2 0 2 )
F203    EQU   $12A3    ;DECREMENT SPACE LENGTH -1   [ ]( 1 2 0 3 )
F204    EQU   $12A4    ;INCREMENT DAH LENGTH +1     [ ]( 1 2 0 4 )
F205    EQU   $12A5    ;DECREMENT DAH LENGTH -1     [ ]( 1 2 0 5 )
F206    EQU   $12A6    ;INCREMENT DIT LENGTH +5     [ ]( 1 2 0 6 )
F207    EQU   $12A7    ;DECREMENT DIT LENGTH -5     [ ]( 1 2 0 7 )
F208    EQU   $12A8    ;INCREMENT SPACE LENGTH +5   [ ]( 1 2 0 8 )
F209    EQU   $12A9    ;DECREMENT SPACE LENGTH -5   [ ]( 1 2 0 9 )
F210    EQU   $121A    ;INCREMENT DAH LENGTH +5     [ ]( 1 2 1 0 )
F211    EQU   $1211    ;DECREMENT DAH LENGTH -5     [ ]( 1 2 1 1 )
F212    EQU   $1212    ;INCREMENT DIT LENGTH +10    [ ]( 1 2 1 2 )
F213    EQU   $1213    ;DECREMENT DIT LENGTH -10    [ ]( 1 2 1 3 )
F214    EQU   $1214    ;INCREMENT SPACE LENGTH +10  [ ]( 1 2 1 4 )
F215    EQU   $1215    ;DECREMENT SPACE LENGTH -10  [ ]( 1 2 1 5 )
F216    EQU   $1216    ;INCREMENT DAH LENGTH +10    [ ]( 1 2 1 6 )
F217    EQU   $1217    ;DECREMENT DAH LENGTH -10    [ ]( 1 2 1 7 )
F218    EQU   $1218    ;ID TONE UP +1               [ ]( 1 2 1 8 )
F219    EQU   $1219    ;ID TONE DOWN -1             [ ]( 1 2 1 9 )
F220    EQU   $122A    ;ID TONE UP +5               [ ]( 1 2 2 0 )
F221    EQU   $1221    ;ID TONE DOWN -5             [ ]( 1 2 2 1 )
F222    EQU   $1222    ;ID TONE UP +10              [ ]( 1 2 2 2 )
F223    EQU   $1223    ;ID TONE DOWN -10            [ ]( 1 2 2 3 )
F224    EQU   $1224    ;ID SPEED UP +1              [ ]( 1 2 2 4 )
F225    EQU   $1225    ;ID SPEED DOWN -1            [ ]( 1 2 2 5 )
F226    EQU   $1226    ;ID SPEED UP +5              [ ]( 1 2 2 6 )
F227    EQU   $1227    ;ID SPEED DOWN -5            [ ]( 1 2 2 7 )
F228    EQU   $1228    ;ID SPEED UP +10             [ ]( 1 2 2 8 )
F229    EQU   $1229    ;ID SPEED DOWN -10           [ ]( 1 2 2 9 )
F230    EQU   $123A    ;SET PHONE FEATURE BIT.  (D) [ ]( 1 2 3 0 )
F231    EQU   $1231    ;RESET PHONE FEATURE BIT.(D) [ ]( 1 2 3 1 )
F232    EQU   $1232    ;SET LCD FEATURE BIT.    (D) [ ]( 1 2 3 2 )
F233    EQU   $1233    ;RESET LCD FEATURE BIT.  (D) [ ]( 1 2 3 3 )
F234    EQU   $1234    ;SET VOICE FEATURE BIT.  (D) [ ]( 1 2 3 4 )
F235    EQU   $1235    ;RESET VOICE FEATURE BIT.(D) [ ]( 1 2 3 5 )
F236    EQU   $1236    ;SET DIAGNOSTIC MODE.        [ ]( 1 2 3 6 )
F237    EQU   $1237    ;RESET DIAGNOSTIC MODE.      [ ]( 1 2 3 7 )
F238    EQU   $1238    ;TEST TONE GENERATE.     (D) [ ]( 1 2 3 8 )
F239    EQU   $1239    ;PULSE T1 OUTOUT.            [ ]( 1 2 3 9 )
F240    EQU   $124A    ;PULSE T2 OUTOUT.            [ ]( 1 2 4 0 )
F241    EQU   $1241    ;PULSE T3 OUTOUT.            [ ]( 1 2 4 1 )
F242    EQU   $1242    ;PULSE T4 OUTOUT.            [ ]( 1 2 4 2 )
F243    EQU   $1243    ;PULSE T5 OUTOUT.            [ ]( 1 2 4 3 )
F244    EQU   $1244    ;PULSE T6 OUTOUT.            [ ]( 1 2 4 4 )
F245    EQU   $1245    ;PULSE T7 OUTOUT.            [ ]( 1 2 4 5 )
F246    EQU   $1246    ;PULSE ID OUTOUT.            [ ]( 1 2 4 6 )
F247    EQU   $1247    ;SET MIXER INSTALLED.    (D) [ ]( 1 2 4 7 )
F248    EQU   $1248    ;RESET MIXER INSTALLED.  (D) [ ]( 1 2 4 8 )
F249    EQU   $1249    ;SET SWEEP TONE.         (D) [ ]( 1 2 4 9 )
F250    EQU   $125A    ;RESET SWEEP TONE.       (D) [ ]( 1 2 5 0 )
*
****** NOTE: FUNCTIONS WITH AN * NEXT TO THEM REQUIRE A FEATURE TO WORK.******
*
F_TABLE FDB     F4,FRCRST
        FDB     F9,S15
        FDB     F10,R15
        FDB     F11,F_ID0
        FDB     F12,F_ID1
        FDB     F13,SAROFF
        FDB     F14,RAROFF
        FDB     F19,KON
        FDB     F20,KOFF
        FDB     F21,S11
        FDB     F22,R11
        FDB     F24,SROM
        FDB     F25,ADJ_ON
        FDB     F26,MON
        FDB     F27,MOFF
        FDB     F28,USERA
        FDB     F30,TROCD
        FDB     F31,TROTD
        FDB     F32,RSPON
        FDB     F33,RSPOFF
        FDB     F34,ARP
        FDB     F35,RARP
        FDB     F36,SWDOG
        FDB     F37,RWDOG
        FDB     F38,RTON1
        FDB     F39,RTOFF
        FDB     F40,R_20
        FDB     F41,S_20
        FDB     F42,RSTBON
        FDB     F43,RSTBOFF
        FDB     F44,SALOCK
        FDB     F45,RALOCK
        FDB     F48,ID_ON
        FDB     F49,ID_OFF
        FDB     F50,S14
        FDB     F51,R14
        FDB     F54,SSTST
        FDB     F55,RSTST
        FDB     F56,IMC
        FDB     F57,DMC
        FDB     F58,ICT
        FDB     F59,DCT
        FDB     F60,IKF
        FDB     F61,DKF
        FDB     F62,IDC
        FDB     F63,DDC
        FDB     F64,IIC
        FDB     F65,DIC
        FDB     F66,S57
        FDB     F67,R57
        FDB     F68,SF1
        FDB     F69,RF1
        FDB     F70,SF2
        FDB     F71,RF2
        FDB     F72,SF3
        FDB     F73,RF3
        FDB     F74,SF4
        FDB     F75,RF4
        FDB     F76,SF5
        FDB     F77,RF5
        FDB     F78,SF6
        FDB     F79,RF6
        FDB     F80,TOM1C8
        FDB     F81,TOFM1C8
        FDB     F82,TOM1C7
        FDB     F83,TOFM1C7
        FDB     F84,TOM1C6
        FDB     F85,TOFM1C6
        FDB     F86,TOM1C5
        FDB     F87,TOFM1C5
        FDB     F88,TOM1C4
        FDB     F89,TOFM1C4
        FDB     F90,TOM1C3
        FDB     F91,TOFM1C3
        FDB     F92,TOM1C2
        FDB     F93,TOFM1C2
        FDB     F94,TOM1C1
        FDB     F95,TOFM1C1
        FDB     F96,TOM2C8
        FDB     F97,TOFM2C8
        FDB     F98,TOM2C7
        FDB     F99,TOFM2C7
        FDB     F100,TOM2C6
        FDB     F101,TOFM2C6
        FDB     F102,TOM2C5
        FDB     F103,TOFM2C5
        FDB     F104,TOM2C4
        FDB     F105,TOFM2C4
        FDB     F106,TOM2C3
        FDB     F107,TOFM2C3
        FDB     F108,TOM2C2
        FDB     F109,TOFM2C2
        FDB     F110,TOM2C1
        FDB     F111,TOFM2C1
        FDB     F112,EAHNG
        FDB     F113,DAHNG
        FDB     F114,RF3
        FDB     F115,SF3
        FDB     F116,SS40
        FDB     F117,RR40
        FDB     F118,EAP
        FDB     F119,DAP
        FDB     F120,DUMPL
        FDB     F121,DUMPH
        FDB     F122,S56
        FDB     F123,R56
        FDB     F124,S55
        FDB     F125,R55
        FDB     F126,S_SAYF1
        FDB     F127,C_LCD
        FDB     F128,ON_L
        FDB     F129,OFF_L
        FDB     F130,S54
        FDB     F131,R54
        FDB     F132,S53
        FDB     F133,R53
        FDB     F134,S52
        FDB     F135,R52
        FDB     F136,SST
        FDB     F137,RTB
        FDB     F138,FORCE
        FDB     F139,CHKSUM1
        FDB     F140,S30
        FDB     F141,R30
        FDB     F200,IDIT1
        FDB     F201,DDIT1
        FDB     F202,ISPC1
        FDB     F203,DSPC1
        FDB     F204,IDAH1
        FDB     F205,DDAH1
        FDB     F206,IDIT5
        FDB     F207,DDIT5
        FDB     F208,ISPC5
        FDB     F209,DSPC5
        FDB     F210,IDAH5
        FDB     F211,DDAH5
        FDB     F212,IDIT10
        FDB     F213,DDIT10
        FDB     F214,ISPC10
        FDB     F215,DSPC10
        FDB     F216,IDAH10
        FDB     F217,DDAH10
        FDB     F218,ID_UP1
        FDB     F219,ID_DN1
        FDB     F220,ID_UP5
        FDB     F221,ID_DN5
        FDB     F222,ID_UP10
        FDB     F223,ID_DN10
        FDB     F224,SP_UP1
        FDB     F225,SP_DN1
        FDB     F226,SP_UP5
        FDB     F227,SP_DN5
        FDB     F228,SP_UP10
        FDB     F229,SP_DN10
        FDB     F230,SP_IN
        FDB     F231,RSP_IN
        FDB     F232,SL_IN
        FDB     F233,RSL_IN
        FDB     F234,SV_IN
        FDB     F235,RSV_IN
        FDB     F236,S51
        FDB     F237,R51
        FDB     F238,S50
        FDB     F239,S60
        FDB     F240,S61
        FDB     F241,S62
        FDB     F242,S63
        FDB     F243,S64
        FDB     F244,S65
        FDB     F245,S66
        FDB     F246,S67
        FDB     F247,SM1_IN
        FDB     F248,RM1_IN
        FDB     F249,SWPON
        FDB     F250,SWPOFF
UFA     FDB     F3,RNM
        FDB     F5,S16
        FDB     F6,R16
        FDB     F7,S10
        FDB     F8,R10
        FDB     F15,S13
        FDB     F16,R13
        FDB     F17,RMT_EN
        FDB     F18,RMT_DIS
        FDB     F29,USERNA
        FDB     F52,ALLTON
        FDB     F53,ALLTOFF
        FDB     F144,TFR5MIN
SECOND  FDB     F1,S17
        FDB     F2,R17
PRIM    FDB     F46,SDBL
        FDB     F47,RSDBL
        FDB     F23,PORRST
ENDTAB  RMB     1
*
* THIS IS THE DIGITALKER EXPANDED VOCABULARY IN ROM.
*
*ROMS 1 AND 2 START HERE.
*
ONE       EQU  $0001
TWO       EQU  $0002
THREE     EQU  $0003
FOUR      EQU  $0004
FIVE      EQU  $0005
SIX       EQU  $0006
SEVEN     EQU  $0007
EIGHT     EQU  $0008
NINE      EQU  $0009
TEN       EQU  $000A
ELEVEN    EQU  $000B
TWELVE    EQU  $000C
THIRTEEN  EQU  $000D
FOURTEEN  EQU  $000E
FIFTEEN   EQU  $000F
SIXTEEN   EQU  $0010
SEVENTEE  EQU  $0011
EIGHTEEN  EQU  $0012
NINETEEN  EQU  $0013
TWENTY    EQU  $0014
THIRTY    EQU  $0015
FORTY     EQU  $0016
FIFTY     EQU  $0017
SIXTY     EQU  $0018
SEVENTY   EQU  $0019
EIGHTY    EQU  $001A
NINETY    EQU  $001B
HUNDRED   EQU  $001C
THOUSAND  EQU  $001D
MILLION   EQU  $001E
ZERO      EQU  $001F
A         EQU  $0020
B         EQU  $0021
C         EQU  $0022
D         EQU  $0023
E         EQU  $0024
F         EQU  $0025
G         EQU  $0026
H         EQU  $0027
I         EQU  $0028
J         EQU  $0029
K         EQU  $002A
L         EQU  $002B
M         EQU  $002C
N         EQU  $002D
O         EQU  $002E
P         EQU  $002F
Q         EQU  $0030
R         EQU  $0031
S         EQU  $0032
T         EQU  $0033
U         EQU  $0034
V         EQU  $0035
W         EQU  $0036
X         EQU  $0037
Y         EQU  $0038
Z         EQU  $0039
AGAIN     EQU  $003A
AND       EQU  $003C
AT        EQU  $003D
CANCEL    EQU  $003E
CASE      EQU  $003F
TONE400   EQU  $0041
TONE80    EQU  $0042
S20       EQU  $0043
S40       EQU  $0044
S80       EQU  $0045
S160      EQU  $0046
S320      EQU  $0047
CENTI     EQU  $0048
CHECK     EQU  $0049
CONTROL   EQU  $004B
EQUAL     EQU  $0050
ERROR     EQU  $0051
GO        EQU  $0056
HAVE      EQU  $005A
HIGH      EQU  $005B
HIGHER    EQU  $005C
HOUR      EQU  $005D
IN        EQU  $005E
IS        EQU  $0060
IT        EQU  $0061
KILO      EQU  $0062
LOW       EQU  $0067
LOWER     EQU  $0068
METER     EQU  $006A
MILE      EQU  $006B
MINUS     EQU  $006D
MINUTE    EQU  $006E
NEAR      EQU  $006F
NUMBER    EQU  $0070
OF        EQU  $0071
OFF       EQU  $0072
ON        EQU  $0073
OUT       EQU  $0074
OVER      EQU  $0075
PARENTHE  EQU  $0076
PERCENT   EQU  $0077
PLEASE    EQU  $0078
PLUS      EQU  $0079
POINT     EQU  $007A
PULSES    EQU  $007C
RATE      EQU  $007D
RE        EQU  $007E
READY     EQU  $007F
RIGHT     EQU  $0080
SS        EQU  $0081
SECND     EQU  $0082
SET       EQU  $0083
SPACE     EQU  $0084
SPEED     EQU  $0085
STAR      EQU  $0086
START     EQU  $0087
STOP      EQU  $0088
THAN      EQU  $0089
THE       EQU  $008A
TIME      EQU  $008B
TRY       EQU  $008C
UP        EQU  $008D
VOLT      EQU  $008E
WEIGHT    EQU  $008F
*
* ROMS 3 AND 4 START HERE.
*
ABORT      EQU  $0100
ADD        EQU  $0101
ADJUST     EQU  $0102
ALARM      EQU  $0103
ALERT      EQU  $0104
ALL        EQU  $0105
ASK        EQU  $0106
ASSISTAN   EQU  $0107
ATTENTIO   EQU  $0108
BRAKE      EQU  $0109
BUTTON     EQU  $010A
BUY        EQU  $010B
CALL       EQU  $010C
CAUTION    EQU  $010D
CHANGE     EQU  $010E
CIRCUIT    EQU  $010F
CLEAR      EQU  $0110
CLOSE      EQU  $0111
COMPLETE   EQU  $0112
CONNECT    EQU  $0113
CONTINUE   EQU  $0114
COPY       EQU  $0115
CORRECT    EQU  $0116
DATE       EQU  $0117
DAY        EQU  $0118
DECREASE   EQU  $0119
DEPOSIT    EQU  $011A
DIAL       EQU  $011B
ED1        EQU  $011F
ED2        EQU  $0120
ED3        EQU  $0121
ED4        EQU  $0122
EMERGENC   EQU  $0123
END        EQU  $0124
ENTER      EQU  $0125
ENTRY      EQU  $0126
ER         EQU  $0127
EVACUATE   EQU  $0128
EXIT       EQU  $0129
FAIL       EQU  $012A
FAILURE    EQU  $012B
FAST       EQU  $012D
FASTER     EQU  $012E
FIFTH      EQU  $012F
FIRE       EQU  $0130
FIRST      EQU  $0131
FORWARD    EQU  $0133
FROM       EQU  $0134
GET        EQU  $0136
GOING      EQU  $0137
HALF       EQU  $0138
HELLO      EQU  $0139
HELP       EQU  $013A
HERTZ      EQU  $013B
HOLD       EQU  $013C
INCORREC   EQU  $013D
INCREASE   EQU  $013E
INTRUDER   EQU  $013F
JUST       EQU  $0140
KEY        EQU  $0141
LEVEL      EQU  $0142
LOAD       EQU  $0143
LOCK       EQU  $0144
MEG        EQU  $0145
MEGA       EQU  $0146
MICRO      EQU  $0147
MORE       EQU  $0148
MOVE       EQU  $0149
NANO       EQU  $014A
NEED       EQU  $014B
NEXT       EQU  $014C
NO         EQU  $014D
NORMAL     EQU  $014E
NORTH      EQU  $014F
NOT        EQU  $0150
NOTICE     EQU  $0151
OHMS       EQU  $0152
OPEN       EQU  $0154
OPERATOR   EQU  $0155
OR         EQU  $0156
PER        EQU  $0158
PRESS      EQU  $015B
RANGE      EQU  $015E
RECEIVE    EQU  $0160
RECORD     EQU  $0161
REPLACE    EQU  $0162
SECURE     EQU  $0166
SELECT     EQU  $0167
SEND       EQU  $0168
SERVICE    EQU  $0169
STATION    EQU  $016F
SWITCH     EQU  $0170
SYSTEM     EQU  $0171
TEST       EQU  $0172
TH         EQU  $0173
THANK      EQU  $0174
THIRD      EQU  $0175
THIS       EQU  $0176
TOTAL      EQU  $0177
TURN       EQU  $0178
USE        EQU  $0179
UTH        EQU  $017A
WAITING    EQU  $017B
WARNING    EQU  $017C
WHICH      EQU  $017F
YES        EQU  $0181
*
* LOW MEMORY ASSIGNMENTS
*
MIN3    EQU     $0000    ;3 MINUTE CHOP TIMER SAVE AREA.(1)
M10INT  EQU     $0001    ;INIT VALUE FOR IDTEN.(2)
IDTEN   EQU     $0003    ;ID TIMER.(2)
XTEMP   EQU     $0005    ;TEMP STORAGE FOR SCODE RTN.(2)
TONECT  EQU     $0007    ;TONE DURATION SAVE AREA.(2)
CORRST  EQU     $0009    ;COUNTER FOR RESTORING PL MODE.(1)
UTIME   EQU     $000A    ;MORSE TONE GENERATOR SAVE AREA.(1)
FCCTR   EQU     $000B    ;FUNCTION CONPLETE COUNTER.(1)
X_INC   EQU     $000C    ;INDEX REG. INCREMENT AREA.(2)
DITCNT  EQU     $000E    ;DIT COUNTER FOR SCODE RTN.(2)
SPACNT  EQU     $0010    ;SPACE COUNTER FOR SCODE RTN.(2)
DAHCNT  EQU     $0012    ;DAH COUNTER FOR SCODE RTN.(2)
M3INT   EQU     $0014    ;INIT VALUE FOR MIN3.(1)
KINT    EQU     $0015    ;KERCHUNK INIT.(2)
DINT    EQU     $0017    ;DELAY COUNTER INIT.(2)
ARPLMS  EQU     $0019    ;AUTO-RESTORE PLMODE TIMER SAVE AREA.(2)
FLAGS0  EQU     $001B    ;FLAGS REG 0.(1)
FLAGS1  EQU     $001C    ;FLAGS REG 1.(1)
FLAGS2  EQU     $001D    ;FLAGS REG 2.(1)
FLAGS3  EQU     $001E    ;FLAGS REG 3.(1)
IN1     EQU     $001F    ;INPUT AREA BYTE ONE, 2 DIGITS.(1)
IN2     EQU     $0020    ;INPUT AREA BYTE TWO, 2 DIGITS.(1)
DCTR    EQU     $0021    ;DIGIT COUNTER SAVE AREA.(1)
FCTB1   EQU     $0022    ;FUNCTION BYTE ONE.(1)
FCTB2   EQU     $0023    ;FUNCTION BYTE TWO.(1)
FCTB3   EQU     $0024    ;FUNCTION BYTE THREE.(1)
FCTB4   EQU     $0025    ;FUNCTION BYTE FOUR.(1)
FCTB5   EQU     $0026    ;FUNCTION BYTE FIVE.(1)
FCTB6   EQU     $0027    ;FUNCTION BYTE SIX.(1)
FCTB7   EQU     $0028    ;FUNCTION BYTE SEVEN.(1)
MIX1    EQU     $0029    ;AUDIO MIXER 1 CONTROL BYTE.(1)
MIX2    EQU     $002A    ;AUDIO MIXER 2 CONTROL BYTE.(1)
MUTECNT EQU     $002B    ;MUTE COUNTER SAVE AREA.(1)
PMTO16  EQU     $002C    ;PMTO COUNTER SAVE AREA.(1)
MSAVE0  EQU     $002D    ;TEMP DATA SAVE AREA FOR MORSE CONV.(1)
MSAVE1  EQU     $002E    ;TERMINATE CHARACTER FOR MORSE CONV.(1)
SAVEXM  EQU     $002F    ;TEMP INDEX SAVE AREA FOR MORSE CONV.(2)
FREQ    EQU     $0031    ;SETS TONE FREQUENCY.(1)
RMTDLY  EQU     $0032    ;REMOTE TX DROP DELAY.(2)
SAVEF1  EQU     $0034    ;TEMP STORAGE OF FUNCT. BYTES 1 FOR RMT.(1)
SAVEF2  EQU     $0035    ;TEMP STORAGE OF FUNCT. BYTES 2 FOR RMT.(1)
SAVEF3  EQU     $0036    ;TEMP STORAGE OF FUNCT. BYTES 3 FOR RMT.(1)
SAVEF4  EQU     $0037    ;TEMP STORAGE OF FUNCT. BYTES 4 FOR RMT.(1)
SAVEF5  EQU     $0038    ;TEMP STORAGE OF FUNCT. BYTES 5 FOR RMT.(1)
TALKX   EQU     $0039    ;TEMP STORAGE FOR DIGITALKER WORD POINTER.(2)
LCDX    EQU     $003B    ;TEMP STORAGE FOR LCD DATA POINTER.(2)
APTIMER EQU     $003D    ;AUTOPATCH AUTO-HANG-UP TIMER.(1)
RUN_TMR EQU     $003E    ;CONTANTLY DECR. TIMER.(1)
FEAT    EQU     $003F    ;FEATURE BYTE.(1)
V_CNTR  EQU     $0040    ;VOICE BUSY WATCH DOG.(1)
OFFTIME EQU     $0041    ;REPEATER OFF TIMER.(2)
STACK   EQU     $007F    ;STACK POINTER INITIAL VALUE.
*
* FLAG BYTE 0 EQUATES.
*
TXFLG   EQU    $80       ;TRANSMIT ON FLAG.
FSFLG   EQU    $40       ;FAILSAFE FLAG.
CHPFLG  EQU    $20       ;CHOPPER FLAG.
RMTFLG  EQU    $10       ;REMOTE TX FLAG.
IDFLG   EQU    $08       ;TIME TO ID FLAG.
MUTEFLG EQU    $04       ;MUTE FLAG.
S_PL    EQU    $02       ;SAY PL STATE.
SERFLG  EQU    $01       ;SERIAL REQUEST FLAG.
*
* FLAG BYTE 1 EQUATES.
*
DT_BUSY  EQU    $80      ;VOICE BUSY BIT.
POR_FLG  EQU    $40      ;POR FLAG.
APFLG    EQU    $20      ;AUTOPATCH FLAG.
AHFLG    EQU    $10      ;AUTO HANG-UP FLAG.
SAPFLG   EQU    $08      ;SEND AP OFF FLAG.
CNTFLG   EQU    $04      ;COUNT-DOWN FLAG.
SFBFLG   EQU    $02      ;SEND F BYTES FLAG.
RING_SP  EQU    $01      ;RING SUPPRESS FLAG.
*
* FLAG BYTE 2 EQUATES.
*
STFLG    EQU    $80      ;SAY TIMER STATE.
*SPARE   EQU    $40      ;
SRMTON   EQU    $20      ;SAY RMT RX IS ON.
SRMTOFF  EQU    $10      ;SAY RMT RX IS OFF.
STXON    EQU    $08      ;SAY RMT TX IS ON.
STXOFF   EQU    $04      ;SAY RMT TX IS OFF.
IDBIT2   EQU    $02      ;SELECT IDENT BIT 2.
IDBIT1   EQU    $01      ;SELECT IDENT BIT 1.
*
* FLAG BYTE 3 EQUATES.
*
RPTR_OFF EQU    $80      ;REPEATER OFF FOR 5 MINS.
*SPARE   EQU    $40      ;
*SPARE   EQU    $20      ;
*SPARE   EQU    $10      ;
*SPARE   EQU    $08      ;
*SPARE   EQU    $04      ;
*SPARE   EQU    $02      ;
*SPARE   EQU    $01      ;
*
* PIA AND OTHER EQUATES
*
IDAUDIO EQU    $80      ;I.D. AUDIO BIT IN DATA OUT 0 REG.
PTIME   EQU     240     ;240 SECONDS AFTER CHOP FORCE ALL TRANSISTORS OFF.
ONESEC  EQU    $07D0    ;ADJUST FOR 1 SECOND.
TDLY    EQU    $8000    ;1 SEC. COUNT DOWN VALUE.
PLCOR   EQU    $3000    ;PL OR COR GLITCH DELAY VALUE.
COR_BIT EQU    $10      ;PIA COR LINE.
MANXMIT EQU    $80      ;XBAND XMIT CONTROL.(INPUT PA7)
TXBIT   EQU    $10      ;TX BIT IN PIA OUTPUT REG.(T5)
PL_BIT  EQU    $20      ;USER PL BIT.
RNG_BIT EQU    $40      ;RING IN BIT.
DTMF    EQU    $80      ;MASK FOR DTMF IRQ.
INTR    EQU    $80      ;MASK FOR DIGITALKER IRQ.
DAT_I0  EQU    $A000    ;CONTROL LINES AND TOUCHTONES READ HERE.
PIA0CR  EQU    $A001    ;CONTROL REG ADDRESS FOR PIA0.
DAT_O0  EQU    $A002    ;OUTPUT TRANSISTORS AND AUDIO SENT HERE.
DAT_I1  EQU    $C000    ;DIGITALKER AND LCD STROBE.
PIA1CR  EQU    $C001    ;CONTROL REG ADDRESS FOR PIA1.
TALK    EQU    $C002    ;DIGITALKER DATA.
CS_BIT  EQU    $08      ;NOT CHIP SELECT BIT.
CMS     EQU    $04      ;CMD SELECT BIT. 0=RESET IRQ AND SRART WORD.1=RESET IRQ.
WR      EQU    $02      ;WRITE STROBE BIT.1=NOT STROBE.
ROM_HI  EQU    $01      ;DIGITALKER EPROM HI HALF SELECT BIT.
LCD_E   EQU    $40      ;LCD ENABLE BIT.
LCD_WR  EQU    $20      ;LCD R/W BIT.
LCD_RS  EQU    $10      ;LCD RS BIT.
PIAINP  EQU    $0017    ;CONFIG BYTES FOR PIA'S.(INPUT=00,ENABLE IRQ.)
PIAIN1  EQU    $FF17    ;CONFIG BYTES FOR PIA'S.(OUTPUT=FF,NO IRQ.)
PIAOUT  EQU    $FF16    ;CONFIG BYTES FOR PIA'S.(OUTPUT=FF,NO IRQ.)
ARPLMI  EQU     0030    ;AUTO LOCKUP,RESTORE PL,LCD,RPTR OFF VALUE.
LOW1    EQU    $A0      ;LOW TONE FREQ. VALUE.
HIGH1   EQU    $60      ;HIGH TONE FREQ. VALUE.
RMTONE  EQU    $0030    ;REMOTE RESPONSE TONE DURATION.(WAS 45H)
RNGTONE EQU    $0020    ;RING TONE DURATION.
RING1T  EQU    $00B0    ;RING TONE FREQ1.
RING2T  EQU    $00B8    ;RING TONE FREQ2.
HANGT   EQU      90     ;AUTO HANGUP TIMER INIT.
DTCTI   EQU    $0030    ;DIT COUNTER INIT VALUE.
SPCNTI  EQU    $0060    ;SPACE COUNTER INIT VALUE.(2*DIT COUNT)
DHCNTI  EQU    $0090    ;DAH COUNTER INIT VALUE.(3* DIT COUNT)
UTIMI   EQU    $50      ;500 USEC.  (83*6)
FREQI   EQU    $64      ;1 KHZ. APPROX.
EOT     EQU    $FF      ;END OF TRANSMISSION.
EOC     EQU    $80      ;END OF CHARACTER.
SPCE    EQU    $21      ;SPACE CODE.
M10I    EQU     0580    ;ID TIMER INIT VALUE (9 MIN. 40 SEC.)
M3I     EQU     180     ;3 MINUTE INIT VALUE.(CHANGE AS REQUIRED)  ****
KCHKI   EQU    $2000    ;KERCHUNK INIT VALUE.
DLYI    EQU    $6000    ;DROP DELAY INIT VALUE.(CHANGE AS REQUIRED)
V_CNTRI EQU     16      ;VOICE BUSY FAILSAFE COUNTER.
FLGS0I  EQU    $01      ;FLAG BYTE 0 INIT VALUE.
FLGS1I  EQU    $00      ;FLAG BYTE 1 INIT VALUE.
FLGS2I  EQU    $00      ;FLAG BYTE 2 INIT VALUE.
MUTM    EQU    $02      ;MUTE DELAY TIME.
FL1     EQU    $20      ;FUNCTION 1 LATCH (T6).
FL2     EQU    $40      ;FUNCTION 2 LATCH (T7)
FL3     EQU    $08      ;FUNCTION 3 LATCH (T4)
FL4     EQU    $04      ;FUNCTION 4 LATCH (T3)
FL5     EQU    $02      ;FUNCTION 5 LATCH (T2)
FL6     EQU    $01      ;FUNCTION 6 LATCH (T1)
CLK     EQU    $20      ;T6 (FL1) IS CLOCK.
NOCLK   EQU    $DF      ;
DATABIT EQU    $40      ;T7 (FL2) IS DATA BIT.
ID1ST   EQU    $0015    ;IDENT AFTER POR NO LESS THAN 15 SECONDS.
RMTDLYI EQU    $1000    ;REMOTE TX DROP DELAY INIT VALUE.
HS_DLY  EQU    $F424    ;HALF SECOND LOOP VALUE FOR 1 HERTZ TIMING RTN.
DEL1    EQU    $007D    ;APPROX. .1 SEC. DELAY VALUE USED IN DEL_1.
DEL5    EQU    $0368    ;APPROX. .5 SEC. DELAY VALUE USED IN DEL_5.
*
*
*       TITLE   'REPEATER SOFTWARE BY WB6JHQ'
*
RESTART SEI                    ;DISABLE INTERRUPTS.
        LDS           #STACK   ;LOAD STACK POINTER.
        LDX           #PIAINP  ;INPUTS AND IRQ ENABLED.
        STX            DAT_I0  ;INIT 1ST PIA PORT AS INPUTS WITH IRQ.
        LDX           #PIAOUT  ;OUTPUTS AND STROBE.
        STX            DAT_O0  ;INIT 2ND PIA PORT AS OUTPUTS & STRB.
        LDX           #PIAIN1  ;OUTPUTS AND STROBE & IRQ FROM DIGITALKER..
        STX            DAT_I1  ;INIT 3RD PIA PORT AS I/O & STRB.
        LDX           #PIAOUT  ;OUTPUTS AND STROBE.
        STX            TALK    ;INIT 4ND PIA PORT AS OUTPUTS & STRB.
        LDAA          #$00     ;CLEAR ALL OUTPUTS.
        STAA           DAT_O0
        STAA           TALK
        JSR            CLRMEM  ;CLEAR LOW MEMORY.
        LDAA          #FEATI
        STAA           FEAT
        JSR            RIPPLE
        JSR            INITIT  ;INITS LOW MENORY CONSTANTS.
        LDAA           FEAT    ;CHK FEATURE BYTE FOR LCD DISPLAY.
        ANDA          #L_INST
        BEQ            NO_LCD1
        LDAA          #POR_FLG
        ORAA           FLAGS1  ;
        STAA           FLAGS1  ;
        JSR            LCD_INI ;INITIALIZE THE DISPLAY.
        JSR            DELONE
        JSR            F_SCRN  ;WRITE SCREEN FULL.
        JSR            DELONE
        JSR            LCD_INI ;INITIALIZE THE DISPLAY.
        JSR            DELONE
        JSR            LEPROM  ;WRITE LCD DATA.
        JSR            DELONE  ;
        JSR            DELONE  ;
NO_LCD1 LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_TLK1
        LDAA           DAT_I0  ;
        ANDA          #$F0
        CMPA          #$70     ;IF RMT COS THEN SKIP LONG RESET SPEECH.
        BEQ            NO_TLK1
        JSR            TXON
        JSR            DEL_5
        JSR            SAY_POR ;SAY RESET COMPLETE.
        CLI                    ;ENABLE INTERRUPTS.
        JSR            TW1
*       JSR            SERDATA ;INIT. MIXERS.
NO_TLK1 LDS           #STACK   ;LOAD STACK POINTER.
        JSR            DEL_1   ;DELAY BEFORE TESTING INPUT LINES.
DTMF1   LDAA           DAT_I0  ;TEST FOR POR DTMF DISPLAY.
        ANDA          #$F0
        BEQ            DTMF2
DTMF1A  LDAA           DAT_I0  ;POR TEST IN LED DISPLAY. CPL LINE DOWN.
        CMPA          #$B0     ;RIPPLE FUNCTION BYTES THROUGH LEDS.
        BEQ            RIPLEDS ;USED FOR DIAGNOSTIC POR TEST.
        LDAA           DAT_I0  ;TEST FOR POR DTMF DISPLAY.
        ANDA          #$0F
        CMPA          #$01     ;IF TOUCHTONE 1 THEN GO TO DTMF DISPLAY.
        BEQ            DTMF2
        BRA            NORM1
DTMF2   LDAA           DAT_I0  ;SHOW INPUT LINES AND DTMF DATA IN LEDS.
        STAA           DAT_O0
        LDAA          #PTIME   ;PUT # IN COUNT DOWN TIMER.
        STAA           PMTO16  ;FOR PROCESS MONITOR TIMEOUT.
        BRA            DTMF2
RIPLEDS BSR            LEDSOUT ;CLEAR LEDS.
        JSR            DELONE
        LDAA           SEND_O  ;POINT TO RESPONSE CODE.
        JSR            CONVASC ;SEND RESPONSE.
        LDAA           SEND_K  ;POINT TO RESPONSE CODE.
        JSR            CONVASC ;SEND RESPONSE.
        JSR            DELONE
        LDAA           FCTB1   ;SHOW FUNCTION BYTE ONE.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        LDAA           FCTB2   ;SHOW FUNCTION BYTE TWO.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        LDAA           FCTB3   ;SHOW FUNCTION BYTE THREE.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        LDAA           FCTB4   ;SHOW FUNCTION BYTE FOUR.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        LDAA           FCTB5   ;SHOW FUNCTION BYTE FIVE.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        LDAA           FEAT    ;SHOW FEATURE BYTE.
        BSR            DISPLD  ;SHOW BYTE IN LEDS 1/2 BYTE AT A TIME.
        BRA            RIPLEDS ;LOOP THE DISPLAY.
DISPLD  PSHA
        PSHA
        LDAA           SEND_H  ;SEND MORSE "H".
        JSR            CONVASC ;SEND RESPONSE.
        PULA
        LSRA                   ;SHIFT "A" RIGHT 4 TIMES.
        LSRA                   ;
        LSRA                   ;
        LSRA                   ;
        ANDA          #$0F     ;
        STAA           DAT_O0  ;STORE A-REG INTO LEDS LOW BYTE.
        JSR            DEL2    ;DELAY 2 SECONDS.
        BSR            LEDSOUT ;CLEAR LEDS.
        LDAA           SEND_L  ;SEND MORSE "L".
        JSR            CONVASC ;SEND RESPONSE.
        PULA                   ;DO SAME TO LOW NIBBLE.
        ANDA          #$0F     ;
        STAA           DAT_O0  ;STORE A-REG INTO LEDS LOW BYTE.
        JSR            DEL2    ;DELAY 4 SECONDS.
        JSR            DEL2
*       JSR            DEL2
LEDSOUT CLRA                   ;CLEAR LEDS.
        STAA           DAT_O0
        RTS
NORM1   JSR            TXOFF   ;TURN OFF TRANSMITTER.
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_TLK2
        JSR            TW1
NO_TLK2 LDAA           FEAT    ;CHK FEATURE BYTE FOR LCD DISPLAY.
        ANDA          #L_INST
        BEQ            NO_LCD2
        JSR            LCD_INI ;INITIALIZE THE DISPLAY.
        JSR            DELONE
        LDAA           FCTB5
        ANDA          #D_FMT
        BEQ            NO_LCD2
        JSR            FMT_LCD
        JSR            DELONE
NO_LCD2 LDAA          #POR_FLG
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        LDAA          #AUD1    ;INIT MIXER 1.
        STAA           MIX1    ;
        LDAA          #AUD2    ;INIT MIXER 2.
        STAA           MIX2    ;
        JSR            SERDATA
        CLI
*
*       THIS IS THE CONTROL LOOP. CHECKING FUNCTION AND STATUS BITS.
*       PUT SCANNED FUNCTIONS IN HERE.
*
C_LOOP  LDAA           FEAT    ;COUNT DOWN TIME OUT RTN.
        ANDA          #V_INST  ;CHK FEATURE BYTE FOR DIGITALKER.
        BEQ            NPL     ;
        LDAA           FLAGS1  ;CHECK FOR COUNT-DOWN.
        ANDA          #CNTFLG  ;
        BEQ            NPL     ;
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            NPL     ;
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            NPL
        LDAA           MIN3
        CMPA          #$05
        BNE            NS5
        JSR            SAY_5
        BRA            NPL
NS5     CMPA          #$04
        BNE            NS4
        JSR            SAY_4
        BRA            NPL
NS4     CMPA          #$03
        BNE            NS3
        JSR            SAY_3
        BRA            NPL
NS3     CMPA          #$02
        BNE            NS2
        JSR            SAY_2
        BRA            NPL
NS2     CMPA          #$01
        BNE            NPL
        JSR            SAY_1
*
NPL     LDAA           DAT_I1   ;CLEAR IRQ FLAG IN PIA.. ****IF NO TALKER****
        LDAA           FCTB2   ;CHECK FOR NO CONTROL PL REQUIRED.
        ANDA          #NPLREQ  ;TO FUNCTION CONTROLLER.
        BNE            PMTO    ;IF BIT ON THEN NO PL REQUIRED.
        LDAA           DAT_I0  ;DIGIT COUNTER.
        ANDA          #PL_BIT  ;
        BEQ            PMTO    ;IF PL ACTIVE GO TO P.M.T.O.
FFDCTR  LDAA          #$FF     ;LOAD DCTR TO DUMP DECODER.
        STAA           DCTR    ;
PMTO    LDAA          #PTIME   ;PUT # IN COUNT DOWN TIMER.
        STAA           PMTO16  ;FOR PROCESS MONITOR TIMEOUT.
        LDAA           FCCTR   ;GET RESPONSE VALUE.
        BEQ            CHKSFB  ;GO ON IF ZERO.
        JSR            RESPOND ;GO SEND RESPONCE BEEPS.
*
CHKSFB  LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            CHKRFLG ;
        LDAA           FLAGS1  ;CHK FOR SAY F BYTES.
        ANDA          #SFBFLG  ;
        BEQ            CHKRFLG ;GO ON IF ZERO.
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            CHKRMT1 ;
        JSR            SAY_ALL ;
        BRA            CHKRFLG
CHKRMT1 JMP            CHKRMT
*
CHKRFLG LDAA           FLAGS2  ;CHECK FOR REMOTE VOICE RESPONSE FLAG.
        ANDA          #$3C     ;
        BEQ            SAPOFF1 ;
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            SAPOFF1 ;
        JSR            TXON    ;
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_T2   ;
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            NO_T2   ;
        LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #SRMTOFF ;
        BEQ            RMT1    ;
        LDX           #RMTISOF ;SAY "THE RMT IS OFF"
        STX            TALKX   ;
        JSR            TALKER  ;
RMT1    LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #SRMTON  ;
        BEQ            RMT2    ;
        LDX           #RMTISON ;SAY "THE RMT IS ON"
        STX            TALKX   ;
        JSR            TALKER  ;
RMT2    LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #STXOFF  ;
        BEQ            RMT3    ;
        LDX           #RMTXOFF ;SAY "THE RMT TX IS OFF"
        STX            TALKX   ;
        JSR            TALKER  ;
RMT3    LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #STXON   ;
        BEQ            CF1     ;
        LDX           #RMTXON  ;SAY "THE RMT TX IS ON"
        STX            TALKX   ;
        JSR            TALKER  ;
        BRA            CF1     ;
*
SAPOFF1 JMP            SAPOFF
*
NO_T2   LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #SRMTOFF ;
        BEQ            NO_T3   ;
        LDX           #REMOFF  ;SEND MORSE "RMT OFF"
        JSR            EPROM1  ;
NO_T3   LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #SRMTON  ;
        BEQ            NO_T8   ;
        LDX           #REMON   ;SEND MORSE "RMT ON"
        JSR            EPROM1  ;
NO_T8   LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #STXOFF
        BEQ            NO_T9
        LDX           #RTXOFF  ;SEND MORSE "RMT TX OFF"
        JSR            EPROM1
NO_T9   LDAA           FLAGS2  ;CHECK RESPONSE FLAG.
        ANDA          #STXON
        BEQ            CF1
        LDX           #RTXON   ;SEND MORSE "RMT TX ON"
        JSR            EPROM1
CF1     SEI
        LDAA          #$C3     ;TURN OFF FLAG.
        ANDA           FLAGS2
        STAA           FLAGS2
        CLI
        JSR            TXOFF01
*
SAPOFF  LDAA           FLAGS1  ;CHECK REQ. SEND AP OFF/CALL COMPLETE.
        ANDA          #SAPFLG  ;
        BEQ            CHKRMT  ;
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            CHKRMT  ;
        JSR            TXON    ;
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_T7   ;
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            CHKRMT  ;
        LDX           #AP_OFF  ;SAY "CALL COMPLETE".
        STX            TALKX   ;
        JSR            TALKER  ;
        BRA            CF2     ;
NO_T7   LDX           #APOFF   ;SEND MORSE "AP OFF "
        JSR            EPROM1  ;
CF2     SEI
        LDAA          #SAPFLG  ;TURN OFF FLAG.
        COMA                   ;
        ANDA           FLAGS1  ;
        STAA           FLAGS1  ;
        CLI
        JSR            TXOFF01 ;
*
CHKRMT  LDAA           FCTB1   ;CHECK IF REMOTE IS ON.
        ANDA          #RMT_ON  ;
        BEQ            WATCH   ;
        LDAA           DAT_O0  ;TURN ON REMOTE RECEIVE.
        ORAA          #FL6     ;
        STAA           DAT_O0  ;
        LDAA           DAT_I0  ;GET REMOTE COS SENSE.
        ANDA          #MANXMIT ;MASK OUT BITS.
        BNE            TFRPTR  ;
        LDAA          #TXBIT   ;TURN ON THE REPEATER TX WITHOUT FLAG.
        JSR            SETR1   ;DONT TURN ON REMOTE TX. JUST RPTR.
        LDX           #RMTDLYI ;SET RMT DLY INIT VALUE.
        STX            RMTDLY  ;
        JSR            CHKID   ;CHECK IF TIME TO IDENT.
        BRA            SENDROM ;
TFRPTR  LDAA           FLAGS0  ;CHK FOR MUTE FLAG FIRST AND THEN
        ANDA          #MUTEFLG ;
        BNE            SENDROM ;
        LDAA           FLAGS0  ;TURN OFF RPTR TX UNLESS MUTE OR TX
        ANDA          #TXFLG   ;FLAG IS ON.
        BNE            SENDROM ;
        LDX            RMTDLY  ;GET REMOTE DROP OUT DELAY VALUE.
        DEX                    ;
        STX            RMTDLY  ;
        LDX            RMTDLY  ;
        BNE            SENDROM ;IF NOT ZERO THEN SKIP IT.
        LDAA          #TXBIT   ;
        COMA                   ;
        JSR            RSTRG1  ;GO TURN OF RPTR BIT.
        BRA            SENDROM ;
*
CHKSST1 JMP            CHKSST  ;
*
WATCH   LDAA           FCTB4   ;CHK FOR REMOTE WATCH-DOG ON.
        ANDA          #WATCHD  ;
        BEQ            SENDROM ;IF OFF DONT CHK FOR REMOTE TX ON.
        LDAA           DAT_O0  ;GET STATE OF OUTPUT LATCHES.
        ANDA          #$03     ;CHK FOR REMOTE OR RMT TX ON.
        BEQ            SENDROM ;IF NOT THEN GO ON.
        LDAA           DAT_O0  ;IF ON THEN CLEAR IT.
        ANDA          #$FC    ;
        STAA           DAT_O0  ;
*
SENDROM LDAA           FCTB3   ;CHECK IF SEND EPROM IS ON.
        ANDA          #SNDROM
        BEQ            APATCH1 ;
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            APATCH1 ;
        JSR            TXON    ;
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_T4   ;
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            APATCH1 ;
        LDX           #S_LEVEL ;SAY EPROM LEVEL.
        STX            TALKX   ;
        JSR            TALKER  ;
        BRA            CF3     ;
NO_T4   JSR            EPROM   ;
CF3     JSR            TXOFF   ;
        LDAA           FCTB3   ;CLEAR SEND EPROM DATE BIT.
        ANDA          #$BF    ;
        STAA           FCTB3   ;
*
APATCH1 LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            CHKSST1
        LDAA           FCTB4   ;CHECK IF AUTOPATCH IS ENABLED.
        ANDA          #AUTOP
        BEQ            APATCH3
        LDAA           FCTB4   ;CHECK FOR REVERSE PATCH ENABLED.
        ANDA          #RPATCH
        BEQ            APATCH2
        LDAA           FLAGS1  ;CHK RING SUPPRESS.
        ANDA          #RING_SP
        BEQ            NRSP
        LDAA           RUN_TMR ;DECR. IN TIMERTN.
        BNE            NRSP    ;IF EQUAL ZERO THEN
        SEI                    ;TURN OFF RING SUPPRESS.
        LDAA          #RING_SP
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        CLI
NRSP    LDAA           FCTB4   ;ANSWER THE PHONE?
        ANDA          #OFFHOOK ;
        BNE            APATCH2 ;
        LDAA           DAT_I0  ;CHECK IF RING IS ACTIVE.
        ANDA          #RNG_BIT ;IS PHONE RINGING?
        BNE            APATCH2
        LDAA           FLAGS1
        ANDA          #RING_SP
        BNE            APATCH2
        JSR            TXON
        JSR            RINGER
        JSR            RINGER
        JSR            RINGER
*
APATCH2 LDAA           FLAGS1  ;CHK IF ALREADY OFF-HOOK.
        ANDA          #APFLG   ;
        BNE            APATCH4 ;TURN ON TX AGAIN.
        LDAA           FCTB4   ;ANSWER THE PHONE?
        ANDA          #OFFHOOK ;
        BEQ            APATCH3 ;
        SEI
        LDAA           FLAGS1  ;SET AUTO HANG-UP & AP FLAG.
        ORAA          #APFLG   ;
        ORAA          #AHFLG   ;
        STAA           FLAGS1  ;
        CLI
        LDAA          #HANGT   ;
        STAA           APTIMER ;
        LDAA          #FL4     ;SET OFF-HOOK.
        JSR            SETR1   ;
        SEI
        LDAA          #RING_SP
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        CLI
*
APATCH4 JSR            TXON
*
APATCH3 LDAA           FCTB4   ;CHK IF STILL OFF-HOOK.
        ANDA          #OFFHOOK ;IF NOT CLEAR THE FLAGS
        BNE            CHKSST  ;AND HANG-UP THE PHONE.
        LDAA           FLAGS1  ;CHK IF ALREADY OFF-HOOK.
        ANDA          #APFLG   ;
        BEQ            CHKSST  ;
        BSR            PATOFF  ;
        BRA            CHKSST  ;
PATOFF  LDAA          #FL4     ;RESET OFF-HOOK.
        COMA                   ;
        JSR            RSTRG1  ;
        LDAA          #FL3     ;TURN ON T4 TO FORCE
        JSR            SETR1   ;THE DROP OF THE LINE RELAY.
*        LDAA          #OFFHOOK ;RESET OFFHOOK FUNCTION.
*        COMA
*        ANDA           FCTB4
*        STAA           FCTB4
        JSR            DELONE
        JSR            DELONE
        LDAA          #FL3     ;AFTER DELAY TIME TURN OF T4 TO
        COMA                   ;ALLOW REVERSE PATCH.
        JSR            RSTRG1
        SEI
        LDAA          #APFLG   ;RESET AUTO HANG-UP & AP FLAG.
        ORAA          #AHFLG
        COMA
        ANDA           FLAGS1
        ORAA          #SAPFLG  ;SET SEND APOFF FLAG.
        STAA           FLAGS1  ;
        LDAA           SAVEF1  ;RESTORE SAVED FCTB1.
        STAA           FCTB1
        LDAA           SAVEF2  ;RESTORE SAVED FCTB2.
        STAA           FCTB2
        LDAA           SAVEF3  ;RESTORE SAVED FCTB3.
        STAA           FCTB3
        LDAA           SAVEF4  ;RESTORE SAVED FCTB4.
        STAA           FCTB4
        LDAA           SAVEF5  ;RESTORE SAVED FCTB5.
        STAA           FCTB5
        CLI
        RTS
*
CHKSST  LDAA           FLAGS2  ;CHK SAY STATUS REQUEST FLG.
        ANDA          #STFLG
        BEQ            CHKPLS
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            CHKPLS
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG
        BNE            CHKPLS
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            CHKPLS
        LDAA           FCTB1
        ANDA          #CHPON
        BEQ            SCHPF
        LDX           #V_TIMEN ;SAY "THE TIMER IS ON"
        STX            TALKX
        JSR            TALKER
        BRA            CLRSTF
SCHPF   LDX           #V_TIMEF ;SAY "THE TIMER IS OFF"
        STX            TALKX   ;
        JSR            TALKER  ;
CLRSTF  SEI
        LDAA           FLAGS2  ;CLEAR FLAG.
        ANDA          #$7F
        STAA           FLAGS2
        CLI
*
CHKPLS  LDAA           FLAGS0  ;CHK PL STATE.
        ANDA          #S_PL
        BEQ            CHKSER
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            CHKSER
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG
        BNE            CHKSER
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            CHKSER
        LDAA           FCTB1
        ANDA          #PLON
        BEQ            SPLOFF
        LDX           #PLISON  ;SAY "THE PL IS ON"
        STX            TALKX
        JSR            TALKER
        BRA            CLRPLS
SPLOFF  LDX           #PLISOFF ;SAY "THE PL IS OFF"
        STX            TALKX   ;
        JSR            TALKER  ;
CLRPLS  SEI
        LDAA           FLAGS0  ;CLEAR FLAG.
        ANDA          #$FD
        STAA           FLAGS0
        CLI
*
CHKSER  LDAA           FLAGS0  ;CHK SERIAL INTERFACE REQUEST FLG.
        ANDA          #SERFLG  ;
        BEQ            P_OUT
        JSR            SERDATA ;
        SEI
        LDAA           FLAGS0  ;
        ANDA          #$FE    ;
        STAA           FLAGS0  ;
        CLI
*
P_OUT   LDAA           FCTB6
        ANDA          #$FF
        BEQ            TTG
        JSR            SETR1
        JSR            DEL_1
        LDAA           FCTB6
        COMA
        JSR            RSTRG1
        CLR            FCTB6
*
TTG     LDAA           FCTB5   ;CHK DIAGNOSTIC MODE.
        ANDA          #DIAG    ;
        BEQ            ID_IT   ;
TTG3    LDAA           FCTB5    ;CHK FOR TONE GEN. FUNCTION.
        ANDA          #TSTONE   ;
        BEQ            ID_IT    ;
TTGL    JSR            TXON     ;
        LDX           #$1000    ;INIT TONE DURATION.
        JSR            SAVER    ;SEND TONE.
        BRA            TTG3     ;
*
ID_IT   LDAA           FCTB3   ;CHK IF FORCE ID BIT IS ON.
        ANDA          #ID_BIT  ;
        BEQ            RPTON   ;
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            RPTON   ;
        JSR            IDENT   ;
        LDAA          #ID_BIT  ;RESET FORCE IDENT BIT.
        COMA                   ;
        ANDA           FCTB3   ;
        STAA           FCTB3   ;
*
RPTON   LDAA           FCTB1   ;CHECK IF REPEATER IS FUNCTIONED ON.
        ANDA          #RPT_ON  ;
        BNE            TSTCHP  ;IF ON THEN GO ON; IF NOT THEN LOOP.
        LDAA           FCTB1   ;CHK IF RMT ON.
        ANDA          #RMT_ON
        BNE            TSTCHP
        JSR            TXOFF   ;
        JMP            C_LOOP  ;
*
TSTCHP  LDAA           FCTB1   ;SEE IF CHOP FUNCTION ON.
        ANDA          #CHPON   ;
        BEQ            PLMODE  ;
        LDAA           FLAGS0  ;SEE IF CHOP TIME.
        ANDA          #CHPFLG  ;
        BEQ            PLMODE  ;
        JMP            WARN1   ;IF ON WARN BEEP/TALK AND TXOFF.
*
PLMODE  LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #PLON    ;MASK PL MODE BIT.
        BEQ            COR     ;IF NOT ON THEN GO COR MODE.
        LDAA           DAT_I0  ;GET PL SENSE*...GND=ACTIVE.
        ANDA          #PL_BIT  ;
        BNE            DRPIT   ;IF PL MODE THEN NO K FILTER.
        JMP            KCHUNK  ; <<<<<<<*******WAS KDONE***************
DRPIT   LDAA           FCTB1   ;GET FUNCTION BYTE ONE.              ***
        ANDA          #PLON    ;MASK PL MODE BIT.                     *
        BEQ            DRPIT1  ;IF NOT ON THEN DONT CLEAR MIX CH1.    *
        LDAA           FCTB5   ;CHK FOR RPT AUDIO WITH PL ONLY        *
        ANDA          #AUD_PL                                         *
        BEQ            DRPIT1                                         *
        LDAA           FCTB4   ;IS PATCH OFF-HOOK.
        ANDA          #OFFHOOK
        BNE            DRPIT1
        JSR            RSTMIX1                                      ***
DRPIT1  BRA            DROPDLY
COR     LDAA           DAT_I0  ;GET COR SENSE*...GND=ACTIVE.
        ANDA          #COR_BIT ;
        BEQ            KCHUNK  ;
DROPDLY LDAA           FLAGS0  ;TEST FOR TX FLAG.
        ANDA          #TXFLG   ;
        BEQ            NTXFLG  ;IF OFF THEN DONT DO AGAIN.
RMT01   LDAA           FCTB1   ;CHK FOR REMOTE ON.
        ANDA          #RMT_ON  ;
        BEQ            CHKMODE ;
        LDAA          #FL5     ;RESET REMOTE TX QUICKLY.
        COMA                   ;
        JSR            RSTRG1  ;
        LDAA           FCTB2   ;CHK FOR REMOTE TELEMETRY ON.
        ANDA          #RTON    ;
        BEQ            CHKMODE ;
        JSR            DELONE  ;
        JSR            LONOTE  ;SEND LOW TONE IF RMT ON.
        LDAA           FLAGS0  ;CHK FOR REMOTE TX ENABLED.
        ANDA          #RMTFLG  ;
        BEQ            CHKMODE ;
        JSR            DEL_1   ;
        JSR            HINOTE  ;SEND HIGH TONE IF RMT TX ON.
        LDAA           M3INT   ;INITIALIZE 3 MIN. TIMER.
        STAA           MIN3    ;
*                              ***************************************
CHKMODE LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            CHKM1
        LDAA           FCTB4   ;CHECK IF AUTOPATCH IS ENABLED.
        ANDA          #AUTOP
        BEQ            CHKM1
        LDAA           FCTB4   ;IS PATCH OFF-HOOK.
        ANDA          #OFFHOOK
        BEQ            CHKM1
        JMP            C_LOOP
CHKM1   LDAA           FCTB2   ;CHECK MODE.
        ANDA          #RSTCOR  ;RESET ON COR OR TX DROP?
        BEQ            TXDROP
        JMP            TAIL    ;DELAY 1 SEC.,BEEP,DELAY 2 SEC.
TXDROP  LDAA           FCTB1   ;CHECK FOR DROP DELAY ON/OFF.
        ANDA          #DROPON
        BEQ            NODLY
        LDX            DINT
        JSR            TLDLA
NODLY   BSR            TXOFF   ;GO TURN OFF TX.
        LDAA           M3INT   ;INITIALIZE 3 MIN. TIMER.
        STAA           MIN3
NTXFLG  LDAA           FCTB1   ;CHK FOR REMOTE ON.
        ANDA          #RMT_ON
        BEQ            NRST    ;IF NOT ON RST FL5.
        LDAA          #FL5     ;RESET REMOTE TX QUICKLY.
        COMA
        JSR            RSTRG1
NRST    JMP            C_LOOP
*                              ;END OF NORMAL C_LOOP.
KCHUNK  LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #KFLTON  ;MASK FOR KERCHUNK ON.
        BEQ            KDONE   ;IF OFF THEN SKIP IT.
        LDAA           FLAGS0  ;IF TX ALREADY ON THEN SKIP IT.
        ANDA          #TXFLG
        BNE            KDONE
        LDX            KINT    ;GET INITIAL KERCHUNK VALUE.
KLOOP   DEX                    ;SUBTRACT 1 FROM IT.
        BEQ            KDONE   ;IF ZERO THEN GO ON.
        LDAA           DAT_I0  ;GET COR STATUS.
        ANDA          #COR_BIT
        BEQ            KLOOP   ;IF COR STILL ON DECREMENT KERCHUNK.
        JMP            C_LOOP
*
KDONE   BSR            TXON    ;TURN ON TRANSMITTER.
        JSR            CHKID   ;CHECK IF TIME TO IDENTIFY.
        LDAA           DAT_I0  ;GET COR SENSE*...GND=ACTIVE.
        ANDA          #COR_BIT ;IF COR SENSED THEN RESTORE COUNT.
        BNE            NOPL    ;THIS KEEPS TIMER FROM TIMING OUT.
        LDX           #ARPLMI  ;SET AUTO RESTORE PL MODE VALUE.
        STX            ARPLMS
        LDAA          #HANGT   ;INIT THE AUTO HANGUP TIMER.
        STAA           APTIMER
NOPL    JMP            C_LOOP
*
TXOFF   LDAA           FCTB1   ;IF REMOTE IS ON CHK COR
        ANDA          #RMT_ON  ;FROM REMOTE RECEIVER.
        BEQ            TXOFF01
        LDAA           DAT_I0  ;GET MANUAL CONTROLS.
        ANDA          #MANXMIT ;MASK OUT BITS.
        BNE            TXOFF01 ;DONT TURN OFF RPTR TX BECAUSE REMOTE COR IS ON.
        SEI
        LDAA           FLAGS0  ;RESET TX FLAG AND CHOP FLAG.
        ANDA          #$5F
        STAA           FLAGS0
        CLI
        RTS
*
TXOFF01 LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_P1
        LDAA           FLAGS1  ;IF TALKING THEN DONT TURN OFF TX.
        ANDA          #DT_BUSY
        BNE            BUSY_DT
NO_P1   LDAA           FLAGS0
        ANDA          #TXFLG
        BEQ            NO_P
        LDAA           FCTB2   ;GET POWER FAIL BIT.
        ANDA          #PWRFL   ;IS IT ON?
        BEQ            NO_P
        JSR            SENDP
NO_P    LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            NO_P2
        LDAA           FCTB4   ;CHK IF PHONE IS OFF-HOOK.
        ANDA          #OFFHOOK
        BNE            BUSY_DT
NO_P2   LDAA           DAT_O0  ;TURN OFF XMIT.
        ANDA          #$EF
        STAA           DAT_O0
        SEI
        LDAA           FLAGS0  ;RESET TX FLAG AND CHOP FLAG.
        ANDA          #$5F
        STAA           FLAGS0
        CLI
BUSY_DT RTS
*
TXON    LDAB           FLAGS0  ;CHK IF RMT TX ENABLED.
        ANDB          #RMTFLG
        BEQ            TXON01  ;IF NOT LEAVE ALONE.
        LDAA           FCTB1   ;CHK IF RMT ON.
        ANDA          #RMT_ON
        BEQ            TXON01
        LDAA           FLAGS0  ;CHECK FOR MUTE FLAG ON.
        ANDA          #MUTEFLG
        BNE            TXON01
        LDAA          #FL5     ;TURN ON REMOTE TX.
        JSR            SETR1
TXON01  LDAA           FCTB2   ;CHECK FOR MUTE ON.
        ANDA          #MUTEON
        BEQ            TXON02
        LDAA           FLAGS0  ;CHECK FOR MUTE FLAG ON.
        ANDA          #MUTEFLG
        BNE            NO_P
TXON02  LDAA           FCTB5   ;CHK FOR RPT AUD WITH PL.
        ANDA          #AUD_PL
        BEQ            NO_APL1
        LDAA           FLAGS1
        ANDA          #POR_FLG
        BNE            NO_APL1
        JSR            SETMIX1
NO_APL1 NOP
        LDAA           FCTB1   ;CHK RPTR ON.
        ANDA          #RPT_ON
        BEQ            FLGON
TXON03  LDAA           DAT_O0  ;GET OUTPUT REG.
        ORAA          #TXBIT   ;SET TX BIT.
        STAA           DAT_O0
        SEI
        LDAA           FLAGS0
        ORAA          #TXFLG   ;SET TX FLAG BIT.
        STAA           FLAGS0
        CLI
FLGON   LDX           #RMTDLYI ;SET RMT DLY INIT VALUE.
        STX            RMTDLY
        RTS
*
CHKID   LDAA           FLAGS0  ;CHECK FOR I.D. TIME.
        ANDA          #IDFLG
        BEQ            NOTNOW
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG
        BNE            NOTNOW
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            NOTNOW
        JSR            IDENT
NOTNOW  RTS
*
TAIL    LDX           #PLCOR   ;PL OR COR GLITCH DELAY VALUE.
        BSR            TLDLA   ;REMOVE GLITCHES.
        LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            NPE1
        LDAA           FCTB4   ;CHECK FOR REVERSE PATCH ENABLED.
        ANDA          #RPATCH
        BEQ            NPE1
        LDAA           DAT_I0  ;CHECK IF RING IS ACTIVE.
        ANDA          #RNG_BIT ;IS PHONE RINGING?
        BEQ            NPE2
NPE1    LDX           #TDLY
        BSR            TLDLA
*
CHKBEP  LDAA           FCTB3   ;IS RESET BEEP ENABLED?
        ANDA          #BEP_ON
        BEQ            NOBEP
        JSR            BEP     ;IF TIMED OUT SEND RESET TONE.
NOBEP   LDAA           M3INT   ;GET CHOPPER INIT VALUE.
        STAA           MIN3
        SEI
        LDAA          #CHPFLG
        COMA
        ANDA           FLAGS0  ;MASK OUT CHOP FLAG.
        STAA           FLAGS0  ;PUT IT BACK.
        CLI
        LDX            DINT
        BSR            TLDLAY
        LDX            DINT
        BSR            TLDLAY
        LDX            DINT
        BSR            TLDLAY
        LDX            DINT
        BSR            TLDLAY
NPE2    LDS           #STACK   ;INIT STACK.
        JMP            NODLY   ;EXIT AND TURN OFF XMIT.
*
TLDLA   LDAA           FCTB1   ;THIS RTN RESTORES STACK BUT DOESNT
        ANDA          #PLON    ;RESET CHOPPER.
        BEQ            DO_COR
        LDAA           DAT_I0  ;GET PL SENSE. (GND ACTIVE)
        ANDA          #PL_BIT
        BEQ            TLGATE
        BRA            MNS1
DO_COR  LDAB           DAT_I0  ;GET COR SENSE. (GND ACTIVE)
        ANDB          #COR_BIT
        BEQ            TLGATE
MNS1    DEX
        BNE            TLDLA
        RTS
*
TLDLAY  LDAA           FCTB1   ;THIS RTN RESETS CHOPPER VALUE AND
        ANDA          #PLON    ;RESETS STACK.
        BEQ            TLD
        LDAA           DAT_I0  ;GET PL SENSE. (GND ACTIVE)
        ANDA          #PL_BIT
        BEQ            RECON
        BRA            MNUS1
TLD     LDAB           DAT_I0  ;GET COR SENSE. (GND ACTIVE)
        ANDB          #COR_BIT
        BEQ            RECON
MNUS1   DEX
        BNE            TLDLAY
        RTS
RECON   LDS           #STACK   ;INIT STACK.
        LDAA           M3INT   ;INIT CHOPPER.
        STAA           MIN3
        JMP            C_LOOP
*
TLGATE  LDS           #STACK   ;INIT STACK.
        JMP            C_LOOP  ;DONT INIT CHOPPER.
*
WARN1   LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            WARN3
        JSR            RSTMIX1
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            WARN1
        LDX           #V_TOUT  ;SAY "TIME OUT".
        STX            TALKX   ;
        JSR            TALKER  ;
        JSR            TW1
        BRA            HOLD1   ;
WARN3   JSR            BEEP3   ;GO HERE ON CHOP.
HOLD1   LDX           #$4000   ;GLITCH REMOVE VALUE.
HOLD2   JSR            TXOFF   ;
        LDAA          #FL5     ;RESET REMOTE TX QUICKLY.
        COMA                   ;
        JSR            RSTRG1  ;
        LDAA           FCTB1   ;
        ANDA          #RPT_ON  ;IF REPEATER OFF NOW THEN EXIT.
        BEQ            GETOUT  ;
        LDAA           FCTB1   ;CHECK PL OR COR MODE.
        ANDA          #PLON    ;
        BEQ            CCC     ;
        LDAA           DAT_I0  ;GET PL SENSE. (GND ACTIVE)
        ANDA          #PL_BIT  ;
        BEQ            HOLD1   ;
        BRA            GTOUT   ;
CCC     LDAA           DAT_I0  ;
        ANDA          #COR_BIT ;
        BEQ            HOLD1   ;COR IS GND ACTIVE.SO LOOK FOR
GTOUT   DEX                    ;PLUS TO GET OUT OF HOLDOFF LOOP.
        BNE            HOLD2   ;
GETOUT  LDS           #STACK   ;INIT STACK.
        LDAA           M3INT   ;GET CHOPPER INIT VALUE.
        STAA           MIN3    ;
        SEI
        LDAA           FLAGS0  ;GET FLAGS.
        ANDA          #$DF    ;MASK OUT CHOP FLAG.
        ORAA          #IDFLG   ;
        STAA           FLAGS0  ;PUT IT BACK.
        CLI
WFBUSY  LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NOT_T   ;
        JSR            M_WAIT
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            WFBUSY
        LDX           #V_RESET ;SAY "RESET".
        STX            TALKX
        JSR            TALKER
        JSR            TW1
        LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #PLON    ;MASK PL MODE BIT.
        BEQ            PLNOT   ;IF NOT ON THEN GO COR MODE.
        JSR            M_WAIT
        LDX           #PLISON  ;SAY "PL IS ON".
        STX            TALKX   ;
        JSR            TALKER  ;
        JSR            TW1
        JMP            C_LOOP  ;GO TO COMMAND LOOP.
PLNOT   JSR            M_WAIT
        LDX           #PLISOFF ;SAY "PL IS OFF".
        STX            TALKX   ;
        JSR            TALKER  ;
        JSR            TW1
NOT_T   JSR            TXON
        JSR            IDENT   ;
        JMP            C_LOOP  ;GO TO COMMAND LOOP.
*
M_WAIT  LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG ;
        BNE            M_WAIT  ;
        RTS
*
RIPPLE  LDAA            FEAT
        ANDA           #$10
        BEQ             RIP2
        LDAA          #$00     ;CLEAR SERIAL PORT.
        STAA           MIX1    ;
        STAA           MIX2    ;
        BSR            SERDATA ;
        JSR            DEL_1   ;
        LDAA          #$01     ;LOAD 1 INTO A.
RIP1    STAA           MIX1    ;
        STAA           MIX2    ;
        BSR            SERDATA ;SEND IT.
        JSR            DEL_1   ;WAIT.
        LDAA           MIX1    ;
        BEQ            RIP2    ;
        ASLA                   ;SHIFT LEFT.
        BCC            RIP1    ;REPEAT ALL BITS.
RIP2    LDAA          #$00     ;CLEAR SERIAL PORT.
        STAA           MIX1    ;
        STAA           MIX2    ;
        BSR            SERDATA ;
        RTS                    ;
*
DUMPL   BSR             DMPITL  ;
        JMP             RESTORE ;
*
DUMPH   BSR             DMPITH  ;
        JMP             RESTORE ;
*
DMPITL  JSR             LCD_INI ;
        LDX            #$0000   ;
DUMP1   LDAA            0,X     ;
        INX                     ;
        BSR             HEXASC2 ;
        CPX            #$0027   ;
        BNE             DUMP1   ;
        RTS                     ;
*
DMPITH  JSR             LCD_INI ;
        LDX            #$0027   ;
DUMP2   LDAA            0,X     ;
        INX                     ;
        BSR             HEXASC2 ;
        CPX            #$004E   ;
        BNE             DUMP2   ;
        RTS                     ;
*
HEXASC1 LSRA                    ;SHIFT RIGHT 4 TIMES.
        LSRA                    ;
        LSRA                    ;
        LSRA                    ;
        BSR             OUTHR   ;
        RTS
HEXASC2 PSHA                    ;SAVE A-REG.
        LSRA                    ;SHIFT RIGHT 4 TIMES.
        LSRA                    ;
        LSRA                    ;
        LSRA                    ;
        BSR             OUTHR   ;
        PULA                    ;
OUTHR   ANDA           #$0F     ;
        ADDA           #$30     ;
        CMPA           #$39     ;
        BLS             HXDONE  ;
        ADDA           #07H     ;
HXDONE  JSR             LCD_DAT ;
        RTS                     ;
*
SERDATA LDAA            FEAT
        ANDA           #MIXINST
        BEQ             NO_SER
        LDAA            MIX2    ;AUDIO MIXER 2 BYTE.
        BSR             SEROUT  ;
        LDAA            MIX1    ;AUDIO MIXER 1 BYTE.
        BSR             SEROUT  ;
        LDAA            DAT_O0  ;RESET DATA BIT.
        ORAA           #DATABIT ;
        STAA            DAT_O0  ;
NO_SER  RTS                     ;
*
SEROUT  LDAB           #$09     ;SET BIT COUNTER.
L1      DECB                    ;
        BEQ             L2      ;IF DONE EXIT.
        PSHB                    ;SAVE B.
        CLC                     ;CLEAR CARRY BIT.
        RORA                    ;SET CARRY BIT IF A 1.
        PSHA                    ;SAVE ROTATED BYTE.
        BCC             NOBIT   ;BRANCH IF CARRY IS CLEAR.
        LDAA            DAT_O0  ;
        ANDA           #$BF    ;
        STAA            DAT_O0  ;SET DATA BIT.
        BSR             CLKIT   ;GO SET/RESET CLOCK BIT.
        PULA                    ;RESTORE A.
        PULB                    ;RESTORE B.
        BRA             L1      ;
*
NOBIT   LDAA            DAT_O0  ;RESET DATA BIT.
        ORAA           #DATABIT ;
        STAA            DAT_O0  ;
        BSR             CLKIT   ;GO SET/RESET CLOCK BIT.
        PULA                    ;RESTORE A.
        PULB                    ;
        BRA             L1      ;
*
CLKIT   LDAB           #$06     ;DELAY
CLKIT1  DECB                    ;
        BNE             CLKIT1  ;
        LDAA            DAT_O0  ;
        ANDA           #NOCLK   ;
        STAA            DAT_O0  ;
        ORAA           #CLK     ;
        STAA            DAT_O0  ;
L2      NOP                     ;
        NOP                     ;
        NOP                     ;
        NOP                     ;
        NOP                     ;
        NOP                     ;
        RTS                     ;
*                               ;
SENDP   LDX           #PCODE    ;
        JSR            SCODE    ;
        RTS                     ;
*                               ;
BEP     LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_T5   ;
        LDAA          #DT_BUSY  ;IF TALKER ON THEN WAIT.
        ANDA           FLAGS1   ;
        BNE            BEP      ;
NO_T5   LDAA           FCTB1    ;CHECK FOR CONTROLLER LOCKED.
        ANDA          #CTRLK    ;
        BEQ            ALTBEEP  ;
        LDAA           CURTSY  ;COURTESY RESPONSE CHAR.
        JSR            CONVASC ;SEND IT.
        RTS                    ;
ALTBEEP JSR            HINOTE  ;
        JSR            LONOTE  ;
        RTS                    ;
*                              ;
RINGER  LDAA           FREQ    ;SAVE TONE FREQ.
        PSHA                   ;
        LDAA          #RING1T  ;SET FOR LOW TONE. (FREQ.)
        STAA           FREQ    ;
        LDX           #RNGTONE ;SET FOR DURATION. (LENGTH)
        STX            TONECT  ;
        JSR            SAVER   ;DO IT.
        LDAA          #RING2T  ;SET FOR HIGH TONE. (FREQ.)
        STAA           FREQ    ;
        LDX           #RNGTONE ;SET FOR DURATION. (LENGTH)
        STX            TONECT  ;
        JSR            SAVER   ;DO IT.
        PULA                   ;RESTORE UTIME.
        STAA           FREQ    ;
        LDAA          #$03     ;
        STAA           RUN_TMR ;
        SEI
        LDAA          #RING_SP ;STOP RING FOR 3 SECONDS.
        ORAA           FLAGS1  ;
        STAA           FLAGS1  ;
        CLI
        RTS                    ;
*
LONOTE  LDAA           FREQ    ;SAVE TONE FREQ.
        PSHA                   ;
        LDAA          #LOW1    ;SET FOR LOW TONE. (FREQ.)
        STAA           FREQ    ;
        LDX           #RMTONE  ;SET FOR DURATION. (LENGTH)
        STX            TONECT  ;
        JSR            SAVER   ;DO IT.
        PULA                   ;RESTORE UTIME.
        STAA           FREQ    ;
        RTS                    ;
*
HINOTE  LDAA           FREQ    ;SAVE TONE FREQ.
        PSHA                   ;
        LDAA          #HIGH1   ;SET FOR HI TONE. (FREQ.)
        STAA           FREQ    ;
        LDX           #RMTONE  ;SET FOR DURATION.(LENGTH)
        STX            TONECT  ;
        JSR            SAVER   ;DO IT.
        PULA                   ;RESTORE UTIME.
        STAA           FREQ    ;
        RTS
*
*       INTERUPT ROUTINE FOR TOUCH TONE SERVICE BEGINS HERE. (MI)
*

IRQ     LDAA           FEAT     ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            IRQ2     ;
        LDAA           PIA1CR   ;CHK FOR TALK IRQ.
        ANDA          #INTR     ;
        BEQ            IRQ2     ;
        LDAA           DAT_I1   ;CLEAR IRQ FLAG IN PIA..
        JSR            TALKER2  ;
        RTI                     ;
*
IRQ2    LDX           #ARPLMI  ;SET AUTO RESTORE PL MODE VALUE.
        STX            ARPLMS  ;
        LDAA           DAT_I1   ;CLEAR IRQ FLAG IN PIA..*****IF NO TALKER*****
*       LDAB           FCTB2    ;LOOK FOR MUTE ON.
*       ANDB          #MUTEON   ;
*       BEQ            IRQA     ;
        LDAA           DAT_I0   ;GET T.T. DATA AND CLEAR IRQ FLAG IN PIA.
        ANDA          #$0F      ;
        CMPA          #PREFIX   ;
        BEQ            RSTR     ;TURN TX OFF & SET MUTE FLAG.
        LDAB           FLAGS0   ;SET MUTE FLAG.
        ANDB          #MUTEFLG  ;
        BEQ            IRQA    ;
        LDAB          #MUTM    ;INIT MUTE COUNTER.
        STAB           MUTECNT ;
IRQA    LDAA           DAT_I0  ;GET T.T. DATA.
        ANDA          #$0F     ;
        CMPA          #PREFIX  ;
        BEQ            RSTR1   ;
        LDAB           DCTR    ;GET BYTE POINTER.
        BNE            CK1     ;IF = ZERO THEN FALL THROUGH.
IRQ1    ASLA                   ;SHIFT DATA LEFT 4 TIMES. ENTER HERE
        ASLA                   ;ALSO IF 4TH DIGIT OF SEQ. AND NOT "PREFIX".
        ASLA                   ;"FUNCTION CHAINING"
        ASLA                   ;
        STAA           IN1     ;PUT AWAY IN INPUT AREA ONE.
        INC            DCTR    ;INCREMENT DIGIT COUNTER.
        RTI                    ;
CK1     CMPB          #$01     ;IS THIS 2ND DIGIT?
        BNE            CK2     ;
        ORAA           IN1     ;OR 1ST DIGIT WITH 2ND.
        STAA           IN1     ;PUT IT BACK.
        INC            DCTR    ;
        RTI                    ;
CK2     CMPB          #$02     ;IS IT 3RD DIGIT?
        BNE            CK3     ;
        ASLA                   ;
        ASLA                   ;
        ASLA                   ;
        ASLA                   ;
        STAA           IN2     ;
        INC            DCTR    ;INCREMENT DIGIT COUNTER.
        RTI                    ;
CK3     CMPB          #$03     ;IS IT 4TH DIGIT?
        BNE            INTRUDE ;IF NOT THE SET DGT TO FFH.
        ORAA           IN2     ;OR 2ND DIGIT WITH 3RD.
        STAA           IN2     ;PUT IT BACK.
        INC            DCTR    ;
        BRA            SEARCH  ;
*                              ;
RSTR    JMP            RESTORE ;
RSTR1   JMP            RSTORE1 ;
*                              ;
SEARCH  LDAA           FCTB4   ;
        ANDA          #DBLLK   ;
        BEQ            SECCK   ;
        LDX           #PRIM    ;
        BRA            SRCH1   ;
SECCK   LDAA           FCTB1   ;
        ANDA          #CTRLK   ;
        BEQ            ALL_ON  ;
        LDAA           FCTB2   ;ARE USER FUNCTIONS ALLOWED?
        ANDA          #USERFA  ;
        BNE            UFA_ON  ;
        LDX           #SECOND  ;
        BRA            SRCH1   ;
UFA_ON  LDX           #UFA     ;POINT TO USER FUNCTIONS.
        BRA            SRCH1   ;
ALL_ON  LDX           #F_TABLE ;LOAD INDEX REG WITH FUNCTIONS.
SRCH1   LDAA           IN1     ;GET 1ST DIGIT IN A-REG.
        LDAB           IN2     ;GET 2ND DIGIT IN B-REG.
LP1     CMPA             0,X   ;COMPARE A-REG PER INDEX.
        BNE            SRCHM   ;IF NO COMPARE THEN TRY AGAIN.
        INX                    ;IF MATCH THEN INCREMENT INDEX.
        CMPB             0,X   ;COMPARE B-REG PER INDEX.
        BNE            SRCHM1  ;IF NOT THEN TRY AGAIN.
        INC            FCCTR   ;INCREMENT FUNCTION COUNTER.
        LDX              1,X   ;IF MATCHED A & B. THEN GO DO IT
        JMP              0,X   ;PER INDEX REG.MUST END WITH RTI.
SRCHM   INX                    ;GO HERE IF A-REG DONT COMPARE.
SRCHM1  INX                    ;HERE IF A-REG DOES BUT NOT B-REG.
        INX                    ;
        INX                    ;
        CPX           #ENDTAB  ;IF END OF TABLE STOP SEARCHING.
        BNE            LP1     ;IF NOT THEN TRY AGAIN.
INTRUDE LDAA          #$FF     ;SET DIGIT COUNT TO FF HEX.
        STAA           DCTR    ;
        RTI                    ;
*
CHKSUM  LDAA          #$00      ;DO CHK SUM OF EPROM.
        LDX           #$FFFF
CHKS1   ADDA           0,X
        DEX
        CPX           #$E000  ;END YET?
        BNE            CHKS1
        CMPA           CHKBYTE
        BNE            BAD      ;IF WRONG SEND BAD IN MORSE.
        RTS
BAD     PSHA
        JSR            TXON
        LDX           #S_BAD
        DEX
        JSR            GO_ID0
        JSR            TXOFF
        LDAA          #$00
BADLOOP STAA           DAT_O0
        CLI
        WAI
        BRA            BADLOOP
*
IDENT   JSR            TXON01  ;TURN ON TX.
        JSR            DELONE
        LDAA           FCTB5   ;CHK FOR ALT. IDENT.
        ANDA          #ALTID   ;
        BNE            ALTID1  ;
        LDAA           FLAGS2  ;GET ID SELECT BITS.
        ANDA          #$03     ;
        CMPA          #$03     ;SEND ALT. ID?
        BEQ            IDENT1  ;
        BRA            DEFAULT ;MUST BE ID 0.
IDENT1  LDAA           FLAGS2  ;GET ID BITS.
        ANDA          #$FC    ;CLEAR ID BITS.
        STAA           FLAGS2  ;PUT IT BACK.
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            CW_ONLY
        JSR            DELONE
        LDAA           FCTB3   ;GET FTCB3.
        ANDA          #ALWSUP  ;CHK FOR ALLOW SUPPRESS VOICE ID.
        BEQ            CHKALW
        LDAA           DAT_I0  ;GET COR SENSE*...GND=ACTIVE.
        ANDA          #COR_BIT
        BEQ            CW_ONLY ;IF COR IS ACTIVE THEN SEND CW.
CHKALW  LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            IDENT1
        LDX           #V_IDENT
        STX            TALKX
        JSR            TALKER
        BRA            IDONE
CW_ONLY LDX           #MYCALL1
        DEX
        BRA            GO_ID0
ALTID1  LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            ALTID2
        LDAA           FLAGS2  ;GET ID BITS.
        ANDA          #$FC    ;CLEAR ID BITS.
        STAA           FLAGS2  ;PUT IT BACK.
        JSR            DELONE
        LDAA           DAT_I0  ;GET COR SENSE*...GND=ACTIVE.
        ANDA          #COR_BIT
        BEQ            ALTID3  ;IF COR ACTIVE THEN SEND CW.
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            ALTID1
        LDX           #ALTID_V ;SET ALTERNATE VOICE IDENT.
        STX            TALKX
        JSR            TALKER
        BRA            IDONE1
ALTID2  LDAA           FLAGS2  ;GET ID BITS.
        ANDA          #$FC    ;CLEAR ID BITS.
        STAA           FLAGS2  ;PUT IT BACK.
ALTID3  LDX           #ALTID_C ;SET ALTERNATE MORSE IDENT.
        DEX
        BRA            GO_ID0
        BRA            IDONE1
DEFAULT LDX           #MYCALL  ;POINT TO MORSE CODE.
        DEX
GO_ID0  INX
        STX            SAVEXM  ;SAVE IT.
        LDAA             0,X   ;GET FIRST CHAR.
        CMPA          #EOT     ;LAST CHAR. SENT?
        BEQ            IDONE1
        JSR            CONVASC ;CONVERT ASCII TO HEX.
        LDX            SAVEXM  ;GET X BACK.
        BRA            GO_ID0
IDONE1  LDAA           FLAGS2  ;GET ID BITS.
        INCA                   ;INCREMENT PLUS ONE.
        STAA           FLAGS2  ;PUT IT BACK.(MAKES IT LONG ID EVERY 4TH)
IDONE   LDX            M10INT  ;INIT NEXT ID TIME.
        STX            IDTEN
        LDAA           FLAGS0  ;RESET ID FLAG.
        ANDA          #$F7
        STAA           FLAGS0
        RTS
RESTORE LDAB           FCTB2   ;LOOK FOR MUTE ON.
        ANDB          #MUTEON
        BEQ            RSTORE1
        LDAB           DAT_O0  ;TURN OFF XMIT FOR MUTE.
        ANDB          #$EF    ;REMOVE TXBIT.
        STAB           DAT_O0
        LDAA           FCTB1   ;CHECK IF REMOTE IS ON.   ********
        ANDA          #RMT_ON  ;                                *
        BEQ            RSTORE1 ;                                *
        LDAB           DAT_O0  ;TURN OFF XMIT FOR MUTE.         *
        ANDB          #$FD    ;REMOVE RMT TX BIT.     07/04/94 *
        STAB           DAT_O0                             *******
RSTORE1 LDAB          #MUTM
        STAB           MUTECNT ;INIT MUTE COUNTER.
        LDAB           FLAGS0  ;SET MUTE FLAG BIT.
        ORAB          #MUTEFLG
        STAB           FLAGS0
        CLR            DCTR
        RTI
*
CLRMEM  LDX           #$0070   ;GET READY TO CLEAR LOW MEMORY.
        LDAA          #$00     ;PUT ZEROS IN A-REG.
CLRLOOP STAA             0,X   ;PUT AWAY PER X-REG.
        DEX                    ;-1 FROM X-REG.
        BNE            CLRLOOP ;IF NOT DONE DO AGAIN.
        STAA             0,X   ;CLEAR ADDRESS ZERO BEFORE RETURN.
        RTS                    ;RETURN.
*
CLRMUTE LDAA          #MUTEFLG ;CLEAR MUTE FLAG.
        ORAA          #TXFLG   ;AND TXFLG.
        COMA
        ANDA           FLAGS0
        STAA           FLAGS0
        JSR            TXON01
        RTS
EPROM   JSR            TXON01  ;SEND EPROM DATE.
        JSR            DELONE
        LDX           #R_DATE
EPROM1  LDAA             0,X   ;GET FIRST CHAR.
        INX                    ;INCREMENT INDEX.
        STX            SAVEXM  ;SAVE IT.
        CMPA          #EOT     ;LAST CHAR. SENT?
        BEQ            IDONE2
        JSR            CONVASC ;CONVERT ASCII TO HEX.
        LDX            SAVEXM  ;GET X BACK.
        BRA            EPROM1
IDONE2  RTS
*
RESPOND LDAB           FCTB3   ;GET 3RD FUNCTION BYTE.
        ANDB          #RESPBIT ;IS RESPONSE ALLOWED.
        BEQ            QUIET1  ;IF NO THEN EXIT.
        LDAA           FLAGS0  ;CHECK FOR MUTE ON.
        ANDA          #MUTEFLG
        BNE            QUIET
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            CODE
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            QUIET
        LDX           #V_RSPND ;SAY "ENTER"
        STX            TALKX
        JSR            TALKER
        DEC            FCCTR   ;DECREMENT FUNCTION COUNTER.
        BRA            QUIET
QUIET1  CLR            FCCTR   ;CLEAR FUNCTION COMPLETE COUNTER.
QUIET   RTS
*
CODE    JSR            TXON03  ;TURN ON TRANSMITTER.
        JSR            DEL_5
        LDAA           RSPND   ;POINT TO RESPONSE CODE.
        JSR            CONVASC ;SEND RESPONSE.
        JSR            TXOFF   ;TURN OFF TRANSMITTER.
        DEC            FCCTR   ;DECREMENT FUNCTION COUNTER.
        BRA            QUIET
*
* ENTER WITH CHAR. TO CONVERT TO MORSE IN THE A-REG.
*
CONVASC LDX           #ASCII   ;POINT TO CONVERSION TABLE.
LOOP10  CMPA             0,X   ;ASCII TO MORSE.
        BEQ            GOTIT   ;IF MATCH THEN SEND IT.
        INX                    ;POINT TO NEXT IN TABLE.
        BRA            LOOP10  ;LOOK SOMEMORE.
DONE    RTS                    ;
*
GOTIT   CMPA          #EOT     ;IS IT END OF TRANSMISSION?
        BEQ            DONE    ;
        LDAB           $30,X   ;GET MORSE EQUIV. TO ASCII.
        STAB           MSAVE0  ;PUT IT IN MORSE SAVE AREA. AND
        LDAB          #$FF     ;PUT A FF AFTER IT TO END SCODE RTN..
        STAB           MSAVE1  ;
        LDX           #MSAVE0  ;POINT TO CODE FOR SCODE.
        BSR            SCODE
        RTS
*
ASCII   FCC     "1234567890"    ;UPPER CASE ASCII ONLY.
        FCC     "ABCDEFGHIJ"
        FCC     "KLMNOPQRST"
        FCC     "UVWXYZ/?,. "
        FCB      $FF
*
        ORG     ASCII+$30
*
HEX     FDB     $7C3C       ;MORSE CODE EQUIV.
        FDB     $1C0C
        FDB     $0484
        FDB     $C4E4
        FDB     $F4FC
        FDB     $6088
        FDB     $A890
        FDB     $4028
        FDB     $D008
        FDB     $2078
        FDB     $B048
        FDB     $E0A0
        FDB     $F068
        FDB     $D850
        FDB     $10C0
        FDB     $3018
        FDB     $7098
        FDB     $B8C8
        FDB     $9432
        FDB     $CE56
        FDB     $21FF
*
SCODE   LDAA             0,X   ;GET CODE PER INDEX REG.
        INX
        STX            XTEMP   ;SAVE POINTER.
        CMPA          #EOT     ;IS IT END OF TRANSMISSION?
        BEQ            ENDIT
        CMPA          #SPCE    ;IS IT A SPACE?
        BEQ            WRDSPC
SHIFT   ASLA
        PSHA
        BCC            DITOUT  ;CARRY CLEAR?
        BSR            DAH     ;NO, SEND DAH.
ENDCHAR PULA
        CMPA          #EOC     ;IS IT END OF CHARACTER.
        BNE            SHIFT
        BSR            UNISP2
        LDX            XTEMP   ;RESTORE POINTER.
        BRA            SCODE
*
DITOUT  BSR            DIT
        BRA            ENDCHAR
*
UNITIM  LDAA           UTIME   ;SETS SPEED OF CODE.
UNITI   DECA
        BNE            UNITI
        RTS
*
TONE    LDAA           FREQ    ;SETS FREQ. OF TONE.
FRQ1    DECA
        BNE            FRQ1
        RTS
*
DIT     LDX            DITCNT  ;SETS LENGTH OF DITS.
        BRA            SAVER
*
DAH     LDX            DAHCNT  ;SETS DURATION OF DAHS.
SAVER   STX            TONECT  ;ENTER HERE WITH X=LENGTH OF NOTE &
TONOUT  LDAA           DAT_O0  ;UTIME SETS FREQUENCY.
        ORAA          #IDAUDIO
        STAA           DAT_O0  ;TURN BIT ON.
        BSR            TONE    ;SET TIME BETWEEN TURN ON/OFF OF LATCH.(FREQ.)
        LDAA           DAT_O0
        ANDA          #$7F     ;TURN BIT OFF.
        STAA           DAT_O0
        BSR            TONE    ;SET TIME BETWEEN TURN ON/OFF OF LATCH.(FREQ.)
        LDX            TONECT  ;THIS CHAR. LENGTH DONE YET?
        DEX
        STX            TONECT
        BNE            TONOUT
UNISPC  LDX            SPACNT  ;SETS SPACE BETWEEN DITS AND DAHS.
UNSP    BSR            UNITIM
        DEX
        BNE            UNSP
        RTS
*
UNISP2  BSR            UNISPC
        BSR            UNISPC
ENDIT   RTS                    ;RETURN TO CALLER.
*
WRDSPC  BSR            UNISP2  ;WORD SPACE
        BSR            UNISP2
        BSR            UNISP2
        LDX            XTEMP
        BRA            SCODE
*
DEL2    BSR            DELONE
        BSR            DELONE
        RTS
*
DELONE  LDX           #ONESEC  ;SET FOR 1 SECOND.
        BRA            DELX
DEL_1   LDX           #DEL1    ;SET FOR .1 SECOND.
        BRA            DELX
DEL_5   LDX           #DEL5
DELX    BSR            UNITIM
        DEX
        BNE            DELX
        RTS
*
BEEP1   LDX           #BEEPR1
        JSR            SCODE
        RTS
*
BEEP3   LDX           #BEEPR3
        JSR            SCODE
        RTS
*
INITIT  LDX           #M10I    ;MINTEN INIT VALUE
        STX            M10INT  ;
        LDAA          #UTIMI   ;INIT. CODE SPEED AT UTIME.
        STAA           UTIME   ;ABOUT 20 WPM.
        LDAA          #FREQI   ;INIT. CODE TONE AT UTIME.
        STAA           FREQ    ;ABOUT 1000 HERTZ.
        LDX           #DTCTI   ;DIT COUNTER INIT VALUE.
        STX            DITCNT  ;
        LDX           #SPCNTI  ;SPACE COUNTER INIT VALUE.
        STX            SPACNT  ;
        LDX           #DHCNTI  ;DAH COUNTER INIT VALUE.
        STX            DAHCNT  ;
        LDX           #ID1ST   ;INIT ID FIRST TIME.
        STX            IDTEN   ;
        LDX           #ARPLMI  ;INIT AUTO RESTORE VALUE.
        STX            ARPLMS  ;
        LDAA          #M3I     ;MIN3 INIT VALUE.
        STAA           M3INT   ;
        STAA           MIN3    ;
        LDX           #KCHKI   ;KERCHUNK INIT VALUE.
        STX            KINT    ;
        LDX           #DLYI    ;DELAY COUNTER INIT VALUE.
        STX            DINT    ;
        LDAA          #FLGS0I  ;FLAGS INIT VALUE.
        STAA           FLAGS0  ;
        LDAA          #FLGS1I  ;FLAGS INIT VALUE.
        STAA           FLAGS1  ;
        LDAA          #FLGS2I  ;FLAGS INIT VALUE.
        STAA           FLAGS2  ;
        LDAA          #$FF     ;INIT DIGIT COUNTER.
        STAA           DCTR    ;
        LDAA          #FCT1    ;INIT FCTB1.
        STAA           FCTB1   ;
        LDAA          #FCT2    ;INIT FCTB2.
        STAA           FCTB2   ;
        LDAA          #FCT3    ;INIT FCTB3.
        STAA           FCTB3   ;
        LDAA          #FCT4    ;INIT FCTB4.
        STAA           FCTB4   ;
        LDAA          #FCT5    ;INIT FCTB5.
        STAA           FCTB5   ;
        LDAA          #FCT6    ;INIT FCTB6.
        STAA           FCTB6   ;
        LDAA          #FEATI   ;INIT FEATURE BYTE.
        STAA           FEAT
        LDAA          #V_CNTRI
        STAA           V_CNTR
        LDX           #V_CLEAR ;USED TO INIT THE DIGITALKER INDEX.
        STX            TALKX   ;PUT IT INTO DIGITALKER INDEX SAVE.
        JSR            CHKSUM
        RTS                    ;
*
PL_YES  LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            PL_YES1
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            PL_YES
        LDX           #PLISON
        STX            TALKX
        JSR            TALKER
PL_YES1 RTS
*
PL_NO   LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            PL_NO1
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            PL_NO
        LDX           #PLISOFF
        STX            TALKX
        JSR            TALKER
PL_NO1  RTS
*
LP10    WAI
        LDX           #$F424  ;INIT INDEX WITH 1/2 SECOND.
LP20    DEX
        BNE            LP20
        LDX           #$F424
LP30    DEX
        BNE            LP30
        BRA            LP10
*
TIMERTN LDAA           FLAGS1   ;CHK POR FLAG.IF ON DONT DO TIMER RTN.
        ANDA          #POR_FLG
        BNE            TTT
        LDAA           FCTB2   ;GO SEE IF TIMER ADJUST ON.
        ANDA          #TIMEADJ
        BEQ            TIME0
TIMESET STX            $0000   ;ADD ONE TO ADDRESS 0000H
        LDAA           $01
        STAA           DAT_O0  ;PUT IN LIGHTS.
TTT     RTI
*
DSPML1  JMP            DSPML
TIME1   JMP            TIME2
TIME0   LDAA           RUN_TMR
        BEQ            OFF_TM
        DEC            RUN_TMR ;DECR. RUN TIMER.
OFF_TM  LDAA           FLAGS3   ;REPEATER OFF TIMER.
        ANDA          #RPTR_OFF
        BEQ            RUN_0
        LDX            OFFTIME  ;DECR. OFF TIMER.
        DEX
        STX            OFFTIME
        BNE            RUN_0
        LDAA          #RPTR_OFF ;CLEAR OFF TIMER FLG.
        COMA
        ANDA           FLAGS3
        STAA           FLAGS3
        LDAA          #RPT_ON  ;TURN ON REPEATER.
        ORAA           FCTB1   ;
        STAA           FCTB1   ;
RUN_0   LDAA           FLAGS0  ;CHECK ID BUSY.
        ANDA          #IDFLG
        BNE            TIME1   ;
        LDAA           FLAGS1  ;CHECK TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            TIME1   ;
        LDAA           FCTB5   ;DISPLAY MEMORY LOW/HI/FMT.
        ANDA          #$70     ;
        BEQ            TIME1   ;
        LDAA           FEAT    ;LCD FEATURE?.
        ANDA          #L_INST
        BEQ            TIME1   ;
        LDAA           FCTB5   ;FORMAT SCREEN?
        ANDA          #D_FMT   ;
        BEQ            DSPML1
        LDAA          #$03     ;LCD ADDR=3.
        JSR            ADD_LCD ;
        LDAA           IN1     ;DISPLAY DTMF BYTE 1.
        JSR            HEXASC2
        LDAA           IN2     ;DISPLAY DTMF BYTE 2.
        JSR            HEXASC2
        LDAA          #$0E     ;LCD ADDR=14.
        JSR            ADD_LCD
        LDAA           FCTB1
        JSR            HEXASC2
        LDAA          #$11     ;LCD ADDR=17.
        JSR            ADD_LCD
        LDAA           FCTB2
        JSR            HEXASC2
        LDAA          #$14     ;LCD ADDR=20.
        JSR            ADD_LCD
        LDAA           FCTB3
        JSR            HEXASC2
        LDAA          #$17     ;LCD ADDR=23.
        JSR            ADD_LCD
        LDAA           FCTB4
        JSR            HEXASC2
        LDAA          #$1A     ;LCD ADDR=26.
        JSR            ADD_LCD
        LDAA           FCTB5
        JSR            HEXASC2
        LDAA          #$1D     ;LCD ADDR=29.
        JSR            ADD_LCD
        LDAA           FCTB6
        JSR            HEXASC2
        LDAA          #$25     ;LCD ADDR=37.
        JSR            ADD_LCD ;
        LDAA           FEAT
        JSR            HEXASC2
        LDAA          #$C3    ;LCD ADDR=43.
        JSR            ADD_LCD
        LDAA           DAT_I0
        ANDA          #$F0
        JSR            HEXASC1 ;OUPUT 1 HEX CHAR.
        LDAA          #$C9    ;LCD ADDR=XX.
        JSR            ADD_LCD
        LDAA           DAT_O0
        JSR            HEXASC2 ;OUPUT 2 HEX CHAR.
        LDAA          #$D1    ;LCD ADDR=XX.
        JSR            ADD_LCD
        LDAA           FLAGS0
        JSR            HEXASC2 ;OUPUT 2 HEX CHAR.
        LDAA           FLAGS1
        JSR            HEXASC2 ;OUPUT 2 HEX CHAR.
        LDAA           FLAGS2
        JSR            HEXASC2 ;OUPUT 2 HEX CHAR.
        LDAA          #$DD    ;LCD ADDR=XX.
        JSR            ADD_LCD
        LDAA           MIN3
        JSR            HEXASC2
        LDAA          #$E3    ;LCD ADDR=XX.
        JSR            ADD_LCD
        LDAA           IDTEN
        JSR            HEXASC2
        LDAA           IDTEN+1
        JSR            HEXASC2
DSPML   LDAA           FCTB5   ;CHK FOR DISPLAY MEMORY LOW ON.
        ANDA          #D_MEML
        BEQ            DSPMH
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            TIME2
        JSR            DMPITL
DSPMH   LDAA           FCTB5   ;CHK FOR DISPLAY MEMORY HIGH ON.
        ANDA          #D_MEMH
        BEQ            TIME2
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            TIME2
        JSR            DMPITH
*
TIME2   LDAA           FCTB5    ;CHK FOR TONE GEN. FUNCTION.
        ANDA          #TSTONE
        BEQ            SWEEP
TTGL1   LDAA           DAT_I0   ;GET TOUCHTONE INPUT.
        ANDA          #$0F      ;MASK FOR T.T. DATA.
        CMPA          #$0F      ;IS IT T.T. "C"
        BNE            TTG1     ;IF SO END IT.
        LDAA          #TSTONE   ;RETURN AND LEAVE TONE FREQ. ALONE.
        COMA
        ANDA           FCTB5
        STAA           FCTB5
        LDAA          #SWPTONE  ;RETURN AND LEAVE TONE FREQ. ALONE.
        COMA
        ANDA           FCTB3
        STAA           FCTB3
        JMP            NMIRETN
TTG1    LDAA           DAT_I0   ;GET TOUCHTONE INPUT.
        ANDA          #$0F      ;MASK FOR T.T. DATA.
        CMPA          #$0E      ;IS IT T.T. "B"
        BNE            TTG2     ;IF SO DECREMENT TONE.
        LDAA           FREQ
        ADDA          #$01
        STAA           FREQ
TTG2    LDAA           DAT_I0   ;GET TOUCHTONE INPUT.
        ANDA          #$0F      ;MASK FOR T.T. DATA.
        CMPA          #$0D      ;IS IT T.T. "A"
        BNE            SWEEP    ;IF SO INCREMENT TONE.
        LDAA           FREQ
        SUBA          #$01
        STAA           FREQ
        LDAA          #PTIME   ;PUT # IN COUNT DOWN TIMER.
        STAA           PMTO16  ;FOR PROCESS MONITOR TIMEOUT.
*
SWEEP   LDAA           FCTB3
        ANDA          #SWPTONE
        BEQ            STST
        LDAA           FREQ
        SUBA          #$01
        STAA           FREQ
        LDAA          #PTIME   ;PUT # IN COUNT DOWN TIMER.
        STAA           PMTO16  ;FOR PROCESS MONITOR TIMEOUT.
*
STST    LDAA           FCTB4   ;CHK FOR SERIAL TEST BIT ON.
        ANDA          #SERTST
        BEQ            CHOPR
        LDAA           FLAGS0
        ORAA          #SERFLG
        STAA           FLAGS0
CHOPR   LDAA           FCTB1   ;SEE IF CHOP FUNCTION ON.
        ANDA          #CHPON
        BEQ            PMTOX   ;IF NOT SKIP ROUTINE.
        LDAA           FLAGS0  ;CHECK CHOPPER TIMER FIRST.
        ANDA          #CHPFLG
        BNE            PMTOX   ;IF FLAG IS ON THEN SKIP IT.
        LDAA           FLAGS0  ;CHECK FOR TX ON.
        ANDA          #TXFLG   ;
        BEQ            PMTOX   ;IF TX IS OFF THEN DONT DECREMENT.
        DEC            MIN3    ;
        LDAA           MIN3    ;
        BEQ            CHPIT   ;
        CMPA          #$06     ;IS IT EQUAL OR GREATER THAN 6?
        BHI            PMTOX   ;
        LDAA           FLAGS1  ;SET COUNT-DOWN FLAG.
        ORAA          #CNTFLG  ;FOR 5,4,3,2,1,TIME-OUT.
        STAA           FLAGS1  ;
        BRA            PMTOX   ;
CHPIT   LDAA           FLAGS0  ;
        ORAA          #CHPFLG  ;
        STAA           FLAGS0  ;
PMTOX   LDAA           FCTB1   ;IF FAILSAFE ON DECR. TIMER.
        ANDA          #FSON    ;
        BEQ            PLMRST  ;
        DEC            PMTO16  ;DECREMENT AND TEST PMTO. VALUE
        BNE            PLMRST  ;IS SET IN C_LOOP.
        JMP            FORCE
*
PLMRST  LDX            ARPLMS  ;VALUE IS SET AT KDONE ROUTINE.
        DEX                    ;IF ZERO THEN SET PL MODE, CONTROLLER-
        STX            ARPLMS  ;LOCKED AND AUTO REPEATER OFF IF WANTED.
        BNE            RSTMUTE
        LDAA           FCTB5   ;CHECK FOR AUTO DISPLAY OFF.
        ANDA          #A_DSP
        BEQ            CKALK
        JSR            OFF_LCD
        LDAA           FCTB5
        ANDA          #$8F
        STAA           FCTB5
CKALK   LDAA           FCTB3   ;CHECK FOR AUTO LOCKUP BIT.
        ANDA          #AUTOL
        BEQ            CKARF
        LDAA           FCTB1   ;SET CONTROLLER LOCKED BIT.
        ORAA          #CTRLK
        STAA           FCTB1
CKARF   LDAA           FCTB4   ;CHECK FOR AUTO REPEATER OFF BIT.
        ANDA          #AROFF
        BEQ            RPLM
        LDAA           FCTB1   ;TURN OFF REPEATER.
        ANDA          #$BF
        STAA           FCTB1
RPLM    LDAA           FCTB2   ;CHECK FOR AUTO RESTORE PL MODE.
        ANDA          #REST_PL
        BEQ            RSTMUTE
        LDAA           FCTB1   ;RESTORE PL MODE.
        ORAA          #PLON
        STAA           FCTB1
        LDX           #ARPLMI
        STX            ARPLMS  ;
RSTMUTE LDAA           FLAGS0  ;CHK FOR MUTE FLAG ON.
        ANDA          #MUTEFLG ;
        BEQ            APH     ;
        LDAA           MUTECNT ;
        BEQ            APH     ;
        DEC            MUTECNT ;VALUE IS SET IN IRQ RTN.
        BNE            APH     ;
        LDAA          #MUTEFLG ;CLEAR MUTE FLAG.
        ORAA          #TXFLG   ;AND TXFLG.
        COMA                   ;
        ANDA           FLAGS0  ;
        STAA           FLAGS0  ;
*       LDAB           FCTB2   ;LOOK FOR MUTE FUNCTION ON.
*       ANDB          #MUTEON  ;
*       BEQ            APH     ;
        LDAA          #$FF     ;IF MUTE IS ON THEN WHEN
        STAA           DCTR    ;MUTE TIME ENDS THROW AWAY DATA.
APH     LDAA           FCTB4   ;IS AUTO HANGUP ON?
        ANDA          #AHANG   ;
        BEQ            IDCNTR  ;
        LDAA           FLAGS1  ;IS AP OFFHOOK.
        ANDA          #AHFLG   ;
        BEQ            IDCNTR  ;
        DEC            APTIMER ;DECR. COUNTER.(SET IN KDONE RTN).
        BNE            IDCNTR  ;
        JSR            PATOFF  ;TURN OFF PATCH AND SET SAP FLAG.
IDCNTR  LDAA           FCTB3   ;CHECK IF AUTOMATIC IDENT ON.
        ANDA          #AUTOID  ;
        BEQ            NMIRETN ;
        LDAA           FLAGS0  ;CHECK ID TIMER.
        ANDA          #IDFLG
        BNE            NMIRETN
        LDX            IDTEN
        DEX
        BEQ            IDSET
        STX            IDTEN
        BRA            NMIRETN
IDSET   LDAA           FLAGS0
        ORAA          #IDFLG
        STAA           FLAGS0
NMIRETN LDAA           FLAGS1
        ANDA          #DT_BUSY
        BEQ            NMI_RET
        DEC            V_CNTR
        BEQ            CLR_TB
        RTI
NMI_RET LDAA          #V_CNTRI
        STAA           V_CNTR
        RTI
CLR_TB  JMP            RTB
*
FORCE   LDAA          #$00
        STAA           DAT_O0
        STAA           TALK
        CLI
        BRA            FORCE
*
PCODE   FCB     $68
        FCB     $FF
*
BEEP    FCB     $21
        FCB     $40
        FCB     $40
        FCB     $FF
BEEPR1  FCB     $21
        FCB     $40
        FCB     $FF
BEEPR3  FCB     $21
        FCB     $40
        FCB     $21
        FCB     $40
        FCB     $21
        FCB     $40
        FCB     $FF
*
C_LCD   BSR            CLR_LCD ;CLEAR DISPLAY.
        JMP            RESTORE ;
*
CLR_LCD LDAA          #$01     ;CLEAR DISPLAY.
        JSR            LCD_CTL ;
        JSR            DEL_1   ;
        RTS
*
ON_L    JSR            LCD_INI
        JMP            RESTORE
*
OFF_L   BSR            OFF_LCD
        JMP            RESTORE
*
OFF_LCD LDAA          #$08     ;CLEAR DISPLAY.
        JSR            LCD_CTL ;
        JSR            DEL_1   ;
        LDAA           FCTB5   ;
        ANDA          #$8F     ;
        STAA           FCTB5   ;
        RTS
*
ADD_LCD ORAA          #$80     ;
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        RTS
*
LCD_INI LDAA           FEAT     ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            LCD_2   ;
        LDAA           FLAGS1  ;CHK FOR BUSY TALKER.
        ANDA          #DT_BUSY ;
        BNE            LCD_INI ;
LCD_2   LDAA          #$38     ;SET 8 BIT & 2 LINE MODE.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        LDAA          #$0F     ;DISPLAY ON,CURSOR ON, CURSOR BLINK.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        LDAA          #$06     ;ENTRY MODE SET.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        LDAA          #$01     ;CLEAR DISPLAY.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        LDAA          #$40     ;CLEAR DISPLAY.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        LDAA          #$80     ;CLEAR DISPLAY.
        JSR            LCD_CTL ;
        JSR            UNITIM  ;
        RTS
*
F_SCRN  LDAB          #$50     ;SET COUNTER TO 80 DECIMAL.
F_SCRN1 LDAA          #$FF
        DECB
        BEQ            LCD_END
        JSR            LCD_DAT ;SEND TO DISPLAY.
*       JSR            DEL_1
        BRA            F_SCRN1 ;
*
FMT_LCD LDX           #FORMAT  ;POINT TO MESSAGE.
        BRA            LCDWRT  ;
*
LEPROM  LDX           #R_DATE1 ;POINT TO MESSAGE.
*
LCDWRT  STX            LCDX    ;
LCD_AGN LDAA           0,X     ;GET DATA PER INDEX.
        INX                    ;
        STX            LCDX    ;
        CMPA          #$00     ;
        BEQ            LCD_END ;
        JSR            LCD_DAT ;SEND TO DISPLAY.
        JSR            UNITIM  ;
        BRA            LCD_AGN ;
LCD_END RTS                    ;
*
LCD_CTL STAA           TALK    ;PUT IT INTO DIGITALKER/LCD DATA PORT.
        LDAA          #$0F     ;CLEAR LCD CONTROL LINES & SILENCE TALKER.
        STAA           DAT_I1  ;
        ORAA          #$40     ;TURN ON ENABLE.
        STAA           DAT_I1  ;
        ANDA          #$BF    ;TURN OFF ENABLE.
        STAA           DAT_I1  ;
        RTS                    ;
*
LCD_DAT STAA           TALK    ;PUT IT INTO DIGITALKER/LCD DATA PORT.
        LDAA          #$1F     ;SET RS CONTROL LINE & SILENCE TALKER.
        STAA           DAT_I1
        ORAA          #$40     ;TURN ON ENABLE.
        STAA           DAT_I1
        ANDA          #$BF     ;TURN OFF ENABLE.
        STAA           DAT_I1
        RTS
*
SAY_POR LDX           #POWERON ;SAY POR AND SKIP TXON.
        STX            TALKX
*        LDAA          #$00
*        STAA           MIX1
*        STAA           MIX2
*        JSR            SERDATA
*
TALKER  JSR            SETMIX8
TALKER2 JSR            TXON    ;TURN ON TX.
        LDAA          #DT_BUSY ;SET DT_BUSY FLAG TO PREVENT TX OFF.
        ORAA           FLAGS1
        STAA           FLAGS1
TALKER1 LDX            TALKX
        LDAA           0,X     ;1st BYTE SET HI/LO ROM.
        CMPA          #EOT
        BEQ            D_RST
        ORAA          #$02     ;SET *CS,*CMS,ROM-HI/LO.
        STAA           DAT_I1
        TAB
        INX
        LDAA           0,X     ;2nd BYTE IS WORD/SILENCE.
        STAA           TALK    ;PUT IT INTO DIGITALKER SWITCHES.
        NOP                    ;DELAY
        NOP                    ;DELAY
        NOP                    ;DELAY
        NOP                    ;DELAY
        TBA
        ANDA          #$01
        STAA           DAT_I1  ;DO WRITE STROBE.
        NOP                    ;DELAY
        TBA                    ;RESET WRITE STROBE.
        ORAA          #$02
        STAA           DAT_I1
        NOP
        ORAA          #$06
        STAA           DAT_I1
        NOP
        ORAA          #$04
        STAA           DAT_I1
        NOP
        ORAA          #$0E
        STAA           DAT_I1
        INX
        STX            TALKX   ;SAVE TALK INDEX.
        RTS
*
D_RST   LDAA          #DT_BUSY ;CLEAR DT BUSY FLAG AND
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        JSR            RSTMIX8
        RTS
*
SST     LDAA          #STFLG
        ORAA           FLAGS2
        STAA           FLAGS2
        CLR            FCCTR
        JMP            RTN4    ;EXIT VIA IRQ ROUTINE.
*
RTB     LDAA          #DT_BUSY ;FORCE RESET OF DT_BUSY FLAG.
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        LDAA          #V_CNTRI
        STAA           V_CNTR
        CLR            FCCTR
        JMP            RTN4    ;EXIT VIA IRQ ROUTINE.
*
ALLTOFF LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #$CE    ;REMOVE CHOPPER & FAILSAFE & PL.
        STAA           FCTB1   ;PUT IT BACK.
        LDAA           FCTB3   ;GET RESET BEEP AND TURN OFF.
        ANDA          #$FB
        STAA           FCTB3
        LDAA          #STFLG
        ORAA           FLAGS2
        STAA           FLAGS2
        LDAA          #S_PL
        ORAA           FLAGS0
        STAA           FLAGS0
*       CLR            FCCTR
        BRA            RTN4    ;EXIT VIA IRQ ROUTINE.
*
ALLTON  LDAA          #$31     ;TURN TIMERS AND PL ON.
        ORAA           FCTB1
        STAA           FCTB1
        LDAA          #BEP_ON
        ORAA           FCTB3
        STAA           FCTB3
        LDAA          #STFLG
        ORAA           FLAGS2
        STAA           FLAGS2
        LDAA          #S_PL
        ORAA           FLAGS0
        STAA           FLAGS0
*       CLR            FCCTR
        LDAA          #M3I     ;MIN3 INIT VALUE.
        STAA           M3INT   ;
        STAA           MIN3    ;
        BRA            RTN4
*
RMT_EN  LDAA           FCTB1   ;GET FCTB1.
        ANDA          #RMT_ON  ;SEE IF REMOTE IS ON.
        BEQ            RMT_NO  ;IF NOT ON THEN RETURN.
        LDAA           MIX2    ;SET RPTR AUDIO TO REMOTE TX.
        ORAA          #$01
        STAA           MIX2
        LDAA          #RMTFLG  ;GET REMOTE ENABLE FLAG.
        ORAA          #SERFLG  ;SET SERIAL REQ. FLAG.
        ORAA           FLAGS0  ;TURN IT ON.
        STAA           FLAGS0  ;PUT IT BACK
        LDAA           FLAGS2  ;
        ORAA          #STXON   ;TURN ON SEND RMT TX ON FLAG.
        STAA           FLAGS2  ;
        CLR            FCCTR
*        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
*        ANDA          #V_INST
*        BEQ            RMT_Y1
*        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
*        ANDA          #DT_BUSY ;
*        BNE            RMT_Y1  ;
*        LDX           #RMTXON
*        STX            TALKX
*        JSR            TALKER
RMT_Y1  BRA            RTN4
RMT_NO  CLR            FCCTR
        BRA            RTN4
*
RMT_DIS LDAA          #RMTFLG  ;GET REMOTE ENABLE FLAG.
        COMA
        ANDA           FLAGS0  ;TURN OFF RMTFLG BIT.
        STAA           FLAGS0
        LDAA           FLAGS2  ;
        ORAA          #STXOFF  ;TURN ON SEND RMT TX ON FLAG.
        STAA           FLAGS2  ;
        CLR            FCCTR
*        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
*        ANDA          #V_INST
*        BEQ            RMT_D1
*        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
*        ANDA          #DT_BUSY
*        BNE            RMT_D1
*        LDX           #RMTXOFF
*        STX            TALKX
*        JSR            TALKER
RMT_D1  LDAA          #$FE    ;TURN OFF RPTR AUDIO TO REMOTE.
        ANDA           MIX2
        STAA           MIX2
        JMP            SETIT
*
RTN4    JMP            RESTORE
*
ID_DN10 LDAB          #$0A     ;INCREMENT THE FREQ COUNTER +10.
        BRA            ID_DNB
ID_DN5  LDAB          #$05     ;INCREMENT THE FREQ COUNTER +5.
ID_DNB  BSR            ID_DWN
        DECB
        BNE            ID_DNB
        BRA            ID_DNA
ID_DN1  BSR            ID_DWN  ;INCREMENT THE FREQ COUNTER +1.
        BRA            ID_DNA
ID_DWN  LDAA           FREQ    ;INCREMENT THE FREQ COUNTER.
        INCA
        STAA           FREQ
        RTS
ID_DNA  BRA            RTN4
*
ID_UP10 LDAB          #$0A     ;DECREMENT THE FREQ COUNTER -10.
        BRA            ID_UPB  ;
ID_UP5  LDAB          #$05     ;DECREMENT THE FREQ COUNTER -5.
ID_UPB  BSR            ID_UP   ;
        DECB                   ;
        BNE            ID_UPB  ;
        BRA            ID_UPA  ;
ID_UP1  BSR            ID_UP   ;DECREMENT THE FREQ COUNTER -1.
        BRA            ID_UPA  ;
ID_UP   LDAA           FREQ    ;DECREMENT THE FREQ COUNTER.
        DECA                   ;
        STAA           FREQ    ;
        RTS                    ;
ID_UPA  BRA            RTN4    ;
*
SP_DN10 LDAB          #$0A     ;INCREMENT THE UTIME COUNTER +10.
        BRA            SP_DNB  ;
SP_DN5  LDAB          #$05     ;INCREMENT THE UTIME COUNTER +5.
SP_DNB  BSR            SP_DWN  ;
        DECB                   ;
        BNE            SP_DNB  ;
        BRA            SP_DNA  ;
SP_DN1  BSR            SP_DWN  ;INCREMENT THE UTIME COUNTER +1.
        BRA            SP_DNA  ;
SP_DWN  LDAA           UTIME   ;INCREMENT THE UTIME COUNTER.
        INCA                   ;
        STAA           UTIME   ;
        RTS                    ;
SP_DNA  BRA            RTN4    ;
*
SP_UP10 LDAB          #$0A     ;DECREMENT THE UTIME COUNTER -10.
        BRA            SP_UPB  ;
SP_UP5  LDAB          #$05     ;DECREMENT THE UTIME COUNTER -5.
SP_UPB  BSR            SP_UP   ;
        DECB                   ;
        BNE            SP_UPB  ;
        BRA            SP_UPA  ;
SP_UP1  BSR            SP_UP   ;DECREMENT THE UTIME COUNTER -1.
        BRA            SP_UPA  ;
SP_UP   LDAA           UTIME   ;DECREMENT THE UTIME COUNTER.
        DECA                   ;
        STAA           UTIME   ;
        RTS                    ;
SP_UPA  BRA            RTN4    ;
*
IMC     LDX            M10INT  ;SETUP INX AND B-REG FIRST.
        LDAB          #$3C     ;INCR COUNTER BY 1 MINUTE.
        BSR            PXAGN   ;
        STX            M10INT  ;
        BRA            RTN3    ;
*                              ;
ICT     LDAA           M3INT   ;INCR CHOPPER BY 30 SECONDS.
        BSR            PLUSA   ;
        STAA           M3INT   ;
        BRA            RTN3    ;
*
IKF     LDAA           KINT    ;.075 SECONDS FOR EACH 10 HEX.
        ADDA          #$10     ;GET HIGH ORDER BYTE OF KERCHUNK FILTER.
        STAA           KINT    ;PUT IT BACK.
        BRA            RTN3    ;
*
IDC     LDAA           DINT    ;DROP DELAY (ADJUST PLUS .167 SEC.)
        ADDA          #$10     ;ADD 10 HEX FROM A-REG.
        STAA           DINT    ;PUT IT BACK.
        BRA            RTN3    ;
*
IIC     LDX            IDTEN   ;SETUP INX AND B-REG FIRST.
        LDAB          #$3C     ;INCR COUNTER BY 1 MINUTE.
        BSR            PXAGN   ;
        STX            IDTEN   ;
        BRA            RTN3    ;
*
PLUSX   LDAB          #$00     ;
PXAGN   INX                    ;INCR INDEX REG.
        DECB                   ;DECR B-REG.
        BNE            PXAGN   ;
        RTS                    ;
*
PLUSA   LDAB          #$1E     ;DECIMAL 30.
APLUS   INCA                   ;
        DECB                   ;
        BNE            APLUS   ;
        RTS                    ;
*
DMC     LDX            M10INT  ;SETUP INX AND B-REG FIRST.
        LDAB          #$3C     ;DECR COUNTER BY 1 MINUTE.
        BSR            MXAGN   ;
        STX            M10INT  ;
        BRA            RTN3    ;
*
DCT     LDAA           M3INT   ;DECR CHOPPER BY 30 SECONDS.
        BSR            SUB_A   ;
        STAA           M3INT   ;
        BRA            RTN3    ;
*
DKF     LDAA           KINT    ;.075 SECONDS FOR EACH 10 HEX.
        LDAB          #$10     ;GET HIGH ORDER BYTE OF KERCHUNK FILTER.
        SBA                    ;SUBTRACT 10 HEX FROM IT.
        STAA           KINT    ;PUT IT BACK.
        BRA            RTN3    ;
*
DDC     LDAA           DINT    ;DROP DELAY (ADJUST MINUS .167 SEC.)
        LDAB          #$10     ;
        SBA                    ;SUBTRACT 10 HEX FROM A-REG.
        STAA           DINT    ;PUT IT BACK.
        BRA            RTN3    ;
*
DIC     LDX            IDTEN   ;SETUP INX AND B-REG FIRST.
        LDAB          #$3C     ;DECR COUNTER BY 1 MINUTE.
        BSR            MXAGN   ;
        STX            IDTEN   ;
        BRA            RTN3    ;
SUBX    LDAB          #$00     ;
MXAGN   DEX                    ;
        DECB                   ;
        BNE            MXAGN   ;
        RTS                    ;
SUB_A   LDAB          #$1E     ;30 DECIMAL.
MINUSA  DECA                   ;
        DECB                   ;
        BNE            MINUSA  ;
        RTS                    ;
RTN3    JMP            RESTORE ;
*
IDIT10  LDAB          #$0A     ;INCREMENT THE DIT COUNTER +10.
        BRA            IDITB   ;
IDIT5   LDAB          #$05     ;INCREMENT THE DIT COUNTER +5.
IDITB   BSR            IDIT    ;
        DECB                   ;
        BNE            IDITB   ;
        BRA            IDITA   ;
IDIT1   BSR            IDIT    ;INCREMENT THE DIT COUNTER +1.
        BRA            IDITA   ;
IDIT    LDX            DITCNT  ;INCREMENT THE DIT COUNTER.
        INX                    ;
        STX            DITCNT  ;
        RTS                    ;
IDITA   BRA            RTN3    ;
*
ISPC10  LDAB          #$0A     ;INCREMENT THE SPACE COUNTER +10.
        BRA            ISPCB   ;
ISPC5   LDAB          #$05     ;INCREMENT THE SPACE COUNTER +5.
ISPCB   BSR            ISPC    ;
        DECB                   ;
        BNE            ISPCB   ;
        BRA            ISPCA   ;
ISPC1   BSR            ISPC    ;INCREMENT THE SPACE COUNTER +1.
        BRA            ISPCA   ;
ISPC    LDX            SPACNT  ;INCREMENT THE SPACE COUNTER.
        INX                    ;
        STX            SPACNT  ;
        RTS                    ;
ISPCA   BRA            RTN3    ;
*
IDAH10  LDAB          #$0A     ;INCREMENT THE DAH COUNTER +10.
        BRA            IDAHB   ;
IDAH5   LDAB          #$05     ;INCREMENT THE DAH COUNTER +5.
IDAHB   BSR            IDAH    ;
        DECB                   ;
        BNE            IDAHB   ;
        BRA            IDAHA   ;
IDAH1   BSR            IDAH    ;INCREMENT THE DAH COUNTER +1.
        BRA            IDAHA   ;
IDAH    LDX            DAHCNT  ;INCREMENT THE DAH COUNTER.
        INX                    ;
        STX            DAHCNT  ;
        RTS                    ;
IDAHA   BRA            RTN3    ;
*
DDIT10  LDAB          #$0A     ;DECREMENT THE DIT COUNTER -10.
        BRA            DDITB   ;
DDIT5   LDAB          #$05     ;DECREMENT THE DIT COUNTER -5.
DDITB   BSR            DDIT    ;
        DECB                   ;
        BNE            DDITB   ;
        BRA            DDITA   ;
DDIT1   BSR            DDIT    ;DECREMENT THE DIT COUNTER -1.
        BRA            DDITA   ;
DDIT    LDX            DITCNT  ;DECREMENT THE DIT COUNTER.
        DEX                    ;
        STX            DITCNT  ;
        RTS                    ;
DDITA   BRA            RTN2    ;
*
DSPC10  LDAB          #$0A     ;DECREMENT THE SPACE COUNTER -10.
        BRA            DSPCB   ;
DSPC5   LDAB          #$05     ;DECREMENT THE SPACE COUNTER -5.
DSPCB   BSR            DSPC    ;
        DECB                   ;
        BNE            DSPCB   ;
        BRA            DSPCA   ;
DSPC1   BSR            DSPC    ;DECREMENT THE SPACE COUNTER -1.
        BRA            DSPCA   ;
DSPC    LDX            SPACNT  ;DECREMENT THE SPACE COUNTER.
        DEX                    ;
        STX            SPACNT  ;
        RTS                    ;
DSPCA   BRA            RTN2    ;
*
DDAH10  LDAB          #$0A     ;DECREMENT THE DAH COUNTER -10.
        BRA            DDAHB   ;
DDAH5   LDAB          #$05     ;DECREMENT THE DAH COUNTER -5.
DDAHB   BSR            DDAH    ;
        DECB                   ;
        BNE            DDAHB   ;
        BRA            DDAHA   ;
DDAH1   BSR            DDAH    ;DECREMENT THE DAH COUNTER -1.
        BRA            DDAHA   ;
DDAH    LDX            DAHCNT  ;DECREMENT THE DAH COUNTER.
        DEX                    ;
        STX            DAHCNT  ;
        RTS                    ;
DDAHA   NOP                    ;
*
RTN2    JMP            RESTORE ;
*
SF1     LDAA          #FL1     ;
        BRA            SETREG  ;
SF2     LDAA          #FL2     ;
        BRA            SETREG  ;
SF3     LDAA          #RPATCH  ;
        COMA                   ;
        ANDA           FCTB4   ;
        STAA           FCTB4   ;
        LDAA          #FL3     ;
        BRA            SETREG  ;
SF4     LDAA          #FL4     ;
        BRA            SETREG  ;
SF5     LDAA          #FL5     ;
        BRA            SETREG  ;
SF6     LDAA          #FL6     ;
SETREG  BSR            SETR1   ;
        BRA            RTN2    ;
SETR1   ORAA           DAT_O0  ;
        STAA           DAT_O0  ;
        RTS                    ;
RF1     LDAA          #FL1     ;
        COMA                   ;
        BRA            RSTREG  ;
RF2     LDAA          #FL2     ;
        COMA                   ;
        BRA            RSTREG  ;
RF3     LDAA           FCTB4   ;
        ORAA          #RPATCH  ;
        STAA           FCTB4   ;
        LDAA          #FL3     ;
        COMA                   ;
        BRA            RSTREG  ;
RF4     LDAA          #FL4     ;
        COMA                   ;
        BRA            RSTREG  ;
RF5     LDAA          #FL5     ;
        COMA                   ;
        BRA            RSTREG  ;
RF6     LDAA          #FL6     ;
        COMA                   ;
RSTREG  BSR            RSTRG1  ;
        BRA            RTN2    ;
RSTRG1  ANDA           DAT_O0  ;
        STAA           DAT_O0  ;
        RTS                    ;
*SET/RESETS FEATURE BITS.
*
SM1_IN  LDAA           FCTB5   ;CHK DIAGNOSTIC MODE.
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #MIXINST
        BRA            SET_F
SP_IN   LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #P_INST
        BRA            SET_F
SL_IN   LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #L_INST
        BRA            SET_F
SV_IN   LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #V_INST
SET_F   ORAA           FEAT
SET_F1  STAA           FEAT
        LDAA          #DIAG    ;RESET DIAG. BIT.
        COMA
        ANDA           FCTB5
        STAA           FCTB5
        JMP            RESTORE
*
NO_SF   CLR            FCCTR
        JMP            RESTORE
RM1_IN  LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #MIXINST
        BRA            RST_F
RSP_IN  LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #P_INST
        BRA            RST_F
RSL_IN  LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #L_INST
        BRA            RST_F
RSV_IN  LDAA           FCTB5
        ANDA          #DIAG
        BEQ            NO_SF
        LDAA          #V_INST
RST_F   COMA
        ANDA           FEAT
        BRA            SET_F1
*
*THIS GROUP SETS BITS IN FCTB5.
S57     LDX           #0060    ;SET ID TIMER TO 1 MINUTE.
        STX            M10INT
        STX            IDTEN
        LDAA          #$80
        BRA            SFCTB5
S56     JSR            LCD_INI
        JSR            DEL_1
        LDX           #ARPLMI
        STX            ARPLMS
        LDAA           FCTB5
        ANDA          #$8F
        STAA           FCTB5
        LDAA          #D_MEML
        BRA            SFCTB5
S55     JSR            LCD_INI
        JSR            DEL_1
        LDX           #ARPLMI
        STX            ARPLMS
        LDAA           FCTB5
        ANDA          #$8F
        STAA           FCTB5
        LDAA          #D_MEMH
        BRA            SFCTB5
S54     JSR            LCD_INI
        JSR            DEL_1
        LDX           #ARPLMI
        STX            ARPLMS
        JSR            FMT_LCD
        LDAA           FCTB5
        ANDA          #$8F
        STAA           FCTB5
        LDAA          #D_FMT
        BRA            SFCTB5
S53     LDAA          #$08
        BRA            SFCTB5
S52     JSR            RSTMIX1
        LDAA          #$04
        BRA            SFCTB5
S51     LDAA          #$02
        BRA            SFCTB5
S50     LDAA          #TSTONE
SFCTB5  ORAA           FCTB5
        STAA           FCTB5
RTN6    JMP            RESTORE
*THIS GROUP RESETS BITS IN FCTB5.
R57     LDX           #M10I    ;RESTORE NORMAL ID TIMER.
        STX            M10INT
        STX            IDTEN
        LDAA           FCTB5
        ANDA          #$7F
        BRA            RFCTB5
R56     JSR            OFF_LCD
        LDAA           FCTB5
        ANDA          #$BF
        BRA            RFCTB5
R55     JSR            OFF_LCD
        LDAA           FCTB5
        ANDA          #$DF
        BRA            RFCTB5
R54     JSR            OFF_LCD
        LDAA           FCTB5
        ANDA          #$EF
        BRA            RFCTB5
R53     JSR            SMIX1
        LDAA           FCTB5
        ANDA          #$F7
        BRA            RFCTB5
R52     JSR            SMIX1
        LDAA           FCTB5
        ANDA          #$FB
        BRA            RFCTB5
R51     LDAA           FCTB5
        ANDA          #$FD
        BRA            RFCTB5
R50     LDAA           FCTB5
        ANDA          #$FE
*
RFCTB5  STAA           FCTB5
        JMP            RESTORE
*THIS GROUP SETS BITS IN FCTB4.
*
SWDOG   LDAA          #WATCHD  ;SET REMOTE WATCH-DOG.
        BRA            SFCTB4
SAROFF  LDAA          #$80
        BRA            SFCTB4
SDBL    LDAA          #$40
        BRA            SFCTB4
EAHNG   LDAA          #AHANG
        BRA            SFCTB4
SS40    LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            NO_AP
        LDAA           FCTB4   ;CHK FOR AP ENABLED.
        ANDA          #AUTOP
        BEQ            NO_AP
        LDAA           FCTB1   ;SAVE CURRENT STATE OF CONTROLLER.  *
        STAA           SAVEF1                                      *
        LDAA           FCTB2   ;SAVE CURRENT STATE OF CONTROLLER.  *
        STAA           SAVEF2                                      *
        LDAA           FCTB3   ;SAVE CURRENT STATE OF CONTROLLER.  *
        STAA           SAVEF3                                      *
        LDAA           FCTB4   ;SAVE CURRENT STATE OF CONTROLLER.  *
        STAA           SAVEF4                                      *
        LDAA           FCTB5   ;SAVE CURRENT STATE OF CONTROLLER.  *
        STAA           SAVEF5                                      *
        LDAA          #RMTFLG  ;TURN OFF REMOTE FLAG.
        COMA
        ANDA           FLAGS0
        STAA           FLAGS0
        LDAA          #FL5     ;TURN OFF FL5 AND FL6.
        ORAA          #FL6
        COMA
        JSR            RSTRG1
        JSR            CLRMUTE ;CLEAR MUTE.RESTORE TXON.
        CLR            FCCTR
        JSR            NO_APL1
        LDAA           MIX1    ;RESET REMOTE AUDIO TO RPTR.
        ANDA          #$FD
        ORAA          #M1C1
        STAA           MIX1
        LDAA           MIX2    ;RESET RPTR AUDIO TO REMOTE.
        ANDA          #$FE
        STAA           MIX2
        LDAA          #SERFLG  ;SET SERIAL REQUEST FLAG.
        ORAA           FLAGS0
        STAA           FLAGS0
        LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #$C7     ;REMOVE CHOPPER, FAILSAFE AND REMOTE.
        ORAA          #$40     ;TURN ON REPEATER IF NOT ALREADY ON..
        STAA           FCTB1   ;PUT IT BACK.
        LDAA           FCTB3   ;GET RESET BEEP AND TURN OFF.
        ANDA          #$FB
        STAA           FCTB3
        LDAA          #OFFHOOK
        BRA            SFCTB4
EAP     LDAA          #AUTOP
        BRA            SFCTB4
SSTST   LDAA           FCTB5   ;CHK DIAGNOSTIC MODE.
        ANDA          #DIAG
        BEQ            NO_AP1
        LDAA          #SERTST  ;SET SERIAL TEST BIT.
*
SFCTB4  ORAA           FCTB4
        STAA           FCTB4
NO_AP   JMP            RESTORE
NO_AP1  CLR            FCCTR
        JMP            RESTORE
*
*THIS GROUP RESETS BITS IN FCTB4.
RSTST   LDAA           FCTB4   ;RESET SERIAL TEST BIT.
        ANDA          #$EF
        BRA            RFCTB4
RWDOG   LDAA           FCTB4   ;RESET REMOTE WATCH-DOG.
        ANDA          #$DF
        BRA            RFCTB4
RAROFF  LDAA           FCTB4
        ANDA          #$7F
        BRA            RFCTB4
DAHNG   LDAA           FCTB4
        ANDA          #$FD
        BRA            RFCTB4
RR40    LDAA           FEAT    ;CHK FEATURE BYTE FOR PHONE INSTALLED.
        ANDA          #P_INST
        BEQ            RTN5
        LDAA           FCTB4   ;CHK FOR AP ENABLED.
        ANDA          #AUTOP   ;
        BEQ            RTN5    ;
        LDAA           SAVEF1  ;RESTORE SAVED FCTB1.
        STAA           FCTB1
        LDAA           SAVEF2  ;RESTORE SAVED FCTB2.
        STAA           FCTB2
        LDAA           SAVEF3  ;RESTORE SAVED FCTB3.
        STAA           FCTB3
        LDAA           SAVEF4  ;RESTORE SAVED FCTB4.
        STAA           FCTB4
        LDAA           SAVEF5  ;RESTORE SAVED FCTB5.
        STAA           FCTB5
        CLR            FCCTR
        LDAA          #OFFHOOK
        COMA
        ANDA           FCTB4
        BRA            RFCTB4
DAP     LDAA          #AUTOP
        COMA
        ANDA           FCTB4
        BRA            RFCTB4
RSDBL   LDAA           FCTB4
        ANDA          #$BF
RFCTB4  STAA           FCTB4
RTN5    JMP            RESTORE
*THIS GROUP SETS BITS IN FCTB3.
S30     LDAA          #ALWSUP  ;SET ALLOW SUPPRESS VOICE ID BIT.
        BRA            SFCTB3
RSTBON  LDAA          #BEP_ON  ;SET RESET BEEP ON BIT.
        BRA            SFCTB3
SWPON   LDAA          #TSTONE  ;SET TEST TONE GEN.
        ORAA           FCTB5
        STAA           FCTB5
        LDAA          #SWPTONE ;SET SWEEP TONE BIT.
        BRA            SFCTB3
SALOCK  LDAA          #$08     ;SET AUTO-LOCKUP.
        BRA            SFCTB3
ID_ON   LDAA          #AUTOID
        BRA            SFCTB3  ;TURN ON IDENTIFIER.
RSPON   LDAA          #$80
        BRA            SFCTB3
SROM    LDAA          #$40
        BRA            SFCTB3
F_ID1   LDAA           FLAGS2  ;SET ALT. ID BITS TO 3.
        ORAA          #$03     ;'OR' ID BITS ID1,ID2.
        STAA           FLAGS2  ;PUT IT BACK.
F_ID0   LDAA           FCTB3
        ORAA          #$20     ;'OR' FORCE ID BIT.
        STAA           FCTB3   ;PUT IT BACK.
        CLR            FCCTR
        BRA            RTN5    ;
SFCTB3  ORAA           FCTB3   ;
        STAA           FCTB3   ;
        LDAA          #DIAG    ;RESET DIAG. BIT.
        COMA
        ANDA           FCTB5
        STAA           FCTB5
        BRA            RTN5    ;
*THIS GROUP RESETS BITS IN FCTB3.
R30     LDAA           FCTB3   ;RESET ALLOW SUPPRESS VOICE ID BIT.
        ANDA          #$FE
        BRA            RFCTB3  ;
SWPOFF  LDAA           FCTB3   ;RESET SWEEP BIT.
        ANDA          #$FD
        BRA            RFCTB3  ;
RSTBOFF LDAA           FCTB3   ;RESET BEEP BIT.
        ANDA          #$FB
        BRA            RFCTB3  ;
ID_OFF  LDAA           FCTB3   ;TURN OFF IDENTIFIER.
        ANDA          #$EF
        BRA            RFCTB3  ;
RALOCK  LDAA           FCTB3   ;RESET AUTO-LOCKUP.
        ANDA          #$F7
        BRA            RFCTB3  ;
RSPOFF  LDAA           FCTB3   ;RESPONSE OFF.
        ANDA          #$7F
RFCTB3  STAA           FCTB3   ;
        LDAA          #DIAG    ;RESET DIAG. BIT.
        COMA
        ANDA           FCTB5
        STAA           FCTB5
        JMP            RESTORE
*THIS GROUP SETS BITS IN FCTB1.
S17     LDAA          #CTRLK
        BRA            SFCTB1
S11     LDAA          #DROPON
        BRA            SFCTB1
S15     LDAA          #CHPON
        BRA            SFCTB1
S10     LDAA          #S_PL
        ORAA           FLAGS0
        STAA           FLAGS0
*        CLR            FCCTR
        LDAA          #PLON
        BRA            SFCTB1
S14     LDAA          #FSON
        BRA            SFCTB1
S16     LDAA          #$01     ;TURN ON MIXER1 CHAN 1.
        ORAA           MIX1    ;
        STAA           MIX1    ;
        LDAA          #RPT_ON  ;TURN ON REPATER.
        ORAA           FCTB1
        STAA           FCTB1
        JMP            SETIT
S13     LDAA           FCTB1   ;CHECK IF RMT ON.
        ANDA          #RMT_ON
        BNE            RETURN2
        LDAA           FCTB1   ;SAVE CURRENT STATE OF CONTROLLER.
        STAA           SAVEF1
        LDAA           FCTB2   ;SAVE CURRENT STATE OF CONTROLLER.
        STAA           SAVEF2
        LDAA           FCTB3   ;SAVE CURRENT STATE OF CONTROLLER.
        STAA           SAVEF3
        LDAA           FCTB4   ;SAVE CURRENT STATE OF CONTROLLER.
        STAA           SAVEF4
        LDAA           FCTB5   ;SAVE CURRENT STATE OF CONTROLLER.
        STAA           SAVEF5
        LDAA           FCTB1   ;GET FUNCTION BYTE ONE.
        ANDA          #$CF     ;REMOVE CHOPPER & FAILSAFE.
        STAA           FCTB1   ;PUT IT BACK.
        LDAA           FCTB3   ;GET RESET BEEP AND TURN OFF.
        ANDA          #$FB
        STAA           FCTB3
        LDAA          #RMT_ON
        ORAA          #RPT_ON
        ORAA           FCTB1
        STAA           FCTB1
        LDAA           FLAGS2
        ORAA          #SRMTON  ;TURN ON SEND RMT ON FLAG.
        STAA           FLAGS2
        CLR            FCCTR
        LDAA           MIX1    ;GET CURRENT MIXER CONTROL BYTE.
        ORAA          #$02     ;SET REMOTE AUDIO TO RPTR.
        STAA           MIX1
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            S13_A
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY
        BNE            S13_A
        LDX           #RMTISON
        STX            TALKX
        JSR            TALKER
S13_A   JMP            SETIT   ;TURN ON SERIAL REQ. FLAG.
KON     LDAA          #KFLTON
SFCTB1  ORAA           FCTB1
        STAA           FCTB1
        JMP            RETURN1
RETURN2 CLR            FCCTR
        JMP            RESTORE
*THIS GROUP RESETS BITS IN FCTB1.
R11     LDAA           FCTB1
        ANDA          #$FD
        BRA            RFCTB1
R15     LDAA           FCTB1
        ANDA          #$DF
        BRA            RFCTB1
R10     LDAA          #S_PL
        ORAA           FLAGS0
        STAA           FLAGS0
*        CLR            FCCTR
        LDAA           FCTB1
        ANDA          #$FE
        BRA            RFCTB1
R14     LDAA           FCTB1
        ANDA          #$EF
        BRA            RFCTB1
R13     LDAA           FCTB1   ;CHECK IF REMOTE IS ON.
        ANDA          #RMT_ON
        BEQ            RETURN2
        LDAA           SAVEF1  ;RESTORE SAVED FCTB1.
        STAA           FCTB1
        LDAA           SAVEF2  ;RESTORE SAVED FCTB2.
        STAA           FCTB2
        LDAA           SAVEF3  ;RESTORE SAVED FCTB3.
        STAA           FCTB3
        LDAA           SAVEF4  ;RESTORE SAVED FCTB4.
        STAA           FCTB4
        LDAA           SAVEF5  ;RESTORE SAVED FCTB5.
        STAA           FCTB5
        LDAA          #RMTFLG  ;TURN OFF REMOTE FLAG.
        COMA
        ANDA           FLAGS0
        STAA           FLAGS0
        LDAA          #FL5     ;TURN OFF FL5 AND FL6.
        ORAA          #FL6
        COMA
        JSR            RSTRG1
        CLR            FCCTR
        JSR            CLRMUTE ;CLEAR MUTE.RESTORE TXON.
        LDAA           FLAGS2
        ORAA          #SRMTOFF ;TURN ON SEND RMT OFF FLAG.
        STAA           FLAGS2
        CLR            FCCTR
        LDAA           MIX1    ;RESET REMOTE AUDIO TO RPTR.
        ANDA          #$FD
        STAA           MIX1
        LDAA           MIX2    ;RESET RPTR AUDIO TO REMOTE.
        ANDA          #$FE
        STAA           MIX2    ;
        JMP            SETIT   ;SET SERIAL REQ. FLAG AND RETURN.
R16     LDAA           FCTB1   ;TURN OFF REPEATER.
        ANDA          #$BF
        STAA           FCTB1   ;
        LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 1.
        ANDA          #$FE
        STAA           MIX1
        JMP            SETIT
KOFF    LDAA           FCTB1
        ANDA          #$FB
        BRA            RFCTB1
R17     LDAA           FCTB1
        ANDA          #$7F
RFCTB1  STAA           FCTB1
RETURN1 JMP            RESTORE
*
*THIS GROUP SETS BITS IN FCTB6.
S67     LDAA          #P_ID    ;
        BRA            SFCTB6  ;
S66     LDAA          #P_T7    ;
        BRA            SFCTB6  ;
S65     LDAA          #P_T6    ;
        BRA            SFCTB6  ;
S64     LDAA          #P_T5    ;
        BRA            SFCTB6  ;
S63     LDAA          #P_T4    ;
        BRA            SFCTB6  ;
S62     LDAA          #P_T3    ;
        BRA            SFCTB6  ;
S61     LDAA          #P_T2    ;
        BRA            SFCTB6  ;
S60     LDAA          #P_T1    ;
SFCTB6  ORAA           FCTB6   ;
        STAA           FCTB6   ;
        JMP            RETURN1 ;
*THIS GROUP RESETS BITS IN FCTB6.
R67     LDAA           FCTB6   ;
        ANDA          #$7F     ;
        BRA            RFCTB6  ;
R66     LDAA           FCTB6   ;
        ANDA          #$BF    ;
        BRA            RFCTB6  ;
R65     LDAA           FCTB6   ;
        ANDA          #$DF    ;
        BRA            RFCTB6  ;
R64     LDAA           FCTB6   ;
        ANDA          #$ED
        BRA            RFCTB6  ;
R63     LDAA           FCTB6   ;
        ANDA          #$F7
        BRA            RFCTB6
R62     LDAA           FCTB6
        ANDA          #$FB
        BRA            RFCTB6
R61     LDAA           FCTB6
        ANDA          #$FD
        BRA            RFCTB6
R60     LDAA           FCTB6
        ANDA          #$FE
RFCTB6  STAA           FCTB6
        JMP            RESTORE
*
FRCRST  JMP            RESTART
*
*SET BITS IN FCTB2.
*
S_20    LDAA          #NPLREQ
        ORAA           FCTB2
        STAA           FCTB2
        JMP            RESTORE
ARP     LDAA          #REST_PL ;SET AUTO RESTORE PL MODE.
        ORAA           FCTB2
        STAA           FCTB2
        JMP            RESTORE
MON     LDAA          #MUTEON  ;SET MUTE FUNCT. ON.
        ORAA           FCTB2
        STAA           FCTB2
        JMP            RESTORE
NF25    CLR            FCCTR
        JMP            RESTORE
ADJ_ON  LDAA           FCTB5   ;CHK DIAGNOSTIC MODE.
        ANDA          #DIAG
        BEQ            NF25
        LDAA          #TIMEADJ ;SET TIME ADJUST FUNCTION
        ORAA           FCTB2
        STAA           FCTB2
        JMP            LP10
*RESET BITS IN FCTB2.
R_20    LDAA           FCTB2
        ANDA          #$FE
        STAA           FCTB2
        JMP            RESTORE
PORRST  LDAA           FCTB2
        ANDA          #$7F
        STAA           FCTB2
        JMP            RESTORE
MOFF    LDAA           FCTB2
        ANDA          #$BF
        STAA           FCTB2
        JMP            RESTORE
RARP    LDAA           FCTB2
        ANDA          #$EF
        STAA           FCTB2
        JMP            RESTORE
TROCD   LDAA           FCTB2
        ORAA          #$02
        BRA            SFCTB2
RTON1   LDAA          #RTON    ;GET REMOTE TELEMETRY BIT.
        ORAA           FCTB2   ;GET FUNCTION BYTE TWO.
        BRA            SFCTB2  ;GO SET BIT.
USERA   LDAA           FCTB2   ;SET UFA.
        ORAA          #$04H
SFCTB2  STAA           FCTB2
        JMP            RESTORE
TROTD   LDAA           FCTB2
        ANDA          #$FD
        BRA            RFCTB2
RTOFF   LDAA           FCTB2   ;TURN OF REMOTE TELEMETRY.
        ANDA          #$F7
        BRA            RFCTB2
USERNA  LDAA           FCTB2
        ANDA          #$FB
RFCTB2  STAA           FCTB2
        JMP            RESTORE
RNM     JSR            INITIT  ;GO INIT EVERYTHING BUT DO NOT
        LDAA           FCTB2   ;
        ANDA          #$7F     ;TURN OFF 'P' FOR POR.
        STAA           FCTB2   ;PUT IT BACK.
        LDAA           FEAT    ;CHK FEATURE BYTE FOR DIGITALKER.
        ANDA          #V_INST
        BEQ            NO_T6   ;
        LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            NO_T6   ;
        LDX           #V_RNM   ;SAY "RESET NORMAL"
        STX            TALKX
        JSR            TALKER
        CLR            FCCTR
NO_T6   JMP            RESTORE
*
TOM1C8  LDAA          #$80     ;TURN ON MIXER 1 CHAN 8.
        BRA            SMC1
TOM1C7  LDAA          #$40     ;TURN ON MIXER 1 CHAN 7.
        BRA            SMC1
TOM1C6  LDAA          #$20     ;TURN ON MIXER 1 CHAN 6.
        BRA            SMC1
TOM1C5  LDAA          #$10     ;TURN ON MIXER 1 CHAN 5.
        BRA            SMC1
TOM1C4  LDAA          #$08     ;TURN ON MIXER 1 CHAN 4.
        BRA            SMC1
TOM1C3  LDAA          #$04     ;TURN ON MIXER 1 CHAN 3.
        BRA            SMC1
TOM1C2  LDAA          #$02     ;TURN ON MIXER 1 CHAN 2.
        BRA            SMC1
TOM1C1  LDAA          #$01     ;TURN ON MIXER 1 CHAN 1.
SMC1    ORAA           MIX1
        STAA           MIX1
        JMP            SETIT
*
TOFM1C8 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 8.
        ANDA          #$7F
        BRA            RMC1
TOFM1C7 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 7.
        ANDA          #$BF
        BRA            RMC1
TOFM1C6 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 6.
        ANDA          #$DF
        BRA            RMC1
TOFM1C5 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 5.
        ANDA          #$EF
        BRA            RMC1
TOFM1C4 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 4.
        ANDA          #$F7    ;
        BRA            RMC1    ;
TOFM1C3 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 3.
        ANDA          #$FB    ;
        BRA            RMC1    ;
TOFM1C2 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 2.
        ANDA          #$FD    ;
        BRA            RMC1    ;
TOFM1C1 LDAA           MIX1    ;TURN OFF MIXER 1 CHAN 1.
        ANDA          #$FE    ;
RMC1    STAA           MIX1    ;
        JMP            SETIT   ;
*
TOM2C8  LDAA          #$80     ;TURN ON MIXER 2 CHAN 8. *
        BRA            SMIX2   ;                        *
TOM2C7  LDAA          #$40     ;TURN ON MIXER 2 CHAN 7. *
        BRA            SMIX2   ;                        *
TOM2C6  LDAA          #$20     ;TURN ON MIXER 2 CHAN 6. *
        BRA            SMIX2   ;                        *
TOM2C5  LDAA          #$10     ;TURN ON MIXER 2 CHAN 5. *
        BRA            SMIX2   ;                        *
TOM2C4  LDAA          #$08     ;TURN ON MIXER 2 CHAN 4. *
        BRA            SMIX2   ;                        *
TOM2C3  LDAA          #$04     ;TURN ON MIXER 2 CHAN 3. *
        BRA            SMIX2   ;                        *
TOM2C2  LDAA          #$02     ;TURN ON MIXER 2 CHAN 2. *
        BRA            SMIX2   ;                        *
TOM2C1  LDAA          #$01     ;TURN ON MIXER 2 CHAN 1. *
SMIX2   ORAA           MIX2    ;                        *
        STAA           MIX2    ;                        *
        JMP            SETIT   ;                        *
*
TOFM2C8 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 8.
        ANDA          #$7F     ;
        BRA            RMIX2   ;
TOFM2C7 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 7.
        ANDA          #$BF    ;
        BRA            RMIX2   ;
TOFM2C6 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 6.
        ANDA          #$DF    ;
        BRA            RMIX2   ;
TOFM2C5 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 5.
        ANDA          #$EF    ;
        BRA            RMIX2   ;
TOFM2C4 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 4.
        ANDA          #$F7    ;
        BRA            RMIX2   ;
TOFM2C3 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 3.
        ANDA          #$FB    ;
        BRA            RMIX2   ;
TOFM2C2 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 2.
        ANDA          #$FD
        BRA            RMIX2
TOFM2C1 LDAA           MIX2    ;TURN OFF MIXER 2 CHAN 1.
        ANDA          #$FE
RMIX2   STAA           MIX2
*
SETIT   LDAA          #SERFLG  ;SET SERIAL REQUEST FLAG.
        ORAA           FLAGS0  ;
        STAA           FLAGS0  ;
        JMP            RESTORE ;RETURN FROM IRQ.
*
S_SAYF1 LDAA           FLAGS1  ;SPEAK FUNCTION BYTES 1 THRU 5.
        ORAA          #SFBFLG  ;
        STAA           FLAGS1  ;
        JMP            RESTORE ;
*
TW1     LDAA           FLAGS1  ;IF TALKING THEN WAIT.
        ANDA          #DT_BUSY ;
        BNE            TW1     ;
        RTS                    ;
*
SPK_EQ  LDX           #S_EQUAL ;SAY "EQUALS"
        STX            TALKX   ;
        JSR            TALKER  ;
        JSR            TW1     ;
        RTS
*
SPK_END LDX           #S_CEND  ;SAY "CONTROL END"
        STX            TALKX
        JSR            TALKER
        JSR            TW1
        RTS
*
SETMIX1 LDAA           FLAGS0  ;SEE IF CHOP TIME.
        ANDA          #CHPFLG  ;
        BNE            NO_SET  ;
*       LDAA           MIX1
*       ANDA          #M1C1
*       BNE            NOSRM
SMIX1   LDAA           MIX1
        ORAA          #M1C1
        STAA           MIX1
        JSR            SERDATA
NO_SET  RTS
*
RSTMIX1 LDAA           MIX1
        ANDA          #M1C1
        BEQ            NOSRM
        LDAA          #M1C1
        COMA
        ANDA           MIX1
        STAA           MIX1
        JSR            SERDATA
NOSRM   RTS
*
SETMIX8 LDAA           MIX1
        ORAA          #M1C8
        STAA           MIX1
        LDAA           MIX2
        ORAA          #M2C8
        STAA           MIX2
        JSR            SERDATA
        RTS
*
RSTMIX8 LDAA          #M1C8
        COMA
        ANDA           MIX1
        STAA           MIX1
        LDAA          #M2C8
        COMA
        ANDA           MIX2
        STAA           MIX2
        JSR            SERDATA
        RTS
*
SAY_ALL JSR            DELONE
        JSR            SETMIX8
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_1   ;SAY "1"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB1   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB1   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_2   ;SAY "2"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB2   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB2   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_3   ;SAY "3"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB3   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB3   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_4   ;SAY "4"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB4   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB4   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_5   ;SAY "5"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB5   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB5   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SAY_F   ;SAY "F"
        JSR            SAY_6   ;SAY "6"
        JSR            SPK_EQ  ;SAY "EQUALS"
        LDAA           FCTB6   ;
        ANDA          #$F0     ;
        JSR            SRCH99  ;
        LDAA           FCTB6   ;
        JSR            SRCH98  ;
        JSR            DEL_5
        JSR            SPK_END ;SAY "CONTROL END"
        LDAA          #SFBFLG
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
        JSR            RSTMIX8
        RTS
*
SRCH98  ASLA
        ASLA
        ASLA
        ASLA
        ANDA          #$F0
*
SRCH99  CMPA          #$00
        BEQ            SAY_0
        CMPA          #$10
        BEQ            SAY_1
        CMPA          #$20
        BEQ            SAY_2
        CMPA          #$30
        BEQ            SAY_3
        CMPA          #$40
        BEQ            SAY_4
        CMPA          #$50
        BEQ            SAY_5
        CMPA          #$60
        BEQ            SAY_6
        CMPA          #$70
        BEQ            SAY_7
        CMPA          #$80
        BEQ            SAY_8
        CMPA          #$90
        BEQ            SAY_9
        CMPA          #$A0
        BEQ            SAY_A
        CMPA          #$B0
        BEQ            SAY_B
        CMPA          #$C0
        BEQ            SAY_C
        CMPA          #$D0
        BEQ            SAY_D
        CMPA          #$E0
        BEQ            SAY_E
        CMPA          #$F0
        BEQ            SAY_F
        JMP            RESTART
*
SAY_0   LDX           #S_ZERO  ;SAY " 0 "
        BRA            SAYFB   ;
SAY_1   LDX           #S_ONE   ;SAY " 1 "
        BRA            SAYFB   ;
SAY_2   LDX           #S_TWO   ;SAY " 2 "
        BRA            SAYFB   ;
SAY_3   LDX           #S_THREE ;SAY " 3 "
        BRA            SAYFB   ;
SAY_4   LDX           #S_FOUR  ;SAY " 4 "
        BRA            SAYFB   ;
SAY_5   LDX           #S_FIVE  ;SAY " 5 "
        BRA            SAYFB   ;
SAY_6   LDX           #S_SIX   ;SAY " 6 "
        BRA            SAYFB   ;
SAY_7   LDX           #S_SEVEN ;SAY " 7 "
        BRA            SAYFB   ;
SAY_8   LDX           #S_EIGHT ;SAY " 8 "
        BRA            SAYFB   ;
SAY_9   LDX           #S_NINE  ;SAY " 9 "
        BRA            SAYFB   ;
SAY_A   LDX           #S_AA    ;SAY " A "
        BRA            SAYFB   ;
SAY_B   LDX           #S_BB    ;SAY " B "
        BRA            SAYFB   ;
SAY_C   LDX           #S_CC    ;SAY " C "
        BRA            SAYFB   ;
SAY_D   LDX           #S_DD    ;SAY " D "
        BRA            SAYFB   ;
SAY_E   LDX           #S_EE    ;SAY " E "
        BRA            SAYFB   ;
SAY_F   LDX           #S_FF    ;SAY " F "
*
SAYFB   LDAA           FLAGS1  ;CHECK FOR TALKER BUSY.
        ANDA          #DT_BUSY ;
        BNE            NSAYNOW ;
        STX            TALKX
        JSR            TALKER
        JSR            TW1
        LDAA          #CNTFLG
        COMA
        ANDA           FLAGS1
        STAA           FLAGS1
NSAYNOW RTS
*
TFR5MIN  LDX           #0300     ;5 MINUTES.
OFFSET   STX            OFFTIME
         LDAA           FCTB1    ;TURN OFF REPEATER.
         ANDA          #$BF
         STAA           FCTB1
         LDAA           FLAGS3
         ORAA          #RPTR_OFF ;TURN ON OFF TIMER FLAG.
         STAA           FLAGS3
         CLR            FCCTR
         JMP            RESTORE
*
CHKSUM1 JSR     CHKSUM
        JMP     RESTORE
*
        ORG     $FFF8
*
MI      FDB     IRQ
SOFT    FDB     RESTART
NMI     FDB     TIMERTN
RESET   FDB     RESTART
*
        ORG     $FFF0
*
FILL2   FDB     $FFFF,$FFFF,$FFFF,$FFFF
        END
