✎ Edit mode on — click any annotation cell to edit it.
Assembly
Pseudo-code / Annotation
************************************************************************************
bit correct disassembly of EPROM dump
LAB_00 = $00 ; alternate stack pointer
LAB_01 = $01 ; RAM size
byt value
--- -----
$00 32K
$01 64K
$02 160K
LAB_02 = $02 ; RAM end low byte
LAB_03 = $03 ; RAM end high byte
LAB_04 = $04 ; RAM size low byte
LAB_05 = $05 ; RAM size high byte
LAB_06 = $06 ; ?? buffer write index
LAB_07 = $07 ; ?? buffer read index
LAB_08 = $08 ; Tx buffer write index
LAB_09 = $09 ; Tx buffer read index
LAB_0A = $0A ; command loop flag, ??
bit function
--- --------
7-2 x = unused
1 1 = dial an outgoing number
0 1 = return to the main loop
LAB_0B = $0B ; partial low byte
LAB_0C = $0C ; partial high byte
LAB_0D = $0D ; multiplicand low byte
LAB_0E = $0E ; multiplicand high byte
LAB_0F = $0F ; multiplier low byte
LAB_10 = $10 ; multiplier high byte
LAB_11 = $11 ; A2D channel 0 byte
LAB_12 = $12 ; A2D channel 1 byte
LAB_13 = $13 ; A2D channel 2 byte
LAB_14 = $14 ; A2D channel 3 byte
LAB_15 = $15 ;..
LAB_16 = $16 ;..
LAB_17 = $17 ;..
LAB_18 = $18 ; ABS(A2D(0 - 3))
LAB_19 = $19 ; ABS(A2D(1 - 3))
LAB_1A = $1A ; 1/8th second countdown byte
LAB_1B = $1B ; seconds countdown
LAB_1C = $1C ; digit to dial
LAB_1D = $1D ; pulse count
LAB_1E = $1E ; digits value
byt value
--- -----
$00 auto
$01 pulse
$02 dtmf
$03 mixed
LAB_1F = $1F ; pulses value
byt value
--- -----
$00 rev
$01 spm16
$02 spm
$03 xspm
$04 m+
$05 m-
LAB_20 = $20 ; VThreshold value
LAB_21 = $21 ; TSeized value
LAB_22 = $22 ; TPulse value
LAB_23 = $23 ; TDial value
LAB_24 = $24 ; rvs value
byt value
--- -----
$00 off
$01 on
LAB_25 = $25 ; ECall value
byt value
--- -----
$00 off
$01 on
LAB_26 = $26 ; park value
byt value
--- -----
$00 off
$01 txe
$02 rev
LAB_27 = $27 ;..
LAB_28 = $28 ;..
LAB_29 = $29 ;..
LAB_2A = $2A ;..
LAB_2B = $2B ;..
LAB_2C = $2C ;..
LAB_2D = $2D ;..
LAB_36 = $36 ; meter value low byte
LAB_37 = $37 ; meter value mid byte
LAB_38 = $38 ; meter value high byte
LAB_39 = $39 ; ?? low byte
LAB_3A = $3A ; ?? high byte
LAB_3B = $3B ; ?? low byte
LAB_3C = $3C ; ?? high byte
LAB_3D = $3D ;..
LAB_3E = $3E ;..
LAB_3F = $3F ;..
LAB_40 = $40 ;.
LAB_41 = $41 ;.
LAB_42 = $42 ;.
LAB_43 = $43 ;.
LAB_44 = $44 ;.
LAB_45 = $45 ;.
LAB_46 = $46 ;.
LAB_47 = $47 ; port 1 last read value
LAB_48 = $48 ;.
LAB_49 = $49 ;.
LAB_4A = $4A ; dialed number buffer index
LAB_4B = $4B ; timer 1 countdown byte
LAB_4C = $4C ;.
LAB_4D = $4D ; seconds countdown word low byte
LAB_4E = $4E ; seconds countdown word high byte
LAB_4F = $4F ; integer part of VThreshold * 2.277
LAB_50 = $50 ;.
LAB_51 = $51 ;.
LAB_52 = $52 ;.
LAB_53 = $53 ;.
LAB_54 = $54 ; buffered record length
LAB_55 = $55 ;.
LAB_56 = $56 ;.
LAB_57 = $57 ;.
LAB_58 = $58 ; record metered units low byte
LAB_59 = $59 ; record metered units high byte
LAB_5A = $5A ;.
LAB_5B = $5B ;.
LAB_5C = $5C ;.
LAB_5D = $5D ;.
LAB_5E = $5E ; carrier detect
LAB_5F = $5F ; max year + 1
LAB_60 = $60 ; max month + 1
LAB_61 = $61 ; max date +1
LAB_62 = $62 ; max hour + 1
LAB_63 = $63 ; max minute + 1
LAB_64 = $64 ; max second + 1
LAB_65 = $65 ; max part second + 1
LAB_66 = $66 ; current year
LAB_67 = $67 ; current month
LAB_68 = $68 ; current date
LAB_69 = $69 ; current hour
LAB_6A = $6A ; current minute
LAB_6B = $6B ; current second
LAB_6C = $6C ; current 1/100ths of seconds
LAB_6D = $6D ; current 1/8th seconds count
LAB_6E = $6E ;.
LAB_6F = $6F ;.
LAB_70 = $70 ;.
LAB_71 = $71 ;.
LAB_72 = $72 ;.
LAB_73 = $73 ;.
LAB_74 = $74 ;.
LAB_75 = $75 ;.
LAB_76 = $76 ;.
LAB_77 = $77 ;.
LAB_78 = $78 ;.
LAB_79 = $79 ;.
LAB_7A = $7A ;.
LAB_7B = $7B ;.
LAB_7C = $7C ;.
LAB_7D = $7D ;.
LAB_7E = $7E ;.
LAB_7F = $7F ; timer 2 value
LAB_80 = $80 ; prescaller 2 value
LAB_81 = $81 ;.
LAB_82 = $82 ;.
LAB_83 = $83 ;.
LAB_84 = $84 ;.
LAB_85 = $85 ;.
LAB_86 = $86 ;.
LAB_88 = $88 ;.
LAB_8A = $8A ;.
LAB_8C = $8C ;.
LAB_8D = $8D ;.
LAB_8E = $8E ;.
LAB_8F = $8F ;.
LAB_90 = $90 ; record RAM pointer low byte
LAB_91 = $91 ; record RAM pointer high byte
LAB_92 = $92 ; record memory start pointer low byte
LAB_93 = $93 ; record memory start pointer mid byte
LAB_94 = $94 ; record memory start pointer high byte
LAB_95 = $95 ; record memory end pointer low byte
LAB_96 = $96 ; record memory end pointer mid byte
LAB_97 = $97 ; record memory end pointer high byte
LAB_98 = $98 ;.
LAB_99 = $99 ;.
LAB_9A = $9A ;.
LAB_9B = $9B ;.
LAB_9C = $9C ;.
LAB_9D = $9D ;.
LAB_9E = $9E ;.
LAB_9F = $9F ;.
LAB_A0 = $A0 ;.
LAB_A1 = $A1 ; next record pointer low byte
LAB_A2 = $A2 ; next record pointer mid byte
LAB_A3 = $A3 ; next record pointer high byte
LAB_A4 = $A4 ;.
************************************************************************************
internal hardware
LAB_DC = $DC ; prescaller 1
LAB_DD = $DD ; timer 1
LAB_DE = $DE ; prescaller 2
LAB_DF = $DF ; timer 2
LAB_E4 = $E4 ; UART Tx shift register
LAB_E5 = $E5 ; UART Rx buffer register
LAB_E6 = $E6 ; UART control register
bit function
--- --------
7 {1|0} = Rx {enabled|disabled}
6 {1|0} = Tx {enabled|disabled}
5 x = unused
4 {1|0} = Rx interrupt {enabled|disabled}
3 {1|0} = {Xin/32|Xin/8}
2 {1|0} = {odd|even} parity
1 {1|0} = parity {enabled|disabled}
0 {1|0} = {8|7} bit
LAB_E7 = $E7 ; UART status register
bit function
--- --------
7 x = unused
6 x = unused
5 x = unused
4 overrun error
3 framing
2 parity
1 Tx complete
0 Rx interrupt
LAB_E9 = $E9 ; A2D control register
LAB_EA = $EA ; A2D register
LAB_EE = $EE ; port 3 data register
LAB_EF = $EF ; port 3 data direction register
LAB_F0 = $F0 ; port 2 data register
bit function
--- --------
7 ring detect
6 podem power control
5 modem mode, 1/0 originate/answer ??
4 0 = carrier detect from modem
3 modem/RS232 select
2-0 unused ??
LAB_F1 = $F1 ; port 2 data direction register
LAB_F3 = $F3 ; port 1 data register
bit function
--- --------
7 ??
6 vref power control
5 MT8870 power control
4 DTMF tone valid
3-0 DTMF tone vaue
LAB_F4 = $F4 ; port 1 data direction register
LAB_F5 = $F5 ; port 0 function register
bit function
--- --------
7 unused
6 {1|0} = b6 = {TxD|b6}
5 {1|0} = b5 = {DME|b5}
4 {1|0} = b4 = {STB|b4}
3 {1|0} = b3 = {BUST|b3}
2 {1|0} = b2 = {CNTR|b2}
1-0 unused
LAB_F6 = $F6 ; port 0 data register
bit function
--- --------
7-5 unused ??
4 RAM A16
3-0 unused ??
LAB_F7 = $F7 ; port 0 data direction register
LAB_FB = $FB ; BAUD rate generator
LAB_FD = $FD ; interrupt control register 3
LAB_FE = $FE ; interrupt control register 2
LAB_FF = $FF ; interrupt control register 1
************************************************************************************
RAM use
LAB_00FF = $FF ;.
LAB_0000 = $0000 ;.
LAB_0011 = $0011 ;.
LAB_006E = $006E ;.
LAB_0100 = $0100 ; bottom of the stack
LAB_017E = $017E ;.
LAB_017F = $017F ;.
LAB_0188 = $0188 ;.
LAB_0200 = $0200 ;.
LAB_0202 = $0202 ;.
LAB_0204 = $0204 ;.
LAB_0206 = $0206 ;.
LAB_0208 = $0208 ;.
LAB_020A = $020A ;.
LAB_020B = $020B ;.
LAB_020C = $020C ; RAM start low byte
LAB_020D = $020D ; RAM start high byte
LAB_020E = $020E ;.
LAB_0210 = $0210 ;.
LAB_0212 = $0212 ;.
LAB_0214 = $0214 ;.
LAB_0216 = $0216 ;.
LAB_0218 = $0218 ;.
LAB_021A = $021A ;.
LAB_021C = $021C ;.
LAB_021E = $021E ;.
LAB_0220 = $0220 ;.
LAB_0222 = $0222 ;.
LAB_0224 = $0224 ;.
LAB_0226 = $0226 ;.
LAB_0228 = $0228 ;.
LAB_022A = $022A ;.
LAB_022C = $022C ;.
LAB_022E = $022E ;.
LAB_0230 = $0230 ;.
LAB_0232 = $0232 ;.
LAB_0233 = $0233 ;.
LAB_0234 = $0234 ;.
LAB_0235 = $0235 ;.
LAB_0236 = $0236 ;.
LAB_0237 = $0237 ;.
LAB_0238 = $0238 ;.
LAB_0239 = $0239 ;.
LAB_023A = $023A ; BAUD rate generator value
LAB_023B = $023B ; timer 2 value
LAB_023C = $023C ; prescaller 2 value
LAB_023D = $023D ; BAUD rate generator value
LAB_023E = $023E ; timer 2 value
LAB_023F = $023F ; prescaller 2 value
LAB_0240 = $0240 ; command vector table
LAB_0280 = $0280 ;.
LAB_0380 = $0380 ;.
LAB_0386 = $0386 ;.
LAB_0396 = $0396 ;.
LAB_03A6 = $03A6 ; to $05B5 ??, password
LAB_03B6 = $03B6 ; ringback number buffer, to $03C5
LAB_03C6 = $03C6 ;.
LAB_0402 = $0402 ;.
LAB_04FC = $04FC ; GMT/BST change date/time
LAB_0503 = $0503 ; new GMT/BST date/time
LAB_050A = $050A ; ?? date/time byte
LAB_0511 = $0511 ; ?? date/time byte
LAB_0518 = $0518 ; ?? date/time byte
LAB_051F = $051F ;.
LAB_0520 = $0520 ;.
LAB_0521 = $0521 ;.
LAB_0522 = $0522 ;.
LAB_0523 = $0523 ;.
LAB_0524 = $0524 ;.
LAB_0526 = $0526 ;.
LAB_0527 = $0527 ;.
LAB_0528 = $0528 ;.
LAB_0529 = $0529 ;.
LAB_052A = $052A ;.
LAB_052B = $052B ;.
LAB_052C = $052C ;.
LAB_052D = $052D ;.
LAB_052E = $052E ;.
LAB_0538 = $0538 ;.
LAB_0539 = $0539 ;.
LAB_053A = $053A ;.
LAB_053B = $053B ;.
LAB_053C = $053C ;.
LAB_053D = $053D ;.
LAB_053E = $053E ;.
LAB_053F = $053F ;.
LAB_0541 = $0541 ;.
LAB_0542 = $0542 ;.
LAB_0543 = $0543 ;.
LAB_0544 = $0544 ;.
LAB_0545 = $0545 ;.
LAB_0546 = $0546 ;.
LAB_0639 = $0639 ;.
LAB_063A = $063A ;.
LAB_063B = $063B ;.
LAB_063E = $063E ;.
LAB_063F = $063F ;.
LAB_0640 = $0640 ;.
LAB_0641 = $0641 ;.
LAB_0739 = $0739 ; ?? year/month
LAB_073A = $073A ; ?? month/date
LAB_073B = $073B ; ?? hours/minutes
LAB_073C = $073C ; ?? minutes/seconds
LAB_073D = $073D ; ?? seconds low bit
LAB_073E = $073E ; ?? year/month
LAB_073F = $073F ; ?? month/date
LAB_0740 = $0740 ; ?? hours/minutes
LAB_0741 = $0741 ; ?? minutes/seconds
LAB_0742 = $0742 ; ?? seconds low bit
LAB_0743 = $0743 ;.
LAB_0744 = $0744 ;.
LAB_0745 = $0745 ;.
LAB_0746 = $0746 ;.
LAB_0747 = $0747 ;.
LAB_0748 = $0748 ;.
LAB_0749 = $0749 ;.
LAB_074A = $074A ;.
LAB_074B = $074B ;.
LAB_074C = $074C ;.
LAB_074D = $074D ; buffered record year/month
LAB_074E = $074E ; buffered record month/date
LAB_074F = $074F ; buffered record hours/minutes
LAB_0750 = $0750 ; buffered record minutes/seconds
LAB_0751 = $0751 ;..
LAB_0752 = $0752 ;..
LAB_0753 = $0753 ;..
LAB_0754 = $0754 ;..
LAB_0755 = $0755 ;..
LAB_0756 = $0756 ; buffered record number to $078A max
LAB_078B = $078B ;.
LAB_078C = $078C ;.
LAB_078D = $078D ;.
LAB_078E = $078E ;.
LAB_078F = $078F ;.
LAB_0790 = $0790 ;.
LAB_0794 = $0794 ;.
.ORG$E000
************************************************************************************
command $00 return string
LAB_E000: ; $E000
.WORD$55BCserial number
.WORD$0082version number
.WORD$0001?? number
************************************************************************************
copied to LAB_1E onward
LAB_E006: ; $E006
.BYTE$00digits default value
.BYTE$00pulses default value
.BYTE$28VThreshold default value
.BYTE$05TSeized default value
.BYTE$04TPulse default value
.BYTE$15TDial default value
.BYTE$01rvs default value
.BYTE$00ECall default value
.BYTE$00park default value
.BYTE$00.
.BYTE$05.
.BYTE$03.
.BYTE$20.
.BYTE$14.
.BYTE$3C.
.BYTE$18.
.BYTE$00.
.BYTE$00.
.BYTE$00.
.BYTE$00.
.BYTE$00.
.BYTE$00.
.BYTE$00.
.BYTE$00.
************************************************************************************
command vector table
LAB_E01E: ; $E01E
.WORDLAB_E2E0return serial#, version#, ??#, RAM size and ??
.WORDLAB_E30Dreturn or set the variables
.WORDLAB_E32C.
.WORDLAB_E342.
.WORDLAB_E358return or set the date/time
.WORDLAB_E388return or set the BST/GMT change date/time
.WORDLAB_E39E.
.WORDLAB_E3ACget the current time/date
.WORDLAB_E3D2return or set the password
.WORDLAB_E3E2.
.WORDLAB_E408return or set the metered units
.WORDLAB_E418.
.WORDLAB_E428.
.WORDLAB_E431return the metered units
.WORDLAB_E440reload vector table(s)
.WORDLAB_E458return the checksum of count bytes from address
.WORDLAB_E4A2write memory bytes
.WORDLAB_E4C0read memory bytes
.WORDLAB_E4E3execute code from address
.WORDLAB_E4EE.
.WORDLAB_E501.
.WORDLAB_E674.
.WORDLAB_E592download ??
.WORDLAB_E5A6.
.WORDLAB_E5AD.
.WORDLAB_E5BB.
.WORDLAB_E5E7.
.WORDLAB_E5EC.
.WORDLAB_E674.
.WORDLAB_E674.
.WORDLAB_E5F2return or set and dial the ringback number
.WORDLAB_E66F.
************************************************************************************
copy the command vector table to RAM
LAB_E05E: ; $E05E
LDX#LAB_E05E-LAB_E01E
set the byte count
LDY#$00clear the index
LAB_E062: ; $E062
LDALAB_E01E,Yget a command vector byte
STALAB_0240,Ysave it to RAM
INYincrement the index
DEXdecrement the count
BNELAB_E062loop if more to do
RTS
************************************************************************************
copy vectors from AY to LAB_0200, A = low byte, Y = high byte, X = byte count
LAB_E06D: ; $E06D
STALAB_74save the source pointer low byte
STYLAB_75save the source pointer high byte
PHPsave the processor status
SEIdisable interrupts
LDY#$00clear the index
LAB_E075: ; $E075
LDA(LAB_74),Yget a table byte
STALAB_0200,Ysave a vector byte
INYincrement the index
DEXdecrement the count
BNELAB_E075loop if more to do
PLPrestore the processor status
NOPwaste two cycles
RTS
************************************************************************************
RAM size ??
LAB_E081: ; $E081
.WORD$0200.
.WORD$0280.
.WORD$0400.
************************************************************************************
test the RAM ??
LAB_E087: ; $E087
LDY#$00clear the index
STYLAB_74clear the RAM test pointer low byte
STYLAB_75clear the RAM test pointer high byte
CLB4,LAB_F6clear b4 port 0 data register, clear RAM A16
SEB5,LAB_F5set b5 port 0 function register, port 0 b5 = DME
LDA#$AAset the first test byte
STA(LAB_74),Ysave the $AA to $0xxxx
SEB4,LAB_F6set b4 port 0 data register, set RAM A16
LSRAmake $AA into $55
STA(LAB_74),Ysave the $55 to $1xxxx
CLB4,LAB_F6clear b4 port 0 data register, clear RAM A16
LDA(LAB_74),Yread $0xxxx
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
LDX#$02set 160K
CMP#$AAcompare the read byte with $AA
BEQLAB_E0ACif the byte is $AA memory is 160K so go use it
DEXdecrement the size to 64K
CMP#$55compare the read byte with $55
BEQLAB_E0ACif the byte is $55 memory is 64K so go use it
DEXelse decrement the size to 32K
LAB_E0AC: ; $E0AC
STXLAB_01save the RAM size
TXAcopy it
ASLA* 2
TAYback to the index
LDALAB_E081,Yget the RAM end low byte
LDXLAB_E081+1,Yget the RAM end high byte
STALAB_02save the RAM end low byte
STXLAB_03save the RAM end high byte
RTS
************************************************************************************
calculate the RAM size ??
LAB_E0BC: ; $E0BC
SECset carry for subtract
LDALAB_02get the RAM end low byte
SBCLAB_020Csubtract the RAM start low byte
STALAB_04save the RAM size low byte
LDALAB_03get the RAM end high byte
SBCLAB_020Dsubtract the RAM start high byte
STALAB_05save the RAM size high byte
RTS
************************************************************************************
??
LAB_E0CC: ; $E0CC
LDALAB_020A.
LDYLAB_020B.
STALAB_017E.
STYLAB_017F.
LDM#$7A,LAB_00set the alternate stack pointer
RTS
************************************************************************************
does nothing, just returns
LAB_E0DC: ; $E0DC
RTS
************************************************************************************
copied to LAB_0200 onward
LAB_E0DD: ; $E0DD
.WORDLAB_F68ETC, CNTR or BRK interrupt, does RESET
.WORDLAB_EC76HE or VE interrupt
.WORDLAB_E9F2timer 1 or timer 2interrupt
.WORDLAB_E927RI or INT1 interrupt
.WORDLAB_E852INT2, 1/8th second interrupt
.WORDLAB_ECB2unused ??
.WORDLAB_0188RAM start ??
.WORDLAB_00FFunused ??
$0210
.WORDLAB_E0DCdoes nothing, just returns
.WORDLAB_E0DCdoes nothing, just returns
.WORDLAB_E0DCdoes nothing, just returns
.WORDLAB_E0DCdoes nothing, just returns
.WORDLAB_E189wait for a character from ??
.WORDLAB_E159put a byte in the Tx buffer
.WORDLAB_E216receive and execute a command ??
.WORDLAB_E138unused ??
$0220
.WORDLAB_ED09.
.WORDLAB_ED38.
.WORDLAB_EDEE.
.WORDLAB_EF63.
.WORDLAB_EFA6.
.WORDLAB_EFCF.
.WORDLAB_E0DCdoes nothing, just returns
.WORDLAB_E0DCdoes nothing, just returns
$0230
.WORDLAB_E0DCdoes nothing, just returns
.BYTE$1E.$0232
.BYTE$C8.$0233
.BYTE$1E.$0234
.BYTE$40.$0235
.BYTE$32.$0236
.BYTE$14.$0237
.BYTE$12.$0238
.BYTE$04.$0239
.BYTE$BF.$023A BAUD rate generator value
sets (1/8) * (1/(191+1)) * (1/16) baud
this will be 300 BAUD with a 7.3728MHz XTAL
.BYTE$BF.$023B timer 2 value, 36.67ms
.BYTE$57.$023C prescaller 2 value
sets (1/(87+1)) * (1/16) Hz
this will be 5236 Hz with a 7.3728MHz XTAL
.BYTE$05.$023D BAUD rate generator value
sets (1/8) * (1/(5+1)) * (1/16) baud
this will be 9600 BAUD with a 7.3728MHz XTAL
.BYTE$05.$023E timer 2 value, 1.15ms
.BYTE$57.$023F prescaller 2 value
sets (1/(87+1)) * (1/16) Hz
this will be 5236 Hz with a 7.3728MHz XTAL
************************************************************************************
??
LAB_E11D: ; $E11D
.WORDLAB_F68ETC, CNTR or BRK interrupt, does RESET
.WORDLAB_EC76HE or VE interrupt
.WORDLAB_E9D1timer 1 or timer 2 interrupt
.WORDLAB_E927RI or INT1 interrupt
.WORDLAB_E7C0INT2, 1/8th second interrupt
.WORDLAB_ECB9unused ??
.WORDLAB_0188unused ??
.WORDLAB_0000unused ??
************************************************************************************
copy the vector table and values from LAB_E0DD
LAB_E12D: ; $E12D
LDA#>LAB_E0DD?? pointer low byte
LDY#<LAB_E0DD?? pointer high byte
LDX#LAB_E11D-LAB_E0DD
set the byte count
BRALAB_E13E.
************************************************************************************
copy the vector tablesand values from from LAB_E0DD and LAB_E11D
LAB_E135: ; $E135
JSRLAB_E12Dcopy the vector table and values from LAB_E0DD
LAB_E138: ; $E138
LDA#>LAB_E11D?? pointer low byte
LDY#<LAB_E11D?? pointer high byte
LDX#$10.
LAB_E13E: ; $E13E
JSRLAB_E06Dcopy vectors from AY to LAB_0200,
A = low byte, Y = high byte, X = byte count
JSRLAB_E0BCcalculate the RAM size ??
JSRLAB_F42F.
JSRLAB_E0CC.
JSRLAB_E05Ecopy the command vector table to RAM
RTS
************************************************************************************
copy the default variable values to RAM
LAB_E14E: ; $E14E
LDX#$17set the count/index
LAB_E150: ; $E150
LDALAB_E006,Xget a default value
STALAB_1E,Xsave it to RAM
DEXdecrement the count/index
BPLLAB_E150loop if more to do
RTS
************************************************************************************
put a byte in the Tx buffer
LAB_E159: ; $E159
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
TSXcopy the stack pointer
LDALAB_0100+3,Xget the saved character
LDXLAB_08get the Tx buffer write index
INXincrement it
CPX#$06compare it with max + 1
BCCLAB_E176if less go use it
LDX#$00else wrap it to zero
BRALAB_E176go use it
LAB_E16D: ; $E16D
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
TSTLAB_5Etest the carrier detect
BEQLAB_E183if no carrier just exit
BBS7,LAB_F0,LAB_E183test b7 port 2 data register, ring detect
if ring detected just exit
LAB_E176: ; $E176
CPXLAB_09compare the incremented write index with the read index
BEQLAB_E16Dif the same go wait for a byte to be sent
LDYLAB_08get the Tx buffer write index
STALAB_0380,Ywrite the character to the Tx buffer
STXLAB_08save the updated Tx buffer write index
SEB2,LAB_FEand set the timer 2 interrupt enable bit
LAB_E183: ; $E183
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTS
************************************************************************************
wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
LAB_E189: ; $E189
PHAmake room on the stack for the character
TXAcopy X
PHAsave X
LDM#$04,LAB_1Aset the 1/8th second countdown byte
LDXLAB_07get the ?? buffer read index
BRALAB_E1A4branch into the loop
LAB_E193: ; $E193
TSTLAB_5Etest the carrier detect
BEQLAB_E1B7if no carrier go do error exit
BBS7,LAB_F0,LAB_E1B7test b7 port 2 data register, ring detect
if ring detected go do error return
TSTLAB_1Btest the seconds countdown
BEQLAB_E1B7if counted out go return no carrier
TSTLAB_1Atest the 1/8th second countdown byte
BEQLAB_E1BAif 1/2 second counted out go do null return
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
LAB_E1A4: ; $E1A4
CPXLAB_06compare it with the ?? buffer write index
BEQLAB_E193if the buffer is empty just loop
LDALAB_0280,Xget a character from the ?? buffer
INCLAB_07increment the ?? buffer read index
TSXcopy the stack pointer
STALAB_0100+2,Xsave the character to the stack
PLApull X
TAXrestore X
PLApull the character
CLVflag no timeout
CLCflag carrier
RTS
LAB_E1B7: ; $E1B7
SECflag no carrier
BRALAB_E1BBgo return the error
LAB_E1BA: ; $E1BA
CLCflag carrier
LAB_E1BB: ; $E1BB
BITLAB_E1C1set Vb, flag timeout
PLApull X
TAXrestore X
PLApull the character
LAB_E1C1: ; $E1C1
RTS
************************************************************************************
if ?? put a byte in the Tx buffer ??
LAB_E1C2: ; $E1C2
TSTLAB_1Atest the 1/8th second countdown byte
BNELAB_E1D1if not counted out just exit
LDALAB_09get the Tx buffer read index
EORLAB_08compare it with the Tx buffer write index
BNELAB_E1D1.
JSR\LAB_FF27put a byte in the Tx buffer
************************************************************************************
set 1/4 second countdown
LAB_E1CE: ; $E1CE
LDM#$02,LAB_1Aset the 1/8th second countdown byte
LAB_E1D1: ; $E1D1
RTS
************************************************************************************
receive a command record
return Cb = 1 if no carrier or ring
return Vb = 1 if timed out
return Zb = 1 if ok
[count][command][byte...][checksum]
LAB_E1D2: ; $E1D2
LDX#$00clear the Rx length
LAB_E1D4: ; $E1D4
JSR\LAB_FF24wait for a character from ??
BCSLAB_E1F4if no carrier or ring just exit
BVSLAB_E1D4if 1/2 second counted go wait some more
STALAB_76save the byte to the checksum
TAYcopy the byte count
LAB_E1DD: ; $E1DD
JSR\LAB_FF24wait for a character from ??
BVSLAB_E1F4if 1/2 second counted just exit
STALAB_0538,Xsave the byte to the command buffer
ADCLAB_76add the checksum byte, Cb /should/ be clear here
STALAB_76save the checksum byte
INXincrement the received byte count
DEYdecrement the expected byte count
BNELAB_E1DDloop if more to do
STXLAB_77save the received byte count
JSR\LAB_FF24wait for a character from ??
EORLAB_76compare it with the checksum
EOR#$55.
LAB_E1F4: ; $E1F4
RTS
************************************************************************************
send the command result ??
result type in A
result byte count in X
result pointer in LAB-78/79
[count][type][byte...][checksum]
LAB_E1F5: ; $E1F5
PHAsave the result type
INXadjust the byte count for the loop type
TXAcopy the byte count
STALAB_76save the byte to the checksum
JSR\LAB_FF27put a byte in the Tx buffer
PLApull the result type
LDY#$00clear the result index
BRALAB_E204go Tx the result type
LAB_E201: ; $E201
LDA(LAB_78),Yget a result byte
INYincrement the result index
LAB_E204: ; $E204
JSR\LAB_FF27put a byte in the Tx buffer
CLCclear carry for add
ADCLAB_76add the checksum byte
STALAB_76save the checksum byte
DEXdecrement the byte count
BNELAB_E201loop if more to do
LDALAB_76get the checksum byte
EOR#$AA.
JSR\LAB_FF27put a byte in the Tx buffer
CLCflag ok
RTS
************************************************************************************
receive and execute a command ??
LAB_E216: ; $E216
LDM#$00,LAB_0Aclear the command loop flag, ??
JSRLAB_E1D2receive a command record
return Cb = 1 if no carrier or ring
return Vb = 1 if timed out
return Zb = 1 if ok
BCSLAB_E260if no carrier or ring detected just exit
BVSLAB_E24Eif timed out go ??
BNELAB_E24Eif checksum error go ??
LDALAB_0538get the command byte
ASLA* 2
TAXcopy to the index
LDA#$F3default to result type $F3, command out of range
CPX#$40compare the index with max + 1
BCSLAB_E256if > max go return command out of range
LDYLAB_0240,Xget the command vector low byte
STYLAB_78save the command vector low byte
LDYLAB_0240+1,Xget the command vector high byte
STYLAB_79save the command vector high byte
LDY#$00.
LDXLAB_77get the received byte count
DEX- 1 gives the command payload
CPX#$01compare the byte count with $01,
sets Cb if there are any payload bytes
CLVclear the returned type flag
JSR(LAB_78)go do the command
BCSLAB_E252if error go do the command error exit
STALAB_78save the result pointer low byte
STYLAB_79save the result pointer high byte
LDA#$00return command ok
LDM#$FF,LAB_1Bset the seconds countdown to 255 seconds
BRALAB_E258go send the command result
LAB_E24E: ; $E24E
LDA#$FFreturn checksum error
BRALAB_E256go clear the byte count and return the type
the command returned an error
LAB_E252: ; $E252
BVSLAB_E256if Vb is set use the returned type in A
LDA#$FEelse return command error
LAB_E256: ; $E256
LDX#$00clear the returned byte count
LAB_E258: ; $E258
JSRLAB_E1F5send the command result, always clears Cb ??
result type in A
result byte count in X
result pointer in LAB-78/79
TSTLAB_0Atest the command loop flag
BEQLAB_E260if not set just exit
SECelse flag command loop exit
LAB_E260: ; $E260
RTS
************************************************************************************
copy a return message from AY to RAM
LAB_E261: ; $E261
STALAB_7Asave the pointer low byte
STYLAB_7Bsave the pointer high byte
LDY#$00clear the index
LAB_E267: ; $E267
LDA(LAB_7A),Yread a return byte
STALAB_0639,Ycopy it to RAM
INYincrement the index
DEXdecrement the count
BNELAB_E267loop if more to do
TYAcopy the byte count ..
TAX.. to X
LDA#>LAB_0639set the pointer low byte
LDY#<LAB_0639set the pointer high byte
CLCflag ok
RTS
************************************************************************************
copy X bytes from LAB_0539 to AY if Zb = 1 ??
LAB_E278: ; $E278
SECset Cb so it will only copy if Zb = 1
************************************************************************************
copy X bytes from LAB_0539 to AY ??
LAB_E279: ; $E279
BEQLAB_E27D.
BCSLAB_E290.
LAB_E27D: ; $E27D
PHPsave the zero status
STALAB_7Aset the destination pointer low byte
STYLAB_7Bset the destination pointer high byte
LDY#$00clear the index
LAB_E284: ; $E284
LDALAB_0539,Y.
STA(LAB_7A),Y.
INYincrement the index
DEXdecrement the count
BNELAB_E284loop if more to do
PLPrestore the zero status
NOPwaste cycles
CLCflag ok
LAB_E290: ; $E290
RTS
************************************************************************************
copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
LAB_E291: ; $E291
JSRLAB_E279copy X bytes from LAB_0539 to AY ??
BCSLAB_E29Bif error just exit
BEQLAB_E29Bif = to max length just exit
TXAclear A
STA(LAB_7A),Yclear the following byte
LAB_E29B: ; $E29B
RTS
************************************************************************************
search for null in X bytes at AY ??
return the index/count in Y
LAB_E29C: ; $E29C
STALAB_7Asave the pointer low byte
STYLAB_7Bsave the pointer high byte
LDY#$00clear the index/count
LAB_E2A2: ; $E2A2
LDA(LAB_7A),Yget a byte
BEQLAB_E2AAif null go return the count
INYincrement the index/count
DEXdecrement the count
BNELAB_E2A2loop if more to do
LAB_E2AA: ; $E2AA
TYAcopy the count ..
TAX.. to X
LDALAB_7Aget the pointer low byte
LDYLAB_7Bget the pointer high byte
CLCflag ok
RTS
************************************************************************************
copy the default date and time to LAB_0518 ??
LAB_E2B2: ; $E2B2
SECset to copy the default date/time
BRALAB_E2B6go copy the date and time to LAB_0518 ??
************************************************************************************
copy the current date and time to LAB_0518 ??
LAB_E2B5: ; $E2B5
CLCclear to copy the current date/time
LAB_E2B6: ; $E2B6
LDA#>LAB_0518set the ?? pointer low byte
LDY#<LAB_0518set the ?? pointer high byte
BRALAB_E2C1go copy the date and time to AY
************************************************************************************
copy the current date and time to LAB_0511 ??
LAB_E2BC: ; $E2BC
CLCclear to copy the current date/time
LDA#>LAB_0511set the ?? pointer low byte
LDY#<LAB_0511set the ?? pointer high byte
************************************************************************************
copy the date and time to AY
LAB_E2C1: ; $E2C1
STALAB_7Asave the pointer low byte
STYLAB_7Bsave the pointer high byte
LDX#$07set the byte count
LDY#$00clear the index
SEIdisable interrupts
LAB_E2CA: ; $E2CA
BCCLAB_E2D1if Cb = 0 go get a current date/time byte
LDALAB_E913,Yelse get a default date and time byte
BRALAB_E2D4go save the byte
LAB_E2D1: ; $E2D1
LDALAB_66,Yget a current date/time byte
LAB_E2D4: ; $E2D4
STA(LAB_7A),Ysave a date/time byte
INYincrement the index
DEXdecrement the count
BNELAB_E2CAloop if more to do
CLIenable interrupts
CLCflag ok
RTS
************************************************************************************
RAM size values
LAB_E2DD: ; $E2DD
.BYTE$2032K
.BYTE$4064K
.BYTE$A0160K
************************************************************************************
command $00, return serial#, version#, ??#, RAM size and ??
LAB_E2E0: ; $E2E0
BCSLAB_E30Cif following bytes just exit
LDA#>LAB_E000set the return message pointer low byte
LDY#<LAB_E000set the return message pointer high byte
LDX#$05set the byte count
JSRLAB_E261copy a return message from AY to RAM
PHAsave the RAM pointer low byte
LDALAB_020E.
STALAB_063E.
LDXLAB_01get the RAM size, $00, $01 or $02
LDALAB_E2DD,Xget the numeric size byte
STALAB_063Fsave the RAM size to the return buffer
LDXLAB_05get the RAM size high byte
LDALAB_04get the RAM size low byte
BNELAB_E301.
DEX.
LAB_E301: ; $E301
DECA.
STALAB_0640.
STXLAB_0641.
LDX#$09set the byte count
PLArestore the RAM pointer low byte
CLCflag ok
LAB_E30C: ; $E30C
RTS
************************************************************************************
command $01, return or set the variables
LAB_E30D: ; $E30D
LDA#>LAB_1Eset the return message pointer low byte
LDY#<LAB_1Eset the return message pointer high byte
BCSLAB_E317if following bytes go set the variables
LDX#$18set the byte count
CLCflag ok
RTS
LAB_E317: ; $E317
CPX#$18compare the byte count with $18
JSRLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
BCSLAB_E32Bif error just exit
SEB1,LAB_EF.
BBC7,LAB_27,LAB_E325.
CLB1,LAB_EF.
LAB_E325: ; $E325
JSRLAB_E679save the integer part of VThreshold * 2.277 in LAB_4F
JMPLAB_E2BCcopy the current date and time to LAB_0511 ??
LAB_E32B: ; $E32B
RTS
************************************************************************************
command $02 ??
LAB_E32C: ; $E32C
LDA#>LAB_0386set the ?? pointer low byte
LDY#<LAB_0386set the ?? pointer high byte
BCSLAB_E337if following bytes go ??
LDX#$10set the byte count
JMPLAB_E29Csearch for null in X bytes at AY ??
LAB_E337: ; $E337
CPX#$10.
JSRLAB_E291copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
BCSLAB_E341if error just exit
JMPLAB_E2BCcopy the current date and time to LAB_0511 ??
LAB_E341: ; $E341
RTS
************************************************************************************
command $03 ??
LAB_E342: ; $E342
LDA#>LAB_0396set the ?? pointer low byte
LDY#<LAB_0396set the ?? pointer high byte
BCSLAB_E34Dif following bytes go ??
LDX#$10set the byte count
JMPLAB_E29Csearch for null in X bytes at AY ??
LAB_E34D: ; $E34D
CPX#$10.
JSRLAB_E291copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
BCSLAB_E357.
JMPLAB_E2BCcopy the current date and time to LAB_0511 ??
LAB_E357: ; $E357
RTS
************************************************************************************
command $04, return or set the date/time
LAB_E358: ; $E358
BCSLAB_E366if following bytes go set the date/time
LDA#>LAB_66set the return message pointer low byte
LDY#<LAB_66set the return message pointer high byte
LDX#$07set the byte count
SEIdisable interrupts
JSRLAB_E261copy a return message from AY to RAM
CLIenable interrupts
RTS
LAB_E366: ; $E366
CPX#$07compare the byte count with $07
SECflag error
BNELAB_E387if not $07 bytes just exit
SEIdisable interrupts
LAB_E36C: ; $E36C
LDALAB_66,Yget a current date/time byte
STALAB_0639,Ysave it to the return buffer
LDALAB_0539,Yget a new date/time byte
STALAB_66,Ysave a current date/time byte
INYincrement the index
DEXdecrement the count
BNELAB_E36Cloop if more to do
JSRLAB_E8F0set 1/8ths of seconds from 100ths
CLIenable interrupts
TYAcopy the byte count ..
TAX.. to X
LDA#>LAB_0639set the return message pointer low byte
LDY#<LAB_0639set the return message pointer high byte
CLCflag ok
LAB_E387: ; $E387
RTS
************************************************************************************
command $05, return or set the BST/GMT change date/time
LAB_E388: ; $E388
LDA#>LAB_04FCset the return message pointer low byte
LDY#<LAB_04FCset the return message pointer high byte
BCSLAB_E396if following bytes go set the BST/GMT change date/time
LDX#$0Eset the byte count
SEIdisable interrupts
JSRLAB_E261copy a return message from AY to RAM
CLIenable interrupts
RTS
LAB_E396: ; $E396
CPX#$0Ecompare the byte count with $0E
SEIdisable interrupts
JSRLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
CLIenable interrupts
RTS
************************************************************************************
command $06 ??
LAB_E39E: ; $E39E
LDA#>LAB_050Aset the return message pointer low byte
LDY#<LAB_050Aset the return message pointer high byte
BCSLAB_E3A7if following bytes go ??
LDX#$07set the byte count
RTS
LAB_E3A7: ; $E3A7
CPX#$07compare the byte count with $07
JMPLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
************************************************************************************
command $07, get the current time/date
LAB_E3AC: ; $E3AC
BCSLAB_E3BFif following bytes just exit
SEIdisable interrupts
LAB_E3AF: ; $E3AF
LDALAB_66,Xget a current date/time byte
STALAB_050A,Xsave it to the reply buffer
INXincrement the index
CPX#$07compare it with max + 1
BCCLAB_E3AFif <= max go get another byte
CLIenable interrupts
LDA#>LAB_050Aset the return message pointer low byte
LDY#<LAB_050Aset the return message pointer high byte
CLCflag ok
LAB_E3BF: ; $E3BF
RTS
************************************************************************************
default password
LAB_E3C0: ; $E3C0
.BYTE'ALICE',$00"ALICE"
************************************************************************************
set the default password
LAB_E3C6: ; $E3C6
LDX#$05set the count/index
LAB_E3C8: ; $E3C8
LDALAB_E3C0,Xget a default password cyte
STALAB_03A6,Xsave a password byte
DEXdecrement the count/index
BPLLAB_E3C8loop if more to do
RTS
************************************************************************************
command $08, return or set the password
LAB_E3D2: ; $E3D2
LDA#>LAB_03A6set the password pointer low byte
LDY#<LAB_03A6set the password pointer high byte
BCSLAB_E3DDif following bytes go set the password
LDX#$10set the byte count
JMPLAB_E29Csearch for null in X bytes at AY ??
return the password
LAB_E3DD: ; $E3DD
CPX#$10compare the byte count with $10
JMPLAB_E291copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
************************************************************************************
command $09, password ??
LAB_E3E2: ; $E3E2
BCCLAB_E401if no following bytes go return type $F2
CPX#$11compare the byte count with max + 1
BCSLAB_E401if > max go return $F2
LAB_E3E8: ; $E3E8
LDALAB_03A6,Yget a password byte
EORLAB_0539,Ycompare it with a command password byte
AND#$DFmask xx0x xxxx, make case insensetive
BNELAB_E401if not the same go return $F2
INYincrement the index
DEXdecrement the count
BNELAB_E3E8loop if more to do
CPY#$10compare the length with $10
BCSLAB_E3FFif >= $10 skip the null end check
LDALAB_03A6,Yelse make sure the next character is $00
BNELAB_E401if not null go return $F2
LAB_E3FF: ; $E3FF
CLCflag ok
RTS
LAB_E401: ; $E401
LDA#$F2set return type $F2, password incorrect ??
BITLAB_E407set Vb
SECflag error
LAB_E407: ; $E407
RTS
************************************************************************************
command $0A, return or set the metered units
LAB_E408: ; $E408
LDA#>LAB_36set the return message pointer low byte
LDY#<LAB_36set the return message pointer high byte
BCSLAB_E413if following bytes go ??
LDX#$03set the byte count
JMPLAB_E261copy a return message from AY to RAM
LAB_E413: ; $E413
CPX#$03.
JMPLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
************************************************************************************
command $0B ??
LAB_E418: ; $E418
LDA#>LAB_39set the return message pointer low byte
LDY#<LAB_39set the return message pointer high byte
BCSLAB_E423if following bytes go ??
LDX#$02set the byte count
JMPLAB_E261copy a return message from AY to RAM
LAB_E423: ; $E423
CPX#$02.
JMPLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
************************************************************************************
command $0C ??
LAB_E428: ; $E428
BCSLAB_E430if following bytes just exit
LDA#>LAB_0511set the return message pointer low byte
LDY#<LAB_0511set the return message pointer high byte
LDX#$07set the byte count
LAB_E430: ; $E430
RTS
************************************************************************************
command $0D, return the metered units
LAB_E431: ; $E431
BCSLAB_E43Fif following bytes just exit
JSRLAB_F5B5.
LDA#>LAB_36set the return message pointer low byte
LDY#<LAB_36set the return message pointer high byte
LDX#$0Aset the byte count
JMPLAB_E261copy a return message from AY to RAM
LAB_E43F: ; $E43F
RTS
************************************************************************************
command $0E, reload vector table(s)
LAB_E440: ; $E440
CPX#$01compare the byte count with $01
SECflag error
BNELAB_E457if not one byte go return the error
SEIdisable interrupts
LDALAB_0539get the one byte
BNELAB_E450if not $00 go copy both tables
JSRLAB_E12Dcopy the vector table and values from LAB_E0DD
BRALAB_E453go return ok
LAB_E450: ; $E450
JSRLAB_E135copy the vector tables and values from from LAB_E0DD
and LAB_E11D
LAB_E453: ; $E453
LDX#$00set the byte count
CLIenable interrupts
CLCflag ok
LAB_E457: ; $E457
RTS
************************************************************************************
command $0F, return the checksum of count bytes from address
LAB_E458: ; $E458
CPX#$04compare the byte count with $04
SECflag error and set carry for subtract
BNELAB_E4A1if not four bytes go return the error
LDA#$00clear A
SBCLAB_053Bsubtract the count low byte
TAYcopy the -count low byte to Y
LDA#$00clear A
SBCLAB_053Csubtract the count high byte
TAXcopy the -count high byte to X
STYLAB_7Asave -count low byte
SECset carry for subtract
LDALAB_0539get the address low byte
SBCLAB_7Aadd -count low byte
STALAB_7Asave the pointer low byte
LDALAB_053Aget the address low byte
SBC#$00subtract any carry
STALAB_7Bsave the pointer high byte
LDA#$00clear A, checksum low byte
STALAB_063Aclear the checksum mid byte
STALAB_063Bclear the checksum high byte
LAB_E482: ; $E482
CLCclear carry for add
ADC(LAB_7A),Yadd the byte to the checksum
BCCLAB_E48Fif no carry skip the mid byte increment
INCLAB_063Aelse increment the checksum mid byte
BNELAB_E48Fif no rollover skip the high byte increment
INCLAB_063Belse increment the checksum high byte
LAB_E48F: ; $E48F
INYincrement the -count low byte
BNELAB_E482loop if more to do
INCLAB_7Bincrement the pointer high byte
INXincrement the -count high byte
BNELAB_E482loop if more to do
STALAB_0639save the checksum low byte
LDX#$03set the byte count
LDA#>LAB_0639set the return message pointer low byte
LDY#<LAB_0639set the return message pointer high byte
CLCflag ok
LAB_E4A1: ; $E4A1
RTS
************************************************************************************
command $10, write memory bytes
LAB_E4A2: ; $E4A2
CPX#$02compare the byte count with $02
BCCLAB_E4BEif < $02 bytes go return an error
LDALAB_0539get the pointer low byte
STALAB_7Asave the pointer low byte
LDALAB_053Aget the pointer high byte
STALAB_7Bsave the pointer high byte
DEXdecrement the count
BRALAB_E4B9branch into the copy loop
LAB_E4B3: ; $E4B3
LDALAB_053B,Yget a command buffer byte
STA(LAB_7A),Ysave it to the memory
INYincrement the index
LAB_E4B9: ; $E4B9
DEXdecrement the count
BNELAB_E4B3loop if more to do
CLCflag ok
RTS
LAB_E4BE: ; $E4BE
SECflag error
RTS
************************************************************************************
command $11, read memory bytes
LAB_E4C0: ; $E4C0
CPX#$03compare the byte count with $03
SECflag error
BNELAB_E4E2if not three bytes go return the error
LDALAB_0539get the pointer low byte
STALAB_7Asave the pointer low byte
LDALAB_053Aget the pointer high byte
STALAB_7Bsave the pointer high byte
LDXLAB_053Bget the byte count
SEIdisable interrupts
LAB_E4D3: ; $E4D3
LDA(LAB_7A),Yget a memory byte
STALAB_0639,Ysave it to the return buffer
INYincrement the index
DEXdecrement the count
BNELAB_E4D3loop if more to do
CLIenable interrupts
LDA#>LAB_0639set the return message pointer low byte
LDY#<LAB_0639set the return message pointer high byte
CLCflag ok
LAB_E4E2: ; $E4E2
RTS
************************************************************************************
command $12, execute code from address
LAB_E4E3: ; $E4E3
CPX#$02compare the byte count with $02
BCCLAB_E4ECif < $02 go return the error
DEXdecrement the byte count
DEXdecrement the byte count
JMP(LAB_0539)jump to the address
LAB_E4EC: ; $E4EC
SECflag error
RTS
************************************************************************************
command $13 ??
LAB_E4EE: ; $E4EE
CPX#$01compare the byte count with $01
SECflag error
BNELAB_E500if not one byte go return the error
LDALAB_0539get the one byte
EOR#'*'compare it with "*"
BNELAB_E500if not "*" go return the error
JSRLAB_F42F.
LDX#$00.
CLCflag ok
LAB_E500: ; $E500
RTS
************************************************************************************
command $14 ??
LAB_E501: ; $E501
STYLAB_7E.
STYLAB_7D.
STYLAB_0739clear the year/month
STYLAB_073Aclear the month/date
STYLAB_073Bclear the hours/minutes
STYLAB_073Cclear the minutes/seconds
STYLAB_073Dclear the seconds low bit
DEY.
STYLAB_073Eset the year/month
STYLAB_073Fset the month/date
STYLAB_0740set the hours/minutes
STYLAB_0741set the minutes/seconds
STYLAB_0742set the seconds low bit
STYLAB_7C.
CPX#$01compare the byte count with $01
BCCLAB_E58D.
BEQLAB_E588.
CPX#$08compare the byte count with $08
BEQLAB_E55E.
CPX#$0Fcompare the byte count with $0F
BNELAB_E590.
LDXLAB_0541get the ?? year
LDALAB_0542get the ?? month
LDYLAB_0543get the ?? date
JSRLAB_F1D6compress YY:MM:DD in X:A:Y into AX
STXLAB_073Esave the year/month
STALAB_073Fsave the month/date
LDXLAB_0544get the ?? hours
LDALAB_0545get the ?? minutes
LDYLAB_0546get the ?? seconds
JSRLAB_F1EBcompress HH:MM:SS in X:A:Y into AX and Cb
STXLAB_0740save the hours/minutes
STALAB_0741save the minutes/seconds
LDA#$00clear A
RORAshift in the seconds low bit
STALAB_0742save the seconds low bit
LAB_E55E: ; $E55E
LDXLAB_053Aget the ?? year
LDALAB_053Bget the ?? month
LDYLAB_053Cget the ?? date
JSRLAB_F1D6compress YY:MM:DD in X:A:Y into AX
STXLAB_0739save the year/month
STALAB_073Asave the month/date
LDXLAB_053Dget the ?? hours
LDALAB_053Eget the ?? minutes
LDYLAB_053Fget the ?? seconds
JSRLAB_F1EBcompress HH:MM:SS in X:A:Y into AX and Cb
STXLAB_073Bsave the hours/minutes
STALAB_073Csave the minutes/seconds
LDA#$00clear A
RORAshift in the seconds low bit
STALAB_073Dsave the seconds low bit
LAB_E588: ; $E588
LDALAB_0539.
STALAB_7C.
LAB_E58D: ; $E58D
JMPLAB_F5D3.
LAB_E590: ; $E590
SECflag error
RTS
************************************************************************************
command $16, download ??
LAB_E592: ; $E592
BCSLAB_E5A5if following bytes just exit
BBS0,LAB_7D,LAB_E59E.
LAB_E597: ; $E597
JSRLAB_F661fill the message buffer with records ??
STXLAB_7Esave the message buffer index
COMLAB_7D.
LAB_E59E: ; $E59E
LDXLAB_7Eget the byte count
LDA#>LAB_0639set the return message pointer low byte
LDY#<LAB_0639set the return message pointer high byte
CLCflag ok
LAB_E5A5: ; $E5A5
RTS
************************************************************************************
command $17 ??
LAB_E5A6: ; $E5A6
BCSLAB_E5A5if following bytes just exit
BBS0,LAB_7D,LAB_E597.
BRALAB_E59E.
************************************************************************************
command $18 ??
LAB_E5AD: ; $E5AD
LDA#>LAB_0518set the return message pointer low byte
LDY#<LAB_0518set the return message pointer high byte
BCSLAB_E5B6if following bytes go ??
LDX#$07set the byte count
RTS
LAB_E5B6: ; $E5B6
CPX#$07.
JMPLAB_E278copy X bytes from LAB_0539 to AY if Zb = 1 ??
************************************************************************************
command $19 ??
LAB_E5BB: ; $E5BB
LDA#>LAB_0402set the ?? pointer low byte
LDY#<LAB_0402set the ?? pointer high byte
BCSLAB_E5C6if following bytes go ??
LDX#$FA.
JMPLAB_E29Csearch for null in X bytes at AY ??
LAB_E5C6: ; $E5C6
CPX#$02compare the byte count with $02
BCSLAB_E5D6if >= $02 go ??
LDALAB_0539.
BNELAB_E5D6.
JSRLAB_E2B2copy the default date and time to LAB_0518 ??
STXLAB_0402.
RTS
LAB_E5D6: ; $E5D6
CPX#$FA.
JSRLAB_E291copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
BCSLAB_E5E6.
JSRLAB_E2B5copy the current date and time to LAB_0518 ??
LDA#>LAB_0518set the return message pointer low byte
LDY#<LAB_0518set the return message pointer high byte
LDX#$07set the byte count
LAB_E5E6: ; $E5E6
RTS
************************************************************************************
command $1A ??
LAB_E5E7: ; $E5E7
BCSLAB_E5F1if following bytes just exit
JMPLAB_F08C.
************************************************************************************
command $1B ??
LAB_E5EC: ; $E5EC
BCSLAB_E5F1if following bytes just exit
JMPLAB_F0DD.
LAB_E5F1: ; $E5F1
RTS
************************************************************************************
command $1E, return or set and dial the ringback number
LAB_E5F2: ; $E5F2
BCSLAB_E5FDif following bytes go dial the ringback number
LDA#>LAB_03B6set the ringback number buffer pointer low byte
LDY#<LAB_03B6set the ringback number buffer pointer high byte
LDX#$10.
JMPLAB_E29Csearch for null in X bytes at AY ??
LAB_E5FD: ; $E5FD
BBC3,LAB_F0,LAB_E60Dtest b3 port 2 data register, RS232/modem select
if RS232 selected just exit
LDA#>LAB_03B6set the ringback number buffer pointer low byte
LDY#<LAB_03B6set the ringback number buffer pointer high byte
CPX#$10.
JSRLAB_E291copy X bytes from LAB_0539 to AY and null terminate ??
?? pointer in AY
?? byte count in X
BCSLAB_E60Dif error just exit
SEB1,LAB_0Aset the command loop flag, dial an outgoing number
LAB_E60D: ; $E60D
RTS
************************************************************************************
dial an outgoing number
LAB_E60E: ; $E60E
SEB6,LAB_F0set b6 port 2 data register, turn the modem off
JSRLAB_E65Fwait 10 seconds for carrier clear
BCSLAB_E64Fif carrier still present do error exit
LDA#$02set the retry count
LAB_E617: ; $E617
PHAsave the retry count
JSRLAB_E72Erelease the line and wait 2 seconds
JSRLAB_E72Bset modem select, seize the line
JSRLAB_E733wait for 2 seconds
JSRLAB_E777disable the UART and set timer 2 to 10ms ??
LDY#$00clear the ringback number index
LDX#$10set the digit count
LAB_E628: ; $E628
LDALAB_03B6,Yget a character from the ringback number buffer
BEQLAB_E643if the end marker go wait for an answer
CMP#','compare the character with ","
BNELAB_E636if not "," go dial it
JSRLAB_E733else wait for 2 seconds
BRALAB_E63Fgo get the next digit
LAB_E636: ; $E636
AND#$0Fmask the digit
BNELAB_E63Cif 1 to 9 go use it
ORA#$0Aelse make any zero into ten
LAB_E63C: ; $E63C
JSRLAB_E650dial an outgoing digit
LAB_E63F: ; $E63F
INYincrement the index
DEXdecrement the count
BNELAB_E628loop if more to do
LAB_E643: ; $E643
JSRLAB_E752setup the UART and timer 2 and clear the Tx/Rx buffers ??
JSRLAB_E6E4set originate mode, wait 30 seconds for two seconds of
new carrier and then ??
PLApull the retry count
BCCLAB_E64Fif done just exit
DECAelse decrement the retry count
BNELAB_E617if not counted out go try again
LAB_E64F: ; $E64F
RTS
************************************************************************************
dial an outgoing digit
LAB_E650: ; $E650
STALAB_1Csave the digit to dial
BBS2,LAB_FE,LAB_E659if timer 2 interrupt enabled skip enabling timer 2
CLB3,LAB_FEelse clear the timer 2 request bit
SEB2,LAB_FEand set the timer 2 enable bit
LAB_E659: ; $E659
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
BBC7,LAB_1C,LAB_E659if stil dialing wait some more
RTS
************************************************************************************
wait 10 seconds for carrier clear, return Cb = 0 if no carrier
LAB_E65F: ; $E65F
LDM#$50,LAB_1Aset the 1/8th second countdown byte
LAB_E662: ; $E662
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
CLCflag no carrier
TSTLAB_5Etest the carrier detect
BEQLAB_E66Eif no carrier go return the status
TSTLAB_1Atest the 1/8th second countdown byte
BNELAB_E662loop if not timed out
SECflag carrier
LAB_E66E: ; $E66E
RTS
************************************************************************************
command $1F ??
LAB_E66F: ; $E66F
BCSLAB_E673if following bytes just exit
SEB0,LAB_0Aset the command loop flag, return to the main loop
LAB_E673: ; $E673
RTS
************************************************************************************
command $15, $1C, $1D ??
LAB_E674: ; $E674
BITLAB_E678set Vb, return A as the type
SECflag error
LAB_E678: ; $E678
RTS
************************************************************************************
save the integer part of VThreshold * 2.277 in LAB_4F
LAB_E679: ; $E679
LDALAB_20get the VThreshold value
STALAB_0Fsave the multiplier low byte
LDM#$00,LAB_10clear the multiplier high byte
LDM#>$0247,LAB_0Dset the multiplicand low byte, 2.277 in 8.8 fixed point
LDM#<$0247,LAB_0Eset the multiplicand high byte, 2.277 in 8.8 fixed point
JSRLAB_E6B9mult LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX
STXLAB_4Fsave the integer part of the result
RTS
************************************************************************************
read the A2D channels ??
LAB_E68C: ; $E68C
LDX#$00set channel 0
CLB6,LAB_F3clear b6 port 1 data register, turn vref on
LAB_E690: ; $E690
STXLAB_E9set the A2D control register and start the conversion
LAB_E692: ; $E692
BBC2,LAB_E9,LAB_E692read the A2D control register and loop if not ready
LDALAB_EAread the A2D data register
STALAB_11,Xsave the A2D channel byte
INXincrement the channel/index
CPX#$04compare it with max + 1
BCCLAB_E690if <= max go get another A2D channel byte
SEB6,LAB_F3set b6 port 1 data register, turn vref off
SECset carry for subtract
LDALAB_11get the A2D channel 0 byte
SBCLAB_14subtract the A2D channel 3 byte
BCSLAB_E6AAif >= o skip the two's complement
else < 0 so ..
EOR#$FFtoggle the byte
INCAand make 2's complement
LAB_E6AA: ; $E6AA
STALAB_18save the ABS(A2D(0 - 3))
SECset carry for subtract
LDALAB_12get the A2D channel 1 byte
SBCLAB_14subtract the A2D channel 3 byte
BCSLAB_E6B6if >= o skip the two's complement
else < 0 so ..
EOR#$FFtoggle the byte
INCAand make 2's complement
LAB_E6B6: ; $E6B6
STALAB_19save the ABS(A2D(1 - 3))
RTS
************************************************************************************
multiply LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX
LAB_E6B9: ; $E6B9
LDA#$00clear A
STALAB_0Bclear the partial low byte
STALAB_0Cclear the partial high byte
LDX#$10set the bit count
LAB_E6C1: ; $E6C1
ASLLAB_0Bshift the partial low byte
ROLLAB_0Cshift the partial high byte
ASLLAB_0Fshift the multiplier low byte
ROLLAB_10shift the multiplier high byte
BCCLAB_E6D8if top bit clear skip the add
CLCclear carry for add
LDALAB_0Bget the partial low byte
ADCLAB_0Dadd the multiplicand low byte
STALAB_0Bsave the partial low byte
LDALAB_0Cget the partial high byte
ADCLAB_0Eadd the multiplicand low byte
STALAB_0Csave the partial high byte
LAB_E6D8: ; $E6D8
DEXdecrement the bit count
BNELAB_E6C1loop if more to do
LDALAB_0Bget the result low byte
LDXLAB_0Cget the result high byte
STALAB_0Fsave the result low byte
STXLAB_10save the result high byte
RTS
************************************************************************************
set originate mode, wait 30 seconds for two seconds of new carrier and then ??
LAB_E6E4: ; $E6E4
LDA#$F0set the 1/8th second count to 30 seconds
SEB5,LAB_F0set b5 port 2 data register, set originate mode
JSRLAB_E6F4wait A 1/8ths of a second for two seconds of new carrier
BCSLAB_E6EFif error just exit
CLB6,LAB_F0clear b6 port 2 data register, turn the modem off
LAB_E6EF: ; $E6EF
RTS
************************************************************************************
wait 15 seconds for two seconds of new carrier
LAB_E6F0: ; $E6F0
LDA#$78set the 1/8th second count to 15 seconds
CLB5,LAB_F0clear b5 port 2 data register, set answer mode
************************************************************************************
wait A 1/8ths of a second for two seconds of new carrier
this routine waits for two seconds for the carrier to be dropped before waiting A
1/8ths of a second for two seconds of new carrier
LAB_E6F4: ; $E6F4
SEB6,LAB_F0set b6 port 2 data register, turn the modem on
JSRLAB_E72Bset modem select, seize the line
make sure there is no carrier
LDM#$10,LAB_1Aset the 1/8th second countdown byte, 2 seconds
LAB_E6FC: ; $E6FC
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
TSTLAB_1Atest the 1/8th second countdown byte
BEQLAB_E729if timed out go do error exit
BBC4,LAB_F0,LAB_E6FCtest b4 port 2 data register, carrier detect
if carrier detected just loop
no carrier was detected
LDM#$00,LAB_5Eclear the carrier detect
BBS5,LAB_F0,LAB_E717test b5 port 2 data register, originate/answer
if originate go wait for the new carrier
is answer mode so ??
JSRLAB_E733wait for 2 seconds
SEB7,LAB_F3?? port 1 data register
CLB6,LAB_F0clear b6 port 2 data register, turn the modem on
JSRLAB_E738wait for 3 seconds
CLB7,LAB_F3?? port 1 data register
wait for the carrier to be detected
LAB_E717: ; $E717
STALAB_1Asave the 1/8th second countdown byte
LAB_E719: ; $E719
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
TSTLAB_1Atest the 1/8th second countdown byte
BEQLAB_E729if counted out go do error return
TSTLAB_5Etest the carrier detect
BEQLAB_E719if no carrier go return an error
LDALAB_07get the ?? buffer read index
STALAB_06save the ?? buffer write index
clear the buffer
CLCflag ok
RTS
LAB_E729: ; $E729
SECflag error
RTS
************************************************************************************
set modem select, seize the line
LAB_E72B: ; $E72B
SEB3,LAB_F0set b3 port 2 data register, modem select, line seize
RTS
************************************************************************************
release the line and wait 2 seconds. if the line is already released just exit
LAB_E72E: ; $E72E
BBC3,LAB_F0,LAB_E746test b3 port 2 data register, RS232/modem select
if RS232 selected just exit
CLB3,LAB_F0clear b3 port 2 data register, RS232 select, line release
************************************************************************************
wait for 2 seconds
LAB_E733: ; $E733
LDM#$10,LAB_1Aset the 1/8th second countdown byte
BRALAB_E740wait for LAB_1A 1/8ths of a second
************************************************************************************
wait for 3 seconds
LAB_E738: ; $E738
LDM#$18,LAB_1Aset the 1/8th second countdown byte
BRALAB_E740wait for LAB_1A 1/8ths of a second
************************************************************************************
wait for 1/2 a second
LAB_E73D: ; $E73D
LDM#$04,LAB_1Aset the 1/8th second countdown byte
************************************************************************************
wait for LAB_1A 1/8ths of a second
LAB_E740: ; $E740
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
TSTLAB_1Atest the 1/8th second countdown byte
BNELAB_E740loop if not counted out
LAB_E746: ; $E746
RTS
************************************************************************************
setup the UART and timer 2 and clear the Tx/Rx buffers ??
LAB_E747: ; $E747
LDALAB_023Dget the BAUD rate generator value
LDXLAB_023Eget the timer 2 value
LDYLAB_023Fget the prescaller 2 value
BRALAB_E75Bgo setup the UART and timer
************************************************************************************
setup the UART and timer 2 and clear the Tx/Rx buffers ??
LAB_E752: ; $E752
LDALAB_023Aget the BAUD rate generator value
LDXLAB_023Bget the timer 2 value
LDYLAB_023Cget the prescaller 2 value
LAB_E75B: ; $E75B
CLB2,LAB_FEclear the timer 2 interrupt enable bit
STALAB_FBset the BAUD rate generator
STXLAB_7Fsave the timer 2 value
STXLAB_DFset timer 2
STYLAB_80save the prescaller 2 value
STYLAB_DEset prescaller 2
LDM#$D1,LAB_E6set the UART control register
bit function
--- --------
7 1 = Rx enabled
6 1 = Tx enabled
5 0 = unused
4 1 = Rx interrupt enabled
3 0 = Xin/8
2 0 = even parity
1 0 = parity disabled
0 1 = 8 bit
LDA#$00clear A
STALAB_E5write to the UART Rx buffer register
clear the error bits
STALAB_06clear the ?? buffer write index
STALAB_07clear the ?? buffer read index
STALAB_08clear the Tx buffer write index
STALAB_09clear the Tx buffer read index
RTS
************************************************************************************
disable the UART and set timer 2 to 10ms ??
LAB_E777: ; $E777
CLB2,LAB_FEclear the timer 2 interrupt enable bit
LDM#$00,LAB_E6?? UART control register
bit function
--- --------
7 0 = Rx disabled
6 0 = Tx disabled
5 0 = unused
4 0 = Rx interrupt disabled
3 0 = Xin/8
2 0 = even parity
1 0 = parity disabled
0 0 = 7 bit
LDM#$47,LAB_DEset prescaller 2
sets (1/(71+1)) * (1/16) Hz
this will be 6400 Hz with a 7.3728MHz XTAL
LDM#$3F,LAB_DFset timer 2 to 10ms
LDM#$00,LAB_1Dclear the pulse count
LDM#$FF,LAB_1Cclear the digit to dial
RTS
************************************************************************************
wait for timer 2 ??
LAB_E789: ; $E789
JSR\LAB_FFEEswap the stack pointers and stop the internal clock
BBS2,LAB_FE,LAB_E789if timer 2 interrupt enabled wait some more
RTS
************************************************************************************
set the default dates and times
LAB_E78F: ; $E78F
LDX#$06set the count/index
LAB_E791: ; $E791
LDALAB_E90C,Xget the max + 1 for date and time
STALAB_5F,Xsave the max + 1 for date and time
LDALAB_E913,Xget a default date and time byte
STALAB_66,Xsave a current date/time byte
STALAB_050A,Xsave a ?? date/time byte
STALAB_0511,Xsave a ?? date/time byte
STALAB_0518,Xsave a ?? date/time byte
LDA#$00clear A
STALAB_04FC,Xclear a GMT/BST change date/time byte
STALAB_0503,Xclear a BST/GMT new date/time byte
DEXdecrement the count/index
BPLLAB_E791loop if more to do
STALAB_6Dclear the 1/8ths of seconds
RTS
************************************************************************************
test the carrier and set the carrier detect byte
LAB_E7B2: ; $E7B2
BBS4,LAB_F0,LAB_E7B9test b4 port 2 data register, carrier detect
if no carrier detected go decrement the carrier detect
LDM#$08,LAB_5Eset the carrier detect
RTS
LAB_E7B9: ; $E7B9
TSTLAB_5Etest the carrier detect
BEQLAB_E7BFif already zero skip the decrement
DECLAB_5Edecrement the carrier detect
LAB_E7BF: ; $E7BF
RTS
************************************************************************************
INT2, 1/8th second interrupt
LAB_E7C0: ; $E7C0
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
CLB3,LAB_FFclear INT2 request bit
LDX#$00clear the index
LAB_E7C9: ; $E7C9
INCLAB_6E,X.
BNELAB_E7D8.
INX.
CPX#$03.
BCCLAB_E7C9.
DECLAB_6E.
DECLAB_6F.
DECLAB_70.
LAB_E7D8: ; $E7D8
BBS0,LAB_FE,LAB_E822if timer 1 interrupt enabled skip ??
JSRLAB_E68Cread the A2D channels ??
LDALAB_11get the A2D channel 0 byte
SECset carry for subtract
SBCLAB_15.
BEQLAB_E7F4.
BCSLAB_E7EE.
else < 0 so ..
EOR#$FFtoggle the byte
INCAand make 2's complement
DECLAB_15.
BRALAB_E7F0.
LAB_E7EE: ; $E7EE
INCLAB_15.
LAB_E7F0: ; $E7F0
CMP#$05.
BCSLAB_E81B.
LAB_E7F4: ; $E7F4
JSRLAB_EA67.
EORLAB_49.
AND#$E0.
BNELAB_E81B.
BBC2,LAB_1F,LAB_E822.
BBC2,LAB_5A,LAB_E822.
SEC.
BBC0,LAB_1F,LAB_E80D.
LDALAB_13get the A2D channel 2 byte
SBCLAB_14subtract the A2D channel 3 byte
BRALAB_E811.
LAB_E80D: ; $E80D
LDALAB_14get the A2D channel 3 byte
SBCLAB_13subtract the A2D channel 2 byte
LAB_E811: ; $E811
BCCLAB_E816.
CMPLAB_0238.
LAB_E816: ; $E816
RORA.
EORLAB_44.
BPLLAB_E822.
LAB_E81B: ; $E81B
CLB1,LAB_FEclear the timer 1 interrupt request bit
SEB0,LAB_FEset the timer 1 interrupt enable bit
LDM#$10,LAB_4C.
LAB_E822: ; $E822
TSTLAB_4C.
BEQLAB_E828.
DECLAB_4C.
LAB_E828: ; $E828
TSTLAB_1Atest the 1/8th second countdown byte
BEQLAB_E82Eif counted out skip the decrement
DECLAB_1Adecrement the 1/8th second countdown byte
LAB_E82E: ; $E82E
JSRLAB_E7B2test the carrier and set the carrier detect byte
JSRLAB_E89Cincrement the date/time in 1/8ths of seconds
BCCLAB_E84Cif the seconds didn't change just exit
else the seconds incremented
TSTLAB_1Btest the seconds countdown
BEQLAB_E83Cif already at zero skip the decrement
DECLAB_1Bdecrement the seconds countdown
LAB_E83C: ; $E83C
TSTLAB_4Dtest the seconds countdown word low byte
BNELAB_E846if not zero go decrement it
TSTLAB_4Etest the seconds countdown word high byte
BEQLAB_E848if zero word is counted out so skip the decrement
DECLAB_4Eelse decrement the seconds countdown word high byte
LAB_E846: ; $E846
DECLAB_4Ddecrement the seconds countdown word low byte
LAB_E848: ; $E848
CLIenable interrupts
JSRLAB_E876save VThreshold * 2.277 * A2D channel 3 in LAB_50 ??
LAB_E84C: ; $E84C
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
INT2, 1/8th second interrupt
LAB_E852: ; $E852
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
CLB3,LAB_FFclear INT2 request bit
TSTLAB_1Atest the 1/8th second countdown byte
BEQLAB_E85Fif already zero skip the decrement
DECLAB_1Aelse decrement the 1/8th second countdown byte
LAB_E85F: ; $E85F
JSRLAB_E7B2test the carrier and set the carrier detect byte
JSRLAB_E89Cincrement the date/time in 1/8ths of seconds
BCCLAB_E870if the seconds didn't change just exit
JSRLAB_E68Cread the A2D channels ??
TSTLAB_1Btest the seconds countdown
BEQLAB_E870if already at zero skip the decrement
DECLAB_1Belse decrement the seconds countdown
LAB_E870: ; $E870
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
save VThreshold * 2.277 * A2D channel 3 in LAB_50 ??
LAB_E876: ; $E876
LDX#$00clear the index
LAB_E878: ; $E878
LDALAB_0B,Xread a math area byte
PHAsave it
INXincrement the index
CPX#$06compare it with max + 1
BCCLAB_E878loop if more to do
LDALAB_4Fget the integer part of VThreshold * 2.277
STALAB_0Fsave the multiplier low byte
LDM#$00,LAB_10clear the multiplier low byte
LDALAB_14get the A2D channel 3 byte
STALAB_0Dsave the multiplicand low byte
LDM#$00,LAB_0Eclaer the multiplicand high byte
JSRLAB_E6B9mult LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX
STXLAB_50.
LDX#$06set the count/index
LAB_E895: ; $E895
PLApull a math area byte
DEXdecrement the count/index
STALAB_0B,Xrestore a math area byte
BNELAB_E895loop if more to do
RTS
************************************************************************************
increment the date/time in 1/8ths of seconds
LAB_E89C: ; $E89C
LDXLAB_6Dget the 1/8ths of seconds
INXincrement it
CPX#$08compare it with max + 1
BCCLAB_E8A5if < max + 1 use it
LDX#$00else wrap the 1/8ths of seconds to zero
LAB_E8A5: ; $E8A5
STXLAB_6Dsave the 1/8ths of seconds
LDALAB_E903,Xget the 1/8ths of seconds expressed in 100ths
STALAB_6Csave the 1/100ths of seconds
BCCLAB_E902if the 1/8ths of seconds didn't wrap just exit
increment the time/date
LDXLAB_67get the current time month
CPX#$02compare it with february
BNELAB_E8BBif not february skip the leap year adjust
LDALAB_66get the current time year
AND#$03effectively do year MOD 4
BNELAB_E8BBif not a leap year skip the leap year adjust
TAXelse clear the index for a leap year february
LAB_E8BB: ; $E8BB
LDALAB_E91A,Xget the max + 1 days in the month
STALAB_61save the max + 1 days in the month
LDX#$06set the index to seconds + 1
LAB_E8C2: ; $E8C2
DEXdecrement the index
LDALAB_66,Xget a current date/time byte
INCAincrement it
CMPLAB_5F,Xcompare it with the max + 1 for date and time
BCCLAB_E8CDif less skip the default byte get
LDALAB_E913,Xelse get a default date and time byte
LAB_E8CD: ; $E8CD
STALAB_66,Xsave a current date/time byte
BCCLAB_E8D4if byte is < max + 1 exit the loop
TXAelse copy the index
BNELAB_E8C2if not at years go do another date/time byte
now check for BST/GMT time change
LAB_E8D4: ; $E8D4
LDX#$05set the index to seconds
LAB_E8D6: ; $E8D6
LDALAB_04FC,Xget a BST/GMT change date/time byte
EORLAB_66,Xcompare it with a current date/time byte
BNELAB_E901if not the same go do changed exit
DEXdecrement the index
BPLLAB_E8D6loop if more to do
the current date/time matches the change date/time so get the new date/time
INXclear X
LAB_E8E1: ; $E8E1
LDALAB_0503,Xget a BST/GMT new date/time byte
STALAB_66,Xsave a current date/time byte
LDA#$00clear A
STALAB_04FC,Xclear a BST/GMT change date/time byte
INXincrement the index
CPX#$07compare with max + 1
BCCLAB_E8E1loop if more to do
************************************************************************************
set 1/8ths of seconds from 100ths
LAB_E8F0: ; $E8F0
LDALAB_6Cget the 1/100ths of seconds
LDX#$08set index to max + 1
LAB_E8F4: ; $E8F4
DEXdecrement the index
CMPLAB_E903,Xcompare it with the 1/8ths of seconds expressed in 100ths
BCCLAB_E8F4if less go try another value
LDALAB_E903,Xget the 1/8ths of seconds expressed in 100ths
STALAB_6Csave the 1/100ths of seconds
STXLAB_6Dsave the 1/8ths of seconds
LAB_E901: ; $E901
SECflag time changed
LAB_E902: ; $E902
RTS
************************************************************************************
1/8ths of seconds expressed in 100ths
LAB_E903: ; $E903
.BYTE$00.00
.BYTE$0C.12
.BYTE$19.25
.BYTE$25.37
.BYTE$32.50
.BYTE$3E.62
.BYTE$4B.75
.BYTE$57.87
************************************************************************************
unused ??
.BYTE$64
************************************************************************************
max + 1 for date and time
LAB_E90C: ; $E90C
.BYTE2099-1980+1max year + 1
.BYTE12+1max month + 1
.BYTE31+1max date +1
.BYTE23+1max hour + 1
.BYTE59+1max minute + 1
.BYTE59+1max second + 1
.BYTE99+1max part second + 1
the interrupt is every 1/100ths of a second ??
************************************************************************************
default date and time
LAB_E913: ; $E913
.BYTE$001980
.BYTE$01january
.BYTE$0101
.BYTE$00,$00,$00,$0000:00:00.00
************************************************************************************
max + 1 days in each month
LAB_E91A: ; $E91A
.BYTE29+1feb leap year
.BYTE31+1jan
.BYTE28+1feb
.BYTE31+1mar
.BYTE30+1apr
.BYTE31+1may
.BYTE30+1jun
.BYTE31+1jul
.BYTE31+1aug
.BYTE30+1sep
.BYTE31+1oct
.BYTE30+1nov
.BYTE31+1dec
************************************************************************************
RI or INT1
LAB_E927: ; $E927
PHAsave A
TXAcopy X
PHAsave X
BBC1,LAB_FF,LAB_E92Fif no INT1 request skip the INT1 enable clear
CLB0,LAB_FFclear the INT1 enable bit
LAB_E92F: ; $E92F
BBC0,LAB_E7,LAB_E940test b0 UART status register
if no Rx interrupt just exit
BBS3,LAB_E7,LAB_E93Etest b3 UART status register
if framing error just the clear error bits and exit
LDALAB_E5read the UART Rx buffer register
LDXLAB_06get the ?? buffer write index
STALAB_0280,Xsave a character to the ?? buffer
INCLAB_06increment the ?? buffer write index
LAB_E93E: ; $E93E
STALAB_E5write to the UART Rx buffer register
clear the error bits
LAB_E940: ; $E940
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
handle timer 1
LAB_E944: ; $E944
TSTLAB_4Btest the timer 1 countdown byte
BEQLAB_E94Aif already zero skip the decrement
DECLAB_4Belse decrement the timer 1 countdown byte
LAB_E94A: ; $E94A
JSRLAB_E68Cread the A2D channels ??
LDALAB_11get the A2D channel 0 byte
SECset carry for subtract
SBCLAB_15.
BCSLAB_E957if >= o skip the two's complement
else < 0 so ..
EOR#$FFtoggle the byte
INCAand make 2's complement
LAB_E957: ; $E957
STALAB_16.
BBC2,LAB_5A,LAB_E95F.
JSRLAB_EB9C.
LAB_E95F: ; $E95F
BBC3,LAB_5A,LAB_E965.
JSRLAB_EB7Aread the MT8870 tone decoder and ??
LAB_E965: ; $E965
BBC4,LAB_5A,LAB_E96B.
JSRLAB_EB63.
LAB_E96B: ; $E96B
BBC1,LAB_5A,LAB_E971.
JSRLAB_EB15.
LAB_E971: ; $E971
BBC7,LAB_5A,LAB_E977.
JSRLAB_EA10.
LAB_E977: ; $E977
BBC5,LAB_5A,LAB_E97D.
JSRLAB_EA9B.
LAB_E97D: ; $E97D
BBC6,LAB_5A,LAB_E983.
JSRLAB_EA2E.
LAB_E983: ; $E983
LDALAB_11get the A2D channel 0 byte
STALAB_15.
RTS
************************************************************************************
do UART Tx and digit dial
LAB_E988: ; $E988
BBC4,LAB_E6,LAB_E9ADtest b4 UART control register, Rx interrupt enable
if Rx interrupt disabled skip the UART handle
LDXLAB_09get the Tx buffer read index
CPXLAB_08compare it with the Tx buffer write index
BEQLAB_E9A9if no bytes waiting go clear the timer 2 interrupt
enable and exit
LDALAB_0380,Xread a Tx buffer byte
STALAB_E4save it to the UART Tx shift register
LDALAB_80get the prescaller 2 value
STALAB_DEset prescaller 2
LDALAB_7Fget the timer 2 value
STALAB_DFset timer 2
INXincrement the TX buffer read index
CPX#$06compare it with max + 1
BCCLAB_E9A5if less than max + 1 just use it
LDX#$00else wrap it to zero
LAB_E9A5: ; $E9A5
STXLAB_09save the Tx buffer read index
BRALAB_E9D0and exit
LAB_E9A9: ; $E9A9
CLB2,LAB_FEclear the timer 2 interrupt enable bit
BRALAB_E9D0and exit
dial a digit. the digit is in LAB_1C and when the digit is first set the pulse count
in LAB_1D is zero. In this case the line is opened and a short pulse time is saved to
the pulse count.
if the pulse count is not zero it is decremented and a check is made to see if it has
reached four. if it has the line is closed. if the pulse count reaches zero the digit
to dial is decremented.
the digit to dial is checked and if that is not now zero another short pulse is set
and the cycle continues, otherwise a final long pulse is set.
LAB_E9AD: ; $E9AD
LDALAB_1Dget the pulse count
BEQLAB_E9B7if zero go check if there is a digit to dial
DECLAB_1Delse decrement the pulse count
BNELAB_E9C8if not zero go check for pulse count
DECLAB_1Cdecrement the digit to dial
LAB_E9B7: ; $E9B7
LDALAB_1Cget the digit to dial
BMILAB_E9D0if done just exit
BEQLAB_E9C2if zero go do a long pulse
CLB3,LAB_F0clear b3 port 2 data register, RS232 select, line release
LDA#$0Aset short pulse count
.BYTE$2Cmakes the next line BIT $xxxx
LAB_E9C2: ; $E9C2
LDA#$28set long pulse count
STALAB_1Dsave the pulse count
BRALAB_E9D0and exit
LAB_E9C8: ; $E9C8
LDALAB_1Dget the pulse count
CMP#$04compare it with $04
BNELAB_E9D0if not $04 skip the line seize
SEB3,LAB_F0set b3 port 2 data register, modem select, line seize
LAB_E9D0: ; $E9D0
RTS
************************************************************************************
timer 1 or timer 2
LAB_E9D1: ; $E9D1
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
BBC0,LAB_FE,LAB_E9E1if timer 1 interrupts not enabled go handle timer 2
BBC1,LAB_FE,LAB_E9E1if timer 1 interrupt request clear go handle timer 2
CLB1,LAB_FEclear the timer 1 interrupt request bit
JSRLAB_E944handle timer 1
LAB_E9E1: ; $E9E1
BBC2,LAB_FE,LAB_E9ECif timer 2 interrupts not enabled just exit
BBC3,LAB_FE,LAB_E9ECif timer 2 interrupt request not set just exit
CLB3,LAB_FEclear the timer 2 interrupt request bit
JSRLAB_E988do UART Tx and digit dial
LAB_E9EC: ; $E9EC
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
timer 1 or timer 2
LAB_E9F2: ; $E9F2
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
BBC0,LAB_FE,LAB_E9FFif timer 1 interrupts not enabled go handle timer 2
BBC1,LAB_FE,LAB_E9FFif timer 1 interrupt request clear go handle timer 2
CLB1,LAB_FEclear the timer 1 interrupt request bit
LAB_E9FF: ; $E9FF
BBC2,LAB_FE,LAB_EA0Aif timer 2 interrupts not enabled just exit
BBC3,LAB_FE,LAB_EA0Aif timer 2 interrupt request not set just exit
CLB3,LAB_FEclear the timer 2 interrupt request bit
JSRLAB_E988do UART Tx and digit dial
LAB_EA0A: ; $EA0A
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
??
LAB_EA10: ; $EA10
LDALAB_16.
LSRA.
LSRA.
LSRA.
CLCclear carry for add
ADCLAB_45.
BCSLAB_EA1C.
BVCLAB_EA20.
LAB_EA1C: ; $EA1C
SEB2,LAB_49.
LDA#$FF.
LAB_EA20: ; $EA20
SECset carry for subtract
SBC#$01.
BCCLAB_EA27.
BVCLAB_EA2B.
LAB_EA27: ; $EA27
CLB2,LAB_49.
LDA#$00.
LAB_EA2B: ; $EA2B
STALAB_45.
RTS
************************************************************************************
??
LAB_EA2E: ; $EA2E
BBS5,LAB_49,LAB_EA61.
LDX#$00.
LDALAB_11get the A2D channel 0 byte
CMPLAB_14compare it with the A2D channel 3 byte
BCSLAB_EA3A.
DEX.
LAB_EA3A: ; $EA3A
LDALAB_18get the ABS(A2D(0 - 3))
CMP#$02.
BCCLAB_EA60.
TXA.
EORLAB_48.
EORLAB_49.
BBC3,A,LAB_EA59.
LDALAB_46.
INCA.
CMPLAB_0232.
BCCLAB_EA5E.
LDALAB_49.
EOR#$08.
STALAB_49.
LDA#$00.
BRALAB_EA5E.
LAB_EA59: ; $EA59
LDALAB_46.
BEQLAB_EA60.
DECA.
LAB_EA5E: ; $EA5E
STALAB_46.
LAB_EA60: ; $EA60
RTS
LAB_EA61: ; $EA61
CLB3,LAB_49.
LDM#$00,LAB_46.
RTS
************************************************************************************
??
LAB_EA67: ; $EA67
LDALAB_18get the ABS(A2D(0 - 3))
CMPLAB_50.
BCSLAB_EA98.
BBC0,LAB_25,LAB_EA86.
LSRA.
CLCclear carry for add
ADCLAB_19add the ABS(A2D(1 - 3))
CMPLAB_50.
BCCLAB_EA86.
BBC6,LAB_25,LAB_EA98.
SBCLAB_18subtract the ABS(A2D(0 - 3))
BCCLAB_EA98.
CMPLAB_50.
BCCLAB_EA98.
LDA#$20.
RTS
LAB_EA86: ; $EA86
BBC0,LAB_26,LAB_EA92.
LDALAB_19get the ABS(A2D(1 - 3))
ASLA.
BCSLAB_EA92.
CMPLAB_50.
BCCLAB_EA95.
LAB_EA92: ; $EA92
LDA#$80.
RTS
LAB_EA95: ; $EA95
LDA#$40.
RTS
LAB_EA98: ; $EA98
LDA#$00.
RTS
************************************************************************************
??
LAB_EA9B: ; $EA9B
JSRLAB_EA67.
TAX.
EORLAB_49.
AND#$E0.
BEQLAB_EB0A.
TXA.
BBS7,A,LAB_EABC.
BBS6,A,LAB_EAFB.
BBS5,A,LAB_EAD4.
INCLAB_41.
LDALAB_41.
CMPLAB_2D.
BCCLAB_EB14.
CLB7,LAB_49.
CLB6,LAB_49.
CLB5,LAB_49.
BRALAB_EB0A.
LAB_EABC: ; $EABC
INCLAB_40.
LDALAB_40.
CMPLAB_2D.
BCCLAB_EB14.
SEB7,LAB_49.
CLB6,LAB_49.
CLB5,LAB_49.
BBC7,LAB_27,LAB_EB0A.
BBC1,LAB_EE,LAB_EB0A.
SEB0,LAB_49.
BRALAB_EB0A.
LAB_EAD4: ; $EAD4
BBC7,LAB_49,LAB_EAEB.
INCLAB_41.
LDALAB_41.
CMPLAB_2D.
BCCLAB_EAEB.
CLB7,LAB_49.
CLB6,LAB_49.
LDA#$00clear A
STALAB_40.
STALAB_41.
STALAB_42.
LAB_EAEB: ; $EAEB
INCLAB_43.
LDALAB_43.
CMPLAB_2D.
BCCLAB_EB14.
SEB5,LAB_49.
CLB7,LAB_49.
CLB6,LAB_49.
BRALAB_EB0A.
LAB_EAFB: ; $EAFB
INCLAB_42.
LDALAB_42.
CMPLAB_0233.
BCCLAB_EB14.
SEB6,LAB_49.
CLB7,LAB_49.
CLB5,LAB_49.
LAB_EB0A: ; $EB0A
LDA#$00clear A
STALAB_40.
STALAB_41.
STALAB_42.
STALAB_43.
LAB_EB14: ; $EB14
RTS
************************************************************************************
??
LAB_EB15: ; $EB15
JSRLAB_EB20.
BCCLAB_EB1F.
DECA.
BNELAB_EB1F.
SEB1,LAB_49.
LAB_EB1F: ; $EB1F
RTS
************************************************************************************
??
LAB_EB20: ; $EB20
LDALAB_18get the ABS(A2D(0 - 3))
CMPLAB_50.
LDALAB_51.
TAX.
AND#$7F.
BCSLAB_EB51.
BEQLAB_EB31.
DECLAB_51.
CLC.
RTS
LAB_EB31: ; $EB31
TXA.
BPLLAB_EB41.
TSTLAB_52.
BEQLAB_EB3A.
INCLAB_53.
LAB_EB3A: ; $EB3A
LDM#$14,LAB_52.
CLB7,LAB_51.
CLC.
RTS
LAB_EB41: ; $EB41
CLC.
TSTLAB_52.
BEQLAB_EB50.
DECLAB_52.
BNELAB_EB50.
LDALAB_53.
LDM#$00,LAB_53.
SEC.
LAB_EB50: ; $EB50
RTS
LAB_EB51: ; $EB51
INCA.
CMPLAB_22.
BCSLAB_EB59.
INCLAB_51.
RTS
LAB_EB59: ; $EB59
INX.
BMILAB_EB61.
LDM#$14,LAB_52.
SEB7,LAB_51.
LAB_EB61: ; $EB61
CLC.
RTS
************************************************************************************
??
LAB_EB63: ; $EB63
JSRLAB_EB20.
BCCLAB_EB79.
CMP#$0B.
BCCLAB_EB6E.
LDA#$0B.
LAB_EB6E: ; $EB6E
LDXLAB_4Aget the dialed number buffer index
CPX#$3C.
BCSLAB_EB79.
STALAB_03C6,X.
INCLAB_4Aincrement the dialed number buffer index
LAB_EB79: ; $EB79
RTS
************************************************************************************
read the MT8870 tone decoder and ??
LAB_EB7A: ; $EB7A
LDALAB_F3read the port 1 data register
TAXcopy it
EORLAB_47compare it with the port 1 last read value
BBC4,A,LAB_EB92if b4 hasn't changed just exit
TXAget the port 1 value back
STALAB_47save it as the port 1 last read value
BBC4,A,LAB_EB92if b4 isn't set just exit
AND#$0Felse mask the read value
SEB4,A.
BBS7,LAB_1E,LAB_EB6E.
BEQLAB_EB92.
CMP#$1D.
BCCLAB_EB6E.
LAB_EB92: ; $EB92
RTS
************************************************************************************
??
LAB_EB93: ; $EB93
LDA#$00clear A
STALAB_82.
STALAB_81.
STALAB_83.
LAB_EB9B: ; $EB9B
RTS
************************************************************************************
??
LAB_EB9C: ; $EB9C
LDALAB_1F.
BBS2,A,LAB_EC15.
BBC1,A,LAB_EB9B.
BBS0,A,LAB_EBF0.
LDXLAB_12get the A2D channel 1 byte
TXAcopy it
SECset carry for subtract
SBCLAB_17.
STXLAB_17.
BCCLAB_EBB6.
BBC7,A,LAB_EBB2.
LDA#$7F.
LAB_EBB2: ; $EBB2
LSRA.
LSRA.
BRALAB_EBBE.
LAB_EBB6: ; $EBB6
BBS7,A,LAB_EBBA.
LDA#$80.
LAB_EBBA: ; $EBBA
SEC.
RORA.
SEC.
RORA.
LAB_EBBE: ; $EBBE
LDXLAB_83.
STALAB_84,X.
INX.
TXA.
CLB3,A.
STALAB_83.
TAX.
BEQLAB_EBCD.
JMPLAB_EC67.
LAB_EBCD: ; $EBCD
INX.
LAB_EBCE: ; $EBCE
LDALAB_84,X.
SECset carry for subtract
SBCLAB_86,X.
CLCclear carry for add
ADCLAB_88,X.
SECset carry for subtract
SBCLAB_8A,X.
BPLLAB_EBDEif >= o skip the two's complement
else < 0 so ..
EOR#$FFtoggle the byte
INCAand make 2's complement
LAB_EBDE: ; $EBDE
STALAB_84,X.
DEX.
BPLLAB_EBCE.
CLCclear carry for add
ADCLAB_85.
CMPLAB_0234.
BCCLAB_EC67.
LDALAB_0235.
BRALAB_EC2B.
LAB_EBF0: ; $EBF0
LDXLAB_13get the A2D channel 2 byte
CPXLAB_82.
BEQLAB_EC67.
BCCLAB_EBFC.
STXLAB_82.
BRALAB_EC02.
LAB_EBFC: ; $EBFC
CPXLAB_81.
BCSLAB_EC67.
STXLAB_81.
LAB_EC02: ; $EC02
LDALAB_82.
SECset carry for subtract
SBCLAB_81.
CMPLAB_0236.
BCCLAB_EC67.
STXLAB_82.
STXLAB_81.
LDALAB_0237.
BRALAB_EC2B.
LAB_EC15: ; $EC15
SECset carry for subtract
BBC0,A,LAB_EC1E.
LDALAB_13get the A2D channel 2 byte
SBCLAB_14subtract the A2D channel 3 byte
BRALAB_EC22.
LAB_EC1E: ; $EC1E
LDALAB_14get the A2D channel 3 byte
SBCLAB_13subtract the A2D channel 2 byte
LAB_EC22: ; $EC22
BCCLAB_EC67.
CMPLAB_0238.
BCCLAB_EC67.
LDALAB_28.
LAB_EC2B: ; $EC2B
CLCclear carry for add
ADCLAB_44.
BCSLAB_EC63.
BVCLAB_EC73.
LDALAB_58get the record metered units low byte
LDXLAB_59get the record metered units high byte
INCAincrement the record metered units low byte
BNELAB_EC3Eif no rollover skip the high byte increment
INXincrement the record metered units high byte
BEQLAB_EC46
STXLAB_59save the record metered units high byte
LAB_EC3E: ; $EC3E
STALAB_58save the record metered units low byte
SEB4,LAB_49.
CPX#$00.
BNELAB_EC4B.
LAB_EC46: ; $EC46
DECA.
CMP#$04.
BCCLAB_EC4D.
LAB_EC4B: ; $EC4B
LDA#$04.
LAB_EC4D: ; $EC4D
TSX.
PHA.
ASLA.
ADCLAB_0100,X.
TXS.
TAX.
LDY#$00.
LAB_EC57: ; $EC57
LDALAB_006E,Y.
STALAB_0529,X.
INX.
INY.
CPY#$03.
BCCLAB_EC57.
LAB_EC63: ; $EC63
LDA#$FF.
BRALAB_EC73.
LAB_EC67: ; $EC67
LDALAB_44.
SECset carry for subtract
SBCLAB_0239.
BCCLAB_EC75.
BVCLAB_EC73.
LDA#$00.
LAB_EC73: ; $EC73
STALAB_44.
LAB_EC75: ; $EC75
RTS
************************************************************************************
HE or VE interrupt
LAB_EC76: ; $EC76
RTI
************************************************************************************
??
LAB_EC77: ; $EC77
CLB0,LAB_FEclear the timer 1 interrupt enable bit
SEB5,LAB_F3set b5 port 1 data register, turn MT8870 off
JSRLAB_E679save the integer part of VThreshold * 2.277 in LAB_4F
JSRLAB_E876save VThreshold * 2.277 * A2D channel 3 in LAB_50 ??
JSRLAB_EB93.
LDA#$00clear A
STALAB_44.
STALAB_58clear the record metered units low byte
STALAB_59clear the record metered units high byte
STALAB_40.
STALAB_41.
STALAB_42.
STALAB_43.
STALAB_45.
STALAB_46.
STALAB_54clear the buffered record length
STALAB_55.
STALAB_5A.
STALAB_4Aclear the dialed number buffer index
STALAB_49.
STALAB_48.
STALAB_5B.
STALAB_5C.
STALAB_5D.
STALAB_4Bclear the timer 1 countdown byte
STALAB_4C.
STALAB_4Eclear the seconds countdown word high byte
STALAB_4Dclear the seconds countdown word low byte
LAB_ECB2: ; $ECB2
RTS
************************************************************************************
??
LAB_ECB3:
JSRLAB_EC77.
LAB_ECB6: ; $ECB6
JSR\LAB_FFDCswap the stack pointers
BRALAB_ECB6.
************************************************************************************
??
LAB_ECB9 = *-1
JSRLAB_EC77.
JSRLAB_F424set timer 1 to 5ms
JSRLAB_F077.
SEB5,LAB_5A.
LAB_ECC5: ; $ECC5
CLB0,LAB_49.
JSRLAB_F131.
JSRLAB_F123.
JSRLAB_F179.
LDM#$50,LAB_4C.
LAB_ECD3: ; $ECD3
JSR\LAB_FFDCswap the stack pointers
LDALAB_49.
BBS1,A,LAB_ED05.
BBS4,A,LAB_ED01.
BBS7,A,LAB_ECF9.
BBS6,A,LAB_ECFD.
BBS3,A,LAB_ECF5.
BBS2,A,LAB_ECF1.
LDALAB_4C.
ORALAB_40.
ORALAB_46.
ORALAB_45.
BNELAB_ECD3.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_ECD3.
LAB_ECF1: ; $ECF1
JSR\LAB_FF30.
BRALAB_ECC5.
LAB_ECF5: ; $ECF5
JSR\LAB_FF33.
BRALAB_ECC5.
LAB_ECF9: ; $ECF9
JSR\LAB_FF36.
BRALAB_ECC5.
LAB_ECFD: ; $ECFD
JSR\LAB_FF39.
BRALAB_ECC5.
LAB_ED01: ; $ED01
JSR\LAB_FF3C.
BRALAB_ECC5.
LAB_ED05: ; $ED05
JSR\LAB_FF3F.
BRALAB_ECC5.
LAB_ED09: ; $ED09
LDA#$10.
JSRLAB_F209.
JSRLAB_F06F.
LDY#$00.
LAB_ED13: ; $ED13
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS3,A,LAB_ED59.
BBS7,A,LAB_ED8A.
BBS2,A,LAB_ED13.
LDALAB_2B.
STALAB_4C.
LAB_ED24: ; $ED24
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS3,A,LAB_ED59.
BBS7,A,LAB_ED8A.
BBS2,A,LAB_ED13.
TSTLAB_4C.
BNELAB_ED24.
JMPLAB_EDC0.
LAB_ED38: ; $ED38
LDA#$10.
JSRLAB_F209.
JSRLAB_F06F.
LDALAB_2B.
STALAB_4C.
LDY#$00.
LAB_ED46: ; $ED46
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS2,A,LAB_ED59.
BBS7,A,LAB_ED8A.
BBC3,A,LAB_EDBD.
TSTLAB_4C.
BNELAB_ED46.
BRALAB_ED84.
LAB_ED59: ; $ED59
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS7,A,LAB_ED8A.
BBS2,A,LAB_ED59.
BBS3,A,LAB_ED69.
BBS0,LAB_24,LAB_EDC0.
LAB_ED69: ; $ED69
LDALAB_2B.
STALAB_4C.
LAB_ED6D: ; $ED6D
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS7,A,LAB_ED8A.
BBS2,A,LAB_ED59.
BBS3,A,LAB_ED7D.
BBS0,LAB_24,LAB_EDC0.
LAB_ED7D: ; $ED7D
TSTLAB_4C.
BNELAB_ED6D.
BBC0,LAB_24,LAB_EDC0.
LAB_ED84: ; $ED84
COMLAB_48.
CLB3,LAB_49.
BRALAB_EDBD.
LAB_ED8A: ; $ED8A
JSRLAB_F134.
JSRLAB_F168.
JSRLAB_F187.
SEB0,LAB_56.
JSRLAB_F24F.
JSRLAB_F073.
LAB_ED9B: ; $ED9B
JSRLAB_F1B6make the seconds countdown word = LAB_2A * 8 ??
LDM#$08,LAB_4C.
LAB_EDA1: ; $EDA1
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_ED9B.
LDALAB_49.
BBC7,A,LAB_EDC0.
BBS1,A,LAB_EDC0.
BBS1,LAB_25,LAB_EDA1.
LDALAB_4Eget the seconds countdown word high byte
ORALAB_4DOR with the seconds countdown word low byte
ORALAB_4C.
BNELAB_EDA1.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_EDA1.
LAB_EDBD: ; $EDBD
BBC4,LAB_49,LAB_EDD2.
LAB_EDC0: ; $EDC0
JSRLAB_F176.
JSRLAB_F292.
JSRLAB_F261.
JSRLAB_F2CD.
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
LAB_EDD2: ; $EDD2
JSRLAB_F077.
LAB_EDD5: ; $EDD5
JSRLAB_F131.
LDM#$08,LAB_4C.
LAB_EDDB: ; $EDDB
JSR\LAB_FFDCswap the stack pointers
LDALAB_49.
BBC3,A,LAB_EDED.
BBS2,A,LAB_EDED.
BBS7,A,LAB_EDE9.
TSTLAB_4C.
BNELAB_EDDB.
LAB_EDE9: ; $EDE9
COMLAB_48.
CLB3,LAB_49.
LAB_EDED: ; $EDED
RTS
************************************************************************************
??
LAB_EDEE: ; $EDEE
JSRLAB_F134.
JSRLAB_F187.
JSRLAB_F144.
LDA#$80.
JSRLAB_F209.
JSRLAB_F063.
LDM#$00,LAB_4Eclear the seconds countdown word high byte
LDALAB_23.
STALAB_4Dsave the seconds countdown word low byte
LAB_EE06: ; $EE06
JSR\LAB_FFDCswap the stack pointers
BBS4,LAB_49,LAB_EE16.
BBC7,LAB_49,LAB_EE37.
TSTLAB_4Atest the dialed number buffer index
BNELAB_EE51.
TSTLAB_4Dtest the seconds countdown word low byte
BNELAB_EE06.
LAB_EE16: ; $EE16
JSRLAB_F161.
LDY#$00.
LAB_EE1B: ; $EE1B
JSRLAB_F1B6make the seconds countdown word = LAB_2A * 8 ??
LDM#$08,LAB_4C.
LAB_EE21: ; $EE21
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_EE1B.
BBC7,LAB_49,LAB_EE37.
LDALAB_4Eget the seconds countdown word high byte
ORALAB_4DOR with the seconds countdown word low byte
ORALAB_4C.
BNELAB_EE21.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_EE21.
LAB_EE37: ; $EE37
JSRLAB_F161.
JSRLAB_F190.
BCCLAB_EE4B.
JSRLAB_F292.
JSRLAB_F2CD.
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
LAB_EE4B: ; $EE4B
JSRLAB_F077.
JMPLAB_EDD5.
LAB_EE51: ; $EE51
CLB0,LAB_8C.
LDALAB_1E.
AND#$0F.
BNELAB_EE66.
LDALAB_03C6.
BBS4,A,LAB_EE63.
JSRLAB_F163turn MT8870 off and ??
BRALAB_EE66.
LAB_EE63: ; $EE63
JSRLAB_F15E.
LAB_EE66: ; $EE66
LDA#$08.
STALAB_56.
JSRLAB_F067.
LAB_EE6D: ; $EE6D
JSRLAB_F24F.
LDXLAB_4Aget the dialed number buffer index
SEB1,LAB_5B.
LDALAB_23.
STALAB_4Dsave the seconds countdown word low byte
LAB_EE78: ; $EE78
JSR\LAB_FFDCswap the stack pointers
CPXLAB_4Acompare ?? with the dialed number buffer index
BNELAB_EE6D.
LDALAB_49.
BBS4,A,LAB_EEB0.
BBC7,A,LAB_EE90.
BBC3,A,LAB_EE99.
CPXLAB_29.
BCSLAB_EE93.
COMLAB_48.
CLB3,LAB_49.
BRALAB_EE99.
LAB_EE90: ; $EE90
JMPLAB_EF10.
LAB_EE93: ; $EE93
BBS1,LAB_26,LAB_EEB0.
BBS7,LAB_1F,LAB_EEB0.
LAB_EE99: ; $EE99
TSTLAB_4Dtest the seconds countdown word low byte
BNELAB_EE78.
JSRLAB_F161.
LAB_EEA0: ; $EEA0
JSR\LAB_FFDCswap the stack pointers
LDALAB_49.
BBC7,A,LAB_EF10.
BBS4,A,LAB_EEB0.
BBC3,A,LAB_EEA0.
BBS1,LAB_26,LAB_EEB0.
BBC7,LAB_1F,LAB_EEA0.
LAB_EEB0: ; $EEB0
JSRLAB_F161.
JSRLAB_F168.
SEB0,LAB_56.
JSRLAB_F24F.
JSRLAB_F06B.
LDY#$00.
LAB_EEC0: ; $EEC0
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS1,A,LAB_EF10.
BBC7,A,LAB_EF00.
BBC3,A,LAB_EEC0.
BBS1,LAB_26,LAB_EED3.
BBC7,LAB_1F,LAB_EEC0.
LAB_EED3: ; $EED3
LDM#$08,LAB_4C.
LAB_EED6: ; $EED6
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS1,A,LAB_EF10.
BBC7,A,LAB_EF00.
BBS3,A,LAB_EEE6.
BBS1,LAB_26,LAB_EF31.
LAB_EEE6: ; $EEE6
BBS4,A,LAB_EEEE.
TSTLAB_4C.
BNELAB_EED6.
SEB0,LAB_8C.
LAB_EEEE: ; $EEEE
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBS1,A,LAB_EF10.
BBC7,A,LAB_EF00.
BBS3,A,LAB_EEEE.
BBC1,LAB_26,LAB_EEEE.
BRALAB_EF31.
LAB_EF00: ; $EF00
LDALAB_2C.
STALAB_4Bsave the timer 1 countdown byte
LAB_EF04: ; $EF04
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BBS7,LAB_49,LAB_EF10.
TSTLAB_4Btest the timer 1 countdown byte
BNELAB_EF04loop if not counted out
LAB_EF10: ; $EF10
JSRLAB_F161.
JSRLAB_F176.
JSRLAB_F292.
JSRLAB_F261.
JSRLAB_F39Acopy the dialed number to the record and ??
BBC0,LAB_8C,LAB_EF25.
JSRLAB_F2CD.
LAB_EF25: ; $EF25
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
JSRLAB_F077.
JMPLAB_EDD5.
LAB_EF31: ; $EF31
JSRLAB_EF10.
JSRLAB_F134.
JSRLAB_F176.
LDA#$40.
JSRLAB_F209.
JSRLAB_F07B.
LDY#$00.
LAB_EF44: ; $EF44
JSRLAB_F1B6make the seconds countdown word = LAB_2A * 8 ??
LDM#$08,LAB_4C.
LAB_EF4A: ; $EF4A
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_EF44.
LDALAB_49.
BBC7,A,LAB_EF8F.
BBS3,A,LAB_EF8F.
LDALAB_4Eget the seconds countdown word high byte
ORALAB_4DOR with the seconds countdown word low byte
ORALAB_4C.
BNELAB_EF4A.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_EF4A.
LAB_EF63: ; $EF63
JSRLAB_F134.
JSRLAB_F187.
LDA#$40.
JSRLAB_F209.
JSRLAB_F07B.
LDY#$00.
LAB_EF73: ; $EF73
JSRLAB_F1B6make the seconds countdown word = LAB_2A * 8 ??
LDM#$08,LAB_4C.
LAB_EF79: ; $EF79
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_EF73.
BBC6,LAB_49,LAB_EF8F.
LDALAB_4Eget the seconds countdown word high byte
ORALAB_4DOR with the seconds countdown word low byte
ORALAB_4C.
BNELAB_EF79.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_EF79.
LAB_EF8F: ; $EF8F
JSRLAB_F190.
BCCLAB_EFA0.
JSRLAB_F292.
JSRLAB_F2CD.
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
LAB_EFA0: ; $EFA0
JSRLAB_F077.
JMPLAB_EDD5.
LAB_EFA6: ; $EFA6
LDA#$00.
JSRLAB_F209.
JSRLAB_F05F.
LDY#$00.
LAB_EFB0: ; $EFB0
LDM#$10,LAB_4C.
LAB_EFB3: ; $EFB3
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_EFB0.
LDALAB_49.
BBS7,A,LAB_EFC6.
BBS2,A,LAB_EFC6.
BBS3,A,LAB_EFC6.
TSTLAB_4C.
BNELAB_EFB3.
LAB_EFC6: ; $EFC6
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
JMPLAB_F077.
LAB_EFCF: ; $EFCF
JSRLAB_F134.
JSRLAB_F187.
CLB1,LAB_49.
LDA#$20.
JSRLAB_F209.
JSRLAB_F05B.
JSRLAB_F13C.
LDY#$00clear Y
STYLAB_4Eclear the seconds countdown word high byte
LDX#$00.
BRALAB_EFF6.
LAB_EFEA: ; $EFEA
JSRLAB_F24F.
LDXLAB_4Aget the dialed number buffer index
SEB3,LAB_56.
SEB1,LAB_5B.
JSRLAB_F168.
LAB_EFF6: ; $EFF6
LDALAB_23.
STALAB_4Dsave the seconds countdown word low byte
LAB_EFFA: ; $EFFA
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
CPXLAB_4Acompare ?? with the dialed number buffer index
BNELAB_EFEA.
LDALAB_49.
BBC7,A,LAB_F03D.
BBS1,A,LAB_F03D.
TSTLAB_4Dtest the seconds countdown word low byte
BNELAB_EFFA.
JSRLAB_F161.
TSTLAB_4Atest the dialed number buffer index
BEQLAB_F021.
LAB_F014: ; $F014
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
LDALAB_49.
BBC7,A,LAB_F03D.
BBS1,A,LAB_F03D.
BRALAB_F014.
LAB_F021: ; $F021
JSRLAB_F1B6make the seconds countdown word = LAB_2A * 8 ??
LDM#$08,LAB_4C.
LAB_F027: ; $F027
JSR\LAB_FFDCswap the stack pointers
JSRLAB_F082.
BCCLAB_F021.
BBC7,LAB_49,LAB_F03D.
LDALAB_4Eget the seconds countdown word high byte
ORALAB_4DOR with the seconds countdown word low byte
ORALAB_4C.
BNELAB_F027.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_F027.
LAB_F03D: ; $F03D
JSRLAB_F161.
JSRLAB_F176.
JSRLAB_F292.
JSRLAB_F261.
JSRLAB_F39Acopy the dialed number to the record and ??
JSRLAB_F2CD.
JSRLAB_F352add the record metered units to the meter value and ??
JSRLAB_F452.
JSRLAB_F077.
JMPLAB_EDD5.
LAB_F05B: ; $F05B
LDA#$84.
BRALAB_F07D.
LAB_F05F: ; $F05F
LDA#$85.
BRALAB_F07D.
LAB_F063: ; $F063
LDA#$80.
BRALAB_F07D.
LAB_F067: ; $F067
LDA#$81.
BRALAB_F07D.
LAB_F06B: ; $F06B
LDA#$89.
BRALAB_F07D.
LAB_F06F: ; $F06F
LDA#$82.
BRALAB_F07D.
LAB_F073: ; $F073
LDA#$8A.
BRALAB_F07D.
LAB_F077: ; $F077
LDA#$88.
BRALAB_F07D.
LAB_F07B: ; $F07B
LDA#$83.
LAB_F07D: ; $F07D
STALAB_5C.
SEB0,LAB_5B.
RTS
************************************************************************************
compare ?? with the record metered units low byte ??
return Cb = 0 if different
LAB_F082: ; $F082
CPYLAB_58compare ?? with the record metered units low byte
BEQLAB_F08B.
LDYLAB_58get the record metered units low byte
SEB2,LAB_5B.
CLC.
LAB_F08B: ; $F08B
RTS
************************************************************************************
??
LAB_F08C: ; $F08C
LDX#$00.
STXLAB_0743.
STXLAB_0744.
STXLAB_0745.
STXLAB_0746.
STXLAB_5D.
SEB0,LAB_5B.
SEB1,LAB_5B.
LDALAB_58get the record metered units low byte
ORALAB_59OR with the record metered units high byte
BEQLAB_F0A8if no metered units just exit
SEB2,LAB_5B.
LAB_F0A8: ; $F0A8
CLCflag ok
RTS
************************************************************************************
copy changed A2D bytes to the LAB_0639 buffer ??
LAB_F0AA: ; $F0AA
TXAcopy the write index
PHAsave the write index
LDY#$00clear Y
STYLAB_8Dclear bytes changed flags
INXincrement the write index, make space for flags byte
SEIdisable interrupts
LAB_F0B2: ; $F0B2
LDALAB_0011,Yget the A2D byte
CMPLAB_0743,Ycompare it with the previous value
CLCflag the byte has not changed
BEQLAB_F0C3if the byte is the same skip the save
STALAB_0743,Ysave the new value
STALAB_0639,Xwrite the new value to the buffer
INXincrement the write index
SECflag the byte has changed
LAB_F0C3: ; $F0C3
RORLAB_8Dshift the changed flag into LAB_8D
INYincrement the channel
CPY#$04compare it with max + 1
BCCLAB_F0B2loop if more to do
CLIenable interrupts
PLApull the write index
TSTLAB_8Dtest the bytes changed flags
BEQLAB_F0DBif no bytes changed just exit
TAYcopt the original write index
RRFLAB_8D.
LDA#$F0.
ORALAB_8D.
STALAB_0639,Ysave the flags byte
RTS
LAB_F0DB: ; $F0DB
TAXrestore the write index
RTS
************************************************************************************
??
LAB_F0DD: ; $F0DD
JSRLAB_F0AAcopy changed A2D bytes to the LAB_0639 buffer ??
BBC0,LAB_5B,LAB_F0ED.
LDALAB_5C.
BPLLAB_F0EB.
STALAB_0639,X.
INX.
LAB_F0EB: ; $F0EB
CLB0,LAB_5B.
LAB_F0ED: ; $F0ED
BBC1,LAB_5B,LAB_F104.
LDYLAB_5D.
LAB_F0F2: ; $F0F2
CPYLAB_4Acompare ?? with the dialed number buffer index
BCSLAB_F100.
LDALAB_03C6,Y.
STALAB_0639,X.
INX.
INY.
BRALAB_F0F2.
LAB_F100: ; $F100
STYLAB_5D.
CLB1,LAB_5B.
LAB_F104: ; $F104
BBC2,LAB_5B,LAB_F11D.
LDA#$90.
STALAB_0639,X.
INXincrement the message index
SEIdisable interrupts
LDALAB_58get the record metered units low byte
STALAB_0639,X.
INXincrement the message index
LDALAB_59get the record metered units high byte
STALAB_0639,X.
INXincrement the message index, set the byte count
CLIenable interrupts
CLB2,LAB_5B.
LAB_F11D: ; $F11D
LDA#>LAB_0639set the pointer low byte
LDY#<LAB_0639set the pointer high byte
CLCflag ok
RTS
************************************************************************************
??
LAB_F123: ; $F123
BBS7,LAB_25,LAB_F129.
SEB6,LAB_5A.
RTS
LAB_F129: ; $F129
CLB6,LAB_5A.
LDM#$00,LAB_46.
CLB3,LAB_49.
RTS
************************************************************************************
??
LAB_F131: ; $F131
SEB7,LAB_5A.
RTS
************************************************************************************
??
LAB_F134: ; $F134
CLB7,LAB_5A.
LDM#$00,LAB_45.
CLB2,LAB_49.
RTS
************************************************************************************
turn MT8870 on and ???
LAB_F13C: ; $F13C
CLB5,LAB_F3clear b5 port 1 data register, turn MT8870 on
LDM#$10,LAB_47set the port 1 last read value
SEB3,LAB_5A.
RTS
************************************************************************************
??
LAB_F144: ; $F144
LDALAB_1E.
AND#$0F.
BNELAB_F14C.
ORA#$03.
LAB_F14C: ; $F14C
BBC1,A,LAB_F151.
JSRLAB_F13C.
LAB_F151: ; $F151
BBC0,A,LAB_F15D.
LDA#$00clear A
STALAB_53.
STALAB_51.
STALAB_52.
SEB4,LAB_5A.
LAB_F15D: ; $F15D
RTS
************************************************************************************
??
LAB_F15E: ; $F15E
CLB4,LAB_5A.
RTS
************************************************************************************
??
LAB_F161: ; $F161
CLB4,LAB_5A.
************************************************************************************
turn MT8870 off and ??
LAB_F163: ; $F163
CLB3,LAB_5A.
SEB5,LAB_F3set b5 port 1 data register, turn MT8870 off
RTS
************************************************************************************
??
LAB_F168: ; $F168
BBC1,LAB_25,LAB_F175.
LDA#$00clear A
STALAB_53.
STALAB_51.
STALAB_52.
SEB1,LAB_5A.
LAB_F175: ; $F175
RTS
************************************************************************************
??
LAB_F176: ; $F176
CLB1,LAB_5A.
RTS
************************************************************************************
??
LAB_F179: ; $F179
LDALAB_1F.
BBS6,A,LAB_F181.
AND#$7F.
BNELAB_F18D.
LAB_F181: ; $F181
CLB2,LAB_5A.
LDM#$00,LAB_44.
RTS
************************************************************************************
??
LAB_F187: ; $F187
LDALAB_1F.
AND#$3F.
BEQLAB_F18F.
LAB_F18D: ; $F18D
SEB2,LAB_5A.
LAB_F18F: ; $F18F
RTS
************************************************************************************
??
LAB_F190: ; $F190
BBS4,LAB_49,LAB_F1B4.
LDX#$00.
SEIdisable interrupts
LAB_F196: ; $F196
LDALAB_6E,X.
STALAB_71,X.
INX.
CPX#$03.
BCCLAB_F196.
CLIenable interrupts
LDALAB_73.
BNELAB_F1B4.
LDALAB_71.
LSRLAB_72.
RORA.
LSRLAB_72.
RORA.
LSRLAB_72.
BNELAB_F1B4.
RORA.
CMPLAB_21.
RTS
LAB_F1B4: ; $F1B4
SEC.
RTS
************************************************************************************
make the seconds countdown word = LAB_2A * 8 ??
LAB_F1B6: ; $F1B6
SEIdisable interrupts
LDALAB_2A.
LDM#$00,LAB_4Eclear the seconds countdown word high byte
ASLA* 2 low byte
ROLLAB_4E* 2 high byte
ASLA* 4 low byte
ROLLAB_4E* 4 high byte
ASLA* 8 low byte
ROLLAB_4E* 8 high byte
STALAB_4Dsave the seconds countdown word low byte
CLIenable interrupts
RTS
************************************************************************************
copy the current date/time to LAB_051F ??
LAB_F1C9: ; $F1C9
LDX#$06set the count/index
SEIdisable interrupts
LAB_F1CC: ; $F1CC
LDALAB_66,Xget a current date/time byte
STALAB_051F,X.
DEXdecrement the count/index
BPLLAB_F1CCloop if more to do
CLIenable interrupts
RTS
************************************************************************************
compress YY:MM:DD in X:A:Y into AX
LAB_F1D6: ; $F1D6
STXLAB_0748save the year
STYLAB_0747save the date
ASLAx xxxM MMM.
ASLAx xxMM MM..
ASLAx xMMM M...
ASLAx MMMM ....
ASLAM MMM. ....
ROLLAB_0748shift the high bit of the month into the year
ORALAB_0747OR with the date, gives MMMD DDDD
LDXLAB_0748get the year, gives YYYY YYYM
RTS
************************************************************************************
compress HH:MM:SS in X:A:Y into AX and Cb
LAB_F1EB: ; $F1EB
STXLAB_0749save the hours
STYLAB_074Asave the seconds
ASLA. .MMM MMM.
ASLA. MMMM MM..
ASLAM MMMM M...
ROLLAB_0749. ..HH HHHM shift the minutes bit into the hour
ASLAM MMMM ....
ROLLAB_0749. .HHH HHMM shift the minutes bit into the hour
ASLAM MMM. ....
ROLLAB_0749. HHHH HMMM shift the minutes bit into the hour
LDXLAB_0749. HHHH HMMM get the hour/minute
LSRLAB_074AS ...S SSSS shift the seconds low bit into Cb
ORALAB_074AS MMMS SSSS OR in the seconds
RTS
************************************************************************************
??
LAB_F209: ; $F209
STALAB_56.
LDA#$00clear A
STALAB_55.
TAX.
LAB_F210: ; $F210
STALAB_6E,X.
STALAB_0526,X.
STALAB_0529,X.
INX.
CPX#$03.
BCCLAB_F210.
JSRLAB_F1C9copy the current date/time to LAB_051F ??
LDXLAB_051Fget the ?? year
LDALAB_0520get the ?? month
LDYLAB_0521get the ?? date
JSRLAB_F1D6compress YY:MM:DD in X:A:Y into AX
STXLAB_074Dsave the buffered record year/month
STALAB_074Esave the buffered record month/date
LDXLAB_0522get the ?? hours
LDALAB_0523get the ?? minutes
LDYLAB_0524get the ?? seconds
JSRLAB_F1EBcompress HH:MM:SS in X:A:Y into AX and Cb
STXLAB_074Fsave the buffered record hours/minutes
STALAB_0750save the buffered record minutes/seconds
LDA#$00clear A
BCCLAB_F249if the seconds low bit is clear skip the bit set
SEB7,Aset the seconds low bit
LAB_F249: ; $F249
STALAB_57.
LDM#$07,LAB_54set the buffered record length
RTS
************************************************************************************
??
LAB_F24F: ; $F24F
SEIdisable interrupts
LDALAB_6E.
STALAB_0526.
LDALAB_6F.
STALAB_0527.
LDALAB_70.
STALAB_0528.
CLIenable interrupts
RTS
************************************************************************************
??
LAB_F261: ; $F261
LDX#$00.
LDY#$00.
LAB_F265: ; $F265
LDALAB_0526,X.
STALAB_71,X.
BEQLAB_F26D.
TAY.
LAB_F26D: ; $F26D
INX.
CPX#$03.
BCCLAB_F265.
TYA.
BEQLAB_F291.
LDX#$04.
LAB_F277: ; $F277
LSRLAB_73.
RORLAB_72.
RORLAB_71.
DEX.
BNELAB_F277.
LDALAB_71.
LDXLAB_72.
STALAB_0754.
STXLAB_0755.
BCCLAB_F28E.
SEB6,LAB_57.
LAB_F28E: ; $F28E
LDM#$0B,LAB_54set the buffered record length
LAB_F291: ; $F291
RTS
************************************************************************************
??
LAB_F292: ; $F292
LDX#$00clear the index
LDY#$03set the count
SEIdisable interrupts
SECset carry for subtract
LAB_F298: ; $F298
LDALAB_6E,X.
SBCLAB_0526,X.
STALAB_71,X.
INXincrement the index
DEYdecrement the count
BNELAB_F298loop if more to do
CLIenable interrupts
LDALAB_71.
AND#$0F.
ORALAB_57.
STALAB_57.
LDX#$04.
LAB_F2AE: ; $F2AE
LSRLAB_73.
RORLAB_72.
RORLAB_71.
DEX.
BNELAB_F2AE.
LDALAB_73.
BEQLAB_F2BF.
DEX.
TXA.
BRALAB_F2C3.
LAB_F2BF: ; $F2BF
LDALAB_71.
LDXLAB_72.
LAB_F2C3: ; $F2C3
STALAB_0752.
STXLAB_0753.
LDM#$09,LAB_54set the buffered record length
RTS
************************************************************************************
??
LAB_F2CD: ; $F2CD
BBC4,LAB_49,LAB_F2FD.
LDX#$00.
LAB_F2D2: ; $F2D2
LDALAB_0529,X.
STALAB_71,X.
INX.
CPX#$03.
BCCLAB_F2D2.
LDX#$04.
LAB_F2DE: ; $F2DE
LSRLAB_73.
RORLAB_72.
RORLAB_71.
DEX.
BNELAB_F2DE.
LDYLAB_54get the buffered record length
LDALAB_71.
STALAB_074B,Y.
LDALAB_72.
STALAB_074C,Y.
INY.
INY.
STYLAB_54save the buffered record length
BCCLAB_F2FB.
SEB6,LAB_55.
LAB_F2FB: ; $F2FB
SEB7,LAB_55.
LAB_F2FD: ; $F2FD
RTS
************************************************************************************
??
LAB_F2FE: ; $F2FE
LDX#$00.
LAB_F300: ; $F300
PHA.
SECset carry for subtract
LDALAB_052C,X.
SBCLAB_0529,X.
STALAB_71.
LDALAB_052D,X.
SBCLAB_052A,X.
STALAB_72.
LDALAB_052E,X.
SBCLAB_052B,X.
STALAB_73.
BEQLAB_F33E.
CPX#$0C.
BCCLAB_F337.
LDA#$04.
LAB_F322: ; $F322
LSRLAB_73.
RORLAB_72.
RORLAB_71.
DECA.
BNELAB_F322.
LDALAB_73.
BNELAB_F337.
BCCLAB_F333.
SEB5,LAB_57.
LAB_F333: ; $F333
SEB4,LAB_57.
BRALAB_F33E.
LAB_F337: ; $F337
LDA#$FF.
STALAB_074B,Y.
BRALAB_F345.
LAB_F33E: ; $F33E
LDALAB_71.
STALAB_074B,Y.
LDALAB_72.
LAB_F345: ; $F345
INY.
STALAB_074B,Y.
INY.
INX.
INX.
INX.
PLA.
DECA.
BNELAB_F300.
RTS
************************************************************************************
add the record metered units to the meter value and ??
LAB_F352: ; $F352
LDALAB_58get the record metered units low byte
ORALAB_59OR with the record metered units high byte
BEQLAB_F395if no metered units go ?? and exit
SEIdisable interrupts
CLCclear carry for add
LDALAB_58get the record metered units low byte
ADCLAB_36add the meter value low byte
STALAB_36save the meter value low byte
LDALAB_59get the record metered units high byte
ADCLAB_37add the meter value mid byte
STALAB_37save the meter value mid byte
BCCLAB_F36Aif no carry skip the high byte increment
INCLAB_38increment the meter value high byte
LAB_F36A: ; $F36A
SEB1,LAB_56.
LDYLAB_54get the buffered record length
TSTLAB_59test the record metered units high byte
BNELAB_F37B.
LDALAB_58get the record metered units low byte
DECA.
BEQLAB_F380.
CMP#$04.
BCCLAB_F37D.
LAB_F37B: ; $F37B
LDA#$04.
LAB_F37D: ; $F37D
JSRLAB_F2FE.
LAB_F380: ; $F380
LDALAB_58get the record metered units low byte
STALAB_074B,Y.
INY.
LDALAB_59get the record metered units high byte
STALAB_074B,Y.
INY.
STYLAB_54save the buffered record length
LDA#$00clear A
STALAB_58clear the record metered units low byte
STALAB_59clear the record metered units high byte
CLIenable interrupts
LAB_F395: ; $F395
CLB2,LAB_5B.
CLB4,LAB_49.
RTS
************************************************************************************
copy the dialed number to the record and ??
LAB_F39A: ; $F39A
JSRLAB_F161.
TSTLAB_4Atest the dialed number buffer index
BEQLAB_F3CAif no dialed number just exit
clear the record buffer dialed number
LDX#$35set the byte count
LDY#$00clear the index
TYAclear A
LAB_F3A6: ; $F3A6
STALAB_0756,Yclear a digit in the record buffer dialed number
INYincrement the index
DEXdecrement the count
BNELAB_F3A6loop if more to do
TAYclear the record digit index
LAB_F3AE: ; $F3AE
JSRLAB_F3FEget a digit from the dialed number buffer and increment
the index
BCSLAB_F3BAif done go ?? and exit
BBS4,A,LAB_F3CB.
JSRLAB_F407save a digit to the record and increment the index
BCCLAB_F3AEif the index < max go get another digit
LAB_F3BA: ; $F3BA
TYAcopy the record digit index
INCA+ 1
LSRA/ 2 gives the number length in bytes
CLCclear carry for add
ADC#$0Badd the offset to the number start
STALAB_54save the buffered record length
LDA#$00clear A
STALAB_4Aclear the dialed number buffer index
STALAB_5D.
CLB1,LAB_5B.
LAB_F3CA: ; $F3CA
RTS
the dialed digit had b4 set so ??
LAB_F3CB: ; $F3CB
INYincrement the record digit index ??
INYincrement the record digit index ??
STYLAB_8Esave the record digit index ??
LDM#$1F,LAB_8F.
LAB_F3D2: ; $F3D2
JSRLAB_F407save a digit to the record and increment the index
BCSLAB_F3E3if the index >= max skip ??
DECLAB_8F.
BEQLAB_F3E3.
JSRLAB_F3FEget a digit from the dialed number buffer and increment
the index
BCSLAB_F3E3.
BBS4,A,LAB_F3D2.
DEX.
LAB_F3E3: ; $F3E3
TYAcopy Y
LDY#$07.
PHAsave Y
SECset carry for subtract
SBCLAB_8Esubtract the record digit index ??
PHA.
CMP#$10.
TYA.
ROLA.
LDYLAB_8Eget the record digit index ??
DEYdecrement the record digit index ??
DEYdecrement the record digit index ??
JSRLAB_F407save a digit to the record and increment the index
PLA.
JSRLAB_F407save a digit to the record and increment the index
PLApull Y
TAYrestore Y
BRALAB_F3AEgo get another digit
************************************************************************************
get a digit from the dialed number buffer and increment the index
LAB_F3FE: ; $F3FE
CPXLAB_4Acompare the number copy index with the dialed number
buffer length
BCSLAB_F406if > length just exit
LDALAB_03C6,Xelse get a dialed number digit
INXincrement the number copy index
LAB_F406: ; $F406
RTS
************************************************************************************
save a digit to the record and increment the index
LAB_F407: ; $F407
CPY#$44compare the index with the max + 1
BCSLAB_F423if > max just exit
AND#$0Fmask the digit
PHAsave A
TYAcopy the index
LSRA/ 2, shift b0 to Cb
TAYrestore the shifted index
PLArestore A
BCSLAB_F419if carry set go OR in the low nibble
ASLAelse shift the ..
ASLA.. low nibble ..
ASLA.. to the high ..
ASLA.. nibble
CLCensure Cb is clear, it /should/ be anyway
LAB_F419: ; $F419
ORALAB_0756,YOR with the high nibble
STALAB_0756,Ysave the nibbles
TYAcopy the shifted index
ROLA* 2, shift b0 back in, also clear Cb
TAYrestore the index
INYincrement the digit index
LAB_F423: ; $F423
RTS
************************************************************************************
set timer 1 to 5ms
LAB_F424: ; $F424
LDM#$23,LAB_DCset prescaller 1 to (1/(35+1)) * (1/16) * XTAL Hz
this will be 12800 Hz with a 7.3728MHz XTAL
LDM#$3F,LAB_DDset timer 1 to (1/(63+1)) * 12800 Hz =5ms
CLB1,LAB_FEclear the timer 1 interrupt request bit
SEB0,LAB_FEset the timer 1 interrupt enable bit
RTS
************************************************************************************
??
LAB_F42F: ; $F42F
LDY#$00clear Y
LDXLAB_020Cget the RAM start low byte
LDALAB_020Dget the RAM start high byte
STYLAB_92clear the record memory start pointer low byte
STXLAB_93save the record memory start pointer mid byte
STALAB_94save the record memory start pointer high byte
STYLAB_95clear the record memory end pointer low byte
STXLAB_96save the record memory end pointer mid byte
STALAB_97save the record memory end pointer high byte
STYLAB_39.
STYLAB_3A.
STYLAB_3B.
STYLAB_3C.
STYLAB_36clear the meter value low byte
STYLAB_37clear the meter value mid byte
STYLAB_38clear the meter value high byte
RTS
************************************************************************************
copy the buffered record to memory ??
LAB_F452: ; $F452
LDALAB_54get the buffered record length
ORALAB_55.
STALAB_074B.
LDALAB_56.
BBC0,LAB_49,LAB_F45F.
SEB2,A.
LAB_F45F: ; $F45F
STALAB_074C.
LDALAB_57.
STALAB_0751.
LDYLAB_92get the record memory start pointer low byte
LDXLAB_93get the record memory start pointer mid byte
LDALAB_94get the record memory start pointer high byte
LAB_F46D: ; $F46D
JSRLAB_F502check if room in memory for a new record ??
BCCLAB_F48Bif room go copy the record to memory
LDYLAB_92get the record memory start pointer low byte
LDXLAB_93get the record memory start pointer mid byte
LDALAB_94get the record memory start pointer high byte
JSRLAB_F4C6increment, check and rollover the YXA word ??
STYLAB_92save the record memory start pointer low byte
STXLAB_93save the record memory start pointer mid byte
STALAB_94save the record memory start pointer high byte
TSTLAB_3B.
BNELAB_F487.
DECLAB_3C.
LAB_F487: ; $F487
DECLAB_3B.
BRALAB_F46D.
LAB_F48B: ; $F48B
LDA#$00clear the record buffer index
PHAsave the record buffer index
LDYLAB_95get the record memory end pointer low byte
LDXLAB_96get the record memory end pointer mid byte
LDALAB_97get the record memory end pointer high byte
BRALAB_F4AEbranch into the copy loop
LAB_F496: ; $F496
LDALAB_074B,Xget a byte from the record buffer
STA(LAB_90),Ysave it to the record in memory
INXincrement the record buffer index
INYincrement the record memory index
STYLAB_95save the record memory end pointer low byte
BNELAB_F4B3if no rollover skip the record pointer rollover
TXAcopy the record buffer index
PHAsave the record buffer index
LDXLAB_96get the record memory end pointer mid byte
LDALAB_97get the record memory end pointer high byte
JSRLAB_F4DAincrement, check and rollover the XA word ??
STXLAB_96save the record memory end pointer mid byte
STALAB_97save the record memory end pointer high byte
LAB_F4AE: ; $F4AE
JSRLAB_F4EDset RAM A16 from A and ??
PLApull the record buffer index
TAXrestore the record buffer index
LAB_F4B3: ; $F4B3
CPXLAB_54compare the record buffer index with the buffered record
length
BCCLAB_F496loop if more record bytes to copy
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
INCLAB_39increment the calls logged low byte ??
BNELAB_F4BFif no rollover skip the high byte increment
INCLAB_3Aincrement the calls logged high byte ??
LAB_F4BF: ; $F4BF
INCLAB_3Bincrement the ?? low byte
BNELAB_F4C5if no rollover skip the high byte increment
INCLAB_3Cincrement the ?? high byte
LAB_F4C5: ; $F4C5
RTS
************************************************************************************
increment, check and rollover the YXA word ??
LAB_F4C6: ; $F4C6
PHAsave the XA word high byte
JSRLAB_F4EDset RAM A16 from A and ??
LDA(LAB_90),Yget the record length ??
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
AND#$3Fmask 00xx xxxx, the record length bits ??
STALAB_91save the record RAM pointer high byte
TYA.
CLCclear carry for add
ADCLAB_91add the record RAM pointer high byte
TAY.
PLArestore the XA word high byte
BCCLAB_F4EC.
************************************************************************************
increment, check and rollover the XA word ??
LAB_F4DA: ; $F4DA
INXincrement the word low byte
BNELAB_F4DEif no rollover skip the high byte increment
INCAelse increment the high byte
LAB_F4DE: ; $F4DE
CMPLAB_03compare ?? with the RAM end high byte
BNELAB_F4EC.
CPXLAB_02zompare ?? with the RAM end low byte
BNELAB_F4EC.
LDXLAB_020Cget the RAM start low byte
LDALAB_020Dget the RAM start high byte
LAB_F4EC: ; $F4EC
RTS
************************************************************************************
set RAM A16 from A and ??
LAB_F4ED: ; $F4ED
CLB4,LAB_F6clear b4 port 0 data register, clear RAM A16
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
BBC0,A,LAB_F4F5.
SEB4,LAB_F6set b4 port 0 data register, set RAM A16
LAB_F4F5: ; $F4F5
BBC1,A,LAB_F4F9.
SEB5,LAB_F5set b5 port 0 function register, port 0 b5 = DME
LAB_F4F9: ; $F4F9
TXA.
EOR#$80.
STALAB_91save the record RAM pointer high byte
LDM#$00,LAB_90clear the record RAM pointer low byte
RTS
************************************************************************************
check if room in memory for a new record ??
Y = record memory start pointer low byte
X = record memory start pointer mid byte
A = record memory start pointer high byte
LAB_F502: ; $F502
PHAsave the record memory start pointer high byte
TYAcopy the record memory start pointer low byte
SECset carry for subtract
SBCLAB_95subtract the record memory end pointer low byte
TAYcopy the record length low byte
TXAcopy the record memory start pointer mid byte
SBCLAB_96subtract the record memory end pointer mid byte
TAXcopy the record length mid byte
PLArestore the record memory start pointer high byte
SBCLAB_97subtract the record memory end pointer high byte
BCSLAB_F519.
record memory start pointer < record memory end pointer
PHA.
TXA.
ADCLAB_04add the RAM size low byte
TAX.
PLA.
ADCLAB_05add the RAM size high byte
LAB_F519: ; $F519
BNELAB_F524.
DEX.
BNELAB_F524.
CPYLAB_54compare ?? with the buffered record length
BCSLAB_F524.
SECflag no room
RTS
LAB_F524: ; $F524
CLCflag room
RTS
************************************************************************************
copy the next record to the record buffer
return Cb = 1 if error
LAB_F526: ; $F526
LDYLAB_A1get the next record pointer low byte
LDXLAB_A2get the next record pointer mid byte
LDALAB_A3get the next record pointer high byte
CMPLAB_97compare it with the record memory end pointer high byte
BNELAB_F538if not the same go get a record
CPXLAB_96compare it with the record memory end pointer mid byte
BNELAB_F538if not the same go get a record
CPYLAB_95compare it with the record memory end pointer low byte
BEQLAB_F56Cif the same go do error exit
LAB_F538: ; $F538
JSRLAB_F4EDset RAM A16 from A and ??
LDA(LAB_90),Yget the record length
AND#$3Fmask 00xx xxxx, the record length
BEQLAB_F56Cif zero length record go do error exit
STALAB_A4save the buffered record length
LDX#$00clear the record buffer index
BRALAB_F564branch into the loop
LAB_F547: ; $F547
LDA(LAB_90),Yget a record byte
STALAB_078E,Xsave it to the record buffer
INXincrement the record buffer index
INYincrement the record index
STYLAB_A1save the next record pointer low byte
BNELAB_F564if no rollover skip the record pointer rollover
TXAcopy the record buffer index
PHAsave the record buffer index
LDXLAB_A2get the next record pointer mid byte
LDALAB_A3get the next record pointer high byte
JSRLAB_F4DAincrement, check and rollover the XA word ??
STXLAB_A2save the next record pointer mid byte
STALAB_A3save the next record pointer high byte
JSRLAB_F4EDset RAM A16 from A and ??
PLApull the record buffer index
TAXrestore the record buffer index
LAB_F564: ; $F564
CPXLAB_A4compare record buffer index with the buffered record
length
BCCLAB_F547loop if more record bytes to copy
CLCflag ok
LAB_F569: ; $F569
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
RTS
LAB_F56C: ; $F56C
SECflag error
BRALAB_F569go exit
************************************************************************************
??
LAB_F56F: ; $F56F
LDY#$00clear the index
LAB_F571: ; $F571
LDALAB_0790,Y.
CMPLAB_0739,Y.
BNELAB_F588.
INYincrement the index
CPY#$04compare with max + 1
BCCLAB_F571loop if more to do
LDALAB_0794.
SBCLAB_073D.
AND#$80.
BEQLAB_F5AD.
LAB_F588: ; $F588
BCCLAB_F5AD.
LDY#$00clear the index
LAB_F58C: ; $F58C
LDALAB_0790,Y.
CMPLAB_073E,Y.
BNELAB_F5A3.
INYincrement the index
CPY#$04compare with max + 1
BCCLAB_F58Cloop if more to do
LDALAB_0794.
SBCLAB_0742.
AND#$80.
BEQLAB_F5A5.
LAB_F5A3: ; $F5A3
BCSLAB_F5B0.
LAB_F5A5: ; $F5A5
LDALAB_078F.
ANDLAB_7C.
CLV.
CLC.
RTS
LAB_F5AD: ; $F5AD
CLV.
SEC.
RTS
LAB_F5B0: ; $F5B0
BITLAB_F5B4.
SEC.
LAB_F5B4: ; $F5B4
RTS
************************************************************************************
??
LAB_F5B5: ; $F5B5
LDY#$03set the count
LDX#$00clear the index
SECset carry for subtract
LAB_F5BA: ; $F5BA
LDALAB_95,Xget a record memory end pointer byte
SBCLAB_92,Xsubtract record memory start pointer byte
STALAB_3D,X.
INXincrement the index
DEYdecrement the count
BNELAB_F5BAloop if more to do
BCSLAB_F5D2if no carry out go return the error
LDALAB_3E.
ADCLAB_04add the RAM size low byte
STALAB_3E.
LDALAB_3F.
ADCLAB_05add the RAM size high byte
STALAB_3F.
LAB_F5D2: ; $F5D2
RTS
************************************************************************************
??
LAB_F5D3: ; $F5D3
JSRLAB_E1CEset 1/4 second countdown
LDX#$00clear A
TXAclear the index
LAB_F5D9: ; $F5D9
STALAB_98,X.
INXincrement the index
CPX#$09compare the index with max + 1
BCCLAB_F5D9loop if more to do
LDYLAB_92get the record memory start pointer low byte
LDXLAB_93get the record memory start pointer mid byte
LDALAB_94get the record memory start pointer high byte
STYLAB_A1save the next record pointer low byte
STXLAB_A2save the next record pointer mid byte
STALAB_A3save the next record pointer high byte
LAB_F5EC: ; $F5EC
STYLAB_078B.
STXLAB_078C.
STALAB_078D.
LAB_F5F5: ; $F5F5
JSR\LAB_FFDCswap the stack pointers
JSRLAB_E1C2if ?? put a byte in the Tx buffer ??
JSRLAB_F526copy the next record to the record buffer
BCSLAB_F64Aif error go ??
JSRLAB_F56F.
BCCLAB_F618.
BVSLAB_F5F5.
BNELAB_F60C.
INCLAB_98.
BRALAB_F610.
LAB_F60C: ; $F60C
TSTLAB_98.
BNELAB_F5F5.
LAB_F610: ; $F610
LDYLAB_A1get the next record pointer low byte
LDXLAB_A2get the next record pointer mid byte
LDALAB_A3get the next record pointer high byte
BRALAB_F5EC.
LAB_F618: ; $F618
BEQLAB_F5F5.
INCLAB_99.
BNELAB_F620.
INCLAB_9A.
LAB_F620: ; $F620
LDALAB_078F.
LDYLAB_A4get the buffered record length
BBC1,A,LAB_F63A.
CLCclear carry for add
LDALAB_078C,Y.
ADCLAB_9B.
STALAB_9B.
LDALAB_078D,Y.
ADCLAB_9C.
STALAB_9C.
BCCLAB_F63A.
INCLAB_9D.
LAB_F63A: ; $F63A
CLCclear carry for add
TYA.
ADCLAB_9E.
STALAB_9E.
BCCLAB_F648.
INCLAB_9F.
BNELAB_F648.
INCLAB_A0.
LAB_F648: ; $F648
BRALAB_F5F5.
LAB_F64A: ; $F64A
LDYLAB_078B.
LDXLAB_078C.
LDALAB_078D.
STYLAB_A1save the next record pointer low byte
STXLAB_A2save the next record pointer mid byte
STALAB_A3save the next record pointer high byte
LDA#>LAB_98set the return message pointer low byte
LDY#<LAB_98set the return message pointer high byte
LDX#$09set the byte count
CLCflag ok
RTS
************************************************************************************
fill the message buffer with records ??
LAB_F661: ; $F661
JSRLAB_E1CEset 1/4 second countdown
LDX#$00clear the message buffer index
LAB_F666: ; $F666
JSR\LAB_FFDCswap the stack pointers
JSRLAB_E1C2if ?? put a byte in the Tx buffer ??
TXAcopy X
PHAsave X
JSRLAB_F526copy the next record to the record buffer
PLApull X
TAXrestore X
BCSLAB_F68Dif error just exit
JSRLAB_F56F.
BCSLAB_F666.
BEQLAB_F666.
LDY#$00clear the record buffer index
LAB_F67D: ; $F67D
LDALAB_078E,Yget a record buffer byte
STALAB_0639,Xsave it to the message buffer
INXincrement the message buffer index
INYincrement the record buffer index
CPYLAB_A4compare the record index with the buffered record length
BCCLAB_F67Dloop if more bytes to copy
CPX#$BEcompare X with the maximum length - one record
BCCLAB_F666loop if room for another record
LAB_F68D: ; $F68D
RTS
************************************************************************************
RESET enters here
LAB_F68E: ; $F68E
CLTclear T mode
CLDclear decimal mode
SEIdisable interrupts
LDX#$00set the delay inner loop count
LDY#$00set the delay outer loop count
LAB_F695: ; $F695
DEXdecrement the inner loop count
BNELAB_F695loop if more to do
DEYdecrement the outer loop count
BNELAB_F695loop if more to do
TYAclear A
LAB_F69C: ; $F69C
STALAB_0100,Yclear a stack byte
INYincrement the index
BNELAB_F69Cloop if more to do
STALAB_FFclear interrupt control register 1
STALAB_FEclear interrupt control register 2
STALAB_FDclear interrupt control register 3
STALAB_E6clear the UART control register
bit function
--- --------
7 0 = Rx disabled
6 0 = Tx disabled
5 0 = unused
4 0 = Rx interrupt disabled
3 0 = Xin/8
2 0 = even parity
1 0 = parity disabled
0 0 = 7 bit
LDM#$60,LAB_F6?? port 0 data register
LDM#$7C,LAB_F7set IOOO OOII, port 0 data direction register
LDA#$40set port 0 function
bit function
--- --------
7 unused
6 1 = b6 = TxD
5 0 = b5 = b5
4 0 = b4 = b4
3 0 = b3 = b3
2 0 = b2 = b2
1-0 unused
STALAB_F5write port 0 function register
LDM#$60,LAB_F3write port 1 data register
bit function
--- --------
7 unused ??
6 turn vref off
5 turn MT8870 off
4-0 inputs
LDM#$E0,LAB_F4set OOOI IIII, port 1 data direction register
LDM#$00,LAB_F0clear port 2 data register
bit function
--- --------
7 ring detect
6 podem power control
5 modem mode, 1/0 originate/answer ??
4 CD from modem
3 modem/RS232 select
2-0 x = unused
LDM#$6F,LAB_F1set IOOI OOOO, port 2 data direction register
LDM#$FF,LAB_EFset OOOO OOOO, port 3 data direction register
LDM#$FF,LAB_EE?? port 3 data register
LDX#$FFset X
TXSset the stack pointer
JSRLAB_E087test the RAM ??
JSRLAB_E12Dcopy the vector table and values from LAB_E0DD
JSRLAB_E3C6set the default password
LDA#$00clear A
STALAB_1Aclear the 1/8th second countdown byte
STALAB_1Bclear the seconds countdown
STALAB_5Eclear the carrier detect
STALAB_0386.
STALAB_0396.
STALAB_03B6clear the ringback number buffer
STALAB_0402.
STALAB_39.
STALAB_3A.
STALAB_3B.
STALAB_3C.
STALAB_36clear the meter value low byte
STALAB_37clear the meter value mid byte
STALAB_38clear the meter value high byte
JSRLAB_E14Ecopy the default variable values to RAM
JSRLAB_E78Fset the default dates and times
SEB2,LAB_FFset INT2 enable bit
CLIenable interrupts
************************************************************************************
main loop
LAB_F6FD: ; $F6FD
JSRLAB_E747setup the UART and timer 2 and clear the Tx/Rx buffers ??
JSRLAB_E72Erelease the line and wait 2 seconds
CLB6,LAB_F0clear b6 port 2 data register, turn the modem on
CLB5,LAB_F0clear b5 port 2 data register, set answer mode
CLB1,LAB_FFclear INT1 request bit
SEB0,LAB_FFset INT1 enable bit
LAB_F70B: ; $F70B
JSR\LAB_FFDCswap the stack pointers
BBS0,LAB_FE,LAB_F713if timer 1 interrupt enabled continue
STPelse stop the oscillator
BRALAB_F714continue after wake up
LAB_F713: ; $F713
WITstop the internal clock
LAB_F714: ; $F714
BBS7,LAB_F0,LAB_F71Ctest b7 port 2 data register, ring detect
if ring detected go setup the URAT and check for carrier
BBS0,LAB_FF,LAB_F70Bin INT1 not enabled go back to waiting
BRALAB_F724go continue connected mode
LAB_F71C: ; $F71C
JSRLAB_E752setup the UART and timer 2 and clear the Tx/Rx buffers ??
JSRLAB_E6F0wait 15 seconds for two seconds of new carrier
LAB_F722: ; $F722
BCSLAB_F6FDif error return to the main loop
LAB_F724: ; $F724
LDM#$14,LAB_1Bset the seconds countdown to 20 seconds
LAB_F727: ; $F727
JSR\LAB_FF2Areceive and execute a command via LAB_021C vector ??
BCCLAB_F727if no error go do another command
JSRLAB_E789wait for timer 2 ??
JSRLAB_E73Dwait for 1/2 a second
BBS0,LAB_0A,LAB_F6FDtest the command loop flag, return to the main loop
BBC1,LAB_0A,LAB_F6FDtest the command loop flag, dial an outgoing number
JSRLAB_E60Edial an outgoing number
BRALAB_F722return to the command loop
************************************************************************************
unused, the assembler should fill this area with $FF bytes
LAB_F73C:
************************************************************************************
.ORG$FF00
LAB_FF00: ; $FF00
JMP(LAB_0200).
LAB_FF03: ; $FF03
JMP(LAB_0202).
LAB_FF06: ; $FF06
JMP(LAB_0204).
LAB_FF09: ; $FF09
JMP(LAB_0206).
LAB_FF0C: ; $FF0C
JMP(LAB_0208).
LAB_FF0F:
JMP(LAB_020A).
LAB_FF12:
JMP(LAB_020C).
LAB_FF15:
JMP(LAB_020E).
LAB_FF18:
JMP(LAB_0210).
LAB_FF1B:
JMP(LAB_0212).
LAB_FF1E:
JMP(LAB_0214).
LAB_FF21:
JMP(LAB_0216).
LAB_FF24: ; $FF24
JMP(LAB_0218)wait for a character from ??
LAB_FF27: ; $FF27
JMP(LAB_021A)put a byte in the Tx buffer
LAB_FF2A: ; $FF2A
JMP(LAB_021C)receive and execute a command ??
LAB_FF2D:
JMP(LAB_021E).
LAB_FF30: ; $FF30
JMP(LAB_0220).
LAB_FF33: ; $FF33
JMP(LAB_0222).
LAB_FF36: ; $FF36
JMP(LAB_0224).
LAB_FF39: ; $FF39
JMP(LAB_0226).
LAB_FF3C: ; $FF3C
JMP(LAB_0228).
LAB_FF3F: ; $FF3F
JMP(LAB_022A).
LAB_FF42:
JMP(LAB_022C).
LAB_FF45:
JMP(LAB_022E).
LAB_FF48:
JMP(LAB_0230).
LAB_FF4B:
JMP(LAB_0232).
LAB_FF4E:
JMP(LAB_0234).
LAB_FF51:
JMP(LAB_0236).
LAB_FF54:
JMP(LAB_0238).
LAB_FF57:
JMP(LAB_023A).
LAB_FF5A:
JMP(LAB_023C).
LAB_FF5D:
JMP(LAB_023E).
************************************************************************************
unused, the assembler should fill this area with $FF bytes
LAB_FF60:
************************************************************************************
swap the stack pointers
.ORG$FFDC
LAB_FFDC: ; $FFDC
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
TSXcopy the stack pointer
LDALAB_00get the alternate stack pointer
STXLAB_00save this stack pointer
TAXcopy the alternate pointer to X
TXSset the stack pointer
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTS
************************************************************************************
swap the stack pointers and stop the internal clock
LAB_FFEE: ; $FFEE
JSR\LAB_FFDCswap the stack pointers
WITstop the internal clock
RTS
************************************************************************************
unused
LAB_FFF2:
STPelse stop the oscillator
RTS
************************************************************************************
processor vectors
.ORG $FFF4 ; vectors start address
.WORDLAB_FF00TC, CNTR or BRK
.WORDLAB_FF03HE or VE
.WORDLAB_FF06TIMER 1, 2 or 3
.WORDLAB_FF09RI or INT1
.WORDLAB_FF0CINT2
.WORDLAB_F68ERESET
.END
************************************************************************************