✎ Edit mode on — click any annotation cell to edit it.
Assembly
Pseudo-code / Annotation
************************************************************************************
bit correct m50734 board ROM disassembly
LAB_00 = $00 ; RAM size
byt value
--- -----
$00 32K
$01 64K
$02 160K
LAB_01 = $01 ; RAM end low byte
LAB_02 = $02 ; RAM end high byte
LAB_03 = $03 ; ?? buffer write index
LAB_04 = $04 ; ?? buffer read index
LAB_05 = $05 ; Tx buffer write index
LAB_06 = $06 ; Tx buffer read index
LAB_07 = $07 ; alternate stack pointer
LAB_08 = $08 ; signed on flag
byt value
--- -----
$00 disconnected
$xx signed on
LAB_09 = $09 ; sign on retry count
LAB_0A = $0A ; system flags ??
bit function
--- --------
7 1 = break
6 1 = pause output
5 ??
4-0 unused ??
LAB_0B = $0B ; break value
LAB_0C = $0C ; Rx buffer read index
LAB_0D = $0D ; decimal value low byte ?? pointer low byte
LAB_0E = $0E ; decimal value mid byte ?? pointer high byte
LAB_0F = $0F ; decimal value high byte
LAB_10 = $10 ; date/time pointer low byte RAM test pointer low byte
LAB_11 = $11 ; date/time pointer high byte RAM test pointer high byte
LAB_12 = $12 ; remainder/partial low byte
LAB_13 = $13 ; remainder/partial high byte
LAB_14 = $14 ; divisor/multiplicand low byte
LAB_15 = $15 ; divisor/multiplicand high byte
LAB_16 = $16 ; dividend/multiplier low byte
LAB_17 = $17 ; dividend/multiplier high byte
LAB_18 = $18 ;to $001D, hex to decimal conversion space
LAB_19 = $19 ;to $001D, hex to decimal conversion space
LAB_1A = $1A ;to $001D, hex to decimal conversion space
LAB_1B = $1B ;to $001D, hex to decimal conversion space
LAB_1C = $1C ;to $001D, hex to decimal conversion space
LAB_1D = $1D ;to $001D, hex to decimal conversion space
LAB_1E = $1E ; Absolute line voltage
LAB_1F = $1F ; A2D channel 0 byte
LAB_20 = $20 ;
LAB_21 = $21 ; A2D channel 1 byte
LAB_22 = $22 ;
LAB_23 = $23 ; A2D channel 2 byte
LAB_24 = $24 ;
LAB_25 = $25 ; A2D channel 3 byte
LAB_26 = $26 ; max + 1 for date and time
LAB_28 = $28 ; max + 1 for days in the month
LAB_29 = $29 ; max + 1 for hours in the day
LAB_2D = $2D ; signed off date/time
LAB_34 = $34 ; temporary year
LAB_35 = $35 ; temporary month
LAB_36 = $36 ; temporary date
LAB_37 = $37 ; temporary hour
LAB_38 = $38 ; temporary minute
LAB_39 = $39 ; temporary second
LAB_3A = $3A ; temporary 1/8th seconds
LAB_3B = $3B ; start hour
LAB_3C = $3C ; start minute
LAB_3D = $3D ; start second
LAB_3E = $3E ; cleared but never read ??
LAB_3F = $3F ; 1/8th second countdown byte
LAB_40 = $40 ; seconds count low byte
LAB_41 = $41 ; seconds count high byte
LAB_42 = $42 ; digit to dial
LAB_43 = $43 ; pulse count
LAB_44 = $44 ; digit count
LAB_45 = $45 ;.
LAB_46 = $46 ; digit index
LAB_47 = $47 ; next record pointer low byte
LAB_48 = $48 ; next record pointer mid byte
LAB_49 = $49 ; next record pointer high byte
LAB_4A = $4A ; update pointer low byte
LAB_4B = $4B ; update pointer mid byte
LAB_4C = $4C ; update pointer high byte
LAB_4D = $4D ; current record pointer low byte
LAB_4E = $4E ; current record pointer mid byte
LAB_4F = $4F ; current record pointer high byte
LAB_50 = $50 ; buffered record length
LAB_51 = $51 ; filter flags byte
bit function
--- --------
7 ??
6 1 = number filter
5 1 = date filter
4 1 = metered units filter
3-0 ?? unused
LAB_52 = $52 ; call type match byte
LAB_53 = $53 ; call type mask byte
LAB_54 = $54 ; last output year/month/date low byte
LAB_55 = $55 ; last output year/month/date high byte
LAB_56 = $56 ; start date low byte
LAB_57 = $57 ; start date high byte
LAB_58 = $58 ; end date low byte
LAB_59 = $59 ; end date high byte
LAB_5A = $5A ;.
LAB_5B = $5B ; minimum number of numeric digits
LAB_5C = $5C ; minimum length of the output
LAB_5D = $5D ; decimal point position
LAB_5E = $5E ; checksum low byte
LAB_5F = $5F ; checksum high byte
LAB_60 = $60 ; block number low byte
LAB_61 = $61 ; block number high byte
LAB_62 = $62 ; block length
LAB_63 = $63 ; record RAM pointer low byte
LAB_64 = $64 ; record RAM pointer high byte
LAB_65 = $65 ; ?? size low byte
LAB_66 = $66 ; ?? size high byte
LAB_67 = $67 ; calls low byte
LAB_68 = $68 ; calls high byte
LAB_69 = $69 ; units low byte
LAB_6A = $6A ; units high byte
LAB_6B = $6B ; digits value
byt value
--- -----
$00 auto
$01 pulse
$02 dtmf
$03 mixed
LAB_6C = $6C ; pulses value
byt value
--- -----
$00 rev
$01 spm16
$02 spm
$03 xspm
$04 m+
$05 m-
LAB_6D = $6D ; VThreshold value
LAB_6E = $6E ; TSeized value
LAB_6F = $6F ; TPulse value
LAB_70 = $70 ; TDial value
LAB_71 = $71 ; rvs value
byt value
--- -----
$00 off
$01 on
LAB_72 = $72 ; ECall value
byt value
--- -----
$00 off
$01 on
LAB_73 = $73 ; park value
byt value
--- -----
$00 off
$01 txe
$02 rev
LAB_74 = $74 ; calls logged low byte
LAB_75 = $75 ; calls logged high byte
LAB_76 = $76 ; meter value low byte
LAB_77 = $77 ; meter value mid byte
LAB_78 = $78 ; meter value high byte
LAB_79 = $79 ; current year
LAB_7A = $7A ; current month
LAB_7B = $7B ; current date
LAB_7C = $7C ; current hour
LAB_7D = $7D ; current minute
LAB_7E = $7E ; current second
LAB_7F = $7F ; current 1/8th seconds count
the date on which GMT begins
LAB_80 = $80 ; GMT year
LAB_81 = $81 ; GMT month
LAB_82 = $82 ; GMT date
the date on which BST begins
LAB_83 = $83 ; BST year
LAB_84 = $84 ; BST month
LAB_85 = $85 ; BST date
LAB_86 = $86 ;.
LAB_87 = $87 ;.
LAB_88 = $88 ;.
LAB_89 = $89 ;.
LAB_8A = $8A ;.
LAB_8B = $8B ;.
LAB_8C = $8C ; port 1 last read value
LAB_8D = $8D ;.
LAB_8E = $8E ; Used for all sorts of stuff
bit value
--- -----
0
1
2
3
4
5
6
7
LAB_8F = $8F ;.
LAB_90 = $90 ;.
LAB_91 = $91 ; dialed number buffer index
LAB_92 = $92 ;.
LAB_93 = $93 ; seconds countdown
LAB_94 = $94 ; integer part of VThreshold * 2.277
LAB_95 = $95 ;.
LAB_96 = $96 ;.
LAB_97 = $97 ;.
LAB_98 = $98 ;.
LAB_99 = $99 ;.
LAB_9A = $9A ; ?? year
LAB_9B = $9B ; ?? month
LAB_9C = $9C ; ?? date
LAB_9D = $9D ;Linked }
LAB_9E = $9E ;Linked }
LAB_9F = $9F ;Linked }
LAB_A1 = $A1 ;Time difference
LAB_A4 = $A4 ;LAB_A4 + $00
LAB_A8 = $A8 ;LAB_A4 + $01
LAB_AB = $AB ;LAB_A4 + $02
LAB_AC = $AC ;.
LAB_AD = $AD ;.
LAB_AE = $AE ; call duration 1/8th seconds
LAB_AF = $AF ; line seized hours ??
LAB_B0 = $B0 ; line seized minutes ??
LAB_B1 = $B1 ; line seized seconds ??
LAB_B2 = $B2 ;.
LAB_B3 = $B3 ; record memory start pointer low byte
LAB_B4 = $B4 ; record memory start pointer mid byte
LAB_B5 = $B5 ; record memory start pointer high byte
LAB_B6 = $B6 ; record memory end pointer low byte
LAB_B7 = $B7 ; record memory end pointer mid byte
LAB_B8 = $B8 ; record memory end pointer high byte
LAB_B9 = $B9 ; Used for all sorts of stuff
bit value
--- -----
0
1
2
3
4
5
6
7
************************************************************************************
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 | P06}
5 {1|0} = b5 = {DME | P05}
4 {1|0} = b4 = {STBout | P04}
3 {1|0} = b3 = {BUSYout | P03}
2 {1|0} = b2 = {CNTR | P02}
1 unused
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_0100 = $0100 ; bottom of stack
LAB_0200 = $0200 ; block buffer, password buffer
LAB_0300 = $0300 ; ?? buffer
LAB_0400 = $0400 ; to $0405, Tx buffer
LAB_0406 = $0406 ; to $xxxx, Rx buffer
LAB_0456 = $0456 ; to $04A5, message buffer 1
LAB_04A6 = $04A6 ; to $04F5, message buffer 2
LAB_04F6 = $04F6 ; record seconds b0 byte
bit function
--- --------
7 record start seconds b0
6 record cleared seconds b0
5 record ans/last seconds b0
4-0 record length
LAB_04F7 = $04F7 ; record call type
LAB_04F8 = $04F8 ; record year/month/date low byte
LAB_04F9 = $04F9 ; record year/month/date high byte
LAB_04FA = $04FA ; record start minutes and seconds
LAB_04FB = $04FB ; record start hours and minutes
LAB_04FC = $04FC ; record cleared minutes and seconds
LAB_04FD = $04FD ; record cleared hours and minutes
LAB_04FE = $04FE ; record ans/last minutes and seconds
LAB_04FF = $04FF ; record ans/last hours and minutes
LAB_0500 = $0500 ; record metered units low byte
LAB_0501 = $0501 ; record metered units high byte
LAB_0502 = $0502 ; record number to $0515 max
LAB_0516 = $0516 ; record seconds b0 byte
bit function
--- --------
7 record start seconds b0
6 record cleared seconds b0
5 record ans/last seconds b0
4-0 record length
LAB_0517 = $0517 ; record call type
LAB_0518 = $0518 ; record year/month/date low byte
LAB_0519 = $0519 ; record year/month/date high byte
LAB_051A = $051A ; record start minutes and seconds
LAB_051B = $051B ; record start hours and minutes
LAB_051C = $051C ; record cleared minutes and seconds
LAB_051D = $051D ; record cleared hours and minutes
LAB_051E = $051E ; record ans/last minutes and seconds
LAB_051F = $051F ; record ans/last hours and minutes
LAB_0520 = $0520 ; record metered units low byte
LAB_0521 = $0521 ; record metered units high byte
LAB_0522 = $0522 ; record number to $0535 max
LAB_0536 = $0536 ; to $0546 ??, password
LAB_0547 = $0547 ; to $0550, num value
LAB_0551 = $0551 ; to $0558, ref value
LAB_0559 = $0559 ; to $0577, dialed number digit buffer
LAB_0578 = $0578 ; ?? minutes/seconds
LAB_0579 = $0579 ; ?? hours/minutes
LAB_057A = $057A ;.
LAB_05A0 = $05A0 ; metered units limit low byte
LAB_05A1 = $05A1 ; metered units limit high byte
LAB_0600 = $0600 ;.
************************************************************************************
ROM from $E000
.ORG$E000
LAB_E000: ; $E000
.WORD$2919serial # and encoded password number 37521
LAB_E002: ; $E002
.WORD$0052version #
LAB_E004: ; $E004
.BYTE$FFVBattery constant
************************************************************************************
default values
LAB_E005: ; $E005
.BYTE$00digits default value
.BYTE$03pulses default value
.BYTE$2CVThreshold 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
************************************************************************************
default break value
LAB_E00E: ; $E00E
.BYTE$03[CTRL+C]
************************************************************************************
RESET enters here
LAB_E00F: ; $E00F
CLTclear T mode
CLDclear decimal mode
SEIdisable the interrupts
LDA#$00clear A
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 = P05
4 0 = b4 = P04
3 0 = b3 = P03
2 0 = b2 = P02
1 unused
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#$7Fset X
TXSset the stack pointer
LDA#<LAB_FB78.
PHApush the routine address high byte
LDA#>LAB_FB78-1.
PHApush the routine address low byte
PHA.
PHA.
PHA.
TSXcopy the stack pointer
STXLAB_07save the alternate stack pointer
LDX#$FFset X
TXSset the stack pointer
JSRLAB_F14Fsetup the UART and timer 2 and clear the Tx/Rx buffers ??
SEB2,LAB_FFset INT2 enable bit
JSRLAB_F44Bset the default date/time and clear the line seized time
JSRLAB_F17Ctest the RAM ??
JSRLAB_E143set the default password to "ALICE"
LDA#$00clear A
STALAB_0Aclear the system flags byte
STALAB_3Eclear byte, only cleared never read ??
STALAB_3Fclear the 1/8th second countdown byte
STALAB_0547clear num
STALAB_0551clear ref
STALAB_0456clear message buffer 1
STALAB_04A6clear message buffer 2
LDALAB_E00Eget the break default value
STALAB_0Bsave the break value
CLIenable the interrupts
main loop
LAB_E072: ; $E072
LDM#$00,LAB_08clear the signed on flag
JSRLAB_F12Frelease 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
LAB_E07C: ; $E07C
CLB1,LAB_FFclear INT1 request bit
SEB0,LAB_FFset INT1 enable bit
LAB_E080: ; $E080
JSRLAB_FFDCswap the stack pointers
BBS0,LAB_FE,LAB_E089if timer 1 interrupt enabled continue
STPelse stop the oscillator
BRALAB_E08Acontinue after wake up
LAB_E089: ; $E089
WITstop the internal clock
LAB_E08A: ; $E08A
BBS7,LAB_F0,LAB_E09Etest b7 port 2 data register, ring detect
if ring detected go ??
BBS0,LAB_FF,LAB_E080in INT1 not enabled go back to waiting
LDALAB_04get the ?? buffer read index
STALAB_03save the ?? buffer write index
clear the buffer
JSRLAB_F2C0wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
CLB7,Amask 0xxx xxxx, 7 bit ASCII
CMP#$0Dcompare the character with [CR]
BEQLAB_E0A3if [CR] go do sign on
BRALAB_E07Celse go back to sleep
LAB_E09E: ; $E09E
JSRLAB_F0E3wait 15 seconds for two seconds of new carrier
BCSLAB_E072if error loop
LAB_E0A3: ; $E0A3
JSRLAB_E0E4sign on
BCSLAB_E0CBif sign on failed go disconnect
signed on command loop
LAB_E0A8: ; $E0A8
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LDA#>$FDA8set the seconds count low byte, 600 seconds
LDX#<$FDA8set the seconds count high byte, 600 seconds
JSRLAB_F269wait -AX seconds for input
BCSLAB_E0C5if timed out go do disconnect
JSRLAB_E20Dfind and execute a command
LDM#$00,LAB_0Aclear the system flags byte
BCCLAB_E0C1if no error skip the [BELL] output
LDA#$07[BELL] character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LAB_E0C1: ; $E0C1
TSTLAB_08test the signed on flag
BNELAB_E0A8if signed on stay in the command loop
LAB_E0C5: ; $E0C5
JSRLAB_F49Acopy the current date/time to the signed off time
JSRLAB_FB36copy the current record pointer to the update point
LAB_E0CB: ; $E0CB
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'disconnected',$0D,$0A,$00
JSRLAB_F443wait for timer 2 ??
BRALAB_E072loop
************************************************************************************
sign on
LAB_E0E4: ; $E0E4
LDM#$03,LAB_09set the retry count ??
BRALAB_E0F2branch into the sign on loop
LAB_E0E9: ; $E0E9
DECLAB_09decrement the retry count ??
BEQLAB_E142if all done just exit
LDA#$07[BELL] character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LAB_E0F2: ; $E0F2
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'sign on ',$05,$00
LDA#>$FFC4set the seconds count low byte, 60 seconds
LDX#<$FFC4set the seconds count high byte, 60 seconds
JSRLAB_F269wait -AX seconds for input
BCSLAB_E142if timed out go exit
JSRLAB_E151check the password
BCCLAB_E114if ok go sign in
JSRLAB_E169check the district set password &4He#r"!:37521
BCSLAB_E0E9if error go decrement the retry count and try again
LAB_E114: ; $E114
COMLAB_08toggle the signed on flag
JSRLAB_E1E3output 'Monolog ', serial#, version#, RAM size
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'time on ',$00
JSRLAB_F685output the current day/date/time
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'last on ',$00
JSRLAB_F68Eoutput the signed off day/date/time
JSRLAB_E776display the number of calls logged
JSRLAB_E5A8transmit message buffers 1 and 2
CLCflag sign on success
LAB_E142: ; $E142
RTS
************************************************************************************
set the default password
LAB_E143: ; $E143
LDX#$FFset the index for pre increment
TXAcopy to A
LAB_E146: ; $E146
INXincrement the index
SECset carry for subtract
SBCLAB_E196,Xsubtract an obfuscated default password character
STALAB_0536,Xsave a password character
BNELAB_E146loop if more to do
RTS
************************************************************************************
check the password
LAB_E151: ; $E151
LDX#$FFset the index for pre increment
LAB_E153: ; $E153
INXincrement the index
LDALAB_0406,Xget a character from the Rx buffer
BEQLAB_E162if null go check the length
EORLAB_0536,Xcompare it with a password character
AND#$DFmask xx0x xxxx, make it case insensetive
BEQLAB_E153if a match loop for the next character
LAB_E160: ; $E160
SECflag error
RTS
LAB_E162: ; $E162
EORLAB_0536,Xcompare it with the password null
BNELAB_E160if not the same go do error exit
CLCflag ok
RTS
************************************************************************************
check the district set password &4He#r"!:37521
LAB_E169: ; $E169
LDX#$00clear the index
LAB_E16B: ; $E16B
LDALAB_0406,Xget a character from the Rx buffer
BEQLAB_E160if null go do error exit
INXincrement the index
EORLAB_E19C-1,Xcompare the character with a ?? character
BEQLAB_E16Bif a match loop for the next character
LDALAB_E19C-1,Xget the district set password character
BNELAB_E160if not null go do error exit
STXLAB_0Csave the Rx buffer read index
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_E160if there is a following character go do error exit
RRFLAB_0Dswap the nibbles
LDALAB_0Dget the number low byte
CMPLAB_E000compare it with the serial number low byte
BNELAB_E160if not a match go do error exit
RRFLAB_0Eswap the nibbles
LDALAB_0Eget the number high byte
CMPLAB_E000+1compare it with the serial number high byte
BNELAB_E160if not a match go do error exit
CLCflag ok
RTS
************************************************************************************
obfuscated default password
LAB_E196: ; $E196
.BYTE$BE,$F5,$03,$06,$FE,$45
"ALICE",$00
************************************************************************************
district set password text
LAB_E19C: ; $E19C
.BYTE'&4He#r"!:',$00&4He#r"!:
************************************************************************************
change the password, min four characters, max fifteen characters, requires confirm
LAB_E1A6: ; $E1A6
LDY#$FFset the index for pre increment
LAB_E1A8: ; $E1A8
INYincrement the index
JSRLAB_F257get a non space character from the Rx buffer
STALAB_0200,Ysave the character to the password buffer
BNELAB_E1A8loop if not a null character
CPY#$04compare the index with the minimum
BCCLAB_E1E1if less than the minimum go return an error
CPY#$11compare the index with the maximum + 1
BCSLAB_E1E1if greater than the maximum go return an error
JSRLAB_E750prompt for confirm, return Cb = 0 if confirmed
BCSLAB_E1E1if not confirmed go return an error
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'changed to ',$00
LDY#$FFset the index for pre increment
LAB_E1D1: ; $E1D1
INYincrement the index
LDALAB_0200,Yget a buffered password character
STALAB_0536,Ysave a password character
BEQLAB_E1DFif null just exit
JSRLAB_F3FFput an even parity byte in the Tx buffer
BRALAB_E1D1loop for the next character
LAB_E1DF: ; $E1DF
CLCflag ok
RTS
LAB_E1E1: ; $E1E1
SECflag error
RTS
************************************************************************************
output 'Monolog ', serial#, version#, RAM size
LAB_E1E3: ; $E1E3
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'Monolog ',$00
LDALAB_E000get the serial number low byte
LDXLAB_E000+1get the serial number high byte
JSRLAB_F36Aoutput AX as a three digit decimal value
JSRLAB_F3F0put [SPACE] in the Tx buffer
LDALAB_E002get the version number low byte
LDXLAB_E002+1get the version number high byte
JSRLAB_F35Doutput AX as a xx.xx digit decimal value
JSRLAB_F3F0put [SPACE] in the Tx buffer
JSRLAB_F1C7display the RAM size
RTS
************************************************************************************
find and execute a command
LAB_E20D: ; $E20D
LDM#>LAB_E265,LAB_0Dset the command table pointer low byte
LDM#<LAB_E265,LAB_0Eset the command table pointer high byte
JSRLAB_F261get a non space character from the Rx buffer without
increment
CLCflag ok
BEQLAB_E22Dif null just exit
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E22Dif not found just return the error
INYincrement the command table index
LDA(LAB_0D),Yget the command vector low byte
PHAsave the vector low byte
INYincrement the command table index
LDA(LAB_0D),Yget the command vector high byte
STALAB_0Esave the jump vector high byte
PLArestore the vector low byte
STALAB_0Dsave the jump vector low byte
.BYTE$6Cforce the long form ..
.WORDLAB_0D.. of JMP ($xxxx)
JMP (LAB_0D) ; go do the command
LAB_E22D: ; $E22D
RTS
************************************************************************************
search for a command, return Cb=0 if found
LAB_E22E: ; $E22E
LDXLAB_0Cget the Rx buffer read index
LDY#$00clear the index
LAB_E232: ; $E232
LDA(LAB_0D),Yget a character from the command table
BEQLAB_E263if end marker go do error exit
EORLAB_0406,Xcompare it with a character from the Rx buffer
AND#$DFmask xx0x xxxx, make it case insensetive
BEQLAB_E25Aif a match go do the next character
ASLAshift b7 out
BNELAB_E247if not a match go find the next command in the table
else matched a command word
LDALAB_0406,Xget the last character from the Rx buffer
CMP#' 'compare it with [SPACE]
BNELAB_E25Eif not [SPACE] go return the found command, branch always
LAB_E247: ; $E247
LDA(LAB_0D),Yget a character from the command table
INYincrement the command table index
BBC7,A,LAB_E247if not an end marker go get another character
INYincrement the command table index past the vector lo word
INYincrement the command table index past the vector hi word
TYAcopy the command table index
CLCclear carry for add
ADCLAB_0Dadd the command table pointer low byte
STALAB_0Dsave the command table pointer low byte
BCCLAB_E22Eif no carry go try the next command word
INCLAB_0Eelse increment the command table pointer high byte
BRALAB_E22Eand go try the next command word
LAB_E25A: ; $E25A
INYincrement the command table index
INXincrement the Rx buffer index
BRALAB_E232go do the next character
LAB_E25E: ; $E25E
INXincrement the Rx buffer index
STXLAB_0Csave the Rx buffer read index
CLCflag ok
RTS
LAB_E263: ; $E263
SECflag error
RTS
************************************************************************************
command table
LAB_E265: ; $E265
.BYTE'TIM','E'+$80"TIME"
.WORDLAB_F57Fdisplay or set the time
.BYTE'DAT','E'+$80"DATE"
.WORDLAB_F58Adisplay or set the date
.BYTE'OFF',$80"OFF"
.WORDLAB_E721sign off
.BYTE'V','L'+$80"VL"
.WORDLAB_EFBDdisplay the line votage
.BYTE'V','B'+$80"VB"
.WORDLAB_F037display the battery voltage
.BYTE'V','T'+$80"VT"
.WORDLAB_EFF1display or set the VThreshold value
.BYTE'RINGBAC','K'+$80"RINGBACK"
.WORDLAB_EF1Chang up and call the entered number back
.BYTE'LIVE',$80"LIVE"
.WORDLAB_EEA2display the current call status until break
.BYTE'LIS','T'+$80"LIST"
.WORDLAB_E838display the logged call short form data as ASCII text
.BYTE'L'+$80"L"
.WORDLAB_E838same as above
.BYTE'FLIS','T'+$80"FLIST"
.WORDLAB_E834display the logged call data as ASCII text
.BYTE'F','L'+$80"FL"
.WORDLAB_E834same as above
.BYTE'DOWNLOA','D'+$80"DOWNLOAD"
.WORDLAB_ECD6transfer logged call data
.BYTE'D','L'+$80"DL"
.WORDLAB_ECD6same as above
.BYTE'AUTOLOA','D'+$80"AUTOLOAD"
.WORDLAB_ECCDtransfer logged call data then automatically disconnect
.BYTE'A','L'+$80"AL"
.WORDLAB_ECCDsame as above
.BYTE'INF','O'+$80"INFO"
.WORDLAB_E7CFdisplay the total number of calls stored in memory
.BYTE'UPDAT','E'+$80"UPDATE"
.WORDLAB_E9B9display or set the update date
.BYTE'NEW',$80"NEW"
.WORDLAB_E790clear the logged calls and metered units
.BYTE'NEW/Y',$80"NEW/Y"
.WORDLAB_E79Eclear the logged calls and metered units without confirm
.BYTE'CALLS',$80"CALLS"
.WORDLAB_E776display the number of calls logged
.BYTE'DIGIT','S'+$80"DIGITS"
.WORDLAB_E5D8display or set the digit mode
.BYTE'PULSE','S'+$80"PULSES"
.WORDLAB_E602display or set the meter pulse mode
.BYTE'RV','S'+$80"RVS"
.WORDLAB_E66Ddisplay or set the ringing reversal detection
.BYTE'E','C'+$80"EC"
.WORDLAB_E648display or set the earth call setting
.BYTE'PAR','K'+$80"PARK"
.WORDLAB_E694display or set the park detection setting
.BYTE'METE','R'+$80"METER"
.WORDLAB_E7A6display or set the number of metered units
.BYTE'MS','G'+$80"MSG"
.WORDLAB_E580display or set the message(s)
.BYTE'PASSWOR','D'+$80"PASSWORD"
.WORDLAB_E1A6change the password
.BYTE'NU','M'+$80"NUM"
.WORDLAB_E42Edisplay or set the target number
.BYTE'RE','F'+$80"REF"
.WORDLAB_E3D8display or set the REF value
.BYTE'DIA','G'+$80"DIAG"
.WORDLAB_E738display all four voltage inputs
.BYTE'STATUS',$80"STATUS"
.WORDLAB_E545display the current settings and metered values
.BYTE'DEFAUL','T'+$80"DEFAULT"
.WORDLAB_E53Breturn parameters to their defaut settings
.BYTE'BREA','K'+$80"BREAK"
.WORDLAB_E509display or set the break character
.BYTE'T','S'+$80"TS"
.WORDLAB_E493display or set the minimum recognised line seizure
.BYTE'T','P'+$80"TP"
.WORDLAB_E4BCdisplay or set the pulse dial timing
.BYTE'T','D'+$80"TD"
.WORDLAB_E4E4display or set the dialled digit timeout
.BYTE'GM','T'+$80"GMT"
.WORDLAB_E389display or set the GMT start date
.BYTE'BS','T'+$80"BST"
.WORDLAB_E3B4display or set the BST start date
.BYTE$00end marker
************************************************************************************
get a BST or GMT start date, must be a sunday, return Cb = 1 if error
LAB_E35D: ; $E35D
JSRLAB_F5C5get the date as DD MMM YYYY
BCSLAB_E387if error just exit
LDM#>LAB_34,LAB_10set the date pointer low byte
LDM#<LAB_34,LAB_11set the date pointer high byte
JSRLAB_F62Fcalculate the day from the date
BNELAB_E375if not a sunday go report and flag the error
LDALAB_34get the entered year
LDXLAB_35get the entered month
LDYLAB_36get the entered date
CLCflag ok
RTS
LAB_E375: ; $E375
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'not a Sunday',$00
LAB_E387: ; $E387
SECflag an error
LAB_E388: ; $E388
RTS
************************************************************************************
display or set the GMT start date
LAB_E389: ; $E389
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E399if null just go output the current value
JSRLAB_E35Dget a BST or GMT date
BCSLAB_E388if error just exit
STALAB_80save the GMT year
STXLAB_81save the GMT month
STYLAB_82save the GMT date
************************************************************************************
output 'gmt ' and the GMT start date
LAB_E399: ; $E399
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'gmt ',$00
TSTLAB_82test the GMT year
BEQLAB_E41Fif null go output "(not set)" and return
LDX#>LAB_80set the pointer to GMT date low byte
LDY#<LAB_80set the pointer to GMT date high byte
output the day/date
LAB_E3AB: ; $E3AB
JSRLAB_F6A1output the day of the week
JSRLAB_F3F0put [SPACE] in the Tx buffer
JMPLAB_F6DAoutput the date as DD MMM YYY and return
************************************************************************************
display or set the BST start date
LAB_E3B4: ; $E3B4
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E3C4if null just go output the current value
JSRLAB_E35Dget a BST or GMT date
BCSLAB_E388if error just exit
STALAB_83save the BST year
STXLAB_84save the BST month
STYLAB_85save the BST date
************************************************************************************
output 'bst ' and the BST start date
LAB_E3C4: ; $E3C4
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'bst ',$00
TSTLAB_85test the BST year
BEQLAB_E41Fif null go output "(not set)" and return
LDX#>LAB_83set the pointer to BST date low byte
LDY#<LAB_83set the pointer to BST date low byte
BRALAB_E3ABoutput the day/date and return
************************************************************************************
display or set the REF value
LAB_E3D8: ; $E3D8
JSRLAB_F243get a character from the Rx buffer
BEQLAB_E3FFif null just go output the current value
CMP#' 'compare the character with [SPACE]
BNELAB_E41Eif it is [SPACE] just exit
LDX#$00clear the character count/index
LAB_E3E3: ; $E3E3
JSRLAB_F257get a non space character from the Rx buffer
BEQLAB_E3F3if the character is null go finish the ref value
JSRLAB_F233test the character in A, return Cb=0 if it is "0" to "9"
BCCLAB_E3F3if the character is "0" to "9" go add it to the ref value
CLB5,Amake upper case
JSRLAB_F23Ctest the character in A, return Cb=0 if it is "A" to "Z"
BCSLAB_E41Eif it is not "A" to "Z" just exit
character is either [NULL], "0" to "9" or "A" to "Z"
LAB_E3F3: ; $E3F3
CPX#$08compare the character count/index with max + 1
BCSLAB_E3FBif > max skip the ref value save
STALAB_0551,Xsave the character to the ref value
INXincrement the character count/index
LAB_E3FB: ; $E3FB
AND#$FFset the flags on A
BNELAB_E3E3if the character wasn't [NULL] go get another character
************************************************************************************
output 'ref ' and the REF value
LAB_E3FF: ; $E3FF
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'ref ',$00
LDALAB_0551get the first ref character
BEQLAB_E41Fif null go output "(not set)" and return
LDX#$00clear the index
LAB_E410: ; $E410
LDALAB_0551,Xget a ref character
BEQLAB_E41Dif null just exit
JSRLAB_F3FFput an even parity byte in the Tx buffer
INXincrement the index
CPX#$08compare the index with max + 1
BCCLAB_E410loop if more to do
LAB_E41D: ; $E41D
CLCflag ok
LAB_E41E: ; $E41E
RTS
************************************************************************************
output "(not set)"
LAB_E41F: ; $E41F
JSRLAB_F316output the following null terminated string
.BYTE'(not set)',$00
CLCflag ok
RTS
************************************************************************************
display or set the target number
LAB_E42E: ; $E42E
JSRLAB_F243get a character from the Rx buffer
BEQLAB_E45Aif null just go output the current value
CMP#' 'compare the character with " "
BNELAB_E491if not " " go do error exit
LDX#$00clear the number index
JSRLAB_F257get a non space character from the Rx buffer
BEQLAB_E452if null go save it to the buffer
CMP#'0'compare the character with "0"
BEQLAB_E452if "0" go save it to the buffer
BRALAB_E47Aelse output "include area code" and do error exit
LAB_E444: ; $E444
JSRLAB_F257get a non space character from the Rx buffer
BEQLAB_E44Eif null just go save it to the buffer
JSRLAB_F233test the character in A, return Cb=0 if it is "0" to "9"
BCSLAB_E444if not numeric go get another character
LAB_E44E: ; $E44E
CPX#$0Acompare the index with the max + 1
BCSLAB_E456if > max skip the save
LAB_E452: ; $E452
STALAB_0547,Xsave the character to the buffer
INXincrement the buffer index
LAB_E456: ; $E456
AND#$FFset the flags on A
BNELAB_E444if not null loop for the next character
LAB_E45A: ; $E45A
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'num ',$00
LDALAB_0547get the first character
BEQLAB_E41Fif null go output "(not set)" and return
LDX#$00clear the index
LAB_E46B: ; $E46B
LDALAB_0547,Xget a character
BEQLAB_E478if null exit the loop
JSRLAB_F3FFput an even parity byte in the Tx buffer
INXincrement the index
CPX#$0Acompare the index with the maximum + 1
BCCLAB_E46Bif less go do another character
LAB_E478: ; $E478
CLCflag ok
RTS
output "include area code" and do error exit
LAB_E47A: ; $E47A
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'include area code',$00
LAB_E491: ; $E491
SECflag error
RTS
************************************************************************************
display or set the minimum recognised line seizure.
This allows short seizures to be discarded. The default is 5 seconds but may be set
anywhere between 0 and 59 seconds. Any seizures shorter than the set period will
not be logged although they will be shown in LIVE mode.
LAB_E493: ; $E493
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E4A7if null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_E4BAif there is a following character go do error exit
CPX#$00compare the high byte with $00
BNELAB_E4BAif the high byte is not $00 go do error exit
CMP#$3Ccompare the returned value with the max + 1
BCSLAB_E4BAif the value is > max go do error exit
STALAB_6Esave the TSeized value
LAB_E4A7: ; $E4A7
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'TSeized ',$00
LDALAB_6Eget the TSeized value
JMPLAB_F350output A as a two digit decimal value and return
LAB_E4BA: ; $E4BA
SECflag error
RTS
************************************************************************************
TP [{1|2|3|4|5|6|7}]
display or set the pulse dial timing
LAB_E4BC: ; $E4BC
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E4D2if null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_E4BAif there is a following character go do error exit
CPX#$00compare the high byte with $00
BNELAB_E4BAif the high byte is not $00 go do error exit
DECAmake the value 0 to 6
CMP#$07compare it with max + 1
BCSLAB_E4BAif the value is > max go do error exit
INCAmake the value 1 to 7
STALAB_6Fsave the TPulse value
LAB_E4D2: ; $E4D2
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'TPulse ',$00
LDALAB_6Fget the TPulse value
JMPLAB_F350output A as a two digit decimal value and return
************************************************************************************
display or set the dialled digit timeout
LAB_E4E4: ; $E4E4
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E4F8if null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_E4BAif there is a following character go do error exit
CPX#$00compare the high byte with $00
BNELAB_E4BAif the high byte is not $00 go do error exit
CMP#$14compare it with max + 1
BCCLAB_E4BAif the value is > max go do error exit
STALAB_70save the TDial value
LAB_E4F8: ; $E4F8
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'TDial ',$00
LDALAB_70get the TDial value
JMPLAB_F350output A as a two digit decimal value and return
************************************************************************************
display or set the break character
LAB_E509: ; $E509
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E517if null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BEQLAB_E515if there is no following character go use the decimal
value
TYAelse copy the following character
CLB7,Amask 0xxx xxxx, 7 bit ASCII
LAB_E515: ; $E515
STALAB_0Bsave the break value
************************************************************************************
display the break value
LAB_E517: ; $E517
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'break ',$00
LDALAB_0Bget the break value
CMP#' 'compare it with [SPACE]
BCSLAB_E536if > [SPACE] just output it
ADC#'A'-1else add "A" - 1
PHAsave the character
JSRLAB_F316output the following null terminated string
.BYTE'CTRL ',$00
PLArestore the character
LAB_E536: ; $E536
JSRLAB_F3FFput an even parity byte in the Tx buffer
CLCflag ok
LAB_E53A: ; $E53A
RTS
************************************************************************************
The parameters used to configure the logger are returned to their power-on default
settings. These are the last nine setting listed by the STATUS command.
Date, time, GMT, BST, password, meter reading and all logged calls remain intact.
Confirmation is required whereupon the default settings are listed.
LAB_E53B: ; $E53B
JSRLAB_E750prompt for confirm, return Cb = 0 if confirmed
BCSLAB_E53Aif not confirmed just exit
JSRLAB_FB6Dset the default values
BRALAB_E565go output the reset values and return
************************************************************************************
display the current settings and metered values
LAB_E545: ; $E545
SEB5,LAB_0A.
JSRLAB_E1E3display 'Monolog ', serial#, version#, RAM size
JSRLAB_E3FFdisplay 'ref ' and the REF value
JSRLAB_E45Adisplay 'num ', ??
JSRLAB_E776display the calls logged total "calls logged xxxx"
JSRLAB_E7B8display the metered units total "meter xxxxxx"
JSRLAB_E399display the GMT start date "gmt DD MMM YYYY"
JSRLAB_E3C4display the BST start date "bst DD MMM YYYY"
JSRLAB_E517display the break value "break CTRL x"
JSRLAB_EFBDdisplay the line votage "VLine xx"
JSRLAB_F037display the battery voltage "VBattery x.xx"
LAB_E565: ; $E565
JSRLAB_F00Cdisplay 'VThreshold ', ??
JSRLAB_E5EDdisplay 'digits ', ??
JSRLAB_E617display 'pulses ', ??
JSRLAB_E6A9display 'park ', ??
JSRLAB_E682display 'rvs ', ??
JSRLAB_E65Ddisplay 'ECall ', ??
JSRLAB_E4F8display 'TDial ', ??
JSRLAB_E4A7display 'TSeized ', ??
JMPLAB_E4D2display 'TPulse ', ?? and return
************************************************************************************
MSG[{1|2}[ [<text>]]]
display or set the message(s)
If the text is omitted the numbered message will be cleared.
If the space is omitted the numbered message will be displayed.
If the number is omitted both message lines will be displayed.
LAB_E580: ; $E580
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E5A8if null just go Tx message buffers 1 and 2
JSRLAB_F1D5get a decimal value, result in AX ??
CPX#$00compare the high byte with $00
BNELAB_E5C5if not $00 just exit
TAXcopy the value low byte
DEXdecrement it
CPX#$02compare it with $02
BCSLAB_E5C5if >= $02 just exit
CPY#$00compare the last character with null
BEQLAB_E5AEif null just go transmit buffer[X]
JSRLAB_F261get a non space character from the Rx buffer without
increment
JSRLAB_E5C6copy message buffer pointer [X] to LAB_0D/0E
LDY#$00clear the index
LAB_E59E: ; $E59E
JSRLAB_F243get a character from the Rx buffer
STA(LAB_0D),Ysave it to the message buffer
BEQLAB_E5B1if null go echo the buffer
INYincrement the message buffer index
BPLLAB_E59Ego get another character, branch always
************************************************************************************
transmit message buffers 1 and 2
LAB_E5A8: ; $E5A8
LDX#$00set X for buffer at LAB_0456
JSRLAB_E5AEtransmit buffer[X]
INXset X for buffer at LAB_04A6
************************************************************************************
transmit buffer[X]
LAB_E5AE: ; $E5AE
JSRLAB_E5C6copy message buffer pointer [X] to LAB_0D/0E
LAB_E5B1: ; $E5B1
LDY#$00clear the index
LDA(LAB_0D),Yget a byte from the character buffer
BEQLAB_E5C4if null just exit
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LAB_E5BA: ; $E5BA
LDA(LAB_0D),Yget a byte from the character buffer
BEQLAB_E5C4if null just exit
JSRLAB_F3FFput an even parity byte in the Tx buffer
INYincrement the index
BPLLAB_E5BAloop for the next byte
LAB_E5C4: ; $E5C4
CLCflag ok
LAB_E5C5: ; $E5C5
RTS
************************************************************************************
copy message buffer pointer [X] to LAB_0D/0E
LAB_E5C6: ; $E5C6
TXAcopy the message index
ASLA* 2
TAYcopy it to Y
LDALAB_E5D4,Yget the message buffer pointer low byte
STALAB_0Dsave the message buffer pointer low byte
LDALAB_E5D4+1,Yget the message buffer pointer high byte
STALAB_0Esave the message buffer pointer high byte
RTS
************************************************************************************
message buffer pointers table
LAB_E5D4: ; $E5D4
.WORDLAB_0456message buffer 1
.WORDLAB_04A6message buffer 2
************************************************************************************
DIGITS [{AUTO|PULSE|DTMF|MIXED}]
display or set the digit mode
LAB_E5D8: ; $E5D8
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E5EDif null just go output the current value
LDM#>LAB_E6D0,LAB_0DDIGITS subcommand table pointer low byte
LDM#<LAB_E6D0,LAB_0EDIGITS subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E647if not found just exit
INYincrement the index to the digits value
LDA(LAB_0D),Yget the digits value
STALAB_6Bsave the digits value
LAB_E5ED: ; $E5ED
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'digits ',$00
LDXLAB_6Bget the digits value
LDA#>LAB_E6D0DIGITS subcommand table pointer low byte
LDY#<LAB_E6D0DIGITS subcommand table pointer high byte
BRALAB_E62Aoutput AY table string [X] and return
************************************************************************************
PULSES [{XSPM|SPM|M+|M-|REV|SPM16}]
display or set the meter pulse mode
LAB_E602: ; $E602
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E617if null just go output the current value
LDM#>LAB_E6EF,LAB_0DPULSES subcommand table pointer low byte
LDM#<LAB_E6EF,LAB_0EPULSES subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E647if not found just exit
INYincrement the index to the pulses value
LDA(LAB_0D),Yget the pulses value
STALAB_6Csave the pulses value
LAB_E617: ; $E617
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'pulses ',$00
LDXLAB_6Cget the pulses value
LDA#>LAB_E6EFPULSES subcommand table pointer low byte
LDY#<LAB_E6EFPULSES subcommand table pointer high byte
************************************************************************************
output AY table string [X]
LAB_E62A: ; $E62A
STALAB_0Dsave the table pointer low byte
STYLAB_0Esave the table pointer high byte
LDY#$00clear the table index
LAB_E630: ; $E630
DEXdecrement the string index
BMILAB_E63Cif negative go output the string
else find the next string
LAB_E633: ; $E633
LDA(LAB_0D),Yget a string byte
INYincrement table the index
BBC7,A,LAB_E633loop if not an end marker
INYincrement the index past the ? low byte
INYincrement the index past the ? high byte
BRALAB_E630go try this index
LAB_E63C: ; $E63C
LDA(LAB_0D),Yget a string character
BMILAB_E646if > $7F just exit
JSRLAB_F3FFput an even parity byte in the Tx buffer
INYincrement the index
BRALAB_E63Cgo get the next character
LAB_E646: ; $E646
CLCflag ok
LAB_E647: ; $E647
RTS
************************************************************************************
EC [{ON|OFF}]
Earth call PBX and shared service lines. ON = use earth call
LAB_E648: ; $E648
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E65Dif null just go output the current value
LDM#>LAB_E715,LAB_0DRVS and EC subcommand table pointer low byte
LDM#<LAB_E715,LAB_0ERVS and EC subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E647if not found just exit
INYincrement the index to the ECall value
LDA(LAB_0D),Yget the ECall value
STALAB_72save the ECall value
LAB_E65D: ; $E65D
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'ECall ',$00
LDXLAB_72get the ECall value
BRALAB_E68Eset table, output string [X] and return
************************************************************************************
RVS [{ON|OFF}]
Most exchanges provide a continous line reversal during ringing. Its presence
enables the start and end of ringing to be detected quickly. UXD5 exchnages only
provide a reversal during active periods of ringing therefore ringing reversal
detection must be inhibited to prevent each ring logging as a seperate incoming call.
LAB_E66D: ; $E66D
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E682if null just go output the current value
LDM#>LAB_E715,LAB_0DRVS and EC subcommand table pointer low byte
LDM#<LAB_E715,LAB_0ERVS and EC subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E647if not found just exit
INYincrement the index to the rvs value
LDA(LAB_0D),Yget the rvs value
STALAB_71save the rvs value
LAB_E682: ; $E682
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'rvs ',$00
LDXLAB_71read the rvs value
LAB_E68E: ; $E68E
LDA#>LAB_E715RVS and EC subcommand table pointer low byte
LDY#<LAB_E715RVS and EC subcommand table pointer high byte
BRALAB_E62Aoutput AY table string [X] and return
************************************************************************************
PARK [{OFF|TXE|REV}]
display or set the park detection setting
LAB_E694: ; $E694
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E6A9if null just go output the current value
LDM#>LAB_E6BD,LAB_0DPARK subcommand table pointer low byte
LDM#<LAB_E6BD,LAB_0EPARK subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E647if not found just exit
INYincrement the index to the park value
LDA(LAB_0D),Yget the park value
STALAB_73save the park value
LAB_E6A9: ; $E6A9
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'park ',$00
LDXLAB_73get the park value
LDA#>LAB_E6BDPARK subcommand table pointer low byte
LDY#<LAB_E6BDPARK subcommand table pointer high byte
JMPLAB_E62Aoutput AY table string [X] and return
************************************************************************************
PARK subcommand table
LAB_E6BD: ; $E6BD
.BYTE'off',$80"OFF"
.WORD$0000off value
.BYTE'txe',$80"TXE"
.WORD$0001txe value
.BYTE'rev',$80"REV"
.WORD$0002rev value
.BYTE$00end marker
************************************************************************************
DIGITS subcommand table
LAB_E6D0: ; $E6D0
.BYTE'auto',$80"AUTO"
.WORD$0000auto value
.BYTE'pulse',$80"PULSE"
.WORD$0001pulse value
.BYTE'dtmf',$80"DTMF"
.WORD$0002dtmf value
.BYTE'mixed',$80"MIXED"
.WORD$0003mixed value
.BYTE$00end marker
************************************************************************************
PULSES subcommand table
LAB_E6EF: ; $E6EF
.BYTE'rev',$80"REV"
.WORD$0000auto value
.BYTE'spm16',$80"SPM16"
.WORD$0001spm16 value
.BYTE'spm',$80"SPM"
.WORD$0002spm value
.BYTE'xspm',$80"XSPM"
.WORD$0003xspm value
.BYTE'm+',$80"M+"
.WORD$0004m+ value
.BYTE'm-',$80"M-"
.WORD$0005m- value
.BYTE$00end marker
************************************************************************************
RVS and EC subcommand table
LAB_E715: ; $E715
.BYTE'off',$80"OFF"
.WORD$0000off value
.BYTE'on',$80"ON"
.WORD$0001on value
.BYTE$00end marker
************************************************************************************
sign off
LAB_E721: ; $E721
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'time off ',$00
JSRLAB_F685output the current day/date/time
LDM#$00,LAB_08clear the signed on flag
CLCflag ok
RTS
************************************************************************************
a diagnostic aid for fault finding
The readings from all four line and meter voltage inputs are displayed.
e.g.
169 143 169 117
ch0 ch1 ch2 ch3
Line Volts (B-A) (same as VL but gives polarity)
V(B-A) = 113.6 * (ch3 - ch0) / ch3
= 113.6 * (117 - 169) / 117
= -50.5V
Line Volts (A+B) wrt ground (earth ref must be connected)
V(A+B) = 227.2 * (ch3 - ch1) / ch3
= 227.2 * (117 - 143) / 117
= -50.5V
V(B) wrt ground
V(B) = (V(A+B) + V(B-A)) / 2 (half the sum)
V(A) wrt ground
V(A) = (V(A+B) - V(B-A)) / 2 (half the difference)
A and B may be reversed as there is no phasing requirement.
Meter Wire
Vmeter = 113.6*(ch3-ch2)/ch3
= 113.6*(117-169)/117
= -50.5
LAB_E738: ; $E738
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LDY#$00clear the A2D channel
LAB_E73D: ; $E73D
JSRLAB_F3F0put [SPACE] in the Tx buffer
TYAcopy the A2D channel
SEIdisable the interrupts
JSRLAB_F06Cread an A2D byte from channel [A]
CLIenable the interrupts
JSRLAB_F368output A as a three digit decimal value
INYincrement the A2D channel
CPY#$04compare the A2D channel with the maximum + 1
BCCLAB_E73Dloop if more channels to do
CLCflag ok
RTS
************************************************************************************
prompt for confirm, return Cb = 0 if confirmed
LAB_E750: ; $E750
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'confirm [y] ',$00
LDA#>$FFC4set the seconds count low byte, 60 seconds
LDX#<$FFC4set the seconds count high byte, 60 seconds
JSRLAB_F269wait -AX seconds for input
BCSLAB_E775if timed out go exit
JSRLAB_F257get a non space character from the Rx buffer
CLB5,Aensure upper case
EOR#'Y'compare it with "Y"
SECflag not confirmed
BNELAB_E775if not "Y" just exit
CLCelse flag confirmed
LAB_E775: ; $E775
RTS
************************************************************************************
display the number of calls logged
LAB_E776: ; $E776
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'calls logged ',$00
LDALAB_74get the calls logged low byte
LDXLAB_75get the calls logged high byte
JMPLAB_F36Aoutput AX as a three digit decimal value
************************************************************************************
clear the logged calls and metered units
LAB_E790: ; $E790
LDALAB_74get the calls logged low byte
ORALAB_75OR it with the calls logged high byte
BEQLAB_E7A1if no calls logged just output the zero count and return
JSRLAB_E7A1output the calls logged count
JSRLAB_E750prompt for confirm, return Cb = 0 if confirmed
BCSLAB_E775if not confirmed just exit
************************************************************************************
clear the logged calls and metered units without confirm
LAB_E79E: ; $E79E
JSRLAB_FB43initialise the record pointers and logged values
************************************************************************************
display the number of calls logged and metered units
LAB_E7A1: ; $E7A1
JSRLAB_E776display the number of calls logged
BRALAB_E7B8display the number of metered units
************************************************************************************
display or set the number of metered units
LAB_E7A6: ; $E7A6
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E7B8if null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_E7CDif there is a following character go do error exit
LDYLAB_0Fget the decimal value high byte
STALAB_76save the meter value low byte
STXLAB_77save the meter value mid byte
STYLAB_78save the meter value high byte
display the number of metered units
LAB_E7B8: ; $E7B8
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'meter ',$00
LDALAB_76get the meter value low byte
LDXLAB_77get the meter value mid byte
LDYLAB_78get the meter value high byte
JMPLAB_F338output AXY as a decimal value and return
LAB_E7CD: ; $E7CD
SECflag error
RTS
************************************************************************************
display the total number of calls stored in memory
LAB_E7CF: ; $E7CF
JSRLAB_E877find a filter and set the match/mask values
BCSLAB_E7EFif error just exit
JSRLAB_E941get a date range ??
BCSLAB_E7EFif error just exit
LAB_E7D9: ; $E7D9
JSRLAB_EDDBcopy the next record to the record buffer
BCSLAB_E7EBif error go end the info output
JSRLAB_EA00test for filter match, return Cb = 0 if match ??
BCSLAB_E7D9if no match go do another record
JSRLAB_E7F0increment the calls count and add units from the buffered
record ??
JSRLAB_FFDCswap the stack pointers
BRALAB_E7D9go do another record
LAB_E7EB: ; $E7EB
JSRLAB_E80Eoutput calls and units ??
CLCflag ok
LAB_E7EF: ; $E7EF
RTS
************************************************************************************
increment the calls count and add units from the buffered record ??
LAB_E7F0: ; $E7F0
INCLAB_67increment the calls low byte
BNELAB_E7F6if no rollover skip the high byte increment
INCLAB_68else increment the calls high byte
LAB_E7F6: ; $E7F6
LDALAB_50get the buffered record length
CMP#LAB_0502-LAB_04F6
compare it with the offset to the number
BCCLAB_E80Dif less just exit
CLCclear carry for add
LDALAB_0500get the record metered units low byte
ADCLAB_69add the units low byte
STALAB_69save the units low byte
LDALAB_0501get the record metered units high byte
AND#$1Fmask 000x xxxx, just the metered units bits
ADCLAB_6Aadd the units high byte
STALAB_6Asave the units high byte
LAB_E80D: ; $E80D
RTS
************************************************************************************
output calls and units ??
LAB_E80E: ; $E80E
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'calls ',$00
LDALAB_67get the calls low byte
LDXLAB_68get the calls high byte
JSRLAB_F36Aoutput AX as a three digit decimal value
JSRLAB_F316output the following null terminated string
.BYTE', units ',$00
LDALAB_69get the units low byte
LDXLAB_6Aget the units high byte
JMPLAB_F36Aoutput AX as a three digit decimal value and return
************************************************************************************
display the logged call data as ASCII text
LAB_E834: ; $E834
SEB7,LAB_51set the full list flag
BRALAB_E840go do the list
************************************************************************************
display the logged call short form data as ASCII text
LAB_E838: ; $E838
CLB7,LAB_51clear the full list flag
LDM#$00,LAB_54clear the last output year/month/date low byte
LDM#$00,LAB_55clear the last output year/month/date high byte
LAB_E840: ; $E840
JSRLAB_E877find a filter and set the match/mask values
BCSLAB_E876if error just exit
JSRLAB_E941get a date range ??
BCSLAB_E876if error just exit
SEB5,LAB_0A.
LAB_E84C: ; $E84C
JSRLAB_F2F9check for no carrier, ring or break
BCSLAB_E875if no carrier, ring or break go do ok exit
JSRLAB_EDDBcopy the next record to the record buffer
BCSLAB_E863if error go ??
JSRLAB_EA00test for filter match, return Cb = 0 if match ??
BCSLAB_E84Cif no match go ??
JSRLAB_E7F0increment the calls count and add units from the buffered
record ??
JSRLAB_EAA5display a record's details
BRALAB_E84Cloop for the next record
LAB_E863: ; $E863
JSRLAB_E80Eoutput calls and units ??
BBC5,LAB_51,LAB_E875if the date filter flag is clear skip ??
LDYLAB_47get the next record pointer low byte
LDXLAB_48get the next record pointer mid byte
LDALAB_49get the next record pointer high byte
STYLAB_4Dsave the current record pointer low byte
STXLAB_4Esave the current record pointer mid byte
STALAB_4Fsave the current record pointer high byte
LAB_E875: ; $E875
CLCflag ok
LAB_E876: ; $E876
RTS
************************************************************************************
find a filter and set the match/mask values
LAB_E877: ; $E877
LDA#$00clear A
STALAB_67clear the calls low byte
STALAB_68clear the calls high byte
STALAB_69clear the units low byte
STALAB_6Aclear the units high byte
CLB6,LAB_51clear the number filter flag
CLB4,LAB_51clear the metered units filter flag
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E8B2if null go clear the match/mask bytes and exit
LDM#>LAB_E90F,LAB_0Dset the DL, INFO and L subcommand table pointer low byte
LDM#<LAB_E90F,LAB_0Eset the DL, INFO and L subcommand table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E8B2if not found go clear the match/mask bytes and exit
LDA(LAB_0D),Yget the last command character
CMP#'>'+$80compare it with ">"
BEQLAB_E8BAif it was ">" go handle metered units limit
CMP#'#'+$80compare it with "#"
BNELAB_E8A6if not "#" go save the match/mask bytes and exit
else handle "#", get a filter number
JSRLAB_E8D1get a filter number in LAB_05A0 on
BCSLAB_E8B9if error just exit
SEB6,LAB_51set the number filter flag
LAB_E8A6: ; $E8A6
INYincrement the index to the command word low byte
LDA(LAB_0D),Yget the call type match byte
STALAB_52save the call type match byte
INYincrement the index to the command word high byte
LDA(LAB_0D),Yget the call type mask byte
STALAB_53save the call type mask byte
CLCflag ok
RTS
LAB_E8B2: ; $E8B2
LDA#$00clear A
STALAB_52clear the call type match byte
STALAB_53clear the call type mask byte
CLCflag ok
LAB_E8B9: ; $E8B9
RTS
handle ">", metered units limit
LAB_E8BA: ; $E8BA
JSRLAB_F1D5get a decimal value, result in AX ??
DECLAB_0Cdecrement the Rx buffer read index
STALAB_05A0save the metered units limit low byte
STXLAB_05A1save the metered units limit high byte
SEB4,LAB_51set the metered units filter flag
LDA#$31match 0011 0001, outgoing
STALAB_52save the call type match byte
LDA#$FDmask xxxx xx0x, all answered
STALAB_53save the call type mask byte
CLCflag ok
RTS
************************************************************************************
get a filter number in LAB_05A0 on
LAB_E8D1: ; $E8D1
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
LDY#$00clear the index
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E909if null go flag an error and exit
LAB_E8DC: ; $E8DC
JSRLAB_F243get a character from the Rx buffer
BEQLAB_E8FEif null go terminate, check and return the number
CMP#' 'compare the character with " "
BEQLAB_E8FEif " " go terminate, check and return the number
LDX#$10set the index to the 'D1234567890*#ABC' keypad table
LAB_E8E7: ; $E8E7
CMPLAB_EC96,Xcompare the character with a keypad character
BEQLAB_E8F3if it is a match go ??
INXelse increment the table index
CPX#$20compare the table index with the maximum + 1
BCCLAB_E8E7if not there yet go try the next table character
BRALAB_E8FEif not in the table go terminate, check and return
the number
LAB_E8F3: ; $E8F3
CPY#$14compare the index with the max + 1
BCSLAB_E8FCif > max just ignore the digit
TXAcopy the table index
STALAB_05A0,Ysave the digit to the filter number buffer
INYincrement the filter number index
LAB_E8FC: ; $E8FC
BRALAB_E8DCgo get another character
LAB_E8FE: ; $E8FE
DECLAB_0Cdecrement the Rx buffer read index
LDA#$00clear A
STALAB_05A0,Ynull terminate the filter number
CLCflag ok
TYAcopy the number index
BNELAB_E90Aif the number has more than zero digits do ok exit
LAB_E909: ; $E909
SECflag error
LAB_E90A: ; $E90A
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
RTS
************************************************************************************
DOWNLOAD, INFO and LIST subcommand table
LAB_E90F: ; $E90F
.BYTE'Z'+$80"Z" line seizures
.BYTE$10match 0001 0000
.BYTE$FFmask xxxx xxxx
.BYTE'P'+$80"P" line parked
.BYTE$12match 0001 0010
.BYTE$FFmask xxxx xxxx
.BYTE'I','U'+$80"IU" unanswered incomming
.BYTE$20match 0010 0000
.BYTE$FFmask xxxx xxxx
.BYTE'I','A'+$80"IA" answered incomming
.BYTE$21match 0010 0001
.BYTE$FDmask xxxx xx0x
.BYTE'I','C'+$80"IC" continued incomming
.BYTE$23match 0010 0011
.BYTE$FFmask xxxx xxxx
.BYTE'I'+$80"I" all incomming
.BYTE$20match 0010 0000
.BYTE$F0mask xxxx 0000
.BYTE'O','U'+$80"OU" unanswered outgoing
.BYTE$30match 0011 0000
.BYTE$F9mask xxxx x00x
.BYTE'O','A'+$80"OA" answered outgoing
.BYTE$31match 0011 0001
.BYTE$F9mask xxxx x00x
.BYTE'O'+$80"O" all outgoing
.BYTE$30match 0011 0000
.BYTE$F0mask xxxx 0000
.BYTE'*'+$80"*" all outgoing ended by forced-release condition
.BYTE$35match 0011 0101
.BYTE$FEmask xxxx xxx0
.BYTE'U','#'+$80"U#" unanswered outgoing to specific number or group
.BYTE$30match 0011 0000
.BYTE$F9mask xxxx x00x
.BYTE'A','#'+$80"A#" answered outgoing to specific number or group
.BYTE$31match 0011 0001
.BYTE$F9mask xxxx x00x
.BYTE'#'+$80"#" all outgoing to specific number or group
.BYTE$30match 0011 0000
.BYTE$F0mask xxxx 0000
.BYTE'>'+$80">" answered outgoing with metered units over a
specific limit
.BYTE$00,$00unused
.BYTE$00end marker
************************************************************************************
get a date range ??
LAB_E941: ; $E941
CLB5,LAB_51clear the date filter flag
LDA#$00clear A
STALAB_56clear the start date low byte
STALAB_57clear the start date high byte
DECAmake A = $FF
STALAB_58set the end date low byte
STALAB_59set the end date high byte
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E9A9if null go ??
CMP#'-'compare the character with "-"
BEQLAB_E993if "-" go get the end date
search for "TODAY" or "UPDATE"
LDM#>LAB_E9EE,LAB_0Dset the "TODAY" or "UPDATE" table pointer low byte
LDM#<LAB_E9EE,LAB_0Eset the "TODAY" or "UPDATE" table pointer high byte
JSRLAB_E22Esearch for a command, return Cb=0 if found
BCSLAB_E97Dif not "TODAY" or "UPDATE" go try a date range
INYincrement the index to the word low byte
LDA(LAB_0D),Yget the word low byte
BEQLAB_E971if zero go handle "TODAY"
else it was "UPDATE"
LDYLAB_4Aget the update pointer low byte
LDXLAB_4Bget the update pointer mid byte
LDALAB_4Cget the update pointer high byte
SEB5,LAB_51set the date filter flag
BRALAB_E9AFsave AXY as the next record pointer and exit
handle "TODAY"
LAB_E971: ; $E971
JSRLAB_F4F6copy the current date/time to the temporary date/time
LAB_E974: ; $E974
JSRLAB_F526get the temporary YY:MM:DD in AX
STALAB_56save the start date low byte
STXLAB_57save the start date high byte
BRALAB_E9A5go save today as the end date
get a date range
LAB_E97D: ; $E97D
JSRLAB_F5C5get the date as DD MMM YYYY
BCSLAB_E9B7if error go do error exit
TAYcopy the last returned character
BEQLAB_E974if no following character go save the entered date as
the start and end date
JSRLAB_F526get the temporary YY:MM:DD in AX
STALAB_56save the start date low byte
STXLAB_57save the start date high byte
TAYcopy the last returned character
CMP#'-'compare the last returned character with "-"
BNELAB_E9B7if not "-" go do error exit
BRALAB_E995else get the end date without increment
get the end date
LAB_E993: ; $E993
INCLAB_0Cincrement the Rx buffer read index
LAB_E995: ; $E995
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E9A9if null go ??
************************************************************************************
get the end date ??
LAB_E99A: ; $E99A
JSRLAB_F5C5get the date as DD MMM YYYY
BCSLAB_E9B7if error go do error exit
TAYcopy the last returned character
BNELAB_E9B7if following character go do error exit
JSRLAB_F526get the temporary YY:MM:DD in AX
LAB_E9A5: ; $E9A5
STALAB_58save the end date low byte
STXLAB_59save the end date high byte
LAB_E9A9: ; $E9A9
LDYLAB_B3get the record memory start pointer low byte
LDXLAB_B4get the record memory start pointer mid byte
LDALAB_B5get the record memory start pointer high byte
save AXY as the next record pointer
LAB_E9AF: ; $E9AF
STYLAB_47save the next record pointer low byte
STXLAB_48save the next record pointer mid byte
STALAB_49save the next record pointer high byte
CLCflag ok
RTS
LAB_E9B7: ; $E9B7
SECflag error
RTS
************************************************************************************
display or set the update date
Occasionally it may be necessary to move the update pointer. The update point can
be reset to the nearest day. Specifying any date outside the range of logged data
will move the pointer to the corresponding end of the file.
LAB_E9B9: ; $E9B9
CLB5,LAB_51clear the date filter flag
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_E9B7if null just go flag an error and exit
JSRLAB_E99Aget the end date ??
BCSLAB_E9EDif error just exit
LDALAB_58get the end date low byte
LDXLAB_59get the end date high byte
STALAB_56save the start date low byte
STXLAB_57save the start date high byte
LDA#$FFset $FF for unreachable future date
STALAB_58set the end date low byte
STALAB_59set the end date high byte
LAB_E9D3: ; $E9D3
LDYLAB_47get the next record pointer low byte
LDXLAB_48get the next record pointer mid byte
LDALAB_49get the next record pointer high byte
STYLAB_4Dsave the current record pointer low byte
STXLAB_4Esave the current record pointer mid byte
STALAB_4Fsave the current record pointer high byte
JSRLAB_EDDBcopy the next record to the record buffer
BCSLAB_E9E9if error go ??
JSRLAB_EA00test for filter match, return Cb = 0 if match ??
BCSLAB_E9D3if no match go ??
LAB_E9E9: ; $E9E9
JSRLAB_FB36copy the current record pointer to the update point
CLCflag ok
LAB_E9ED: ; $E9ED
RTS
************************************************************************************
"TODAY" or "UPDATE" table
LAB_E9EE: ; $E9EE
.BYTE'TODAY',$80"TODAY"
.WORD$0000word flag for TODAY
.BYTE'UPDATE',$80"UPDATE"
.WORD$FFFFword flag for UPDATE
.BYTE$00end marker
************************************************************************************
test for filter match, return Cb = 0 if match ??
LAB_EA00: ; $EA00
LDALAB_04F8get the record year/month/date low byte
LDYLAB_04F9get the record year/month/date high byte
CPYLAB_57compare the record date with the start date high byte
BNELAB_EA0Cif the high bytes differ skip the low byte compare
CMPLAB_56compare the record date with the start date low byte
LAB_EA0C: ; $EA0C
BCCLAB_EA29if the record date is < the start date go do the no
match exit
CPYLAB_59compare the record date with the end date high byte
BNELAB_EA14if the high bytes differ skip the low byte compare
CMPLAB_58compare the record date with the end date low byte
LAB_EA14: ; $EA14
BEQLAB_EA18if the record date = the start date go do no match exit
BCSLAB_EA29if the record date is > the start date go do the no
match exit
the record date is >= the start date and <= the end date
LAB_EA18: ; $EA18
LDALAB_04F7get the record call type ??
EORLAB_52compare it with the call type match byte
ANDLAB_53mask it with the call type mask byte
BNELAB_EA29if not ?? go do the no match exit
BBS4,LAB_51,LAB_EA2Eif the metered units flag is set go compare the units
BBS6,LAB_51,LAB_EA42if the number filter flag is set go compare the number
LAB_EA27: ; $EA27
CLCflag filter match
RTS
LAB_EA29: ; $EA29
JSRLAB_FFDCswap the stack pointers
SECflag no filter match
RTS
compare the metered units with the units limit
LAB_EA2E: ; $EA2E
LDALAB_0501get the record metered units high byte
AND#$1Fmask 000x xxxx
CMPLAB_05A1compare it with the metered units limit high byte
BNELAB_EA3Eif not equal skip the low byte compare
LDALAB_0500get the record metered units low byte
CMPLAB_05A0compare it with the metered units limit low byte
LAB_EA3E: ; $EA3E
BCCLAB_EA29if the metered units are smaler than the units limit
go do the no match exit
BRALAB_EA27else return filter match
compare the number with the filter number
LAB_EA42: ; $EA42
TXAcopy X
PHAsave X
LDALAB_04F6get the record length
AND#$1Fmask 000x xxxx, the record length
SECset carry for subtract
SBC#LAB_0502-LAB_04F6
subtract the offset to the number
BCSLAB_EA50if there are digits skip the zero
LDA#$00else set zero digits
LAB_EA50: ; $EA50
ASLA* 2 digits per byte
STALAB_44save the digit count
LDY#$00clear the digit index
STYLAB_46save the digit index
LAB_EA57: ; $EA57
JSRLAB_ECB6get the digit indexed by Y
BEQLAB_EA68if null go ??
BCSLAB_EA68.
CMP#$0Ecompare with 14
BCSLAB_EA76if >= 14 go ??
SEB4,A.
JSRLAB_EA9Acompare the digit and increment the index ??
BEQLAB_EA57.
LAB_EA68: ; $EA68
LDA#$00.
JSRLAB_EA9Acompare the digit and increment the index ??
SECflag no match
BNELAB_EA71.
CLCflag match
LAB_EA71: ; $EA71
PLApull X
TAXrestore X
BCSLAB_EA29if ?? go do the no match exit
RTS
LAB_EA76: ; $EA76
AND#$01.
ASLA.... ..x.
ASLA.... .x..
ASLA.... x...
ASLA...x ....
STALAB_45.
JSRLAB_ECB6get the digit indexed by Y
BCSLAB_EA68if error go ??
ADCLAB_45.
STALAB_45.
BEQLAB_EA68if null go ??
LAB_EA89: ; $EA89
JSRLAB_ECB6get the digit indexed by Y
BCSLAB_EA68if error go ??
SEB4,A.
JSRLAB_EA9Acompare the digit and increment the index ??
BNELAB_EA68.
DECLAB_45.
BNELAB_EA89.
BRALAB_EA68.
************************************************************************************
compare the digit and increment the index ??
LAB_EA9A: ; $EA9A
LDXLAB_46get the digit index
INXincrement it
EORLAB_0600-1,Xcompare it with the ?? digit
BNELAB_EAA4if no match skip the index save
STXLAB_46else save the index
LAB_EAA4: ; $EAA4
RTS
************************************************************************************
display a record's details
LAB_EAA5: ; $EAA5
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LDALAB_04F8get the record year/month/date low byte
LDXLAB_04F9get the record year/month/date high byte
BBS7,LAB_51,LAB_EABDif the full list flag is set go output the year/month/date
if not the full list see if the date had been output for this year/month/date
CMPLAB_54compare it with the last output year/month/date low byte
BNELAB_EAB9if not output yet go do it
CPXLAB_55compare it with the last output year/month/date high byte
BEQLAB_EAC6if already output skip doing it again
LAB_EAB9: ; $EAB9
STALAB_54save the last output year/month/date low byte
STXLAB_55save the last output year/month/date high byte
LAB_EABD: ; $EABD
JSRLAB_EBE1output AX as year/month/date
BBS7,LAB_51,LAB_EAC6if the full list flag is set skip the newline
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LAB_EAC6: ; $EAC6
JSRLAB_F3F0put [SPACE] in the Tx buffer
LDALAB_04F6get the record seconds b0 byte
ASLAshift the record start seconds b0 into Cb
LDALAB_04FAget the record start minutes and seconds
LDXLAB_04FBget the record start hours and minutes
JSRLAB_EC32expand and output AX and Cb as HH:MM:SS
JSRLAB_EBECcopy the start hh:mm:ss to the call start temporary
BBC7,LAB_51,LAB_EB03if the full list flag is not set skip the ans/last time
LDALAB_50get the buffered record length
CMP#$09compare it with the ans/last length
BCSLAB_EAF1if >= $09 go do the ans/last time
JSRLAB_F316output the following null terminated string
.BYTE' - - ',$00" - - "
BRALAB_EB03go do the cleared time
LAB_EAF1: ; $EAF1
LDALAB_04F6get the record seconds b0 byte
ASLAshift the ..
ASLA.. record ans/last ..
ASLA.. seconds b0 into Cb
LDALAB_04FEget the record ans/last minutes and seconds
LDXLAB_04FFget the record ans/last hours and minutes
JSRLAB_EC32expand and output AX and Cb as HH:MM:SS
JSRLAB_EBECcopy the ans/last hh:mm:ss to the call start temporary
LAB_EB03: ; $EB03
LDALAB_04F6get the record seconds b0 byte
ASLAshift the record ..
ASLA.. cleared seconds b0 into Cb
LDALAB_04FCget the record cleared minutes and seconds
LDXLAB_04FDget the record cleared hours and minutes
JSRLAB_EC32expand and output AX and Cb as HH:MM:SS
BBC7,LAB_51,LAB_EB1Aif the full list flag is not set skip the metered units
JSRLAB_EBF9subtract and display the call start from the call
cleared hh:mm:ss
JSRLAB_EB21display 1/10ths of seconds and metered units or blank
LAB_EB1A: ; $EB1A
JSRLAB_EB64display the record call type
JSRLAB_EC40display the record digits ??
RTS
************************************************************************************
display 1/10ths of seconds and metered units or blank
LAB_EB21: ; $EB21
LDALAB_04F7get the record call type
CLB2,Amask xxxx x0xx, ??
CMP#$31compare with o/g_ans type call
BNELAB_EB4Eif not o/g_ans type call go output [SPACE]s
LDA#'.'set "." character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LDALAB_0501get the record metered units high byte
LSRAshift ..
LSRA.. the ..
LSRA.. 1/8ths of ..
LSRA.. seconds ..
LSRA.. to b2-b0
TAXcopy 1/8ths of seconds to the index
LDALAB_EB5C,Xget the nearest 1/10ths character from "01345689"
JSRLAB_F3FFput an even parity byte in the Tx buffer
JSRLAB_F3F0put [SPACE] in the Tx buffer
LDALAB_0501get the record metered units high byte
AND#$1Fmask 000x xxxx, the record length
TAXcopy the high byte to X
LDALAB_0500get the record metered units low byte
JSRLAB_F345output AX as a decimal value of four characters
BRALAB_EB59go output [SPACE] and return
LAB_EB4E: ; $EB4E
JSRLAB_F316output the following null terminated string
.BYTE' ',$00" "
LAB_EB59: ; $EB59
JMPLAB_F3F0put [SPACE] in the Tx buffer
************************************************************************************
1/8th of a second as nearest 1/10th character
fractions of seconds
measured displayed
======== =========
x.000 x.0
x.125 x.1
x.250 x.3
x.375 x.4
x.500 x.5
x.625 x.6
x.750 x.8
x.875 x.9
LAB_EB5C: ; $EB5C
.BYTE'01345689'eighths of a second as the nearest tenth
************************************************************************************
display the record call type
LAB_EB64: ; $EB64
LDALAB_04F7get the record call type
BMILAB_EB86if ?? do error exit
LDX#$00clear the table index
LAB_EB6B: ; $EB6B
CMPLAB_EB88,Xcompare the flags with the table byte
BEQLAB_EB76if match go output the string
INXelse increment the index ..
INX.. to the next flags byte
CPX#$12compare the index with max + 1
BCCLAB_EB6Bloop if not there yet
LAB_EB76: ; $EB76
LDYLAB_EB88+1,Xget the string offset
LAB_EB79: ; $EB79
LDALAB_EB9A,Yget a string character
BEQLAB_EB84if null go do ok exit
JSRLAB_F3FFput an even parity byte in the Tx buffer
INYincrement the string index
BNELAB_EB79loop for the next character, branch always
LAB_EB84: ; $EB84
CLCflag ok
RTS
LAB_EB86: ; $EB86
SECflag error
RTS
************************************************************************************
record call type bytes and string offsets
LAB_EB88: ; $EB88
.BYTE$10"seized"
.BYTELAB_EB9A-LAB_EB9Aoffset from the table start to the "seized" string
.BYTE$12"parked"
.BYTELAB_EB9A-LAB_EBA1offset from the table start to the "parked" string
.BYTE$20"i/c"
.BYTELAB_EB9A-LAB_EBA8offset from the table start to the "i/c" string
.BYTE$21"i/c_ans"
.BYTELAB_EB9A-LAB_EBACoffset from the table start to the "i/c_ans" string
.BYTE$23"i/c_cont"
.BYTELAB_EB9A-LAB_EBB4offset from the table start to the "i/c_cont" string
.BYTE$30"o/g"
.BYTELAB_EB9A-LAB_EBBDoffset from the table start to the "o/g" string
.BYTE$31"o/g_ans"
.BYTELAB_EB9A-LAB_EBC6offset from the table start to the "o/g_ans" string
.BYTE$34"o/g*"
.BYTELAB_EB9A-LAB_EBCFoffset from the table start to the "o/g*" string
.BYTE$35"o/g*ans"
.BYTELAB_EB9A-LAB_EBD8offset from the table start to the "o/g*ans" string
************************************************************************************
record call type strings
LAB_EB9A: ; $EB9A
.BYTE'seized',$00
LAB_EBA1: ; $EBA1
.BYTE'parked',$00
LAB_EBA8: ; $EBA8
.BYTE'i/c',$00
LAB_EBAC: ; $EBAC
.BYTE'i/c_ans',$00
LAB_EBB4: ; $EBB4
.BYTE'i/c_cont',$00
LAB_EBBD: ; $EBBD
.BYTE'o/g ',$00
LAB_EBC6: ; $EBC6
.BYTE'o/g_ans ',$00
LAB_EBCF: ; $EBCF
.BYTE'o/g* ',$00
LAB_EBD8: ; $EBD8
.BYTE'o/g*ans ',$00
************************************************************************************
output AX as year/month/date
LAB_EBE1: ; $EBE1
JSRLAB_F542expand AX into the temporary YY:MM:DD ??
LDX#>LAB_34set the date pointer low byte
LDY#<LAB_34set the date pointer high byte
JSRLAB_F6DAoutput the date as DD MMM YYY
RTS
************************************************************************************
copy temp hh:mm:ss to LAB_3B ??
LAB_EBEC: ; $EBEC
LDALAB_37?? temporary hour
STALAB_3Bsave the start hour
LDALAB_38?? temporary minute
STALAB_3Csave the start minute
LDALAB_39?? temporary second
STALAB_3Dsave the start second
RTS
************************************************************************************
subtract and display the call start from the call cleared hh:mm:ss
LAB_EBF9: ; $EBF9
SECset carry for subtract
LDALAB_39get the call cleared second
SBCLAB_3Dsubtract the call start second
BCSLAB_EC03if no underflow skip the seconds correct
ADC#$3Celse add 60 seconds
CLCand clear the carry for minutes subtract + 1
LAB_EC03: ; $EC03
PHAsave the seconds difference
LDALAB_38get the call cleared minute
SBCLAB_3Csubtract the call start minute
BCSLAB_EC0Dif no underflow skip the minutes correct
ADC#$3Celse add 60 minutes
CLCand clear the carry for hours subtract + 1
LAB_EC0D: ; $EC0D
PHAsave the minutes difference
LDALAB_37get the call cleared hour
SBCLAB_3Bsubtract the call start hour
BCSLAB_EC16if no underflow skip the hours correct
ADC#$18else add 24 hours
LAB_EC16: ; $EC16
BEQLAB_EC24if the hours are zero go output spaces
JSRLAB_F350output A as a two digit decimal value
JSRLAB_F3F4put ":" in the Tx buffer
PLApull the minutes difference
JSRLAB_F368output A as a three digit decimal value
BRALAB_EC2Bgo output the seconds
LAB_EC24: ; $EC24
JSRLAB_F3EAput [SPACE][SPACE][SPACE] in the Tx buffer
PLApull the minutes difference
JSRLAB_F350output A as a two digit decimal value
LAB_EC2B: ; $EC2B
JSRLAB_F3F4put ":" in the Tx buffer
PLApull the seconds difference
JMPLAB_F368output A as a three digit decimal value and return
************************************************************************************
expand and output AX and Cb as HH:MM:SS
LAB_EC32: ; $EC32
JSRLAB_F568expand AX and Cb into temporary HH:MM:SS
LDX#>LAB_34set the date/time pointer low byte
LDY#<LAB_34set the date/time pointer high byte
JSRLAB_F742output the time as HH:MM:SS
JSRLAB_F3F0put [SPACE] in the Tx buffer
RTS
************************************************************************************
display the record digits ??
LAB_EC40: ; $EC40
LDALAB_04F6get the record length
AND#$1Fmask 000x xxxx, the record length
SECset carry for subtract
SBC#LAB_0502-LAB_04F6
subtract the offset to the number
BCSLAB_EC4Cif there are digits skip the zero
LDA#$00else set zero digits
LAB_EC4C: ; $EC4C
ASLA* 2 digits per byte
STALAB_44save the digit count
LDY#$00clear the digit index
LAB_EC51: ; $EC51
JSRLAB_ECB6get the digit indexed by Y
BEQLAB_EC61if null just exit
BCSLAB_EC61if error just exit
CMP#$0Ecompare with 14
BCSLAB_EC62if >= 14 go ??
JSRLAB_EC8E?? output keypad character [A]
BRALAB_EC51loop for the next digit
LAB_EC61: ; $EC61
RTS
LAB_EC62: ; $EC62
AND#$01.
ASLA.
ASLA.
ASLA.
ASLA.
STALAB_45.
LDA#'('set "(" character
JSRLAB_F3FFput an even parity byte in the Tx buffer
JSRLAB_ECB6get the digit indexed by Y
BCSLAB_EC87.
ADCLAB_45.
STALAB_45.
BEQLAB_EC87.
LAB_EC7A: ; $EC7A
JSRLAB_ECB6get the digit indexed by Y
BCSLAB_EC87.
SEB4,A.
JSRLAB_EC8E?? output keypad character [A]
DECLAB_45.
BNELAB_EC7A.
LAB_EC87: ; $EC87
LDA#')'set ")" character
JSRLAB_F3FFput an even parity byte in the Tx buffer
BRALAB_EC51.
************************************************************************************
?? output keypad character [A]
LAB_EC8E: ; $EC8E
TAXcopy A to the index
LDALAB_EC96,Xget the keypad character [X]
JSRLAB_F3FFput an even parity byte in the Tx buffer
RTS
************************************************************************************
keypad character tables
LAB_EC96: ; $EC96
.BYTE' 1234567890?./ '
LAB_ECA6:
.BYTE'D1234567890*#ABC'
************************************************************************************
get the digit indexed by Y
LAB_ECB6: ; $ECB6
CPYLAB_44compare the index with the digit count
BCSLAB_ECCBif done go return error
TYAcopy the digit index
LSRA/ 2
TAXcopy the byte index
LDALAB_0502,Xget the digit's byte
BCSLAB_ECC6if Cb = 1 go use the low nibble
LSRAelse shift the ..
LSRA.. high nibble ..
LSRA.. to the ..
LSRA.. low nibble
LAB_ECC6: ; $ECC6
INYincrement the digit index
AND#$0Fmask the nibble
CLCflag ok
RTS
LAB_ECCB: ; $ECCB
SECflag error
RTS
************************************************************************************
transfer logged call data then automatically disconnect
LAB_ECCD: ; $ECCD
JSRLAB_ECD6do download
BCSLAB_ECD5if error just exit
LDM#$00,LAB_08else clear the signed on flag
LAB_ECD5: ; $ECD5
RTS
************************************************************************************
transfer logged call data
data is ..
[NAK] .. waits 1 second for a [NAK] reply 5 times
<block> .. waits 1 second for an [ACK] reply then send the next block
if no [ACK] ..
[NAK] .. waits 1 second for a [NAK] reply 20 times then resends the block
after all the blocks or after a no [ACK], no [NAK] exit
[NAK] .. waits 1 second for a [NAK] reply 5 times
[EOT]
LAB_ECD6: ; $ECD6
JSRLAB_E877find a filter and set the match/mask values
BCSLAB_ED45if error just exit
JSRLAB_E941get a date range ??
BCSLAB_ED45if error just exit
LDM#$00,LAB_60clear the block number low byte
LDM#$00,LAB_61clear the block number high byte
JSRLAB_ED55save the download header to the buffer
LDY#$05set 5 times
BRALAB_ECF8go wait for [NAK]
output the next block of records
LAB_ECED: ; $ECED
LDY#$14set 20 times
JSRLAB_EDA3fill the transmit buffer with records
BCSLAB_ED10if error go ??, never branches, Cb is always 0
BEQLAB_ED0Eif no records copied do the send loop ok exit
BRALAB_ECFFbranch into the send loop
LAB_ECF8: ; $ECF8
JSRLAB_EE81send [NAK] and wait 1 second for [NAK] Y times
BVSLAB_ED10if no [NAK] go do error exit
BCSLAB_ED10if error go do error exit
LAB_ECFF: ; $ECFF
JSRLAB_EE24put the block in the Tx buffer
return Cb = 1 if RI or CD
return Vb = 1 if no ACK
BVSLAB_ECF8if no ACK go wait for [NAK]
BCSLAB_ED10if RI or CD go do error exit
INCLAB_60increment the block number low byte
BNELAB_ED0Cif no rollover skip the high byte increment
INCLAB_61increment the block number high byte
LAB_ED0C: ; $ED0C
BRALAB_ECEDgo do another block of records
LAB_ED0E: ; $ED0E
CLVflag no no [NAK]
CLCflag no error
LAB_ED10: ; $ED10
PHPsave the status
LDY#$05set 5 times
JSRLAB_EE81send [NAK] and wait 1 second for [NAK] Y times
LDA#$04set [EOT]
JSRLAB_F40Bput a byte in the Tx buffer
PLPrestore the status
NOPdo nothing
BVSLAB_ED46if no [NAK] go do error exit
BCSLAB_ED46if error go do error exit
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,$07,'downloaded',$00
JSRLAB_E80Eoutput calls and units ??
BBC5,LAB_51,LAB_ED44if the date filter flag is clear skip ??
LDYLAB_47get the next record pointer low byte
LDXLAB_48get the next record pointer mid byte
LDALAB_49get the next record pointer high byte
STYLAB_4Dsave the current record pointer low byte
STXLAB_4Esave the current record pointer mid byte
STALAB_4Fsave the current record pointer high byte
LAB_ED44: ; $ED44
CLCflag no error
LAB_ED45: ; $ED45
RTS
LAB_ED46: ; $ED46
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'aborted',$00
SECflag error
RTS
************************************************************************************
save the download header to the buffer
header is ..
<index to byte after ref>,$80,[STX],<version byte>,<serial # word>,<$10 num bytes>,
<$xx ref bytes>,<index to end read settings bytes>,$81,<$1C settings bytes>
LAB_ED55: ; $ED55
LDX#$01set the index
LDA#$80.
JSRLAB_ED9Esave A to the buffer and increment the index ??
LDA#$02set [STX]
JSRLAB_ED9Esave A to the buffer and increment the index ??
LDALAB_E002get the version number low byte
JSRLAB_ED9Esave A to the buffer and increment the index ??
LDALAB_E000get the serial number low byte
JSRLAB_ED9Esave A to the buffer and increment the index ??
LDALAB_E000+1get the serial number high byte
JSRLAB_ED9Esave A to the buffer and increment the index ??
LDY#$00clear the read index
LAB_ED75: ; $ED75
LDALAB_0547,Yget a num character
JSRLAB_ED9Esave A to the buffer and increment the index ??
INYincrement the read index
CPY#$12compare the index with max + 1
BCCLAB_ED75loop if more to do
STXLAB_0200save the length so far
INXincrement the buffer index
LDA#$81.
JSRLAB_ED9Esave A to the buffer and increment the index ??
copy the settings, metered units and date/time to the header
LDY#$02set the index to the digits value
SEIdisable the interrupts
LAB_ED8C: ; $ED8C
LDALAB_6B-2,Yget a byte from the settings
JSRLAB_ED9Esave A to the buffer and increment the index ??
INYincrement the read index
CPY#LAB_85+1-LAB_6B+2
compare Y with the end + 1
BCCLAB_ED8Cloop if more bytes to do
CLIenable the interrupts
STXLAB_62save the block buffer length
LDXLAB_0200restore the index to the start of the settings
TYAcopy the read index
************************************************************************************
save A to the buffer and increment the index ??
LAB_ED9E: ; $ED9E
STALAB_0200,Xsave the read index to the buffer
INXincrement the buffer index
RTS
************************************************************************************
fill the transmit buffer with records
LAB_EDA3: ; $EDA3
TYAcopy Y
PHAsave Y
LDA#$0Aset the record count
LDX#$00clear the transmit buffer index
LAB_EDA9: ; $EDA9
PHAsave the record count
LAB_EDAA: ; $EDAA
TXAcopy X
PHAsave X
JSRLAB_EDDBcopy the next record to the record buffer
PLApull X
TAXrestore X
BCSLAB_EDCAif no more records skip the record copy
JSRLAB_EA00test for filter match, return Cb = 0 if match ??
BCSLAB_EDAAif no match go get another record
JSRLAB_E7F0increment the calls count and add units from the buffered
record ??
LDY#$00clear the buffered record index
LAB_EDBD: ; $EDBD
LDALAB_04F6,Yget a byte from the buffered record
STALAB_0200,Xsave it to the block buffer
INXincrement the block buffer index
INYincrement the buffered record index
CPYLAB_50compare the buffered record index with the buffered
record length
BCCLAB_EDBDloop if more bytes to copy
CLCflag still records
LAB_EDCA: ; $EDCA
PLArestore the record count
BCSLAB_EDD4if no more records exit
DECAdecrement the record count
BEQLAB_EDD4if all done just exit
CPX#$E0compare the buffer index with $E0
BCCLAB_EDA9if there is still room go get another record
LAB_EDD4: ; $EDD4
STXLAB_62save the block buffer length
PLApull Y
TAYrestore Y
TXAcopy the transmit buffer length
CLCflag ok
RTS
************************************************************************************
copy the next record to the record buffer
return Cb = 1 if error
LAB_EDDB: ; $EDDB
LDYLAB_47get the next record pointer low byte
LDXLAB_48get the next record pointer mid byte
LDALAB_49get the next record pointer high byte
CMPLAB_B8compare it with the record memory end pointer high byte
BNELAB_EDEDif not the same go get a record
CPXLAB_B7compare it with the record memory end pointer mid byte
BNELAB_EDEDif not the same go get a record
CPYLAB_B6compare it with the record memory end pointer low byte
BEQLAB_EE21if the same go do error exit
LAB_EDED: ; $EDED
JSRLAB_FFA3set bank and LAB_63/64 pointer from A ??
LDA(LAB_63),Yget the record length
AND#$1Fmask 000x xxxx, the record length
BEQLAB_EE21if zero length record go do error exit
STALAB_50save the buffered record length
LDX#$00clear the record buffer index
BRALAB_EE19branch into the loop
LAB_EDFC: ; $EDFC
LDA(LAB_63),Yget a record byte
STALAB_04F6,Xsave it to the record buffer
INXincrement the record buffer index
INYincrement the record index
STYLAB_47save the next record pointer low byte
BNELAB_EE19if no rollover skip the record pointer rollover
TXAcopy the record buffer index
PHAsave the record buffer index
LDXLAB_48get the next record pointer mid byte
LDALAB_49get the next record pointer high byte
JSRLAB_FF90increment, check and rollover the XA word ??
STXLAB_48save the next record pointer mid byte
STALAB_49save the next record pointer high byte
JSRLAB_FFA3set bank and LAB_63/64 pointer from A ??
PLApull the record buffer index
TAXrestore the record buffer index
LAB_EE19: ; $EE19
CPXLAB_50compare record buffer index with the buffered record
length
BCCLAB_EDFCloop if more record bytes to copy
CLCflag ok
LAB_EE1E: ; $EE1E
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
RTS
LAB_EE21: ; $EE21
SECflag error
BRALAB_EE1Ego exit
************************************************************************************
put a block in the Tx buffer
return Cb = 1 if RI or CD
return Vb = 1 if no ACK
block is ..
[STX],<block #.w>,<block len.b>,<block bytes>,<checksum.w>
LAB_EE24: ; $EE24
LDM#$00,LAB_5Eclear the checksum low byte
LDM#$00,LAB_5Fclear the checksum high byte
LDA#$02set [STX]
JSRLAB_EE71put a byte in the Tx buffer and checksum it ??
LDALAB_60get the block number low byte
JSRLAB_EE71put a byte in the Tx buffer and checksum it ??
LDALAB_61get the block number high byte
JSRLAB_EE71put a byte in the Tx buffer and checksum it ??
LDALAB_62get the block length
PHAsave the block length
JSRLAB_EE71put a byte in the Tx buffer and checksum it ??
PLArestore the block length
BEQLAB_EE4Fif zero skip the block copy
LDX#$00clear the count/index
LAB_EE44: ; $EE44
LDALAB_0200,Xget a block byte
JSRLAB_EE71put a byte in the Tx buffer and checksum it ??
INXincrement the count/index
CPXLAB_62compare it with the block length
BCCLAB_EE44loop if more to do
LAB_EE4F: ; $EE4F
LDALAB_5Eget the checksum low byte
JSRLAB_F40Bput a byte in the Tx buffer
LDALAB_5Fget the checksum high byte
JSRLAB_F40Bput a byte in the Tx buffer
JSRLAB_F443wait for timer 2 ??
LDALAB_04get the ?? buffer read index
STALAB_03save the ?? buffer write index
clear the buffer
JSRLAB_F2C0wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
BCSLAB_EE70if no carrier or ring just exit
BVSLAB_EE6Fif 1 second counted do ok exit
BITLAB_F2F8set Vb
CMP#$06compare the character with [ACK]
BNELAB_EE6Fif not ACK exit with Vb = 1
CLVclear Vb, flag [ACK]
LAB_EE6F: ; $EE6F
CLCflag no error
LAB_EE70: ; $EE70
RTS
************************************************************************************
put a byte in the Tx buffer and checksum it ??
LAB_EE71: ; $EE71
PHAsave the byte
JSRLAB_F40Bput a byte in the Tx buffer
PLArestore the byte
CLCclear carry for add
LAB_EE78 = $EE78 ; this label is because of an incorrect byte ##
ADCLAB_5Eadd the checksum low byte
STALAB_5Esave the checksum low byte
BCCLAB_EE80if no carry skip the high byte increment
INCLAB_5Felse increment the high byte
CLCflag ok
LAB_EE80: ; $EE80
RTS
************************************************************************************
send [NAK] and wait 1 second for [NAK] Y times
return Cb = 1 if error
return Vb = 1 in no [NAK]
LAB_EE81: ; $EE81
LDA#$15set [NAK]
JSRLAB_F40Bput a byte in the Tx buffer
JSRLAB_F443wait for timer 2 ??
LDALAB_04get the ?? buffer read index
STALAB_03save the ?? buffer write index
clear the buffer
JSRLAB_F2C0wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
BCSLAB_EEA1if no carrier or ring just exit
EOR#$15compare the character with [NAK]
CLVflag not no [NAK]
BEQLAB_EEA1if [NAK] just exit
JSRLAB_F143wait for 1/2 a second
DEYdecrement the wait count
BNELAB_EE81loop if more to do
BITLAB_F2F8set Vb, flag no [NAK]
CLCflag no error
LAB_EEA1: ; $EEA1
RTS
************************************************************************************
The progress of monitored calls is shown as it develops. If a call is already in
progress its immediate history is shown, otherwise any previous call is displayed.
There is no inactivity time-out in live mode, use the currently defined break key
to exit live mode.
There is a bug in this routine that means the call type is not correctly displayed.
LAB_EEA2: ; $EEA2
JSRLAB_E517display the break value
JSRLAB_F3F8put [CR][LF] in the Tx buffer
LDY#$00.
CPYLAB_5A.
BNELAB_EEBA.
LAB_EEAE: ; $EEAE
LDY#$00clear the index
JSRLAB_EEF2set Cb if Y = LAB_5A ??
BCSLAB_EEE7.
LDA#$07set [BELL] character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LAB_EEBA: ; $EEBA
LDALAB_0578get the ?? minutes/seconds
LDXLAB_0579get the ?? hours/minutes
CLCclear the seconds b0
JSRLAB_EC32expand and output AX and Cb as HH:MM:SS
INYset Y = $01
LAB_EEC5: ; $EEC5
INYincrement the digit index
JSRLAB_EEF2set Cb if Y = LAB_5A ??
BCSLAB_EEE7if all done just exit
CPYLAB_5A.
BCSLAB_EEAE.
LDXLAB_057A-2,Yget a ?? character
BMILAB_EEDCif end marker go do the call type
LDALAB_EC96,Xget the keypad character [X]
JSRLAB_F3FFput an even parity byte in the Tx buffer
BRALAB_EEC5.
LAB_EEDC: ; $EEDC
LDALAB_EE78,Xget a live table string character
## there is a bug here, this address should be LAB_EEF8
BEQLAB_EEC5if end marker return to ??
JSRLAB_F3FFput an even parity byte in the Tx buffer
INXincrement the index
BNELAB_EEDCgo get another character, branch always
LAB_EEE7: ; $EEE7
CLCflag ok
RTS
LAB_EEE9: ; $EEE9
JSRLAB_F2F9check for no carrier, ring or break
BCSLAB_EEF7if no carrier, ring or break go exit
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
************************************************************************************
set Cb if Y = LAB_5A ??
LAB_EEF2: ; $EEF2
CPYLAB_5A.
BEQLAB_EEE9.
CLCflag ok
LAB_EEF7: ; $EEF7
RTS
************************************************************************************
live table strings
this data is unused because of an incorrect byte ##
LAB_EEF8:
.BYTE'ring',$00"ring"
.BYTE'/answ',$00"/answ"
.BYTE'/clear',$0D,$0A,$00
"/clear",[CR],[LF]
.BYTE'seized',$00"seized"
.BYTE'parked',$00"parked"
.BYTE'/',$00"/"
************************************************************************************
RINGBACK n
when the RINGBACK command is entered with a telephone number of minimum length of
one digit, maximum length fifteen digits digits, the message "hang up" is sent and
the line is dropped before ten seconds is allowed for the incoming call to clear.
The line is then seized and the number that was entered is loop dialled. The logger
is now the call originator so the terminal should switch to answer mode. Hayes
compatible modems allegedly default to answer mode under these conditions. If a
carrier is not detected within 30 seconds of dialling then a second attempt is made
before giving up and signing the user off.
While in answer mode the terminal should not echo transmitted characters to the
screen or recieved characters back to the Monolog.
LAB_EF1C: ; $EF1C
BBC3,LAB_F0,LAB_EF99test b3 port 2 data register, modem/RS232 select
if RS232 selected go do error exit
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_EF99if null go flag an error and exit
LDX#$00clear the ringback number index
LAB_EF26: ; $EF26
JSRLAB_F257get a non space character from the Rx buffer
BEQLAB_EF44if null go test he length and do ringback
SECset carry for subtract
SBC#$30convert ASCII to digit
BCCLAB_EF99if < 0 go do error exit
BEQLAB_EF38if 0 go convert it to 10
CMP#9+1compare it with max + 1
BCSLAB_EF99if > 9 go do error exit
BCCLAB_EF3Ago save the character, branch always
LAB_EF38: ; $EF38
LDA#$0Aconvert 0 to 10
LAB_EF3A: ; $EF3A
STALAB_0406,Xsave the digit to the ringback number buffer
INXincrement the ringback number length
CPX#$10compare the ringback number length with max + 1
BCCLAB_EF26if less go get another ringback digit
BCSLAB_EF99else go flag an error and exit
LAB_EF44: ; $EF44
STALAB_0406,Xsave the null end to the rignback number buffer
CPX#$02compare the length with two
BCCLAB_EF99if less than two go flag an error and exit
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'hang up',$0D,$0A,$0A,$00
JSRLAB_F443wait for timer 2 ??
SEB6,LAB_F0set b6 port 2 data register, turn the modem off
JSRLAB_EFACwait 10 seconds for carrier clear
BCSLAB_EF99if carrier still present do error exit
JSRLAB_F12Frelease the line and wait 2 seconds
JSRLAB_F139wait for 10 seconds
LDY#$02set the retry count
LAB_EF6D: ; $EF6D
JSRLAB_F12Frelease the line and wait 2 seconds
JSRLAB_F12Cset modem select, seize the line
JSRLAB_F134wait for 2 seconds
JSRLAB_F16Adisable the UART and set timer 2 to 10ms ??
LDX#$00clear the ringback number index
LAB_EF7B: ; $EF7B
LDALAB_0406,Xget a character from the ringback number buffer
BEQLAB_EF86if the end marker go wait for an answer
JSRLAB_EF9Bdial an outgoing digit
INXincrement the ringback number index
BRALAB_EF7Bloop
LAB_EF86: ; $EF86
JSRLAB_F14Fsetup the UART and timer 2 and clear the Tx/Rx buffers ??
JSRLAB_F0D3set originate mode, wait 30 seconds for two seconds of
new carrier and then ??
BCSLAB_EF93if error go decrement the retry count
JSRLAB_E1E3output 'Monolog ', serial#, version#, RAM size
CLCflag ok
RTS
LAB_EF93: ; $EF93
DEYdecrement the retry count
BNELAB_EF6Dloop if more tries left
LDM#$00,LAB_08clear the signed on flag
LAB_EF99: ; $EF99
SECflag error
RTS
************************************************************************************
dial an outgoing digit
LAB_EF9B: ; $EF9B
STALAB_42save the digit to dial
BBS2,LAB_FE,LAB_EFA4if 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_EFA4: ; $EFA4
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
BBC7,LAB_42,LAB_EFA4if stil dialing wait some more
RTS
************************************************************************************
wait 10 seconds for carrier clear
LAB_EFAC: ; $EFAC
LDM#$50,LAB_3Fset the 1/8th second countdown byte
LAB_EFAF: ; $EFAF
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
CLCflag no carrier
BBS4,LAB_F0,LAB_EFBCtest b4 port 2 data register, carrier detect
if no carrier detected just exit
TSTLAB_3Ftest the 1/8th second countdown byte
BNELAB_EFAFloop if not timed out
SECflag carrier
LAB_EFBC: ; $EFBC
RTS
************************************************************************************
display the line votage
LAB_EFBD: ; $EFBD
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'VLine ',$00
LDALAB_25get the A2D channel 3 byte (Battery)
STALAB_14save the A2D channel 3 byte (Battery)
LDALAB_1Fget the A2D channel 0 byte
SECset carry for subtract
SBCLAB_14subtract the A2D channel 3 byte (Battery)
BCSLAB_EFD7if ch0 >= ch3 skip the 2's complement
EOR#$FFtoggle the byte
INCAmake 2's complement
LAB_EFD7: ; $EFD7
PHAsave (ch0-ch3)
LDM#>$72C5,LAB_16set the dividend low byte, 114.77 in 8.8 fixed point
LDM#<$72C5,LAB_17set the dividend high byte, 114.77 in 8.8 fixed point
LDM#$00,LAB_15clear the divisor high byte
JSRLAB_F0A9divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
does 114.77 / ch3
PLArestore (ch0-ch3)
STALAB_14save the multiplicand low byte
LDM#$00,LAB_15clear the multiplicand high byte
JSRLAB_F07Emult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
does 114.77 / ch3 * (ch0-ch3)
TXAtake the integer part of the result
JMPLAB_F368output A as a three digit decimal value
************************************************************************************
display or set the VThreshold value
LAB_EFF1: ; $EFF1
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_F00Cif null just go output the current value
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_F022if there is a following character go do error exit
CPX#$00test the result high byte
BNELAB_F022if the high byte is not zero go do error exit
CMP#$3Ccompare the value with max + 1
BCSLAB_F022if > max go do error exit
CMP#$0Acompare the value with the minimum
BCCLAB_F022if < minimum go do error exit
STALAB_6Dsave the VThreshold value
JSRLAB_F024save the integer part of VThreshold * 2.277 in LAB_94
LAB_F00C: ; $F00C
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'VThreshold ',$00
LDALAB_6Dget the VThreshold value
JMPLAB_F368output A as a three digit decimal value and return
LAB_F022: ; $F022
SECflag error
RTS
************************************************************************************
save the integer part of VThreshold * 2.277 in LAB_94
LAB_F024: ; $F024
LDALAB_6Dget the VThreshold value
STALAB_16save the multiplier low byte
LDM#$00,LAB_17clear the multiplier high byte
LDM#>$0247,LAB_14set the multiplicand low byte, 2.277 in 8.8 fixed point
LDM#<$0247,LAB_15set the multiplicand high byte, 2.277 in 8.8 fixed point
JSRLAB_F07Emult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
STXLAB_94save the integer part of the result
RTS
************************************************************************************
display the battery voltage
LAB_F037: ; $F037
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'VBattery ',$00
LDM#>$FA00,LAB_16set the dividend low byte, 250.00 in 8.8 fixed point
LDM#<$FA00,LAB_17set the dividend high byte, 250.00 in 8.8 fixed point
LDALAB_25get the A2D channel 3 byte (Battery)
CLCclear carry for add
ADCLAB_E004add the VBattery constant
STALAB_14save the divisor low byte
LDM#$00,LAB_15clear the divisor high byte
JSRLAB_F0A9divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
does 250 / (ch3+const)
LDALAB_16get the result low byte
LDXLAB_17get the result high byte
JMPLAB_F35Doutput AX as a xx.xx digit decimal value and return
************************************************************************************
read the A2D channel 3 byte (Battery)
LAB_F061: ; $F061
LDA#$03set channel 3
.BYTE$2Cmakes the next line BIT $xxxx
************************************************************************************
read the A2D channel 2 byte (Meter)
LAB_F064: ; $F064
LDA#$02set channel 2
.BYTE$2Cmakes the next line BIT $xxxx
************************************************************************************
read the A2D channel 1 byte
LAB_F067: ; $F067
LDA#$01set channel 1
.BYTE$2Cmakes the next line BIT $xxxx
************************************************************************************
read the A2D channel 0 byte
LAB_F06A: ; $F06A
LDA#$00set channel 0
************************************************************************************
read an A2D byte from channel [A]
LAB_F06C: ; $F06C
BBC2,LAB_E9,LAB_F06Cread the A2D control register and loop if not ready
CLB6,LAB_F3clear b6 port 1 data register, turn vref on
STALAB_E9set the A2D control register and start the conversion
LAB_F073: ; $F073
BBC2,LAB_E9,LAB_F073read the A2D control register and loop if not ready
LDALAB_EAread the A2D data register
SEB6,LAB_F3set b6 port 1 data register, turn vref off
LDM#$02,LAB_E9set the A2D control register to channel 0
RTS
************************************************************************************
multiply LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
LAB_F07E: ; $F07E
LDA#$00clear A
STALAB_12clear the partial low byte
STALAB_13clear the partial high byte
LDX#$10set the bit count
LAB_F086: ; $F086
ASLLAB_12shift the partial low byte
ROLLAB_13shift the partial high byte
ASLLAB_16shift the multiplier low byte
ROLLAB_17shift the multiplier high byte
BCCLAB_F09Dif top bit clear skip the add
CLCclear carry for add
LDALAB_12get the partial low byte
ADCLAB_14add the multiplicand low byte
STALAB_12save the partial low byte
LDALAB_13get the partial high byte
ADCLAB_15add the multiplicand low byte
STALAB_13save the partial high byte
LAB_F09D: ; $F09D
DEXdecrement the bit count
BNELAB_F086loop if more to do
LDALAB_12get the result low byte
LDXLAB_13get the result high byte
STALAB_16save the result low byte
STXLAB_17save the result high byte
RTS
************************************************************************************
divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
LAB_F0A9: ; $F0A9
LDA#$00clear A
STALAB_12clear the remainder low byte
STALAB_13clear the remainder high byte
LDX#$10set the bit count
BRALAB_F0B7branch into the divide loop
LAB_F0B3: ; $F0B3
ROLLAB_12shift the remainder low byte
ROLLAB_13shift the remainder high byte
LAB_F0B7: ; $F0B7
SECset carry for subtract
LDALAB_12get the remainder low byte
SBCLAB_14subtract the divisor low byte
TAYcopy the remainder low byte
LDALAB_13get the remainder high byte
SBCLAB_15subtract the divisor high byte
BCCLAB_F0C7if underflowed skip the save
STYLAB_12save the remainder low byte
STALAB_13save the remainder high byte
LAB_F0C7: ; $F0C7
ROLLAB_16shift the dividend low byte
ROLLAB_17shift the dividend high byte
DEXdecrement the bit count
BPLLAB_F0B3loop if more to do
LDALAB_16get the result low byte
LDXLAB_17get the result high byte
RTS
************************************************************************************
set originate mode, wait 30 seconds for two seconds of new carrier and then ??
LAB_F0D3: ; $F0D3
LDA#$F0set the 1/8th second count to 30 seconds
SEB5,LAB_F0set b5 port 2 data register, set originate mode
JSRLAB_F0E7wait A 1/8ths of a second for two seconds of new carrier
BCSLAB_F0E2if error just exit
CLB6,LAB_F0clear b6 port 2 data register, turn the modem off
JSRLAB_F134wait for 2 seconds
CLCflag ok
LAB_F0E2: ; $F0E2
RTS
************************************************************************************
wait 15 seconds for two seconds of new carrier
LAB_F0E3: ; $F0E3
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_F0E7: ; $F0E7
SEB6,LAB_F0set b6 port 2 data register, turn the modem on
JSRLAB_F12Cset modem select, seize the line
make sure there is no carrier
LDM#$10,LAB_3Fset the 1/8th second countdown byte, 2 seconds
LAB_F0EF: ; $F0EF
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
TSTLAB_3Ftest the 1/8th second countdown byte
BEQLAB_F12Aif timed out go do error exit
BBC4,LAB_F0,LAB_F0EFtest b4 port 2 data register, carrier detect
if carrier detected just loop
no carrier was detected
BBS5,LAB_F0,LAB_F109test b5 port 2 data register, originate/answer
if originate go wait for the new carrier
is answer mode so ??
JSRLAB_F134wait for 2 seconds
SEB7,LAB_F3?? port 1 data register
CLB6,LAB_F0clear b6 port 2 data register, turn the modem on
JSRLAB_F13Ewait for 3 seconds
CLB7,LAB_F3?? port 1 data register
wait for the carrier to be detected
LAB_F109: ; $F109
STALAB_3Fsave the 1/8th second countdown byte
LAB_F10B: ; $F10B
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
LAB_F10F: ; $F10F
LDALAB_3Fget the 1/8th second countdown byte
SECset carry for subtract
SBC#$10subtract $10 1/8ths of a second
BCCLAB_F12Aif < 2 seconds left go do error exit
BBS4,LAB_F0,LAB_F10Btest b4 port 2 data register, carrier detect
if no carrier detected go wait some more
carrier is present, make sure it stays for two seconds
LAB_F119: ; $F119
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
BBS4,LAB_F0,LAB_F10Ftest b4 port 2 data register, carrier detect
if no carrier detected go wait for the carrier
CMPLAB_3Fcompare it with the 1/8th second countdown byte
BCCLAB_F119if 2 seconds haven't elapsed go wait some more
carrier has been present for 2 seconds
LDALAB_04get the ?? buffer read index
STALAB_03save the ?? buffer write index
clear the buffer
CLCflag ok
RTS
LAB_F12A: ; $F12A
SECflag error
RTS
************************************************************************************
set modem select, seize the line
LAB_F12C: ; $F12C
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_F12F: ; $F12F
BBC3,LAB_F0,LAB_F14Etest 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_F134: ; $F134
LDM#$10,LAB_3Fset the 1/8th second countdown byte
BRALAB_F146wait for LAB_3F 1/8ths of a second
************************************************************************************
wait for 10 seconds
LAB_F139: ; $F139
LDM#$50,LAB_3Fset the 1/8th second countdown byte
BRALAB_F146wait for LAB_3F 1/8ths of a second
************************************************************************************
wait for 3 seconds
LAB_F13E: ; $F13E
LDM#$18,LAB_3Fset the 1/8th second countdown byte
BRALAB_F146wait for LAB_3F 1/8ths of a second
************************************************************************************
wait for 1/2 a second
LAB_F143: ; $F143
LDM#$04,LAB_3Fset the 1/8th second countdown byte
************************************************************************************
wait for LAB_3F 1/8ths of a second
LAB_F146: ; $F146
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
TSTLAB_3Ftest the 1/8th second countdown byte
BNELAB_F146loop if not counted out
LAB_F14E: ; $F14E
RTS
************************************************************************************
setup the UART and timer 2 and clear the Tx/Rx buffers ??
LAB_F14F: ; $F14F
CLB2,LAB_FEclear the timer 2 interrupt enable bit
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
LDM#$57,LAB_DEset prescaller 2
sets (1/(87+1)) * (1/16) Hz
this will be 5236 Hz with a 7.3728MHz XTAL
LDA#$BF.
STALAB_DFset timer 2 to 36 and 2/3ms
STALAB_FBset the BAUD rate generator
sets (1/8) * (1/(191+1)) * (1/16) baud
this will be 300 BAUD with a 7.3728MHz XTAL
LDA#$00clear A
STALAB_E5write to the UART Rx buffer register
clear the error bits
STALAB_03clear the ?? buffer write index
STALAB_04clear the ?? buffer read index
STALAB_05clear the Tx buffer write index
STALAB_06clear the Tx buffer read index
RTS
************************************************************************************
disable the UART and set timer 2 to 10ms ??
LAB_F16A: ; $F16A
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_43clear the pulse count
LDM#$FF,LAB_42clear the digit to dial
RTS
************************************************************************************
test the RAM ??
LAB_F17C: ; $F17C
LDY#$00clear the index
STYLAB_10clear the RAM test pointer low byte
STYLAB_11clear 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_10),Ysave the $AA to $0xxxx
SEB4,LAB_F6set b4 port 0 data register, set RAM A16
LSRAmake $AA into $55
STA(LAB_10),Ysave the $55 to $1xxxx
CLB4,LAB_F6clear b4 port 0 data register, clear RAM A16
LDA(LAB_10),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_F1A1if $AA was 160K so go use it
DEXdecrement the size to 64K
CMP#$55compare the read byte with $55
BEQLAB_F1A1if $55 was 64K so go use it
DEXelse decrement the size to 32K
LAB_F1A1: ; $F1A1
STXLAB_00save the RAM size
TXAcopy it
ASLA* 2
TAXback to the index
LDALAB_F1BC,Xget the RAM end low byte
STALAB_01save the RAM end low byte
SECset carry for subtract
SBCLAB_F1C5subtract the ?? start low byte
STALAB_65save the ?? size low byte
LDALAB_F1BC+1,Xget the RAM end high byte
STALAB_02save the RAM end high byte
SBCLAB_F1C5+1subtract the ?? start high byte
STALAB_66save the ?? size high byte
RTS
************************************************************************************
RAM end
LAB_F1BC: ; $F1BC
.WORD$0200.
.WORD$0280.
.WORD$0400.
************************************************************************************
RAM size values
LAB_F1C2: ; $F1C2
.BYTE$2032K
.BYTE$4064K
.BYTE$A0160K
************************************************************************************
?? start address
LAB_F1C5: ; $F1C5
.BYTE$01.
.BYTE$86.
************************************************************************************
display the RAM size
LAB_F1C7: ; $F1C7
LDXLAB_00get the RAM size, $00, $01 or $02
LDALAB_F1C2,Xget the numeric size
JSRLAB_F368output A as a three digit decimal value
LDA#'K'set "K" character
JSRLAB_F3FFput an even parity byte in the Tx buffer
RTS
************************************************************************************
get a decimal value, result in AX ??
LAB_F1D5: ; $F1D5
LDM#$00,LAB_0Dclear the result low byte
LDM#$00,LAB_0Eclear the result mid byte
LDM#$00,LAB_0Fclear the result high byte
LDY#$06set the digit counter
JSRLAB_F257get a non space character from the Rx buffer
BRALAB_F1E8branch into the loop
LAB_F1E5: ; $F1E5
JSRLAB_F243get a character from the Rx buffer
LAB_F1E8: ; $F1E8
JSRLAB_F233test the character in A, return Cb=0 if it is "0" to "9"
BCSLAB_F22Bif not "0" to "9" go return the result
DEYdecrement the digit counter
BMILAB_F22Bif more than 6 digits go return the result
SECset carry for subtract
SBC#'0'convert "0" to "9" to 0 to 9
PHAsave the digit
LDALAB_0Fget the result high byte
PHAsave it
LDALAB_0Eget the result mid byte
PHAsave it
LDALAB_0Dget the result low byte
ASLLAB_0D* 2 result low byte
ROLLAB_0E* 2 result mid byte
ROLLAB_0F* 2 result high byte
ASLLAB_0D* 4 result low byte
ROLLAB_0E* 4 result mid byte
ROLLAB_0F* 4 result high byte
ADCLAB_0D* 5 result low byte
STALAB_0Dsave the result low byte
PLApull the result mid byte
ADCLAB_0E* 5 result mid byte
STALAB_0Esave the result mid byte
PLApull the result high byte
ADCLAB_0F* 5 result high byte
STALAB_0Fsave the result high byte
ASLLAB_0D* 10 result low byte
ROLLAB_0E* 10 result mid byte
ROLLAB_0F* 10 result high byte
PLApull the digit
ADCLAB_0Dadd the result low byte
STALAB_0Dsave the result low byte
BCCLAB_F1E5if no carry go get the next digit
INCLAB_0Eelse increment the result mid byte
BNELAB_F1E5if no overflow go get the next digit
INCLAB_0Felse increment the result high byte
BRALAB_F1E5go get the next digit
LAB_F22B: ; $F22B
TAYcopy the last character
LDALAB_0Dget the result low byte
LDXLAB_0Eget the result mid byte
INYset the flags ..
DEY.. on the last character
RTS
************************************************************************************
test the character in A, return Cb=0 if it is "0" to "9"
LAB_F233: ; $F233
CMP#'0'compare the character with "0"
BCCLAB_F23Aif < "0" go set the carry and return
CMP#'9'+1compare the character with "9"+1
RTS
LAB_F23A: ; $F23A
SECflag not in range
RTS
************************************************************************************
test the character in A, return Cb=0 if it is "A" to "Z"
LAB_F23C: ; $F23C
CMP#'A'compare the character with "A"
BCCLAB_F23Aif < "A" go set the carry and return
CMP#'Z'+1compare the character with "Z"+1
RTS
************************************************************************************
get a character from the Rx buffer
LAB_F243: ; $F243
PHAmake room on the stack for the character
TXAcopy X
PHAsave X
LDXLAB_0Cget the Rx buffer read index
LDALAB_0406,Xget a character from the Rx buffer
INCLAB_0Cincrement the Rx buffer read index
TSXcopy the stack pointer
INXincrement the stack index ..
INX.. to where the room was made
STALAB_0100,Xsave the character to the stack
PLApull X
TAXrestore X
PLApull the character
RTS
************************************************************************************
get a non space character from the Rx buffer
LAB_F257: ; $F257
JSRLAB_F243get a character from the Rx buffer
CMP#' 'compare it with [SPACE]
BEQLAB_F257if it was [SPACE] got get another character
AND#$FFset the flags on the character
RTS
************************************************************************************
get a non space character from the Rx buffer without increment
LAB_F261: ; $F261
JSRLAB_F257get a non space character from the Rx buffer
DECLAB_0Cdecrement the Rx buffer read index
AND#$FFset the flags on the character
RTS
************************************************************************************
wait -AX seconds for input
return Cb = 1 if timed out
LAB_F269: ; $F269
STALAB_40save the seconds count low byte
STXLAB_41save the seconds count high byte
LDX#$00clear X
STXLAB_0Cclear the Rx buffer read index
LDA#'>'set the prompt character
BRALAB_F29Bgo enter the loop at the output the prompt point
LAB_F275: ; $F275
JSRLAB_F2C0wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
BCSLAB_F2B5if no carrier or ring just exit
BVSLAB_F2B6if second timeout go increment the seconds count
CLB7,Amask 0xxx xxxx, 7 bit ASCII
CMP#$0Dcompare the character with [CR]
BEQLAB_F2ADif [CR] go return the line
CMP#$7Fcompare the character with [RUB OUT] ??
BEQLAB_F2A0if [RUB OUT] ?? go delete the last character
CMP#$08compare the character with [BACKSPACE]
BEQLAB_F2A0if [BACKSPACE] go delete the last character
CMP#$20compare the character with [SPACE]
BCCLAB_F2B6if less than [SPACE] go decrement the counter
CPX#$4Fcompare the index with max + 1
BCSLAB_F2B6if > max go decrement the counter
STALAB_0406,Xsave a character to the Rx buffer
INXincrement the Rx buffer index
TSTLAB_08test the signed on flag
BNELAB_F29Bif signed on skip the character replace
LDA#'-'else replace the character with a "-" character
this hides the password during sign on
LAB_F29B: ; $F29B
JSRLAB_F3FFput an even parity byte in the Tx buffer
BRALAB_F275loop for the input
delete the last character
LAB_F2A0: ; $F2A0
TXAcopy the buffer index to A
BEQLAB_F275if already at the start just loop
DEXdecrement the buffer index
JSRLAB_F316output the following null terminated string
.BYTE$08,' ',$08,$00"[BACKSPACE][SPACE][BACKSPACE]", overwrite character
BRALAB_F275loop for the input
LAB_F2AD: ; $F2AD
LDA#$00clear A
STALAB_0406,Xclear the next character in the Rx buffer
STALAB_0Aclear the system flags byte
CLCflag ok
LAB_F2B5: ; $F2B5
RTS
LAB_F2B6: ; $F2B6
INCLAB_40increment the seconds count low byte
BNELAB_F275if no rollover loop for another character
INCLAB_41else increment the seconds count high byte
BNELAB_F275if no rollover loop for another character
SECflag error
RTS
************************************************************************************
wait for a character from ??
return Cb = 1 if no carrier or ring
return Vb = 1 if 1 second counted
LAB_F2C0: ; $F2C0
PHAmake room on the stack for the character
TXAcopy X
PHAsave X
LDM#$08,LAB_3Fset the 1/8th second countdown byte
LDXLAB_04get the ?? buffer read index
BRALAB_F2D8branch into the loop
LAB_F2CA: ; $F2CA
BBS4,LAB_F0,LAB_F2EDtest b4 port 2 data register, carrier detect
if no carrier detected do error return
BBS7,LAB_F0,LAB_F2EDtest b7 port 2 data register, ring detect
if ring detected go do error return
TSTLAB_3Ftest the 1/8th second countdown byte
BEQLAB_F2EFif 1 second counted out go do null return
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
LAB_F2D8: ; $F2D8
CPXLAB_03compare it with the ?? buffer write index
BEQLAB_F2CAif the buffer is empty just loop
LDALAB_0300,Xget a character from the ?? buffer
INCLAB_04increment the ?? buffer read index
CLCflag carrier
CLVflag no timeout
TSXcopy the stack pointer
INXincrement the stack index ..
INX.. to where the room was made
STALAB_0100,Xsave the character to the stack
PLApull X
TAXrestore X
PLApull the character
RTS
LAB_F2ED: ; $F2ED
SECflag error
.BYTE$24makes next line BIT $xx
LAB_F2EF: ; $F2EF
CLCflag ok
BITLAB_F2F8set Vb
PLApull X
TAXrestore X
PLApull the character
LDA#$00clear the character
LAB_F2F8: ; $F2F8
RTS
************************************************************************************
check for no carrier, ring or break
LAB_F2F9: ; $F2F9
BBS4,LAB_F0,LAB_F314test b4 port 2 data register, carrier detect
if no carrier detected go flag no carrier
BBS7,LAB_F0,LAB_F314test b7 port 2 data register, ring detect
if ring detected go flag ring
CLCflag no break
BBC7,LAB_0A,LAB_F315if not break just exit
PHAsave A
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'break',$00
LDALAB_04get the ?? buffer read index
STALAB_03save the ?? buffer write index
clear the buffer
PLArestore A
LAB_F314: ; $F314
SECno carrier, ring or break
LAB_F315: ; $F315
RTS
************************************************************************************
output the following null terminated string
LAB_F316: ; $F316
PLApull the return address low byte
STALAB_0Dsave the string pointer low byte
PLApull the return address high byte
STALAB_0Esave the string pointer high byte
TXAcopy X
PHAsave X
LDX#$00clear the index
LAB_F320: ; $F320
INCLAB_0Dincrement the string pointer low byte
BNELAB_F326if no rollover skip the high byte increment
INCLAB_0Eelse increment the string pointer high byte
LAB_F326: ; $F326
LDA(LAB_0D,X)get a string character
BEQLAB_F32Fif null go exit the routine
JSRLAB_F3FFput an even parity byte in the Tx buffer
BRALAB_F320loop for the next character
LAB_F32F: ; $F32F
PLApull X
TAXrestore X
LDALAB_0Eget the string pointer high byte
PHApush the return address high byte
LDALAB_0Dget the string pointer low byte
PHApush the return address low byte
RTS
************************************************************************************
output AXY as a decimal value
LAB_F338: ; $F338
LDM#$06,LAB_5Bset a seven digit number, actually six digits
LDM#$00,LAB_5Cset no minimum length
LDM#$FF,LAB_5Dset no decimal point
STYLAB_0Fsave the high byte
BRALAB_F376output AX[LAB_0F] as a decimal value
************************************************************************************
output AX as a decimal value of four characters
LAB_F345: ; $F345
LDM#$00,LAB_5Bset a single digit number
LDM#$04,LAB_5Cset a minimum length of four characters
LDM#$FF,LAB_5Dset no decimal point
BRALAB_F373output AX as a decimal value
************************************************************************************
output A as a two digit decimal value
LAB_F350: ; $F350
LDX#$00clear the AX value high byte
LDM#$01,LAB_5Bset a two digit number
LDM#$02,LAB_5Cset a minimum length of two characters
LDM#$FF,LAB_5Dset no decimal point
BRALAB_F373output AX as a decimal value
************************************************************************************
output AX as a xx.xx digit decimal value
LAB_F35D: ; $F35D
LDM#$03,LAB_5Bset a four digit number
LDM#$00,LAB_5Cset no minimum length
LDM#$02,LAB_5Dset the decimal point position
BRALAB_F373output AX as a decimal value
************************************************************************************
output A as a three digit decimal value
LAB_F368: ; $F368
LDX#$00clear the value middle byte
************************************************************************************
output AX as a three digit decimal value
LAB_F36A: ; $F36A
LDM#$02,LAB_5Bset a three digit number
LDM#$00,LAB_5Cset no minimum length
LDM#$FF,LAB_5Dset no decimal point
************************************************************************************
output AX as a decimal value
LAB_F373: ; $F373
LDM#$00,LAB_0Fclear the value high byte
************************************************************************************
output AX[LAB_0F] as a decimal value
LAB_5B holds the minimum number of numeric digits
LAB_5C holds the minimum length of the output
LAB_5D holds the decimal point position
LAB_F376: ; $F376
STALAB_0Dsave the value low byte
STXLAB_0Esave the value middle byte
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
LDX#$05set the power of 10 index
LAB_F381: ; $F381
LDA#$00clear A
STALAB_18,Xclear this power of 10
SECset carry for the initial subtract
LAB_F386: ; $F386
LDALAB_0Dget the value low byte
SBCLAB_F3D8,Xsubtract the power of 10 low byte
TAYcopy the result low byte
LDALAB_0Eget the value middle byte
SBCLAB_F3DE,Xsubtract the power of 10 middle byte
PHAsave the result middle byte
LDALAB_0Fget the value high byte
SBCLAB_F3E4,Xsubtract the power of 10 high byte
BCCLAB_F3A4if the result underflowed go do the next power of 10
STALAB_0Fsave the value high byte
PLApull the result middle byte
STALAB_0Esave the value middle byte
STYLAB_0Dsave the value low byte
INCLAB_18,Xincrement this power of 10
BRALAB_F386go try again
LAB_F3A4: ; $F3A4
PLApull the result middle byte
DEXdecrement the power of 10 index
BPLLAB_F381loop if more to do
the number is converted to decimal nibbles at LAB_18 on
LDX#$05set the digit index to the first digit
LAB_F3AA: ; $F3AA
LDALAB_18,Xget a digit
BNELAB_F3C0if it's not zero go output it
CPXLAB_5Bcompare the index with the forced digits index
BCCLAB_F3C0if the index < forced digits index go output it
CPXLAB_5Ccompare the index with the total digits index
BCSLAB_F3B9if the index >= total digits index go do next digit
JSRLAB_F3F0else ?? output [SPACE]
LAB_F3B9: ; $F3B9
DEXdecrement the digit index
BPLLAB_F3AAloop if more to do
BMILAB_F3D1go exit the routine
LAB_F3BE: ; $F3BE
LDALAB_18,Xget a digit
LAB_F3C0: ; $F3C0
ORA#'0'convert the nibble to ASCII
JSRLAB_F3FFput an even parity byte in the Tx buffer
CPXLAB_5Dcompare X with the decimal point position
BNELAB_F3CEif not equal skip the decimal point output
LDA#'.'set "." character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LAB_F3CE: ; $F3CE
DEXdecrement the digit index
BPLLAB_F3BEloop if more to do
LAB_F3D1: ; $F3D1
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
CLCflag ok
RTS
************************************************************************************
powers of 10 low, middle and high bytes
LAB_F3D8: ; $F3D8
.BYTE$011 low byte
.BYTE$0A10 low byte
.BYTE$64100 low byte
.BYTE$E81000 low byte
.BYTE$1010000 low byte
.BYTE$A0100000 low byte
LAB_F3DE: ; $F3DE
.BYTE$001 middle byte
.BYTE$0010 middle byte
.BYTE$00100 middle byte
.BYTE$031000 middle byte
.BYTE$2710000 middle byte
.BYTE$86100000 middle byte
LAB_F3E4: ; $F3E4
.BYTE$001 high byte
.BYTE$0010 high byte
.BYTE$00100 high byte
.BYTE$001000 high byte
.BYTE$0010000 high byte
.BYTE$01100000 high byte
************************************************************************************
put [SPACE][SPACE][SPACE] in the Tx buffer
LAB_F3EA: ; $F3EA
JSRLAB_F3F0put [SPACE] in the Tx buffer
JSRLAB_F3F0put [SPACE] in the Tx buffer
************************************************************************************
put [SPACE] in the Tx buffer
LAB_F3F0: ; $F3F0
LDA#' 'set [SPACE] character
BRALAB_F3FFput an even parity byte in the Tx buffer
************************************************************************************
put ":" in the Tx buffer
LAB_F3F4: ; $F3F4
LDA#':'set ":" character
BRALAB_F3FFput an even parity byte in the Tx buffer
************************************************************************************
put [CR][LF] in the Tx buffer
LAB_F3F8: ; $F3F8
LDA#$0Dset [CR] character
JSRLAB_F3FFput an even parity byte in the Tx buffer
LDA#$0Aset [LF] character
************************************************************************************
put an even parity byte in the Tx buffer
LAB_F3FF: ; $F3FF
ASLAshift and clear b0
PHAsave the shifted byte
CLCclear carry for even parity
LAB_F402: ; $F402
BCCLAB_F406skip bit change if carry clear
EOR#$80else toggle the high bit
LAB_F406: ; $F406
ASLAshift b7 to carry
BNELAB_F402loop if more bits to do
PLArestore the shifted byte
RORAshift the even carry into b7
************************************************************************************
put a byte in the Tx buffer
LAB_F40B: ; $F40B
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
LDXLAB_05get the Tx buffer write index
INXincrement it
CPX#$06compare it with max + 1
BCCLAB_F427if less go use it
LDX#$00else wrap it to zero
BRALAB_F427go use it
LAB_F41B: ; $F41B
SEB2,LAB_FEset the timer 2 interrupt enable bit
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
BBS4,LAB_F0,LAB_F43Dtest b4 port 2 data register, carrier detect
if no carrier detected just exit
BBS7,LAB_F0,LAB_F43Dtest b7 port 2 data register, ring detect
if ring detected go ??
LAB_F427: ; $F427
CPXLAB_06compare the incremented write index with the read index
BEQLAB_F41Bif the same go wait for a byte to be sent
LDYLAB_05get the Tx buffer write index
STXLAB_05save the updated Tx buffer write index
TSXcopy the stack pointer
LDALAB_0100+3,Xget the saved character
STALAB_0400,Ywrite it to the Tx buffer
BBS2,LAB_FE,LAB_F43Dif timer 2 interrupts enabled continue
CLB3,LAB_FEelse clear the timer 2 interrupt request bit
SEB2,LAB_FEand set the timer 2 interrupt enable bit
LAB_F43D: ; $F43D
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTS
************************************************************************************
wait for timer 2 ??
LAB_F443: ; $F443
JSRLAB_FFDCswap the stack pointers
WITstop the internal clock
BBS2,LAB_FE,LAB_F443if the timer 2 interrupts are enabled go wait more
RTS
************************************************************************************
set the default date/time and clear the line seized time
LAB_F44B: ; $F44B
LDX#$06set the count/index
LAB_F44D: ; $F44D
LDALAB_F846,Xget the max + 1 for date and time
STALAB_26,Xsave the max + 1 for date and time
LDALAB_F84D,Xget a default date/time byte
STALAB_79,Xsave a current date/time byte
STALAB_2D,Xsave a signed off date/time byte
DEXdecrement the count/index
BPLLAB_F44Dloop if more to do
LDA#$00clear A
STALAB_82.
STALAB_85.
************************************************************************************
clear the line seized time
LAB_F462: ; $F462
LDA#$80set an impossible time byte
STALAB_AFsave the line seized hours ??
STALAB_B0save the line seized minutes ??
STALAB_B1save the line seized seconds ??
RTS
************************************************************************************
copy the current time to the line seized time
LAB_F46B: ; $F46B
SEIdisable the interrupts
LDALAB_7Ccopy the current hours
STALAB_AFsave the line seized hours ??
LDALAB_7Dcopy the current minutes
STALAB_B0save the line seized minutes ??
LDALAB_7Ecopy the current seconds
STALAB_B1save the line seized seconds ??
CLIenable the interrupts
RTS
************************************************************************************
return Cb = 0 if time - line seized time < 30 seconds ??
LAB_F47A: ; $F47A
LDY#$02set the byte count/index
TSXcopy the stack pointer
SECset carry for subtract
LAB_F47E: ; $F47E
LDALAB_A4,Y.
SBCLAB_AF,Ysubtract the line seized time
BCSLAB_F48Aif time >= line seized time then skip the correct
ADCLAB_29,Yelse add max + 1 for time
CLCclear carry for next subtract
LAB_F48A: ; $F48A
PHAsave the result
DEYdecrement the byte count/index
BPLLAB_F47Eloop if more to do
SEC.
PLApull the hours result
BNELAB_F498.
PLApull the minutes result
BNELAB_F498.
PLApull the seconds result
CMP#$1Ecompare the seconds with 30
LAB_F498: ; $F498
TXSrestore the stack pointer
RTS
************************************************************************************
copy the current date/time to the signed off time
LAB_F49A: ; $F49A
LDX#$06set the count/index
SEIdisable the interrupts
LAB_F49D: ; $F49D
LDALAB_79,Xget a current date/time byte
STALAB_2D,Xsave a signed off date/time byte
DEXdecrement the count/index
BPLLAB_F49Dloop if more to do
CLIenable the interrupts
RTS
************************************************************************************
check the temporary date/time
LAB_F4A6: ; $F4A6
LDX#$06set the count/index
LAB_F4A8: ; $F4A8
LDALAB_34,Xget a temporary date/time byte
CMPLAB_F84D,Xcompare it with a default date/time byte
BCCLAB_F4F4if less go flag an error and exit
CPX#$02compare the date/time index with the month
BNELAB_F4CBif not the months go do the normal compare
LDXLAB_35get the temporary month
CPX#$02compare it with february
BNELAB_F4C2if not february just go do the compare
PHAsave the temporary date/time byte
LDALAB_34get the temporary year
AND#$03effectively do year MOD 4
BNELAB_F4C1if not a leap year skip the leap year adjust
TAXelse clear the index for a leap year february
LAB_F4C1: ; $F4C1
PLArestore the temporary date/time byte
LAB_F4C2: ; $F4C2
CMPLAB_F854,Xcompare it with the max + 1 days in the month
BCSLAB_F4E0if > max go check if it's less than 30
LDX#$02reset the index to the months
BRALAB_F4D0go do the next date/time byte
LAB_F4CB: ; $F4CB
CMPLAB_F846,Xcompare it with the max + 1 for date and time
BCSLAB_F4F4if > max go return an error
LAB_F4D0: ; $F4D0
DEXdecrement the count/index
BPLLAB_F4A8loop if more to do
LDX#$06set the count/index
SEIdisable the interrupts
LAB_F4D6: ; $F4D6
LDALAB_34,Xget a temporary date/time byte
STALAB_79,Xsave a current date/time byte
DEXdecrement the count/index
BPLLAB_F4D6loop if more to do
CLIenable the interrupts
CLCflag ok
RTS
LAB_F4E0: ; $F4E0
CMP#$1Ecompare the number of days with 30
BCSLAB_F4F5if >= 30 just exit
so it must be the 29th of february
JSRLAB_F316output the following null terminated string
.BYTE$0D,$0A,'no chance',$21,$00
LAB_F4F4: ; $F4F4
SECflag error
LAB_F4F5: ; $F4F5
RTS
************************************************************************************
copy the current date/time to the temporary date/time
LAB_F4F6: ; $F4F6
LDX#$06set the count/index
SEIdisable the interrupts
LAB_F4F9: ; $F4F9
LDALAB_79,Xget a current date/time byte
STALAB_34,Xsave a temporary date/time byte
DEXdecrement the count/index
BPLLAB_F4F9loop if more to do
CLIenable the interrupts
RTS
************************************************************************************
copy the current date/time to LAB_9A and LAB_A1 on ??
LAB_F502: ; $F502
LDX#$06set the count/index
SEIdisable the interrupts
LAB_F505: ; $F505
LDALAB_79,Xget a current date/time byte
STALAB_9A,X.
STALAB_A1,X.
DEXdecrement the count/index
BPLLAB_F505loop if more to do
CLIenable the interrupts
RTS
************************************************************************************
copy the current date/time to LAB_9A and LAB_A1 diff to LAB_A8 ??
LAB_F510: ; $F510
LDX#$06set the count/index
SEIdisable the interrupts
SECset carry for subtract
LAB_F514: ; $F514
LDALAB_79,Xget a current date/time byte
STALAB_9A,X.
SBCLAB_A1,X.
BCSLAB_F51Fif no underflow skip the correction
ADCLAB_26,Xelse add the max + 1 for date and time
CLCclear the carry for SBC + 1
LAB_F51F: ; $F51F
STALAB_A8,Xsave the diff time ??
DEXdecrement the count/index
BPLLAB_F514loop if more to do
CLIenable the interrupts
RTS
************************************************************************************
get the temporary YY:MM:DD in AX
LAB_F526: ; $F526
LDALAB_35get the temporary month
ASLAx xxxM MMM.
ASLAx xxMM MM..
ASLAx xMMM M...
ASLAx MMMM ....
ASLAM MMM. ....
ROLLAB_34shift the high bit of the month into the temporary year
ORALAB_36OR with the temporary date, gives MMMD DDDD
LDXLAB_34get the temporary year, gives YYYY YYYM
RTS
************************************************************************************
get the LAB_9A/9B/9C YY:MM:DD in AX
LAB_F534: ; $F534
LDALAB_9Bget the ?? month
ASLA. ...M MMM.
ASLA. ..MM MM..
ASLA. .MMM M...
ASLA. MMMM ....
ASLAM MMM. ....
ROLLAB_9Ashift the high bit of the month into the ?? year
ORALAB_9COR with the ?? date, gives MMMD DDDD
LDXLAB_9Aget the ?? year, gives YYYY YYYM
RTS
************************************************************************************
expand AX into the temporary YY:MM:DD ??
LAB_F542: ; $F542
PHA. MMMD DDDD
AND#$1F. ...D DDDD
STALAB_36save the ?? date
TXA. YYYY YYYM
LSRAM .YYY YYYY
STALAB_34save the ?? year
PLAM MMMD DDDD
RORAD MMMM DDDD
LSRAD .MMM MDDD
LSRAD ..MM MMDD
LSRAD ...M MMMD
LSRAD .... MMMM
STALAB_35save the ?? month
RTS
************************************************************************************
compress LAB_9D/9E/9F into AX and Cb ??
LAB_F554: ; $F554
LDALAB_9E. ..MM MMMM get the ?? minutes
ASLA. .MMM MMM.
ASLA. MMMM MM..
ASLAM MMMM M...
ROLLAB_9D. ..HH HHHM shift the ?? hour
ASLAM MMMM ....
ROLLAB_9D. .HHH HHMM shift the ?? hour
ASLAM MMM. ....
ROLLAB_9D. HHHH HMMM shift the ?? hour
LDXLAB_9D. HHHH HMMM get the ?? hour
LSRLAB_9FS ...S SSSS shift the ?? seconds
ORALAB_9FS MMMS SSSS OR in the seconds
RTS
************************************************************************************
expand AX and Cb into temporary HH:MM:SS
c X A
LAB_F568: ; $F568= ========= =========
PHAsave the minutes i jklm nprs abcd efgh
ROLAshift in seconds b0 a jklm nprs bcde fghi
AND#$3Fmask the seconds ..de fghi
STALAB_39save the temporary seconds
PLArestore the minutes a jklm nprs abcd efgh
STXLAB_37save the temporary hour a jklm nprs abcd efgh
LSRLAB_37shift the temporary hour s .jkl mnpr abcd efgh
RORAshift the temporary minute h .jkl mnpr sabc defg
LSRLAB_37shift the temporary hour r ..jk lmnp sabc defg
RORAshift the temporary minute g ..jk lmnp rsab cdef
LSRLAB_37shift the temporary hour p ...j klmn rsab cdef
RORAshift the temporary minute f ...j klmn prsa bcde
LSRAshift the temporary minute e ...j klmn .prs abcd
LSRAshift the temporary minute d ...j klmn ..pr sabc
STALAB_38save the temporary minute ..pr sabc
RTS
************************************************************************************
display or set the time
LAB_F57F: ; $F57F
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_F599if null just go output the current value
JSRLAB_F59Eget the time in the temporary time, Cb = 1 if error
BCCLAB_F594if no error go check the date/time
RTS
************************************************************************************
display or set the date
LAB_F58A: ; $F58A
JSRLAB_F261get a non space character from the Rx buffer without
increment
BEQLAB_F599if null just go output the current value
JSRLAB_F5C5get the date as DD MMM YYYY
BCSLAB_F59Dif error just exit
LAB_F594: ; $F594
JSRLAB_F4A6check the temporary date/time
BCSLAB_F59Dif error just exit
LAB_F599: ; $F599
JSRLAB_F682output [CR][LF] and the current day/date/time
CLCflag ok
LAB_F59D: ; $F59D
RTS
************************************************************************************
get the time in the temporary time, return Cb = 1 if error
LAB_F59E: ; $F59E
JSRLAB_F4F6copy the current date/time to the temporary date/time
JSRLAB_F1D5get a decimal value, result in AX ??
BEQLAB_F5C3if null following go do error exit
STALAB_37save the returned hour value
TXAcopy the returned hour value high byte
BNELAB_F5C3if not $00 go do error exit
JSRLAB_F1D5get a decimal value, result in AX ??
BEQLAB_F5C3if null following go do error exit
STALAB_38save the returned minute value
TXAcopy the returned minute value high byte
BNELAB_F5C3if not $00 go do error exit
JSRLAB_F1D5get a decimal value, result in AX ??
BNELAB_F5C3if null following go do error exit
STALAB_39save the returned second value
TXAcopy the returned second value high byte
BNELAB_F5C3if not $00 go do error exit
STALAB_3Aclear the returned 1/8th second value
CLCflag ok
RTS
LAB_F5C3: ; $F5C3
SECflag error
RTS
************************************************************************************
get the date as DD MMM YYYY
LAB_F5C5: ; $F5C5
JSRLAB_F4F6copy the current date/time to the temporary date/time
JSRLAB_F1D5get a decimal value, result in AX ??
STALAB_36save the returned date value
TXAcopy the returned date value high byte
BNELAB_F61Aif not $00 go do error exit
TYAcopy the next character
BEQLAB_F618if null go do ok exit
CMP#'-'compare the character with "-"
BEQLAB_F618if "-" go do ok exit
LDA#>LAB_F71Bset the month strings pointer low byte
LDX#<LAB_F71Bset the month strings pointer high byte
STALAB_0Dsave the pointer low byte
STXLAB_0Esave the pointer high byte
LDY#$03set the table index to 'jan'
LDM#$01,LAB_35set january
LAB_F5E4: ; $F5E4
LDXLAB_0Cget the Rx buffer read index
LDA#$03three characters to compare
JSRLAB_F61Ccompare A bytes of the buffer with the table ??
BCCLAB_F5F7if found go return the month
INCLAB_35increment the month
LDALAB_35get the month
CMP#$0Dcompare it with max + 1
BCCLAB_F5E4if not there yet go try next month
BCSLAB_F61Aelse go do error exit, branch always
LAB_F5F7: ; $F5F7
JSRLAB_F243get a character from the Rx buffer
BEQLAB_F618if null go do ok exit
CMP#'-'compare it with "-"
BEQLAB_F618if "-" go do ok exit
CMP#' 'compare it with [SPACE]
BNELAB_F5F7if it was [SPACE] go get another character
JSRLAB_F1D5get a decimal value, result in AX ??
SECset carry for subtract
SBC#>$07BCsubtract 1980 low byte
STALAB_34save the returned year value
TXAcopy the returned year high byte
SBC#<$07BCsubtract 1980 high byte
BNELAB_F61Aif not $00 go do error exit
TYAset the flags on the next returned character
BEQLAB_F618if null go do ok exit
CMP#'-'else compare it with "-"
BNELAB_F61Aif not "-" go do error exit
LAB_F618: ; $F618
CLCflag ok
RTS
LAB_F61A: ; $F61A
SECflag error
RTS
************************************************************************************
compare A bytes of the buffer with the table ??
LAB_F61C: ; $F61C
CLCflag match
LAB_F61D: ; $F61D
PHAsave the byte count
LDA(LAB_0D),Yget a table character
EORLAB_0406,Xcompare it with a character from the Rx buffer
AND#$DFmask xx0x xxxx, make it case insensetive
BEQLAB_F628.
SECflag no match
LAB_F628: ; $F628
INYincrement the table index
INXincrement the buffer index
PLArestore the byte count
DECAdecrement the byte count
BNELAB_F61Dloop if more to do
RTS
************************************************************************************
calculate the day from the date
LAB_F62F: ; $F62F
LDY#$00set the index to the year
LDA(LAB_10),Yget the year
TAXcopy the year
STALAB_16.
LSRA.
LSRA.
BCSLAB_F63E.
BBC0,LAB_16,LAB_F63E.
SEC.
LAB_F63E: ; $F63E
ADCLAB_16.
INCA.
INCA.
STALAB_16.
LDM#$00,LAB_17.
LDY#$01set the index to the month
LDA(LAB_10),Yget the month
TAYcopy the month
LAB_F64C: ; $F64C
DEY.
BEQLAB_F668.
CPY#$02compare the month with februaru
CLCclear carry for no leap day
BNELAB_F65Aif not february go do the add
TXAelse copy the year
AND#$03effectively do year MOD 4
BNELAB_F65Aif not a leap year skip the leap day set
SECelse set a leap day
LAB_F65A: ; $F65A
LDALAB_F854,Yget the max + 1 days in the month
DECAdecrement it
ADCLAB_16.
STALAB_16.
BCCLAB_F64C.
INCLAB_17.
BRALAB_F64C.
LAB_F668: ; $F668
LDY#$02set the index to the day
LDA(LAB_10),Yget the day
DECA.
CLCclear carry for add
ADCLAB_16.
STALAB_16.
BCCLAB_F676.
INCLAB_17.
LAB_F676: ; $F676
LDM#>$0007,LAB_14save the divisor low byte
LDM#<$0007,LAB_15save the divisor high byte
JSRLAB_F0A9divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
LDALAB_12get the remainder, day, low byte
RTS
************************************************************************************
output [CR][LF] and the current day/date/time
LAB_F682: ; $F682
JSRLAB_F3F8put [CR][LF] in the Tx buffer
************************************************************************************
output the current day/date/time
LAB_F685: ; $F685
JSRLAB_F4F6copy the current date/time to the temporary date/time
LDX#>LAB_34set the date pointer low byte
LDY#<LAB_34set the date pointer high byte
BRALAB_F692output day/date/time and return
************************************************************************************
output the signed off day/date/time
LAB_F68E: ; $F68E
LDX#>LAB_2Dset the signed off date/time pointer low byte
LDY#<LAB_2Dset the signed off date/time pointer high byte
output day/date/time
LAB_F692: ; $F692
JSRLAB_F6A1output the day of the week
JSRLAB_F3F0put [SPACE] in the Tx buffer
JSRLAB_F6DAoutput the date as DD MMM YYY
JSRLAB_F3F0put [SPACE] in the Tx buffer
JMPLAB_F742output the time as HH:MM:SS
************************************************************************************
output the day of the week
LAB_F6A1: ; $F6A1
STXLAB_10save the date pointer low byte
STYLAB_11save the date pointer high byte
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
JSRLAB_F62Fcalculate the day from the date
TSXget the stack pointer
PHAsave A
ASLA* 2
ADCLAB_0100,Xadd the saved A, * 3
TXSdump the saved A
TAXcopy the day * 3 to the index
LDY#$03set the day character count
LAB_F6B6: ; $F6B6
LDALAB_F6C5,Xget a day string character
JSRLAB_F3FFput an even parity byte in the Tx buffer
INXincrement the day string character index
DEYdecrement the day character count
BNELAB_F6B6loop if more characters to do
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
RTS
************************************************************************************
day strings
LAB_F6C5: ; $F6C5
.BYTE'Sun'monday
.BYTE'Mon'tuesday
.BYTE'Tue'wednesday
.BYTE'Wed'thursday
.BYTE'Thu'friday
.BYTE'Fri'saturday
.BYTE'Sat'sunday
************************************************************************************
output the date as DD MMM YYY
LAB_F6DA: ; $F6DA
STXLAB_10save the date pointer low byte
STYLAB_11save the date pointer high byte
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
LDY#$02set the index to the date
LDA(LAB_10),Yget the date
JSRLAB_F350output A as a two digit decimal value
JSRLAB_F3F0put [SPACE] in the Tx buffer
LDY#$01set the index to the month
LDA(LAB_10),Yget the month
TSXcopy the stack pointer
PHAsave A
ASLA* 2
ADCLAB_0100,X* 3
TXSrestore the stack pointer
TAXcopy to the index
LDY#$03set the character count
LAB_F6FA: ; $F6FA
LDALAB_F71B,Xget a month string character
JSRLAB_F3FFput an even parity byte in the Tx buffer
INXincrement the read index
DEYdecrement the character count
BNELAB_F6FAloop if more to do
JSRLAB_F3F0put [SPACE] in the Tx buffer
LDY#$00set the index to the year
LDA(LAB_10),Yget the year
LDX#<$07BCset the year high byte
CLCclear carry for add
ADC#>$07BCadd 1980 low byte
BCCLAB_F713if no carry skip the high byte increment
INXelse increment the year high byte
LAB_F713: ; $F713
JSRLAB_F36Aoutput AX as a three digit decimal value
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
RTS
************************************************************************************
month strings
LAB_F71B: ; $F71B
.BYTE'???'unused
.BYTE'Jan'january
.BYTE'Feb'februaru
.BYTE'Mar'march
.BYTE'Apr'april
.BYTE'May'may
.BYTE'Jun'june
.BYTE'Jul'july
.BYTE'Aug'august
.BYTE'Sep'september
.BYTE'Oct'october
.BYTE'Nov'november
.BYTE'Dec'december
************************************************************************************
output the time as HH:MM:SS
LAB_F742: ; $F742
STXLAB_10save the date/time pointer low byte
STYLAB_11save the date/time pointer high byte
TYAcopy Y
PHAsave Y
LDY#$03set the index to hours
LDA(LAB_10),Yget the hours
JSRLAB_F368output A as a three digit decimal value
JSRLAB_F3F4put ":" in the Tx buffer
LDY#$04set the index to minutes
LDA(LAB_10),Yget the minutes
JSRLAB_F368output A as a three digit decimal value
JSRLAB_F3F4put ":" in the Tx buffer
LDY#$05set the index to seconds
LDA(LAB_10),Yget the seconds
JSRLAB_F368output A as a three digit decimal value
PLApull Y
TAYrestore Y
RTS
************************************************************************************
INT2, 1/8th second interrupt
Called every 125ms by Divider IC
LAB_F766: ; $F766
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
CLB3,LAB_FFclear INT2 request bit
TSTLAB_3Ftest the 1/8th second countdown byte
BEQLAB_F773if already zero skip the decrement
DECLAB_3Felse decrement the 1/8th second countdown byte
LAB_F773: ; $F773
BBS0,LAB_FE,LAB_F7A8if the timer 1 interrupt is enabled (ie. already
checking for line activity) then skip the housekeeping
********************* HOUSE KEEPING *************************************************
JSRLAB_F06Aread the A2D channel 0 byte
STALAB_1Fsave the A2D channel 0 byte
SECset carry for subtract
SBCLAB_20
BEQLAB_F78Fif = 0 go ??
BCSLAB_F789if > 0 go ??
else < 0 so ??
EOR#$FFtoggle the byte
INCAmake 2's complement
DECLAB_20.
BRALAB_F78B.
LAB_F789: ; $F789
INCLAB_20.
LAB_F78B: ; $F78B
CMP#$05.
BCSLAB_F7A1.
LAB_F78F: ; $F78F
JSRLAB_F067read the A2D channel 1 byte
STALAB_21save the A2D channel 1 byte
JSRLAB_F990.
BNELAB_F79B.
STYLAB_8D.
LAB_F79B: ; $F79B
EORLAB_8E.
AND#$C0.
BEQLAB_F7A8.
LAB_F7A1: ; $F7A1
CLB1,LAB_FEclear the timer 1 interrupt request bit
SEB0,LAB_FEset the timer 1 interrupt enable bit
LDM#$10,LAB_92.
********************* UPDATE THE CLOCK *************************************************
LAB_F7A8: ; $F7A8
TSTLAB_92.
BEQLAB_F7AE.
DECLAB_92.
LAB_F7AE: ; $F7AE
INCLAB_7Fincrement the 1/8th seconds count
BBC3,LAB_7F,LAB_F7C8if not at a whole second skip the time increment
LDM#$00,LAB_7Felse reset the 1/8th seconds count
TSTLAB_93test the seconds countdown
BEQLAB_F7BCif already at zero skip the decrement
DECLAB_93else decrement the seconds countdown
LAB_F7BC: ; $F7BC
JSRLAB_F7F4increment the ?? time
JSRLAB_F061read the A2D channel 3 byte (Battery)
STALAB_25save the A2D channel 3 byte (Battery)
CLIenable the interrupts
JSRLAB_F7CE.
LAB_F7C8: ; $F7C8
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
??
LAB_F7CE: ; $F7CE
LDX#$00clear the index
LAB_F7D0: ; $F7D0
LDALAB_12,Xread a math area byte
PHAsave it
INXincrement the index
CPX#$06compare it with max + 1
BCCLAB_F7D0loop if more to do
LDALAB_94get the integer part of VThreshold * 2.277
STALAB_16save the multiplier low byte
LDM#$00,LAB_17clear the multiplier low byte
LDALAB_25read the A2D channel 3 byte (Battery)
STALAB_14save the multiplicand low byte
LDM#$00,LAB_15claer the multiplicand high byte
JSRLAB_F07Emult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX
STXLAB_95.
LDX#$06set the count/index
LAB_F7ED: ; $F7ED
PLApull a math area byte
DEXdecrement the count/index
STALAB_12,Xrestore a math area byte
BNELAB_F7EDloop if more to do
RTS
************************************************************************************
increment the ?? time
LAB_F7F4: ; $F7F4
LDXLAB_7Aget the ?? time month
CPX#$02compare it with february
BNELAB_F801if not february skip the leap year adjust
LDALAB_79get the ?? time year
AND#$03effectively do year MOD 4
BNELAB_F801if not a leap year skip the leap year adjust
TAXelse clear the index for a leap year february
LAB_F801: ; $F801
LDALAB_F854,Xget the max + 1 days in the month
STALAB_28save the max + 1 days in the month
LDX#$06set the index to seconds + 1
LAB_F808: ; $F808
DEXdecrement the index
LDALAB_79,Xget a current date/time byte
INCA+ 1
CMPLAB_26,Xcompare it with the max + 1 for date and time
BCCLAB_F813if less skip the default byte get
LDALAB_F84D,Xelse get a default date and time byte
LAB_F813: ; $F813
STALAB_79,Xsave a current date/time byte
BCCLAB_F81Aif byte is < max + 1 exit the loop
TXAelse copy the index
BNELAB_F808if not at years go do another date/time byte
LAB_F81A: ; $F81A
CPX#$03compare the index with hours
BNELAB_F845if it wasn't hours that was updated just exit
DECAdecrement the hours
BEQLAB_F835if the hours were $01 go compare the BST date with the
current date
DECAdecrement the hours
BNELAB_F845if the hours were not $02 just exit
else compare the GMT date with the current date
LDX#$02set the byte count/index
LAB_F826: ; $F826
LDALAB_80,Xget a GMT date byte
EORLAB_79,Xcompare it with a current date byte
BNELAB_F835if not the same go compare the BST date
this branch should go to LAB_F845
DEXdecrement the byte count/index
BPLLAB_F826loop if more to do
DECLAB_7Cdecrement the current hour
LDM#$00,LAB_82clear the GMT days
RTS
LAB_F835: ; $F835
LDX#$02set the byte count/index
LAB_F837: ; $F837
LDALAB_83,Xget a BST date byte
EORLAB_79,Xcompare it with a current date byte
BNELAB_F845if not the same just exit
DEXdecrement the byte count/index
BPLLAB_F837loop if more to do
INCLAB_7Cincrement the current hour
LDM#$00,LAB_85clear the BST days
LAB_F845: ; $F845
RTS
************************************************************************************
max + 1 for date and time
LAB_F846: ; $F846
.BYTE2099-1980+1max year + 1
.BYTE12+1max month + 1
.BYTE0max date is handled separately
.BYTE23+1max hour + 1
.BYTE59+1max minute + 1
.BYTE59+1max second + 1
.BYTE7+1max part second + 1
the interrupt is every 1/8ths of a second
************************************************************************************
default date and time
LAB_F84D: ; $F84D
.BYTE$001980
.BYTE$01january
.BYTE$0101
.BYTE$00,$00,$00,$0000:00:00.00
************************************************************************************
max + 1 days in each month
LAB_F854: ; $F854
.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, check for [CTRL][Q], [CTRL][S] or break
LAB_F861: ; $F861
PHAsave A
TXAcopy X
PHAsave X
BBC1,LAB_FF,LAB_F869if no INT1 request skip the INT1 enable clear
CLB0,LAB_FFclear the INT1 enable bit
LAB_F869: ; $F869
BBC0,LAB_E7,LAB_F892test b0 UART status register
if no Rx interrupt just exit
BBS2,LAB_E7,LAB_F890test b2 UART status register
if parity error just the clear error bits and exit
LDALAB_E5read the UART Rx buffer register
LDXLAB_03get the ?? buffer write index
STALAB_0300,Xsave a character to the ?? buffer
INCLAB_03increment the ?? buffer write index
CLB7,Amask 0xxx xxxx, 7 bit ASCII
CMP#$11compare the character with [CTRL][Q]
BEQLAB_F887if [CTRL][Q] go clear the pause bit
CMP#$13compare the character with [CTRL][S]
BEQLAB_F88Bif [CTRL][S] go set the pause bit
CMPLAB_0Bcompare the character with the break value
BNELAB_F890if not break go clear eny error bits and exit
SEB7,LAB_0Aelse set the break bit
LAB_F887: ; $F887
CLB6,LAB_0Aclear the pause bit
BRALAB_F890go clear eny error bits and exit
LAB_F88B: ; $F88B
BBC5,LAB_0A,LAB_F890.
SEB6,LAB_0Aset the pause bit
LAB_F890: ; $F890
STALAB_E5write to the UART Rx buffer register
clear the error bits
LAB_F892: ; $F892
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
TIMER 1, 2 or 3
LAB_F896: ; $F896
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
BBC0,LAB_FE,LAB_F8DFif timer 1 interrupts not enabled go handle timer 2
BBC1,LAB_FE,LAB_F8DFif timer 1 interrupt request clear go handle timer 2
************************ handle timer 1 ******************************************
Check for line activity
CLB1,LAB_FEclear the timer 1 interrupt request bit
JSRLAB_F06Aread the A2D channel 0 byte (Monitored line)
STALAB_1Fsave the A2D channel 0 byte (Monitored line)
SECset carry for subtract
SBCLAB_20Subtract from A, the contents of LAB_20. Result stored in A
BCSLAB_F8B0if >= 0, branch to LAB_F8B0 (If A=0 then line condition not changed presumably)
EOR#$FFElse, toggle the byte
INCAmake 2's complement
LAB_F8B0: ; $F8B0
STALAB_1Esave the absolute line voltage ??
JSRLAB_F067read the A2D channel 1 byte (Monitored line)
STALAB_21save the A2D channel 1 byte (Monitored line)
BBC2,LAB_B9,LAB_F8BDIf Bit 2 of LAB_B9 is 0, branch to....
JSRLAB_FAAFElse
LAB_F8BD: ; $F8BD
BBC3,LAB_B9,LAB_F8C3If Bit 3 of LAB_B9 is 0, branch to....
JSRLAB_FA9FElse, read the MT8870 tone decoder and save any new digit to
the dialed number buffer
LAB_F8C3: ; $F8C3
BBC4,LAB_B9,LAB_F8C9If Bit 4 of LAB_B9 is 0, branch to....
JSRLAB_FA46Else....
LAB_F8C9: ; $F8C9
BBC7,LAB_B9,LAB_F8CFIf Bit 7 of LAB_B9 is 0, branch to....
JSRLAB_F930Else....
LAB_F8CF: ; $F8CF
BBC5,LAB_B9,LAB_F8D5If Bit 5 of LAB_B9 is 0, branch to....
JSRLAB_F9D9Else....
LAB_F8D5: ; $F8D5
BBC6,LAB_B9,LAB_F8DBIf Bit 6 of LAB_B9 is 0, branch to....
JSRLAB_F955Else....
LAB_F8DB: ; $F8DB
LDALAB_1Fget the A2D channel 0 byte (Monitored line)
STALAB_20Save the result to LAB_20
************************ handle timer 2 ******************************************
Keyboard scanning
LAB_F8DF: ; $F8DF
BBC2,LAB_FE,LAB_F92Aif timer 2 interrupts not enabled just exit
BBC3,LAB_FE,LAB_F92Aif timer 2 interrupt request not set go just exit
timer 2 timed out
CLB3,LAB_FEclear the timer 2 interrupt request bit
BBC4,LAB_E6,LAB_F907test b4 UART control register, Rx interrupt enable
if Rx interrupt disabled skip the UART handle
BBS6,LAB_0A,LAB_F92Aif the pause bit is set just exit
LDXLAB_06get the Tx buffer read index
CPXLAB_05compare it with the Tx buffer write index
BEQLAB_F903if no bytes waiting go clear the timer 2 interrupt
enable and exit
LDALAB_0400,Xread a Tx buffer byte
STALAB_E4save it to the UART Tx shift register
INXincrement the TX buffer read index
CPX#$06compare it with max + 1
BCCLAB_F8FFif less than max + 1 just use it
LDX#$00else wrap it to zero
LAB_F8FF: ; $F8FF
STXLAB_06save the Tx buffer read index
BRALAB_F92Aand exit
LAB_F903: ; $F903
CLB2,LAB_FEclear the timer 2 interrupt enable bit
BRALAB_F92Aand exit
dial a digit. the digit is in LAB_42 and when the digit is first set the pulse count
in LAB_43 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_F907: ; $F907
LDALAB_43get the pulse count
BEQLAB_F911if zero go check if there is a digit to dial
DECLAB_43else decrement the pulse count
BNELAB_F922if not zero go check for pulse count
DECLAB_42decrement the digit to dial
LAB_F911: ; $F911
LDALAB_42get the digit to dial
BMILAB_F92Aif done just exit
BEQLAB_F91Cif 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_F91C: ; $F91C
LDA#$28set long pulse count
STALAB_43save the pulse count
BRALAB_F92Aand exit
LAB_F922: ; $F922
LDALAB_43get the pulse count
CMP#$04compare it with $04
BNELAB_F92Aif not $04 skip the line seize
SEB3,LAB_F0set b3 port 2 data register, modem select, line seize
LAB_F92A: ; $F92A
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTI
************************************************************************************
Called from Timer 1 routine
LAB_F930: ; $F930
LDALAB_1ELoad the absolute line voltage
LSRA.
LSRA.
LSRA.
CLCclear carry for add
ADCLAB_87.
BCSLAB_F93C.
BVCLAB_F943.
LAB_F93C: ; $F93C
LDM#$18,LAB_92.
SEB3,LAB_8E.
LDA#$FF.
LAB_F943: ; $F943
SECset carry for subtract
SBC#$01.
BCCLAB_F94E.
BVCLAB_F94C.
LDA#$00.
LAB_F94C: ; $F94C
STALAB_87.
LAB_F94E: ; $F94E
TSTLAB_92.
BNELAB_F954.
CLB3,LAB_8E.
LAB_F954: ; $F954
RTS
************************************************************************************
Called from Timer 1 handling routine (LAB_F8D5)
If Bit 6 of LAB_B9 is 1 then do the following....
LAB_F955: ; $F955
LDX#$00clear high byte ??
LDALAB_1Fget the A2D channel 0 byte
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BCSLAB_F962if ch0 >= ch3 skip the 2's complement
DEXtoggle high byte
EOR#$FFtoggle low byte
INCAmake 2's complement
LAB_F962: ; $F962
CMP#$02compare A with $02
BCCLAB_F98FIf A < $02, then just exit
TSTLAB_8Delse, test to see if LAB_8D is zero or not
BEQLAB_F98FIf it is, then
TXAElse....
EORLAB_8D.
EORLAB_8E.
BBC4,A,LAB_F988.
LDALAB_8B.
INCA.
CMP#$1E.
BCCLAB_F98D.
LDALAB_8E.
EOR#$10.
STALAB_8E.
BBC1,A,LAB_F984.
BBS4,A,LAB_F984.
SEB2,LAB_8E.
LAB_F984: ; $F984
LDA#$00.
BRALAB_F98D.
LAB_F988: ; $F988
LDALAB_8B.
BEQLAB_F98Fexit
DECA.
LAB_F98D: ; $F98D
STALAB_8B.
LAB_F98F: ; $F98F
RTS
************************************************************************************
??
LAB_F990: ; $F990
LDALAB_1Fget the A2D channel 0 byte
LDY#$0F.
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BCSLAB_F99Dif ch0 >= ch3 skip the 2's complement
INY.
EOR#$FFtoggle the byte
INCAmake 2's complement
LAB_F99D: ; $F99D
BBC0,LAB_72,LAB_F9B2.
LSRAdo (ch0-ch3)/2
TSXcopy the stack pointer
PHApush (ch0-ch3)/2
LDALAB_21get the A2D channel 1 byte
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BCSLAB_F9ADif ch1 >= ch3 skip the 2's complement
EOR#$FFtoggle the byte
INCAmake 2's complement
LAB_F9AD: ; $F9AD
CLCclear carry for add
ADCLAB_0100,Xdo (ch1-ch3) + (ch0-ch3)/2
TXSrestore the stack pointer
LAB_F9B2: ; $F9B2
CMPLAB_95.
BCSLAB_F9D6.
BBS0,LAB_73,LAB_F9C1.
BBC1,LAB_73,LAB_F9D0.
BBC2,LAB_8E,LAB_F9D0.
BRALAB_F9D3.
LAB_F9C1: ; $F9C1
LDALAB_21get the A2D channel 1 byte
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BCSLAB_F9CBif ch1 >= ch3 skip the 2's complement
EOR#$FFtoggle the byte
INCAmake 2's complement
LAB_F9CB: ; $F9CB
ASLAdo (ch1-ch3)*2
CMPLAB_95.
BCCLAB_F9D3.
LAB_F9D0: ; $F9D0
LDA#$80.
RTS
LAB_F9D3: ; $F9D3
LDA#$40.
RTS
LAB_F9D6: ; $F9D6
LDA#$00.
RTS
************************************************************************************
Called from LAB_F8CF, part of Timer 1 handling routine.
If Bit 5 of LAB_B9 is 1 then do the following...
LAB_F9D9: ; $F9D9
JSRLAB_F990Loads A with either $00, $40 or $80
TAXTransfer the returned value into X
BBC0,LAB_8E,LAB_F9E4.
EORLAB_8F.
BRALAB_F9E6.
LAB_F9E4: ; $F9E4
EORLAB_8E.
LAB_F9E6: ; $F9E6
AND#$C0.
BEQLAB_FA2D.
TXATransfer the value in X stored earlier back to A
BEQLAB_FA00If value is $00 then...
BPLLAB_FA1CElse...
INCLAB_88.
LDALAB_88.
CMP#$18.
BCCLAB_FA35.
BBS0,LAB_8E,LAB_FA16.
SEB7,LAB_8E.
CLB6,LAB_8E.
BRALAB_FA2D.
LAB_FA00: ; $FA00
INCLAB_89.
LDALAB_89.
CMP#$18.
BCCLAB_FA35.
CLB1,LAB_8E.
CLB2,LAB_8E.
BBC0,LAB_8E,LAB_FA18.
CLB7,LAB_8F.
LDM#$3C,LAB_90.
BRALAB_FA2D.
LAB_FA16: ; $FA16
SEB7,LAB_8F.
LAB_FA18: ; $FA18
CLB6,LAB_8E.
BRALAB_FA28.
LAB_FA1C: ; $FA1C
INCLAB_8A.
LDALAB_8A.
CMP#$C8.
BCCLAB_FA35.
CLB0,LAB_8E.
SEB6,LAB_8E.
LAB_FA28: ; $FA28
CLB7,LAB_8E.
LDM#$00,LAB_90.
LAB_FA2D: ; $FA2D
LDA#$00clear A
STALAB_88.
STALAB_89.
STALAB_8A.
LAB_FA35: ; $FA35
TSTLAB_90.
BEQLAB_FA45.
DECLAB_90.
BNELAB_FA45.
************************************************************************************
??
LAB_FA3D: ; $FA3D
LDALAB_8E.
AND#$7E.
ORALAB_8F.
STALAB_8E.
LAB_FA45: ; $FA45
RTS
************************************************************************************
??
LAB_FA46: ; $FA46
LDALAB_1Fget the A2D channel 0 byte
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BCSLAB_FA50.
EOR#$FFtoggle the byte
INCAmake 2's complement
LAB_FA50: ; $FA50
CMPLAB_95.
LDALAB_96.
BCSLAB_FA8E.
BEQLAB_FA5C.
DECA.
STALAB_96.
RTS
LAB_FA5C: ; $FA5C
BBC7,LAB_98,LAB_FA6B.
CLB7,LAB_98.
TSTLAB_97.
BEQLAB_FA67.
INCLAB_99.
LAB_FA67: ; $FA67
LDM#$14,LAB_97.
RTS
LAB_FA6B: ; $FA6B
TSTLAB_97.
BEQLAB_FA8D.
DECLAB_97.
BNELAB_FA8D.
LDALAB_99.
LDM#$00,LAB_99.
CMP#$0B.
BCCLAB_FA7E.
LDA#$0B.
save the digit to the dialed number buffer
LAB_FA7E: ; $FA7E
LDXLAB_91get the dialed number buffer index
CPX#$1Fcompare it with the max + 1
BCSLAB_FA8Dif > max go return the error
STALAB_0559,Xsave the dialed number digit
INCLAB_91increment the dialed number buffer index
LDALAB_70get the TDial value
STALAB_93save the seconds countdown
LAB_FA8D: ; $FA8D
RTS
LAB_FA8E: ; $FA8E
INCA.
CMPLAB_6Fcompare it with the TPulse value
BCSLAB_FA96.
STALAB_96.
RTS
LAB_FA96: ; $FA96
BBS7,LAB_98,LAB_FA9E.
SEB7,LAB_98.
LDM#$14,LAB_97.
LAB_FA9E: ; $FA9E
RTS
************************************************************************************
read the MT8870 tone decoder and save any new digit to the dialed number buffer
LAB_FA9F: ; $FA9F
LDALAB_F3read the port 1 data register
TAXcopy it
EORLAB_8Ccompare it with the port 1 last read value
BBC4,A,LAB_FA9Eif b4 hasn't changed just exit
TXAget the port 1 value back
STALAB_8Csave it as the port 1 last read value
BBC4,A,LAB_FA9Eif b4 isn't set just exit
AND#$1Felse mask the read value
BRALAB_FA7Eand save the digit to the dialed number buffer
************************************************************************************
Called from Timer 1 Interrupt routine
LAB_FAAF: ; $FAAF
LDALAB_6Cget the pulses value (0=REV, 1=SPM16, 2=SPM, 3=XSPM, 4=M+, 5=M-)
LSRA0 = REV = 0000 0000 -> 0000 0000 = 0
1= SPM16 = 0000 0001 -> 0000 0000 = 0
2= SPM = 0000 0010 -> 0000 0001 = 1
3= XSPM = 0000 0011 -> 0000 0001 = 1
4= M+ = 0000 0100 -> 0000 0010 = 2
5= M- = 0000 0101 -> 0000 0010 = 2
BEQLAB_FA9EIf REV or SPM16 then exit (RTS)
BBS1,A,LAB_FAF1If M+ or M- then branch to LAB_FAF1
BCCLAB_FABEIf SPM, then branch to LAB_FABE
JSRLAB_F064Else it's XSPM. Read the A2D channel 2 byte (Meter wire)
TAXcopy the A2D channel 2 byte (Meter wire)
BRALAB_FAD0
******************* SPM ************************
LAB_FABE: ; $FABE
LDALAB_21get the A2D channel 1 byte
TAXTransfer A2D channel 1 byte into X
SECset carry for subtract
SBCLAB_22
STXLAB_22
BCSLAB_FACC
EOR#$FFtoggle the byte
INCAmake 2's complement
SECset carry for subtract
LAB_FACC: ; $FACC
SBCLAB_1ESubtract the absolute line voltage
BCCLAB_FB27.
******************* XSPM ***********************
LAB_FAD0: ; $FAD0
CPXLAB_24.
BEQLAB_FB27.
BCCLAB_FADA.
STXLAB_24.
BRALAB_FAE0.
LAB_FADA: ; $FADA
CPXLAB_23compare with the A2D channel 2 byte (Meter wire)
BCSLAB_FB27.
STXLAB_23save the A2D channel 2 byte (Meter wire)
LAB_FAE0: ; $FAE0
LDALAB_24.
SECset carry for subtract
SBCLAB_23subtract the A2D channel 2 byte (Meter wire)
CMP#$32.
BCCLAB_FB27.
STXLAB_24.
STXLAB_23save the A2D channel 2 byte (Meter wire)
LDA#$14.
BRALAB_FB08.
******************* M+ or M- ********************
LAB_FAF1: ; $FAF1
JSRLAB_F064read the A2D channel 2 byte (Meter wire)
SECset carry for subtract
SBCLAB_25subtract the A2D channel 3 byte (Battery)
BBS0,LAB_6C,LAB_FB00.
BCSLAB_FB27.
EOR#$FFtoggle the byte
INCAmake 2's complement
SEC.
LAB_FB00: ; $FB00
BCCLAB_FB27.
CMP#$12.
BCCLAB_FB27.
LDA#$08.
LAB_FB08: ; $FB08
CLCclear carry for add
ADCLAB_86.
BCSLAB_FB23.
BVCLAB_FB32.
SEB5,LAB_8E.
LDXLAB_0520get the record metered units low byte
INXincrement the record metered units low byte
BNELAB_FB20if no rollover skip the high byte increment
LDALAB_0521get the record metered units high byte
INCAincrement the record metered units high byte
BBS5,A,LAB_FB23if xx1x xxxx xxxx xxxx skip the metered units save
STALAB_0521save the record metered units high byte
LAB_FB20: ; $FB20
STXLAB_0520save the record metered units low byte
LAB_FB23: ; $FB23
LDA#$FF.
BRALAB_FB32.
LAB_FB27: ; $FB27
LDALAB_86.
SECset carry for subtract
SBC#$04.
BCCLAB_FB34.
BVCLAB_FB32.
LDA#$00.
LAB_FB32: ; $FB32
STALAB_86.
LAB_FB34: ; $FB34
RTS
************************************************************************************
TC, CNTR, BRK, HE or VE
LAB_FB35: ; $FB35
RTI
************************************************************************************
copy the current record pointer to the update point
LAB_FB36: ; $FB36
LDYLAB_4Dget the current record pointer low byte
LDXLAB_4Eget the current record pointer mid byte
LDALAB_4Fget the current record pointer high byte
************************************************************************************
save YXA as the update point
LAB_FB3C: ; $FB3C
STYLAB_4Asave the update pointer low byte
STXLAB_4Bsave the update pointer mid byte
STALAB_4Csave the update pointer high byte
RTS
************************************************************************************
initialise the record pointers and logged values
LAB_FB43: ; $FB43
LDY#$00clear the pointer low byte
LDXLAB_F1C5get the ?? start address mid byte $01
LDALAB_F1C5+1get the ?? start address high byte $86
STYLAB_B3save the record memory start pointer low byte
STXLAB_B4save the record memory start pointer mid byte
STALAB_B5save the record memory start pointer high byte
STYLAB_B6save the record memory end pointer low byte
STXLAB_B7save the record memory end pointer mid byte
STALAB_B8save the record memory end pointer high byte
STYLAB_4Dsave the current record pointer low byte
STXLAB_4Esave the current record pointer mid byte
STALAB_4Fsave the current record pointer high byte
JSRLAB_FB3Csave YXA as the update point
LDA#$00clear A
STALAB_74clear the calls logged low byte
STALAB_75clear the calls logged high byte
STALAB_76clear the meter value low byte
STALAB_77clear the meter value mid byte
STALAB_78clear the meter value high byte
RTS
************************************************************************************
set the default values
LAB_FB6D: ; $FB6D
LDX#$08set the count/index
LAB_FB6F: ; $FB6F
LDALAB_E005,Xget a default byte
STALAB_6B,Xsave a default value
DEXdecrement the count/index
BPLLAB_FB6Floop if more to do
RTS
************************************************************************************
Called/Referenced by RESET routine ??
LAB_FB78: ; $FB78
JSRLAB_FB43initialise the record pointers and logged values
JSRLAB_FB6Dset the default values
JSRLAB_F024save the integer part of VThreshold * 2.277 in LAB_94
LDA#$00clear A
STALAB_90.
STALAB_88.
STALAB_8E.
STALAB_8D.
STALAB_5A.
JSRLAB_FF19set timer 1 to 5ms
LAB_FB90: ; $FB90
JSRLAB_FDD4turn MT8870 off and ??
LDALAB_8E.
AND#$C6.
STALAB_8E.
LDA#$00clear A
STALAB_B9clear LAB_B9
STALAB_91clear the dialed number buffer index
STALAB_8B.
JSRLAB_FDBA.
BBC0,LAB_71,LAB_FBAA.
JSRLAB_FDC3.
LAB_FBAA: ; $FBAA
SEB5,LAB_B9.
LDM#$10,LAB_92.
LAB_FBAF: ; $FBAF
LDALAB_92.
ORALAB_88.
ORALAB_8B.
ORALAB_87.
BNELAB_FBBB.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
LAB_FBBB: ; $FBBB
JSRLAB_FFDCswap the stack pointers
BBS7,LAB_8E,LAB_FBDB.
BBS6,LAB_8E,LAB_FC40.
BBS4,LAB_8E,LAB_FBDE.
BBC3,LAB_8E,LAB_FBAF.
JSRLAB_FD97.
LAB_FBCD: ; $FBCD
JSRLAB_FFDCswap the stack pointers
BBS4,LAB_8E,LAB_FBE4.
BBS7,LAB_8E,LAB_FBF1Incoming Call answered ?
BBC3,LAB_8E,LAB_FC20.
BRALAB_FBCD.
LAB_FBDB: ; $FBDB
JMPLAB_FC68.
LAB_FBDE: ; $FBDE
LDM#$18,LAB_92.
JSRLAB_FD97.
LAB_FBE4: ; $FBE4
JSRLAB_FFDCswap the stack pointers
TSTLAB_92.
BEQLAB_FC37.
BBS4,LAB_8E,LAB_FBE4.
BBC7,LAB_8E,LAB_FC20.
LAB_FBF1: ; $FBF1
JSRLAB_FDC0.
JSRLAB_FDC9.
LDA#$21set the call type to "i/c_ans" ??
STALAB_0517save the record call type
JSRLAB_FE28set the record ans/last time
LDALAB_0516get the record length
AND#$E0mask xxx0 0000, clear the length
ORA#$0Aset the length to $0A
STALAB_0516save the record length
LDM#$08,LAB_92.
JSRLAB_FD9F.
LAB_FC0F: ; $FC0F
JSRLAB_FFDCswap the stack pointers
BBC0,LAB_FE,LAB_FC0Fif timer 1 interrupts not enabled go ??
BBC7,LAB_8E,LAB_FC20.
TSTLAB_92.
BNELAB_FC0F.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_FC0F.
LAB_FC20: ; $FC20
JSRLAB_FE95set the record cleared time
LDALAB_0517get the record call type
CMP#$21compare the call type with "i/c_ans"
BNELAB_FC2F.
JSRLAB_F46Bcopy the current time to the line seized time
BRALAB_FC32.
LAB_FC2F: ; $FC2F
JSRLAB_F462clear the line seized time ??
LAB_FC32: ; $FC32
JSRLAB_FF24copy the buffered record to memory ??
BRALAB_FC3A.
LAB_FC37: ; $FC37
LDM#$00,LAB_8D.
LAB_FC3A: ; $FC3A
JSRLAB_FDA2.
JMPLAB_FB90.
LAB_FC40: ; $FC40
JSRLAB_FDC9.
JSRLAB_FDC0.
LDA#$12set the call type to "parked" ??
JSRLAB_FDF6initialise a new record in the write buffer
JSRLAB_FDA8.
LAB_FC4E: ; $FC4E
JSRLAB_FFDCswap the stack pointers
BBC6,LAB_8E,LAB_FC5C.
TSTLAB_92.
BNELAB_FC4E.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_FC4E.
LAB_FC5C: ; $FC5C
JSRLAB_FE95set the record cleared time
JSRLAB_FDA2.
JSRLAB_FF24copy the buffered record to memory ??
JMPLAB_FB90.
************************************************************************************
Called from LAB_FBDB
LAB_FC68: ; $FC68
JSRLAB_FDC9.
JSRLAB_FDC0.
LDA#$10set the call type to "seized" ??
JSRLAB_FDF6initialise a new record in the write buffer
JSRLAB_FDA5.
LDALAB_70get the TDial value
STALAB_93save the seconds countdown
LDALAB_6Bget the digits value
BNELAB_FC80if not auto go ??
ORA#$03else make it mixed
LAB_FC80: ; $FC80
BBC1,A,LAB_FC85if DTMF not enabled skip turning the MT8870 on
JSRLAB_FDCCturn MT8870 on and ??
LAB_FC85: ; $FC85
BBC0,A,LAB_FC8Aif pulse not enabled skip ??
JSRLAB_FDD9.
LAB_FC8A: ; $FC8A
LDY#$00clear ??
LAB_FC8C: ; $FC8C
JSRLAB_FFDCswap the stack pointers
TSTLAB_93test the seconds countdown
BEQLAB_FCBE.
BBS4,LAB_8E,LAB_FCE4.
BBS5,LAB_8E,LAB_FCE4.
BBC7,LAB_8E,LAB_FCFB.
CPYLAB_91compare ?? with the dialed number buffer index
BEQLAB_FC8C.
TYA.
BNELAB_FCA6.
JSRLAB_FD5B.
LAB_FCA6: ; $FCA6
JSRLAB_FE28set the record ans/last time
JSRLAB_FD92.
INY.
CPY#$03.
BNELAB_FC8C.
LDALAB_0559get the dialed number first digit
CLB4,A.
EOR#$01.
BNELAB_FC8C.
JSRLAB_FDD4turn MT8870 off and ??
BRALAB_FC8C.
LAB_FCBE: ; $FCBE
JSRLAB_FDEFturn off the MT8870 tone decoder
LDALAB_91get the dialed number buffer index
CMP#$02.
BCSLAB_FCD8.
JSRLAB_FDC9.
LAB_FCCA: ; $FCCA
JSRLAB_FFDCswap the stack pointers
BBC7,LAB_8E,LAB_FCFBSub has cleared down ?
TSTLAB_92.
BNELAB_FCCA.
CLB0,LAB_FEclear the timer 1 interrupt enable bit
BRALAB_FCCA.
LAB_FCD8: ; $FCD8
JSRLAB_FFDCswap the stack pointers
BBC7,LAB_8E,LAB_FCFBSub has cleared down
BBS5,LAB_8E,LAB_FCE4.
BBC4,LAB_8E,LAB_FCD8.
LAB_FCE4: ; $FCE4
JSRLAB_FDEFturn of the MT8870 tone decoder
JSRLAB_FDC3.
LDA#$31set the call type to "o/g_ans" ??
STALAB_0517save the record call type
JSRLAB_FE28set the record ans/last time
JSRLAB_FD9F.
LAB_FCF5: ; $FCF5
JSRLAB_FFDCswap the stack pointers
BBS7,LAB_8E,LAB_FCF5.
******* Subscriber has cleared down *****************
LAB_FCFB: ; $FCFB
JSRLAB_FE3Fadd the units to the meter value and set the cleared time
LDALAB_0517get the record call type
CMP#$10compare the call type with "seized"
BNELAB_FD20.
LDALAB_AB.
ORALAB_AC.
BNELAB_FD11.
LDALAB_AD.
CMPLAB_6Ecompare it with the TSeized value
BCCLAB_FD3Aif ?? < TSeized go ??
LAB_FD11: ; $FD11
JSRLAB_F47Areturn Cb = 0 if time - line seized time < 30 seconds ??
BCSLAB_FD37.
LDA#$23set the call type to "i/c_cont" ??
STALAB_0517save the record call type
JSRLAB_F46Bcopy the current time to the line seized time
BRALAB_FD37.
LAB_FD20: ; $FD20
JSRLAB_FEACcopy the dialed number to the record ??
CLCclear carry for add
ADCLAB_0516add the record length
STALAB_0516save the record length
JSRLAB_F462clear the line seized time ??
BBC6,LAB_8E,LAB_FD37.
LDALAB_0517get the record call type
SEB2,Achange the call type from "o/g_" to "o/g*" ??
STALAB_0517save the record call type
LAB_FD37: ; $FD37
JSRLAB_FF24copy the buffered record to memory ??
LAB_FD3A: ; $FD3A
JSRLAB_FDA2.
BBC0,LAB_8E,LAB_FD43.
JSRLAB_FA3D.
LAB_FD43: ; $FD43
BBC4,LAB_8E,LAB_FD58.
LDM#$08,LAB_92.
JSRLAB_FDC3.
LAB_FD4C: ; $FD4C
JSRLAB_FFDCswap the stack pointers
BBC4,LAB_8E,LAB_FD58.
LDALAB_92.
BNELAB_FD4C.
STALAB_8D.
LAB_FD58: ; $FD58
JMPLAB_FB90.
************************************************************************************
??
LAB_FD5B: ; $FD5B
TSTLAB_6Btest the digits value
BNELAB_FD6C.
LDALAB_0559get the dialed number first digit
BBS4,A,LAB_FD69.
JSRLAB_FDD4turn MT8870 off and ??
BRALAB_FD6C.
LAB_FD69: ; $FD69
JSRLAB_FDE6.
LAB_FD6C: ; $FD6C
TSTLAB_6Ctest the pulses value
BEQLAB_FD76.
JSRLAB_FDE9.
BBC1,LAB_73,LAB_FD7B.
LAB_FD76: ; $FD76
JSRLAB_FDC3.
SEB1,LAB_8E.
LAB_FD7B: ; $FD7B
LDA#$30set the call type to "o/g" ??
STALAB_0517save the record call type
LDALAB_0516get the record length
AND#$E0mask xxx0 0000, clear the length
ORA#$0Cset the length to $0C
STALAB_0516save the record length
LDA#$80.
STALAB_8F.
SEB0,LAB_8E.
BRALAB_FDAB.
************************************************************************************
??
LAB_FD92: ; $FD92
LDALAB_0559,Yget a dialed number digit
BRALAB_FDAD.
************************************************************************************
??
LAB_FD97: ; $FD97
LDA#$20set the call type to "i/c" ??
JSRLAB_FDF6initialise a new record in the write buffer
LDA#$80.
.BYTE$2Cmake the next line BIT $xxxx
************************************************************************************
??
LAB_FD9F: ; $FD9F
LDA#$85.
.BYTE$2Cmake the next line BIT $xxxx
************************************************************************************
??
LAB_FDA2: ; $FDA2
LDA#$8B.
.BYTE$2Cmake the next line BIT $xxxx
************************************************************************************
??
LAB_FDA5: ; $FDA5
LDA#$94.
.BYTE$2Cmake the next line BIT $xxxx
************************************************************************************
??
LAB_FDA8: ; $FDA8
LDA#$9B.
.BYTE$2Cmake the next line BIT $xxxx
************************************************************************************
??
LAB_FDAB: ; $FDAB
LDA#$A2.
LAB_FDAD: ; $FDAD
LDXLAB_5A.
STALAB_0578,X.
INX.
CPX#$28.
BCSLAB_FDB9.
STXLAB_5A.
LAB_FDB9: ; $FDB9
RTS
************************************************************************************
??
LAB_FDBA: ; $FDBA
LDM#$00,LAB_87.
SEB7,LAB_B9.
RTS
************************************************************************************
??
LAB_FDC0: ; $FDC0
CLB7,LAB_B9.
RTS
************************************************************************************
??
LAB_FDC3: ; $FDC3
LDM#$00,LAB_8B.
SEB6,LAB_B9.
RTS
************************************************************************************
??
LAB_FDC9: ; $FDC9
CLB6,LAB_B9Meter Pulses = REV ? (1 = Yes, 0 = No) {TJ}
RTS
************************************************************************************
turn MT8870 on and ??
LAB_FDCC: ; $FDCC
CLB5,LAB_F3clear b5 port 1 data register, turn MT8870 on
LDM#$10,LAB_8Cset the port 1 last read value
SEB3,LAB_B9.
RTS
************************************************************************************
turn MT8870 off and ??
LAB_FDD4: ; $FDD4
CLB3,LAB_B9.
SEB5,LAB_F3set b5 port 1 data register, turn MT8870 off
RTS
************************************************************************************
??
LAB_FDD9: ; $FDD9
LDA#$00clear A
STALAB_99.
STALAB_96.
STALAB_98.
STALAB_97.
SEB4,LAB_B9.
RTS
************************************************************************************
??
LAB_FDE6: ; $FDE6
CLB4,LAB_B9.
RTS
************************************************************************************
??
LAB_FDE9: ; $FDE9
LDM#$00,LAB_86.
SEB2,LAB_B9.
RTS
************************************************************************************
Turn off the MT8870 tone decoder
LAB_FDEF: ; $FDEF
CLB3,LAB_B9.
SEB5,LAB_F3set b5 port 1 data register, turn MT8870 off
CLB4,LAB_B9.
RTS
************************************************************************************
initialise a new record in the write buffer
LAB_FDF6: ; $FDF6
STALAB_0517save the record call type
JSRLAB_F502copy the current date/time to LAB_9A and LAB_A1 on ??
JSRLAB_F534get the LAB_9A/9B/9C YY:MM:DD in AX
STALAB_0518save the record year/month/date low byte
STXLAB_0519save the record year/month/date high byte
JSRLAB_F554compress LAB_9D/9E/9F into AX and Cb ??
STALAB_0578save the minutes/seconds
STXLAB_0579save the hours/minutes
LDM#$02,LAB_5A.
STALAB_051Asave the record start minutes and seconds
STXLAB_051Bsave the record start hours and minutes
LDA#$08set the initial record length
BCCLAB_FE1Cif the seconds b0 is clear skip the bit set
SEB7,Aset the record start seconds b0
LAB_FE1C: ; $FE1C
STALAB_0516save the record length
LDA#$00clear A
STALAB_0520clear the record metered units low byte
STALAB_0521clear the record metered units high byte
RTS
************************************************************************************
set the record ans/last time
LAB_FE28: ; $FE28
JSRLAB_F502copy the current date/time to LAB_9A and LAB_A1 on ??
JSRLAB_F554compress LAB_9D/9E/9F into AX and Cb ??
STALAB_051Esave the record ans/last minutes and seconds
STXLAB_051Fsave the record ans/last hours and minutes
LDALAB_0516get the record seconds b0 byte
CLB5,Aclear the record ans/last seconds b0
BCCLAB_FE3Bif the seconds b0 was clear skip the bit set
SEB5,Aset the record ans/last seconds b0
LAB_FE3B: ; $FE3B
STALAB_0516save the record seconds b0 byte
RTS
************************************************************************************
add the units to the meter value and set the cleared time
LAB_FE3F: ; $FE3F
CLCclear carry for add
LDALAB_0520get the record metered units low byte
ADCLAB_76add the meter value low byte
STALAB_76save the meter value low byte
LDALAB_0521get the record metered units high byte
ADCLAB_77add the meter value mid byte
STALAB_77save the meter value mid byte
BCCLAB_FE52if no carry skip the high byte increment
INCLAB_78increment the meter value high byte
LAB_FE52: ; $FE52
SECset carry for subtract
LDALAB_76get the meter value low byte
SBC#$40subtract 1,000,000 low byte
TAYcopy the low byte result
LDALAB_77get the meter value mid byte
SBC#$42subtract 1,000,000 mid byte
TAXcopy the mid byte result
LDALAB_78get the meter value high byte
SBC#$0Fsubtract 1,000,000 high byte
BCCLAB_FE69if the meter value was < 1,000,000 skip the save
STYLAB_76save the meter value low byte
STXLAB_77save the meter value mid byte
STALAB_78save the meter value high byte
LAB_FE69: ; $FE69
JSRLAB_F510copy the current date/time to LAB_9A and LAB_A1 diff
to LAB_A8 ??
LDALAB_0517get the record call type
CMP#$31compare the call type with "o/g_ans"
BNELAB_FE98if not "o/g_ans" just go save the cleared time
LDALAB_AEget the call duration 1/8th seconds
ASLAshift ..
ASLA.. the ..
ASLA.. 1/8th ..
ASLA.. seconds ..
ASLA.. to b7-b5
ORALAB_0521OR with the record metered units high byte
STALAB_0521save the record metered units high byte
LDX#$05set the count/index
CLCclear carry for add
LAB_FE83: ; $FE83
LDALAB_A1,Xget the current time
ADCLAB_A8,Xadd the diff time
CMPLAB_26,Xcompare it with the max + 1 for date and time
BCCLAB_FE8Eif no overflow skip the correct
SBCLAB_26,Xelse subtract the max + 1 for date and time
SECand set the carry for ADC + 1
LAB_FE8E: ; $FE8E
STALAB_9A,Xsave the cleared time
DEXdecrement the count/index
BPLLAB_FE83loop if more to do
BRALAB_FE98go save the cleared time to the record
************************************************************************************
set the record cleared time
LAB_FE95: ; $FE95
JSRLAB_F510copy the current date/time to LAB_9A and LAB_A1 diff
to LAB_A8 ??
LAB_FE98: ; $FE98
JSRLAB_F554compress LAB_9D/9E/9F into AX and Cb
STALAB_051Csave the record cleared minutes and seconds
STXLAB_051Dsave the record cleared hours and minutes
LDALAB_0516get the record seconds b0 byte
CLB6,Aclear the record cleared seconds b0
BCCLAB_FEA8if the seconds b0 was clear skip the bit set
SEB6,Aset the record cleared seconds b0
LAB_FEA8: ; $FEA8
STALAB_0516save the record seconds b0 byte
RTS
************************************************************************************
copy the dialed number to the record ??
LAB_FEAC: ; $FEAC
TSTLAB_91test the dialed number buffer index
BEQLAB_FEC3if no dialed number just exit
LDX#$00clear the number copy index
LDY#$00clear the record digit index
LAB_FEB4: ; $FEB4
JSRLAB_FEF1get a digit from the dialed number buffer and increment
the index
BCSLAB_FEC0if done just exit
BBS4,A,LAB_FEC4.
JSRLAB_FEFAsave a digit to the record and increment the index
BCCLAB_FEB4if the index < max go get another digit
LAB_FEC0: ; $FEC0
TYAcopy the record digit index
INCA+ 1
LSRA/ 2 gives the number length in bytes
LAB_FEC3: ; $FEC3
RTS
the dialed digit had b4 set so ??
LAB_FEC4: ; $FEC4
INYincrement the record digit index ??
INYincrement the record digit index ??
STYLAB_B2save the record digit index ??
LAB_FEC8: ; $FEC8
JSRLAB_FEFAsave a digit to the record and increment the index
BCSLAB_FED5.
JSRLAB_FEF1get a digit from the dialed number buffer and increment
the index
BCSLAB_FED5.
BBS4,A,LAB_FEC8.
DEX.
LAB_FED5: ; $FED5
PHAsave A
TYAcopy Y
PHAsave Y
SECset carry for subtract
SBCLAB_B2subtract the record digit index ??
PHA.
CMP#$10.
LDA#$07.
ROLA.
LDYLAB_B2get the record digit index ??
DEYdecrement the record digit index ??
DEYdecrement the record digit index ??
JSRLAB_FEFAsave a digit to the record and increment the index
PLA.
JSRLAB_FEFAsave a digit to the record and increment the index
PLApull Y
TAYrestore Y
PLArestore A
BRALAB_FEB4go get another digit
************************************************************************************
get a digit from the dialed number buffer and increment the index
LAB_FEF1: ; $FEF1
CPXLAB_91compare the number copy index with the dialed number
buffer length
BCSLAB_FEF9if > length just exit
LDALAB_0559,Xelse get a dialed number digit
INXincrement the number copy index
LAB_FEF9: ; $FEF9
RTS
************************************************************************************
save a digit to the record and increment the index
LAB_FEFA: ; $FEFA
CPY#$26compare the index with the max + 1
BCSLAB_FF18if > 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_FF0Eif 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
BRALAB_FF11go save the high nibble
LAB_FF0E: ; $FF0E
ORALAB_0522,YOR with the high nibble
LAB_FF11: ; $FF11
STALAB_0522,Ysave the nibbles
TYAcopy the shifted index
ROLA* 2, shift b0 back in, also clear Cb
TAYrestore the index
INYincrement the digit index
LAB_FF18: ; $FF18
RTS
************************************************************************************
set timer 1 to 5ms
LAB_FF19: ; $FF19
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
************************************************************************************
copy the buffered record to memory ??
LAB_FF24: ; $FF24
LDALAB_0516get the record length
AND#$1Fmask 000x xxxx, the record length
STALAB_B2save the buffered record length
LDYLAB_B3get the record memory start pointer low byte
LDXLAB_B4get the record memory start pointer mid byte
LDALAB_B5get the record memory start pointer high byte
LAB_FF31: ; $FF31
JSRLAB_FFB8check if room in memory for a new record ??
BCCLAB_FF47if room go copy the record to memory
LDYLAB_B3get the record memory start pointer low byte
LDXLAB_B4get the record memory start pointer mid byte
LDALAB_B5get the record memory start pointer high byte
JSRLAB_FF7Cincrement, check and rollover the YXA word ??
STYLAB_B3save the record memory start pointer low byte
STXLAB_B4save the record memory start pointer mid byte
STALAB_B5save the record memory start pointer high byte
BRALAB_FF31.
LAB_FF47: ; $FF47
LDA#$00clear the record buffer index
PHAsave the record buffer index
LDYLAB_B6get the record memory end pointer low byte
LDXLAB_B7get the record memory end pointer mid byte
LDALAB_B8get the record memory end pointer high byte
BRALAB_FF6Abranch into the copy loop
LAB_FF52: ; $FF52
LDALAB_0516,Xget a byte from the record buffer
STA(LAB_63),Ysave it to the record in memory
INXincrement the record buffer index
INYincrement the record memory index
STYLAB_B6save the record memory end pointer low byte
BNELAB_FF6Fif no rollover skip the record pointer rollover
TXAcopy the record buffer index
PHAsave the record buffer index
LDXLAB_B7get the record memory end pointer mid byte
LDALAB_B8get the record memory end pointer high byte
JSRLAB_FF90increment, check and rollover the XA word ??
STXLAB_B7save the record memory end pointer mid byte
STALAB_B8save the record memory end pointer high byte
LAB_FF6A: ; $FF6A
JSRLAB_FFA3set bank and LAB_63/64 pointer from A ??
PLApull the record buffer index
TAXrestore the record buffer index
LAB_FF6F: ; $FF6F
CPXLAB_B2compare the record buffer index with the buffered record
length
BCCLAB_FF52loop if more record bytes to copy
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
INCLAB_74increment the calls logged low byte
BNELAB_FF7Bif no rollover skip the high byte increment
INCLAB_75increment the calls logged high byte
LAB_FF7B: ; $FF7B
RTS
************************************************************************************
increment, check and rollover the YXA word ??
LAB_FF7C: ; $FF7C
PHAsave the XA word high byte
JSRLAB_FFA3set bank and LAB_63/64 pointer from A ??
LDA(LAB_63),Yget the record length
CLB5,LAB_F5clear b5 port 0 function register, port 0 b5 = b5
AND#$1F.
STALAB_64save the record RAM pointer high byte
TYA.
CLCclear carry for add
ADCLAB_64add the record RAM pointer high byte
TAY.
PLArestore the XA word high byte
BCCLAB_FFA2.
************************************************************************************
increment, check and rollover the XA word ??
LAB_FF90: ; $FF90
INXincrement the word low byte
BNELAB_FF94if no rollover skip the high byte increment
INCAelse increment the high byte
LAB_FF94: ; $FF94
CMPLAB_02compare ?? with the RAM end high byte
BNELAB_FFA2.
CPXLAB_01compare ?? with the RAM end low byte
BNELAB_FFA2.
LDXLAB_F1C5get the RAM start address low byte
LDALAB_F1C5+1get the RAM start address high byte
LAB_FFA2: ; $FFA2
RTS
************************************************************************************
set bank and LAB_63/64 pointer from A ??
LAB_FFA3: ; $FFA3
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_FFAB.
SEB4,LAB_F6set b4 port 0 data register, set RAM A16
LAB_FFAB: ; $FFAB
BBC1,A,LAB_FFAF.
SEB5,LAB_F5set b5 port 0 function register, port 0 b5 = DME
LAB_FFAF: ; $FFAF
TXA.
EOR#$80.
STALAB_64save the record RAM pointer high byte
LDM#$00,LAB_63clear 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_FFB8: ; $FFB8
PHAsave the record memory start pointer high byte
TYAcopy the record memory start pointer low byte
SECset carry for subtract
SBCLAB_B6subtract the record memory end pointer low byte
TAYcopy the record length low byte
TXAcopy the record memory start pointer mid byte
SBCLAB_B7subtract the record memory end pointer mid byte
TAXcopy the record length mid byte
PLArestore A
SBCLAB_B8subtract the record memory end pointer high byte
BCSLAB_FFCF.
PHA.
TXA.
ADCLAB_65add the ?? size low byte
TAX.
PLA.
ADCLAB_66add the ?? size high byte
LAB_FFCF: ; $FFCF
BNELAB_FFDA.
DEX.
BNELAB_FFDA.
CPYLAB_B2.
BCSLAB_FFDA.
SECflag no room
RTS
LAB_FFDA: ; $FFDA
CLCflag room
RTS
************************************************************************************
swap the stack pointers
LAB_FFDC: ; $FFDC
PHAsave A
TXAcopy X
PHAsave X
TYAcopy Y
PHAsave Y
TSXcopy the stack pointer
LDALAB_07get the alternate stack pointer
STXLAB_07save this stack pointer
TAXcopy the alternate pointer to X
TXSset the stack pointer
PLApull Y
TAYrestore Y
PLApull X
TAXrestore X
PLArestore A
RTS
************************************************************************************
unused
.BYTE$FF,$FFunused bytes
.BYTE$FF,$FFunused bytes
.BYTE$FF,$FFunused bytes
************************************************************************************
processor vectors
.ORG $FFF4 ; vectors start address
.WORDLAB_FB35TC, CNTR or BRK
.WORDLAB_FB35HE or VE
.WORDLAB_F896TIMER 1, 2 or 3
.WORDLAB_F861RI or INT1
.WORDLAB_F766INT2
.WORDLAB_E00FRESET
.END
************************************************************************************