| ************************************************************************************ | |
| bit correct disassembly of EPROM dump | |
| LAB_00 = $00 ; alternate stack pointer | |
| LAB_01 = $01 ; RAM size | |
| byt value | |
| --- ----- | |
| $00 32K | |
| $01 64K | |
| $02 160K | |
| LAB_02 = $02 ; RAM end low byte | |
| LAB_03 = $03 ; RAM end high byte | |
| LAB_04 = $04 ; RAM size low byte | |
| LAB_05 = $05 ; RAM size high byte | |
| LAB_06 = $06 ; ?? buffer write index | |
| LAB_07 = $07 ; ?? buffer read index | |
| LAB_08 = $08 ; Tx buffer write index | |
| LAB_09 = $09 ; Tx buffer read index | |
| LAB_0A = $0A ; command loop flag, ?? | |
| bit function | |
| --- -------- | |
| 7-2 x = unused | |
| 1 1 = dial an outgoing number | |
| 0 1 = return to the main loop | |
| LAB_0B = $0B ; partial low byte | |
| LAB_0C = $0C ; partial high byte | |
| LAB_0D = $0D ; multiplicand low byte | |
| LAB_0E = $0E ; multiplicand high byte | |
| LAB_0F = $0F ; multiplier low byte | |
| LAB_10 = $10 ; multiplier high byte | |
| LAB_11 = $11 ; A2D channel 0 byte | |
| LAB_12 = $12 ; A2D channel 1 byte | |
| LAB_13 = $13 ; A2D channel 2 byte | |
| LAB_14 = $14 ; A2D channel 3 byte | |
| LAB_15 = $15 ;.. | |
| LAB_16 = $16 ;.. | |
| LAB_17 = $17 ;.. | |
| LAB_18 = $18 ; ABS(A2D(0 - 3)) | |
| LAB_19 = $19 ; ABS(A2D(1 - 3)) | |
| LAB_1A = $1A ; 1/8th second countdown byte | |
| LAB_1B = $1B ; seconds countdown | |
| LAB_1C = $1C ; digit to dial | |
| LAB_1D = $1D ; pulse count | |
| LAB_1E = $1E ; digits value | |
| byt value | |
| --- ----- | |
| $00 auto | |
| $01 pulse | |
| $02 dtmf | |
| $03 mixed | |
| LAB_1F = $1F ; pulses value | |
| byt value | |
| --- ----- | |
| $00 rev | |
| $01 spm16 | |
| $02 spm | |
| $03 xspm | |
| $04 m+ | |
| $05 m- | |
| LAB_20 = $20 ; VThreshold value | |
| LAB_21 = $21 ; TSeized value | |
| LAB_22 = $22 ; TPulse value | |
| LAB_23 = $23 ; TDial value | |
| LAB_24 = $24 ; rvs value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 on | |
| LAB_25 = $25 ; ECall value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 on | |
| LAB_26 = $26 ; park value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 txe | |
| $02 rev | |
| LAB_27 = $27 ;.. | |
| LAB_28 = $28 ;.. | |
| LAB_29 = $29 ;.. | |
| LAB_2A = $2A ;.. | |
| LAB_2B = $2B ;.. | |
| LAB_2C = $2C ;.. | |
| LAB_2D = $2D ;.. | |
| LAB_36 = $36 ; meter value low byte | |
| LAB_37 = $37 ; meter value mid byte | |
| LAB_38 = $38 ; meter value high byte | |
| LAB_39 = $39 ; ?? low byte | |
| LAB_3A = $3A ; ?? high byte | |
| LAB_3B = $3B ; ?? low byte | |
| LAB_3C = $3C ; ?? high byte | |
| LAB_3D = $3D ;.. | |
| LAB_3E = $3E ;.. | |
| LAB_3F = $3F ;.. | |
| LAB_40 = $40 ;. | |
| LAB_41 = $41 ;. | |
| LAB_42 = $42 ;. | |
| LAB_43 = $43 ;. | |
| LAB_44 = $44 ;. | |
| LAB_45 = $45 ;. | |
| LAB_46 = $46 ;. | |
| LAB_47 = $47 ; port 1 last read value | |
| LAB_48 = $48 ;. | |
| LAB_49 = $49 ;. | |
| LAB_4A = $4A ; dialed number buffer index | |
| LAB_4B = $4B ; timer 1 countdown byte | |
| LAB_4C = $4C ;. | |
| LAB_4D = $4D ; seconds countdown word low byte | |
| LAB_4E = $4E ; seconds countdown word high byte | |
| LAB_4F = $4F ; integer part of VThreshold * 2.277 | |
| LAB_50 = $50 ;. | |
| LAB_51 = $51 ;. | |
| LAB_52 = $52 ;. | |
| LAB_53 = $53 ;. | |
| LAB_54 = $54 ; buffered record length | |
| LAB_55 = $55 ;. | |
| LAB_56 = $56 ;. | |
| LAB_57 = $57 ;. | |
| LAB_58 = $58 ; record metered units low byte | |
| LAB_59 = $59 ; record metered units high byte | |
| LAB_5A = $5A ;. | |
| LAB_5B = $5B ;. | |
| LAB_5C = $5C ;. | |
| LAB_5D = $5D ;. | |
| LAB_5E = $5E ; carrier detect | |
| LAB_5F = $5F ; max year + 1 | |
| LAB_60 = $60 ; max month + 1 | |
| LAB_61 = $61 ; max date +1 | |
| LAB_62 = $62 ; max hour + 1 | |
| LAB_63 = $63 ; max minute + 1 | |
| LAB_64 = $64 ; max second + 1 | |
| LAB_65 = $65 ; max part second + 1 | |
| LAB_66 = $66 ; current year | |
| LAB_67 = $67 ; current month | |
| LAB_68 = $68 ; current date | |
| LAB_69 = $69 ; current hour | |
| LAB_6A = $6A ; current minute | |
| LAB_6B = $6B ; current second | |
| LAB_6C = $6C ; current 1/100ths of seconds | |
| LAB_6D = $6D ; current 1/8th seconds count | |
| LAB_6E = $6E ;. | |
| LAB_6F = $6F ;. | |
| LAB_70 = $70 ;. | |
| LAB_71 = $71 ;. | |
| LAB_72 = $72 ;. | |
| LAB_73 = $73 ;. | |
| LAB_74 = $74 ;. | |
| LAB_75 = $75 ;. | |
| LAB_76 = $76 ;. | |
| LAB_77 = $77 ;. | |
| LAB_78 = $78 ;. | |
| LAB_79 = $79 ;. | |
| LAB_7A = $7A ;. | |
| LAB_7B = $7B ;. | |
| LAB_7C = $7C ;. | |
| LAB_7D = $7D ;. | |
| LAB_7E = $7E ;. | |
| LAB_7F = $7F ; timer 2 value | |
| LAB_80 = $80 ; prescaller 2 value | |
| LAB_81 = $81 ;. | |
| LAB_82 = $82 ;. | |
| LAB_83 = $83 ;. | |
| LAB_84 = $84 ;. | |
| LAB_85 = $85 ;. | |
| LAB_86 = $86 ;. | |
| LAB_88 = $88 ;. | |
| LAB_8A = $8A ;. | |
| LAB_8C = $8C ;. | |
| LAB_8D = $8D ;. | |
| LAB_8E = $8E ;. | |
| LAB_8F = $8F ;. | |
| LAB_90 = $90 ; record RAM pointer low byte | |
| LAB_91 = $91 ; record RAM pointer high byte | |
| LAB_92 = $92 ; record memory start pointer low byte | |
| LAB_93 = $93 ; record memory start pointer mid byte | |
| LAB_94 = $94 ; record memory start pointer high byte | |
| LAB_95 = $95 ; record memory end pointer low byte | |
| LAB_96 = $96 ; record memory end pointer mid byte | |
| LAB_97 = $97 ; record memory end pointer high byte | |
| LAB_98 = $98 ;. | |
| LAB_99 = $99 ;. | |
| LAB_9A = $9A ;. | |
| LAB_9B = $9B ;. | |
| LAB_9C = $9C ;. | |
| LAB_9D = $9D ;. | |
| LAB_9E = $9E ;. | |
| LAB_9F = $9F ;. | |
| LAB_A0 = $A0 ;. | |
| LAB_A1 = $A1 ; next record pointer low byte | |
| LAB_A2 = $A2 ; next record pointer mid byte | |
| LAB_A3 = $A3 ; next record pointer high byte | |
| LAB_A4 = $A4 ;. | |
| ************************************************************************************ | |
| internal hardware | |
| LAB_DC = $DC ; prescaller 1 | |
| LAB_DD = $DD ; timer 1 | |
| LAB_DE = $DE ; prescaller 2 | |
| LAB_DF = $DF ; timer 2 | |
| LAB_E4 = $E4 ; UART Tx shift register | |
| LAB_E5 = $E5 ; UART Rx buffer register | |
| LAB_E6 = $E6 ; UART control register | |
| bit function | |
| --- -------- | |
| 7 {1|0} = Rx {enabled|disabled} | |
| 6 {1|0} = Tx {enabled|disabled} | |
| 5 x = unused | |
| 4 {1|0} = Rx interrupt {enabled|disabled} | |
| 3 {1|0} = {Xin/32|Xin/8} | |
| 2 {1|0} = {odd|even} parity | |
| 1 {1|0} = parity {enabled|disabled} | |
| 0 {1|0} = {8|7} bit | |
| LAB_E7 = $E7 ; UART status register | |
| bit function | |
| --- -------- | |
| 7 x = unused | |
| 6 x = unused | |
| 5 x = unused | |
| 4 overrun error | |
| 3 framing | |
| 2 parity | |
| 1 Tx complete | |
| 0 Rx interrupt | |
| LAB_E9 = $E9 ; A2D control register | |
| LAB_EA = $EA ; A2D register | |
| LAB_EE = $EE ; port 3 data register | |
| LAB_EF = $EF ; port 3 data direction register | |
| LAB_F0 = $F0 ; port 2 data register | |
| bit function | |
| --- -------- | |
| 7 ring detect | |
| 6 podem power control | |
| 5 modem mode, 1/0 originate/answer ?? | |
| 4 0 = carrier detect from modem | |
| 3 modem/RS232 select | |
| 2-0 unused ?? | |
| LAB_F1 = $F1 ; port 2 data direction register | |
| LAB_F3 = $F3 ; port 1 data register | |
| bit function | |
| --- -------- | |
| 7 ?? | |
| 6 vref power control | |
| 5 MT8870 power control | |
| 4 DTMF tone valid | |
| 3-0 DTMF tone vaue | |
| LAB_F4 = $F4 ; port 1 data direction register | |
| LAB_F5 = $F5 ; port 0 function register | |
| bit function | |
| --- -------- | |
| 7 unused | |
| 6 {1|0} = b6 = {TxD|b6} | |
| 5 {1|0} = b5 = {DME|b5} | |
| 4 {1|0} = b4 = {STB|b4} | |
| 3 {1|0} = b3 = {BUST|b3} | |
| 2 {1|0} = b2 = {CNTR|b2} | |
| 1-0 unused | |
| LAB_F6 = $F6 ; port 0 data register | |
| bit function | |
| --- -------- | |
| 7-5 unused ?? | |
| 4 RAM A16 | |
| 3-0 unused ?? | |
| LAB_F7 = $F7 ; port 0 data direction register | |
| LAB_FB = $FB ; BAUD rate generator | |
| LAB_FD = $FD ; interrupt control register 3 | |
| LAB_FE = $FE ; interrupt control register 2 | |
| LAB_FF = $FF ; interrupt control register 1 | |
| ************************************************************************************ | |
| RAM use | |
| LAB_00FF = $FF ;. | |
| LAB_0000 = $0000 ;. | |
| LAB_0011 = $0011 ;. | |
| LAB_006E = $006E ;. | |
| LAB_0100 = $0100 ; bottom of the stack | |
| LAB_017E = $017E ;. | |
| LAB_017F = $017F ;. | |
| LAB_0188 = $0188 ;. | |
| LAB_0200 = $0200 ;. | |
| LAB_0202 = $0202 ;. | |
| LAB_0204 = $0204 ;. | |
| LAB_0206 = $0206 ;. | |
| LAB_0208 = $0208 ;. | |
| LAB_020A = $020A ;. | |
| LAB_020B = $020B ;. | |
| LAB_020C = $020C ; RAM start low byte | |
| LAB_020D = $020D ; RAM start high byte | |
| LAB_020E = $020E ;. | |
| LAB_0210 = $0210 ;. | |
| LAB_0212 = $0212 ;. | |
| LAB_0214 = $0214 ;. | |
| LAB_0216 = $0216 ;. | |
| LAB_0218 = $0218 ;. | |
| LAB_021A = $021A ;. | |
| LAB_021C = $021C ;. | |
| LAB_021E = $021E ;. | |
| LAB_0220 = $0220 ;. | |
| LAB_0222 = $0222 ;. | |
| LAB_0224 = $0224 ;. | |
| LAB_0226 = $0226 ;. | |
| LAB_0228 = $0228 ;. | |
| LAB_022A = $022A ;. | |
| LAB_022C = $022C ;. | |
| LAB_022E = $022E ;. | |
| LAB_0230 = $0230 ;. | |
| LAB_0232 = $0232 ;. | |
| LAB_0233 = $0233 ;. | |
| LAB_0234 = $0234 ;. | |
| LAB_0235 = $0235 ;. | |
| LAB_0236 = $0236 ;. | |
| LAB_0237 = $0237 ;. | |
| LAB_0238 = $0238 ;. | |
| LAB_0239 = $0239 ;. | |
| LAB_023A = $023A ; BAUD rate generator value | |
| LAB_023B = $023B ; timer 2 value | |
| LAB_023C = $023C ; prescaller 2 value | |
| LAB_023D = $023D ; BAUD rate generator value | |
| LAB_023E = $023E ; timer 2 value | |
| LAB_023F = $023F ; prescaller 2 value | |
| LAB_0240 = $0240 ; command vector table | |
| LAB_0280 = $0280 ;. | |
| LAB_0380 = $0380 ;. | |
| LAB_0386 = $0386 ;. | |
| LAB_0396 = $0396 ;. | |
| LAB_03A6 = $03A6 ; to $05B5 ??, password | |
| LAB_03B6 = $03B6 ; ringback number buffer, to $03C5 | |
| LAB_03C6 = $03C6 ;. | |
| LAB_0402 = $0402 ;. | |
| LAB_04FC = $04FC ; GMT/BST change date/time | |
| LAB_0503 = $0503 ; new GMT/BST date/time | |
| LAB_050A = $050A ; ?? date/time byte | |
| LAB_0511 = $0511 ; ?? date/time byte | |
| LAB_0518 = $0518 ; ?? date/time byte | |
| LAB_051F = $051F ;. | |
| LAB_0520 = $0520 ;. | |
| LAB_0521 = $0521 ;. | |
| LAB_0522 = $0522 ;. | |
| LAB_0523 = $0523 ;. | |
| LAB_0524 = $0524 ;. | |
| LAB_0526 = $0526 ;. | |
| LAB_0527 = $0527 ;. | |
| LAB_0528 = $0528 ;. | |
| LAB_0529 = $0529 ;. | |
| LAB_052A = $052A ;. | |
| LAB_052B = $052B ;. | |
| LAB_052C = $052C ;. | |
| LAB_052D = $052D ;. | |
| LAB_052E = $052E ;. | |
| LAB_0538 = $0538 ;. | |
| LAB_0539 = $0539 ;. | |
| LAB_053A = $053A ;. | |
| LAB_053B = $053B ;. | |
| LAB_053C = $053C ;. | |
| LAB_053D = $053D ;. | |
| LAB_053E = $053E ;. | |
| LAB_053F = $053F ;. | |
| LAB_0541 = $0541 ;. | |
| LAB_0542 = $0542 ;. | |
| LAB_0543 = $0543 ;. | |
| LAB_0544 = $0544 ;. | |
| LAB_0545 = $0545 ;. | |
| LAB_0546 = $0546 ;. | |
| LAB_0639 = $0639 ;. | |
| LAB_063A = $063A ;. | |
| LAB_063B = $063B ;. | |
| LAB_063E = $063E ;. | |
| LAB_063F = $063F ;. | |
| LAB_0640 = $0640 ;. | |
| LAB_0641 = $0641 ;. | |
| LAB_0739 = $0739 ; ?? year/month | |
| LAB_073A = $073A ; ?? month/date | |
| LAB_073B = $073B ; ?? hours/minutes | |
| LAB_073C = $073C ; ?? minutes/seconds | |
| LAB_073D = $073D ; ?? seconds low bit | |
| LAB_073E = $073E ; ?? year/month | |
| LAB_073F = $073F ; ?? month/date | |
| LAB_0740 = $0740 ; ?? hours/minutes | |
| LAB_0741 = $0741 ; ?? minutes/seconds | |
| LAB_0742 = $0742 ; ?? seconds low bit | |
| LAB_0743 = $0743 ;. | |
| LAB_0744 = $0744 ;. | |
| LAB_0745 = $0745 ;. | |
| LAB_0746 = $0746 ;. | |
| LAB_0747 = $0747 ;. | |
| LAB_0748 = $0748 ;. | |
| LAB_0749 = $0749 ;. | |
| LAB_074A = $074A ;. | |
| LAB_074B = $074B ;. | |
| LAB_074C = $074C ;. | |
| LAB_074D = $074D ; buffered record year/month | |
| LAB_074E = $074E ; buffered record month/date | |
| LAB_074F = $074F ; buffered record hours/minutes | |
| LAB_0750 = $0750 ; buffered record minutes/seconds | |
| LAB_0751 = $0751 ;.. | |
| LAB_0752 = $0752 ;.. | |
| LAB_0753 = $0753 ;.. | |
| LAB_0754 = $0754 ;.. | |
| LAB_0755 = $0755 ;.. | |
| LAB_0756 = $0756 ; buffered record number to $078A max | |
| LAB_078B = $078B ;. | |
| LAB_078C = $078C ;. | |
| LAB_078D = $078D ;. | |
| LAB_078E = $078E ;. | |
| LAB_078F = $078F ;. | |
| LAB_0790 = $0790 ;. | |
| LAB_0794 = $0794 ;. | |
| .ORG$E000 | |
| ************************************************************************************ | |
| command $00 return string | |
| LAB_E000: ; $E000 | |
| .WORD$55BC | serial number |
| .WORD$0082 | version number |
| .WORD$0001 | ?? number |
| ************************************************************************************ | |
| copied to LAB_1E onward | |
| LAB_E006: ; $E006 | |
| .BYTE$00 | digits default value |
| .BYTE$00 | pulses default value |
| .BYTE$28 | VThreshold default value |
| .BYTE$05 | TSeized default value |
| .BYTE$04 | TPulse default value |
| .BYTE$15 | TDial default value |
| .BYTE$01 | rvs default value |
| .BYTE$00 | ECall default value |
| .BYTE$00 | park default value |
| .BYTE$00 | . |
| .BYTE$05 | . |
| .BYTE$03 | . |
| .BYTE$20 | . |
| .BYTE$14 | . |
| .BYTE$3C | . |
| .BYTE$18 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| .BYTE$00 | . |
| ************************************************************************************ | |
| command vector table | |
| LAB_E01E: ; $E01E | |
| .WORDLAB_E2E0 | return serial#, version#, ??#, RAM size and ?? |
| .WORDLAB_E30D | return or set the variables |
| .WORDLAB_E32C | . |
| .WORDLAB_E342 | . |
| .WORDLAB_E358 | return or set the date/time |
| .WORDLAB_E388 | return or set the BST/GMT change date/time |
| .WORDLAB_E39E | . |
| .WORDLAB_E3AC | get the current time/date |
| .WORDLAB_E3D2 | return or set the password |
| .WORDLAB_E3E2 | . |
| .WORDLAB_E408 | return or set the metered units |
| .WORDLAB_E418 | . |
| .WORDLAB_E428 | . |
| .WORDLAB_E431 | return the metered units |
| .WORDLAB_E440 | reload vector table(s) |
| .WORDLAB_E458 | return the checksum of count bytes from address |
| .WORDLAB_E4A2 | write memory bytes |
| .WORDLAB_E4C0 | read memory bytes |
| .WORDLAB_E4E3 | execute code from address |
| .WORDLAB_E4EE | . |
| .WORDLAB_E501 | . |
| .WORDLAB_E674 | . |
| .WORDLAB_E592 | download ?? |
| .WORDLAB_E5A6 | . |
| .WORDLAB_E5AD | . |
| .WORDLAB_E5BB | . |
| .WORDLAB_E5E7 | . |
| .WORDLAB_E5EC | . |
| .WORDLAB_E674 | . |
| .WORDLAB_E674 | . |
| .WORDLAB_E5F2 | return or set and dial the ringback number |
| .WORDLAB_E66F | . |
| ************************************************************************************ | |
| copy the command vector table to RAM | |
| LAB_E05E: ; $E05E | |
| LDX#LAB_E05E-LAB_E01E | |
| set the byte count | |
| LDY#$00 | clear the index |
| LAB_E062: ; $E062 | |
| LDALAB_E01E,Y | get a command vector byte |
| STALAB_0240,Y | save it to RAM |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E062 | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| copy vectors from AY to LAB_0200, A = low byte, Y = high byte, X = byte count | |
| LAB_E06D: ; $E06D | |
| STALAB_74 | save the source pointer low byte |
| STYLAB_75 | save the source pointer high byte |
| PHP | save the processor status |
| SEI | disable interrupts |
| LDY#$00 | clear the index |
| LAB_E075: ; $E075 | |
| LDA(LAB_74),Y | get a table byte |
| STALAB_0200,Y | save a vector byte |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E075 | loop if more to do |
| PLP | restore the processor status |
| NOP | waste two cycles |
| RTS | |
| ************************************************************************************ | |
| RAM size ?? | |
| LAB_E081: ; $E081 | |
| .WORD$0200 | . |
| .WORD$0280 | . |
| .WORD$0400 | . |
| ************************************************************************************ | |
| test the RAM ?? | |
| LAB_E087: ; $E087 | |
| LDY#$00 | clear the index |
| STYLAB_74 | clear the RAM test pointer low byte |
| STYLAB_75 | clear the RAM test pointer high byte |
| CLB4,LAB_F6 | clear b4 port 0 data register, clear RAM A16 |
| SEB5,LAB_F5 | set b5 port 0 function register, port 0 b5 = DME |
| LDA#$AA | set the first test byte |
| STA(LAB_74),Y | save the $AA to $0xxxx |
| SEB4,LAB_F6 | set b4 port 0 data register, set RAM A16 |
| LSRA | make $AA into $55 |
| STA(LAB_74),Y | save the $55 to $1xxxx |
| CLB4,LAB_F6 | clear b4 port 0 data register, clear RAM A16 |
| LDA(LAB_74),Y | read $0xxxx |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| LDX#$02 | set 160K |
| CMP#$AA | compare the read byte with $AA |
| BEQLAB_E0AC | if the byte is $AA memory is 160K so go use it |
| DEX | decrement the size to 64K |
| CMP#$55 | compare the read byte with $55 |
| BEQLAB_E0AC | if the byte is $55 memory is 64K so go use it |
| DEX | else decrement the size to 32K |
| LAB_E0AC: ; $E0AC | |
| STXLAB_01 | save the RAM size |
| TXA | copy it |
| ASLA | * 2 |
| TAY | back to the index |
| LDALAB_E081,Y | get the RAM end low byte |
| LDXLAB_E081+1,Y | get the RAM end high byte |
| STALAB_02 | save the RAM end low byte |
| STXLAB_03 | save the RAM end high byte |
| RTS | |
| ************************************************************************************ | |
| calculate the RAM size ?? | |
| LAB_E0BC: ; $E0BC | |
| SEC | set carry for subtract |
| LDALAB_02 | get the RAM end low byte |
| SBCLAB_020C | subtract the RAM start low byte |
| STALAB_04 | save the RAM size low byte |
| LDALAB_03 | get the RAM end high byte |
| SBCLAB_020D | subtract the RAM start high byte |
| STALAB_05 | save the RAM size high byte |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_E0CC: ; $E0CC | |
| LDALAB_020A | . |
| LDYLAB_020B | . |
| STALAB_017E | . |
| STYLAB_017F | . |
| LDM#$7A,LAB_00 | set the alternate stack pointer |
| RTS | |
| ************************************************************************************ | |
| does nothing, just returns | |
| LAB_E0DC: ; $E0DC | |
| RTS | |
| ************************************************************************************ | |
| copied to LAB_0200 onward | |
| LAB_E0DD: ; $E0DD | |
| .WORDLAB_F68E | TC, CNTR or BRK interrupt, does RESET |
| .WORDLAB_EC76 | HE or VE interrupt |
| .WORDLAB_E9F2 | timer 1 or timer 2interrupt |
| .WORDLAB_E927 | RI or INT1 interrupt |
| .WORDLAB_E852 | INT2, 1/8th second interrupt |
| .WORDLAB_ECB2 | unused ?? |
| .WORDLAB_0188 | RAM start ?? |
| .WORDLAB_00FF | unused ?? |
| $0210 | |
| .WORDLAB_E0DC | does nothing, just returns |
| .WORDLAB_E0DC | does nothing, just returns |
| .WORDLAB_E0DC | does nothing, just returns |
| .WORDLAB_E0DC | does nothing, just returns |
| .WORDLAB_E189 | wait for a character from ?? |
| .WORDLAB_E159 | put a byte in the Tx buffer |
| .WORDLAB_E216 | receive and execute a command ?? |
| .WORDLAB_E138 | unused ?? |
| $0220 | |
| .WORDLAB_ED09 | . |
| .WORDLAB_ED38 | . |
| .WORDLAB_EDEE | . |
| .WORDLAB_EF63 | . |
| .WORDLAB_EFA6 | . |
| .WORDLAB_EFCF | . |
| .WORDLAB_E0DC | does nothing, just returns |
| .WORDLAB_E0DC | does nothing, just returns |
| $0230 | |
| .WORDLAB_E0DC | does nothing, just returns |
| .BYTE$1E | .$0232 |
| .BYTE$C8 | .$0233 |
| .BYTE$1E | .$0234 |
| .BYTE$40 | .$0235 |
| .BYTE$32 | .$0236 |
| .BYTE$14 | .$0237 |
| .BYTE$12 | .$0238 |
| .BYTE$04 | .$0239 |
| .BYTE$BF | .$023A BAUD rate generator value |
| sets (1/8) * (1/(191+1)) * (1/16) baud | |
| this will be 300 BAUD with a 7.3728MHz XTAL | |
| .BYTE$BF | .$023B timer 2 value, 36.67ms |
| .BYTE$57 | .$023C prescaller 2 value |
| sets (1/(87+1)) * (1/16) Hz | |
| this will be 5236 Hz with a 7.3728MHz XTAL | |
| .BYTE$05 | .$023D BAUD rate generator value |
| sets (1/8) * (1/(5+1)) * (1/16) baud | |
| this will be 9600 BAUD with a 7.3728MHz XTAL | |
| .BYTE$05 | .$023E timer 2 value, 1.15ms |
| .BYTE$57 | .$023F prescaller 2 value |
| sets (1/(87+1)) * (1/16) Hz | |
| this will be 5236 Hz with a 7.3728MHz XTAL | |
| ************************************************************************************ | |
| ?? | |
| LAB_E11D: ; $E11D | |
| .WORDLAB_F68E | TC, CNTR or BRK interrupt, does RESET |
| .WORDLAB_EC76 | HE or VE interrupt |
| .WORDLAB_E9D1 | timer 1 or timer 2 interrupt |
| .WORDLAB_E927 | RI or INT1 interrupt |
| .WORDLAB_E7C0 | INT2, 1/8th second interrupt |
| .WORDLAB_ECB9 | unused ?? |
| .WORDLAB_0188 | unused ?? |
| .WORDLAB_0000 | unused ?? |
| ************************************************************************************ | |
| copy the vector table and values from LAB_E0DD | |
| LAB_E12D: ; $E12D | |
| LDA#>LAB_E0DD | ?? pointer low byte |
| LDY#<LAB_E0DD | ?? pointer high byte |
| LDX#LAB_E11D-LAB_E0DD | |
| set the byte count | |
| BRALAB_E13E | . |
| ************************************************************************************ | |
| copy the vector tablesand values from from LAB_E0DD and LAB_E11D | |
| LAB_E135: ; $E135 | |
| JSRLAB_E12D | copy the vector table and values from LAB_E0DD |
| LAB_E138: ; $E138 | |
| LDA#>LAB_E11D | ?? pointer low byte |
| LDY#<LAB_E11D | ?? pointer high byte |
| LDX#$10 | . |
| LAB_E13E: ; $E13E | |
| JSRLAB_E06D | copy vectors from AY to LAB_0200, |
| A = low byte, Y = high byte, X = byte count | |
| JSRLAB_E0BC | calculate the RAM size ?? |
| JSRLAB_F42F | . |
| JSRLAB_E0CC | . |
| JSRLAB_E05E | copy the command vector table to RAM |
| RTS | |
| ************************************************************************************ | |
| copy the default variable values to RAM | |
| LAB_E14E: ; $E14E | |
| LDX#$17 | set the count/index |
| LAB_E150: ; $E150 | |
| LDALAB_E006,X | get a default value |
| STALAB_1E,X | save it to RAM |
| DEX | decrement the count/index |
| BPLLAB_E150 | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| put a byte in the Tx buffer | |
| LAB_E159: ; $E159 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| TSX | copy the stack pointer |
| LDALAB_0100+3,X | get the saved character |
| LDXLAB_08 | get the Tx buffer write index |
| INX | increment it |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_E176 | if less go use it |
| LDX#$00 | else wrap it to zero |
| BRALAB_E176 | go use it |
| LAB_E16D: ; $E16D | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| TSTLAB_5E | test the carrier detect |
| BEQLAB_E183 | if no carrier just exit |
| BBS7,LAB_F0,LAB_E183 | test b7 port 2 data register, ring detect |
| if ring detected just exit | |
| LAB_E176: ; $E176 | |
| CPXLAB_09 | compare the incremented write index with the read index |
| BEQLAB_E16D | if the same go wait for a byte to be sent |
| LDYLAB_08 | get the Tx buffer write index |
| STALAB_0380,Y | write the character to the Tx buffer |
| STXLAB_08 | save the updated Tx buffer write index |
| SEB2,LAB_FE | and set the timer 2 interrupt enable bit |
| LAB_E183: ; $E183 | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTS | |
| ************************************************************************************ | |
| wait for a character from ?? | |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| LAB_E189: ; $E189 | |
| PHA | make room on the stack for the character |
| TXA | copy X |
| PHA | save X |
| LDM#$04,LAB_1A | set the 1/8th second countdown byte |
| LDXLAB_07 | get the ?? buffer read index |
| BRALAB_E1A4 | branch into the loop |
| LAB_E193: ; $E193 | |
| TSTLAB_5E | test the carrier detect |
| BEQLAB_E1B7 | if no carrier go do error exit |
| BBS7,LAB_F0,LAB_E1B7 | test b7 port 2 data register, ring detect |
| if ring detected go do error return | |
| TSTLAB_1B | test the seconds countdown |
| BEQLAB_E1B7 | if counted out go return no carrier |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BEQLAB_E1BA | if 1/2 second counted out go do null return |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| LAB_E1A4: ; $E1A4 | |
| CPXLAB_06 | compare it with the ?? buffer write index |
| BEQLAB_E193 | if the buffer is empty just loop |
| LDALAB_0280,X | get a character from the ?? buffer |
| INCLAB_07 | increment the ?? buffer read index |
| TSX | copy the stack pointer |
| STALAB_0100+2,X | save the character to the stack |
| PLA | pull X |
| TAX | restore X |
| PLA | pull the character |
| CLV | flag no timeout |
| CLC | flag carrier |
| RTS | |
| LAB_E1B7: ; $E1B7 | |
| SEC | flag no carrier |
| BRALAB_E1BB | go return the error |
| LAB_E1BA: ; $E1BA | |
| CLC | flag carrier |
| LAB_E1BB: ; $E1BB | |
| BITLAB_E1C1 | set Vb, flag timeout |
| PLA | pull X |
| TAX | restore X |
| PLA | pull the character |
| LAB_E1C1: ; $E1C1 | |
| RTS | |
| ************************************************************************************ | |
| if ?? put a byte in the Tx buffer ?? | |
| LAB_E1C2: ; $E1C2 | |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BNELAB_E1D1 | if not counted out just exit |
| LDALAB_09 | get the Tx buffer read index |
| EORLAB_08 | compare it with the Tx buffer write index |
| BNELAB_E1D1 | . |
| JSR\LAB_FF27 | put a byte in the Tx buffer |
| ************************************************************************************ | |
| set 1/4 second countdown | |
| LAB_E1CE: ; $E1CE | |
| LDM#$02,LAB_1A | set the 1/8th second countdown byte |
| LAB_E1D1: ; $E1D1 | |
| RTS | |
| ************************************************************************************ | |
| receive a command record | |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if timed out | |
| return Zb = 1 if ok | |
| [count][command][byte...][checksum] | |
| LAB_E1D2: ; $E1D2 | |
| LDX#$00 | clear the Rx length |
| LAB_E1D4: ; $E1D4 | |
| JSR\LAB_FF24 | wait for a character from ?? |
| BCSLAB_E1F4 | if no carrier or ring just exit |
| BVSLAB_E1D4 | if 1/2 second counted go wait some more |
| STALAB_76 | save the byte to the checksum |
| TAY | copy the byte count |
| LAB_E1DD: ; $E1DD | |
| JSR\LAB_FF24 | wait for a character from ?? |
| BVSLAB_E1F4 | if 1/2 second counted just exit |
| STALAB_0538,X | save the byte to the command buffer |
| ADCLAB_76 | add the checksum byte, Cb /should/ be clear here |
| STALAB_76 | save the checksum byte |
| INX | increment the received byte count |
| DEY | decrement the expected byte count |
| BNELAB_E1DD | loop if more to do |
| STXLAB_77 | save the received byte count |
| JSR\LAB_FF24 | wait for a character from ?? |
| EORLAB_76 | compare it with the checksum |
| EOR#$55 | . |
| LAB_E1F4: ; $E1F4 | |
| RTS | |
| ************************************************************************************ | |
| send the command result ?? | |
| result type in A | |
| result byte count in X | |
| result pointer in LAB-78/79 | |
| [count][type][byte...][checksum] | |
| LAB_E1F5: ; $E1F5 | |
| PHA | save the result type |
| INX | adjust the byte count for the loop type |
| TXA | copy the byte count |
| STALAB_76 | save the byte to the checksum |
| JSR\LAB_FF27 | put a byte in the Tx buffer |
| PLA | pull the result type |
| LDY#$00 | clear the result index |
| BRALAB_E204 | go Tx the result type |
| LAB_E201: ; $E201 | |
| LDA(LAB_78),Y | get a result byte |
| INY | increment the result index |
| LAB_E204: ; $E204 | |
| JSR\LAB_FF27 | put a byte in the Tx buffer |
| CLC | clear carry for add |
| ADCLAB_76 | add the checksum byte |
| STALAB_76 | save the checksum byte |
| DEX | decrement the byte count |
| BNELAB_E201 | loop if more to do |
| LDALAB_76 | get the checksum byte |
| EOR#$AA | . |
| JSR\LAB_FF27 | put a byte in the Tx buffer |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| receive and execute a command ?? | |
| LAB_E216: ; $E216 | |
| LDM#$00,LAB_0A | clear the command loop flag, ?? |
| JSRLAB_E1D2 | receive a command record |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if timed out | |
| return Zb = 1 if ok | |
| BCSLAB_E260 | if no carrier or ring detected just exit |
| BVSLAB_E24E | if timed out go ?? |
| BNELAB_E24E | if checksum error go ?? |
| LDALAB_0538 | get the command byte |
| ASLA | * 2 |
| TAX | copy to the index |
| LDA#$F3 | default to result type $F3, command out of range |
| CPX#$40 | compare the index with max + 1 |
| BCSLAB_E256 | if > max go return command out of range |
| LDYLAB_0240,X | get the command vector low byte |
| STYLAB_78 | save the command vector low byte |
| LDYLAB_0240+1,X | get the command vector high byte |
| STYLAB_79 | save the command vector high byte |
| LDY#$00 | . |
| LDXLAB_77 | get the received byte count |
| DEX | - 1 gives the command payload |
| CPX#$01 | compare the byte count with $01, |
| sets Cb if there are any payload bytes | |
| CLV | clear the returned type flag |
| JSR(LAB_78) | go do the command |
| BCSLAB_E252 | if error go do the command error exit |
| STALAB_78 | save the result pointer low byte |
| STYLAB_79 | save the result pointer high byte |
| LDA#$00 | return command ok |
| LDM#$FF,LAB_1B | set the seconds countdown to 255 seconds |
| BRALAB_E258 | go send the command result |
| LAB_E24E: ; $E24E | |
| LDA#$FF | return checksum error |
| BRALAB_E256 | go clear the byte count and return the type |
| the command returned an error | |
| LAB_E252: ; $E252 | |
| BVSLAB_E256 | if Vb is set use the returned type in A |
| LDA#$FE | else return command error |
| LAB_E256: ; $E256 | |
| LDX#$00 | clear the returned byte count |
| LAB_E258: ; $E258 | |
| JSRLAB_E1F5 | send the command result, always clears Cb ?? |
| result type in A | |
| result byte count in X | |
| result pointer in LAB-78/79 | |
| TSTLAB_0A | test the command loop flag |
| BEQLAB_E260 | if not set just exit |
| SEC | else flag command loop exit |
| LAB_E260: ; $E260 | |
| RTS | |
| ************************************************************************************ | |
| copy a return message from AY to RAM | |
| LAB_E261: ; $E261 | |
| STALAB_7A | save the pointer low byte |
| STYLAB_7B | save the pointer high byte |
| LDY#$00 | clear the index |
| LAB_E267: ; $E267 | |
| LDA(LAB_7A),Y | read a return byte |
| STALAB_0639,Y | copy it to RAM |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E267 | loop if more to do |
| TYA | copy the byte count .. |
| TAX | .. to X |
| LDA#>LAB_0639 | set the pointer low byte |
| LDY#<LAB_0639 | set the pointer high byte |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| copy X bytes from LAB_0539 to AY if Zb = 1 ?? | |
| LAB_E278: ; $E278 | |
| SEC | set Cb so it will only copy if Zb = 1 |
| ************************************************************************************ | |
| copy X bytes from LAB_0539 to AY ?? | |
| LAB_E279: ; $E279 | |
| BEQLAB_E27D | . |
| BCSLAB_E290 | . |
| LAB_E27D: ; $E27D | |
| PHP | save the zero status |
| STALAB_7A | set the destination pointer low byte |
| STYLAB_7B | set the destination pointer high byte |
| LDY#$00 | clear the index |
| LAB_E284: ; $E284 | |
| LDALAB_0539,Y | . |
| STA(LAB_7A),Y | . |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E284 | loop if more to do |
| PLP | restore the zero status |
| NOP | waste cycles |
| CLC | flag ok |
| LAB_E290: ; $E290 | |
| RTS | |
| ************************************************************************************ | |
| copy X bytes from LAB_0539 to AY and null terminate ?? | |
| ?? pointer in AY | |
| ?? byte count in X | |
| LAB_E291: ; $E291 | |
| JSRLAB_E279 | copy X bytes from LAB_0539 to AY ?? |
| BCSLAB_E29B | if error just exit |
| BEQLAB_E29B | if = to max length just exit |
| TXA | clear A |
| STA(LAB_7A),Y | clear the following byte |
| LAB_E29B: ; $E29B | |
| RTS | |
| ************************************************************************************ | |
| search for null in X bytes at AY ?? | |
| return the index/count in Y | |
| LAB_E29C: ; $E29C | |
| STALAB_7A | save the pointer low byte |
| STYLAB_7B | save the pointer high byte |
| LDY#$00 | clear the index/count |
| LAB_E2A2: ; $E2A2 | |
| LDA(LAB_7A),Y | get a byte |
| BEQLAB_E2AA | if null go return the count |
| INY | increment the index/count |
| DEX | decrement the count |
| BNELAB_E2A2 | loop if more to do |
| LAB_E2AA: ; $E2AA | |
| TYA | copy the count .. |
| TAX | .. to X |
| LDALAB_7A | get the pointer low byte |
| LDYLAB_7B | get the pointer high byte |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| copy the default date and time to LAB_0518 ?? | |
| LAB_E2B2: ; $E2B2 | |
| SEC | set to copy the default date/time |
| BRALAB_E2B6 | go copy the date and time to LAB_0518 ?? |
| ************************************************************************************ | |
| copy the current date and time to LAB_0518 ?? | |
| LAB_E2B5: ; $E2B5 | |
| CLC | clear to copy the current date/time |
| LAB_E2B6: ; $E2B6 | |
| LDA#>LAB_0518 | set the ?? pointer low byte |
| LDY#<LAB_0518 | set the ?? pointer high byte |
| BRALAB_E2C1 | go copy the date and time to AY |
| ************************************************************************************ | |
| copy the current date and time to LAB_0511 ?? | |
| LAB_E2BC: ; $E2BC | |
| CLC | clear to copy the current date/time |
| LDA#>LAB_0511 | set the ?? pointer low byte |
| LDY#<LAB_0511 | set the ?? pointer high byte |
| ************************************************************************************ | |
| copy the date and time to AY | |
| LAB_E2C1: ; $E2C1 | |
| STALAB_7A | save the pointer low byte |
| STYLAB_7B | save the pointer high byte |
| LDX#$07 | set the byte count |
| LDY#$00 | clear the index |
| SEI | disable interrupts |
| LAB_E2CA: ; $E2CA | |
| BCCLAB_E2D1 | if Cb = 0 go get a current date/time byte |
| LDALAB_E913,Y | else get a default date and time byte |
| BRALAB_E2D4 | go save the byte |
| LAB_E2D1: ; $E2D1 | |
| LDALAB_66,Y | get a current date/time byte |
| LAB_E2D4: ; $E2D4 | |
| STA(LAB_7A),Y | save a date/time byte |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E2CA | loop if more to do |
| CLI | enable interrupts |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| RAM size values | |
| LAB_E2DD: ; $E2DD | |
| .BYTE$20 | 32K |
| .BYTE$40 | 64K |
| .BYTE$A0 | 160K |
| ************************************************************************************ | |
| command $00, return serial#, version#, ??#, RAM size and ?? | |
| LAB_E2E0: ; $E2E0 | |
| BCSLAB_E30C | if following bytes just exit |
| LDA#>LAB_E000 | set the return message pointer low byte |
| LDY#<LAB_E000 | set the return message pointer high byte |
| LDX#$05 | set the byte count |
| JSRLAB_E261 | copy a return message from AY to RAM |
| PHA | save the RAM pointer low byte |
| LDALAB_020E | . |
| STALAB_063E | . |
| LDXLAB_01 | get the RAM size, $00, $01 or $02 |
| LDALAB_E2DD,X | get the numeric size byte |
| STALAB_063F | save the RAM size to the return buffer |
| LDXLAB_05 | get the RAM size high byte |
| LDALAB_04 | get the RAM size low byte |
| BNELAB_E301 | . |
| DEX | . |
| LAB_E301: ; $E301 | |
| DECA | . |
| STALAB_0640 | . |
| STXLAB_0641 | . |
| LDX#$09 | set the byte count |
| PLA | restore the RAM pointer low byte |
| CLC | flag ok |
| LAB_E30C: ; $E30C | |
| RTS | |
| ************************************************************************************ | |
| command $01, return or set the variables | |
| LAB_E30D: ; $E30D | |
| LDA#>LAB_1E | set the return message pointer low byte |
| LDY#<LAB_1E | set the return message pointer high byte |
| BCSLAB_E317 | if following bytes go set the variables |
| LDX#$18 | set the byte count |
| CLC | flag ok |
| RTS | |
| LAB_E317: ; $E317 | |
| CPX#$18 | compare the byte count with $18 |
| JSRLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| BCSLAB_E32B | if error just exit |
| SEB1,LAB_EF | . |
| BBC7,LAB_27,LAB_E325 | . |
| CLB1,LAB_EF | . |
| LAB_E325: ; $E325 | |
| JSRLAB_E679 | save the integer part of VThreshold * 2.277 in LAB_4F |
| JMPLAB_E2BC | copy the current date and time to LAB_0511 ?? |
| LAB_E32B: ; $E32B | |
| RTS | |
| ************************************************************************************ | |
| command $02 ?? | |
| LAB_E32C: ; $E32C | |
| LDA#>LAB_0386 | set the ?? pointer low byte |
| LDY#<LAB_0386 | set the ?? pointer high byte |
| BCSLAB_E337 | if following bytes go ?? |
| LDX#$10 | set the byte count |
| JMPLAB_E29C | search for null in X bytes at AY ?? |
| LAB_E337: ; $E337 | |
| CPX#$10 | . |
| JSRLAB_E291 | copy X bytes from LAB_0539 to AY and null terminate ?? |
| ?? pointer in AY | |
| ?? byte count in X | |
| BCSLAB_E341 | if error just exit |
| JMPLAB_E2BC | copy the current date and time to LAB_0511 ?? |
| LAB_E341: ; $E341 | |
| RTS | |
| ************************************************************************************ | |
| command $03 ?? | |
| LAB_E342: ; $E342 | |
| LDA#>LAB_0396 | set the ?? pointer low byte |
| LDY#<LAB_0396 | set the ?? pointer high byte |
| BCSLAB_E34D | if following bytes go ?? |
| LDX#$10 | set the byte count |
| JMPLAB_E29C | search for null in X bytes at AY ?? |
| LAB_E34D: ; $E34D | |
| CPX#$10 | . |
| JSRLAB_E291 | copy X bytes from LAB_0539 to AY and null terminate ?? |
| ?? pointer in AY | |
| ?? byte count in X | |
| BCSLAB_E357 | . |
| JMPLAB_E2BC | copy the current date and time to LAB_0511 ?? |
| LAB_E357: ; $E357 | |
| RTS | |
| ************************************************************************************ | |
| command $04, return or set the date/time | |
| LAB_E358: ; $E358 | |
| BCSLAB_E366 | if following bytes go set the date/time |
| LDA#>LAB_66 | set the return message pointer low byte |
| LDY#<LAB_66 | set the return message pointer high byte |
| LDX#$07 | set the byte count |
| SEI | disable interrupts |
| JSRLAB_E261 | copy a return message from AY to RAM |
| CLI | enable interrupts |
| RTS | |
| LAB_E366: ; $E366 | |
| CPX#$07 | compare the byte count with $07 |
| SEC | flag error |
| BNELAB_E387 | if not $07 bytes just exit |
| SEI | disable interrupts |
| LAB_E36C: ; $E36C | |
| LDALAB_66,Y | get a current date/time byte |
| STALAB_0639,Y | save it to the return buffer |
| LDALAB_0539,Y | get a new date/time byte |
| STALAB_66,Y | save a current date/time byte |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E36C | loop if more to do |
| JSRLAB_E8F0 | set 1/8ths of seconds from 100ths |
| CLI | enable interrupts |
| TYA | copy the byte count .. |
| TAX | .. to X |
| LDA#>LAB_0639 | set the return message pointer low byte |
| LDY#<LAB_0639 | set the return message pointer high byte |
| CLC | flag ok |
| LAB_E387: ; $E387 | |
| RTS | |
| ************************************************************************************ | |
| command $05, return or set the BST/GMT change date/time | |
| LAB_E388: ; $E388 | |
| LDA#>LAB_04FC | set the return message pointer low byte |
| LDY#<LAB_04FC | set the return message pointer high byte |
| BCSLAB_E396 | if following bytes go set the BST/GMT change date/time |
| LDX#$0E | set the byte count |
| SEI | disable interrupts |
| JSRLAB_E261 | copy a return message from AY to RAM |
| CLI | enable interrupts |
| RTS | |
| LAB_E396: ; $E396 | |
| CPX#$0E | compare the byte count with $0E |
| SEI | disable interrupts |
| JSRLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| CLI | enable interrupts |
| RTS | |
| ************************************************************************************ | |
| command $06 ?? | |
| LAB_E39E: ; $E39E | |
| LDA#>LAB_050A | set the return message pointer low byte |
| LDY#<LAB_050A | set the return message pointer high byte |
| BCSLAB_E3A7 | if following bytes go ?? |
| LDX#$07 | set the byte count |
| RTS | |
| LAB_E3A7: ; $E3A7 | |
| CPX#$07 | compare the byte count with $07 |
| JMPLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| ************************************************************************************ | |
| command $07, get the current time/date | |
| LAB_E3AC: ; $E3AC | |
| BCSLAB_E3BF | if following bytes just exit |
| SEI | disable interrupts |
| LAB_E3AF: ; $E3AF | |
| LDALAB_66,X | get a current date/time byte |
| STALAB_050A,X | save it to the reply buffer |
| INX | increment the index |
| CPX#$07 | compare it with max + 1 |
| BCCLAB_E3AF | if <= max go get another byte |
| CLI | enable interrupts |
| LDA#>LAB_050A | set the return message pointer low byte |
| LDY#<LAB_050A | set the return message pointer high byte |
| CLC | flag ok |
| LAB_E3BF: ; $E3BF | |
| RTS | |
| ************************************************************************************ | |
| default password | |
| LAB_E3C0: ; $E3C0 | |
| .BYTE'ALICE',$00 | "ALICE" |
| ************************************************************************************ | |
| set the default password | |
| LAB_E3C6: ; $E3C6 | |
| LDX#$05 | set the count/index |
| LAB_E3C8: ; $E3C8 | |
| LDALAB_E3C0,X | get a default password cyte |
| STALAB_03A6,X | save a password byte |
| DEX | decrement the count/index |
| BPLLAB_E3C8 | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| command $08, return or set the password | |
| LAB_E3D2: ; $E3D2 | |
| LDA#>LAB_03A6 | set the password pointer low byte |
| LDY#<LAB_03A6 | set the password pointer high byte |
| BCSLAB_E3DD | if following bytes go set the password |
| LDX#$10 | set the byte count |
| JMPLAB_E29C | search for null in X bytes at AY ?? |
| return the password | |
| LAB_E3DD: ; $E3DD | |
| CPX#$10 | compare the byte count with $10 |
| JMPLAB_E291 | copy X bytes from LAB_0539 to AY and null terminate ?? |
| ?? pointer in AY | |
| ?? byte count in X | |
| ************************************************************************************ | |
| command $09, password ?? | |
| LAB_E3E2: ; $E3E2 | |
| BCCLAB_E401 | if no following bytes go return type $F2 |
| CPX#$11 | compare the byte count with max + 1 |
| BCSLAB_E401 | if > max go return $F2 |
| LAB_E3E8: ; $E3E8 | |
| LDALAB_03A6,Y | get a password byte |
| EORLAB_0539,Y | compare it with a command password byte |
| AND#$DF | mask xx0x xxxx, make case insensetive |
| BNELAB_E401 | if not the same go return $F2 |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E3E8 | loop if more to do |
| CPY#$10 | compare the length with $10 |
| BCSLAB_E3FF | if >= $10 skip the null end check |
| LDALAB_03A6,Y | else make sure the next character is $00 |
| BNELAB_E401 | if not null go return $F2 |
| LAB_E3FF: ; $E3FF | |
| CLC | flag ok |
| RTS | |
| LAB_E401: ; $E401 | |
| LDA#$F2 | set return type $F2, password incorrect ?? |
| BITLAB_E407 | set Vb |
| SEC | flag error |
| LAB_E407: ; $E407 | |
| RTS | |
| ************************************************************************************ | |
| command $0A, return or set the metered units | |
| LAB_E408: ; $E408 | |
| LDA#>LAB_36 | set the return message pointer low byte |
| LDY#<LAB_36 | set the return message pointer high byte |
| BCSLAB_E413 | if following bytes go ?? |
| LDX#$03 | set the byte count |
| JMPLAB_E261 | copy a return message from AY to RAM |
| LAB_E413: ; $E413 | |
| CPX#$03 | . |
| JMPLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| ************************************************************************************ | |
| command $0B ?? | |
| LAB_E418: ; $E418 | |
| LDA#>LAB_39 | set the return message pointer low byte |
| LDY#<LAB_39 | set the return message pointer high byte |
| BCSLAB_E423 | if following bytes go ?? |
| LDX#$02 | set the byte count |
| JMPLAB_E261 | copy a return message from AY to RAM |
| LAB_E423: ; $E423 | |
| CPX#$02 | . |
| JMPLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| ************************************************************************************ | |
| command $0C ?? | |
| LAB_E428: ; $E428 | |
| BCSLAB_E430 | if following bytes just exit |
| LDA#>LAB_0511 | set the return message pointer low byte |
| LDY#<LAB_0511 | set the return message pointer high byte |
| LDX#$07 | set the byte count |
| LAB_E430: ; $E430 | |
| RTS | |
| ************************************************************************************ | |
| command $0D, return the metered units | |
| LAB_E431: ; $E431 | |
| BCSLAB_E43F | if following bytes just exit |
| JSRLAB_F5B5 | . |
| LDA#>LAB_36 | set the return message pointer low byte |
| LDY#<LAB_36 | set the return message pointer high byte |
| LDX#$0A | set the byte count |
| JMPLAB_E261 | copy a return message from AY to RAM |
| LAB_E43F: ; $E43F | |
| RTS | |
| ************************************************************************************ | |
| command $0E, reload vector table(s) | |
| LAB_E440: ; $E440 | |
| CPX#$01 | compare the byte count with $01 |
| SEC | flag error |
| BNELAB_E457 | if not one byte go return the error |
| SEI | disable interrupts |
| LDALAB_0539 | get the one byte |
| BNELAB_E450 | if not $00 go copy both tables |
| JSRLAB_E12D | copy the vector table and values from LAB_E0DD |
| BRALAB_E453 | go return ok |
| LAB_E450: ; $E450 | |
| JSRLAB_E135 | copy the vector tables and values from from LAB_E0DD |
| and LAB_E11D | |
| LAB_E453: ; $E453 | |
| LDX#$00 | set the byte count |
| CLI | enable interrupts |
| CLC | flag ok |
| LAB_E457: ; $E457 | |
| RTS | |
| ************************************************************************************ | |
| command $0F, return the checksum of count bytes from address | |
| LAB_E458: ; $E458 | |
| CPX#$04 | compare the byte count with $04 |
| SEC | flag error and set carry for subtract |
| BNELAB_E4A1 | if not four bytes go return the error |
| LDA#$00 | clear A |
| SBCLAB_053B | subtract the count low byte |
| TAY | copy the -count low byte to Y |
| LDA#$00 | clear A |
| SBCLAB_053C | subtract the count high byte |
| TAX | copy the -count high byte to X |
| STYLAB_7A | save -count low byte |
| SEC | set carry for subtract |
| LDALAB_0539 | get the address low byte |
| SBCLAB_7A | add -count low byte |
| STALAB_7A | save the pointer low byte |
| LDALAB_053A | get the address low byte |
| SBC#$00 | subtract any carry |
| STALAB_7B | save the pointer high byte |
| LDA#$00 | clear A, checksum low byte |
| STALAB_063A | clear the checksum mid byte |
| STALAB_063B | clear the checksum high byte |
| LAB_E482: ; $E482 | |
| CLC | clear carry for add |
| ADC(LAB_7A),Y | add the byte to the checksum |
| BCCLAB_E48F | if no carry skip the mid byte increment |
| INCLAB_063A | else increment the checksum mid byte |
| BNELAB_E48F | if no rollover skip the high byte increment |
| INCLAB_063B | else increment the checksum high byte |
| LAB_E48F: ; $E48F | |
| INY | increment the -count low byte |
| BNELAB_E482 | loop if more to do |
| INCLAB_7B | increment the pointer high byte |
| INX | increment the -count high byte |
| BNELAB_E482 | loop if more to do |
| STALAB_0639 | save the checksum low byte |
| LDX#$03 | set the byte count |
| LDA#>LAB_0639 | set the return message pointer low byte |
| LDY#<LAB_0639 | set the return message pointer high byte |
| CLC | flag ok |
| LAB_E4A1: ; $E4A1 | |
| RTS | |
| ************************************************************************************ | |
| command $10, write memory bytes | |
| LAB_E4A2: ; $E4A2 | |
| CPX#$02 | compare the byte count with $02 |
| BCCLAB_E4BE | if < $02 bytes go return an error |
| LDALAB_0539 | get the pointer low byte |
| STALAB_7A | save the pointer low byte |
| LDALAB_053A | get the pointer high byte |
| STALAB_7B | save the pointer high byte |
| DEX | decrement the count |
| BRALAB_E4B9 | branch into the copy loop |
| LAB_E4B3: ; $E4B3 | |
| LDALAB_053B,Y | get a command buffer byte |
| STA(LAB_7A),Y | save it to the memory |
| INY | increment the index |
| LAB_E4B9: ; $E4B9 | |
| DEX | decrement the count |
| BNELAB_E4B3 | loop if more to do |
| CLC | flag ok |
| RTS | |
| LAB_E4BE: ; $E4BE | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| command $11, read memory bytes | |
| LAB_E4C0: ; $E4C0 | |
| CPX#$03 | compare the byte count with $03 |
| SEC | flag error |
| BNELAB_E4E2 | if not three bytes go return the error |
| LDALAB_0539 | get the pointer low byte |
| STALAB_7A | save the pointer low byte |
| LDALAB_053A | get the pointer high byte |
| STALAB_7B | save the pointer high byte |
| LDXLAB_053B | get the byte count |
| SEI | disable interrupts |
| LAB_E4D3: ; $E4D3 | |
| LDA(LAB_7A),Y | get a memory byte |
| STALAB_0639,Y | save it to the return buffer |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E4D3 | loop if more to do |
| CLI | enable interrupts |
| LDA#>LAB_0639 | set the return message pointer low byte |
| LDY#<LAB_0639 | set the return message pointer high byte |
| CLC | flag ok |
| LAB_E4E2: ; $E4E2 | |
| RTS | |
| ************************************************************************************ | |
| command $12, execute code from address | |
| LAB_E4E3: ; $E4E3 | |
| CPX#$02 | compare the byte count with $02 |
| BCCLAB_E4EC | if < $02 go return the error |
| DEX | decrement the byte count |
| DEX | decrement the byte count |
| JMP(LAB_0539) | jump to the address |
| LAB_E4EC: ; $E4EC | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| command $13 ?? | |
| LAB_E4EE: ; $E4EE | |
| CPX#$01 | compare the byte count with $01 |
| SEC | flag error |
| BNELAB_E500 | if not one byte go return the error |
| LDALAB_0539 | get the one byte |
| EOR#'*' | compare it with "*" |
| BNELAB_E500 | if not "*" go return the error |
| JSRLAB_F42F | . |
| LDX#$00 | . |
| CLC | flag ok |
| LAB_E500: ; $E500 | |
| RTS | |
| ************************************************************************************ | |
| command $14 ?? | |
| LAB_E501: ; $E501 | |
| STYLAB_7E | . |
| STYLAB_7D | . |
| STYLAB_0739 | clear the year/month |
| STYLAB_073A | clear the month/date |
| STYLAB_073B | clear the hours/minutes |
| STYLAB_073C | clear the minutes/seconds |
| STYLAB_073D | clear the seconds low bit |
| DEY | . |
| STYLAB_073E | set the year/month |
| STYLAB_073F | set the month/date |
| STYLAB_0740 | set the hours/minutes |
| STYLAB_0741 | set the minutes/seconds |
| STYLAB_0742 | set the seconds low bit |
| STYLAB_7C | . |
| CPX#$01 | compare the byte count with $01 |
| BCCLAB_E58D | . |
| BEQLAB_E588 | . |
| CPX#$08 | compare the byte count with $08 |
| BEQLAB_E55E | . |
| CPX#$0F | compare the byte count with $0F |
| BNELAB_E590 | . |
| LDXLAB_0541 | get the ?? year |
| LDALAB_0542 | get the ?? month |
| LDYLAB_0543 | get the ?? date |
| JSRLAB_F1D6 | compress YY:MM:DD in X:A:Y into AX |
| STXLAB_073E | save the year/month |
| STALAB_073F | save the month/date |
| LDXLAB_0544 | get the ?? hours |
| LDALAB_0545 | get the ?? minutes |
| LDYLAB_0546 | get the ?? seconds |
| JSRLAB_F1EB | compress HH:MM:SS in X:A:Y into AX and Cb |
| STXLAB_0740 | save the hours/minutes |
| STALAB_0741 | save the minutes/seconds |
| LDA#$00 | clear A |
| RORA | shift in the seconds low bit |
| STALAB_0742 | save the seconds low bit |
| LAB_E55E: ; $E55E | |
| LDXLAB_053A | get the ?? year |
| LDALAB_053B | get the ?? month |
| LDYLAB_053C | get the ?? date |
| JSRLAB_F1D6 | compress YY:MM:DD in X:A:Y into AX |
| STXLAB_0739 | save the year/month |
| STALAB_073A | save the month/date |
| LDXLAB_053D | get the ?? hours |
| LDALAB_053E | get the ?? minutes |
| LDYLAB_053F | get the ?? seconds |
| JSRLAB_F1EB | compress HH:MM:SS in X:A:Y into AX and Cb |
| STXLAB_073B | save the hours/minutes |
| STALAB_073C | save the minutes/seconds |
| LDA#$00 | clear A |
| RORA | shift in the seconds low bit |
| STALAB_073D | save the seconds low bit |
| LAB_E588: ; $E588 | |
| LDALAB_0539 | . |
| STALAB_7C | . |
| LAB_E58D: ; $E58D | |
| JMPLAB_F5D3 | . |
| LAB_E590: ; $E590 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| command $16, download ?? | |
| LAB_E592: ; $E592 | |
| BCSLAB_E5A5 | if following bytes just exit |
| BBS0,LAB_7D,LAB_E59E | . |
| LAB_E597: ; $E597 | |
| JSRLAB_F661 | fill the message buffer with records ?? |
| STXLAB_7E | save the message buffer index |
| COMLAB_7D | . |
| LAB_E59E: ; $E59E | |
| LDXLAB_7E | get the byte count |
| LDA#>LAB_0639 | set the return message pointer low byte |
| LDY#<LAB_0639 | set the return message pointer high byte |
| CLC | flag ok |
| LAB_E5A5: ; $E5A5 | |
| RTS | |
| ************************************************************************************ | |
| command $17 ?? | |
| LAB_E5A6: ; $E5A6 | |
| BCSLAB_E5A5 | if following bytes just exit |
| BBS0,LAB_7D,LAB_E597 | . |
| BRALAB_E59E | . |
| ************************************************************************************ | |
| command $18 ?? | |
| LAB_E5AD: ; $E5AD | |
| LDA#>LAB_0518 | set the return message pointer low byte |
| LDY#<LAB_0518 | set the return message pointer high byte |
| BCSLAB_E5B6 | if following bytes go ?? |
| LDX#$07 | set the byte count |
| RTS | |
| LAB_E5B6: ; $E5B6 | |
| CPX#$07 | . |
| JMPLAB_E278 | copy X bytes from LAB_0539 to AY if Zb = 1 ?? |
| ************************************************************************************ | |
| command $19 ?? | |
| LAB_E5BB: ; $E5BB | |
| LDA#>LAB_0402 | set the ?? pointer low byte |
| LDY#<LAB_0402 | set the ?? pointer high byte |
| BCSLAB_E5C6 | if following bytes go ?? |
| LDX#$FA | . |
| JMPLAB_E29C | search for null in X bytes at AY ?? |
| LAB_E5C6: ; $E5C6 | |
| CPX#$02 | compare the byte count with $02 |
| BCSLAB_E5D6 | if >= $02 go ?? |
| LDALAB_0539 | . |
| BNELAB_E5D6 | . |
| JSRLAB_E2B2 | copy the default date and time to LAB_0518 ?? |
| STXLAB_0402 | . |
| RTS | |
| LAB_E5D6: ; $E5D6 | |
| CPX#$FA | . |
| JSRLAB_E291 | copy X bytes from LAB_0539 to AY and null terminate ?? |
| ?? pointer in AY | |
| ?? byte count in X | |
| BCSLAB_E5E6 | . |
| JSRLAB_E2B5 | copy the current date and time to LAB_0518 ?? |
| LDA#>LAB_0518 | set the return message pointer low byte |
| LDY#<LAB_0518 | set the return message pointer high byte |
| LDX#$07 | set the byte count |
| LAB_E5E6: ; $E5E6 | |
| RTS | |
| ************************************************************************************ | |
| command $1A ?? | |
| LAB_E5E7: ; $E5E7 | |
| BCSLAB_E5F1 | if following bytes just exit |
| JMPLAB_F08C | . |
| ************************************************************************************ | |
| command $1B ?? | |
| LAB_E5EC: ; $E5EC | |
| BCSLAB_E5F1 | if following bytes just exit |
| JMPLAB_F0DD | . |
| LAB_E5F1: ; $E5F1 | |
| RTS | |
| ************************************************************************************ | |
| command $1E, return or set and dial the ringback number | |
| LAB_E5F2: ; $E5F2 | |
| BCSLAB_E5FD | if following bytes go dial the ringback number |
| LDA#>LAB_03B6 | set the ringback number buffer pointer low byte |
| LDY#<LAB_03B6 | set the ringback number buffer pointer high byte |
| LDX#$10 | . |
| JMPLAB_E29C | search for null in X bytes at AY ?? |
| LAB_E5FD: ; $E5FD | |
| BBC3,LAB_F0,LAB_E60D | test b3 port 2 data register, RS232/modem select |
| if RS232 selected just exit | |
| LDA#>LAB_03B6 | set the ringback number buffer pointer low byte |
| LDY#<LAB_03B6 | set the ringback number buffer pointer high byte |
| CPX#$10 | . |
| JSRLAB_E291 | copy X bytes from LAB_0539 to AY and null terminate ?? |
| ?? pointer in AY | |
| ?? byte count in X | |
| BCSLAB_E60D | if error just exit |
| SEB1,LAB_0A | set the command loop flag, dial an outgoing number |
| LAB_E60D: ; $E60D | |
| RTS | |
| ************************************************************************************ | |
| dial an outgoing number | |
| LAB_E60E: ; $E60E | |
| SEB6,LAB_F0 | set b6 port 2 data register, turn the modem off |
| JSRLAB_E65F | wait 10 seconds for carrier clear |
| BCSLAB_E64F | if carrier still present do error exit |
| LDA#$02 | set the retry count |
| LAB_E617: ; $E617 | |
| PHA | save the retry count |
| JSRLAB_E72E | release the line and wait 2 seconds |
| JSRLAB_E72B | set modem select, seize the line |
| JSRLAB_E733 | wait for 2 seconds |
| JSRLAB_E777 | disable the UART and set timer 2 to 10ms ?? |
| LDY#$00 | clear the ringback number index |
| LDX#$10 | set the digit count |
| LAB_E628: ; $E628 | |
| LDALAB_03B6,Y | get a character from the ringback number buffer |
| BEQLAB_E643 | if the end marker go wait for an answer |
| CMP#',' | compare the character with "," |
| BNELAB_E636 | if not "," go dial it |
| JSRLAB_E733 | else wait for 2 seconds |
| BRALAB_E63F | go get the next digit |
| LAB_E636: ; $E636 | |
| AND#$0F | mask the digit |
| BNELAB_E63C | if 1 to 9 go use it |
| ORA#$0A | else make any zero into ten |
| LAB_E63C: ; $E63C | |
| JSRLAB_E650 | dial an outgoing digit |
| LAB_E63F: ; $E63F | |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_E628 | loop if more to do |
| LAB_E643: ; $E643 | |
| JSRLAB_E752 | setup the UART and timer 2 and clear the Tx/Rx buffers ?? |
| JSRLAB_E6E4 | set originate mode, wait 30 seconds for two seconds of |
| new carrier and then ?? | |
| PLA | pull the retry count |
| BCCLAB_E64F | if done just exit |
| DECA | else decrement the retry count |
| BNELAB_E617 | if not counted out go try again |
| LAB_E64F: ; $E64F | |
| RTS | |
| ************************************************************************************ | |
| dial an outgoing digit | |
| LAB_E650: ; $E650 | |
| STALAB_1C | save the digit to dial |
| BBS2,LAB_FE,LAB_E659 | if timer 2 interrupt enabled skip enabling timer 2 |
| CLB3,LAB_FE | else clear the timer 2 request bit |
| SEB2,LAB_FE | and set the timer 2 enable bit |
| LAB_E659: ; $E659 | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| BBC7,LAB_1C,LAB_E659 | if stil dialing wait some more |
| RTS | |
| ************************************************************************************ | |
| wait 10 seconds for carrier clear, return Cb = 0 if no carrier | |
| LAB_E65F: ; $E65F | |
| LDM#$50,LAB_1A | set the 1/8th second countdown byte |
| LAB_E662: ; $E662 | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| CLC | flag no carrier |
| TSTLAB_5E | test the carrier detect |
| BEQLAB_E66E | if no carrier go return the status |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BNELAB_E662 | loop if not timed out |
| SEC | flag carrier |
| LAB_E66E: ; $E66E | |
| RTS | |
| ************************************************************************************ | |
| command $1F ?? | |
| LAB_E66F: ; $E66F | |
| BCSLAB_E673 | if following bytes just exit |
| SEB0,LAB_0A | set the command loop flag, return to the main loop |
| LAB_E673: ; $E673 | |
| RTS | |
| ************************************************************************************ | |
| command $15, $1C, $1D ?? | |
| LAB_E674: ; $E674 | |
| BITLAB_E678 | set Vb, return A as the type |
| SEC | flag error |
| LAB_E678: ; $E678 | |
| RTS | |
| ************************************************************************************ | |
| save the integer part of VThreshold * 2.277 in LAB_4F | |
| LAB_E679: ; $E679 | |
| LDALAB_20 | get the VThreshold value |
| STALAB_0F | save the multiplier low byte |
| LDM#$00,LAB_10 | clear the multiplier high byte |
| LDM#>$0247,LAB_0D | set the multiplicand low byte, 2.277 in 8.8 fixed point |
| LDM#<$0247,LAB_0E | set the multiplicand high byte, 2.277 in 8.8 fixed point |
| JSRLAB_E6B9 | mult LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX |
| STXLAB_4F | save the integer part of the result |
| RTS | |
| ************************************************************************************ | |
| read the A2D channels ?? | |
| LAB_E68C: ; $E68C | |
| LDX#$00 | set channel 0 |
| CLB6,LAB_F3 | clear b6 port 1 data register, turn vref on |
| LAB_E690: ; $E690 | |
| STXLAB_E9 | set the A2D control register and start the conversion |
| LAB_E692: ; $E692 | |
| BBC2,LAB_E9,LAB_E692 | read the A2D control register and loop if not ready |
| LDALAB_EA | read the A2D data register |
| STALAB_11,X | save the A2D channel byte |
| INX | increment the channel/index |
| CPX#$04 | compare it with max + 1 |
| BCCLAB_E690 | if <= max go get another A2D channel byte |
| SEB6,LAB_F3 | set b6 port 1 data register, turn vref off |
| SEC | set carry for subtract |
| LDALAB_11 | get the A2D channel 0 byte |
| SBCLAB_14 | subtract the A2D channel 3 byte |
| BCSLAB_E6AA | if >= o skip the two's complement |
| else < 0 so .. | |
| EOR#$FF | toggle the byte |
| INCA | and make 2's complement |
| LAB_E6AA: ; $E6AA | |
| STALAB_18 | save the ABS(A2D(0 - 3)) |
| SEC | set carry for subtract |
| LDALAB_12 | get the A2D channel 1 byte |
| SBCLAB_14 | subtract the A2D channel 3 byte |
| BCSLAB_E6B6 | if >= o skip the two's complement |
| else < 0 so .. | |
| EOR#$FF | toggle the byte |
| INCA | and make 2's complement |
| LAB_E6B6: ; $E6B6 | |
| STALAB_19 | save the ABS(A2D(1 - 3)) |
| RTS | |
| ************************************************************************************ | |
| multiply LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX | |
| LAB_E6B9: ; $E6B9 | |
| LDA#$00 | clear A |
| STALAB_0B | clear the partial low byte |
| STALAB_0C | clear the partial high byte |
| LDX#$10 | set the bit count |
| LAB_E6C1: ; $E6C1 | |
| ASLLAB_0B | shift the partial low byte |
| ROLLAB_0C | shift the partial high byte |
| ASLLAB_0F | shift the multiplier low byte |
| ROLLAB_10 | shift the multiplier high byte |
| BCCLAB_E6D8 | if top bit clear skip the add |
| CLC | clear carry for add |
| LDALAB_0B | get the partial low byte |
| ADCLAB_0D | add the multiplicand low byte |
| STALAB_0B | save the partial low byte |
| LDALAB_0C | get the partial high byte |
| ADCLAB_0E | add the multiplicand low byte |
| STALAB_0C | save the partial high byte |
| LAB_E6D8: ; $E6D8 | |
| DEX | decrement the bit count |
| BNELAB_E6C1 | loop if more to do |
| LDALAB_0B | get the result low byte |
| LDXLAB_0C | get the result high byte |
| STALAB_0F | save the result low byte |
| STXLAB_10 | save the result high byte |
| RTS | |
| ************************************************************************************ | |
| set originate mode, wait 30 seconds for two seconds of new carrier and then ?? | |
| LAB_E6E4: ; $E6E4 | |
| LDA#$F0 | set the 1/8th second count to 30 seconds |
| SEB5,LAB_F0 | set b5 port 2 data register, set originate mode |
| JSRLAB_E6F4 | wait A 1/8ths of a second for two seconds of new carrier |
| BCSLAB_E6EF | if error just exit |
| CLB6,LAB_F0 | clear b6 port 2 data register, turn the modem off |
| LAB_E6EF: ; $E6EF | |
| RTS | |
| ************************************************************************************ | |
| wait 15 seconds for two seconds of new carrier | |
| LAB_E6F0: ; $E6F0 | |
| LDA#$78 | set the 1/8th second count to 15 seconds |
| CLB5,LAB_F0 | clear b5 port 2 data register, set answer mode |
| ************************************************************************************ | |
| wait A 1/8ths of a second for two seconds of new carrier | |
| this routine waits for two seconds for the carrier to be dropped before waiting A | |
| 1/8ths of a second for two seconds of new carrier | |
| LAB_E6F4: ; $E6F4 | |
| SEB6,LAB_F0 | set b6 port 2 data register, turn the modem on |
| JSRLAB_E72B | set modem select, seize the line |
| make sure there is no carrier | |
| LDM#$10,LAB_1A | set the 1/8th second countdown byte, 2 seconds |
| LAB_E6FC: ; $E6FC | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BEQLAB_E729 | if timed out go do error exit |
| BBC4,LAB_F0,LAB_E6FC | test b4 port 2 data register, carrier detect |
| if carrier detected just loop | |
| no carrier was detected | |
| LDM#$00,LAB_5E | clear the carrier detect |
| BBS5,LAB_F0,LAB_E717 | test b5 port 2 data register, originate/answer |
| if originate go wait for the new carrier | |
| is answer mode so ?? | |
| JSRLAB_E733 | wait for 2 seconds |
| SEB7,LAB_F3 | ?? port 1 data register |
| CLB6,LAB_F0 | clear b6 port 2 data register, turn the modem on |
| JSRLAB_E738 | wait for 3 seconds |
| CLB7,LAB_F3 | ?? port 1 data register |
| wait for the carrier to be detected | |
| LAB_E717: ; $E717 | |
| STALAB_1A | save the 1/8th second countdown byte |
| LAB_E719: ; $E719 | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BEQLAB_E729 | if counted out go do error return |
| TSTLAB_5E | test the carrier detect |
| BEQLAB_E719 | if no carrier go return an error |
| LDALAB_07 | get the ?? buffer read index |
| STALAB_06 | save the ?? buffer write index |
| clear the buffer | |
| CLC | flag ok |
| RTS | |
| LAB_E729: ; $E729 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| set modem select, seize the line | |
| LAB_E72B: ; $E72B | |
| SEB3,LAB_F0 | set b3 port 2 data register, modem select, line seize |
| RTS | |
| ************************************************************************************ | |
| release the line and wait 2 seconds. if the line is already released just exit | |
| LAB_E72E: ; $E72E | |
| BBC3,LAB_F0,LAB_E746 | test b3 port 2 data register, RS232/modem select |
| if RS232 selected just exit | |
| CLB3,LAB_F0 | clear b3 port 2 data register, RS232 select, line release |
| ************************************************************************************ | |
| wait for 2 seconds | |
| LAB_E733: ; $E733 | |
| LDM#$10,LAB_1A | set the 1/8th second countdown byte |
| BRALAB_E740 | wait for LAB_1A 1/8ths of a second |
| ************************************************************************************ | |
| wait for 3 seconds | |
| LAB_E738: ; $E738 | |
| LDM#$18,LAB_1A | set the 1/8th second countdown byte |
| BRALAB_E740 | wait for LAB_1A 1/8ths of a second |
| ************************************************************************************ | |
| wait for 1/2 a second | |
| LAB_E73D: ; $E73D | |
| LDM#$04,LAB_1A | set the 1/8th second countdown byte |
| ************************************************************************************ | |
| wait for LAB_1A 1/8ths of a second | |
| LAB_E740: ; $E740 | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BNELAB_E740 | loop if not counted out |
| LAB_E746: ; $E746 | |
| RTS | |
| ************************************************************************************ | |
| setup the UART and timer 2 and clear the Tx/Rx buffers ?? | |
| LAB_E747: ; $E747 | |
| LDALAB_023D | get the BAUD rate generator value |
| LDXLAB_023E | get the timer 2 value |
| LDYLAB_023F | get the prescaller 2 value |
| BRALAB_E75B | go setup the UART and timer |
| ************************************************************************************ | |
| setup the UART and timer 2 and clear the Tx/Rx buffers ?? | |
| LAB_E752: ; $E752 | |
| LDALAB_023A | get the BAUD rate generator value |
| LDXLAB_023B | get the timer 2 value |
| LDYLAB_023C | get the prescaller 2 value |
| LAB_E75B: ; $E75B | |
| CLB2,LAB_FE | clear the timer 2 interrupt enable bit |
| STALAB_FB | set the BAUD rate generator |
| STXLAB_7F | save the timer 2 value |
| STXLAB_DF | set timer 2 |
| STYLAB_80 | save the prescaller 2 value |
| STYLAB_DE | set prescaller 2 |
| LDM#$D1,LAB_E6 | set the UART control register |
| bit function | |
| --- -------- | |
| 7 1 = Rx enabled | |
| 6 1 = Tx enabled | |
| 5 0 = unused | |
| 4 1 = Rx interrupt enabled | |
| 3 0 = Xin/8 | |
| 2 0 = even parity | |
| 1 0 = parity disabled | |
| 0 1 = 8 bit | |
| LDA#$00 | clear A |
| STALAB_E5 | write to the UART Rx buffer register |
| clear the error bits | |
| STALAB_06 | clear the ?? buffer write index |
| STALAB_07 | clear the ?? buffer read index |
| STALAB_08 | clear the Tx buffer write index |
| STALAB_09 | clear the Tx buffer read index |
| RTS | |
| ************************************************************************************ | |
| disable the UART and set timer 2 to 10ms ?? | |
| LAB_E777: ; $E777 | |
| CLB2,LAB_FE | clear 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_DE | set prescaller 2 |
| sets (1/(71+1)) * (1/16) Hz | |
| this will be 6400 Hz with a 7.3728MHz XTAL | |
| LDM#$3F,LAB_DF | set timer 2 to 10ms |
| LDM#$00,LAB_1D | clear the pulse count |
| LDM#$FF,LAB_1C | clear the digit to dial |
| RTS | |
| ************************************************************************************ | |
| wait for timer 2 ?? | |
| LAB_E789: ; $E789 | |
| JSR\LAB_FFEE | swap the stack pointers and stop the internal clock |
| BBS2,LAB_FE,LAB_E789 | if timer 2 interrupt enabled wait some more |
| RTS | |
| ************************************************************************************ | |
| set the default dates and times | |
| LAB_E78F: ; $E78F | |
| LDX#$06 | set the count/index |
| LAB_E791: ; $E791 | |
| LDALAB_E90C,X | get the max + 1 for date and time |
| STALAB_5F,X | save the max + 1 for date and time |
| LDALAB_E913,X | get a default date and time byte |
| STALAB_66,X | save a current date/time byte |
| STALAB_050A,X | save a ?? date/time byte |
| STALAB_0511,X | save a ?? date/time byte |
| STALAB_0518,X | save a ?? date/time byte |
| LDA#$00 | clear A |
| STALAB_04FC,X | clear a GMT/BST change date/time byte |
| STALAB_0503,X | clear a BST/GMT new date/time byte |
| DEX | decrement the count/index |
| BPLLAB_E791 | loop if more to do |
| STALAB_6D | clear the 1/8ths of seconds |
| RTS | |
| ************************************************************************************ | |
| test the carrier and set the carrier detect byte | |
| LAB_E7B2: ; $E7B2 | |
| BBS4,LAB_F0,LAB_E7B9 | test b4 port 2 data register, carrier detect |
| if no carrier detected go decrement the carrier detect | |
| LDM#$08,LAB_5E | set the carrier detect |
| RTS | |
| LAB_E7B9: ; $E7B9 | |
| TSTLAB_5E | test the carrier detect |
| BEQLAB_E7BF | if already zero skip the decrement |
| DECLAB_5E | decrement the carrier detect |
| LAB_E7BF: ; $E7BF | |
| RTS | |
| ************************************************************************************ | |
| INT2, 1/8th second interrupt | |
| LAB_E7C0: ; $E7C0 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| CLB3,LAB_FF | clear INT2 request bit |
| LDX#$00 | clear the index |
| LAB_E7C9: ; $E7C9 | |
| INCLAB_6E,X | . |
| BNELAB_E7D8 | . |
| INX | . |
| CPX#$03 | . |
| BCCLAB_E7C9 | . |
| DECLAB_6E | . |
| DECLAB_6F | . |
| DECLAB_70 | . |
| LAB_E7D8: ; $E7D8 | |
| BBS0,LAB_FE,LAB_E822 | if timer 1 interrupt enabled skip ?? |
| JSRLAB_E68C | read the A2D channels ?? |
| LDALAB_11 | get the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_15 | . |
| BEQLAB_E7F4 | . |
| BCSLAB_E7EE | . |
| else < 0 so .. | |
| EOR#$FF | toggle the byte |
| INCA | and make 2's complement |
| DECLAB_15 | . |
| BRALAB_E7F0 | . |
| LAB_E7EE: ; $E7EE | |
| INCLAB_15 | . |
| LAB_E7F0: ; $E7F0 | |
| CMP#$05 | . |
| BCSLAB_E81B | . |
| LAB_E7F4: ; $E7F4 | |
| JSRLAB_EA67 | . |
| EORLAB_49 | . |
| AND#$E0 | . |
| BNELAB_E81B | . |
| BBC2,LAB_1F,LAB_E822 | . |
| BBC2,LAB_5A,LAB_E822 | . |
| SEC | . |
| BBC0,LAB_1F,LAB_E80D | . |
| LDALAB_13 | get the A2D channel 2 byte |
| SBCLAB_14 | subtract the A2D channel 3 byte |
| BRALAB_E811 | . |
| LAB_E80D: ; $E80D | |
| LDALAB_14 | get the A2D channel 3 byte |
| SBCLAB_13 | subtract the A2D channel 2 byte |
| LAB_E811: ; $E811 | |
| BCCLAB_E816 | . |
| CMPLAB_0238 | . |
| LAB_E816: ; $E816 | |
| RORA | . |
| EORLAB_44 | . |
| BPLLAB_E822 | . |
| LAB_E81B: ; $E81B | |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| SEB0,LAB_FE | set the timer 1 interrupt enable bit |
| LDM#$10,LAB_4C | . |
| LAB_E822: ; $E822 | |
| TSTLAB_4C | . |
| BEQLAB_E828 | . |
| DECLAB_4C | . |
| LAB_E828: ; $E828 | |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BEQLAB_E82E | if counted out skip the decrement |
| DECLAB_1A | decrement the 1/8th second countdown byte |
| LAB_E82E: ; $E82E | |
| JSRLAB_E7B2 | test the carrier and set the carrier detect byte |
| JSRLAB_E89C | increment the date/time in 1/8ths of seconds |
| BCCLAB_E84C | if the seconds didn't change just exit |
| else the seconds incremented | |
| TSTLAB_1B | test the seconds countdown |
| BEQLAB_E83C | if already at zero skip the decrement |
| DECLAB_1B | decrement the seconds countdown |
| LAB_E83C: ; $E83C | |
| TSTLAB_4D | test the seconds countdown word low byte |
| BNELAB_E846 | if not zero go decrement it |
| TSTLAB_4E | test the seconds countdown word high byte |
| BEQLAB_E848 | if zero word is counted out so skip the decrement |
| DECLAB_4E | else decrement the seconds countdown word high byte |
| LAB_E846: ; $E846 | |
| DECLAB_4D | decrement the seconds countdown word low byte |
| LAB_E848: ; $E848 | |
| CLI | enable interrupts |
| JSRLAB_E876 | save VThreshold * 2.277 * A2D channel 3 in LAB_50 ?? |
| LAB_E84C: ; $E84C | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| INT2, 1/8th second interrupt | |
| LAB_E852: ; $E852 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| CLB3,LAB_FF | clear INT2 request bit |
| TSTLAB_1A | test the 1/8th second countdown byte |
| BEQLAB_E85F | if already zero skip the decrement |
| DECLAB_1A | else decrement the 1/8th second countdown byte |
| LAB_E85F: ; $E85F | |
| JSRLAB_E7B2 | test the carrier and set the carrier detect byte |
| JSRLAB_E89C | increment the date/time in 1/8ths of seconds |
| BCCLAB_E870 | if the seconds didn't change just exit |
| JSRLAB_E68C | read the A2D channels ?? |
| TSTLAB_1B | test the seconds countdown |
| BEQLAB_E870 | if already at zero skip the decrement |
| DECLAB_1B | else decrement the seconds countdown |
| LAB_E870: ; $E870 | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| save VThreshold * 2.277 * A2D channel 3 in LAB_50 ?? | |
| LAB_E876: ; $E876 | |
| LDX#$00 | clear the index |
| LAB_E878: ; $E878 | |
| LDALAB_0B,X | read a math area byte |
| PHA | save it |
| INX | increment the index |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_E878 | loop if more to do |
| LDALAB_4F | get the integer part of VThreshold * 2.277 |
| STALAB_0F | save the multiplier low byte |
| LDM#$00,LAB_10 | clear the multiplier low byte |
| LDALAB_14 | get the A2D channel 3 byte |
| STALAB_0D | save the multiplicand low byte |
| LDM#$00,LAB_0E | claer the multiplicand high byte |
| JSRLAB_E6B9 | mult LAB_0F/10 by LAB_0D/0E, result in LAB_0F/10 and AX |
| STXLAB_50 | . |
| LDX#$06 | set the count/index |
| LAB_E895: ; $E895 | |
| PLA | pull a math area byte |
| DEX | decrement the count/index |
| STALAB_0B,X | restore a math area byte |
| BNELAB_E895 | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| increment the date/time in 1/8ths of seconds | |
| LAB_E89C: ; $E89C | |
| LDXLAB_6D | get the 1/8ths of seconds |
| INX | increment it |
| CPX#$08 | compare it with max + 1 |
| BCCLAB_E8A5 | if < max + 1 use it |
| LDX#$00 | else wrap the 1/8ths of seconds to zero |
| LAB_E8A5: ; $E8A5 | |
| STXLAB_6D | save the 1/8ths of seconds |
| LDALAB_E903,X | get the 1/8ths of seconds expressed in 100ths |
| STALAB_6C | save the 1/100ths of seconds |
| BCCLAB_E902 | if the 1/8ths of seconds didn't wrap just exit |
| increment the time/date | |
| LDXLAB_67 | get the current time month |
| CPX#$02 | compare it with february |
| BNELAB_E8BB | if not february skip the leap year adjust |
| LDALAB_66 | get the current time year |
| AND#$03 | effectively do year MOD 4 |
| BNELAB_E8BB | if not a leap year skip the leap year adjust |
| TAX | else clear the index for a leap year february |
| LAB_E8BB: ; $E8BB | |
| LDALAB_E91A,X | get the max + 1 days in the month |
| STALAB_61 | save the max + 1 days in the month |
| LDX#$06 | set the index to seconds + 1 |
| LAB_E8C2: ; $E8C2 | |
| DEX | decrement the index |
| LDALAB_66,X | get a current date/time byte |
| INCA | increment it |
| CMPLAB_5F,X | compare it with the max + 1 for date and time |
| BCCLAB_E8CD | if less skip the default byte get |
| LDALAB_E913,X | else get a default date and time byte |
| LAB_E8CD: ; $E8CD | |
| STALAB_66,X | save a current date/time byte |
| BCCLAB_E8D4 | if byte is < max + 1 exit the loop |
| TXA | else copy the index |
| BNELAB_E8C2 | if not at years go do another date/time byte |
| now check for BST/GMT time change | |
| LAB_E8D4: ; $E8D4 | |
| LDX#$05 | set the index to seconds |
| LAB_E8D6: ; $E8D6 | |
| LDALAB_04FC,X | get a BST/GMT change date/time byte |
| EORLAB_66,X | compare it with a current date/time byte |
| BNELAB_E901 | if not the same go do changed exit |
| DEX | decrement the index |
| BPLLAB_E8D6 | loop if more to do |
| the current date/time matches the change date/time so get the new date/time | |
| INX | clear X |
| LAB_E8E1: ; $E8E1 | |
| LDALAB_0503,X | get a BST/GMT new date/time byte |
| STALAB_66,X | save a current date/time byte |
| LDA#$00 | clear A |
| STALAB_04FC,X | clear a BST/GMT change date/time byte |
| INX | increment the index |
| CPX#$07 | compare with max + 1 |
| BCCLAB_E8E1 | loop if more to do |
| ************************************************************************************ | |
| set 1/8ths of seconds from 100ths | |
| LAB_E8F0: ; $E8F0 | |
| LDALAB_6C | get the 1/100ths of seconds |
| LDX#$08 | set index to max + 1 |
| LAB_E8F4: ; $E8F4 | |
| DEX | decrement the index |
| CMPLAB_E903,X | compare it with the 1/8ths of seconds expressed in 100ths |
| BCCLAB_E8F4 | if less go try another value |
| LDALAB_E903,X | get the 1/8ths of seconds expressed in 100ths |
| STALAB_6C | save the 1/100ths of seconds |
| STXLAB_6D | save the 1/8ths of seconds |
| LAB_E901: ; $E901 | |
| SEC | flag time changed |
| LAB_E902: ; $E902 | |
| RTS | |
| ************************************************************************************ | |
| 1/8ths of seconds expressed in 100ths | |
| LAB_E903: ; $E903 | |
| .BYTE$00 | .00 |
| .BYTE$0C | .12 |
| .BYTE$19 | .25 |
| .BYTE$25 | .37 |
| .BYTE$32 | .50 |
| .BYTE$3E | .62 |
| .BYTE$4B | .75 |
| .BYTE$57 | .87 |
| ************************************************************************************ | |
| unused ?? | |
| .BYTE$64 | |
| ************************************************************************************ | |
| max + 1 for date and time | |
| LAB_E90C: ; $E90C | |
| .BYTE2099-1980+1 | max year + 1 |
| .BYTE12+1 | max month + 1 |
| .BYTE31+1 | max date +1 |
| .BYTE23+1 | max hour + 1 |
| .BYTE59+1 | max minute + 1 |
| .BYTE59+1 | max second + 1 |
| .BYTE99+1 | max part second + 1 |
| the interrupt is every 1/100ths of a second ?? | |
| ************************************************************************************ | |
| default date and time | |
| LAB_E913: ; $E913 | |
| .BYTE$00 | 1980 |
| .BYTE$01 | january |
| .BYTE$01 | 01 |
| .BYTE$00,$00,$00,$00 | 00:00:00.00 |
| ************************************************************************************ | |
| max + 1 days in each month | |
| LAB_E91A: ; $E91A | |
| .BYTE29+1 | feb leap year |
| .BYTE31+1 | jan |
| .BYTE28+1 | feb |
| .BYTE31+1 | mar |
| .BYTE30+1 | apr |
| .BYTE31+1 | may |
| .BYTE30+1 | jun |
| .BYTE31+1 | jul |
| .BYTE31+1 | aug |
| .BYTE30+1 | sep |
| .BYTE31+1 | oct |
| .BYTE30+1 | nov |
| .BYTE31+1 | dec |
| ************************************************************************************ | |
| RI or INT1 | |
| LAB_E927: ; $E927 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| BBC1,LAB_FF,LAB_E92F | if no INT1 request skip the INT1 enable clear |
| CLB0,LAB_FF | clear the INT1 enable bit |
| LAB_E92F: ; $E92F | |
| BBC0,LAB_E7,LAB_E940 | test b0 UART status register |
| if no Rx interrupt just exit | |
| BBS3,LAB_E7,LAB_E93E | test b3 UART status register |
| if framing error just the clear error bits and exit | |
| LDALAB_E5 | read the UART Rx buffer register |
| LDXLAB_06 | get the ?? buffer write index |
| STALAB_0280,X | save a character to the ?? buffer |
| INCLAB_06 | increment the ?? buffer write index |
| LAB_E93E: ; $E93E | |
| STALAB_E5 | write to the UART Rx buffer register |
| clear the error bits | |
| LAB_E940: ; $E940 | |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| handle timer 1 | |
| LAB_E944: ; $E944 | |
| TSTLAB_4B | test the timer 1 countdown byte |
| BEQLAB_E94A | if already zero skip the decrement |
| DECLAB_4B | else decrement the timer 1 countdown byte |
| LAB_E94A: ; $E94A | |
| JSRLAB_E68C | read the A2D channels ?? |
| LDALAB_11 | get the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_15 | . |
| BCSLAB_E957 | if >= o skip the two's complement |
| else < 0 so .. | |
| EOR#$FF | toggle the byte |
| INCA | and make 2's complement |
| LAB_E957: ; $E957 | |
| STALAB_16 | . |
| BBC2,LAB_5A,LAB_E95F | . |
| JSRLAB_EB9C | . |
| LAB_E95F: ; $E95F | |
| BBC3,LAB_5A,LAB_E965 | . |
| JSRLAB_EB7A | read the MT8870 tone decoder and ?? |
| LAB_E965: ; $E965 | |
| BBC4,LAB_5A,LAB_E96B | . |
| JSRLAB_EB63 | . |
| LAB_E96B: ; $E96B | |
| BBC1,LAB_5A,LAB_E971 | . |
| JSRLAB_EB15 | . |
| LAB_E971: ; $E971 | |
| BBC7,LAB_5A,LAB_E977 | . |
| JSRLAB_EA10 | . |
| LAB_E977: ; $E977 | |
| BBC5,LAB_5A,LAB_E97D | . |
| JSRLAB_EA9B | . |
| LAB_E97D: ; $E97D | |
| BBC6,LAB_5A,LAB_E983 | . |
| JSRLAB_EA2E | . |
| LAB_E983: ; $E983 | |
| LDALAB_11 | get the A2D channel 0 byte |
| STALAB_15 | . |
| RTS | |
| ************************************************************************************ | |
| do UART Tx and digit dial | |
| LAB_E988: ; $E988 | |
| BBC4,LAB_E6,LAB_E9AD | test b4 UART control register, Rx interrupt enable |
| if Rx interrupt disabled skip the UART handle | |
| LDXLAB_09 | get the Tx buffer read index |
| CPXLAB_08 | compare it with the Tx buffer write index |
| BEQLAB_E9A9 | if no bytes waiting go clear the timer 2 interrupt |
| enable and exit | |
| LDALAB_0380,X | read a Tx buffer byte |
| STALAB_E4 | save it to the UART Tx shift register |
| LDALAB_80 | get the prescaller 2 value |
| STALAB_DE | set prescaller 2 |
| LDALAB_7F | get the timer 2 value |
| STALAB_DF | set timer 2 |
| INX | increment the TX buffer read index |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_E9A5 | if less than max + 1 just use it |
| LDX#$00 | else wrap it to zero |
| LAB_E9A5: ; $E9A5 | |
| STXLAB_09 | save the Tx buffer read index |
| BRALAB_E9D0 | and exit |
| LAB_E9A9: ; $E9A9 | |
| CLB2,LAB_FE | clear the timer 2 interrupt enable bit |
| BRALAB_E9D0 | and exit |
| dial a digit. the digit is in LAB_1C and when the digit is first set the pulse count | |
| in LAB_1D is zero. In this case the line is opened and a short pulse time is saved to | |
| the pulse count. | |
| if the pulse count is not zero it is decremented and a check is made to see if it has | |
| reached four. if it has the line is closed. if the pulse count reaches zero the digit | |
| to dial is decremented. | |
| the digit to dial is checked and if that is not now zero another short pulse is set | |
| and the cycle continues, otherwise a final long pulse is set. | |
| LAB_E9AD: ; $E9AD | |
| LDALAB_1D | get the pulse count |
| BEQLAB_E9B7 | if zero go check if there is a digit to dial |
| DECLAB_1D | else decrement the pulse count |
| BNELAB_E9C8 | if not zero go check for pulse count |
| DECLAB_1C | decrement the digit to dial |
| LAB_E9B7: ; $E9B7 | |
| LDALAB_1C | get the digit to dial |
| BMILAB_E9D0 | if done just exit |
| BEQLAB_E9C2 | if zero go do a long pulse |
| CLB3,LAB_F0 | clear b3 port 2 data register, RS232 select, line release |
| LDA#$0A | set short pulse count |
| .BYTE$2C | makes the next line BIT $xxxx |
| LAB_E9C2: ; $E9C2 | |
| LDA#$28 | set long pulse count |
| STALAB_1D | save the pulse count |
| BRALAB_E9D0 | and exit |
| LAB_E9C8: ; $E9C8 | |
| LDALAB_1D | get the pulse count |
| CMP#$04 | compare it with $04 |
| BNELAB_E9D0 | if not $04 skip the line seize |
| SEB3,LAB_F0 | set b3 port 2 data register, modem select, line seize |
| LAB_E9D0: ; $E9D0 | |
| RTS | |
| ************************************************************************************ | |
| timer 1 or timer 2 | |
| LAB_E9D1: ; $E9D1 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| BBC0,LAB_FE,LAB_E9E1 | if timer 1 interrupts not enabled go handle timer 2 |
| BBC1,LAB_FE,LAB_E9E1 | if timer 1 interrupt request clear go handle timer 2 |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| JSRLAB_E944 | handle timer 1 |
| LAB_E9E1: ; $E9E1 | |
| BBC2,LAB_FE,LAB_E9EC | if timer 2 interrupts not enabled just exit |
| BBC3,LAB_FE,LAB_E9EC | if timer 2 interrupt request not set just exit |
| CLB3,LAB_FE | clear the timer 2 interrupt request bit |
| JSRLAB_E988 | do UART Tx and digit dial |
| LAB_E9EC: ; $E9EC | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| timer 1 or timer 2 | |
| LAB_E9F2: ; $E9F2 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| BBC0,LAB_FE,LAB_E9FF | if timer 1 interrupts not enabled go handle timer 2 |
| BBC1,LAB_FE,LAB_E9FF | if timer 1 interrupt request clear go handle timer 2 |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| LAB_E9FF: ; $E9FF | |
| BBC2,LAB_FE,LAB_EA0A | if timer 2 interrupts not enabled just exit |
| BBC3,LAB_FE,LAB_EA0A | if timer 2 interrupt request not set just exit |
| CLB3,LAB_FE | clear the timer 2 interrupt request bit |
| JSRLAB_E988 | do UART Tx and digit dial |
| LAB_EA0A: ; $EA0A | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| ?? | |
| LAB_EA10: ; $EA10 | |
| LDALAB_16 | . |
| LSRA | . |
| LSRA | . |
| LSRA | . |
| CLC | clear carry for add |
| ADCLAB_45 | . |
| BCSLAB_EA1C | . |
| BVCLAB_EA20 | . |
| LAB_EA1C: ; $EA1C | |
| SEB2,LAB_49 | . |
| LDA#$FF | . |
| LAB_EA20: ; $EA20 | |
| SEC | set carry for subtract |
| SBC#$01 | . |
| BCCLAB_EA27 | . |
| BVCLAB_EA2B | . |
| LAB_EA27: ; $EA27 | |
| CLB2,LAB_49 | . |
| LDA#$00 | . |
| LAB_EA2B: ; $EA2B | |
| STALAB_45 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EA2E: ; $EA2E | |
| BBS5,LAB_49,LAB_EA61 | . |
| LDX#$00 | . |
| LDALAB_11 | get the A2D channel 0 byte |
| CMPLAB_14 | compare it with the A2D channel 3 byte |
| BCSLAB_EA3A | . |
| DEX | . |
| LAB_EA3A: ; $EA3A | |
| LDALAB_18 | get the ABS(A2D(0 - 3)) |
| CMP#$02 | . |
| BCCLAB_EA60 | . |
| TXA | . |
| EORLAB_48 | . |
| EORLAB_49 | . |
| BBC3,A,LAB_EA59 | . |
| LDALAB_46 | . |
| INCA | . |
| CMPLAB_0232 | . |
| BCCLAB_EA5E | . |
| LDALAB_49 | . |
| EOR#$08 | . |
| STALAB_49 | . |
| LDA#$00 | . |
| BRALAB_EA5E | . |
| LAB_EA59: ; $EA59 | |
| LDALAB_46 | . |
| BEQLAB_EA60 | . |
| DECA | . |
| LAB_EA5E: ; $EA5E | |
| STALAB_46 | . |
| LAB_EA60: ; $EA60 | |
| RTS | |
| LAB_EA61: ; $EA61 | |
| CLB3,LAB_49 | . |
| LDM#$00,LAB_46 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EA67: ; $EA67 | |
| LDALAB_18 | get the ABS(A2D(0 - 3)) |
| CMPLAB_50 | . |
| BCSLAB_EA98 | . |
| BBC0,LAB_25,LAB_EA86 | . |
| LSRA | . |
| CLC | clear carry for add |
| ADCLAB_19 | add the ABS(A2D(1 - 3)) |
| CMPLAB_50 | . |
| BCCLAB_EA86 | . |
| BBC6,LAB_25,LAB_EA98 | . |
| SBCLAB_18 | subtract the ABS(A2D(0 - 3)) |
| BCCLAB_EA98 | . |
| CMPLAB_50 | . |
| BCCLAB_EA98 | . |
| LDA#$20 | . |
| RTS | |
| LAB_EA86: ; $EA86 | |
| BBC0,LAB_26,LAB_EA92 | . |
| LDALAB_19 | get the ABS(A2D(1 - 3)) |
| ASLA | . |
| BCSLAB_EA92 | . |
| CMPLAB_50 | . |
| BCCLAB_EA95 | . |
| LAB_EA92: ; $EA92 | |
| LDA#$80 | . |
| RTS | |
| LAB_EA95: ; $EA95 | |
| LDA#$40 | . |
| RTS | |
| LAB_EA98: ; $EA98 | |
| LDA#$00 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EA9B: ; $EA9B | |
| JSRLAB_EA67 | . |
| TAX | . |
| EORLAB_49 | . |
| AND#$E0 | . |
| BEQLAB_EB0A | . |
| TXA | . |
| BBS7,A,LAB_EABC | . |
| BBS6,A,LAB_EAFB | . |
| BBS5,A,LAB_EAD4 | . |
| INCLAB_41 | . |
| LDALAB_41 | . |
| CMPLAB_2D | . |
| BCCLAB_EB14 | . |
| CLB7,LAB_49 | . |
| CLB6,LAB_49 | . |
| CLB5,LAB_49 | . |
| BRALAB_EB0A | . |
| LAB_EABC: ; $EABC | |
| INCLAB_40 | . |
| LDALAB_40 | . |
| CMPLAB_2D | . |
| BCCLAB_EB14 | . |
| SEB7,LAB_49 | . |
| CLB6,LAB_49 | . |
| CLB5,LAB_49 | . |
| BBC7,LAB_27,LAB_EB0A | . |
| BBC1,LAB_EE,LAB_EB0A | . |
| SEB0,LAB_49 | . |
| BRALAB_EB0A | . |
| LAB_EAD4: ; $EAD4 | |
| BBC7,LAB_49,LAB_EAEB | . |
| INCLAB_41 | . |
| LDALAB_41 | . |
| CMPLAB_2D | . |
| BCCLAB_EAEB | . |
| CLB7,LAB_49 | . |
| CLB6,LAB_49 | . |
| LDA#$00 | clear A |
| STALAB_40 | . |
| STALAB_41 | . |
| STALAB_42 | . |
| LAB_EAEB: ; $EAEB | |
| INCLAB_43 | . |
| LDALAB_43 | . |
| CMPLAB_2D | . |
| BCCLAB_EB14 | . |
| SEB5,LAB_49 | . |
| CLB7,LAB_49 | . |
| CLB6,LAB_49 | . |
| BRALAB_EB0A | . |
| LAB_EAFB: ; $EAFB | |
| INCLAB_42 | . |
| LDALAB_42 | . |
| CMPLAB_0233 | . |
| BCCLAB_EB14 | . |
| SEB6,LAB_49 | . |
| CLB7,LAB_49 | . |
| CLB5,LAB_49 | . |
| LAB_EB0A: ; $EB0A | |
| LDA#$00 | clear A |
| STALAB_40 | . |
| STALAB_41 | . |
| STALAB_42 | . |
| STALAB_43 | . |
| LAB_EB14: ; $EB14 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EB15: ; $EB15 | |
| JSRLAB_EB20 | . |
| BCCLAB_EB1F | . |
| DECA | . |
| BNELAB_EB1F | . |
| SEB1,LAB_49 | . |
| LAB_EB1F: ; $EB1F | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EB20: ; $EB20 | |
| LDALAB_18 | get the ABS(A2D(0 - 3)) |
| CMPLAB_50 | . |
| LDALAB_51 | . |
| TAX | . |
| AND#$7F | . |
| BCSLAB_EB51 | . |
| BEQLAB_EB31 | . |
| DECLAB_51 | . |
| CLC | . |
| RTS | |
| LAB_EB31: ; $EB31 | |
| TXA | . |
| BPLLAB_EB41 | . |
| TSTLAB_52 | . |
| BEQLAB_EB3A | . |
| INCLAB_53 | . |
| LAB_EB3A: ; $EB3A | |
| LDM#$14,LAB_52 | . |
| CLB7,LAB_51 | . |
| CLC | . |
| RTS | |
| LAB_EB41: ; $EB41 | |
| CLC | . |
| TSTLAB_52 | . |
| BEQLAB_EB50 | . |
| DECLAB_52 | . |
| BNELAB_EB50 | . |
| LDALAB_53 | . |
| LDM#$00,LAB_53 | . |
| SEC | . |
| LAB_EB50: ; $EB50 | |
| RTS | |
| LAB_EB51: ; $EB51 | |
| INCA | . |
| CMPLAB_22 | . |
| BCSLAB_EB59 | . |
| INCLAB_51 | . |
| RTS | |
| LAB_EB59: ; $EB59 | |
| INX | . |
| BMILAB_EB61 | . |
| LDM#$14,LAB_52 | . |
| SEB7,LAB_51 | . |
| LAB_EB61: ; $EB61 | |
| CLC | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EB63: ; $EB63 | |
| JSRLAB_EB20 | . |
| BCCLAB_EB79 | . |
| CMP#$0B | . |
| BCCLAB_EB6E | . |
| LDA#$0B | . |
| LAB_EB6E: ; $EB6E | |
| LDXLAB_4A | get the dialed number buffer index |
| CPX#$3C | . |
| BCSLAB_EB79 | . |
| STALAB_03C6,X | . |
| INCLAB_4A | increment the dialed number buffer index |
| LAB_EB79: ; $EB79 | |
| RTS | |
| ************************************************************************************ | |
| read the MT8870 tone decoder and ?? | |
| LAB_EB7A: ; $EB7A | |
| LDALAB_F3 | read the port 1 data register |
| TAX | copy it |
| EORLAB_47 | compare it with the port 1 last read value |
| BBC4,A,LAB_EB92 | if b4 hasn't changed just exit |
| TXA | get the port 1 value back |
| STALAB_47 | save it as the port 1 last read value |
| BBC4,A,LAB_EB92 | if b4 isn't set just exit |
| AND#$0F | else mask the read value |
| SEB4,A | . |
| BBS7,LAB_1E,LAB_EB6E | . |
| BEQLAB_EB92 | . |
| CMP#$1D | . |
| BCCLAB_EB6E | . |
| LAB_EB92: ; $EB92 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EB93: ; $EB93 | |
| LDA#$00 | clear A |
| STALAB_82 | . |
| STALAB_81 | . |
| STALAB_83 | . |
| LAB_EB9B: ; $EB9B | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EB9C: ; $EB9C | |
| LDALAB_1F | . |
| BBS2,A,LAB_EC15 | . |
| BBC1,A,LAB_EB9B | . |
| BBS0,A,LAB_EBF0 | . |
| LDXLAB_12 | get the A2D channel 1 byte |
| TXA | copy it |
| SEC | set carry for subtract |
| SBCLAB_17 | . |
| STXLAB_17 | . |
| BCCLAB_EBB6 | . |
| BBC7,A,LAB_EBB2 | . |
| LDA#$7F | . |
| LAB_EBB2: ; $EBB2 | |
| LSRA | . |
| LSRA | . |
| BRALAB_EBBE | . |
| LAB_EBB6: ; $EBB6 | |
| BBS7,A,LAB_EBBA | . |
| LDA#$80 | . |
| LAB_EBBA: ; $EBBA | |
| SEC | . |
| RORA | . |
| SEC | . |
| RORA | . |
| LAB_EBBE: ; $EBBE | |
| LDXLAB_83 | . |
| STALAB_84,X | . |
| INX | . |
| TXA | . |
| CLB3,A | . |
| STALAB_83 | . |
| TAX | . |
| BEQLAB_EBCD | . |
| JMPLAB_EC67 | . |
| LAB_EBCD: ; $EBCD | |
| INX | . |
| LAB_EBCE: ; $EBCE | |
| LDALAB_84,X | . |
| SEC | set carry for subtract |
| SBCLAB_86,X | . |
| CLC | clear carry for add |
| ADCLAB_88,X | . |
| SEC | set carry for subtract |
| SBCLAB_8A,X | . |
| BPLLAB_EBDE | if >= o skip the two's complement |
| else < 0 so .. | |
| EOR#$FF | toggle the byte |
| INCA | and make 2's complement |
| LAB_EBDE: ; $EBDE | |
| STALAB_84,X | . |
| DEX | . |
| BPLLAB_EBCE | . |
| CLC | clear carry for add |
| ADCLAB_85 | . |
| CMPLAB_0234 | . |
| BCCLAB_EC67 | . |
| LDALAB_0235 | . |
| BRALAB_EC2B | . |
| LAB_EBF0: ; $EBF0 | |
| LDXLAB_13 | get the A2D channel 2 byte |
| CPXLAB_82 | . |
| BEQLAB_EC67 | . |
| BCCLAB_EBFC | . |
| STXLAB_82 | . |
| BRALAB_EC02 | . |
| LAB_EBFC: ; $EBFC | |
| CPXLAB_81 | . |
| BCSLAB_EC67 | . |
| STXLAB_81 | . |
| LAB_EC02: ; $EC02 | |
| LDALAB_82 | . |
| SEC | set carry for subtract |
| SBCLAB_81 | . |
| CMPLAB_0236 | . |
| BCCLAB_EC67 | . |
| STXLAB_82 | . |
| STXLAB_81 | . |
| LDALAB_0237 | . |
| BRALAB_EC2B | . |
| LAB_EC15: ; $EC15 | |
| SEC | set carry for subtract |
| BBC0,A,LAB_EC1E | . |
| LDALAB_13 | get the A2D channel 2 byte |
| SBCLAB_14 | subtract the A2D channel 3 byte |
| BRALAB_EC22 | . |
| LAB_EC1E: ; $EC1E | |
| LDALAB_14 | get the A2D channel 3 byte |
| SBCLAB_13 | subtract the A2D channel 2 byte |
| LAB_EC22: ; $EC22 | |
| BCCLAB_EC67 | . |
| CMPLAB_0238 | . |
| BCCLAB_EC67 | . |
| LDALAB_28 | . |
| LAB_EC2B: ; $EC2B | |
| CLC | clear carry for add |
| ADCLAB_44 | . |
| BCSLAB_EC63 | . |
| BVCLAB_EC73 | . |
| LDALAB_58 | get the record metered units low byte |
| LDXLAB_59 | get the record metered units high byte |
| INCA | increment the record metered units low byte |
| BNELAB_EC3E | if no rollover skip the high byte increment |
| INX | increment the record metered units high byte |
| BEQLAB_EC46 | |
| STXLAB_59 | save the record metered units high byte |
| LAB_EC3E: ; $EC3E | |
| STALAB_58 | save the record metered units low byte |
| SEB4,LAB_49 | . |
| CPX#$00 | . |
| BNELAB_EC4B | . |
| LAB_EC46: ; $EC46 | |
| DECA | . |
| CMP#$04 | . |
| BCCLAB_EC4D | . |
| LAB_EC4B: ; $EC4B | |
| LDA#$04 | . |
| LAB_EC4D: ; $EC4D | |
| TSX | . |
| PHA | . |
| ASLA | . |
| ADCLAB_0100,X | . |
| TXS | . |
| TAX | . |
| LDY#$00 | . |
| LAB_EC57: ; $EC57 | |
| LDALAB_006E,Y | . |
| STALAB_0529,X | . |
| INX | . |
| INY | . |
| CPY#$03 | . |
| BCCLAB_EC57 | . |
| LAB_EC63: ; $EC63 | |
| LDA#$FF | . |
| BRALAB_EC73 | . |
| LAB_EC67: ; $EC67 | |
| LDALAB_44 | . |
| SEC | set carry for subtract |
| SBCLAB_0239 | . |
| BCCLAB_EC75 | . |
| BVCLAB_EC73 | . |
| LDA#$00 | . |
| LAB_EC73: ; $EC73 | |
| STALAB_44 | . |
| LAB_EC75: ; $EC75 | |
| RTS | |
| ************************************************************************************ | |
| HE or VE interrupt | |
| LAB_EC76: ; $EC76 | |
| RTI | |
| ************************************************************************************ | |
| ?? | |
| LAB_EC77: ; $EC77 | |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| SEB5,LAB_F3 | set b5 port 1 data register, turn MT8870 off |
| JSRLAB_E679 | save the integer part of VThreshold * 2.277 in LAB_4F |
| JSRLAB_E876 | save VThreshold * 2.277 * A2D channel 3 in LAB_50 ?? |
| JSRLAB_EB93 | . |
| LDA#$00 | clear A |
| STALAB_44 | . |
| STALAB_58 | clear the record metered units low byte |
| STALAB_59 | clear the record metered units high byte |
| STALAB_40 | . |
| STALAB_41 | . |
| STALAB_42 | . |
| STALAB_43 | . |
| STALAB_45 | . |
| STALAB_46 | . |
| STALAB_54 | clear the buffered record length |
| STALAB_55 | . |
| STALAB_5A | . |
| STALAB_4A | clear the dialed number buffer index |
| STALAB_49 | . |
| STALAB_48 | . |
| STALAB_5B | . |
| STALAB_5C | . |
| STALAB_5D | . |
| STALAB_4B | clear the timer 1 countdown byte |
| STALAB_4C | . |
| STALAB_4E | clear the seconds countdown word high byte |
| STALAB_4D | clear the seconds countdown word low byte |
| LAB_ECB2: ; $ECB2 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_ECB3: | |
| JSRLAB_EC77 | . |
| LAB_ECB6: ; $ECB6 | |
| JSR\LAB_FFDC | swap the stack pointers |
| BRALAB_ECB6 | . |
| ************************************************************************************ | |
| ?? | |
| LAB_ECB9 = *-1 | |
| JSRLAB_EC77 | . |
| JSRLAB_F424 | set timer 1 to 5ms |
| JSRLAB_F077 | . |
| SEB5,LAB_5A | . |
| LAB_ECC5: ; $ECC5 | |
| CLB0,LAB_49 | . |
| JSRLAB_F131 | . |
| JSRLAB_F123 | . |
| JSRLAB_F179 | . |
| LDM#$50,LAB_4C | . |
| LAB_ECD3: ; $ECD3 | |
| JSR\LAB_FFDC | swap the stack pointers |
| LDALAB_49 | . |
| BBS1,A,LAB_ED05 | . |
| BBS4,A,LAB_ED01 | . |
| BBS7,A,LAB_ECF9 | . |
| BBS6,A,LAB_ECFD | . |
| BBS3,A,LAB_ECF5 | . |
| BBS2,A,LAB_ECF1 | . |
| LDALAB_4C | . |
| ORALAB_40 | . |
| ORALAB_46 | . |
| ORALAB_45 | . |
| BNELAB_ECD3 | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_ECD3 | . |
| LAB_ECF1: ; $ECF1 | |
| JSR\LAB_FF30 | . |
| BRALAB_ECC5 | . |
| LAB_ECF5: ; $ECF5 | |
| JSR\LAB_FF33 | . |
| BRALAB_ECC5 | . |
| LAB_ECF9: ; $ECF9 | |
| JSR\LAB_FF36 | . |
| BRALAB_ECC5 | . |
| LAB_ECFD: ; $ECFD | |
| JSR\LAB_FF39 | . |
| BRALAB_ECC5 | . |
| LAB_ED01: ; $ED01 | |
| JSR\LAB_FF3C | . |
| BRALAB_ECC5 | . |
| LAB_ED05: ; $ED05 | |
| JSR\LAB_FF3F | . |
| BRALAB_ECC5 | . |
| LAB_ED09: ; $ED09 | |
| LDA#$10 | . |
| JSRLAB_F209 | . |
| JSRLAB_F06F | . |
| LDY#$00 | . |
| LAB_ED13: ; $ED13 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS3,A,LAB_ED59 | . |
| BBS7,A,LAB_ED8A | . |
| BBS2,A,LAB_ED13 | . |
| LDALAB_2B | . |
| STALAB_4C | . |
| LAB_ED24: ; $ED24 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS3,A,LAB_ED59 | . |
| BBS7,A,LAB_ED8A | . |
| BBS2,A,LAB_ED13 | . |
| TSTLAB_4C | . |
| BNELAB_ED24 | . |
| JMPLAB_EDC0 | . |
| LAB_ED38: ; $ED38 | |
| LDA#$10 | . |
| JSRLAB_F209 | . |
| JSRLAB_F06F | . |
| LDALAB_2B | . |
| STALAB_4C | . |
| LDY#$00 | . |
| LAB_ED46: ; $ED46 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS2,A,LAB_ED59 | . |
| BBS7,A,LAB_ED8A | . |
| BBC3,A,LAB_EDBD | . |
| TSTLAB_4C | . |
| BNELAB_ED46 | . |
| BRALAB_ED84 | . |
| LAB_ED59: ; $ED59 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS7,A,LAB_ED8A | . |
| BBS2,A,LAB_ED59 | . |
| BBS3,A,LAB_ED69 | . |
| BBS0,LAB_24,LAB_EDC0 | . |
| LAB_ED69: ; $ED69 | |
| LDALAB_2B | . |
| STALAB_4C | . |
| LAB_ED6D: ; $ED6D | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS7,A,LAB_ED8A | . |
| BBS2,A,LAB_ED59 | . |
| BBS3,A,LAB_ED7D | . |
| BBS0,LAB_24,LAB_EDC0 | . |
| LAB_ED7D: ; $ED7D | |
| TSTLAB_4C | . |
| BNELAB_ED6D | . |
| BBC0,LAB_24,LAB_EDC0 | . |
| LAB_ED84: ; $ED84 | |
| COMLAB_48 | . |
| CLB3,LAB_49 | . |
| BRALAB_EDBD | . |
| LAB_ED8A: ; $ED8A | |
| JSRLAB_F134 | . |
| JSRLAB_F168 | . |
| JSRLAB_F187 | . |
| SEB0,LAB_56 | . |
| JSRLAB_F24F | . |
| JSRLAB_F073 | . |
| LAB_ED9B: ; $ED9B | |
| JSRLAB_F1B6 | make the seconds countdown word = LAB_2A * 8 ?? |
| LDM#$08,LAB_4C | . |
| LAB_EDA1: ; $EDA1 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_ED9B | . |
| LDALAB_49 | . |
| BBC7,A,LAB_EDC0 | . |
| BBS1,A,LAB_EDC0 | . |
| BBS1,LAB_25,LAB_EDA1 | . |
| LDALAB_4E | get the seconds countdown word high byte |
| ORALAB_4D | OR with the seconds countdown word low byte |
| ORALAB_4C | . |
| BNELAB_EDA1 | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_EDA1 | . |
| LAB_EDBD: ; $EDBD | |
| BBC4,LAB_49,LAB_EDD2 | . |
| LAB_EDC0: ; $EDC0 | |
| JSRLAB_F176 | . |
| JSRLAB_F292 | . |
| JSRLAB_F261 | . |
| JSRLAB_F2CD | . |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| LAB_EDD2: ; $EDD2 | |
| JSRLAB_F077 | . |
| LAB_EDD5: ; $EDD5 | |
| JSRLAB_F131 | . |
| LDM#$08,LAB_4C | . |
| LAB_EDDB: ; $EDDB | |
| JSR\LAB_FFDC | swap the stack pointers |
| LDALAB_49 | . |
| BBC3,A,LAB_EDED | . |
| BBS2,A,LAB_EDED | . |
| BBS7,A,LAB_EDE9 | . |
| TSTLAB_4C | . |
| BNELAB_EDDB | . |
| LAB_EDE9: ; $EDE9 | |
| COMLAB_48 | . |
| CLB3,LAB_49 | . |
| LAB_EDED: ; $EDED | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_EDEE: ; $EDEE | |
| JSRLAB_F134 | . |
| JSRLAB_F187 | . |
| JSRLAB_F144 | . |
| LDA#$80 | . |
| JSRLAB_F209 | . |
| JSRLAB_F063 | . |
| LDM#$00,LAB_4E | clear the seconds countdown word high byte |
| LDALAB_23 | . |
| STALAB_4D | save the seconds countdown word low byte |
| LAB_EE06: ; $EE06 | |
| JSR\LAB_FFDC | swap the stack pointers |
| BBS4,LAB_49,LAB_EE16 | . |
| BBC7,LAB_49,LAB_EE37 | . |
| TSTLAB_4A | test the dialed number buffer index |
| BNELAB_EE51 | . |
| TSTLAB_4D | test the seconds countdown word low byte |
| BNELAB_EE06 | . |
| LAB_EE16: ; $EE16 | |
| JSRLAB_F161 | . |
| LDY#$00 | . |
| LAB_EE1B: ; $EE1B | |
| JSRLAB_F1B6 | make the seconds countdown word = LAB_2A * 8 ?? |
| LDM#$08,LAB_4C | . |
| LAB_EE21: ; $EE21 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_EE1B | . |
| BBC7,LAB_49,LAB_EE37 | . |
| LDALAB_4E | get the seconds countdown word high byte |
| ORALAB_4D | OR with the seconds countdown word low byte |
| ORALAB_4C | . |
| BNELAB_EE21 | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_EE21 | . |
| LAB_EE37: ; $EE37 | |
| JSRLAB_F161 | . |
| JSRLAB_F190 | . |
| BCCLAB_EE4B | . |
| JSRLAB_F292 | . |
| JSRLAB_F2CD | . |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| LAB_EE4B: ; $EE4B | |
| JSRLAB_F077 | . |
| JMPLAB_EDD5 | . |
| LAB_EE51: ; $EE51 | |
| CLB0,LAB_8C | . |
| LDALAB_1E | . |
| AND#$0F | . |
| BNELAB_EE66 | . |
| LDALAB_03C6 | . |
| BBS4,A,LAB_EE63 | . |
| JSRLAB_F163 | turn MT8870 off and ?? |
| BRALAB_EE66 | . |
| LAB_EE63: ; $EE63 | |
| JSRLAB_F15E | . |
| LAB_EE66: ; $EE66 | |
| LDA#$08 | . |
| STALAB_56 | . |
| JSRLAB_F067 | . |
| LAB_EE6D: ; $EE6D | |
| JSRLAB_F24F | . |
| LDXLAB_4A | get the dialed number buffer index |
| SEB1,LAB_5B | . |
| LDALAB_23 | . |
| STALAB_4D | save the seconds countdown word low byte |
| LAB_EE78: ; $EE78 | |
| JSR\LAB_FFDC | swap the stack pointers |
| CPXLAB_4A | compare ?? with the dialed number buffer index |
| BNELAB_EE6D | . |
| LDALAB_49 | . |
| BBS4,A,LAB_EEB0 | . |
| BBC7,A,LAB_EE90 | . |
| BBC3,A,LAB_EE99 | . |
| CPXLAB_29 | . |
| BCSLAB_EE93 | . |
| COMLAB_48 | . |
| CLB3,LAB_49 | . |
| BRALAB_EE99 | . |
| LAB_EE90: ; $EE90 | |
| JMPLAB_EF10 | . |
| LAB_EE93: ; $EE93 | |
| BBS1,LAB_26,LAB_EEB0 | . |
| BBS7,LAB_1F,LAB_EEB0 | . |
| LAB_EE99: ; $EE99 | |
| TSTLAB_4D | test the seconds countdown word low byte |
| BNELAB_EE78 | . |
| JSRLAB_F161 | . |
| LAB_EEA0: ; $EEA0 | |
| JSR\LAB_FFDC | swap the stack pointers |
| LDALAB_49 | . |
| BBC7,A,LAB_EF10 | . |
| BBS4,A,LAB_EEB0 | . |
| BBC3,A,LAB_EEA0 | . |
| BBS1,LAB_26,LAB_EEB0 | . |
| BBC7,LAB_1F,LAB_EEA0 | . |
| LAB_EEB0: ; $EEB0 | |
| JSRLAB_F161 | . |
| JSRLAB_F168 | . |
| SEB0,LAB_56 | . |
| JSRLAB_F24F | . |
| JSRLAB_F06B | . |
| LDY#$00 | . |
| LAB_EEC0: ; $EEC0 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS1,A,LAB_EF10 | . |
| BBC7,A,LAB_EF00 | . |
| BBC3,A,LAB_EEC0 | . |
| BBS1,LAB_26,LAB_EED3 | . |
| BBC7,LAB_1F,LAB_EEC0 | . |
| LAB_EED3: ; $EED3 | |
| LDM#$08,LAB_4C | . |
| LAB_EED6: ; $EED6 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS1,A,LAB_EF10 | . |
| BBC7,A,LAB_EF00 | . |
| BBS3,A,LAB_EEE6 | . |
| BBS1,LAB_26,LAB_EF31 | . |
| LAB_EEE6: ; $EEE6 | |
| BBS4,A,LAB_EEEE | . |
| TSTLAB_4C | . |
| BNELAB_EED6 | . |
| SEB0,LAB_8C | . |
| LAB_EEEE: ; $EEEE | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBS1,A,LAB_EF10 | . |
| BBC7,A,LAB_EF00 | . |
| BBS3,A,LAB_EEEE | . |
| BBC1,LAB_26,LAB_EEEE | . |
| BRALAB_EF31 | . |
| LAB_EF00: ; $EF00 | |
| LDALAB_2C | . |
| STALAB_4B | save the timer 1 countdown byte |
| LAB_EF04: ; $EF04 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BBS7,LAB_49,LAB_EF10 | . |
| TSTLAB_4B | test the timer 1 countdown byte |
| BNELAB_EF04 | loop if not counted out |
| LAB_EF10: ; $EF10 | |
| JSRLAB_F161 | . |
| JSRLAB_F176 | . |
| JSRLAB_F292 | . |
| JSRLAB_F261 | . |
| JSRLAB_F39A | copy the dialed number to the record and ?? |
| BBC0,LAB_8C,LAB_EF25 | . |
| JSRLAB_F2CD | . |
| LAB_EF25: ; $EF25 | |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| JSRLAB_F077 | . |
| JMPLAB_EDD5 | . |
| LAB_EF31: ; $EF31 | |
| JSRLAB_EF10 | . |
| JSRLAB_F134 | . |
| JSRLAB_F176 | . |
| LDA#$40 | . |
| JSRLAB_F209 | . |
| JSRLAB_F07B | . |
| LDY#$00 | . |
| LAB_EF44: ; $EF44 | |
| JSRLAB_F1B6 | make the seconds countdown word = LAB_2A * 8 ?? |
| LDM#$08,LAB_4C | . |
| LAB_EF4A: ; $EF4A | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_EF44 | . |
| LDALAB_49 | . |
| BBC7,A,LAB_EF8F | . |
| BBS3,A,LAB_EF8F | . |
| LDALAB_4E | get the seconds countdown word high byte |
| ORALAB_4D | OR with the seconds countdown word low byte |
| ORALAB_4C | . |
| BNELAB_EF4A | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_EF4A | . |
| LAB_EF63: ; $EF63 | |
| JSRLAB_F134 | . |
| JSRLAB_F187 | . |
| LDA#$40 | . |
| JSRLAB_F209 | . |
| JSRLAB_F07B | . |
| LDY#$00 | . |
| LAB_EF73: ; $EF73 | |
| JSRLAB_F1B6 | make the seconds countdown word = LAB_2A * 8 ?? |
| LDM#$08,LAB_4C | . |
| LAB_EF79: ; $EF79 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_EF73 | . |
| BBC6,LAB_49,LAB_EF8F | . |
| LDALAB_4E | get the seconds countdown word high byte |
| ORALAB_4D | OR with the seconds countdown word low byte |
| ORALAB_4C | . |
| BNELAB_EF79 | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_EF79 | . |
| LAB_EF8F: ; $EF8F | |
| JSRLAB_F190 | . |
| BCCLAB_EFA0 | . |
| JSRLAB_F292 | . |
| JSRLAB_F2CD | . |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| LAB_EFA0: ; $EFA0 | |
| JSRLAB_F077 | . |
| JMPLAB_EDD5 | . |
| LAB_EFA6: ; $EFA6 | |
| LDA#$00 | . |
| JSRLAB_F209 | . |
| JSRLAB_F05F | . |
| LDY#$00 | . |
| LAB_EFB0: ; $EFB0 | |
| LDM#$10,LAB_4C | . |
| LAB_EFB3: ; $EFB3 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_EFB0 | . |
| LDALAB_49 | . |
| BBS7,A,LAB_EFC6 | . |
| BBS2,A,LAB_EFC6 | . |
| BBS3,A,LAB_EFC6 | . |
| TSTLAB_4C | . |
| BNELAB_EFB3 | . |
| LAB_EFC6: ; $EFC6 | |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| JMPLAB_F077 | . |
| LAB_EFCF: ; $EFCF | |
| JSRLAB_F134 | . |
| JSRLAB_F187 | . |
| CLB1,LAB_49 | . |
| LDA#$20 | . |
| JSRLAB_F209 | . |
| JSRLAB_F05B | . |
| JSRLAB_F13C | . |
| LDY#$00 | clear Y |
| STYLAB_4E | clear the seconds countdown word high byte |
| LDX#$00 | . |
| BRALAB_EFF6 | . |
| LAB_EFEA: ; $EFEA | |
| JSRLAB_F24F | . |
| LDXLAB_4A | get the dialed number buffer index |
| SEB3,LAB_56 | . |
| SEB1,LAB_5B | . |
| JSRLAB_F168 | . |
| LAB_EFF6: ; $EFF6 | |
| LDALAB_23 | . |
| STALAB_4D | save the seconds countdown word low byte |
| LAB_EFFA: ; $EFFA | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| CPXLAB_4A | compare ?? with the dialed number buffer index |
| BNELAB_EFEA | . |
| LDALAB_49 | . |
| BBC7,A,LAB_F03D | . |
| BBS1,A,LAB_F03D | . |
| TSTLAB_4D | test the seconds countdown word low byte |
| BNELAB_EFFA | . |
| JSRLAB_F161 | . |
| TSTLAB_4A | test the dialed number buffer index |
| BEQLAB_F021 | . |
| LAB_F014: ; $F014 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| LDALAB_49 | . |
| BBC7,A,LAB_F03D | . |
| BBS1,A,LAB_F03D | . |
| BRALAB_F014 | . |
| LAB_F021: ; $F021 | |
| JSRLAB_F1B6 | make the seconds countdown word = LAB_2A * 8 ?? |
| LDM#$08,LAB_4C | . |
| LAB_F027: ; $F027 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_F082 | . |
| BCCLAB_F021 | . |
| BBC7,LAB_49,LAB_F03D | . |
| LDALAB_4E | get the seconds countdown word high byte |
| ORALAB_4D | OR with the seconds countdown word low byte |
| ORALAB_4C | . |
| BNELAB_F027 | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_F027 | . |
| LAB_F03D: ; $F03D | |
| JSRLAB_F161 | . |
| JSRLAB_F176 | . |
| JSRLAB_F292 | . |
| JSRLAB_F261 | . |
| JSRLAB_F39A | copy the dialed number to the record and ?? |
| JSRLAB_F2CD | . |
| JSRLAB_F352 | add the record metered units to the meter value and ?? |
| JSRLAB_F452 | . |
| JSRLAB_F077 | . |
| JMPLAB_EDD5 | . |
| LAB_F05B: ; $F05B | |
| LDA#$84 | . |
| BRALAB_F07D | . |
| LAB_F05F: ; $F05F | |
| LDA#$85 | . |
| BRALAB_F07D | . |
| LAB_F063: ; $F063 | |
| LDA#$80 | . |
| BRALAB_F07D | . |
| LAB_F067: ; $F067 | |
| LDA#$81 | . |
| BRALAB_F07D | . |
| LAB_F06B: ; $F06B | |
| LDA#$89 | . |
| BRALAB_F07D | . |
| LAB_F06F: ; $F06F | |
| LDA#$82 | . |
| BRALAB_F07D | . |
| LAB_F073: ; $F073 | |
| LDA#$8A | . |
| BRALAB_F07D | . |
| LAB_F077: ; $F077 | |
| LDA#$88 | . |
| BRALAB_F07D | . |
| LAB_F07B: ; $F07B | |
| LDA#$83 | . |
| LAB_F07D: ; $F07D | |
| STALAB_5C | . |
| SEB0,LAB_5B | . |
| RTS | |
| ************************************************************************************ | |
| compare ?? with the record metered units low byte ?? | |
| return Cb = 0 if different | |
| LAB_F082: ; $F082 | |
| CPYLAB_58 | compare ?? with the record metered units low byte |
| BEQLAB_F08B | . |
| LDYLAB_58 | get the record metered units low byte |
| SEB2,LAB_5B | . |
| CLC | . |
| LAB_F08B: ; $F08B | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F08C: ; $F08C | |
| LDX#$00 | . |
| STXLAB_0743 | . |
| STXLAB_0744 | . |
| STXLAB_0745 | . |
| STXLAB_0746 | . |
| STXLAB_5D | . |
| SEB0,LAB_5B | . |
| SEB1,LAB_5B | . |
| LDALAB_58 | get the record metered units low byte |
| ORALAB_59 | OR with the record metered units high byte |
| BEQLAB_F0A8 | if no metered units just exit |
| SEB2,LAB_5B | . |
| LAB_F0A8: ; $F0A8 | |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| copy changed A2D bytes to the LAB_0639 buffer ?? | |
| LAB_F0AA: ; $F0AA | |
| TXA | copy the write index |
| PHA | save the write index |
| LDY#$00 | clear Y |
| STYLAB_8D | clear bytes changed flags |
| INX | increment the write index, make space for flags byte |
| SEI | disable interrupts |
| LAB_F0B2: ; $F0B2 | |
| LDALAB_0011,Y | get the A2D byte |
| CMPLAB_0743,Y | compare it with the previous value |
| CLC | flag the byte has not changed |
| BEQLAB_F0C3 | if the byte is the same skip the save |
| STALAB_0743,Y | save the new value |
| STALAB_0639,X | write the new value to the buffer |
| INX | increment the write index |
| SEC | flag the byte has changed |
| LAB_F0C3: ; $F0C3 | |
| RORLAB_8D | shift the changed flag into LAB_8D |
| INY | increment the channel |
| CPY#$04 | compare it with max + 1 |
| BCCLAB_F0B2 | loop if more to do |
| CLI | enable interrupts |
| PLA | pull the write index |
| TSTLAB_8D | test the bytes changed flags |
| BEQLAB_F0DB | if no bytes changed just exit |
| TAY | copt the original write index |
| RRFLAB_8D | . |
| LDA#$F0 | . |
| ORALAB_8D | . |
| STALAB_0639,Y | save the flags byte |
| RTS | |
| LAB_F0DB: ; $F0DB | |
| TAX | restore the write index |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F0DD: ; $F0DD | |
| JSRLAB_F0AA | copy changed A2D bytes to the LAB_0639 buffer ?? |
| BBC0,LAB_5B,LAB_F0ED | . |
| LDALAB_5C | . |
| BPLLAB_F0EB | . |
| STALAB_0639,X | . |
| INX | . |
| LAB_F0EB: ; $F0EB | |
| CLB0,LAB_5B | . |
| LAB_F0ED: ; $F0ED | |
| BBC1,LAB_5B,LAB_F104 | . |
| LDYLAB_5D | . |
| LAB_F0F2: ; $F0F2 | |
| CPYLAB_4A | compare ?? with the dialed number buffer index |
| BCSLAB_F100 | . |
| LDALAB_03C6,Y | . |
| STALAB_0639,X | . |
| INX | . |
| INY | . |
| BRALAB_F0F2 | . |
| LAB_F100: ; $F100 | |
| STYLAB_5D | . |
| CLB1,LAB_5B | . |
| LAB_F104: ; $F104 | |
| BBC2,LAB_5B,LAB_F11D | . |
| LDA#$90 | . |
| STALAB_0639,X | . |
| INX | increment the message index |
| SEI | disable interrupts |
| LDALAB_58 | get the record metered units low byte |
| STALAB_0639,X | . |
| INX | increment the message index |
| LDALAB_59 | get the record metered units high byte |
| STALAB_0639,X | . |
| INX | increment the message index, set the byte count |
| CLI | enable interrupts |
| CLB2,LAB_5B | . |
| LAB_F11D: ; $F11D | |
| LDA#>LAB_0639 | set the pointer low byte |
| LDY#<LAB_0639 | set the pointer high byte |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F123: ; $F123 | |
| BBS7,LAB_25,LAB_F129 | . |
| SEB6,LAB_5A | . |
| RTS | |
| LAB_F129: ; $F129 | |
| CLB6,LAB_5A | . |
| LDM#$00,LAB_46 | . |
| CLB3,LAB_49 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F131: ; $F131 | |
| SEB7,LAB_5A | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F134: ; $F134 | |
| CLB7,LAB_5A | . |
| LDM#$00,LAB_45 | . |
| CLB2,LAB_49 | . |
| RTS | |
| ************************************************************************************ | |
| turn MT8870 on and ??? | |
| LAB_F13C: ; $F13C | |
| CLB5,LAB_F3 | clear b5 port 1 data register, turn MT8870 on |
| LDM#$10,LAB_47 | set the port 1 last read value |
| SEB3,LAB_5A | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F144: ; $F144 | |
| LDALAB_1E | . |
| AND#$0F | . |
| BNELAB_F14C | . |
| ORA#$03 | . |
| LAB_F14C: ; $F14C | |
| BBC1,A,LAB_F151 | . |
| JSRLAB_F13C | . |
| LAB_F151: ; $F151 | |
| BBC0,A,LAB_F15D | . |
| LDA#$00 | clear A |
| STALAB_53 | . |
| STALAB_51 | . |
| STALAB_52 | . |
| SEB4,LAB_5A | . |
| LAB_F15D: ; $F15D | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F15E: ; $F15E | |
| CLB4,LAB_5A | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F161: ; $F161 | |
| CLB4,LAB_5A | . |
| ************************************************************************************ | |
| turn MT8870 off and ?? | |
| LAB_F163: ; $F163 | |
| CLB3,LAB_5A | . |
| SEB5,LAB_F3 | set b5 port 1 data register, turn MT8870 off |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F168: ; $F168 | |
| BBC1,LAB_25,LAB_F175 | . |
| LDA#$00 | clear A |
| STALAB_53 | . |
| STALAB_51 | . |
| STALAB_52 | . |
| SEB1,LAB_5A | . |
| LAB_F175: ; $F175 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F176: ; $F176 | |
| CLB1,LAB_5A | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F179: ; $F179 | |
| LDALAB_1F | . |
| BBS6,A,LAB_F181 | . |
| AND#$7F | . |
| BNELAB_F18D | . |
| LAB_F181: ; $F181 | |
| CLB2,LAB_5A | . |
| LDM#$00,LAB_44 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F187: ; $F187 | |
| LDALAB_1F | . |
| AND#$3F | . |
| BEQLAB_F18F | . |
| LAB_F18D: ; $F18D | |
| SEB2,LAB_5A | . |
| LAB_F18F: ; $F18F | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F190: ; $F190 | |
| BBS4,LAB_49,LAB_F1B4 | . |
| LDX#$00 | . |
| SEI | disable interrupts |
| LAB_F196: ; $F196 | |
| LDALAB_6E,X | . |
| STALAB_71,X | . |
| INX | . |
| CPX#$03 | . |
| BCCLAB_F196 | . |
| CLI | enable interrupts |
| LDALAB_73 | . |
| BNELAB_F1B4 | . |
| LDALAB_71 | . |
| LSRLAB_72 | . |
| RORA | . |
| LSRLAB_72 | . |
| RORA | . |
| LSRLAB_72 | . |
| BNELAB_F1B4 | . |
| RORA | . |
| CMPLAB_21 | . |
| RTS | |
| LAB_F1B4: ; $F1B4 | |
| SEC | . |
| RTS | |
| ************************************************************************************ | |
| make the seconds countdown word = LAB_2A * 8 ?? | |
| LAB_F1B6: ; $F1B6 | |
| SEI | disable interrupts |
| LDALAB_2A | . |
| LDM#$00,LAB_4E | clear the seconds countdown word high byte |
| ASLA | * 2 low byte |
| ROLLAB_4E | * 2 high byte |
| ASLA | * 4 low byte |
| ROLLAB_4E | * 4 high byte |
| ASLA | * 8 low byte |
| ROLLAB_4E | * 8 high byte |
| STALAB_4D | save the seconds countdown word low byte |
| CLI | enable interrupts |
| RTS | |
| ************************************************************************************ | |
| copy the current date/time to LAB_051F ?? | |
| LAB_F1C9: ; $F1C9 | |
| LDX#$06 | set the count/index |
| SEI | disable interrupts |
| LAB_F1CC: ; $F1CC | |
| LDALAB_66,X | get a current date/time byte |
| STALAB_051F,X | . |
| DEX | decrement the count/index |
| BPLLAB_F1CC | loop if more to do |
| CLI | enable interrupts |
| RTS | |
| ************************************************************************************ | |
| compress YY:MM:DD in X:A:Y into AX | |
| LAB_F1D6: ; $F1D6 | |
| STXLAB_0748 | save the year |
| STYLAB_0747 | save the date |
| ASLA | x xxxM MMM. |
| ASLA | x xxMM MM.. |
| ASLA | x xMMM M... |
| ASLA | x MMMM .... |
| ASLA | M MMM. .... |
| ROLLAB_0748 | shift the high bit of the month into the year |
| ORALAB_0747 | OR with the date, gives MMMD DDDD |
| LDXLAB_0748 | get the year, gives YYYY YYYM |
| RTS | |
| ************************************************************************************ | |
| compress HH:MM:SS in X:A:Y into AX and Cb | |
| LAB_F1EB: ; $F1EB | |
| STXLAB_0749 | save the hours |
| STYLAB_074A | save the seconds |
| ASLA | . .MMM MMM. |
| ASLA | . MMMM MM.. |
| ASLA | M MMMM M... |
| ROLLAB_0749 | . ..HH HHHM shift the minutes bit into the hour |
| ASLA | M MMMM .... |
| ROLLAB_0749 | . .HHH HHMM shift the minutes bit into the hour |
| ASLA | M MMM. .... |
| ROLLAB_0749 | . HHHH HMMM shift the minutes bit into the hour |
| LDXLAB_0749 | . HHHH HMMM get the hour/minute |
| LSRLAB_074A | S ...S SSSS shift the seconds low bit into Cb |
| ORALAB_074A | S MMMS SSSS OR in the seconds |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F209: ; $F209 | |
| STALAB_56 | . |
| LDA#$00 | clear A |
| STALAB_55 | . |
| TAX | . |
| LAB_F210: ; $F210 | |
| STALAB_6E,X | . |
| STALAB_0526,X | . |
| STALAB_0529,X | . |
| INX | . |
| CPX#$03 | . |
| BCCLAB_F210 | . |
| JSRLAB_F1C9 | copy the current date/time to LAB_051F ?? |
| LDXLAB_051F | get the ?? year |
| LDALAB_0520 | get the ?? month |
| LDYLAB_0521 | get the ?? date |
| JSRLAB_F1D6 | compress YY:MM:DD in X:A:Y into AX |
| STXLAB_074D | save the buffered record year/month |
| STALAB_074E | save the buffered record month/date |
| LDXLAB_0522 | get the ?? hours |
| LDALAB_0523 | get the ?? minutes |
| LDYLAB_0524 | get the ?? seconds |
| JSRLAB_F1EB | compress HH:MM:SS in X:A:Y into AX and Cb |
| STXLAB_074F | save the buffered record hours/minutes |
| STALAB_0750 | save the buffered record minutes/seconds |
| LDA#$00 | clear A |
| BCCLAB_F249 | if the seconds low bit is clear skip the bit set |
| SEB7,A | set the seconds low bit |
| LAB_F249: ; $F249 | |
| STALAB_57 | . |
| LDM#$07,LAB_54 | set the buffered record length |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F24F: ; $F24F | |
| SEI | disable interrupts |
| LDALAB_6E | . |
| STALAB_0526 | . |
| LDALAB_6F | . |
| STALAB_0527 | . |
| LDALAB_70 | . |
| STALAB_0528 | . |
| CLI | enable interrupts |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F261: ; $F261 | |
| LDX#$00 | . |
| LDY#$00 | . |
| LAB_F265: ; $F265 | |
| LDALAB_0526,X | . |
| STALAB_71,X | . |
| BEQLAB_F26D | . |
| TAY | . |
| LAB_F26D: ; $F26D | |
| INX | . |
| CPX#$03 | . |
| BCCLAB_F265 | . |
| TYA | . |
| BEQLAB_F291 | . |
| LDX#$04 | . |
| LAB_F277: ; $F277 | |
| LSRLAB_73 | . |
| RORLAB_72 | . |
| RORLAB_71 | . |
| DEX | . |
| BNELAB_F277 | . |
| LDALAB_71 | . |
| LDXLAB_72 | . |
| STALAB_0754 | . |
| STXLAB_0755 | . |
| BCCLAB_F28E | . |
| SEB6,LAB_57 | . |
| LAB_F28E: ; $F28E | |
| LDM#$0B,LAB_54 | set the buffered record length |
| LAB_F291: ; $F291 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F292: ; $F292 | |
| LDX#$00 | clear the index |
| LDY#$03 | set the count |
| SEI | disable interrupts |
| SEC | set carry for subtract |
| LAB_F298: ; $F298 | |
| LDALAB_6E,X | . |
| SBCLAB_0526,X | . |
| STALAB_71,X | . |
| INX | increment the index |
| DEY | decrement the count |
| BNELAB_F298 | loop if more to do |
| CLI | enable interrupts |
| LDALAB_71 | . |
| AND#$0F | . |
| ORALAB_57 | . |
| STALAB_57 | . |
| LDX#$04 | . |
| LAB_F2AE: ; $F2AE | |
| LSRLAB_73 | . |
| RORLAB_72 | . |
| RORLAB_71 | . |
| DEX | . |
| BNELAB_F2AE | . |
| LDALAB_73 | . |
| BEQLAB_F2BF | . |
| DEX | . |
| TXA | . |
| BRALAB_F2C3 | . |
| LAB_F2BF: ; $F2BF | |
| LDALAB_71 | . |
| LDXLAB_72 | . |
| LAB_F2C3: ; $F2C3 | |
| STALAB_0752 | . |
| STXLAB_0753 | . |
| LDM#$09,LAB_54 | set the buffered record length |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F2CD: ; $F2CD | |
| BBC4,LAB_49,LAB_F2FD | . |
| LDX#$00 | . |
| LAB_F2D2: ; $F2D2 | |
| LDALAB_0529,X | . |
| STALAB_71,X | . |
| INX | . |
| CPX#$03 | . |
| BCCLAB_F2D2 | . |
| LDX#$04 | . |
| LAB_F2DE: ; $F2DE | |
| LSRLAB_73 | . |
| RORLAB_72 | . |
| RORLAB_71 | . |
| DEX | . |
| BNELAB_F2DE | . |
| LDYLAB_54 | get the buffered record length |
| LDALAB_71 | . |
| STALAB_074B,Y | . |
| LDALAB_72 | . |
| STALAB_074C,Y | . |
| INY | . |
| INY | . |
| STYLAB_54 | save the buffered record length |
| BCCLAB_F2FB | . |
| SEB6,LAB_55 | . |
| LAB_F2FB: ; $F2FB | |
| SEB7,LAB_55 | . |
| LAB_F2FD: ; $F2FD | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F2FE: ; $F2FE | |
| LDX#$00 | . |
| LAB_F300: ; $F300 | |
| PHA | . |
| SEC | set carry for subtract |
| LDALAB_052C,X | . |
| SBCLAB_0529,X | . |
| STALAB_71 | . |
| LDALAB_052D,X | . |
| SBCLAB_052A,X | . |
| STALAB_72 | . |
| LDALAB_052E,X | . |
| SBCLAB_052B,X | . |
| STALAB_73 | . |
| BEQLAB_F33E | . |
| CPX#$0C | . |
| BCCLAB_F337 | . |
| LDA#$04 | . |
| LAB_F322: ; $F322 | |
| LSRLAB_73 | . |
| RORLAB_72 | . |
| RORLAB_71 | . |
| DECA | . |
| BNELAB_F322 | . |
| LDALAB_73 | . |
| BNELAB_F337 | . |
| BCCLAB_F333 | . |
| SEB5,LAB_57 | . |
| LAB_F333: ; $F333 | |
| SEB4,LAB_57 | . |
| BRALAB_F33E | . |
| LAB_F337: ; $F337 | |
| LDA#$FF | . |
| STALAB_074B,Y | . |
| BRALAB_F345 | . |
| LAB_F33E: ; $F33E | |
| LDALAB_71 | . |
| STALAB_074B,Y | . |
| LDALAB_72 | . |
| LAB_F345: ; $F345 | |
| INY | . |
| STALAB_074B,Y | . |
| INY | . |
| INX | . |
| INX | . |
| INX | . |
| PLA | . |
| DECA | . |
| BNELAB_F300 | . |
| RTS | |
| ************************************************************************************ | |
| add the record metered units to the meter value and ?? | |
| LAB_F352: ; $F352 | |
| LDALAB_58 | get the record metered units low byte |
| ORALAB_59 | OR with the record metered units high byte |
| BEQLAB_F395 | if no metered units go ?? and exit |
| SEI | disable interrupts |
| CLC | clear carry for add |
| LDALAB_58 | get the record metered units low byte |
| ADCLAB_36 | add the meter value low byte |
| STALAB_36 | save the meter value low byte |
| LDALAB_59 | get the record metered units high byte |
| ADCLAB_37 | add the meter value mid byte |
| STALAB_37 | save the meter value mid byte |
| BCCLAB_F36A | if no carry skip the high byte increment |
| INCLAB_38 | increment the meter value high byte |
| LAB_F36A: ; $F36A | |
| SEB1,LAB_56 | . |
| LDYLAB_54 | get the buffered record length |
| TSTLAB_59 | test the record metered units high byte |
| BNELAB_F37B | . |
| LDALAB_58 | get the record metered units low byte |
| DECA | . |
| BEQLAB_F380 | . |
| CMP#$04 | . |
| BCCLAB_F37D | . |
| LAB_F37B: ; $F37B | |
| LDA#$04 | . |
| LAB_F37D: ; $F37D | |
| JSRLAB_F2FE | . |
| LAB_F380: ; $F380 | |
| LDALAB_58 | get the record metered units low byte |
| STALAB_074B,Y | . |
| INY | . |
| LDALAB_59 | get the record metered units high byte |
| STALAB_074B,Y | . |
| INY | . |
| STYLAB_54 | save the buffered record length |
| LDA#$00 | clear A |
| STALAB_58 | clear the record metered units low byte |
| STALAB_59 | clear the record metered units high byte |
| CLI | enable interrupts |
| LAB_F395: ; $F395 | |
| CLB2,LAB_5B | . |
| CLB4,LAB_49 | . |
| RTS | |
| ************************************************************************************ | |
| copy the dialed number to the record and ?? | |
| LAB_F39A: ; $F39A | |
| JSRLAB_F161 | . |
| TSTLAB_4A | test the dialed number buffer index |
| BEQLAB_F3CA | if no dialed number just exit |
| clear the record buffer dialed number | |
| LDX#$35 | set the byte count |
| LDY#$00 | clear the index |
| TYA | clear A |
| LAB_F3A6: ; $F3A6 | |
| STALAB_0756,Y | clear a digit in the record buffer dialed number |
| INY | increment the index |
| DEX | decrement the count |
| BNELAB_F3A6 | loop if more to do |
| TAY | clear the record digit index |
| LAB_F3AE: ; $F3AE | |
| JSRLAB_F3FE | get a digit from the dialed number buffer and increment |
| the index | |
| BCSLAB_F3BA | if done go ?? and exit |
| BBS4,A,LAB_F3CB | . |
| JSRLAB_F407 | save a digit to the record and increment the index |
| BCCLAB_F3AE | if the index < max go get another digit |
| LAB_F3BA: ; $F3BA | |
| TYA | copy the record digit index |
| INCA | + 1 |
| LSRA | / 2 gives the number length in bytes |
| CLC | clear carry for add |
| ADC#$0B | add the offset to the number start |
| STALAB_54 | save the buffered record length |
| LDA#$00 | clear A |
| STALAB_4A | clear the dialed number buffer index |
| STALAB_5D | . |
| CLB1,LAB_5B | . |
| LAB_F3CA: ; $F3CA | |
| RTS | |
| the dialed digit had b4 set so ?? | |
| LAB_F3CB: ; $F3CB | |
| INY | increment the record digit index ?? |
| INY | increment the record digit index ?? |
| STYLAB_8E | save the record digit index ?? |
| LDM#$1F,LAB_8F | . |
| LAB_F3D2: ; $F3D2 | |
| JSRLAB_F407 | save a digit to the record and increment the index |
| BCSLAB_F3E3 | if the index >= max skip ?? |
| DECLAB_8F | . |
| BEQLAB_F3E3 | . |
| JSRLAB_F3FE | get a digit from the dialed number buffer and increment |
| the index | |
| BCSLAB_F3E3 | . |
| BBS4,A,LAB_F3D2 | . |
| DEX | . |
| LAB_F3E3: ; $F3E3 | |
| TYA | copy Y |
| LDY#$07 | . |
| PHA | save Y |
| SEC | set carry for subtract |
| SBCLAB_8E | subtract the record digit index ?? |
| PHA | . |
| CMP#$10 | . |
| TYA | . |
| ROLA | . |
| LDYLAB_8E | get the record digit index ?? |
| DEY | decrement the record digit index ?? |
| DEY | decrement the record digit index ?? |
| JSRLAB_F407 | save a digit to the record and increment the index |
| PLA | . |
| JSRLAB_F407 | save a digit to the record and increment the index |
| PLA | pull Y |
| TAY | restore Y |
| BRALAB_F3AE | go get another digit |
| ************************************************************************************ | |
| get a digit from the dialed number buffer and increment the index | |
| LAB_F3FE: ; $F3FE | |
| CPXLAB_4A | compare the number copy index with the dialed number |
| buffer length | |
| BCSLAB_F406 | if > length just exit |
| LDALAB_03C6,X | else get a dialed number digit |
| INX | increment the number copy index |
| LAB_F406: ; $F406 | |
| RTS | |
| ************************************************************************************ | |
| save a digit to the record and increment the index | |
| LAB_F407: ; $F407 | |
| CPY#$44 | compare the index with the max + 1 |
| BCSLAB_F423 | if > max just exit |
| AND#$0F | mask the digit |
| PHA | save A |
| TYA | copy the index |
| LSRA | / 2, shift b0 to Cb |
| TAY | restore the shifted index |
| PLA | restore A |
| BCSLAB_F419 | if carry set go OR in the low nibble |
| ASLA | else shift the .. |
| ASLA | .. low nibble .. |
| ASLA | .. to the high .. |
| ASLA | .. nibble |
| CLC | ensure Cb is clear, it /should/ be anyway |
| LAB_F419: ; $F419 | |
| ORALAB_0756,Y | OR with the high nibble |
| STALAB_0756,Y | save the nibbles |
| TYA | copy the shifted index |
| ROLA | * 2, shift b0 back in, also clear Cb |
| TAY | restore the index |
| INY | increment the digit index |
| LAB_F423: ; $F423 | |
| RTS | |
| ************************************************************************************ | |
| set timer 1 to 5ms | |
| LAB_F424: ; $F424 | |
| LDM#$23,LAB_DC | set prescaller 1 to (1/(35+1)) * (1/16) * XTAL Hz |
| this will be 12800 Hz with a 7.3728MHz XTAL | |
| LDM#$3F,LAB_DD | set timer 1 to (1/(63+1)) * 12800 Hz =5ms |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| SEB0,LAB_FE | set the timer 1 interrupt enable bit |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F42F: ; $F42F | |
| LDY#$00 | clear Y |
| LDXLAB_020C | get the RAM start low byte |
| LDALAB_020D | get the RAM start high byte |
| STYLAB_92 | clear the record memory start pointer low byte |
| STXLAB_93 | save the record memory start pointer mid byte |
| STALAB_94 | save the record memory start pointer high byte |
| STYLAB_95 | clear the record memory end pointer low byte |
| STXLAB_96 | save the record memory end pointer mid byte |
| STALAB_97 | save the record memory end pointer high byte |
| STYLAB_39 | . |
| STYLAB_3A | . |
| STYLAB_3B | . |
| STYLAB_3C | . |
| STYLAB_36 | clear the meter value low byte |
| STYLAB_37 | clear the meter value mid byte |
| STYLAB_38 | clear the meter value high byte |
| RTS | |
| ************************************************************************************ | |
| copy the buffered record to memory ?? | |
| LAB_F452: ; $F452 | |
| LDALAB_54 | get the buffered record length |
| ORALAB_55 | . |
| STALAB_074B | . |
| LDALAB_56 | . |
| BBC0,LAB_49,LAB_F45F | . |
| SEB2,A | . |
| LAB_F45F: ; $F45F | |
| STALAB_074C | . |
| LDALAB_57 | . |
| STALAB_0751 | . |
| LDYLAB_92 | get the record memory start pointer low byte |
| LDXLAB_93 | get the record memory start pointer mid byte |
| LDALAB_94 | get the record memory start pointer high byte |
| LAB_F46D: ; $F46D | |
| JSRLAB_F502 | check if room in memory for a new record ?? |
| BCCLAB_F48B | if room go copy the record to memory |
| LDYLAB_92 | get the record memory start pointer low byte |
| LDXLAB_93 | get the record memory start pointer mid byte |
| LDALAB_94 | get the record memory start pointer high byte |
| JSRLAB_F4C6 | increment, check and rollover the YXA word ?? |
| STYLAB_92 | save the record memory start pointer low byte |
| STXLAB_93 | save the record memory start pointer mid byte |
| STALAB_94 | save the record memory start pointer high byte |
| TSTLAB_3B | . |
| BNELAB_F487 | . |
| DECLAB_3C | . |
| LAB_F487: ; $F487 | |
| DECLAB_3B | . |
| BRALAB_F46D | . |
| LAB_F48B: ; $F48B | |
| LDA#$00 | clear the record buffer index |
| PHA | save the record buffer index |
| LDYLAB_95 | get the record memory end pointer low byte |
| LDXLAB_96 | get the record memory end pointer mid byte |
| LDALAB_97 | get the record memory end pointer high byte |
| BRALAB_F4AE | branch into the copy loop |
| LAB_F496: ; $F496 | |
| LDALAB_074B,X | get a byte from the record buffer |
| STA(LAB_90),Y | save it to the record in memory |
| INX | increment the record buffer index |
| INY | increment the record memory index |
| STYLAB_95 | save the record memory end pointer low byte |
| BNELAB_F4B3 | if no rollover skip the record pointer rollover |
| TXA | copy the record buffer index |
| PHA | save the record buffer index |
| LDXLAB_96 | get the record memory end pointer mid byte |
| LDALAB_97 | get the record memory end pointer high byte |
| JSRLAB_F4DA | increment, check and rollover the XA word ?? |
| STXLAB_96 | save the record memory end pointer mid byte |
| STALAB_97 | save the record memory end pointer high byte |
| LAB_F4AE: ; $F4AE | |
| JSRLAB_F4ED | set RAM A16 from A and ?? |
| PLA | pull the record buffer index |
| TAX | restore the record buffer index |
| LAB_F4B3: ; $F4B3 | |
| CPXLAB_54 | compare the record buffer index with the buffered record |
| length | |
| BCCLAB_F496 | loop if more record bytes to copy |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| INCLAB_39 | increment the calls logged low byte ?? |
| BNELAB_F4BF | if no rollover skip the high byte increment |
| INCLAB_3A | increment the calls logged high byte ?? |
| LAB_F4BF: ; $F4BF | |
| INCLAB_3B | increment the ?? low byte |
| BNELAB_F4C5 | if no rollover skip the high byte increment |
| INCLAB_3C | increment the ?? high byte |
| LAB_F4C5: ; $F4C5 | |
| RTS | |
| ************************************************************************************ | |
| increment, check and rollover the YXA word ?? | |
| LAB_F4C6: ; $F4C6 | |
| PHA | save the XA word high byte |
| JSRLAB_F4ED | set RAM A16 from A and ?? |
| LDA(LAB_90),Y | get the record length ?? |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| AND#$3F | mask 00xx xxxx, the record length bits ?? |
| STALAB_91 | save the record RAM pointer high byte |
| TYA | . |
| CLC | clear carry for add |
| ADCLAB_91 | add the record RAM pointer high byte |
| TAY | . |
| PLA | restore the XA word high byte |
| BCCLAB_F4EC | . |
| ************************************************************************************ | |
| increment, check and rollover the XA word ?? | |
| LAB_F4DA: ; $F4DA | |
| INX | increment the word low byte |
| BNELAB_F4DE | if no rollover skip the high byte increment |
| INCA | else increment the high byte |
| LAB_F4DE: ; $F4DE | |
| CMPLAB_03 | compare ?? with the RAM end high byte |
| BNELAB_F4EC | . |
| CPXLAB_02 | zompare ?? with the RAM end low byte |
| BNELAB_F4EC | . |
| LDXLAB_020C | get the RAM start low byte |
| LDALAB_020D | get the RAM start high byte |
| LAB_F4EC: ; $F4EC | |
| RTS | |
| ************************************************************************************ | |
| set RAM A16 from A and ?? | |
| LAB_F4ED: ; $F4ED | |
| CLB4,LAB_F6 | clear b4 port 0 data register, clear RAM A16 |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| BBC0,A,LAB_F4F5 | . |
| SEB4,LAB_F6 | set b4 port 0 data register, set RAM A16 |
| LAB_F4F5: ; $F4F5 | |
| BBC1,A,LAB_F4F9 | . |
| SEB5,LAB_F5 | set b5 port 0 function register, port 0 b5 = DME |
| LAB_F4F9: ; $F4F9 | |
| TXA | . |
| EOR#$80 | . |
| STALAB_91 | save the record RAM pointer high byte |
| LDM#$00,LAB_90 | clear the record RAM pointer low byte |
| RTS | |
| ************************************************************************************ | |
| check if room in memory for a new record ?? | |
| Y = record memory start pointer low byte | |
| X = record memory start pointer mid byte | |
| A = record memory start pointer high byte | |
| LAB_F502: ; $F502 | |
| PHA | save the record memory start pointer high byte |
| TYA | copy the record memory start pointer low byte |
| SEC | set carry for subtract |
| SBCLAB_95 | subtract the record memory end pointer low byte |
| TAY | copy the record length low byte |
| TXA | copy the record memory start pointer mid byte |
| SBCLAB_96 | subtract the record memory end pointer mid byte |
| TAX | copy the record length mid byte |
| PLA | restore the record memory start pointer high byte |
| SBCLAB_97 | subtract the record memory end pointer high byte |
| BCSLAB_F519 | . |
| record memory start pointer < record memory end pointer | |
| PHA | . |
| TXA | . |
| ADCLAB_04 | add the RAM size low byte |
| TAX | . |
| PLA | . |
| ADCLAB_05 | add the RAM size high byte |
| LAB_F519: ; $F519 | |
| BNELAB_F524 | . |
| DEX | . |
| BNELAB_F524 | . |
| CPYLAB_54 | compare ?? with the buffered record length |
| BCSLAB_F524 | . |
| SEC | flag no room |
| RTS | |
| LAB_F524: ; $F524 | |
| CLC | flag room |
| RTS | |
| ************************************************************************************ | |
| copy the next record to the record buffer | |
| return Cb = 1 if error | |
| LAB_F526: ; $F526 | |
| LDYLAB_A1 | get the next record pointer low byte |
| LDXLAB_A2 | get the next record pointer mid byte |
| LDALAB_A3 | get the next record pointer high byte |
| CMPLAB_97 | compare it with the record memory end pointer high byte |
| BNELAB_F538 | if not the same go get a record |
| CPXLAB_96 | compare it with the record memory end pointer mid byte |
| BNELAB_F538 | if not the same go get a record |
| CPYLAB_95 | compare it with the record memory end pointer low byte |
| BEQLAB_F56C | if the same go do error exit |
| LAB_F538: ; $F538 | |
| JSRLAB_F4ED | set RAM A16 from A and ?? |
| LDA(LAB_90),Y | get the record length |
| AND#$3F | mask 00xx xxxx, the record length |
| BEQLAB_F56C | if zero length record go do error exit |
| STALAB_A4 | save the buffered record length |
| LDX#$00 | clear the record buffer index |
| BRALAB_F564 | branch into the loop |
| LAB_F547: ; $F547 | |
| LDA(LAB_90),Y | get a record byte |
| STALAB_078E,X | save it to the record buffer |
| INX | increment the record buffer index |
| INY | increment the record index |
| STYLAB_A1 | save the next record pointer low byte |
| BNELAB_F564 | if no rollover skip the record pointer rollover |
| TXA | copy the record buffer index |
| PHA | save the record buffer index |
| LDXLAB_A2 | get the next record pointer mid byte |
| LDALAB_A3 | get the next record pointer high byte |
| JSRLAB_F4DA | increment, check and rollover the XA word ?? |
| STXLAB_A2 | save the next record pointer mid byte |
| STALAB_A3 | save the next record pointer high byte |
| JSRLAB_F4ED | set RAM A16 from A and ?? |
| PLA | pull the record buffer index |
| TAX | restore the record buffer index |
| LAB_F564: ; $F564 | |
| CPXLAB_A4 | compare record buffer index with the buffered record |
| length | |
| BCCLAB_F547 | loop if more record bytes to copy |
| CLC | flag ok |
| LAB_F569: ; $F569 | |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| RTS | |
| LAB_F56C: ; $F56C | |
| SEC | flag error |
| BRALAB_F569 | go exit |
| ************************************************************************************ | |
| ?? | |
| LAB_F56F: ; $F56F | |
| LDY#$00 | clear the index |
| LAB_F571: ; $F571 | |
| LDALAB_0790,Y | . |
| CMPLAB_0739,Y | . |
| BNELAB_F588 | . |
| INY | increment the index |
| CPY#$04 | compare with max + 1 |
| BCCLAB_F571 | loop if more to do |
| LDALAB_0794 | . |
| SBCLAB_073D | . |
| AND#$80 | . |
| BEQLAB_F5AD | . |
| LAB_F588: ; $F588 | |
| BCCLAB_F5AD | . |
| LDY#$00 | clear the index |
| LAB_F58C: ; $F58C | |
| LDALAB_0790,Y | . |
| CMPLAB_073E,Y | . |
| BNELAB_F5A3 | . |
| INY | increment the index |
| CPY#$04 | compare with max + 1 |
| BCCLAB_F58C | loop if more to do |
| LDALAB_0794 | . |
| SBCLAB_0742 | . |
| AND#$80 | . |
| BEQLAB_F5A5 | . |
| LAB_F5A3: ; $F5A3 | |
| BCSLAB_F5B0 | . |
| LAB_F5A5: ; $F5A5 | |
| LDALAB_078F | . |
| ANDLAB_7C | . |
| CLV | . |
| CLC | . |
| RTS | |
| LAB_F5AD: ; $F5AD | |
| CLV | . |
| SEC | . |
| RTS | |
| LAB_F5B0: ; $F5B0 | |
| BITLAB_F5B4 | . |
| SEC | . |
| LAB_F5B4: ; $F5B4 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F5B5: ; $F5B5 | |
| LDY#$03 | set the count |
| LDX#$00 | clear the index |
| SEC | set carry for subtract |
| LAB_F5BA: ; $F5BA | |
| LDALAB_95,X | get a record memory end pointer byte |
| SBCLAB_92,X | subtract record memory start pointer byte |
| STALAB_3D,X | . |
| INX | increment the index |
| DEY | decrement the count |
| BNELAB_F5BA | loop if more to do |
| BCSLAB_F5D2 | if no carry out go return the error |
| LDALAB_3E | . |
| ADCLAB_04 | add the RAM size low byte |
| STALAB_3E | . |
| LDALAB_3F | . |
| ADCLAB_05 | add the RAM size high byte |
| STALAB_3F | . |
| LAB_F5D2: ; $F5D2 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F5D3: ; $F5D3 | |
| JSRLAB_E1CE | set 1/4 second countdown |
| LDX#$00 | clear A |
| TXA | clear the index |
| LAB_F5D9: ; $F5D9 | |
| STALAB_98,X | . |
| INX | increment the index |
| CPX#$09 | compare the index with max + 1 |
| BCCLAB_F5D9 | loop if more to do |
| LDYLAB_92 | get the record memory start pointer low byte |
| LDXLAB_93 | get the record memory start pointer mid byte |
| LDALAB_94 | get the record memory start pointer high byte |
| STYLAB_A1 | save the next record pointer low byte |
| STXLAB_A2 | save the next record pointer mid byte |
| STALAB_A3 | save the next record pointer high byte |
| LAB_F5EC: ; $F5EC | |
| STYLAB_078B | . |
| STXLAB_078C | . |
| STALAB_078D | . |
| LAB_F5F5: ; $F5F5 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_E1C2 | if ?? put a byte in the Tx buffer ?? |
| JSRLAB_F526 | copy the next record to the record buffer |
| BCSLAB_F64A | if error go ?? |
| JSRLAB_F56F | . |
| BCCLAB_F618 | . |
| BVSLAB_F5F5 | . |
| BNELAB_F60C | . |
| INCLAB_98 | . |
| BRALAB_F610 | . |
| LAB_F60C: ; $F60C | |
| TSTLAB_98 | . |
| BNELAB_F5F5 | . |
| LAB_F610: ; $F610 | |
| LDYLAB_A1 | get the next record pointer low byte |
| LDXLAB_A2 | get the next record pointer mid byte |
| LDALAB_A3 | get the next record pointer high byte |
| BRALAB_F5EC | . |
| LAB_F618: ; $F618 | |
| BEQLAB_F5F5 | . |
| INCLAB_99 | . |
| BNELAB_F620 | . |
| INCLAB_9A | . |
| LAB_F620: ; $F620 | |
| LDALAB_078F | . |
| LDYLAB_A4 | get the buffered record length |
| BBC1,A,LAB_F63A | . |
| CLC | clear carry for add |
| LDALAB_078C,Y | . |
| ADCLAB_9B | . |
| STALAB_9B | . |
| LDALAB_078D,Y | . |
| ADCLAB_9C | . |
| STALAB_9C | . |
| BCCLAB_F63A | . |
| INCLAB_9D | . |
| LAB_F63A: ; $F63A | |
| CLC | clear carry for add |
| TYA | . |
| ADCLAB_9E | . |
| STALAB_9E | . |
| BCCLAB_F648 | . |
| INCLAB_9F | . |
| BNELAB_F648 | . |
| INCLAB_A0 | . |
| LAB_F648: ; $F648 | |
| BRALAB_F5F5 | . |
| LAB_F64A: ; $F64A | |
| LDYLAB_078B | . |
| LDXLAB_078C | . |
| LDALAB_078D | . |
| STYLAB_A1 | save the next record pointer low byte |
| STXLAB_A2 | save the next record pointer mid byte |
| STALAB_A3 | save the next record pointer high byte |
| LDA#>LAB_98 | set the return message pointer low byte |
| LDY#<LAB_98 | set the return message pointer high byte |
| LDX#$09 | set the byte count |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| fill the message buffer with records ?? | |
| LAB_F661: ; $F661 | |
| JSRLAB_E1CE | set 1/4 second countdown |
| LDX#$00 | clear the message buffer index |
| LAB_F666: ; $F666 | |
| JSR\LAB_FFDC | swap the stack pointers |
| JSRLAB_E1C2 | if ?? put a byte in the Tx buffer ?? |
| TXA | copy X |
| PHA | save X |
| JSRLAB_F526 | copy the next record to the record buffer |
| PLA | pull X |
| TAX | restore X |
| BCSLAB_F68D | if error just exit |
| JSRLAB_F56F | . |
| BCSLAB_F666 | . |
| BEQLAB_F666 | . |
| LDY#$00 | clear the record buffer index |
| LAB_F67D: ; $F67D | |
| LDALAB_078E,Y | get a record buffer byte |
| STALAB_0639,X | save it to the message buffer |
| INX | increment the message buffer index |
| INY | increment the record buffer index |
| CPYLAB_A4 | compare the record index with the buffered record length |
| BCCLAB_F67D | loop if more bytes to copy |
| CPX#$BE | compare X with the maximum length - one record |
| BCCLAB_F666 | loop if room for another record |
| LAB_F68D: ; $F68D | |
| RTS | |
| ************************************************************************************ | |
| RESET enters here | |
| LAB_F68E: ; $F68E | |
| CLT | clear T mode |
| CLD | clear decimal mode |
| SEI | disable interrupts |
| LDX#$00 | set the delay inner loop count |
| LDY#$00 | set the delay outer loop count |
| LAB_F695: ; $F695 | |
| DEX | decrement the inner loop count |
| BNELAB_F695 | loop if more to do |
| DEY | decrement the outer loop count |
| BNELAB_F695 | loop if more to do |
| TYA | clear A |
| LAB_F69C: ; $F69C | |
| STALAB_0100,Y | clear a stack byte |
| INY | increment the index |
| BNELAB_F69C | loop if more to do |
| STALAB_FF | clear interrupt control register 1 |
| STALAB_FE | clear interrupt control register 2 |
| STALAB_FD | clear interrupt control register 3 |
| STALAB_E6 | clear 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_F7 | set IOOO OOII, port 0 data direction register |
| LDA#$40 | set port 0 function |
| bit function | |
| --- -------- | |
| 7 unused | |
| 6 1 = b6 = TxD | |
| 5 0 = b5 = b5 | |
| 4 0 = b4 = b4 | |
| 3 0 = b3 = b3 | |
| 2 0 = b2 = b2 | |
| 1-0 unused | |
| STALAB_F5 | write port 0 function register |
| LDM#$60,LAB_F3 | write port 1 data register |
| bit function | |
| --- -------- | |
| 7 unused ?? | |
| 6 turn vref off | |
| 5 turn MT8870 off | |
| 4-0 inputs | |
| LDM#$E0,LAB_F4 | set OOOI IIII, port 1 data direction register |
| LDM#$00,LAB_F0 | clear 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_F1 | set IOOI OOOO, port 2 data direction register |
| LDM#$FF,LAB_EF | set OOOO OOOO, port 3 data direction register |
| LDM#$FF,LAB_EE | ?? port 3 data register |
| LDX#$FF | set X |
| TXS | set the stack pointer |
| JSRLAB_E087 | test the RAM ?? |
| JSRLAB_E12D | copy the vector table and values from LAB_E0DD |
| JSRLAB_E3C6 | set the default password |
| LDA#$00 | clear A |
| STALAB_1A | clear the 1/8th second countdown byte |
| STALAB_1B | clear the seconds countdown |
| STALAB_5E | clear the carrier detect |
| STALAB_0386 | . |
| STALAB_0396 | . |
| STALAB_03B6 | clear the ringback number buffer |
| STALAB_0402 | . |
| STALAB_39 | . |
| STALAB_3A | . |
| STALAB_3B | . |
| STALAB_3C | . |
| STALAB_36 | clear the meter value low byte |
| STALAB_37 | clear the meter value mid byte |
| STALAB_38 | clear the meter value high byte |
| JSRLAB_E14E | copy the default variable values to RAM |
| JSRLAB_E78F | set the default dates and times |
| SEB2,LAB_FF | set INT2 enable bit |
| CLI | enable interrupts |
| ************************************************************************************ | |
| main loop | |
| LAB_F6FD: ; $F6FD | |
| JSRLAB_E747 | setup the UART and timer 2 and clear the Tx/Rx buffers ?? |
| JSRLAB_E72E | release the line and wait 2 seconds |
| CLB6,LAB_F0 | clear b6 port 2 data register, turn the modem on |
| CLB5,LAB_F0 | clear b5 port 2 data register, set answer mode |
| CLB1,LAB_FF | clear INT1 request bit |
| SEB0,LAB_FF | set INT1 enable bit |
| LAB_F70B: ; $F70B | |
| JSR\LAB_FFDC | swap the stack pointers |
| BBS0,LAB_FE,LAB_F713 | if timer 1 interrupt enabled continue |
| STP | else stop the oscillator |
| BRALAB_F714 | continue after wake up |
| LAB_F713: ; $F713 | |
| WIT | stop the internal clock |
| LAB_F714: ; $F714 | |
| BBS7,LAB_F0,LAB_F71C | test b7 port 2 data register, ring detect |
| if ring detected go setup the URAT and check for carrier | |
| BBS0,LAB_FF,LAB_F70B | in INT1 not enabled go back to waiting |
| BRALAB_F724 | go continue connected mode |
| LAB_F71C: ; $F71C | |
| JSRLAB_E752 | setup the UART and timer 2 and clear the Tx/Rx buffers ?? |
| JSRLAB_E6F0 | wait 15 seconds for two seconds of new carrier |
| LAB_F722: ; $F722 | |
| BCSLAB_F6FD | if error return to the main loop |
| LAB_F724: ; $F724 | |
| LDM#$14,LAB_1B | set the seconds countdown to 20 seconds |
| LAB_F727: ; $F727 | |
| JSR\LAB_FF2A | receive and execute a command via LAB_021C vector ?? |
| BCCLAB_F727 | if no error go do another command |
| JSRLAB_E789 | wait for timer 2 ?? |
| JSRLAB_E73D | wait for 1/2 a second |
| BBS0,LAB_0A,LAB_F6FD | test the command loop flag, return to the main loop |
| BBC1,LAB_0A,LAB_F6FD | test the command loop flag, dial an outgoing number |
| JSRLAB_E60E | dial an outgoing number |
| BRALAB_F722 | return to the command loop |
| ************************************************************************************ | |
| unused, the assembler should fill this area with $FF bytes | |
| LAB_F73C: | |
| ************************************************************************************ | |
| .ORG$FF00 | |
| LAB_FF00: ; $FF00 | |
| JMP(LAB_0200) | . |
| LAB_FF03: ; $FF03 | |
| JMP(LAB_0202) | . |
| LAB_FF06: ; $FF06 | |
| JMP(LAB_0204) | . |
| LAB_FF09: ; $FF09 | |
| JMP(LAB_0206) | . |
| LAB_FF0C: ; $FF0C | |
| JMP(LAB_0208) | . |
| LAB_FF0F: | |
| JMP(LAB_020A) | . |
| LAB_FF12: | |
| JMP(LAB_020C) | . |
| LAB_FF15: | |
| JMP(LAB_020E) | . |
| LAB_FF18: | |
| JMP(LAB_0210) | . |
| LAB_FF1B: | |
| JMP(LAB_0212) | . |
| LAB_FF1E: | |
| JMP(LAB_0214) | . |
| LAB_FF21: | |
| JMP(LAB_0216) | . |
| LAB_FF24: ; $FF24 | |
| JMP(LAB_0218) | wait for a character from ?? |
| LAB_FF27: ; $FF27 | |
| JMP(LAB_021A) | put a byte in the Tx buffer |
| LAB_FF2A: ; $FF2A | |
| JMP(LAB_021C) | receive and execute a command ?? |
| LAB_FF2D: | |
| JMP(LAB_021E) | . |
| LAB_FF30: ; $FF30 | |
| JMP(LAB_0220) | . |
| LAB_FF33: ; $FF33 | |
| JMP(LAB_0222) | . |
| LAB_FF36: ; $FF36 | |
| JMP(LAB_0224) | . |
| LAB_FF39: ; $FF39 | |
| JMP(LAB_0226) | . |
| LAB_FF3C: ; $FF3C | |
| JMP(LAB_0228) | . |
| LAB_FF3F: ; $FF3F | |
| JMP(LAB_022A) | . |
| LAB_FF42: | |
| JMP(LAB_022C) | . |
| LAB_FF45: | |
| JMP(LAB_022E) | . |
| LAB_FF48: | |
| JMP(LAB_0230) | . |
| LAB_FF4B: | |
| JMP(LAB_0232) | . |
| LAB_FF4E: | |
| JMP(LAB_0234) | . |
| LAB_FF51: | |
| JMP(LAB_0236) | . |
| LAB_FF54: | |
| JMP(LAB_0238) | . |
| LAB_FF57: | |
| JMP(LAB_023A) | . |
| LAB_FF5A: | |
| JMP(LAB_023C) | . |
| LAB_FF5D: | |
| JMP(LAB_023E) | . |
| ************************************************************************************ | |
| unused, the assembler should fill this area with $FF bytes | |
| LAB_FF60: | |
| ************************************************************************************ | |
| swap the stack pointers | |
| .ORG$FFDC | |
| LAB_FFDC: ; $FFDC | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| TSX | copy the stack pointer |
| LDALAB_00 | get the alternate stack pointer |
| STXLAB_00 | save this stack pointer |
| TAX | copy the alternate pointer to X |
| TXS | set the stack pointer |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTS | |
| ************************************************************************************ | |
| swap the stack pointers and stop the internal clock | |
| LAB_FFEE: ; $FFEE | |
| JSR\LAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| RTS | |
| ************************************************************************************ | |
| unused | |
| LAB_FFF2: | |
| STP | else stop the oscillator |
| RTS | |
| ************************************************************************************ | |
| processor vectors | |
| .ORG $FFF4 ; vectors start address | |
| .WORDLAB_FF00 | TC, CNTR or BRK |
| .WORDLAB_FF03 | HE or VE |
| .WORDLAB_FF06 | TIMER 1, 2 or 3 |
| .WORDLAB_FF09 | RI or INT1 |
| .WORDLAB_FF0C | INT2 |
| .WORDLAB_F68E | RESET |
| .END | |
| ************************************************************************************ | |