| ************************************************************************************ | |
| bit correct m50734 board ROM disassembly | |
| LAB_00 = $00 ; RAM size | |
| byt value | |
| --- ----- | |
| $00 32K | |
| $01 64K | |
| $02 160K | |
| LAB_01 = $01 ; RAM end low byte | |
| LAB_02 = $02 ; RAM end high byte | |
| LAB_03 = $03 ; ?? buffer write index | |
| LAB_04 = $04 ; ?? buffer read index | |
| LAB_05 = $05 ; Tx buffer write index | |
| LAB_06 = $06 ; Tx buffer read index | |
| LAB_07 = $07 ; alternate stack pointer | |
| LAB_08 = $08 ; signed on flag | |
| byt value | |
| --- ----- | |
| $00 disconnected | |
| $xx signed on | |
| LAB_09 = $09 ; sign on retry count | |
| LAB_0A = $0A ; system flags ?? | |
| bit function | |
| --- -------- | |
| 7 1 = break | |
| 6 1 = pause output | |
| 5 ?? | |
| 4-0 unused ?? | |
| LAB_0B = $0B ; break value | |
| LAB_0C = $0C ; Rx buffer read index | |
| LAB_0D = $0D ; decimal value low byte ?? pointer low byte | |
| LAB_0E = $0E ; decimal value mid byte ?? pointer high byte | |
| LAB_0F = $0F ; decimal value high byte | |
| LAB_10 = $10 ; date/time pointer low byte RAM test pointer low byte | |
| LAB_11 = $11 ; date/time pointer high byte RAM test pointer high byte | |
| LAB_12 = $12 ; remainder/partial low byte | |
| LAB_13 = $13 ; remainder/partial high byte | |
| LAB_14 = $14 ; divisor/multiplicand low byte | |
| LAB_15 = $15 ; divisor/multiplicand high byte | |
| LAB_16 = $16 ; dividend/multiplier low byte | |
| LAB_17 = $17 ; dividend/multiplier high byte | |
| LAB_18 = $18 ;to $001D, hex to decimal conversion space | |
| LAB_19 = $19 ;to $001D, hex to decimal conversion space | |
| LAB_1A = $1A ;to $001D, hex to decimal conversion space | |
| LAB_1B = $1B ;to $001D, hex to decimal conversion space | |
| LAB_1C = $1C ;to $001D, hex to decimal conversion space | |
| LAB_1D = $1D ;to $001D, hex to decimal conversion space | |
| LAB_1E = $1E ; Absolute line voltage | |
| LAB_1F = $1F ; A2D channel 0 byte | |
| LAB_20 = $20 ; | |
| LAB_21 = $21 ; A2D channel 1 byte | |
| LAB_22 = $22 ; | |
| LAB_23 = $23 ; A2D channel 2 byte | |
| LAB_24 = $24 ; | |
| LAB_25 = $25 ; A2D channel 3 byte | |
| LAB_26 = $26 ; max + 1 for date and time | |
| LAB_28 = $28 ; max + 1 for days in the month | |
| LAB_29 = $29 ; max + 1 for hours in the day | |
| LAB_2D = $2D ; signed off date/time | |
| LAB_34 = $34 ; temporary year | |
| LAB_35 = $35 ; temporary month | |
| LAB_36 = $36 ; temporary date | |
| LAB_37 = $37 ; temporary hour | |
| LAB_38 = $38 ; temporary minute | |
| LAB_39 = $39 ; temporary second | |
| LAB_3A = $3A ; temporary 1/8th seconds | |
| LAB_3B = $3B ; start hour | |
| LAB_3C = $3C ; start minute | |
| LAB_3D = $3D ; start second | |
| LAB_3E = $3E ; cleared but never read ?? | |
| LAB_3F = $3F ; 1/8th second countdown byte | |
| LAB_40 = $40 ; seconds count low byte | |
| LAB_41 = $41 ; seconds count high byte | |
| LAB_42 = $42 ; digit to dial | |
| LAB_43 = $43 ; pulse count | |
| LAB_44 = $44 ; digit count | |
| LAB_45 = $45 ;. | |
| LAB_46 = $46 ; digit index | |
| LAB_47 = $47 ; next record pointer low byte | |
| LAB_48 = $48 ; next record pointer mid byte | |
| LAB_49 = $49 ; next record pointer high byte | |
| LAB_4A = $4A ; update pointer low byte | |
| LAB_4B = $4B ; update pointer mid byte | |
| LAB_4C = $4C ; update pointer high byte | |
| LAB_4D = $4D ; current record pointer low byte | |
| LAB_4E = $4E ; current record pointer mid byte | |
| LAB_4F = $4F ; current record pointer high byte | |
| LAB_50 = $50 ; buffered record length | |
| LAB_51 = $51 ; filter flags byte | |
| bit function | |
| --- -------- | |
| 7 ?? | |
| 6 1 = number filter | |
| 5 1 = date filter | |
| 4 1 = metered units filter | |
| 3-0 ?? unused | |
| LAB_52 = $52 ; call type match byte | |
| LAB_53 = $53 ; call type mask byte | |
| LAB_54 = $54 ; last output year/month/date low byte | |
| LAB_55 = $55 ; last output year/month/date high byte | |
| LAB_56 = $56 ; start date low byte | |
| LAB_57 = $57 ; start date high byte | |
| LAB_58 = $58 ; end date low byte | |
| LAB_59 = $59 ; end date high byte | |
| LAB_5A = $5A ;. | |
| LAB_5B = $5B ; minimum number of numeric digits | |
| LAB_5C = $5C ; minimum length of the output | |
| LAB_5D = $5D ; decimal point position | |
| LAB_5E = $5E ; checksum low byte | |
| LAB_5F = $5F ; checksum high byte | |
| LAB_60 = $60 ; block number low byte | |
| LAB_61 = $61 ; block number high byte | |
| LAB_62 = $62 ; block length | |
| LAB_63 = $63 ; record RAM pointer low byte | |
| LAB_64 = $64 ; record RAM pointer high byte | |
| LAB_65 = $65 ; ?? size low byte | |
| LAB_66 = $66 ; ?? size high byte | |
| LAB_67 = $67 ; calls low byte | |
| LAB_68 = $68 ; calls high byte | |
| LAB_69 = $69 ; units low byte | |
| LAB_6A = $6A ; units high byte | |
| LAB_6B = $6B ; digits value | |
| byt value | |
| --- ----- | |
| $00 auto | |
| $01 pulse | |
| $02 dtmf | |
| $03 mixed | |
| LAB_6C = $6C ; pulses value | |
| byt value | |
| --- ----- | |
| $00 rev | |
| $01 spm16 | |
| $02 spm | |
| $03 xspm | |
| $04 m+ | |
| $05 m- | |
| LAB_6D = $6D ; VThreshold value | |
| LAB_6E = $6E ; TSeized value | |
| LAB_6F = $6F ; TPulse value | |
| LAB_70 = $70 ; TDial value | |
| LAB_71 = $71 ; rvs value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 on | |
| LAB_72 = $72 ; ECall value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 on | |
| LAB_73 = $73 ; park value | |
| byt value | |
| --- ----- | |
| $00 off | |
| $01 txe | |
| $02 rev | |
| LAB_74 = $74 ; calls logged low byte | |
| LAB_75 = $75 ; calls logged high byte | |
| LAB_76 = $76 ; meter value low byte | |
| LAB_77 = $77 ; meter value mid byte | |
| LAB_78 = $78 ; meter value high byte | |
| LAB_79 = $79 ; current year | |
| LAB_7A = $7A ; current month | |
| LAB_7B = $7B ; current date | |
| LAB_7C = $7C ; current hour | |
| LAB_7D = $7D ; current minute | |
| LAB_7E = $7E ; current second | |
| LAB_7F = $7F ; current 1/8th seconds count | |
| the date on which GMT begins | |
| LAB_80 = $80 ; GMT year | |
| LAB_81 = $81 ; GMT month | |
| LAB_82 = $82 ; GMT date | |
| the date on which BST begins | |
| LAB_83 = $83 ; BST year | |
| LAB_84 = $84 ; BST month | |
| LAB_85 = $85 ; BST date | |
| LAB_86 = $86 ;. | |
| LAB_87 = $87 ;. | |
| LAB_88 = $88 ;. | |
| LAB_89 = $89 ;. | |
| LAB_8A = $8A ;. | |
| LAB_8B = $8B ;. | |
| LAB_8C = $8C ; port 1 last read value | |
| LAB_8D = $8D ;. | |
| LAB_8E = $8E ; Used for all sorts of stuff | |
| bit value | |
| --- ----- | |
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| LAB_8F = $8F ;. | |
| LAB_90 = $90 ;. | |
| LAB_91 = $91 ; dialed number buffer index | |
| LAB_92 = $92 ;. | |
| LAB_93 = $93 ; seconds countdown | |
| LAB_94 = $94 ; integer part of VThreshold * 2.277 | |
| LAB_95 = $95 ;. | |
| LAB_96 = $96 ;. | |
| LAB_97 = $97 ;. | |
| LAB_98 = $98 ;. | |
| LAB_99 = $99 ;. | |
| LAB_9A = $9A ; ?? year | |
| LAB_9B = $9B ; ?? month | |
| LAB_9C = $9C ; ?? date | |
| LAB_9D = $9D ;Linked } | |
| LAB_9E = $9E ;Linked } | |
| LAB_9F = $9F ;Linked } | |
| LAB_A1 = $A1 ;Time difference | |
| LAB_A4 = $A4 ;LAB_A4 + $00 | |
| LAB_A8 = $A8 ;LAB_A4 + $01 | |
| LAB_AB = $AB ;LAB_A4 + $02 | |
| LAB_AC = $AC ;. | |
| LAB_AD = $AD ;. | |
| LAB_AE = $AE ; call duration 1/8th seconds | |
| LAB_AF = $AF ; line seized hours ?? | |
| LAB_B0 = $B0 ; line seized minutes ?? | |
| LAB_B1 = $B1 ; line seized seconds ?? | |
| LAB_B2 = $B2 ;. | |
| LAB_B3 = $B3 ; record memory start pointer low byte | |
| LAB_B4 = $B4 ; record memory start pointer mid byte | |
| LAB_B5 = $B5 ; record memory start pointer high byte | |
| LAB_B6 = $B6 ; record memory end pointer low byte | |
| LAB_B7 = $B7 ; record memory end pointer mid byte | |
| LAB_B8 = $B8 ; record memory end pointer high byte | |
| LAB_B9 = $B9 ; Used for all sorts of stuff | |
| bit value | |
| --- ----- | |
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| ************************************************************************************ | |
| internal hardware | |
| LAB_DC = $DC ; prescaller 1 | |
| LAB_DD = $DD ; timer 1 | |
| LAB_DE = $DE ; prescaller 2 | |
| LAB_DF = $DF ; timer 2 | |
| LAB_E4 = $E4 ; UART Tx shift register | |
| LAB_E5 = $E5 ; UART Rx buffer register | |
| LAB_E6 = $E6 ; UART control register | |
| bit function | |
| --- -------- | |
| 7 {1|0} = Rx {enabled|disabled} | |
| 6 {1|0} = Tx {enabled|disabled} | |
| 5 x = unused | |
| 4 {1|0} = Rx interrupt {enabled|disabled} | |
| 3 {1|0} = {Xin/32|Xin/8} | |
| 2 {1|0} = {odd|even} parity | |
| 1 {1|0} = parity {enabled|disabled} | |
| 0 {1|0} = {8|7} bit | |
| LAB_E7 = $E7 ; UART status register | |
| bit function | |
| --- -------- | |
| 7 x = unused | |
| 6 x = unused | |
| 5 x = unused | |
| 4 overrun error | |
| 3 framing | |
| 2 parity | |
| 1 Tx complete | |
| 0 Rx interrupt | |
| LAB_E9 = $E9 ; A2D control register | |
| LAB_EA = $EA ; A2D register | |
| LAB_EE = $EE ; port 3 data register | |
| LAB_EF = $EF ; port 3 data direction register | |
| LAB_F0 = $F0 ; port 2 data register | |
| bit function | |
| --- -------- | |
| 7 ring detect | |
| 6 podem power control | |
| 5 modem mode, 1/0 originate/answer ?? | |
| 4 0 = carrier detect from modem | |
| 3 modem/RS232 select | |
| 2-0 unused ?? | |
| LAB_F1 = $F1 ; port 2 data direction register | |
| LAB_F3 = $F3 ; port 1 data register | |
| bit function | |
| --- -------- | |
| 7 ?? | |
| 6 vref power control | |
| 5 MT8870 power control | |
| 4 DTMF tone valid | |
| 3-0 DTMF tone vaue | |
| LAB_F4 = $F4 ; port 1 data direction register | |
| LAB_F5 = $F5 ; port 0 function register | |
| bit function | |
| --- -------- | |
| 7 unused | |
| 6 {1|0} = b6 = {TxD | P06} | |
| 5 {1|0} = b5 = {DME | P05} | |
| 4 {1|0} = b4 = {STBout | P04} | |
| 3 {1|0} = b3 = {BUSYout | P03} | |
| 2 {1|0} = b2 = {CNTR | P02} | |
| 1 unused | |
| 0 unused | |
| LAB_F6 = $F6 ; port 0 data register | |
| bit function | |
| --- -------- | |
| 7-5 unused ?? | |
| 4 RAM A16 | |
| 3-0 unused ?? | |
| LAB_F7 = $F7 ; port 0 data direction register | |
| LAB_FB = $FB ; BAUD rate generator | |
| LAB_FD = $FD ; interrupt control register 3 | |
| LAB_FE = $FE ; interrupt control register 2 | |
| LAB_FF = $FF ; interrupt control register 1 | |
| ************************************************************************************ | |
| RAM use | |
| LAB_0100 = $0100 ; bottom of stack | |
| LAB_0200 = $0200 ; block buffer, password buffer | |
| LAB_0300 = $0300 ; ?? buffer | |
| LAB_0400 = $0400 ; to $0405, Tx buffer | |
| LAB_0406 = $0406 ; to $xxxx, Rx buffer | |
| LAB_0456 = $0456 ; to $04A5, message buffer 1 | |
| LAB_04A6 = $04A6 ; to $04F5, message buffer 2 | |
| LAB_04F6 = $04F6 ; record seconds b0 byte | |
| bit function | |
| --- -------- | |
| 7 record start seconds b0 | |
| 6 record cleared seconds b0 | |
| 5 record ans/last seconds b0 | |
| 4-0 record length | |
| LAB_04F7 = $04F7 ; record call type | |
| LAB_04F8 = $04F8 ; record year/month/date low byte | |
| LAB_04F9 = $04F9 ; record year/month/date high byte | |
| LAB_04FA = $04FA ; record start minutes and seconds | |
| LAB_04FB = $04FB ; record start hours and minutes | |
| LAB_04FC = $04FC ; record cleared minutes and seconds | |
| LAB_04FD = $04FD ; record cleared hours and minutes | |
| LAB_04FE = $04FE ; record ans/last minutes and seconds | |
| LAB_04FF = $04FF ; record ans/last hours and minutes | |
| LAB_0500 = $0500 ; record metered units low byte | |
| LAB_0501 = $0501 ; record metered units high byte | |
| LAB_0502 = $0502 ; record number to $0515 max | |
| LAB_0516 = $0516 ; record seconds b0 byte | |
| bit function | |
| --- -------- | |
| 7 record start seconds b0 | |
| 6 record cleared seconds b0 | |
| 5 record ans/last seconds b0 | |
| 4-0 record length | |
| LAB_0517 = $0517 ; record call type | |
| LAB_0518 = $0518 ; record year/month/date low byte | |
| LAB_0519 = $0519 ; record year/month/date high byte | |
| LAB_051A = $051A ; record start minutes and seconds | |
| LAB_051B = $051B ; record start hours and minutes | |
| LAB_051C = $051C ; record cleared minutes and seconds | |
| LAB_051D = $051D ; record cleared hours and minutes | |
| LAB_051E = $051E ; record ans/last minutes and seconds | |
| LAB_051F = $051F ; record ans/last hours and minutes | |
| LAB_0520 = $0520 ; record metered units low byte | |
| LAB_0521 = $0521 ; record metered units high byte | |
| LAB_0522 = $0522 ; record number to $0535 max | |
| LAB_0536 = $0536 ; to $0546 ??, password | |
| LAB_0547 = $0547 ; to $0550, num value | |
| LAB_0551 = $0551 ; to $0558, ref value | |
| LAB_0559 = $0559 ; to $0577, dialed number digit buffer | |
| LAB_0578 = $0578 ; ?? minutes/seconds | |
| LAB_0579 = $0579 ; ?? hours/minutes | |
| LAB_057A = $057A ;. | |
| LAB_05A0 = $05A0 ; metered units limit low byte | |
| LAB_05A1 = $05A1 ; metered units limit high byte | |
| LAB_0600 = $0600 ;. | |
| ************************************************************************************ | |
| ROM from $E000 | |
| .ORG$E000 | |
| LAB_E000: ; $E000 | |
| .WORD$2919 | serial # and encoded password number 37521 |
| LAB_E002: ; $E002 | |
| .WORD$0052 | version # |
| LAB_E004: ; $E004 | |
| .BYTE$FF | VBattery constant |
| ************************************************************************************ | |
| default values | |
| LAB_E005: ; $E005 | |
| .BYTE$00 | digits default value |
| .BYTE$03 | pulses default value |
| .BYTE$2C | 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 |
| ************************************************************************************ | |
| default break value | |
| LAB_E00E: ; $E00E | |
| .BYTE$03 | [CTRL+C] |
| ************************************************************************************ | |
| RESET enters here | |
| LAB_E00F: ; $E00F | |
| CLT | clear T mode |
| CLD | clear decimal mode |
| SEI | disable the interrupts |
| LDA#$00 | clear A |
| 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 = P05 | |
| 4 0 = b4 = P04 | |
| 3 0 = b3 = P03 | |
| 2 0 = b2 = P02 | |
| 1 unused | |
| 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#$7F | set X |
| TXS | set the stack pointer |
| LDA#<LAB_FB78 | . |
| PHA | push the routine address high byte |
| LDA#>LAB_FB78-1 | . |
| PHA | push the routine address low byte |
| PHA | . |
| PHA | . |
| PHA | . |
| TSX | copy the stack pointer |
| STXLAB_07 | save the alternate stack pointer |
| LDX#$FF | set X |
| TXS | set the stack pointer |
| JSRLAB_F14F | setup the UART and timer 2 and clear the Tx/Rx buffers ?? |
| SEB2,LAB_FF | set INT2 enable bit |
| JSRLAB_F44B | set the default date/time and clear the line seized time |
| JSRLAB_F17C | test the RAM ?? |
| JSRLAB_E143 | set the default password to "ALICE" |
| LDA#$00 | clear A |
| STALAB_0A | clear the system flags byte |
| STALAB_3E | clear byte, only cleared never read ?? |
| STALAB_3F | clear the 1/8th second countdown byte |
| STALAB_0547 | clear num |
| STALAB_0551 | clear ref |
| STALAB_0456 | clear message buffer 1 |
| STALAB_04A6 | clear message buffer 2 |
| LDALAB_E00E | get the break default value |
| STALAB_0B | save the break value |
| CLI | enable the interrupts |
| main loop | |
| LAB_E072: ; $E072 | |
| LDM#$00,LAB_08 | clear the signed on flag |
| JSRLAB_F12F | 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 |
| LAB_E07C: ; $E07C | |
| CLB1,LAB_FF | clear INT1 request bit |
| SEB0,LAB_FF | set INT1 enable bit |
| LAB_E080: ; $E080 | |
| JSRLAB_FFDC | swap the stack pointers |
| BBS0,LAB_FE,LAB_E089 | if timer 1 interrupt enabled continue |
| STP | else stop the oscillator |
| BRALAB_E08A | continue after wake up |
| LAB_E089: ; $E089 | |
| WIT | stop the internal clock |
| LAB_E08A: ; $E08A | |
| BBS7,LAB_F0,LAB_E09E | test b7 port 2 data register, ring detect |
| if ring detected go ?? | |
| BBS0,LAB_FF,LAB_E080 | in INT1 not enabled go back to waiting |
| LDALAB_04 | get the ?? buffer read index |
| STALAB_03 | save the ?? buffer write index |
| clear the buffer | |
| JSRLAB_F2C0 | wait for a character from ?? |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| CLB7,A | mask 0xxx xxxx, 7 bit ASCII |
| CMP#$0D | compare the character with [CR] |
| BEQLAB_E0A3 | if [CR] go do sign on |
| BRALAB_E07C | else go back to sleep |
| LAB_E09E: ; $E09E | |
| JSRLAB_F0E3 | wait 15 seconds for two seconds of new carrier |
| BCSLAB_E072 | if error loop |
| LAB_E0A3: ; $E0A3 | |
| JSRLAB_E0E4 | sign on |
| BCSLAB_E0CB | if sign on failed go disconnect |
| signed on command loop | |
| LAB_E0A8: ; $E0A8 | |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LDA#>$FDA8 | set the seconds count low byte, 600 seconds |
| LDX#<$FDA8 | set the seconds count high byte, 600 seconds |
| JSRLAB_F269 | wait -AX seconds for input |
| BCSLAB_E0C5 | if timed out go do disconnect |
| JSRLAB_E20D | find and execute a command |
| LDM#$00,LAB_0A | clear the system flags byte |
| BCCLAB_E0C1 | if no error skip the [BELL] output |
| LDA#$07 | [BELL] character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LAB_E0C1: ; $E0C1 | |
| TSTLAB_08 | test the signed on flag |
| BNELAB_E0A8 | if signed on stay in the command loop |
| LAB_E0C5: ; $E0C5 | |
| JSRLAB_F49A | copy the current date/time to the signed off time |
| JSRLAB_FB36 | copy the current record pointer to the update point |
| LAB_E0CB: ; $E0CB | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'disconnected',$0D,$0A,$00 | |
| JSRLAB_F443 | wait for timer 2 ?? |
| BRALAB_E072 | loop |
| ************************************************************************************ | |
| sign on | |
| LAB_E0E4: ; $E0E4 | |
| LDM#$03,LAB_09 | set the retry count ?? |
| BRALAB_E0F2 | branch into the sign on loop |
| LAB_E0E9: ; $E0E9 | |
| DECLAB_09 | decrement the retry count ?? |
| BEQLAB_E142 | if all done just exit |
| LDA#$07 | [BELL] character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LAB_E0F2: ; $E0F2 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'sign on ',$05,$00 | |
| LDA#>$FFC4 | set the seconds count low byte, 60 seconds |
| LDX#<$FFC4 | set the seconds count high byte, 60 seconds |
| JSRLAB_F269 | wait -AX seconds for input |
| BCSLAB_E142 | if timed out go exit |
| JSRLAB_E151 | check the password |
| BCCLAB_E114 | if ok go sign in |
| JSRLAB_E169 | check the district set password &4He#r"!:37521 |
| BCSLAB_E0E9 | if error go decrement the retry count and try again |
| LAB_E114: ; $E114 | |
| COMLAB_08 | toggle the signed on flag |
| JSRLAB_E1E3 | output 'Monolog ', serial#, version#, RAM size |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'time on ',$00 | |
| JSRLAB_F685 | output the current day/date/time |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'last on ',$00 | |
| JSRLAB_F68E | output the signed off day/date/time |
| JSRLAB_E776 | display the number of calls logged |
| JSRLAB_E5A8 | transmit message buffers 1 and 2 |
| CLC | flag sign on success |
| LAB_E142: ; $E142 | |
| RTS | |
| ************************************************************************************ | |
| set the default password | |
| LAB_E143: ; $E143 | |
| LDX#$FF | set the index for pre increment |
| TXA | copy to A |
| LAB_E146: ; $E146 | |
| INX | increment the index |
| SEC | set carry for subtract |
| SBCLAB_E196,X | subtract an obfuscated default password character |
| STALAB_0536,X | save a password character |
| BNELAB_E146 | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| check the password | |
| LAB_E151: ; $E151 | |
| LDX#$FF | set the index for pre increment |
| LAB_E153: ; $E153 | |
| INX | increment the index |
| LDALAB_0406,X | get a character from the Rx buffer |
| BEQLAB_E162 | if null go check the length |
| EORLAB_0536,X | compare it with a password character |
| AND#$DF | mask xx0x xxxx, make it case insensetive |
| BEQLAB_E153 | if a match loop for the next character |
| LAB_E160: ; $E160 | |
| SEC | flag error |
| RTS | |
| LAB_E162: ; $E162 | |
| EORLAB_0536,X | compare it with the password null |
| BNELAB_E160 | if not the same go do error exit |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| check the district set password &4He#r"!:37521 | |
| LAB_E169: ; $E169 | |
| LDX#$00 | clear the index |
| LAB_E16B: ; $E16B | |
| LDALAB_0406,X | get a character from the Rx buffer |
| BEQLAB_E160 | if null go do error exit |
| INX | increment the index |
| EORLAB_E19C-1,X | compare the character with a ?? character |
| BEQLAB_E16B | if a match loop for the next character |
| LDALAB_E19C-1,X | get the district set password character |
| BNELAB_E160 | if not null go do error exit |
| STXLAB_0C | save the Rx buffer read index |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_E160 | if there is a following character go do error exit |
| RRFLAB_0D | swap the nibbles |
| LDALAB_0D | get the number low byte |
| CMPLAB_E000 | compare it with the serial number low byte |
| BNELAB_E160 | if not a match go do error exit |
| RRFLAB_0E | swap the nibbles |
| LDALAB_0E | get the number high byte |
| CMPLAB_E000+1 | compare it with the serial number high byte |
| BNELAB_E160 | if not a match go do error exit |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| obfuscated default password | |
| LAB_E196: ; $E196 | |
| .BYTE$BE,$F5,$03,$06,$FE,$45 | |
| "ALICE",$00 | |
| ************************************************************************************ | |
| district set password text | |
| LAB_E19C: ; $E19C | |
| .BYTE'&4He#r"!:',$00 | &4He#r"!: |
| ************************************************************************************ | |
| change the password, min four characters, max fifteen characters, requires confirm | |
| LAB_E1A6: ; $E1A6 | |
| LDY#$FF | set the index for pre increment |
| LAB_E1A8: ; $E1A8 | |
| INY | increment the index |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| STALAB_0200,Y | save the character to the password buffer |
| BNELAB_E1A8 | loop if not a null character |
| CPY#$04 | compare the index with the minimum |
| BCCLAB_E1E1 | if less than the minimum go return an error |
| CPY#$11 | compare the index with the maximum + 1 |
| BCSLAB_E1E1 | if greater than the maximum go return an error |
| JSRLAB_E750 | prompt for confirm, return Cb = 0 if confirmed |
| BCSLAB_E1E1 | if not confirmed go return an error |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'changed to ',$00 | |
| LDY#$FF | set the index for pre increment |
| LAB_E1D1: ; $E1D1 | |
| INY | increment the index |
| LDALAB_0200,Y | get a buffered password character |
| STALAB_0536,Y | save a password character |
| BEQLAB_E1DF | if null just exit |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| BRALAB_E1D1 | loop for the next character |
| LAB_E1DF: ; $E1DF | |
| CLC | flag ok |
| RTS | |
| LAB_E1E1: ; $E1E1 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| output 'Monolog ', serial#, version#, RAM size | |
| LAB_E1E3: ; $E1E3 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'Monolog ',$00 | |
| LDALAB_E000 | get the serial number low byte |
| LDXLAB_E000+1 | get the serial number high byte |
| JSRLAB_F36A | output AX as a three digit decimal value |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| LDALAB_E002 | get the version number low byte |
| LDXLAB_E002+1 | get the version number high byte |
| JSRLAB_F35D | output AX as a xx.xx digit decimal value |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| JSRLAB_F1C7 | display the RAM size |
| RTS | |
| ************************************************************************************ | |
| find and execute a command | |
| LAB_E20D: ; $E20D | |
| LDM#>LAB_E265,LAB_0D | set the command table pointer low byte |
| LDM#<LAB_E265,LAB_0E | set the command table pointer high byte |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| CLC | flag ok |
| BEQLAB_E22D | if null just exit |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E22D | if not found just return the error |
| INY | increment the command table index |
| LDA(LAB_0D),Y | get the command vector low byte |
| PHA | save the vector low byte |
| INY | increment the command table index |
| LDA(LAB_0D),Y | get the command vector high byte |
| STALAB_0E | save the jump vector high byte |
| PLA | restore the vector low byte |
| STALAB_0D | save the jump vector low byte |
| .BYTE$6C | force the long form .. |
| .WORDLAB_0D | .. of JMP ($xxxx) |
| JMP (LAB_0D) ; go do the command | |
| LAB_E22D: ; $E22D | |
| RTS | |
| ************************************************************************************ | |
| search for a command, return Cb=0 if found | |
| LAB_E22E: ; $E22E | |
| LDXLAB_0C | get the Rx buffer read index |
| LDY#$00 | clear the index |
| LAB_E232: ; $E232 | |
| LDA(LAB_0D),Y | get a character from the command table |
| BEQLAB_E263 | if end marker go do error exit |
| EORLAB_0406,X | compare it with a character from the Rx buffer |
| AND#$DF | mask xx0x xxxx, make it case insensetive |
| BEQLAB_E25A | if a match go do the next character |
| ASLA | shift b7 out |
| BNELAB_E247 | if not a match go find the next command in the table |
| else matched a command word | |
| LDALAB_0406,X | get the last character from the Rx buffer |
| CMP#' ' | compare it with [SPACE] |
| BNELAB_E25E | if not [SPACE] go return the found command, branch always |
| LAB_E247: ; $E247 | |
| LDA(LAB_0D),Y | get a character from the command table |
| INY | increment the command table index |
| BBC7,A,LAB_E247 | if not an end marker go get another character |
| INY | increment the command table index past the vector lo word |
| INY | increment the command table index past the vector hi word |
| TYA | copy the command table index |
| CLC | clear carry for add |
| ADCLAB_0D | add the command table pointer low byte |
| STALAB_0D | save the command table pointer low byte |
| BCCLAB_E22E | if no carry go try the next command word |
| INCLAB_0E | else increment the command table pointer high byte |
| BRALAB_E22E | and go try the next command word |
| LAB_E25A: ; $E25A | |
| INY | increment the command table index |
| INX | increment the Rx buffer index |
| BRALAB_E232 | go do the next character |
| LAB_E25E: ; $E25E | |
| INX | increment the Rx buffer index |
| STXLAB_0C | save the Rx buffer read index |
| CLC | flag ok |
| RTS | |
| LAB_E263: ; $E263 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| command table | |
| LAB_E265: ; $E265 | |
| .BYTE'TIM','E'+$80 | "TIME" |
| .WORDLAB_F57F | display or set the time |
| .BYTE'DAT','E'+$80 | "DATE" |
| .WORDLAB_F58A | display or set the date |
| .BYTE'OFF',$80 | "OFF" |
| .WORDLAB_E721 | sign off |
| .BYTE'V','L'+$80 | "VL" |
| .WORDLAB_EFBD | display the line votage |
| .BYTE'V','B'+$80 | "VB" |
| .WORDLAB_F037 | display the battery voltage |
| .BYTE'V','T'+$80 | "VT" |
| .WORDLAB_EFF1 | display or set the VThreshold value |
| .BYTE'RINGBAC','K'+$80 | "RINGBACK" |
| .WORDLAB_EF1C | hang up and call the entered number back |
| .BYTE'LIVE',$80 | "LIVE" |
| .WORDLAB_EEA2 | display the current call status until break |
| .BYTE'LIS','T'+$80 | "LIST" |
| .WORDLAB_E838 | display the logged call short form data as ASCII text |
| .BYTE'L'+$80 | "L" |
| .WORDLAB_E838 | same as above |
| .BYTE'FLIS','T'+$80 | "FLIST" |
| .WORDLAB_E834 | display the logged call data as ASCII text |
| .BYTE'F','L'+$80 | "FL" |
| .WORDLAB_E834 | same as above |
| .BYTE'DOWNLOA','D'+$80 | "DOWNLOAD" |
| .WORDLAB_ECD6 | transfer logged call data |
| .BYTE'D','L'+$80 | "DL" |
| .WORDLAB_ECD6 | same as above |
| .BYTE'AUTOLOA','D'+$80 | "AUTOLOAD" |
| .WORDLAB_ECCD | transfer logged call data then automatically disconnect |
| .BYTE'A','L'+$80 | "AL" |
| .WORDLAB_ECCD | same as above |
| .BYTE'INF','O'+$80 | "INFO" |
| .WORDLAB_E7CF | display the total number of calls stored in memory |
| .BYTE'UPDAT','E'+$80 | "UPDATE" |
| .WORDLAB_E9B9 | display or set the update date |
| .BYTE'NEW',$80 | "NEW" |
| .WORDLAB_E790 | clear the logged calls and metered units |
| .BYTE'NEW/Y',$80 | "NEW/Y" |
| .WORDLAB_E79E | clear the logged calls and metered units without confirm |
| .BYTE'CALLS',$80 | "CALLS" |
| .WORDLAB_E776 | display the number of calls logged |
| .BYTE'DIGIT','S'+$80 | "DIGITS" |
| .WORDLAB_E5D8 | display or set the digit mode |
| .BYTE'PULSE','S'+$80 | "PULSES" |
| .WORDLAB_E602 | display or set the meter pulse mode |
| .BYTE'RV','S'+$80 | "RVS" |
| .WORDLAB_E66D | display or set the ringing reversal detection |
| .BYTE'E','C'+$80 | "EC" |
| .WORDLAB_E648 | display or set the earth call setting |
| .BYTE'PAR','K'+$80 | "PARK" |
| .WORDLAB_E694 | display or set the park detection setting |
| .BYTE'METE','R'+$80 | "METER" |
| .WORDLAB_E7A6 | display or set the number of metered units |
| .BYTE'MS','G'+$80 | "MSG" |
| .WORDLAB_E580 | display or set the message(s) |
| .BYTE'PASSWOR','D'+$80 | "PASSWORD" |
| .WORDLAB_E1A6 | change the password |
| .BYTE'NU','M'+$80 | "NUM" |
| .WORDLAB_E42E | display or set the target number |
| .BYTE'RE','F'+$80 | "REF" |
| .WORDLAB_E3D8 | display or set the REF value |
| .BYTE'DIA','G'+$80 | "DIAG" |
| .WORDLAB_E738 | display all four voltage inputs |
| .BYTE'STATUS',$80 | "STATUS" |
| .WORDLAB_E545 | display the current settings and metered values |
| .BYTE'DEFAUL','T'+$80 | "DEFAULT" |
| .WORDLAB_E53B | return parameters to their defaut settings |
| .BYTE'BREA','K'+$80 | "BREAK" |
| .WORDLAB_E509 | display or set the break character |
| .BYTE'T','S'+$80 | "TS" |
| .WORDLAB_E493 | display or set the minimum recognised line seizure |
| .BYTE'T','P'+$80 | "TP" |
| .WORDLAB_E4BC | display or set the pulse dial timing |
| .BYTE'T','D'+$80 | "TD" |
| .WORDLAB_E4E4 | display or set the dialled digit timeout |
| .BYTE'GM','T'+$80 | "GMT" |
| .WORDLAB_E389 | display or set the GMT start date |
| .BYTE'BS','T'+$80 | "BST" |
| .WORDLAB_E3B4 | display or set the BST start date |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| get a BST or GMT start date, must be a sunday, return Cb = 1 if error | |
| LAB_E35D: ; $E35D | |
| JSRLAB_F5C5 | get the date as DD MMM YYYY |
| BCSLAB_E387 | if error just exit |
| LDM#>LAB_34,LAB_10 | set the date pointer low byte |
| LDM#<LAB_34,LAB_11 | set the date pointer high byte |
| JSRLAB_F62F | calculate the day from the date |
| BNELAB_E375 | if not a sunday go report and flag the error |
| LDALAB_34 | get the entered year |
| LDXLAB_35 | get the entered month |
| LDYLAB_36 | get the entered date |
| CLC | flag ok |
| RTS | |
| LAB_E375: ; $E375 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'not a Sunday',$00 | |
| LAB_E387: ; $E387 | |
| SEC | flag an error |
| LAB_E388: ; $E388 | |
| RTS | |
| ************************************************************************************ | |
| display or set the GMT start date | |
| LAB_E389: ; $E389 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E399 | if null just go output the current value |
| JSRLAB_E35D | get a BST or GMT date |
| BCSLAB_E388 | if error just exit |
| STALAB_80 | save the GMT year |
| STXLAB_81 | save the GMT month |
| STYLAB_82 | save the GMT date |
| ************************************************************************************ | |
| output 'gmt ' and the GMT start date | |
| LAB_E399: ; $E399 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'gmt ',$00 | |
| TSTLAB_82 | test the GMT year |
| BEQLAB_E41F | if null go output "(not set)" and return |
| LDX#>LAB_80 | set the pointer to GMT date low byte |
| LDY#<LAB_80 | set the pointer to GMT date high byte |
| output the day/date | |
| LAB_E3AB: ; $E3AB | |
| JSRLAB_F6A1 | output the day of the week |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| JMPLAB_F6DA | output the date as DD MMM YYY and return |
| ************************************************************************************ | |
| display or set the BST start date | |
| LAB_E3B4: ; $E3B4 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E3C4 | if null just go output the current value |
| JSRLAB_E35D | get a BST or GMT date |
| BCSLAB_E388 | if error just exit |
| STALAB_83 | save the BST year |
| STXLAB_84 | save the BST month |
| STYLAB_85 | save the BST date |
| ************************************************************************************ | |
| output 'bst ' and the BST start date | |
| LAB_E3C4: ; $E3C4 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'bst ',$00 | |
| TSTLAB_85 | test the BST year |
| BEQLAB_E41F | if null go output "(not set)" and return |
| LDX#>LAB_83 | set the pointer to BST date low byte |
| LDY#<LAB_83 | set the pointer to BST date low byte |
| BRALAB_E3AB | output the day/date and return |
| ************************************************************************************ | |
| display or set the REF value | |
| LAB_E3D8: ; $E3D8 | |
| JSRLAB_F243 | get a character from the Rx buffer |
| BEQLAB_E3FF | if null just go output the current value |
| CMP#' ' | compare the character with [SPACE] |
| BNELAB_E41E | if it is [SPACE] just exit |
| LDX#$00 | clear the character count/index |
| LAB_E3E3: ; $E3E3 | |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| BEQLAB_E3F3 | if the character is null go finish the ref value |
| JSRLAB_F233 | test the character in A, return Cb=0 if it is "0" to "9" |
| BCCLAB_E3F3 | if the character is "0" to "9" go add it to the ref value |
| CLB5,A | make upper case |
| JSRLAB_F23C | test the character in A, return Cb=0 if it is "A" to "Z" |
| BCSLAB_E41E | if it is not "A" to "Z" just exit |
| character is either [NULL], "0" to "9" or "A" to "Z" | |
| LAB_E3F3: ; $E3F3 | |
| CPX#$08 | compare the character count/index with max + 1 |
| BCSLAB_E3FB | if > max skip the ref value save |
| STALAB_0551,X | save the character to the ref value |
| INX | increment the character count/index |
| LAB_E3FB: ; $E3FB | |
| AND#$FF | set the flags on A |
| BNELAB_E3E3 | if the character wasn't [NULL] go get another character |
| ************************************************************************************ | |
| output 'ref ' and the REF value | |
| LAB_E3FF: ; $E3FF | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'ref ',$00 | |
| LDALAB_0551 | get the first ref character |
| BEQLAB_E41F | if null go output "(not set)" and return |
| LDX#$00 | clear the index |
| LAB_E410: ; $E410 | |
| LDALAB_0551,X | get a ref character |
| BEQLAB_E41D | if null just exit |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INX | increment the index |
| CPX#$08 | compare the index with max + 1 |
| BCCLAB_E410 | loop if more to do |
| LAB_E41D: ; $E41D | |
| CLC | flag ok |
| LAB_E41E: ; $E41E | |
| RTS | |
| ************************************************************************************ | |
| output "(not set)" | |
| LAB_E41F: ; $E41F | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE'(not set)',$00 | |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| display or set the target number | |
| LAB_E42E: ; $E42E | |
| JSRLAB_F243 | get a character from the Rx buffer |
| BEQLAB_E45A | if null just go output the current value |
| CMP#' ' | compare the character with " " |
| BNELAB_E491 | if not " " go do error exit |
| LDX#$00 | clear the number index |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| BEQLAB_E452 | if null go save it to the buffer |
| CMP#'0' | compare the character with "0" |
| BEQLAB_E452 | if "0" go save it to the buffer |
| BRALAB_E47A | else output "include area code" and do error exit |
| LAB_E444: ; $E444 | |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| BEQLAB_E44E | if null just go save it to the buffer |
| JSRLAB_F233 | test the character in A, return Cb=0 if it is "0" to "9" |
| BCSLAB_E444 | if not numeric go get another character |
| LAB_E44E: ; $E44E | |
| CPX#$0A | compare the index with the max + 1 |
| BCSLAB_E456 | if > max skip the save |
| LAB_E452: ; $E452 | |
| STALAB_0547,X | save the character to the buffer |
| INX | increment the buffer index |
| LAB_E456: ; $E456 | |
| AND#$FF | set the flags on A |
| BNELAB_E444 | if not null loop for the next character |
| LAB_E45A: ; $E45A | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'num ',$00 | |
| LDALAB_0547 | get the first character |
| BEQLAB_E41F | if null go output "(not set)" and return |
| LDX#$00 | clear the index |
| LAB_E46B: ; $E46B | |
| LDALAB_0547,X | get a character |
| BEQLAB_E478 | if null exit the loop |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INX | increment the index |
| CPX#$0A | compare the index with the maximum + 1 |
| BCCLAB_E46B | if less go do another character |
| LAB_E478: ; $E478 | |
| CLC | flag ok |
| RTS | |
| output "include area code" and do error exit | |
| LAB_E47A: ; $E47A | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'include area code',$00 | |
| LAB_E491: ; $E491 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| display or set the minimum recognised line seizure. | |
| This allows short seizures to be discarded. The default is 5 seconds but may be set | |
| anywhere between 0 and 59 seconds. Any seizures shorter than the set period will | |
| not be logged although they will be shown in LIVE mode. | |
| LAB_E493: ; $E493 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E4A7 | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_E4BA | if there is a following character go do error exit |
| CPX#$00 | compare the high byte with $00 |
| BNELAB_E4BA | if the high byte is not $00 go do error exit |
| CMP#$3C | compare the returned value with the max + 1 |
| BCSLAB_E4BA | if the value is > max go do error exit |
| STALAB_6E | save the TSeized value |
| LAB_E4A7: ; $E4A7 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'TSeized ',$00 | |
| LDALAB_6E | get the TSeized value |
| JMPLAB_F350 | output A as a two digit decimal value and return |
| LAB_E4BA: ; $E4BA | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| TP [{1|2|3|4|5|6|7}] | |
| display or set the pulse dial timing | |
| LAB_E4BC: ; $E4BC | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E4D2 | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_E4BA | if there is a following character go do error exit |
| CPX#$00 | compare the high byte with $00 |
| BNELAB_E4BA | if the high byte is not $00 go do error exit |
| DECA | make the value 0 to 6 |
| CMP#$07 | compare it with max + 1 |
| BCSLAB_E4BA | if the value is > max go do error exit |
| INCA | make the value 1 to 7 |
| STALAB_6F | save the TPulse value |
| LAB_E4D2: ; $E4D2 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'TPulse ',$00 | |
| LDALAB_6F | get the TPulse value |
| JMPLAB_F350 | output A as a two digit decimal value and return |
| ************************************************************************************ | |
| display or set the dialled digit timeout | |
| LAB_E4E4: ; $E4E4 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E4F8 | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_E4BA | if there is a following character go do error exit |
| CPX#$00 | compare the high byte with $00 |
| BNELAB_E4BA | if the high byte is not $00 go do error exit |
| CMP#$14 | compare it with max + 1 |
| BCCLAB_E4BA | if the value is > max go do error exit |
| STALAB_70 | save the TDial value |
| LAB_E4F8: ; $E4F8 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'TDial ',$00 | |
| LDALAB_70 | get the TDial value |
| JMPLAB_F350 | output A as a two digit decimal value and return |
| ************************************************************************************ | |
| display or set the break character | |
| LAB_E509: ; $E509 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E517 | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BEQLAB_E515 | if there is no following character go use the decimal |
| value | |
| TYA | else copy the following character |
| CLB7,A | mask 0xxx xxxx, 7 bit ASCII |
| LAB_E515: ; $E515 | |
| STALAB_0B | save the break value |
| ************************************************************************************ | |
| display the break value | |
| LAB_E517: ; $E517 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'break ',$00 | |
| LDALAB_0B | get the break value |
| CMP#' ' | compare it with [SPACE] |
| BCSLAB_E536 | if > [SPACE] just output it |
| ADC#'A'-1 | else add "A" - 1 |
| PHA | save the character |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE'CTRL ',$00 | |
| PLA | restore the character |
| LAB_E536: ; $E536 | |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| CLC | flag ok |
| LAB_E53A: ; $E53A | |
| RTS | |
| ************************************************************************************ | |
| The parameters used to configure the logger are returned to their power-on default | |
| settings. These are the last nine setting listed by the STATUS command. | |
| Date, time, GMT, BST, password, meter reading and all logged calls remain intact. | |
| Confirmation is required whereupon the default settings are listed. | |
| LAB_E53B: ; $E53B | |
| JSRLAB_E750 | prompt for confirm, return Cb = 0 if confirmed |
| BCSLAB_E53A | if not confirmed just exit |
| JSRLAB_FB6D | set the default values |
| BRALAB_E565 | go output the reset values and return |
| ************************************************************************************ | |
| display the current settings and metered values | |
| LAB_E545: ; $E545 | |
| SEB5,LAB_0A | . |
| JSRLAB_E1E3 | display 'Monolog ', serial#, version#, RAM size |
| JSRLAB_E3FF | display 'ref ' and the REF value |
| JSRLAB_E45A | display 'num ', ?? |
| JSRLAB_E776 | display the calls logged total "calls logged xxxx" |
| JSRLAB_E7B8 | display the metered units total "meter xxxxxx" |
| JSRLAB_E399 | display the GMT start date "gmt DD MMM YYYY" |
| JSRLAB_E3C4 | display the BST start date "bst DD MMM YYYY" |
| JSRLAB_E517 | display the break value "break CTRL x" |
| JSRLAB_EFBD | display the line votage "VLine xx" |
| JSRLAB_F037 | display the battery voltage "VBattery x.xx" |
| LAB_E565: ; $E565 | |
| JSRLAB_F00C | display 'VThreshold ', ?? |
| JSRLAB_E5ED | display 'digits ', ?? |
| JSRLAB_E617 | display 'pulses ', ?? |
| JSRLAB_E6A9 | display 'park ', ?? |
| JSRLAB_E682 | display 'rvs ', ?? |
| JSRLAB_E65D | display 'ECall ', ?? |
| JSRLAB_E4F8 | display 'TDial ', ?? |
| JSRLAB_E4A7 | display 'TSeized ', ?? |
| JMPLAB_E4D2 | display 'TPulse ', ?? and return |
| ************************************************************************************ | |
| MSG[{1|2}[ [<text>]]] | |
| display or set the message(s) | |
| If the text is omitted the numbered message will be cleared. | |
| If the space is omitted the numbered message will be displayed. | |
| If the number is omitted both message lines will be displayed. | |
| LAB_E580: ; $E580 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E5A8 | if null just go Tx message buffers 1 and 2 |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| CPX#$00 | compare the high byte with $00 |
| BNELAB_E5C5 | if not $00 just exit |
| TAX | copy the value low byte |
| DEX | decrement it |
| CPX#$02 | compare it with $02 |
| BCSLAB_E5C5 | if >= $02 just exit |
| CPY#$00 | compare the last character with null |
| BEQLAB_E5AE | if null just go transmit buffer[X] |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| JSRLAB_E5C6 | copy message buffer pointer [X] to LAB_0D/0E |
| LDY#$00 | clear the index |
| LAB_E59E: ; $E59E | |
| JSRLAB_F243 | get a character from the Rx buffer |
| STA(LAB_0D),Y | save it to the message buffer |
| BEQLAB_E5B1 | if null go echo the buffer |
| INY | increment the message buffer index |
| BPLLAB_E59E | go get another character, branch always |
| ************************************************************************************ | |
| transmit message buffers 1 and 2 | |
| LAB_E5A8: ; $E5A8 | |
| LDX#$00 | set X for buffer at LAB_0456 |
| JSRLAB_E5AE | transmit buffer[X] |
| INX | set X for buffer at LAB_04A6 |
| ************************************************************************************ | |
| transmit buffer[X] | |
| LAB_E5AE: ; $E5AE | |
| JSRLAB_E5C6 | copy message buffer pointer [X] to LAB_0D/0E |
| LAB_E5B1: ; $E5B1 | |
| LDY#$00 | clear the index |
| LDA(LAB_0D),Y | get a byte from the character buffer |
| BEQLAB_E5C4 | if null just exit |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LAB_E5BA: ; $E5BA | |
| LDA(LAB_0D),Y | get a byte from the character buffer |
| BEQLAB_E5C4 | if null just exit |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INY | increment the index |
| BPLLAB_E5BA | loop for the next byte |
| LAB_E5C4: ; $E5C4 | |
| CLC | flag ok |
| LAB_E5C5: ; $E5C5 | |
| RTS | |
| ************************************************************************************ | |
| copy message buffer pointer [X] to LAB_0D/0E | |
| LAB_E5C6: ; $E5C6 | |
| TXA | copy the message index |
| ASLA | * 2 |
| TAY | copy it to Y |
| LDALAB_E5D4,Y | get the message buffer pointer low byte |
| STALAB_0D | save the message buffer pointer low byte |
| LDALAB_E5D4+1,Y | get the message buffer pointer high byte |
| STALAB_0E | save the message buffer pointer high byte |
| RTS | |
| ************************************************************************************ | |
| message buffer pointers table | |
| LAB_E5D4: ; $E5D4 | |
| .WORDLAB_0456 | message buffer 1 |
| .WORDLAB_04A6 | message buffer 2 |
| ************************************************************************************ | |
| DIGITS [{AUTO|PULSE|DTMF|MIXED}] | |
| display or set the digit mode | |
| LAB_E5D8: ; $E5D8 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E5ED | if null just go output the current value |
| LDM#>LAB_E6D0,LAB_0D | DIGITS subcommand table pointer low byte |
| LDM#<LAB_E6D0,LAB_0E | DIGITS subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E647 | if not found just exit |
| INY | increment the index to the digits value |
| LDA(LAB_0D),Y | get the digits value |
| STALAB_6B | save the digits value |
| LAB_E5ED: ; $E5ED | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'digits ',$00 | |
| LDXLAB_6B | get the digits value |
| LDA#>LAB_E6D0 | DIGITS subcommand table pointer low byte |
| LDY#<LAB_E6D0 | DIGITS subcommand table pointer high byte |
| BRALAB_E62A | output AY table string [X] and return |
| ************************************************************************************ | |
| PULSES [{XSPM|SPM|M+|M-|REV|SPM16}] | |
| display or set the meter pulse mode | |
| LAB_E602: ; $E602 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E617 | if null just go output the current value |
| LDM#>LAB_E6EF,LAB_0D | PULSES subcommand table pointer low byte |
| LDM#<LAB_E6EF,LAB_0E | PULSES subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E647 | if not found just exit |
| INY | increment the index to the pulses value |
| LDA(LAB_0D),Y | get the pulses value |
| STALAB_6C | save the pulses value |
| LAB_E617: ; $E617 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'pulses ',$00 | |
| LDXLAB_6C | get the pulses value |
| LDA#>LAB_E6EF | PULSES subcommand table pointer low byte |
| LDY#<LAB_E6EF | PULSES subcommand table pointer high byte |
| ************************************************************************************ | |
| output AY table string [X] | |
| LAB_E62A: ; $E62A | |
| STALAB_0D | save the table pointer low byte |
| STYLAB_0E | save the table pointer high byte |
| LDY#$00 | clear the table index |
| LAB_E630: ; $E630 | |
| DEX | decrement the string index |
| BMILAB_E63C | if negative go output the string |
| else find the next string | |
| LAB_E633: ; $E633 | |
| LDA(LAB_0D),Y | get a string byte |
| INY | increment table the index |
| BBC7,A,LAB_E633 | loop if not an end marker |
| INY | increment the index past the ? low byte |
| INY | increment the index past the ? high byte |
| BRALAB_E630 | go try this index |
| LAB_E63C: ; $E63C | |
| LDA(LAB_0D),Y | get a string character |
| BMILAB_E646 | if > $7F just exit |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INY | increment the index |
| BRALAB_E63C | go get the next character |
| LAB_E646: ; $E646 | |
| CLC | flag ok |
| LAB_E647: ; $E647 | |
| RTS | |
| ************************************************************************************ | |
| EC [{ON|OFF}] | |
| Earth call PBX and shared service lines. ON = use earth call | |
| LAB_E648: ; $E648 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E65D | if null just go output the current value |
| LDM#>LAB_E715,LAB_0D | RVS and EC subcommand table pointer low byte |
| LDM#<LAB_E715,LAB_0E | RVS and EC subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E647 | if not found just exit |
| INY | increment the index to the ECall value |
| LDA(LAB_0D),Y | get the ECall value |
| STALAB_72 | save the ECall value |
| LAB_E65D: ; $E65D | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'ECall ',$00 | |
| LDXLAB_72 | get the ECall value |
| BRALAB_E68E | set table, output string [X] and return |
| ************************************************************************************ | |
| RVS [{ON|OFF}] | |
| Most exchanges provide a continous line reversal during ringing. Its presence | |
| enables the start and end of ringing to be detected quickly. UXD5 exchnages only | |
| provide a reversal during active periods of ringing therefore ringing reversal | |
| detection must be inhibited to prevent each ring logging as a seperate incoming call. | |
| LAB_E66D: ; $E66D | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E682 | if null just go output the current value |
| LDM#>LAB_E715,LAB_0D | RVS and EC subcommand table pointer low byte |
| LDM#<LAB_E715,LAB_0E | RVS and EC subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E647 | if not found just exit |
| INY | increment the index to the rvs value |
| LDA(LAB_0D),Y | get the rvs value |
| STALAB_71 | save the rvs value |
| LAB_E682: ; $E682 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'rvs ',$00 | |
| LDXLAB_71 | read the rvs value |
| LAB_E68E: ; $E68E | |
| LDA#>LAB_E715 | RVS and EC subcommand table pointer low byte |
| LDY#<LAB_E715 | RVS and EC subcommand table pointer high byte |
| BRALAB_E62A | output AY table string [X] and return |
| ************************************************************************************ | |
| PARK [{OFF|TXE|REV}] | |
| display or set the park detection setting | |
| LAB_E694: ; $E694 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E6A9 | if null just go output the current value |
| LDM#>LAB_E6BD,LAB_0D | PARK subcommand table pointer low byte |
| LDM#<LAB_E6BD,LAB_0E | PARK subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E647 | if not found just exit |
| INY | increment the index to the park value |
| LDA(LAB_0D),Y | get the park value |
| STALAB_73 | save the park value |
| LAB_E6A9: ; $E6A9 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'park ',$00 | |
| LDXLAB_73 | get the park value |
| LDA#>LAB_E6BD | PARK subcommand table pointer low byte |
| LDY#<LAB_E6BD | PARK subcommand table pointer high byte |
| JMPLAB_E62A | output AY table string [X] and return |
| ************************************************************************************ | |
| PARK subcommand table | |
| LAB_E6BD: ; $E6BD | |
| .BYTE'off',$80 | "OFF" |
| .WORD$0000 | off value |
| .BYTE'txe',$80 | "TXE" |
| .WORD$0001 | txe value |
| .BYTE'rev',$80 | "REV" |
| .WORD$0002 | rev value |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| DIGITS subcommand table | |
| LAB_E6D0: ; $E6D0 | |
| .BYTE'auto',$80 | "AUTO" |
| .WORD$0000 | auto value |
| .BYTE'pulse',$80 | "PULSE" |
| .WORD$0001 | pulse value |
| .BYTE'dtmf',$80 | "DTMF" |
| .WORD$0002 | dtmf value |
| .BYTE'mixed',$80 | "MIXED" |
| .WORD$0003 | mixed value |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| PULSES subcommand table | |
| LAB_E6EF: ; $E6EF | |
| .BYTE'rev',$80 | "REV" |
| .WORD$0000 | auto value |
| .BYTE'spm16',$80 | "SPM16" |
| .WORD$0001 | spm16 value |
| .BYTE'spm',$80 | "SPM" |
| .WORD$0002 | spm value |
| .BYTE'xspm',$80 | "XSPM" |
| .WORD$0003 | xspm value |
| .BYTE'm+',$80 | "M+" |
| .WORD$0004 | m+ value |
| .BYTE'm-',$80 | "M-" |
| .WORD$0005 | m- value |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| RVS and EC subcommand table | |
| LAB_E715: ; $E715 | |
| .BYTE'off',$80 | "OFF" |
| .WORD$0000 | off value |
| .BYTE'on',$80 | "ON" |
| .WORD$0001 | on value |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| sign off | |
| LAB_E721: ; $E721 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'time off ',$00 | |
| JSRLAB_F685 | output the current day/date/time |
| LDM#$00,LAB_08 | clear the signed on flag |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| a diagnostic aid for fault finding | |
| The readings from all four line and meter voltage inputs are displayed. | |
| e.g. | |
| 169 143 169 117 | |
| ch0 ch1 ch2 ch3 | |
| Line Volts (B-A) (same as VL but gives polarity) | |
| V(B-A) = 113.6 * (ch3 - ch0) / ch3 | |
| = 113.6 * (117 - 169) / 117 | |
| = -50.5V | |
| Line Volts (A+B) wrt ground (earth ref must be connected) | |
| V(A+B) = 227.2 * (ch3 - ch1) / ch3 | |
| = 227.2 * (117 - 143) / 117 | |
| = -50.5V | |
| V(B) wrt ground | |
| V(B) = (V(A+B) + V(B-A)) / 2 (half the sum) | |
| V(A) wrt ground | |
| V(A) = (V(A+B) - V(B-A)) / 2 (half the difference) | |
| A and B may be reversed as there is no phasing requirement. | |
| Meter Wire | |
| Vmeter = 113.6*(ch3-ch2)/ch3 | |
| = 113.6*(117-169)/117 | |
| = -50.5 | |
| LAB_E738: ; $E738 | |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LDY#$00 | clear the A2D channel |
| LAB_E73D: ; $E73D | |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| TYA | copy the A2D channel |
| SEI | disable the interrupts |
| JSRLAB_F06C | read an A2D byte from channel [A] |
| CLI | enable the interrupts |
| JSRLAB_F368 | output A as a three digit decimal value |
| INY | increment the A2D channel |
| CPY#$04 | compare the A2D channel with the maximum + 1 |
| BCCLAB_E73D | loop if more channels to do |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| prompt for confirm, return Cb = 0 if confirmed | |
| LAB_E750: ; $E750 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'confirm [y] ',$00 | |
| LDA#>$FFC4 | set the seconds count low byte, 60 seconds |
| LDX#<$FFC4 | set the seconds count high byte, 60 seconds |
| JSRLAB_F269 | wait -AX seconds for input |
| BCSLAB_E775 | if timed out go exit |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| CLB5,A | ensure upper case |
| EOR#'Y' | compare it with "Y" |
| SEC | flag not confirmed |
| BNELAB_E775 | if not "Y" just exit |
| CLC | else flag confirmed |
| LAB_E775: ; $E775 | |
| RTS | |
| ************************************************************************************ | |
| display the number of calls logged | |
| LAB_E776: ; $E776 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'calls logged ',$00 | |
| LDALAB_74 | get the calls logged low byte |
| LDXLAB_75 | get the calls logged high byte |
| JMPLAB_F36A | output AX as a three digit decimal value |
| ************************************************************************************ | |
| clear the logged calls and metered units | |
| LAB_E790: ; $E790 | |
| LDALAB_74 | get the calls logged low byte |
| ORALAB_75 | OR it with the calls logged high byte |
| BEQLAB_E7A1 | if no calls logged just output the zero count and return |
| JSRLAB_E7A1 | output the calls logged count |
| JSRLAB_E750 | prompt for confirm, return Cb = 0 if confirmed |
| BCSLAB_E775 | if not confirmed just exit |
| ************************************************************************************ | |
| clear the logged calls and metered units without confirm | |
| LAB_E79E: ; $E79E | |
| JSRLAB_FB43 | initialise the record pointers and logged values |
| ************************************************************************************ | |
| display the number of calls logged and metered units | |
| LAB_E7A1: ; $E7A1 | |
| JSRLAB_E776 | display the number of calls logged |
| BRALAB_E7B8 | display the number of metered units |
| ************************************************************************************ | |
| display or set the number of metered units | |
| LAB_E7A6: ; $E7A6 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E7B8 | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_E7CD | if there is a following character go do error exit |
| LDYLAB_0F | get the decimal value high byte |
| STALAB_76 | save the meter value low byte |
| STXLAB_77 | save the meter value mid byte |
| STYLAB_78 | save the meter value high byte |
| display the number of metered units | |
| LAB_E7B8: ; $E7B8 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'meter ',$00 | |
| LDALAB_76 | get the meter value low byte |
| LDXLAB_77 | get the meter value mid byte |
| LDYLAB_78 | get the meter value high byte |
| JMPLAB_F338 | output AXY as a decimal value and return |
| LAB_E7CD: ; $E7CD | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| display the total number of calls stored in memory | |
| LAB_E7CF: ; $E7CF | |
| JSRLAB_E877 | find a filter and set the match/mask values |
| BCSLAB_E7EF | if error just exit |
| JSRLAB_E941 | get a date range ?? |
| BCSLAB_E7EF | if error just exit |
| LAB_E7D9: ; $E7D9 | |
| JSRLAB_EDDB | copy the next record to the record buffer |
| BCSLAB_E7EB | if error go end the info output |
| JSRLAB_EA00 | test for filter match, return Cb = 0 if match ?? |
| BCSLAB_E7D9 | if no match go do another record |
| JSRLAB_E7F0 | increment the calls count and add units from the buffered |
| record ?? | |
| JSRLAB_FFDC | swap the stack pointers |
| BRALAB_E7D9 | go do another record |
| LAB_E7EB: ; $E7EB | |
| JSRLAB_E80E | output calls and units ?? |
| CLC | flag ok |
| LAB_E7EF: ; $E7EF | |
| RTS | |
| ************************************************************************************ | |
| increment the calls count and add units from the buffered record ?? | |
| LAB_E7F0: ; $E7F0 | |
| INCLAB_67 | increment the calls low byte |
| BNELAB_E7F6 | if no rollover skip the high byte increment |
| INCLAB_68 | else increment the calls high byte |
| LAB_E7F6: ; $E7F6 | |
| LDALAB_50 | get the buffered record length |
| CMP#LAB_0502-LAB_04F6 | |
| compare it with the offset to the number | |
| BCCLAB_E80D | if less just exit |
| CLC | clear carry for add |
| LDALAB_0500 | get the record metered units low byte |
| ADCLAB_69 | add the units low byte |
| STALAB_69 | save the units low byte |
| LDALAB_0501 | get the record metered units high byte |
| AND#$1F | mask 000x xxxx, just the metered units bits |
| ADCLAB_6A | add the units high byte |
| STALAB_6A | save the units high byte |
| LAB_E80D: ; $E80D | |
| RTS | |
| ************************************************************************************ | |
| output calls and units ?? | |
| LAB_E80E: ; $E80E | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'calls ',$00 | |
| LDALAB_67 | get the calls low byte |
| LDXLAB_68 | get the calls high byte |
| JSRLAB_F36A | output AX as a three digit decimal value |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE', units ',$00 | |
| LDALAB_69 | get the units low byte |
| LDXLAB_6A | get the units high byte |
| JMPLAB_F36A | output AX as a three digit decimal value and return |
| ************************************************************************************ | |
| display the logged call data as ASCII text | |
| LAB_E834: ; $E834 | |
| SEB7,LAB_51 | set the full list flag |
| BRALAB_E840 | go do the list |
| ************************************************************************************ | |
| display the logged call short form data as ASCII text | |
| LAB_E838: ; $E838 | |
| CLB7,LAB_51 | clear the full list flag |
| LDM#$00,LAB_54 | clear the last output year/month/date low byte |
| LDM#$00,LAB_55 | clear the last output year/month/date high byte |
| LAB_E840: ; $E840 | |
| JSRLAB_E877 | find a filter and set the match/mask values |
| BCSLAB_E876 | if error just exit |
| JSRLAB_E941 | get a date range ?? |
| BCSLAB_E876 | if error just exit |
| SEB5,LAB_0A | . |
| LAB_E84C: ; $E84C | |
| JSRLAB_F2F9 | check for no carrier, ring or break |
| BCSLAB_E875 | if no carrier, ring or break go do ok exit |
| JSRLAB_EDDB | copy the next record to the record buffer |
| BCSLAB_E863 | if error go ?? |
| JSRLAB_EA00 | test for filter match, return Cb = 0 if match ?? |
| BCSLAB_E84C | if no match go ?? |
| JSRLAB_E7F0 | increment the calls count and add units from the buffered |
| record ?? | |
| JSRLAB_EAA5 | display a record's details |
| BRALAB_E84C | loop for the next record |
| LAB_E863: ; $E863 | |
| JSRLAB_E80E | output calls and units ?? |
| BBC5,LAB_51,LAB_E875 | if the date filter flag is clear skip ?? |
| LDYLAB_47 | get the next record pointer low byte |
| LDXLAB_48 | get the next record pointer mid byte |
| LDALAB_49 | get the next record pointer high byte |
| STYLAB_4D | save the current record pointer low byte |
| STXLAB_4E | save the current record pointer mid byte |
| STALAB_4F | save the current record pointer high byte |
| LAB_E875: ; $E875 | |
| CLC | flag ok |
| LAB_E876: ; $E876 | |
| RTS | |
| ************************************************************************************ | |
| find a filter and set the match/mask values | |
| LAB_E877: ; $E877 | |
| LDA#$00 | clear A |
| STALAB_67 | clear the calls low byte |
| STALAB_68 | clear the calls high byte |
| STALAB_69 | clear the units low byte |
| STALAB_6A | clear the units high byte |
| CLB6,LAB_51 | clear the number filter flag |
| CLB4,LAB_51 | clear the metered units filter flag |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E8B2 | if null go clear the match/mask bytes and exit |
| LDM#>LAB_E90F,LAB_0D | set the DL, INFO and L subcommand table pointer low byte |
| LDM#<LAB_E90F,LAB_0E | set the DL, INFO and L subcommand table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E8B2 | if not found go clear the match/mask bytes and exit |
| LDA(LAB_0D),Y | get the last command character |
| CMP#'>'+$80 | compare it with ">" |
| BEQLAB_E8BA | if it was ">" go handle metered units limit |
| CMP#'#'+$80 | compare it with "#" |
| BNELAB_E8A6 | if not "#" go save the match/mask bytes and exit |
| else handle "#", get a filter number | |
| JSRLAB_E8D1 | get a filter number in LAB_05A0 on |
| BCSLAB_E8B9 | if error just exit |
| SEB6,LAB_51 | set the number filter flag |
| LAB_E8A6: ; $E8A6 | |
| INY | increment the index to the command word low byte |
| LDA(LAB_0D),Y | get the call type match byte |
| STALAB_52 | save the call type match byte |
| INY | increment the index to the command word high byte |
| LDA(LAB_0D),Y | get the call type mask byte |
| STALAB_53 | save the call type mask byte |
| CLC | flag ok |
| RTS | |
| LAB_E8B2: ; $E8B2 | |
| LDA#$00 | clear A |
| STALAB_52 | clear the call type match byte |
| STALAB_53 | clear the call type mask byte |
| CLC | flag ok |
| LAB_E8B9: ; $E8B9 | |
| RTS | |
| handle ">", metered units limit | |
| LAB_E8BA: ; $E8BA | |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| DECLAB_0C | decrement the Rx buffer read index |
| STALAB_05A0 | save the metered units limit low byte |
| STXLAB_05A1 | save the metered units limit high byte |
| SEB4,LAB_51 | set the metered units filter flag |
| LDA#$31 | match 0011 0001, outgoing |
| STALAB_52 | save the call type match byte |
| LDA#$FD | mask xxxx xx0x, all answered |
| STALAB_53 | save the call type mask byte |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| get a filter number in LAB_05A0 on | |
| LAB_E8D1: ; $E8D1 | |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| LDY#$00 | clear the index |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E909 | if null go flag an error and exit |
| LAB_E8DC: ; $E8DC | |
| JSRLAB_F243 | get a character from the Rx buffer |
| BEQLAB_E8FE | if null go terminate, check and return the number |
| CMP#' ' | compare the character with " " |
| BEQLAB_E8FE | if " " go terminate, check and return the number |
| LDX#$10 | set the index to the 'D1234567890*#ABC' keypad table |
| LAB_E8E7: ; $E8E7 | |
| CMPLAB_EC96,X | compare the character with a keypad character |
| BEQLAB_E8F3 | if it is a match go ?? |
| INX | else increment the table index |
| CPX#$20 | compare the table index with the maximum + 1 |
| BCCLAB_E8E7 | if not there yet go try the next table character |
| BRALAB_E8FE | if not in the table go terminate, check and return |
| the number | |
| LAB_E8F3: ; $E8F3 | |
| CPY#$14 | compare the index with the max + 1 |
| BCSLAB_E8FC | if > max just ignore the digit |
| TXA | copy the table index |
| STALAB_05A0,Y | save the digit to the filter number buffer |
| INY | increment the filter number index |
| LAB_E8FC: ; $E8FC | |
| BRALAB_E8DC | go get another character |
| LAB_E8FE: ; $E8FE | |
| DECLAB_0C | decrement the Rx buffer read index |
| LDA#$00 | clear A |
| STALAB_05A0,Y | null terminate the filter number |
| CLC | flag ok |
| TYA | copy the number index |
| BNELAB_E90A | if the number has more than zero digits do ok exit |
| LAB_E909: ; $E909 | |
| SEC | flag error |
| LAB_E90A: ; $E90A | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| RTS | |
| ************************************************************************************ | |
| DOWNLOAD, INFO and LIST subcommand table | |
| LAB_E90F: ; $E90F | |
| .BYTE'Z'+$80 | "Z" line seizures |
| .BYTE$10 | match 0001 0000 |
| .BYTE$FF | mask xxxx xxxx |
| .BYTE'P'+$80 | "P" line parked |
| .BYTE$12 | match 0001 0010 |
| .BYTE$FF | mask xxxx xxxx |
| .BYTE'I','U'+$80 | "IU" unanswered incomming |
| .BYTE$20 | match 0010 0000 |
| .BYTE$FF | mask xxxx xxxx |
| .BYTE'I','A'+$80 | "IA" answered incomming |
| .BYTE$21 | match 0010 0001 |
| .BYTE$FD | mask xxxx xx0x |
| .BYTE'I','C'+$80 | "IC" continued incomming |
| .BYTE$23 | match 0010 0011 |
| .BYTE$FF | mask xxxx xxxx |
| .BYTE'I'+$80 | "I" all incomming |
| .BYTE$20 | match 0010 0000 |
| .BYTE$F0 | mask xxxx 0000 |
| .BYTE'O','U'+$80 | "OU" unanswered outgoing |
| .BYTE$30 | match 0011 0000 |
| .BYTE$F9 | mask xxxx x00x |
| .BYTE'O','A'+$80 | "OA" answered outgoing |
| .BYTE$31 | match 0011 0001 |
| .BYTE$F9 | mask xxxx x00x |
| .BYTE'O'+$80 | "O" all outgoing |
| .BYTE$30 | match 0011 0000 |
| .BYTE$F0 | mask xxxx 0000 |
| .BYTE'*'+$80 | "*" all outgoing ended by forced-release condition |
| .BYTE$35 | match 0011 0101 |
| .BYTE$FE | mask xxxx xxx0 |
| .BYTE'U','#'+$80 | "U#" unanswered outgoing to specific number or group |
| .BYTE$30 | match 0011 0000 |
| .BYTE$F9 | mask xxxx x00x |
| .BYTE'A','#'+$80 | "A#" answered outgoing to specific number or group |
| .BYTE$31 | match 0011 0001 |
| .BYTE$F9 | mask xxxx x00x |
| .BYTE'#'+$80 | "#" all outgoing to specific number or group |
| .BYTE$30 | match 0011 0000 |
| .BYTE$F0 | mask xxxx 0000 |
| .BYTE'>'+$80 | ">" answered outgoing with metered units over a |
| specific limit | |
| .BYTE$00,$00 | unused |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| get a date range ?? | |
| LAB_E941: ; $E941 | |
| CLB5,LAB_51 | clear the date filter flag |
| LDA#$00 | clear A |
| STALAB_56 | clear the start date low byte |
| STALAB_57 | clear the start date high byte |
| DECA | make A = $FF |
| STALAB_58 | set the end date low byte |
| STALAB_59 | set the end date high byte |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E9A9 | if null go ?? |
| CMP#'-' | compare the character with "-" |
| BEQLAB_E993 | if "-" go get the end date |
| search for "TODAY" or "UPDATE" | |
| LDM#>LAB_E9EE,LAB_0D | set the "TODAY" or "UPDATE" table pointer low byte |
| LDM#<LAB_E9EE,LAB_0E | set the "TODAY" or "UPDATE" table pointer high byte |
| JSRLAB_E22E | search for a command, return Cb=0 if found |
| BCSLAB_E97D | if not "TODAY" or "UPDATE" go try a date range |
| INY | increment the index to the word low byte |
| LDA(LAB_0D),Y | get the word low byte |
| BEQLAB_E971 | if zero go handle "TODAY" |
| else it was "UPDATE" | |
| LDYLAB_4A | get the update pointer low byte |
| LDXLAB_4B | get the update pointer mid byte |
| LDALAB_4C | get the update pointer high byte |
| SEB5,LAB_51 | set the date filter flag |
| BRALAB_E9AF | save AXY as the next record pointer and exit |
| handle "TODAY" | |
| LAB_E971: ; $E971 | |
| JSRLAB_F4F6 | copy the current date/time to the temporary date/time |
| LAB_E974: ; $E974 | |
| JSRLAB_F526 | get the temporary YY:MM:DD in AX |
| STALAB_56 | save the start date low byte |
| STXLAB_57 | save the start date high byte |
| BRALAB_E9A5 | go save today as the end date |
| get a date range | |
| LAB_E97D: ; $E97D | |
| JSRLAB_F5C5 | get the date as DD MMM YYYY |
| BCSLAB_E9B7 | if error go do error exit |
| TAY | copy the last returned character |
| BEQLAB_E974 | if no following character go save the entered date as |
| the start and end date | |
| JSRLAB_F526 | get the temporary YY:MM:DD in AX |
| STALAB_56 | save the start date low byte |
| STXLAB_57 | save the start date high byte |
| TAY | copy the last returned character |
| CMP#'-' | compare the last returned character with "-" |
| BNELAB_E9B7 | if not "-" go do error exit |
| BRALAB_E995 | else get the end date without increment |
| get the end date | |
| LAB_E993: ; $E993 | |
| INCLAB_0C | increment the Rx buffer read index |
| LAB_E995: ; $E995 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E9A9 | if null go ?? |
| ************************************************************************************ | |
| get the end date ?? | |
| LAB_E99A: ; $E99A | |
| JSRLAB_F5C5 | get the date as DD MMM YYYY |
| BCSLAB_E9B7 | if error go do error exit |
| TAY | copy the last returned character |
| BNELAB_E9B7 | if following character go do error exit |
| JSRLAB_F526 | get the temporary YY:MM:DD in AX |
| LAB_E9A5: ; $E9A5 | |
| STALAB_58 | save the end date low byte |
| STXLAB_59 | save the end date high byte |
| LAB_E9A9: ; $E9A9 | |
| LDYLAB_B3 | get the record memory start pointer low byte |
| LDXLAB_B4 | get the record memory start pointer mid byte |
| LDALAB_B5 | get the record memory start pointer high byte |
| save AXY as the next record pointer | |
| LAB_E9AF: ; $E9AF | |
| STYLAB_47 | save the next record pointer low byte |
| STXLAB_48 | save the next record pointer mid byte |
| STALAB_49 | save the next record pointer high byte |
| CLC | flag ok |
| RTS | |
| LAB_E9B7: ; $E9B7 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| display or set the update date | |
| Occasionally it may be necessary to move the update pointer. The update point can | |
| be reset to the nearest day. Specifying any date outside the range of logged data | |
| will move the pointer to the corresponding end of the file. | |
| LAB_E9B9: ; $E9B9 | |
| CLB5,LAB_51 | clear the date filter flag |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_E9B7 | if null just go flag an error and exit |
| JSRLAB_E99A | get the end date ?? |
| BCSLAB_E9ED | if error just exit |
| LDALAB_58 | get the end date low byte |
| LDXLAB_59 | get the end date high byte |
| STALAB_56 | save the start date low byte |
| STXLAB_57 | save the start date high byte |
| LDA#$FF | set $FF for unreachable future date |
| STALAB_58 | set the end date low byte |
| STALAB_59 | set the end date high byte |
| LAB_E9D3: ; $E9D3 | |
| LDYLAB_47 | get the next record pointer low byte |
| LDXLAB_48 | get the next record pointer mid byte |
| LDALAB_49 | get the next record pointer high byte |
| STYLAB_4D | save the current record pointer low byte |
| STXLAB_4E | save the current record pointer mid byte |
| STALAB_4F | save the current record pointer high byte |
| JSRLAB_EDDB | copy the next record to the record buffer |
| BCSLAB_E9E9 | if error go ?? |
| JSRLAB_EA00 | test for filter match, return Cb = 0 if match ?? |
| BCSLAB_E9D3 | if no match go ?? |
| LAB_E9E9: ; $E9E9 | |
| JSRLAB_FB36 | copy the current record pointer to the update point |
| CLC | flag ok |
| LAB_E9ED: ; $E9ED | |
| RTS | |
| ************************************************************************************ | |
| "TODAY" or "UPDATE" table | |
| LAB_E9EE: ; $E9EE | |
| .BYTE'TODAY',$80 | "TODAY" |
| .WORD$0000 | word flag for TODAY |
| .BYTE'UPDATE',$80 | "UPDATE" |
| .WORD$FFFF | word flag for UPDATE |
| .BYTE$00 | end marker |
| ************************************************************************************ | |
| test for filter match, return Cb = 0 if match ?? | |
| LAB_EA00: ; $EA00 | |
| LDALAB_04F8 | get the record year/month/date low byte |
| LDYLAB_04F9 | get the record year/month/date high byte |
| CPYLAB_57 | compare the record date with the start date high byte |
| BNELAB_EA0C | if the high bytes differ skip the low byte compare |
| CMPLAB_56 | compare the record date with the start date low byte |
| LAB_EA0C: ; $EA0C | |
| BCCLAB_EA29 | if the record date is < the start date go do the no |
| match exit | |
| CPYLAB_59 | compare the record date with the end date high byte |
| BNELAB_EA14 | if the high bytes differ skip the low byte compare |
| CMPLAB_58 | compare the record date with the end date low byte |
| LAB_EA14: ; $EA14 | |
| BEQLAB_EA18 | if the record date = the start date go do no match exit |
| BCSLAB_EA29 | if the record date is > the start date go do the no |
| match exit | |
| the record date is >= the start date and <= the end date | |
| LAB_EA18: ; $EA18 | |
| LDALAB_04F7 | get the record call type ?? |
| EORLAB_52 | compare it with the call type match byte |
| ANDLAB_53 | mask it with the call type mask byte |
| BNELAB_EA29 | if not ?? go do the no match exit |
| BBS4,LAB_51,LAB_EA2E | if the metered units flag is set go compare the units |
| BBS6,LAB_51,LAB_EA42 | if the number filter flag is set go compare the number |
| LAB_EA27: ; $EA27 | |
| CLC | flag filter match |
| RTS | |
| LAB_EA29: ; $EA29 | |
| JSRLAB_FFDC | swap the stack pointers |
| SEC | flag no filter match |
| RTS | |
| compare the metered units with the units limit | |
| LAB_EA2E: ; $EA2E | |
| LDALAB_0501 | get the record metered units high byte |
| AND#$1F | mask 000x xxxx |
| CMPLAB_05A1 | compare it with the metered units limit high byte |
| BNELAB_EA3E | if not equal skip the low byte compare |
| LDALAB_0500 | get the record metered units low byte |
| CMPLAB_05A0 | compare it with the metered units limit low byte |
| LAB_EA3E: ; $EA3E | |
| BCCLAB_EA29 | if the metered units are smaler than the units limit |
| go do the no match exit | |
| BRALAB_EA27 | else return filter match |
| compare the number with the filter number | |
| LAB_EA42: ; $EA42 | |
| TXA | copy X |
| PHA | save X |
| LDALAB_04F6 | get the record length |
| AND#$1F | mask 000x xxxx, the record length |
| SEC | set carry for subtract |
| SBC#LAB_0502-LAB_04F6 | |
| subtract the offset to the number | |
| BCSLAB_EA50 | if there are digits skip the zero |
| LDA#$00 | else set zero digits |
| LAB_EA50: ; $EA50 | |
| ASLA | * 2 digits per byte |
| STALAB_44 | save the digit count |
| LDY#$00 | clear the digit index |
| STYLAB_46 | save the digit index |
| LAB_EA57: ; $EA57 | |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BEQLAB_EA68 | if null go ?? |
| BCSLAB_EA68 | . |
| CMP#$0E | compare with 14 |
| BCSLAB_EA76 | if >= 14 go ?? |
| SEB4,A | . |
| JSRLAB_EA9A | compare the digit and increment the index ?? |
| BEQLAB_EA57 | . |
| LAB_EA68: ; $EA68 | |
| LDA#$00 | . |
| JSRLAB_EA9A | compare the digit and increment the index ?? |
| SEC | flag no match |
| BNELAB_EA71 | . |
| CLC | flag match |
| LAB_EA71: ; $EA71 | |
| PLA | pull X |
| TAX | restore X |
| BCSLAB_EA29 | if ?? go do the no match exit |
| RTS | |
| LAB_EA76: ; $EA76 | |
| AND#$01 | . |
| ASLA | .... ..x. |
| ASLA | .... .x.. |
| ASLA | .... x... |
| ASLA | ...x .... |
| STALAB_45 | . |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BCSLAB_EA68 | if error go ?? |
| ADCLAB_45 | . |
| STALAB_45 | . |
| BEQLAB_EA68 | if null go ?? |
| LAB_EA89: ; $EA89 | |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BCSLAB_EA68 | if error go ?? |
| SEB4,A | . |
| JSRLAB_EA9A | compare the digit and increment the index ?? |
| BNELAB_EA68 | . |
| DECLAB_45 | . |
| BNELAB_EA89 | . |
| BRALAB_EA68 | . |
| ************************************************************************************ | |
| compare the digit and increment the index ?? | |
| LAB_EA9A: ; $EA9A | |
| LDXLAB_46 | get the digit index |
| INX | increment it |
| EORLAB_0600-1,X | compare it with the ?? digit |
| BNELAB_EAA4 | if no match skip the index save |
| STXLAB_46 | else save the index |
| LAB_EAA4: ; $EAA4 | |
| RTS | |
| ************************************************************************************ | |
| display a record's details | |
| LAB_EAA5: ; $EAA5 | |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LDALAB_04F8 | get the record year/month/date low byte |
| LDXLAB_04F9 | get the record year/month/date high byte |
| BBS7,LAB_51,LAB_EABD | if the full list flag is set go output the year/month/date |
| if not the full list see if the date had been output for this year/month/date | |
| CMPLAB_54 | compare it with the last output year/month/date low byte |
| BNELAB_EAB9 | if not output yet go do it |
| CPXLAB_55 | compare it with the last output year/month/date high byte |
| BEQLAB_EAC6 | if already output skip doing it again |
| LAB_EAB9: ; $EAB9 | |
| STALAB_54 | save the last output year/month/date low byte |
| STXLAB_55 | save the last output year/month/date high byte |
| LAB_EABD: ; $EABD | |
| JSRLAB_EBE1 | output AX as year/month/date |
| BBS7,LAB_51,LAB_EAC6 | if the full list flag is set skip the newline |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LAB_EAC6: ; $EAC6 | |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| LDALAB_04F6 | get the record seconds b0 byte |
| ASLA | shift the record start seconds b0 into Cb |
| LDALAB_04FA | get the record start minutes and seconds |
| LDXLAB_04FB | get the record start hours and minutes |
| JSRLAB_EC32 | expand and output AX and Cb as HH:MM:SS |
| JSRLAB_EBEC | copy the start hh:mm:ss to the call start temporary |
| BBC7,LAB_51,LAB_EB03 | if the full list flag is not set skip the ans/last time |
| LDALAB_50 | get the buffered record length |
| CMP#$09 | compare it with the ans/last length |
| BCSLAB_EAF1 | if >= $09 go do the ans/last time |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE' - - ',$00 | " - - " |
| BRALAB_EB03 | go do the cleared time |
| LAB_EAF1: ; $EAF1 | |
| LDALAB_04F6 | get the record seconds b0 byte |
| ASLA | shift the .. |
| ASLA | .. record ans/last .. |
| ASLA | .. seconds b0 into Cb |
| LDALAB_04FE | get the record ans/last minutes and seconds |
| LDXLAB_04FF | get the record ans/last hours and minutes |
| JSRLAB_EC32 | expand and output AX and Cb as HH:MM:SS |
| JSRLAB_EBEC | copy the ans/last hh:mm:ss to the call start temporary |
| LAB_EB03: ; $EB03 | |
| LDALAB_04F6 | get the record seconds b0 byte |
| ASLA | shift the record .. |
| ASLA | .. cleared seconds b0 into Cb |
| LDALAB_04FC | get the record cleared minutes and seconds |
| LDXLAB_04FD | get the record cleared hours and minutes |
| JSRLAB_EC32 | expand and output AX and Cb as HH:MM:SS |
| BBC7,LAB_51,LAB_EB1A | if the full list flag is not set skip the metered units |
| JSRLAB_EBF9 | subtract and display the call start from the call |
| cleared hh:mm:ss | |
| JSRLAB_EB21 | display 1/10ths of seconds and metered units or blank |
| LAB_EB1A: ; $EB1A | |
| JSRLAB_EB64 | display the record call type |
| JSRLAB_EC40 | display the record digits ?? |
| RTS | |
| ************************************************************************************ | |
| display 1/10ths of seconds and metered units or blank | |
| LAB_EB21: ; $EB21 | |
| LDALAB_04F7 | get the record call type |
| CLB2,A | mask xxxx x0xx, ?? |
| CMP#$31 | compare with o/g_ans type call |
| BNELAB_EB4E | if not o/g_ans type call go output [SPACE]s |
| LDA#'.' | set "." character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LDALAB_0501 | get the record metered units high byte |
| LSRA | shift .. |
| LSRA | .. the .. |
| LSRA | .. 1/8ths of .. |
| LSRA | .. seconds .. |
| LSRA | .. to b2-b0 |
| TAX | copy 1/8ths of seconds to the index |
| LDALAB_EB5C,X | get the nearest 1/10ths character from "01345689" |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| LDALAB_0501 | get the record metered units high byte |
| AND#$1F | mask 000x xxxx, the record length |
| TAX | copy the high byte to X |
| LDALAB_0500 | get the record metered units low byte |
| JSRLAB_F345 | output AX as a decimal value of four characters |
| BRALAB_EB59 | go output [SPACE] and return |
| LAB_EB4E: ; $EB4E | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE' ',$00 | " " |
| LAB_EB59: ; $EB59 | |
| JMPLAB_F3F0 | put [SPACE] in the Tx buffer |
| ************************************************************************************ | |
| 1/8th of a second as nearest 1/10th character | |
| fractions of seconds | |
| measured displayed | |
| ======== ========= | |
| x.000 x.0 | |
| x.125 x.1 | |
| x.250 x.3 | |
| x.375 x.4 | |
| x.500 x.5 | |
| x.625 x.6 | |
| x.750 x.8 | |
| x.875 x.9 | |
| LAB_EB5C: ; $EB5C | |
| .BYTE'01345689' | eighths of a second as the nearest tenth |
| ************************************************************************************ | |
| display the record call type | |
| LAB_EB64: ; $EB64 | |
| LDALAB_04F7 | get the record call type |
| BMILAB_EB86 | if ?? do error exit |
| LDX#$00 | clear the table index |
| LAB_EB6B: ; $EB6B | |
| CMPLAB_EB88,X | compare the flags with the table byte |
| BEQLAB_EB76 | if match go output the string |
| INX | else increment the index .. |
| INX | .. to the next flags byte |
| CPX#$12 | compare the index with max + 1 |
| BCCLAB_EB6B | loop if not there yet |
| LAB_EB76: ; $EB76 | |
| LDYLAB_EB88+1,X | get the string offset |
| LAB_EB79: ; $EB79 | |
| LDALAB_EB9A,Y | get a string character |
| BEQLAB_EB84 | if null go do ok exit |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INY | increment the string index |
| BNELAB_EB79 | loop for the next character, branch always |
| LAB_EB84: ; $EB84 | |
| CLC | flag ok |
| RTS | |
| LAB_EB86: ; $EB86 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| record call type bytes and string offsets | |
| LAB_EB88: ; $EB88 | |
| .BYTE$10 | "seized" |
| .BYTELAB_EB9A-LAB_EB9A | offset from the table start to the "seized" string |
| .BYTE$12 | "parked" |
| .BYTELAB_EB9A-LAB_EBA1 | offset from the table start to the "parked" string |
| .BYTE$20 | "i/c" |
| .BYTELAB_EB9A-LAB_EBA8 | offset from the table start to the "i/c" string |
| .BYTE$21 | "i/c_ans" |
| .BYTELAB_EB9A-LAB_EBAC | offset from the table start to the "i/c_ans" string |
| .BYTE$23 | "i/c_cont" |
| .BYTELAB_EB9A-LAB_EBB4 | offset from the table start to the "i/c_cont" string |
| .BYTE$30 | "o/g" |
| .BYTELAB_EB9A-LAB_EBBD | offset from the table start to the "o/g" string |
| .BYTE$31 | "o/g_ans" |
| .BYTELAB_EB9A-LAB_EBC6 | offset from the table start to the "o/g_ans" string |
| .BYTE$34 | "o/g*" |
| .BYTELAB_EB9A-LAB_EBCF | offset from the table start to the "o/g*" string |
| .BYTE$35 | "o/g*ans" |
| .BYTELAB_EB9A-LAB_EBD8 | offset from the table start to the "o/g*ans" string |
| ************************************************************************************ | |
| record call type strings | |
| LAB_EB9A: ; $EB9A | |
| .BYTE'seized',$00 | |
| LAB_EBA1: ; $EBA1 | |
| .BYTE'parked',$00 | |
| LAB_EBA8: ; $EBA8 | |
| .BYTE'i/c',$00 | |
| LAB_EBAC: ; $EBAC | |
| .BYTE'i/c_ans',$00 | |
| LAB_EBB4: ; $EBB4 | |
| .BYTE'i/c_cont',$00 | |
| LAB_EBBD: ; $EBBD | |
| .BYTE'o/g ',$00 | |
| LAB_EBC6: ; $EBC6 | |
| .BYTE'o/g_ans ',$00 | |
| LAB_EBCF: ; $EBCF | |
| .BYTE'o/g* ',$00 | |
| LAB_EBD8: ; $EBD8 | |
| .BYTE'o/g*ans ',$00 | |
| ************************************************************************************ | |
| output AX as year/month/date | |
| LAB_EBE1: ; $EBE1 | |
| JSRLAB_F542 | expand AX into the temporary YY:MM:DD ?? |
| LDX#>LAB_34 | set the date pointer low byte |
| LDY#<LAB_34 | set the date pointer high byte |
| JSRLAB_F6DA | output the date as DD MMM YYY |
| RTS | |
| ************************************************************************************ | |
| copy temp hh:mm:ss to LAB_3B ?? | |
| LAB_EBEC: ; $EBEC | |
| LDALAB_37 | ?? temporary hour |
| STALAB_3B | save the start hour |
| LDALAB_38 | ?? temporary minute |
| STALAB_3C | save the start minute |
| LDALAB_39 | ?? temporary second |
| STALAB_3D | save the start second |
| RTS | |
| ************************************************************************************ | |
| subtract and display the call start from the call cleared hh:mm:ss | |
| LAB_EBF9: ; $EBF9 | |
| SEC | set carry for subtract |
| LDALAB_39 | get the call cleared second |
| SBCLAB_3D | subtract the call start second |
| BCSLAB_EC03 | if no underflow skip the seconds correct |
| ADC#$3C | else add 60 seconds |
| CLC | and clear the carry for minutes subtract + 1 |
| LAB_EC03: ; $EC03 | |
| PHA | save the seconds difference |
| LDALAB_38 | get the call cleared minute |
| SBCLAB_3C | subtract the call start minute |
| BCSLAB_EC0D | if no underflow skip the minutes correct |
| ADC#$3C | else add 60 minutes |
| CLC | and clear the carry for hours subtract + 1 |
| LAB_EC0D: ; $EC0D | |
| PHA | save the minutes difference |
| LDALAB_37 | get the call cleared hour |
| SBCLAB_3B | subtract the call start hour |
| BCSLAB_EC16 | if no underflow skip the hours correct |
| ADC#$18 | else add 24 hours |
| LAB_EC16: ; $EC16 | |
| BEQLAB_EC24 | if the hours are zero go output spaces |
| JSRLAB_F350 | output A as a two digit decimal value |
| JSRLAB_F3F4 | put ":" in the Tx buffer |
| PLA | pull the minutes difference |
| JSRLAB_F368 | output A as a three digit decimal value |
| BRALAB_EC2B | go output the seconds |
| LAB_EC24: ; $EC24 | |
| JSRLAB_F3EA | put [SPACE][SPACE][SPACE] in the Tx buffer |
| PLA | pull the minutes difference |
| JSRLAB_F350 | output A as a two digit decimal value |
| LAB_EC2B: ; $EC2B | |
| JSRLAB_F3F4 | put ":" in the Tx buffer |
| PLA | pull the seconds difference |
| JMPLAB_F368 | output A as a three digit decimal value and return |
| ************************************************************************************ | |
| expand and output AX and Cb as HH:MM:SS | |
| LAB_EC32: ; $EC32 | |
| JSRLAB_F568 | expand AX and Cb into temporary HH:MM:SS |
| LDX#>LAB_34 | set the date/time pointer low byte |
| LDY#<LAB_34 | set the date/time pointer high byte |
| JSRLAB_F742 | output the time as HH:MM:SS |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| RTS | |
| ************************************************************************************ | |
| display the record digits ?? | |
| LAB_EC40: ; $EC40 | |
| LDALAB_04F6 | get the record length |
| AND#$1F | mask 000x xxxx, the record length |
| SEC | set carry for subtract |
| SBC#LAB_0502-LAB_04F6 | |
| subtract the offset to the number | |
| BCSLAB_EC4C | if there are digits skip the zero |
| LDA#$00 | else set zero digits |
| LAB_EC4C: ; $EC4C | |
| ASLA | * 2 digits per byte |
| STALAB_44 | save the digit count |
| LDY#$00 | clear the digit index |
| LAB_EC51: ; $EC51 | |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BEQLAB_EC61 | if null just exit |
| BCSLAB_EC61 | if error just exit |
| CMP#$0E | compare with 14 |
| BCSLAB_EC62 | if >= 14 go ?? |
| JSRLAB_EC8E | ?? output keypad character [A] |
| BRALAB_EC51 | loop for the next digit |
| LAB_EC61: ; $EC61 | |
| RTS | |
| LAB_EC62: ; $EC62 | |
| AND#$01 | . |
| ASLA | . |
| ASLA | . |
| ASLA | . |
| ASLA | . |
| STALAB_45 | . |
| LDA#'(' | set "(" character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BCSLAB_EC87 | . |
| ADCLAB_45 | . |
| STALAB_45 | . |
| BEQLAB_EC87 | . |
| LAB_EC7A: ; $EC7A | |
| JSRLAB_ECB6 | get the digit indexed by Y |
| BCSLAB_EC87 | . |
| SEB4,A | . |
| JSRLAB_EC8E | ?? output keypad character [A] |
| DECLAB_45 | . |
| BNELAB_EC7A | . |
| LAB_EC87: ; $EC87 | |
| LDA#')' | set ")" character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| BRALAB_EC51 | . |
| ************************************************************************************ | |
| ?? output keypad character [A] | |
| LAB_EC8E: ; $EC8E | |
| TAX | copy A to the index |
| LDALAB_EC96,X | get the keypad character [X] |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| RTS | |
| ************************************************************************************ | |
| keypad character tables | |
| LAB_EC96: ; $EC96 | |
| .BYTE' 1234567890?./ ' | |
| LAB_ECA6: | |
| .BYTE'D1234567890*#ABC' | |
| ************************************************************************************ | |
| get the digit indexed by Y | |
| LAB_ECB6: ; $ECB6 | |
| CPYLAB_44 | compare the index with the digit count |
| BCSLAB_ECCB | if done go return error |
| TYA | copy the digit index |
| LSRA | / 2 |
| TAX | copy the byte index |
| LDALAB_0502,X | get the digit's byte |
| BCSLAB_ECC6 | if Cb = 1 go use the low nibble |
| LSRA | else shift the .. |
| LSRA | .. high nibble .. |
| LSRA | .. to the .. |
| LSRA | .. low nibble |
| LAB_ECC6: ; $ECC6 | |
| INY | increment the digit index |
| AND#$0F | mask the nibble |
| CLC | flag ok |
| RTS | |
| LAB_ECCB: ; $ECCB | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| transfer logged call data then automatically disconnect | |
| LAB_ECCD: ; $ECCD | |
| JSRLAB_ECD6 | do download |
| BCSLAB_ECD5 | if error just exit |
| LDM#$00,LAB_08 | else clear the signed on flag |
| LAB_ECD5: ; $ECD5 | |
| RTS | |
| ************************************************************************************ | |
| transfer logged call data | |
| data is .. | |
| [NAK] .. waits 1 second for a [NAK] reply 5 times | |
| <block> .. waits 1 second for an [ACK] reply then send the next block | |
| if no [ACK] .. | |
| [NAK] .. waits 1 second for a [NAK] reply 20 times then resends the block | |
| after all the blocks or after a no [ACK], no [NAK] exit | |
| [NAK] .. waits 1 second for a [NAK] reply 5 times | |
| [EOT] | |
| LAB_ECD6: ; $ECD6 | |
| JSRLAB_E877 | find a filter and set the match/mask values |
| BCSLAB_ED45 | if error just exit |
| JSRLAB_E941 | get a date range ?? |
| BCSLAB_ED45 | if error just exit |
| LDM#$00,LAB_60 | clear the block number low byte |
| LDM#$00,LAB_61 | clear the block number high byte |
| JSRLAB_ED55 | save the download header to the buffer |
| LDY#$05 | set 5 times |
| BRALAB_ECF8 | go wait for [NAK] |
| output the next block of records | |
| LAB_ECED: ; $ECED | |
| LDY#$14 | set 20 times |
| JSRLAB_EDA3 | fill the transmit buffer with records |
| BCSLAB_ED10 | if error go ??, never branches, Cb is always 0 |
| BEQLAB_ED0E | if no records copied do the send loop ok exit |
| BRALAB_ECFF | branch into the send loop |
| LAB_ECF8: ; $ECF8 | |
| JSRLAB_EE81 | send [NAK] and wait 1 second for [NAK] Y times |
| BVSLAB_ED10 | if no [NAK] go do error exit |
| BCSLAB_ED10 | if error go do error exit |
| LAB_ECFF: ; $ECFF | |
| JSRLAB_EE24 | put the block in the Tx buffer |
| return Cb = 1 if RI or CD | |
| return Vb = 1 if no ACK | |
| BVSLAB_ECF8 | if no ACK go wait for [NAK] |
| BCSLAB_ED10 | if RI or CD go do error exit |
| INCLAB_60 | increment the block number low byte |
| BNELAB_ED0C | if no rollover skip the high byte increment |
| INCLAB_61 | increment the block number high byte |
| LAB_ED0C: ; $ED0C | |
| BRALAB_ECED | go do another block of records |
| LAB_ED0E: ; $ED0E | |
| CLV | flag no no [NAK] |
| CLC | flag no error |
| LAB_ED10: ; $ED10 | |
| PHP | save the status |
| LDY#$05 | set 5 times |
| JSRLAB_EE81 | send [NAK] and wait 1 second for [NAK] Y times |
| LDA#$04 | set [EOT] |
| JSRLAB_F40B | put a byte in the Tx buffer |
| PLP | restore the status |
| NOP | do nothing |
| BVSLAB_ED46 | if no [NAK] go do error exit |
| BCSLAB_ED46 | if error go do error exit |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,$07,'downloaded',$00 | |
| JSRLAB_E80E | output calls and units ?? |
| BBC5,LAB_51,LAB_ED44 | if the date filter flag is clear skip ?? |
| LDYLAB_47 | get the next record pointer low byte |
| LDXLAB_48 | get the next record pointer mid byte |
| LDALAB_49 | get the next record pointer high byte |
| STYLAB_4D | save the current record pointer low byte |
| STXLAB_4E | save the current record pointer mid byte |
| STALAB_4F | save the current record pointer high byte |
| LAB_ED44: ; $ED44 | |
| CLC | flag no error |
| LAB_ED45: ; $ED45 | |
| RTS | |
| LAB_ED46: ; $ED46 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'aborted',$00 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| save the download header to the buffer | |
| header is .. | |
| <index to byte after ref>,$80,[STX],<version byte>,<serial # word>,<$10 num bytes>, | |
| <$xx ref bytes>,<index to end read settings bytes>,$81,<$1C settings bytes> | |
| LAB_ED55: ; $ED55 | |
| LDX#$01 | set the index |
| LDA#$80 | . |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| LDA#$02 | set [STX] |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| LDALAB_E002 | get the version number low byte |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| LDALAB_E000 | get the serial number low byte |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| LDALAB_E000+1 | get the serial number high byte |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| LDY#$00 | clear the read index |
| LAB_ED75: ; $ED75 | |
| LDALAB_0547,Y | get a num character |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| INY | increment the read index |
| CPY#$12 | compare the index with max + 1 |
| BCCLAB_ED75 | loop if more to do |
| STXLAB_0200 | save the length so far |
| INX | increment the buffer index |
| LDA#$81 | . |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| copy the settings, metered units and date/time to the header | |
| LDY#$02 | set the index to the digits value |
| SEI | disable the interrupts |
| LAB_ED8C: ; $ED8C | |
| LDALAB_6B-2,Y | get a byte from the settings |
| JSRLAB_ED9E | save A to the buffer and increment the index ?? |
| INY | increment the read index |
| CPY#LAB_85+1-LAB_6B+2 | |
| compare Y with the end + 1 | |
| BCCLAB_ED8C | loop if more bytes to do |
| CLI | enable the interrupts |
| STXLAB_62 | save the block buffer length |
| LDXLAB_0200 | restore the index to the start of the settings |
| TYA | copy the read index |
| ************************************************************************************ | |
| save A to the buffer and increment the index ?? | |
| LAB_ED9E: ; $ED9E | |
| STALAB_0200,X | save the read index to the buffer |
| INX | increment the buffer index |
| RTS | |
| ************************************************************************************ | |
| fill the transmit buffer with records | |
| LAB_EDA3: ; $EDA3 | |
| TYA | copy Y |
| PHA | save Y |
| LDA#$0A | set the record count |
| LDX#$00 | clear the transmit buffer index |
| LAB_EDA9: ; $EDA9 | |
| PHA | save the record count |
| LAB_EDAA: ; $EDAA | |
| TXA | copy X |
| PHA | save X |
| JSRLAB_EDDB | copy the next record to the record buffer |
| PLA | pull X |
| TAX | restore X |
| BCSLAB_EDCA | if no more records skip the record copy |
| JSRLAB_EA00 | test for filter match, return Cb = 0 if match ?? |
| BCSLAB_EDAA | if no match go get another record |
| JSRLAB_E7F0 | increment the calls count and add units from the buffered |
| record ?? | |
| LDY#$00 | clear the buffered record index |
| LAB_EDBD: ; $EDBD | |
| LDALAB_04F6,Y | get a byte from the buffered record |
| STALAB_0200,X | save it to the block buffer |
| INX | increment the block buffer index |
| INY | increment the buffered record index |
| CPYLAB_50 | compare the buffered record index with the buffered |
| record length | |
| BCCLAB_EDBD | loop if more bytes to copy |
| CLC | flag still records |
| LAB_EDCA: ; $EDCA | |
| PLA | restore the record count |
| BCSLAB_EDD4 | if no more records exit |
| DECA | decrement the record count |
| BEQLAB_EDD4 | if all done just exit |
| CPX#$E0 | compare the buffer index with $E0 |
| BCCLAB_EDA9 | if there is still room go get another record |
| LAB_EDD4: ; $EDD4 | |
| STXLAB_62 | save the block buffer length |
| PLA | pull Y |
| TAY | restore Y |
| TXA | copy the transmit buffer length |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| copy the next record to the record buffer | |
| return Cb = 1 if error | |
| LAB_EDDB: ; $EDDB | |
| LDYLAB_47 | get the next record pointer low byte |
| LDXLAB_48 | get the next record pointer mid byte |
| LDALAB_49 | get the next record pointer high byte |
| CMPLAB_B8 | compare it with the record memory end pointer high byte |
| BNELAB_EDED | if not the same go get a record |
| CPXLAB_B7 | compare it with the record memory end pointer mid byte |
| BNELAB_EDED | if not the same go get a record |
| CPYLAB_B6 | compare it with the record memory end pointer low byte |
| BEQLAB_EE21 | if the same go do error exit |
| LAB_EDED: ; $EDED | |
| JSRLAB_FFA3 | set bank and LAB_63/64 pointer from A ?? |
| LDA(LAB_63),Y | get the record length |
| AND#$1F | mask 000x xxxx, the record length |
| BEQLAB_EE21 | if zero length record go do error exit |
| STALAB_50 | save the buffered record length |
| LDX#$00 | clear the record buffer index |
| BRALAB_EE19 | branch into the loop |
| LAB_EDFC: ; $EDFC | |
| LDA(LAB_63),Y | get a record byte |
| STALAB_04F6,X | save it to the record buffer |
| INX | increment the record buffer index |
| INY | increment the record index |
| STYLAB_47 | save the next record pointer low byte |
| BNELAB_EE19 | if no rollover skip the record pointer rollover |
| TXA | copy the record buffer index |
| PHA | save the record buffer index |
| LDXLAB_48 | get the next record pointer mid byte |
| LDALAB_49 | get the next record pointer high byte |
| JSRLAB_FF90 | increment, check and rollover the XA word ?? |
| STXLAB_48 | save the next record pointer mid byte |
| STALAB_49 | save the next record pointer high byte |
| JSRLAB_FFA3 | set bank and LAB_63/64 pointer from A ?? |
| PLA | pull the record buffer index |
| TAX | restore the record buffer index |
| LAB_EE19: ; $EE19 | |
| CPXLAB_50 | compare record buffer index with the buffered record |
| length | |
| BCCLAB_EDFC | loop if more record bytes to copy |
| CLC | flag ok |
| LAB_EE1E: ; $EE1E | |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| RTS | |
| LAB_EE21: ; $EE21 | |
| SEC | flag error |
| BRALAB_EE1E | go exit |
| ************************************************************************************ | |
| put a block in the Tx buffer | |
| return Cb = 1 if RI or CD | |
| return Vb = 1 if no ACK | |
| block is .. | |
| [STX],<block #.w>,<block len.b>,<block bytes>,<checksum.w> | |
| LAB_EE24: ; $EE24 | |
| LDM#$00,LAB_5E | clear the checksum low byte |
| LDM#$00,LAB_5F | clear the checksum high byte |
| LDA#$02 | set [STX] |
| JSRLAB_EE71 | put a byte in the Tx buffer and checksum it ?? |
| LDALAB_60 | get the block number low byte |
| JSRLAB_EE71 | put a byte in the Tx buffer and checksum it ?? |
| LDALAB_61 | get the block number high byte |
| JSRLAB_EE71 | put a byte in the Tx buffer and checksum it ?? |
| LDALAB_62 | get the block length |
| PHA | save the block length |
| JSRLAB_EE71 | put a byte in the Tx buffer and checksum it ?? |
| PLA | restore the block length |
| BEQLAB_EE4F | if zero skip the block copy |
| LDX#$00 | clear the count/index |
| LAB_EE44: ; $EE44 | |
| LDALAB_0200,X | get a block byte |
| JSRLAB_EE71 | put a byte in the Tx buffer and checksum it ?? |
| INX | increment the count/index |
| CPXLAB_62 | compare it with the block length |
| BCCLAB_EE44 | loop if more to do |
| LAB_EE4F: ; $EE4F | |
| LDALAB_5E | get the checksum low byte |
| JSRLAB_F40B | put a byte in the Tx buffer |
| LDALAB_5F | get the checksum high byte |
| JSRLAB_F40B | put a byte in the Tx buffer |
| JSRLAB_F443 | wait for timer 2 ?? |
| LDALAB_04 | get the ?? buffer read index |
| STALAB_03 | save the ?? buffer write index |
| clear the buffer | |
| JSRLAB_F2C0 | wait for a character from ?? |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| BCSLAB_EE70 | if no carrier or ring just exit |
| BVSLAB_EE6F | if 1 second counted do ok exit |
| BITLAB_F2F8 | set Vb |
| CMP#$06 | compare the character with [ACK] |
| BNELAB_EE6F | if not ACK exit with Vb = 1 |
| CLV | clear Vb, flag [ACK] |
| LAB_EE6F: ; $EE6F | |
| CLC | flag no error |
| LAB_EE70: ; $EE70 | |
| RTS | |
| ************************************************************************************ | |
| put a byte in the Tx buffer and checksum it ?? | |
| LAB_EE71: ; $EE71 | |
| PHA | save the byte |
| JSRLAB_F40B | put a byte in the Tx buffer |
| PLA | restore the byte |
| CLC | clear carry for add |
| LAB_EE78 = $EE78 ; this label is because of an incorrect byte ## | |
| ADCLAB_5E | add the checksum low byte |
| STALAB_5E | save the checksum low byte |
| BCCLAB_EE80 | if no carry skip the high byte increment |
| INCLAB_5F | else increment the high byte |
| CLC | flag ok |
| LAB_EE80: ; $EE80 | |
| RTS | |
| ************************************************************************************ | |
| send [NAK] and wait 1 second for [NAK] Y times | |
| return Cb = 1 if error | |
| return Vb = 1 in no [NAK] | |
| LAB_EE81: ; $EE81 | |
| LDA#$15 | set [NAK] |
| JSRLAB_F40B | put a byte in the Tx buffer |
| JSRLAB_F443 | wait for timer 2 ?? |
| LDALAB_04 | get the ?? buffer read index |
| STALAB_03 | save the ?? buffer write index |
| clear the buffer | |
| JSRLAB_F2C0 | wait for a character from ?? |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| BCSLAB_EEA1 | if no carrier or ring just exit |
| EOR#$15 | compare the character with [NAK] |
| CLV | flag not no [NAK] |
| BEQLAB_EEA1 | if [NAK] just exit |
| JSRLAB_F143 | wait for 1/2 a second |
| DEY | decrement the wait count |
| BNELAB_EE81 | loop if more to do |
| BITLAB_F2F8 | set Vb, flag no [NAK] |
| CLC | flag no error |
| LAB_EEA1: ; $EEA1 | |
| RTS | |
| ************************************************************************************ | |
| The progress of monitored calls is shown as it develops. If a call is already in | |
| progress its immediate history is shown, otherwise any previous call is displayed. | |
| There is no inactivity time-out in live mode, use the currently defined break key | |
| to exit live mode. | |
| There is a bug in this routine that means the call type is not correctly displayed. | |
| LAB_EEA2: ; $EEA2 | |
| JSRLAB_E517 | display the break value |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| LDY#$00 | . |
| CPYLAB_5A | . |
| BNELAB_EEBA | . |
| LAB_EEAE: ; $EEAE | |
| LDY#$00 | clear the index |
| JSRLAB_EEF2 | set Cb if Y = LAB_5A ?? |
| BCSLAB_EEE7 | . |
| LDA#$07 | set [BELL] character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LAB_EEBA: ; $EEBA | |
| LDALAB_0578 | get the ?? minutes/seconds |
| LDXLAB_0579 | get the ?? hours/minutes |
| CLC | clear the seconds b0 |
| JSRLAB_EC32 | expand and output AX and Cb as HH:MM:SS |
| INY | set Y = $01 |
| LAB_EEC5: ; $EEC5 | |
| INY | increment the digit index |
| JSRLAB_EEF2 | set Cb if Y = LAB_5A ?? |
| BCSLAB_EEE7 | if all done just exit |
| CPYLAB_5A | . |
| BCSLAB_EEAE | . |
| LDXLAB_057A-2,Y | get a ?? character |
| BMILAB_EEDC | if end marker go do the call type |
| LDALAB_EC96,X | get the keypad character [X] |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| BRALAB_EEC5 | . |
| LAB_EEDC: ; $EEDC | |
| LDALAB_EE78,X | get a live table string character |
| ## there is a bug here, this address should be LAB_EEF8 | |
| BEQLAB_EEC5 | if end marker return to ?? |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INX | increment the index |
| BNELAB_EEDC | go get another character, branch always |
| LAB_EEE7: ; $EEE7 | |
| CLC | flag ok |
| RTS | |
| LAB_EEE9: ; $EEE9 | |
| JSRLAB_F2F9 | check for no carrier, ring or break |
| BCSLAB_EEF7 | if no carrier, ring or break go exit |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| ************************************************************************************ | |
| set Cb if Y = LAB_5A ?? | |
| LAB_EEF2: ; $EEF2 | |
| CPYLAB_5A | . |
| BEQLAB_EEE9 | . |
| CLC | flag ok |
| LAB_EEF7: ; $EEF7 | |
| RTS | |
| ************************************************************************************ | |
| live table strings | |
| this data is unused because of an incorrect byte ## | |
| LAB_EEF8: | |
| .BYTE'ring',$00 | "ring" |
| .BYTE'/answ',$00 | "/answ" |
| .BYTE'/clear',$0D,$0A,$00 | |
| "/clear",[CR],[LF] | |
| .BYTE'seized',$00 | "seized" |
| .BYTE'parked',$00 | "parked" |
| .BYTE'/',$00 | "/" |
| ************************************************************************************ | |
| RINGBACK n | |
| when the RINGBACK command is entered with a telephone number of minimum length of | |
| one digit, maximum length fifteen digits digits, the message "hang up" is sent and | |
| the line is dropped before ten seconds is allowed for the incoming call to clear. | |
| The line is then seized and the number that was entered is loop dialled. The logger | |
| is now the call originator so the terminal should switch to answer mode. Hayes | |
| compatible modems allegedly default to answer mode under these conditions. If a | |
| carrier is not detected within 30 seconds of dialling then a second attempt is made | |
| before giving up and signing the user off. | |
| While in answer mode the terminal should not echo transmitted characters to the | |
| screen or recieved characters back to the Monolog. | |
| LAB_EF1C: ; $EF1C | |
| BBC3,LAB_F0,LAB_EF99 | test b3 port 2 data register, modem/RS232 select |
| if RS232 selected go do error exit | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_EF99 | if null go flag an error and exit |
| LDX#$00 | clear the ringback number index |
| LAB_EF26: ; $EF26 | |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| BEQLAB_EF44 | if null go test he length and do ringback |
| SEC | set carry for subtract |
| SBC#$30 | convert ASCII to digit |
| BCCLAB_EF99 | if < 0 go do error exit |
| BEQLAB_EF38 | if 0 go convert it to 10 |
| CMP#9+1 | compare it with max + 1 |
| BCSLAB_EF99 | if > 9 go do error exit |
| BCCLAB_EF3A | go save the character, branch always |
| LAB_EF38: ; $EF38 | |
| LDA#$0A | convert 0 to 10 |
| LAB_EF3A: ; $EF3A | |
| STALAB_0406,X | save the digit to the ringback number buffer |
| INX | increment the ringback number length |
| CPX#$10 | compare the ringback number length with max + 1 |
| BCCLAB_EF26 | if less go get another ringback digit |
| BCSLAB_EF99 | else go flag an error and exit |
| LAB_EF44: ; $EF44 | |
| STALAB_0406,X | save the null end to the rignback number buffer |
| CPX#$02 | compare the length with two |
| BCCLAB_EF99 | if less than two go flag an error and exit |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'hang up',$0D,$0A,$0A,$00 | |
| JSRLAB_F443 | wait for timer 2 ?? |
| SEB6,LAB_F0 | set b6 port 2 data register, turn the modem off |
| JSRLAB_EFAC | wait 10 seconds for carrier clear |
| BCSLAB_EF99 | if carrier still present do error exit |
| JSRLAB_F12F | release the line and wait 2 seconds |
| JSRLAB_F139 | wait for 10 seconds |
| LDY#$02 | set the retry count |
| LAB_EF6D: ; $EF6D | |
| JSRLAB_F12F | release the line and wait 2 seconds |
| JSRLAB_F12C | set modem select, seize the line |
| JSRLAB_F134 | wait for 2 seconds |
| JSRLAB_F16A | disable the UART and set timer 2 to 10ms ?? |
| LDX#$00 | clear the ringback number index |
| LAB_EF7B: ; $EF7B | |
| LDALAB_0406,X | get a character from the ringback number buffer |
| BEQLAB_EF86 | if the end marker go wait for an answer |
| JSRLAB_EF9B | dial an outgoing digit |
| INX | increment the ringback number index |
| BRALAB_EF7B | loop |
| LAB_EF86: ; $EF86 | |
| JSRLAB_F14F | setup the UART and timer 2 and clear the Tx/Rx buffers ?? |
| JSRLAB_F0D3 | set originate mode, wait 30 seconds for two seconds of |
| new carrier and then ?? | |
| BCSLAB_EF93 | if error go decrement the retry count |
| JSRLAB_E1E3 | output 'Monolog ', serial#, version#, RAM size |
| CLC | flag ok |
| RTS | |
| LAB_EF93: ; $EF93 | |
| DEY | decrement the retry count |
| BNELAB_EF6D | loop if more tries left |
| LDM#$00,LAB_08 | clear the signed on flag |
| LAB_EF99: ; $EF99 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| dial an outgoing digit | |
| LAB_EF9B: ; $EF9B | |
| STALAB_42 | save the digit to dial |
| BBS2,LAB_FE,LAB_EFA4 | 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_EFA4: ; $EFA4 | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| BBC7,LAB_42,LAB_EFA4 | if stil dialing wait some more |
| RTS | |
| ************************************************************************************ | |
| wait 10 seconds for carrier clear | |
| LAB_EFAC: ; $EFAC | |
| LDM#$50,LAB_3F | set the 1/8th second countdown byte |
| LAB_EFAF: ; $EFAF | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| CLC | flag no carrier |
| BBS4,LAB_F0,LAB_EFBC | test b4 port 2 data register, carrier detect |
| if no carrier detected just exit | |
| TSTLAB_3F | test the 1/8th second countdown byte |
| BNELAB_EFAF | loop if not timed out |
| SEC | flag carrier |
| LAB_EFBC: ; $EFBC | |
| RTS | |
| ************************************************************************************ | |
| display the line votage | |
| LAB_EFBD: ; $EFBD | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'VLine ',$00 | |
| LDALAB_25 | get the A2D channel 3 byte (Battery) |
| STALAB_14 | save the A2D channel 3 byte (Battery) |
| LDALAB_1F | get the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_14 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_EFD7 | if ch0 >= ch3 skip the 2's complement |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| LAB_EFD7: ; $EFD7 | |
| PHA | save (ch0-ch3) |
| LDM#>$72C5,LAB_16 | set the dividend low byte, 114.77 in 8.8 fixed point |
| LDM#<$72C5,LAB_17 | set the dividend high byte, 114.77 in 8.8 fixed point |
| LDM#$00,LAB_15 | clear the divisor high byte |
| JSRLAB_F0A9 | divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| does 114.77 / ch3 | |
| PLA | restore (ch0-ch3) |
| STALAB_14 | save the multiplicand low byte |
| LDM#$00,LAB_15 | clear the multiplicand high byte |
| JSRLAB_F07E | mult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| does 114.77 / ch3 * (ch0-ch3) | |
| TXA | take the integer part of the result |
| JMPLAB_F368 | output A as a three digit decimal value |
| ************************************************************************************ | |
| display or set the VThreshold value | |
| LAB_EFF1: ; $EFF1 | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_F00C | if null just go output the current value |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_F022 | if there is a following character go do error exit |
| CPX#$00 | test the result high byte |
| BNELAB_F022 | if the high byte is not zero go do error exit |
| CMP#$3C | compare the value with max + 1 |
| BCSLAB_F022 | if > max go do error exit |
| CMP#$0A | compare the value with the minimum |
| BCCLAB_F022 | if < minimum go do error exit |
| STALAB_6D | save the VThreshold value |
| JSRLAB_F024 | save the integer part of VThreshold * 2.277 in LAB_94 |
| LAB_F00C: ; $F00C | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'VThreshold ',$00 | |
| LDALAB_6D | get the VThreshold value |
| JMPLAB_F368 | output A as a three digit decimal value and return |
| LAB_F022: ; $F022 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| save the integer part of VThreshold * 2.277 in LAB_94 | |
| LAB_F024: ; $F024 | |
| LDALAB_6D | get the VThreshold value |
| STALAB_16 | save the multiplier low byte |
| LDM#$00,LAB_17 | clear the multiplier high byte |
| LDM#>$0247,LAB_14 | set the multiplicand low byte, 2.277 in 8.8 fixed point |
| LDM#<$0247,LAB_15 | set the multiplicand high byte, 2.277 in 8.8 fixed point |
| JSRLAB_F07E | mult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| STXLAB_94 | save the integer part of the result |
| RTS | |
| ************************************************************************************ | |
| display the battery voltage | |
| LAB_F037: ; $F037 | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'VBattery ',$00 | |
| LDM#>$FA00,LAB_16 | set the dividend low byte, 250.00 in 8.8 fixed point |
| LDM#<$FA00,LAB_17 | set the dividend high byte, 250.00 in 8.8 fixed point |
| LDALAB_25 | get the A2D channel 3 byte (Battery) |
| CLC | clear carry for add |
| ADCLAB_E004 | add the VBattery constant |
| STALAB_14 | save the divisor low byte |
| LDM#$00,LAB_15 | clear the divisor high byte |
| JSRLAB_F0A9 | divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| does 250 / (ch3+const) | |
| LDALAB_16 | get the result low byte |
| LDXLAB_17 | get the result high byte |
| JMPLAB_F35D | output AX as a xx.xx digit decimal value and return |
| ************************************************************************************ | |
| read the A2D channel 3 byte (Battery) | |
| LAB_F061: ; $F061 | |
| LDA#$03 | set channel 3 |
| .BYTE$2C | makes the next line BIT $xxxx |
| ************************************************************************************ | |
| read the A2D channel 2 byte (Meter) | |
| LAB_F064: ; $F064 | |
| LDA#$02 | set channel 2 |
| .BYTE$2C | makes the next line BIT $xxxx |
| ************************************************************************************ | |
| read the A2D channel 1 byte | |
| LAB_F067: ; $F067 | |
| LDA#$01 | set channel 1 |
| .BYTE$2C | makes the next line BIT $xxxx |
| ************************************************************************************ | |
| read the A2D channel 0 byte | |
| LAB_F06A: ; $F06A | |
| LDA#$00 | set channel 0 |
| ************************************************************************************ | |
| read an A2D byte from channel [A] | |
| LAB_F06C: ; $F06C | |
| BBC2,LAB_E9,LAB_F06C | read the A2D control register and loop if not ready |
| CLB6,LAB_F3 | clear b6 port 1 data register, turn vref on |
| STALAB_E9 | set the A2D control register and start the conversion |
| LAB_F073: ; $F073 | |
| BBC2,LAB_E9,LAB_F073 | read the A2D control register and loop if not ready |
| LDALAB_EA | read the A2D data register |
| SEB6,LAB_F3 | set b6 port 1 data register, turn vref off |
| LDM#$02,LAB_E9 | set the A2D control register to channel 0 |
| RTS | |
| ************************************************************************************ | |
| multiply LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX | |
| LAB_F07E: ; $F07E | |
| LDA#$00 | clear A |
| STALAB_12 | clear the partial low byte |
| STALAB_13 | clear the partial high byte |
| LDX#$10 | set the bit count |
| LAB_F086: ; $F086 | |
| ASLLAB_12 | shift the partial low byte |
| ROLLAB_13 | shift the partial high byte |
| ASLLAB_16 | shift the multiplier low byte |
| ROLLAB_17 | shift the multiplier high byte |
| BCCLAB_F09D | if top bit clear skip the add |
| CLC | clear carry for add |
| LDALAB_12 | get the partial low byte |
| ADCLAB_14 | add the multiplicand low byte |
| STALAB_12 | save the partial low byte |
| LDALAB_13 | get the partial high byte |
| ADCLAB_15 | add the multiplicand low byte |
| STALAB_13 | save the partial high byte |
| LAB_F09D: ; $F09D | |
| DEX | decrement the bit count |
| BNELAB_F086 | loop if more to do |
| LDALAB_12 | get the result low byte |
| LDXLAB_13 | get the result high byte |
| STALAB_16 | save the result low byte |
| STXLAB_17 | save the result high byte |
| RTS | |
| ************************************************************************************ | |
| divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX | |
| LAB_F0A9: ; $F0A9 | |
| LDA#$00 | clear A |
| STALAB_12 | clear the remainder low byte |
| STALAB_13 | clear the remainder high byte |
| LDX#$10 | set the bit count |
| BRALAB_F0B7 | branch into the divide loop |
| LAB_F0B3: ; $F0B3 | |
| ROLLAB_12 | shift the remainder low byte |
| ROLLAB_13 | shift the remainder high byte |
| LAB_F0B7: ; $F0B7 | |
| SEC | set carry for subtract |
| LDALAB_12 | get the remainder low byte |
| SBCLAB_14 | subtract the divisor low byte |
| TAY | copy the remainder low byte |
| LDALAB_13 | get the remainder high byte |
| SBCLAB_15 | subtract the divisor high byte |
| BCCLAB_F0C7 | if underflowed skip the save |
| STYLAB_12 | save the remainder low byte |
| STALAB_13 | save the remainder high byte |
| LAB_F0C7: ; $F0C7 | |
| ROLLAB_16 | shift the dividend low byte |
| ROLLAB_17 | shift the dividend high byte |
| DEX | decrement the bit count |
| BPLLAB_F0B3 | loop if more to do |
| LDALAB_16 | get the result low byte |
| LDXLAB_17 | get the result high byte |
| RTS | |
| ************************************************************************************ | |
| set originate mode, wait 30 seconds for two seconds of new carrier and then ?? | |
| LAB_F0D3: ; $F0D3 | |
| LDA#$F0 | set the 1/8th second count to 30 seconds |
| SEB5,LAB_F0 | set b5 port 2 data register, set originate mode |
| JSRLAB_F0E7 | wait A 1/8ths of a second for two seconds of new carrier |
| BCSLAB_F0E2 | if error just exit |
| CLB6,LAB_F0 | clear b6 port 2 data register, turn the modem off |
| JSRLAB_F134 | wait for 2 seconds |
| CLC | flag ok |
| LAB_F0E2: ; $F0E2 | |
| RTS | |
| ************************************************************************************ | |
| wait 15 seconds for two seconds of new carrier | |
| LAB_F0E3: ; $F0E3 | |
| 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_F0E7: ; $F0E7 | |
| SEB6,LAB_F0 | set b6 port 2 data register, turn the modem on |
| JSRLAB_F12C | set modem select, seize the line |
| make sure there is no carrier | |
| LDM#$10,LAB_3F | set the 1/8th second countdown byte, 2 seconds |
| LAB_F0EF: ; $F0EF | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| TSTLAB_3F | test the 1/8th second countdown byte |
| BEQLAB_F12A | if timed out go do error exit |
| BBC4,LAB_F0,LAB_F0EF | test b4 port 2 data register, carrier detect |
| if carrier detected just loop | |
| no carrier was detected | |
| BBS5,LAB_F0,LAB_F109 | test b5 port 2 data register, originate/answer |
| if originate go wait for the new carrier | |
| is answer mode so ?? | |
| JSRLAB_F134 | 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_F13E | wait for 3 seconds |
| CLB7,LAB_F3 | ?? port 1 data register |
| wait for the carrier to be detected | |
| LAB_F109: ; $F109 | |
| STALAB_3F | save the 1/8th second countdown byte |
| LAB_F10B: ; $F10B | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| LAB_F10F: ; $F10F | |
| LDALAB_3F | get the 1/8th second countdown byte |
| SEC | set carry for subtract |
| SBC#$10 | subtract $10 1/8ths of a second |
| BCCLAB_F12A | if < 2 seconds left go do error exit |
| BBS4,LAB_F0,LAB_F10B | test b4 port 2 data register, carrier detect |
| if no carrier detected go wait some more | |
| carrier is present, make sure it stays for two seconds | |
| LAB_F119: ; $F119 | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| BBS4,LAB_F0,LAB_F10F | test b4 port 2 data register, carrier detect |
| if no carrier detected go wait for the carrier | |
| CMPLAB_3F | compare it with the 1/8th second countdown byte |
| BCCLAB_F119 | if 2 seconds haven't elapsed go wait some more |
| carrier has been present for 2 seconds | |
| LDALAB_04 | get the ?? buffer read index |
| STALAB_03 | save the ?? buffer write index |
| clear the buffer | |
| CLC | flag ok |
| RTS | |
| LAB_F12A: ; $F12A | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| set modem select, seize the line | |
| LAB_F12C: ; $F12C | |
| 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_F12F: ; $F12F | |
| BBC3,LAB_F0,LAB_F14E | 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_F134: ; $F134 | |
| LDM#$10,LAB_3F | set the 1/8th second countdown byte |
| BRALAB_F146 | wait for LAB_3F 1/8ths of a second |
| ************************************************************************************ | |
| wait for 10 seconds | |
| LAB_F139: ; $F139 | |
| LDM#$50,LAB_3F | set the 1/8th second countdown byte |
| BRALAB_F146 | wait for LAB_3F 1/8ths of a second |
| ************************************************************************************ | |
| wait for 3 seconds | |
| LAB_F13E: ; $F13E | |
| LDM#$18,LAB_3F | set the 1/8th second countdown byte |
| BRALAB_F146 | wait for LAB_3F 1/8ths of a second |
| ************************************************************************************ | |
| wait for 1/2 a second | |
| LAB_F143: ; $F143 | |
| LDM#$04,LAB_3F | set the 1/8th second countdown byte |
| ************************************************************************************ | |
| wait for LAB_3F 1/8ths of a second | |
| LAB_F146: ; $F146 | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| TSTLAB_3F | test the 1/8th second countdown byte |
| BNELAB_F146 | loop if not counted out |
| LAB_F14E: ; $F14E | |
| RTS | |
| ************************************************************************************ | |
| setup the UART and timer 2 and clear the Tx/Rx buffers ?? | |
| LAB_F14F: ; $F14F | |
| CLB2,LAB_FE | clear the timer 2 interrupt enable bit |
| 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 | |
| LDM#$57,LAB_DE | set prescaller 2 |
| sets (1/(87+1)) * (1/16) Hz | |
| this will be 5236 Hz with a 7.3728MHz XTAL | |
| LDA#$BF | . |
| STALAB_DF | set timer 2 to 36 and 2/3ms |
| STALAB_FB | set the BAUD rate generator |
| sets (1/8) * (1/(191+1)) * (1/16) baud | |
| this will be 300 BAUD with a 7.3728MHz XTAL | |
| LDA#$00 | clear A |
| STALAB_E5 | write to the UART Rx buffer register |
| clear the error bits | |
| STALAB_03 | clear the ?? buffer write index |
| STALAB_04 | clear the ?? buffer read index |
| STALAB_05 | clear the Tx buffer write index |
| STALAB_06 | clear the Tx buffer read index |
| RTS | |
| ************************************************************************************ | |
| disable the UART and set timer 2 to 10ms ?? | |
| LAB_F16A: ; $F16A | |
| 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_43 | clear the pulse count |
| LDM#$FF,LAB_42 | clear the digit to dial |
| RTS | |
| ************************************************************************************ | |
| test the RAM ?? | |
| LAB_F17C: ; $F17C | |
| LDY#$00 | clear the index |
| STYLAB_10 | clear the RAM test pointer low byte |
| STYLAB_11 | 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_10),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_10),Y | save the $55 to $1xxxx |
| CLB4,LAB_F6 | clear b4 port 0 data register, clear RAM A16 |
| LDA(LAB_10),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_F1A1 | if $AA was 160K so go use it |
| DEX | decrement the size to 64K |
| CMP#$55 | compare the read byte with $55 |
| BEQLAB_F1A1 | if $55 was 64K so go use it |
| DEX | else decrement the size to 32K |
| LAB_F1A1: ; $F1A1 | |
| STXLAB_00 | save the RAM size |
| TXA | copy it |
| ASLA | * 2 |
| TAX | back to the index |
| LDALAB_F1BC,X | get the RAM end low byte |
| STALAB_01 | save the RAM end low byte |
| SEC | set carry for subtract |
| SBCLAB_F1C5 | subtract the ?? start low byte |
| STALAB_65 | save the ?? size low byte |
| LDALAB_F1BC+1,X | get the RAM end high byte |
| STALAB_02 | save the RAM end high byte |
| SBCLAB_F1C5+1 | subtract the ?? start high byte |
| STALAB_66 | save the ?? size high byte |
| RTS | |
| ************************************************************************************ | |
| RAM end | |
| LAB_F1BC: ; $F1BC | |
| .WORD$0200 | . |
| .WORD$0280 | . |
| .WORD$0400 | . |
| ************************************************************************************ | |
| RAM size values | |
| LAB_F1C2: ; $F1C2 | |
| .BYTE$20 | 32K |
| .BYTE$40 | 64K |
| .BYTE$A0 | 160K |
| ************************************************************************************ | |
| ?? start address | |
| LAB_F1C5: ; $F1C5 | |
| .BYTE$01 | . |
| .BYTE$86 | . |
| ************************************************************************************ | |
| display the RAM size | |
| LAB_F1C7: ; $F1C7 | |
| LDXLAB_00 | get the RAM size, $00, $01 or $02 |
| LDALAB_F1C2,X | get the numeric size |
| JSRLAB_F368 | output A as a three digit decimal value |
| LDA#'K' | set "K" character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| RTS | |
| ************************************************************************************ | |
| get a decimal value, result in AX ?? | |
| LAB_F1D5: ; $F1D5 | |
| LDM#$00,LAB_0D | clear the result low byte |
| LDM#$00,LAB_0E | clear the result mid byte |
| LDM#$00,LAB_0F | clear the result high byte |
| LDY#$06 | set the digit counter |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| BRALAB_F1E8 | branch into the loop |
| LAB_F1E5: ; $F1E5 | |
| JSRLAB_F243 | get a character from the Rx buffer |
| LAB_F1E8: ; $F1E8 | |
| JSRLAB_F233 | test the character in A, return Cb=0 if it is "0" to "9" |
| BCSLAB_F22B | if not "0" to "9" go return the result |
| DEY | decrement the digit counter |
| BMILAB_F22B | if more than 6 digits go return the result |
| SEC | set carry for subtract |
| SBC#'0' | convert "0" to "9" to 0 to 9 |
| PHA | save the digit |
| LDALAB_0F | get the result high byte |
| PHA | save it |
| LDALAB_0E | get the result mid byte |
| PHA | save it |
| LDALAB_0D | get the result low byte |
| ASLLAB_0D | * 2 result low byte |
| ROLLAB_0E | * 2 result mid byte |
| ROLLAB_0F | * 2 result high byte |
| ASLLAB_0D | * 4 result low byte |
| ROLLAB_0E | * 4 result mid byte |
| ROLLAB_0F | * 4 result high byte |
| ADCLAB_0D | * 5 result low byte |
| STALAB_0D | save the result low byte |
| PLA | pull the result mid byte |
| ADCLAB_0E | * 5 result mid byte |
| STALAB_0E | save the result mid byte |
| PLA | pull the result high byte |
| ADCLAB_0F | * 5 result high byte |
| STALAB_0F | save the result high byte |
| ASLLAB_0D | * 10 result low byte |
| ROLLAB_0E | * 10 result mid byte |
| ROLLAB_0F | * 10 result high byte |
| PLA | pull the digit |
| ADCLAB_0D | add the result low byte |
| STALAB_0D | save the result low byte |
| BCCLAB_F1E5 | if no carry go get the next digit |
| INCLAB_0E | else increment the result mid byte |
| BNELAB_F1E5 | if no overflow go get the next digit |
| INCLAB_0F | else increment the result high byte |
| BRALAB_F1E5 | go get the next digit |
| LAB_F22B: ; $F22B | |
| TAY | copy the last character |
| LDALAB_0D | get the result low byte |
| LDXLAB_0E | get the result mid byte |
| INY | set the flags .. |
| DEY | .. on the last character |
| RTS | |
| ************************************************************************************ | |
| test the character in A, return Cb=0 if it is "0" to "9" | |
| LAB_F233: ; $F233 | |
| CMP#'0' | compare the character with "0" |
| BCCLAB_F23A | if < "0" go set the carry and return |
| CMP#'9'+1 | compare the character with "9"+1 |
| RTS | |
| LAB_F23A: ; $F23A | |
| SEC | flag not in range |
| RTS | |
| ************************************************************************************ | |
| test the character in A, return Cb=0 if it is "A" to "Z" | |
| LAB_F23C: ; $F23C | |
| CMP#'A' | compare the character with "A" |
| BCCLAB_F23A | if < "A" go set the carry and return |
| CMP#'Z'+1 | compare the character with "Z"+1 |
| RTS | |
| ************************************************************************************ | |
| get a character from the Rx buffer | |
| LAB_F243: ; $F243 | |
| PHA | make room on the stack for the character |
| TXA | copy X |
| PHA | save X |
| LDXLAB_0C | get the Rx buffer read index |
| LDALAB_0406,X | get a character from the Rx buffer |
| INCLAB_0C | increment the Rx buffer read index |
| TSX | copy the stack pointer |
| INX | increment the stack index .. |
| INX | .. to where the room was made |
| STALAB_0100,X | save the character to the stack |
| PLA | pull X |
| TAX | restore X |
| PLA | pull the character |
| RTS | |
| ************************************************************************************ | |
| get a non space character from the Rx buffer | |
| LAB_F257: ; $F257 | |
| JSRLAB_F243 | get a character from the Rx buffer |
| CMP#' ' | compare it with [SPACE] |
| BEQLAB_F257 | if it was [SPACE] got get another character |
| AND#$FF | set the flags on the character |
| RTS | |
| ************************************************************************************ | |
| get a non space character from the Rx buffer without increment | |
| LAB_F261: ; $F261 | |
| JSRLAB_F257 | get a non space character from the Rx buffer |
| DECLAB_0C | decrement the Rx buffer read index |
| AND#$FF | set the flags on the character |
| RTS | |
| ************************************************************************************ | |
| wait -AX seconds for input | |
| return Cb = 1 if timed out | |
| LAB_F269: ; $F269 | |
| STALAB_40 | save the seconds count low byte |
| STXLAB_41 | save the seconds count high byte |
| LDX#$00 | clear X |
| STXLAB_0C | clear the Rx buffer read index |
| LDA#'>' | set the prompt character |
| BRALAB_F29B | go enter the loop at the output the prompt point |
| LAB_F275: ; $F275 | |
| JSRLAB_F2C0 | wait for a character from ?? |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| BCSLAB_F2B5 | if no carrier or ring just exit |
| BVSLAB_F2B6 | if second timeout go increment the seconds count |
| CLB7,A | mask 0xxx xxxx, 7 bit ASCII |
| CMP#$0D | compare the character with [CR] |
| BEQLAB_F2AD | if [CR] go return the line |
| CMP#$7F | compare the character with [RUB OUT] ?? |
| BEQLAB_F2A0 | if [RUB OUT] ?? go delete the last character |
| CMP#$08 | compare the character with [BACKSPACE] |
| BEQLAB_F2A0 | if [BACKSPACE] go delete the last character |
| CMP#$20 | compare the character with [SPACE] |
| BCCLAB_F2B6 | if less than [SPACE] go decrement the counter |
| CPX#$4F | compare the index with max + 1 |
| BCSLAB_F2B6 | if > max go decrement the counter |
| STALAB_0406,X | save a character to the Rx buffer |
| INX | increment the Rx buffer index |
| TSTLAB_08 | test the signed on flag |
| BNELAB_F29B | if signed on skip the character replace |
| LDA#'-' | else replace the character with a "-" character |
| this hides the password during sign on | |
| LAB_F29B: ; $F29B | |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| BRALAB_F275 | loop for the input |
| delete the last character | |
| LAB_F2A0: ; $F2A0 | |
| TXA | copy the buffer index to A |
| BEQLAB_F275 | if already at the start just loop |
| DEX | decrement the buffer index |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$08,' ',$08,$00 | "[BACKSPACE][SPACE][BACKSPACE]", overwrite character |
| BRALAB_F275 | loop for the input |
| LAB_F2AD: ; $F2AD | |
| LDA#$00 | clear A |
| STALAB_0406,X | clear the next character in the Rx buffer |
| STALAB_0A | clear the system flags byte |
| CLC | flag ok |
| LAB_F2B5: ; $F2B5 | |
| RTS | |
| LAB_F2B6: ; $F2B6 | |
| INCLAB_40 | increment the seconds count low byte |
| BNELAB_F275 | if no rollover loop for another character |
| INCLAB_41 | else increment the seconds count high byte |
| BNELAB_F275 | if no rollover loop for another character |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| wait for a character from ?? | |
| return Cb = 1 if no carrier or ring | |
| return Vb = 1 if 1 second counted | |
| LAB_F2C0: ; $F2C0 | |
| PHA | make room on the stack for the character |
| TXA | copy X |
| PHA | save X |
| LDM#$08,LAB_3F | set the 1/8th second countdown byte |
| LDXLAB_04 | get the ?? buffer read index |
| BRALAB_F2D8 | branch into the loop |
| LAB_F2CA: ; $F2CA | |
| BBS4,LAB_F0,LAB_F2ED | test b4 port 2 data register, carrier detect |
| if no carrier detected do error return | |
| BBS7,LAB_F0,LAB_F2ED | test b7 port 2 data register, ring detect |
| if ring detected go do error return | |
| TSTLAB_3F | test the 1/8th second countdown byte |
| BEQLAB_F2EF | if 1 second counted out go do null return |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| LAB_F2D8: ; $F2D8 | |
| CPXLAB_03 | compare it with the ?? buffer write index |
| BEQLAB_F2CA | if the buffer is empty just loop |
| LDALAB_0300,X | get a character from the ?? buffer |
| INCLAB_04 | increment the ?? buffer read index |
| CLC | flag carrier |
| CLV | flag no timeout |
| TSX | copy the stack pointer |
| INX | increment the stack index .. |
| INX | .. to where the room was made |
| STALAB_0100,X | save the character to the stack |
| PLA | pull X |
| TAX | restore X |
| PLA | pull the character |
| RTS | |
| LAB_F2ED: ; $F2ED | |
| SEC | flag error |
| .BYTE$24 | makes next line BIT $xx |
| LAB_F2EF: ; $F2EF | |
| CLC | flag ok |
| BITLAB_F2F8 | set Vb |
| PLA | pull X |
| TAX | restore X |
| PLA | pull the character |
| LDA#$00 | clear the character |
| LAB_F2F8: ; $F2F8 | |
| RTS | |
| ************************************************************************************ | |
| check for no carrier, ring or break | |
| LAB_F2F9: ; $F2F9 | |
| BBS4,LAB_F0,LAB_F314 | test b4 port 2 data register, carrier detect |
| if no carrier detected go flag no carrier | |
| BBS7,LAB_F0,LAB_F314 | test b7 port 2 data register, ring detect |
| if ring detected go flag ring | |
| CLC | flag no break |
| BBC7,LAB_0A,LAB_F315 | if not break just exit |
| PHA | save A |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'break',$00 | |
| LDALAB_04 | get the ?? buffer read index |
| STALAB_03 | save the ?? buffer write index |
| clear the buffer | |
| PLA | restore A |
| LAB_F314: ; $F314 | |
| SEC | no carrier, ring or break |
| LAB_F315: ; $F315 | |
| RTS | |
| ************************************************************************************ | |
| output the following null terminated string | |
| LAB_F316: ; $F316 | |
| PLA | pull the return address low byte |
| STALAB_0D | save the string pointer low byte |
| PLA | pull the return address high byte |
| STALAB_0E | save the string pointer high byte |
| TXA | copy X |
| PHA | save X |
| LDX#$00 | clear the index |
| LAB_F320: ; $F320 | |
| INCLAB_0D | increment the string pointer low byte |
| BNELAB_F326 | if no rollover skip the high byte increment |
| INCLAB_0E | else increment the string pointer high byte |
| LAB_F326: ; $F326 | |
| LDA(LAB_0D,X) | get a string character |
| BEQLAB_F32F | if null go exit the routine |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| BRALAB_F320 | loop for the next character |
| LAB_F32F: ; $F32F | |
| PLA | pull X |
| TAX | restore X |
| LDALAB_0E | get the string pointer high byte |
| PHA | push the return address high byte |
| LDALAB_0D | get the string pointer low byte |
| PHA | push the return address low byte |
| RTS | |
| ************************************************************************************ | |
| output AXY as a decimal value | |
| LAB_F338: ; $F338 | |
| LDM#$06,LAB_5B | set a seven digit number, actually six digits |
| LDM#$00,LAB_5C | set no minimum length |
| LDM#$FF,LAB_5D | set no decimal point |
| STYLAB_0F | save the high byte |
| BRALAB_F376 | output AX[LAB_0F] as a decimal value |
| ************************************************************************************ | |
| output AX as a decimal value of four characters | |
| LAB_F345: ; $F345 | |
| LDM#$00,LAB_5B | set a single digit number |
| LDM#$04,LAB_5C | set a minimum length of four characters |
| LDM#$FF,LAB_5D | set no decimal point |
| BRALAB_F373 | output AX as a decimal value |
| ************************************************************************************ | |
| output A as a two digit decimal value | |
| LAB_F350: ; $F350 | |
| LDX#$00 | clear the AX value high byte |
| LDM#$01,LAB_5B | set a two digit number |
| LDM#$02,LAB_5C | set a minimum length of two characters |
| LDM#$FF,LAB_5D | set no decimal point |
| BRALAB_F373 | output AX as a decimal value |
| ************************************************************************************ | |
| output AX as a xx.xx digit decimal value | |
| LAB_F35D: ; $F35D | |
| LDM#$03,LAB_5B | set a four digit number |
| LDM#$00,LAB_5C | set no minimum length |
| LDM#$02,LAB_5D | set the decimal point position |
| BRALAB_F373 | output AX as a decimal value |
| ************************************************************************************ | |
| output A as a three digit decimal value | |
| LAB_F368: ; $F368 | |
| LDX#$00 | clear the value middle byte |
| ************************************************************************************ | |
| output AX as a three digit decimal value | |
| LAB_F36A: ; $F36A | |
| LDM#$02,LAB_5B | set a three digit number |
| LDM#$00,LAB_5C | set no minimum length |
| LDM#$FF,LAB_5D | set no decimal point |
| ************************************************************************************ | |
| output AX as a decimal value | |
| LAB_F373: ; $F373 | |
| LDM#$00,LAB_0F | clear the value high byte |
| ************************************************************************************ | |
| output AX[LAB_0F] as a decimal value | |
| LAB_5B holds the minimum number of numeric digits | |
| LAB_5C holds the minimum length of the output | |
| LAB_5D holds the decimal point position | |
| LAB_F376: ; $F376 | |
| STALAB_0D | save the value low byte |
| STXLAB_0E | save the value middle byte |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| LDX#$05 | set the power of 10 index |
| LAB_F381: ; $F381 | |
| LDA#$00 | clear A |
| STALAB_18,X | clear this power of 10 |
| SEC | set carry for the initial subtract |
| LAB_F386: ; $F386 | |
| LDALAB_0D | get the value low byte |
| SBCLAB_F3D8,X | subtract the power of 10 low byte |
| TAY | copy the result low byte |
| LDALAB_0E | get the value middle byte |
| SBCLAB_F3DE,X | subtract the power of 10 middle byte |
| PHA | save the result middle byte |
| LDALAB_0F | get the value high byte |
| SBCLAB_F3E4,X | subtract the power of 10 high byte |
| BCCLAB_F3A4 | if the result underflowed go do the next power of 10 |
| STALAB_0F | save the value high byte |
| PLA | pull the result middle byte |
| STALAB_0E | save the value middle byte |
| STYLAB_0D | save the value low byte |
| INCLAB_18,X | increment this power of 10 |
| BRALAB_F386 | go try again |
| LAB_F3A4: ; $F3A4 | |
| PLA | pull the result middle byte |
| DEX | decrement the power of 10 index |
| BPLLAB_F381 | loop if more to do |
| the number is converted to decimal nibbles at LAB_18 on | |
| LDX#$05 | set the digit index to the first digit |
| LAB_F3AA: ; $F3AA | |
| LDALAB_18,X | get a digit |
| BNELAB_F3C0 | if it's not zero go output it |
| CPXLAB_5B | compare the index with the forced digits index |
| BCCLAB_F3C0 | if the index < forced digits index go output it |
| CPXLAB_5C | compare the index with the total digits index |
| BCSLAB_F3B9 | if the index >= total digits index go do next digit |
| JSRLAB_F3F0 | else ?? output [SPACE] |
| LAB_F3B9: ; $F3B9 | |
| DEX | decrement the digit index |
| BPLLAB_F3AA | loop if more to do |
| BMILAB_F3D1 | go exit the routine |
| LAB_F3BE: ; $F3BE | |
| LDALAB_18,X | get a digit |
| LAB_F3C0: ; $F3C0 | |
| ORA#'0' | convert the nibble to ASCII |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| CPXLAB_5D | compare X with the decimal point position |
| BNELAB_F3CE | if not equal skip the decimal point output |
| LDA#'.' | set "." character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LAB_F3CE: ; $F3CE | |
| DEX | decrement the digit index |
| BPLLAB_F3BE | loop if more to do |
| LAB_F3D1: ; $F3D1 | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| CLC | flag ok |
| RTS | |
| ************************************************************************************ | |
| powers of 10 low, middle and high bytes | |
| LAB_F3D8: ; $F3D8 | |
| .BYTE$01 | 1 low byte |
| .BYTE$0A | 10 low byte |
| .BYTE$64 | 100 low byte |
| .BYTE$E8 | 1000 low byte |
| .BYTE$10 | 10000 low byte |
| .BYTE$A0 | 100000 low byte |
| LAB_F3DE: ; $F3DE | |
| .BYTE$00 | 1 middle byte |
| .BYTE$00 | 10 middle byte |
| .BYTE$00 | 100 middle byte |
| .BYTE$03 | 1000 middle byte |
| .BYTE$27 | 10000 middle byte |
| .BYTE$86 | 100000 middle byte |
| LAB_F3E4: ; $F3E4 | |
| .BYTE$00 | 1 high byte |
| .BYTE$00 | 10 high byte |
| .BYTE$00 | 100 high byte |
| .BYTE$00 | 1000 high byte |
| .BYTE$00 | 10000 high byte |
| .BYTE$01 | 100000 high byte |
| ************************************************************************************ | |
| put [SPACE][SPACE][SPACE] in the Tx buffer | |
| LAB_F3EA: ; $F3EA | |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| ************************************************************************************ | |
| put [SPACE] in the Tx buffer | |
| LAB_F3F0: ; $F3F0 | |
| LDA#' ' | set [SPACE] character |
| BRALAB_F3FF | put an even parity byte in the Tx buffer |
| ************************************************************************************ | |
| put ":" in the Tx buffer | |
| LAB_F3F4: ; $F3F4 | |
| LDA#':' | set ":" character |
| BRALAB_F3FF | put an even parity byte in the Tx buffer |
| ************************************************************************************ | |
| put [CR][LF] in the Tx buffer | |
| LAB_F3F8: ; $F3F8 | |
| LDA#$0D | set [CR] character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| LDA#$0A | set [LF] character |
| ************************************************************************************ | |
| put an even parity byte in the Tx buffer | |
| LAB_F3FF: ; $F3FF | |
| ASLA | shift and clear b0 |
| PHA | save the shifted byte |
| CLC | clear carry for even parity |
| LAB_F402: ; $F402 | |
| BCCLAB_F406 | skip bit change if carry clear |
| EOR#$80 | else toggle the high bit |
| LAB_F406: ; $F406 | |
| ASLA | shift b7 to carry |
| BNELAB_F402 | loop if more bits to do |
| PLA | restore the shifted byte |
| RORA | shift the even carry into b7 |
| ************************************************************************************ | |
| put a byte in the Tx buffer | |
| LAB_F40B: ; $F40B | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| LDXLAB_05 | get the Tx buffer write index |
| INX | increment it |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_F427 | if less go use it |
| LDX#$00 | else wrap it to zero |
| BRALAB_F427 | go use it |
| LAB_F41B: ; $F41B | |
| SEB2,LAB_FE | set the timer 2 interrupt enable bit |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| BBS4,LAB_F0,LAB_F43D | test b4 port 2 data register, carrier detect |
| if no carrier detected just exit | |
| BBS7,LAB_F0,LAB_F43D | test b7 port 2 data register, ring detect |
| if ring detected go ?? | |
| LAB_F427: ; $F427 | |
| CPXLAB_06 | compare the incremented write index with the read index |
| BEQLAB_F41B | if the same go wait for a byte to be sent |
| LDYLAB_05 | get the Tx buffer write index |
| STXLAB_05 | save the updated Tx buffer write index |
| TSX | copy the stack pointer |
| LDALAB_0100+3,X | get the saved character |
| STALAB_0400,Y | write it to the Tx buffer |
| BBS2,LAB_FE,LAB_F43D | if timer 2 interrupts enabled continue |
| CLB3,LAB_FE | else clear the timer 2 interrupt request bit |
| SEB2,LAB_FE | and set the timer 2 interrupt enable bit |
| LAB_F43D: ; $F43D | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTS | |
| ************************************************************************************ | |
| wait for timer 2 ?? | |
| LAB_F443: ; $F443 | |
| JSRLAB_FFDC | swap the stack pointers |
| WIT | stop the internal clock |
| BBS2,LAB_FE,LAB_F443 | if the timer 2 interrupts are enabled go wait more |
| RTS | |
| ************************************************************************************ | |
| set the default date/time and clear the line seized time | |
| LAB_F44B: ; $F44B | |
| LDX#$06 | set the count/index |
| LAB_F44D: ; $F44D | |
| LDALAB_F846,X | get the max + 1 for date and time |
| STALAB_26,X | save the max + 1 for date and time |
| LDALAB_F84D,X | get a default date/time byte |
| STALAB_79,X | save a current date/time byte |
| STALAB_2D,X | save a signed off date/time byte |
| DEX | decrement the count/index |
| BPLLAB_F44D | loop if more to do |
| LDA#$00 | clear A |
| STALAB_82 | . |
| STALAB_85 | . |
| ************************************************************************************ | |
| clear the line seized time | |
| LAB_F462: ; $F462 | |
| LDA#$80 | set an impossible time byte |
| STALAB_AF | save the line seized hours ?? |
| STALAB_B0 | save the line seized minutes ?? |
| STALAB_B1 | save the line seized seconds ?? |
| RTS | |
| ************************************************************************************ | |
| copy the current time to the line seized time | |
| LAB_F46B: ; $F46B | |
| SEI | disable the interrupts |
| LDALAB_7C | copy the current hours |
| STALAB_AF | save the line seized hours ?? |
| LDALAB_7D | copy the current minutes |
| STALAB_B0 | save the line seized minutes ?? |
| LDALAB_7E | copy the current seconds |
| STALAB_B1 | save the line seized seconds ?? |
| CLI | enable the interrupts |
| RTS | |
| ************************************************************************************ | |
| return Cb = 0 if time - line seized time < 30 seconds ?? | |
| LAB_F47A: ; $F47A | |
| LDY#$02 | set the byte count/index |
| TSX | copy the stack pointer |
| SEC | set carry for subtract |
| LAB_F47E: ; $F47E | |
| LDALAB_A4,Y | . |
| SBCLAB_AF,Y | subtract the line seized time |
| BCSLAB_F48A | if time >= line seized time then skip the correct |
| ADCLAB_29,Y | else add max + 1 for time |
| CLC | clear carry for next subtract |
| LAB_F48A: ; $F48A | |
| PHA | save the result |
| DEY | decrement the byte count/index |
| BPLLAB_F47E | loop if more to do |
| SEC | . |
| PLA | pull the hours result |
| BNELAB_F498 | . |
| PLA | pull the minutes result |
| BNELAB_F498 | . |
| PLA | pull the seconds result |
| CMP#$1E | compare the seconds with 30 |
| LAB_F498: ; $F498 | |
| TXS | restore the stack pointer |
| RTS | |
| ************************************************************************************ | |
| copy the current date/time to the signed off time | |
| LAB_F49A: ; $F49A | |
| LDX#$06 | set the count/index |
| SEI | disable the interrupts |
| LAB_F49D: ; $F49D | |
| LDALAB_79,X | get a current date/time byte |
| STALAB_2D,X | save a signed off date/time byte |
| DEX | decrement the count/index |
| BPLLAB_F49D | loop if more to do |
| CLI | enable the interrupts |
| RTS | |
| ************************************************************************************ | |
| check the temporary date/time | |
| LAB_F4A6: ; $F4A6 | |
| LDX#$06 | set the count/index |
| LAB_F4A8: ; $F4A8 | |
| LDALAB_34,X | get a temporary date/time byte |
| CMPLAB_F84D,X | compare it with a default date/time byte |
| BCCLAB_F4F4 | if less go flag an error and exit |
| CPX#$02 | compare the date/time index with the month |
| BNELAB_F4CB | if not the months go do the normal compare |
| LDXLAB_35 | get the temporary month |
| CPX#$02 | compare it with february |
| BNELAB_F4C2 | if not february just go do the compare |
| PHA | save the temporary date/time byte |
| LDALAB_34 | get the temporary year |
| AND#$03 | effectively do year MOD 4 |
| BNELAB_F4C1 | if not a leap year skip the leap year adjust |
| TAX | else clear the index for a leap year february |
| LAB_F4C1: ; $F4C1 | |
| PLA | restore the temporary date/time byte |
| LAB_F4C2: ; $F4C2 | |
| CMPLAB_F854,X | compare it with the max + 1 days in the month |
| BCSLAB_F4E0 | if > max go check if it's less than 30 |
| LDX#$02 | reset the index to the months |
| BRALAB_F4D0 | go do the next date/time byte |
| LAB_F4CB: ; $F4CB | |
| CMPLAB_F846,X | compare it with the max + 1 for date and time |
| BCSLAB_F4F4 | if > max go return an error |
| LAB_F4D0: ; $F4D0 | |
| DEX | decrement the count/index |
| BPLLAB_F4A8 | loop if more to do |
| LDX#$06 | set the count/index |
| SEI | disable the interrupts |
| LAB_F4D6: ; $F4D6 | |
| LDALAB_34,X | get a temporary date/time byte |
| STALAB_79,X | save a current date/time byte |
| DEX | decrement the count/index |
| BPLLAB_F4D6 | loop if more to do |
| CLI | enable the interrupts |
| CLC | flag ok |
| RTS | |
| LAB_F4E0: ; $F4E0 | |
| CMP#$1E | compare the number of days with 30 |
| BCSLAB_F4F5 | if >= 30 just exit |
| so it must be the 29th of february | |
| JSRLAB_F316 | output the following null terminated string |
| .BYTE$0D,$0A,'no chance',$21,$00 | |
| LAB_F4F4: ; $F4F4 | |
| SEC | flag error |
| LAB_F4F5: ; $F4F5 | |
| RTS | |
| ************************************************************************************ | |
| copy the current date/time to the temporary date/time | |
| LAB_F4F6: ; $F4F6 | |
| LDX#$06 | set the count/index |
| SEI | disable the interrupts |
| LAB_F4F9: ; $F4F9 | |
| LDALAB_79,X | get a current date/time byte |
| STALAB_34,X | save a temporary date/time byte |
| DEX | decrement the count/index |
| BPLLAB_F4F9 | loop if more to do |
| CLI | enable the interrupts |
| RTS | |
| ************************************************************************************ | |
| copy the current date/time to LAB_9A and LAB_A1 on ?? | |
| LAB_F502: ; $F502 | |
| LDX#$06 | set the count/index |
| SEI | disable the interrupts |
| LAB_F505: ; $F505 | |
| LDALAB_79,X | get a current date/time byte |
| STALAB_9A,X | . |
| STALAB_A1,X | . |
| DEX | decrement the count/index |
| BPLLAB_F505 | loop if more to do |
| CLI | enable the interrupts |
| RTS | |
| ************************************************************************************ | |
| copy the current date/time to LAB_9A and LAB_A1 diff to LAB_A8 ?? | |
| LAB_F510: ; $F510 | |
| LDX#$06 | set the count/index |
| SEI | disable the interrupts |
| SEC | set carry for subtract |
| LAB_F514: ; $F514 | |
| LDALAB_79,X | get a current date/time byte |
| STALAB_9A,X | . |
| SBCLAB_A1,X | . |
| BCSLAB_F51F | if no underflow skip the correction |
| ADCLAB_26,X | else add the max + 1 for date and time |
| CLC | clear the carry for SBC + 1 |
| LAB_F51F: ; $F51F | |
| STALAB_A8,X | save the diff time ?? |
| DEX | decrement the count/index |
| BPLLAB_F514 | loop if more to do |
| CLI | enable the interrupts |
| RTS | |
| ************************************************************************************ | |
| get the temporary YY:MM:DD in AX | |
| LAB_F526: ; $F526 | |
| LDALAB_35 | get the temporary month |
| ASLA | x xxxM MMM. |
| ASLA | x xxMM MM.. |
| ASLA | x xMMM M... |
| ASLA | x MMMM .... |
| ASLA | M MMM. .... |
| ROLLAB_34 | shift the high bit of the month into the temporary year |
| ORALAB_36 | OR with the temporary date, gives MMMD DDDD |
| LDXLAB_34 | get the temporary year, gives YYYY YYYM |
| RTS | |
| ************************************************************************************ | |
| get the LAB_9A/9B/9C YY:MM:DD in AX | |
| LAB_F534: ; $F534 | |
| LDALAB_9B | get the ?? month |
| ASLA | . ...M MMM. |
| ASLA | . ..MM MM.. |
| ASLA | . .MMM M... |
| ASLA | . MMMM .... |
| ASLA | M MMM. .... |
| ROLLAB_9A | shift the high bit of the month into the ?? year |
| ORALAB_9C | OR with the ?? date, gives MMMD DDDD |
| LDXLAB_9A | get the ?? year, gives YYYY YYYM |
| RTS | |
| ************************************************************************************ | |
| expand AX into the temporary YY:MM:DD ?? | |
| LAB_F542: ; $F542 | |
| PHA | . MMMD DDDD |
| AND#$1F | . ...D DDDD |
| STALAB_36 | save the ?? date |
| TXA | . YYYY YYYM |
| LSRA | M .YYY YYYY |
| STALAB_34 | save the ?? year |
| PLA | M MMMD DDDD |
| RORA | D MMMM DDDD |
| LSRA | D .MMM MDDD |
| LSRA | D ..MM MMDD |
| LSRA | D ...M MMMD |
| LSRA | D .... MMMM |
| STALAB_35 | save the ?? month |
| RTS | |
| ************************************************************************************ | |
| compress LAB_9D/9E/9F into AX and Cb ?? | |
| LAB_F554: ; $F554 | |
| LDALAB_9E | . ..MM MMMM get the ?? minutes |
| ASLA | . .MMM MMM. |
| ASLA | . MMMM MM.. |
| ASLA | M MMMM M... |
| ROLLAB_9D | . ..HH HHHM shift the ?? hour |
| ASLA | M MMMM .... |
| ROLLAB_9D | . .HHH HHMM shift the ?? hour |
| ASLA | M MMM. .... |
| ROLLAB_9D | . HHHH HMMM shift the ?? hour |
| LDXLAB_9D | . HHHH HMMM get the ?? hour |
| LSRLAB_9F | S ...S SSSS shift the ?? seconds |
| ORALAB_9F | S MMMS SSSS OR in the seconds |
| RTS | |
| ************************************************************************************ | |
| expand AX and Cb into temporary HH:MM:SS | |
| c X A | |
| LAB_F568: ; $F568 | = ========= ========= |
| PHA | save the minutes i jklm nprs abcd efgh |
| ROLA | shift in seconds b0 a jklm nprs bcde fghi |
| AND#$3F | mask the seconds ..de fghi |
| STALAB_39 | save the temporary seconds |
| PLA | restore the minutes a jklm nprs abcd efgh |
| STXLAB_37 | save the temporary hour a jklm nprs abcd efgh |
| LSRLAB_37 | shift the temporary hour s .jkl mnpr abcd efgh |
| RORA | shift the temporary minute h .jkl mnpr sabc defg |
| LSRLAB_37 | shift the temporary hour r ..jk lmnp sabc defg |
| RORA | shift the temporary minute g ..jk lmnp rsab cdef |
| LSRLAB_37 | shift the temporary hour p ...j klmn rsab cdef |
| RORA | shift the temporary minute f ...j klmn prsa bcde |
| LSRA | shift the temporary minute e ...j klmn .prs abcd |
| LSRA | shift the temporary minute d ...j klmn ..pr sabc |
| STALAB_38 | save the temporary minute ..pr sabc |
| RTS | |
| ************************************************************************************ | |
| display or set the time | |
| LAB_F57F: ; $F57F | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_F599 | if null just go output the current value |
| JSRLAB_F59E | get the time in the temporary time, Cb = 1 if error |
| BCCLAB_F594 | if no error go check the date/time |
| RTS | |
| ************************************************************************************ | |
| display or set the date | |
| LAB_F58A: ; $F58A | |
| JSRLAB_F261 | get a non space character from the Rx buffer without |
| increment | |
| BEQLAB_F599 | if null just go output the current value |
| JSRLAB_F5C5 | get the date as DD MMM YYYY |
| BCSLAB_F59D | if error just exit |
| LAB_F594: ; $F594 | |
| JSRLAB_F4A6 | check the temporary date/time |
| BCSLAB_F59D | if error just exit |
| LAB_F599: ; $F599 | |
| JSRLAB_F682 | output [CR][LF] and the current day/date/time |
| CLC | flag ok |
| LAB_F59D: ; $F59D | |
| RTS | |
| ************************************************************************************ | |
| get the time in the temporary time, return Cb = 1 if error | |
| LAB_F59E: ; $F59E | |
| JSRLAB_F4F6 | copy the current date/time to the temporary date/time |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BEQLAB_F5C3 | if null following go do error exit |
| STALAB_37 | save the returned hour value |
| TXA | copy the returned hour value high byte |
| BNELAB_F5C3 | if not $00 go do error exit |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BEQLAB_F5C3 | if null following go do error exit |
| STALAB_38 | save the returned minute value |
| TXA | copy the returned minute value high byte |
| BNELAB_F5C3 | if not $00 go do error exit |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| BNELAB_F5C3 | if null following go do error exit |
| STALAB_39 | save the returned second value |
| TXA | copy the returned second value high byte |
| BNELAB_F5C3 | if not $00 go do error exit |
| STALAB_3A | clear the returned 1/8th second value |
| CLC | flag ok |
| RTS | |
| LAB_F5C3: ; $F5C3 | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| get the date as DD MMM YYYY | |
| LAB_F5C5: ; $F5C5 | |
| JSRLAB_F4F6 | copy the current date/time to the temporary date/time |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| STALAB_36 | save the returned date value |
| TXA | copy the returned date value high byte |
| BNELAB_F61A | if not $00 go do error exit |
| TYA | copy the next character |
| BEQLAB_F618 | if null go do ok exit |
| CMP#'-' | compare the character with "-" |
| BEQLAB_F618 | if "-" go do ok exit |
| LDA#>LAB_F71B | set the month strings pointer low byte |
| LDX#<LAB_F71B | set the month strings pointer high byte |
| STALAB_0D | save the pointer low byte |
| STXLAB_0E | save the pointer high byte |
| LDY#$03 | set the table index to 'jan' |
| LDM#$01,LAB_35 | set january |
| LAB_F5E4: ; $F5E4 | |
| LDXLAB_0C | get the Rx buffer read index |
| LDA#$03 | three characters to compare |
| JSRLAB_F61C | compare A bytes of the buffer with the table ?? |
| BCCLAB_F5F7 | if found go return the month |
| INCLAB_35 | increment the month |
| LDALAB_35 | get the month |
| CMP#$0D | compare it with max + 1 |
| BCCLAB_F5E4 | if not there yet go try next month |
| BCSLAB_F61A | else go do error exit, branch always |
| LAB_F5F7: ; $F5F7 | |
| JSRLAB_F243 | get a character from the Rx buffer |
| BEQLAB_F618 | if null go do ok exit |
| CMP#'-' | compare it with "-" |
| BEQLAB_F618 | if "-" go do ok exit |
| CMP#' ' | compare it with [SPACE] |
| BNELAB_F5F7 | if it was [SPACE] go get another character |
| JSRLAB_F1D5 | get a decimal value, result in AX ?? |
| SEC | set carry for subtract |
| SBC#>$07BC | subtract 1980 low byte |
| STALAB_34 | save the returned year value |
| TXA | copy the returned year high byte |
| SBC#<$07BC | subtract 1980 high byte |
| BNELAB_F61A | if not $00 go do error exit |
| TYA | set the flags on the next returned character |
| BEQLAB_F618 | if null go do ok exit |
| CMP#'-' | else compare it with "-" |
| BNELAB_F61A | if not "-" go do error exit |
| LAB_F618: ; $F618 | |
| CLC | flag ok |
| RTS | |
| LAB_F61A: ; $F61A | |
| SEC | flag error |
| RTS | |
| ************************************************************************************ | |
| compare A bytes of the buffer with the table ?? | |
| LAB_F61C: ; $F61C | |
| CLC | flag match |
| LAB_F61D: ; $F61D | |
| PHA | save the byte count |
| LDA(LAB_0D),Y | get a table character |
| EORLAB_0406,X | compare it with a character from the Rx buffer |
| AND#$DF | mask xx0x xxxx, make it case insensetive |
| BEQLAB_F628 | . |
| SEC | flag no match |
| LAB_F628: ; $F628 | |
| INY | increment the table index |
| INX | increment the buffer index |
| PLA | restore the byte count |
| DECA | decrement the byte count |
| BNELAB_F61D | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| calculate the day from the date | |
| LAB_F62F: ; $F62F | |
| LDY#$00 | set the index to the year |
| LDA(LAB_10),Y | get the year |
| TAX | copy the year |
| STALAB_16 | . |
| LSRA | . |
| LSRA | . |
| BCSLAB_F63E | . |
| BBC0,LAB_16,LAB_F63E | . |
| SEC | . |
| LAB_F63E: ; $F63E | |
| ADCLAB_16 | . |
| INCA | . |
| INCA | . |
| STALAB_16 | . |
| LDM#$00,LAB_17 | . |
| LDY#$01 | set the index to the month |
| LDA(LAB_10),Y | get the month |
| TAY | copy the month |
| LAB_F64C: ; $F64C | |
| DEY | . |
| BEQLAB_F668 | . |
| CPY#$02 | compare the month with februaru |
| CLC | clear carry for no leap day |
| BNELAB_F65A | if not february go do the add |
| TXA | else copy the year |
| AND#$03 | effectively do year MOD 4 |
| BNELAB_F65A | if not a leap year skip the leap day set |
| SEC | else set a leap day |
| LAB_F65A: ; $F65A | |
| LDALAB_F854,Y | get the max + 1 days in the month |
| DECA | decrement it |
| ADCLAB_16 | . |
| STALAB_16 | . |
| BCCLAB_F64C | . |
| INCLAB_17 | . |
| BRALAB_F64C | . |
| LAB_F668: ; $F668 | |
| LDY#$02 | set the index to the day |
| LDA(LAB_10),Y | get the day |
| DECA | . |
| CLC | clear carry for add |
| ADCLAB_16 | . |
| STALAB_16 | . |
| BCCLAB_F676 | . |
| INCLAB_17 | . |
| LAB_F676: ; $F676 | |
| LDM#>$0007,LAB_14 | save the divisor low byte |
| LDM#<$0007,LAB_15 | save the divisor high byte |
| JSRLAB_F0A9 | divide LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| LDALAB_12 | get the remainder, day, low byte |
| RTS | |
| ************************************************************************************ | |
| output [CR][LF] and the current day/date/time | |
| LAB_F682: ; $F682 | |
| JSRLAB_F3F8 | put [CR][LF] in the Tx buffer |
| ************************************************************************************ | |
| output the current day/date/time | |
| LAB_F685: ; $F685 | |
| JSRLAB_F4F6 | copy the current date/time to the temporary date/time |
| LDX#>LAB_34 | set the date pointer low byte |
| LDY#<LAB_34 | set the date pointer high byte |
| BRALAB_F692 | output day/date/time and return |
| ************************************************************************************ | |
| output the signed off day/date/time | |
| LAB_F68E: ; $F68E | |
| LDX#>LAB_2D | set the signed off date/time pointer low byte |
| LDY#<LAB_2D | set the signed off date/time pointer high byte |
| output day/date/time | |
| LAB_F692: ; $F692 | |
| JSRLAB_F6A1 | output the day of the week |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| JSRLAB_F6DA | output the date as DD MMM YYY |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| JMPLAB_F742 | output the time as HH:MM:SS |
| ************************************************************************************ | |
| output the day of the week | |
| LAB_F6A1: ; $F6A1 | |
| STXLAB_10 | save the date pointer low byte |
| STYLAB_11 | save the date pointer high byte |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| JSRLAB_F62F | calculate the day from the date |
| TSX | get the stack pointer |
| PHA | save A |
| ASLA | * 2 |
| ADCLAB_0100,X | add the saved A, * 3 |
| TXS | dump the saved A |
| TAX | copy the day * 3 to the index |
| LDY#$03 | set the day character count |
| LAB_F6B6: ; $F6B6 | |
| LDALAB_F6C5,X | get a day string character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INX | increment the day string character index |
| DEY | decrement the day character count |
| BNELAB_F6B6 | loop if more characters to do |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| RTS | |
| ************************************************************************************ | |
| day strings | |
| LAB_F6C5: ; $F6C5 | |
| .BYTE'Sun' | monday |
| .BYTE'Mon' | tuesday |
| .BYTE'Tue' | wednesday |
| .BYTE'Wed' | thursday |
| .BYTE'Thu' | friday |
| .BYTE'Fri' | saturday |
| .BYTE'Sat' | sunday |
| ************************************************************************************ | |
| output the date as DD MMM YYY | |
| LAB_F6DA: ; $F6DA | |
| STXLAB_10 | save the date pointer low byte |
| STYLAB_11 | save the date pointer high byte |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| LDY#$02 | set the index to the date |
| LDA(LAB_10),Y | get the date |
| JSRLAB_F350 | output A as a two digit decimal value |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| LDY#$01 | set the index to the month |
| LDA(LAB_10),Y | get the month |
| TSX | copy the stack pointer |
| PHA | save A |
| ASLA | * 2 |
| ADCLAB_0100,X | * 3 |
| TXS | restore the stack pointer |
| TAX | copy to the index |
| LDY#$03 | set the character count |
| LAB_F6FA: ; $F6FA | |
| LDALAB_F71B,X | get a month string character |
| JSRLAB_F3FF | put an even parity byte in the Tx buffer |
| INX | increment the read index |
| DEY | decrement the character count |
| BNELAB_F6FA | loop if more to do |
| JSRLAB_F3F0 | put [SPACE] in the Tx buffer |
| LDY#$00 | set the index to the year |
| LDA(LAB_10),Y | get the year |
| LDX#<$07BC | set the year high byte |
| CLC | clear carry for add |
| ADC#>$07BC | add 1980 low byte |
| BCCLAB_F713 | if no carry skip the high byte increment |
| INX | else increment the year high byte |
| LAB_F713: ; $F713 | |
| JSRLAB_F36A | output AX as a three digit decimal value |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| RTS | |
| ************************************************************************************ | |
| month strings | |
| LAB_F71B: ; $F71B | |
| .BYTE'???' | unused |
| .BYTE'Jan' | january |
| .BYTE'Feb' | februaru |
| .BYTE'Mar' | march |
| .BYTE'Apr' | april |
| .BYTE'May' | may |
| .BYTE'Jun' | june |
| .BYTE'Jul' | july |
| .BYTE'Aug' | august |
| .BYTE'Sep' | september |
| .BYTE'Oct' | october |
| .BYTE'Nov' | november |
| .BYTE'Dec' | december |
| ************************************************************************************ | |
| output the time as HH:MM:SS | |
| LAB_F742: ; $F742 | |
| STXLAB_10 | save the date/time pointer low byte |
| STYLAB_11 | save the date/time pointer high byte |
| TYA | copy Y |
| PHA | save Y |
| LDY#$03 | set the index to hours |
| LDA(LAB_10),Y | get the hours |
| JSRLAB_F368 | output A as a three digit decimal value |
| JSRLAB_F3F4 | put ":" in the Tx buffer |
| LDY#$04 | set the index to minutes |
| LDA(LAB_10),Y | get the minutes |
| JSRLAB_F368 | output A as a three digit decimal value |
| JSRLAB_F3F4 | put ":" in the Tx buffer |
| LDY#$05 | set the index to seconds |
| LDA(LAB_10),Y | get the seconds |
| JSRLAB_F368 | output A as a three digit decimal value |
| PLA | pull Y |
| TAY | restore Y |
| RTS | |
| ************************************************************************************ | |
| INT2, 1/8th second interrupt | |
| Called every 125ms by Divider IC | |
| LAB_F766: ; $F766 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| CLB3,LAB_FF | clear INT2 request bit |
| TSTLAB_3F | test the 1/8th second countdown byte |
| BEQLAB_F773 | if already zero skip the decrement |
| DECLAB_3F | else decrement the 1/8th second countdown byte |
| LAB_F773: ; $F773 | |
| BBS0,LAB_FE,LAB_F7A8 | if the timer 1 interrupt is enabled (ie. already |
| checking for line activity) then skip the housekeeping | |
| ********************* HOUSE KEEPING ************************************************* | |
| JSRLAB_F06A | read the A2D channel 0 byte |
| STALAB_1F | save the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_20 | |
| BEQLAB_F78F | if = 0 go ?? |
| BCSLAB_F789 | if > 0 go ?? |
| else < 0 so ?? | |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| DECLAB_20 | . |
| BRALAB_F78B | . |
| LAB_F789: ; $F789 | |
| INCLAB_20 | . |
| LAB_F78B: ; $F78B | |
| CMP#$05 | . |
| BCSLAB_F7A1 | . |
| LAB_F78F: ; $F78F | |
| JSRLAB_F067 | read the A2D channel 1 byte |
| STALAB_21 | save the A2D channel 1 byte |
| JSRLAB_F990 | . |
| BNELAB_F79B | . |
| STYLAB_8D | . |
| LAB_F79B: ; $F79B | |
| EORLAB_8E | . |
| AND#$C0 | . |
| BEQLAB_F7A8 | . |
| LAB_F7A1: ; $F7A1 | |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| SEB0,LAB_FE | set the timer 1 interrupt enable bit |
| LDM#$10,LAB_92 | . |
| ********************* UPDATE THE CLOCK ************************************************* | |
| LAB_F7A8: ; $F7A8 | |
| TSTLAB_92 | . |
| BEQLAB_F7AE | . |
| DECLAB_92 | . |
| LAB_F7AE: ; $F7AE | |
| INCLAB_7F | increment the 1/8th seconds count |
| BBC3,LAB_7F,LAB_F7C8 | if not at a whole second skip the time increment |
| LDM#$00,LAB_7F | else reset the 1/8th seconds count |
| TSTLAB_93 | test the seconds countdown |
| BEQLAB_F7BC | if already at zero skip the decrement |
| DECLAB_93 | else decrement the seconds countdown |
| LAB_F7BC: ; $F7BC | |
| JSRLAB_F7F4 | increment the ?? time |
| JSRLAB_F061 | read the A2D channel 3 byte (Battery) |
| STALAB_25 | save the A2D channel 3 byte (Battery) |
| CLI | enable the interrupts |
| JSRLAB_F7CE | . |
| LAB_F7C8: ; $F7C8 | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| ?? | |
| LAB_F7CE: ; $F7CE | |
| LDX#$00 | clear the index |
| LAB_F7D0: ; $F7D0 | |
| LDALAB_12,X | read a math area byte |
| PHA | save it |
| INX | increment the index |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_F7D0 | loop if more to do |
| LDALAB_94 | get the integer part of VThreshold * 2.277 |
| STALAB_16 | save the multiplier low byte |
| LDM#$00,LAB_17 | clear the multiplier low byte |
| LDALAB_25 | read the A2D channel 3 byte (Battery) |
| STALAB_14 | save the multiplicand low byte |
| LDM#$00,LAB_15 | claer the multiplicand high byte |
| JSRLAB_F07E | mult LAB_16/17 by LAB_14/15, result in LAB_16/17 and AX |
| STXLAB_95 | . |
| LDX#$06 | set the count/index |
| LAB_F7ED: ; $F7ED | |
| PLA | pull a math area byte |
| DEX | decrement the count/index |
| STALAB_12,X | restore a math area byte |
| BNELAB_F7ED | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| increment the ?? time | |
| LAB_F7F4: ; $F7F4 | |
| LDXLAB_7A | get the ?? time month |
| CPX#$02 | compare it with february |
| BNELAB_F801 | if not february skip the leap year adjust |
| LDALAB_79 | get the ?? time year |
| AND#$03 | effectively do year MOD 4 |
| BNELAB_F801 | if not a leap year skip the leap year adjust |
| TAX | else clear the index for a leap year february |
| LAB_F801: ; $F801 | |
| LDALAB_F854,X | get the max + 1 days in the month |
| STALAB_28 | save the max + 1 days in the month |
| LDX#$06 | set the index to seconds + 1 |
| LAB_F808: ; $F808 | |
| DEX | decrement the index |
| LDALAB_79,X | get a current date/time byte |
| INCA | + 1 |
| CMPLAB_26,X | compare it with the max + 1 for date and time |
| BCCLAB_F813 | if less skip the default byte get |
| LDALAB_F84D,X | else get a default date and time byte |
| LAB_F813: ; $F813 | |
| STALAB_79,X | save a current date/time byte |
| BCCLAB_F81A | if byte is < max + 1 exit the loop |
| TXA | else copy the index |
| BNELAB_F808 | if not at years go do another date/time byte |
| LAB_F81A: ; $F81A | |
| CPX#$03 | compare the index with hours |
| BNELAB_F845 | if it wasn't hours that was updated just exit |
| DECA | decrement the hours |
| BEQLAB_F835 | if the hours were $01 go compare the BST date with the |
| current date | |
| DECA | decrement the hours |
| BNELAB_F845 | if the hours were not $02 just exit |
| else compare the GMT date with the current date | |
| LDX#$02 | set the byte count/index |
| LAB_F826: ; $F826 | |
| LDALAB_80,X | get a GMT date byte |
| EORLAB_79,X | compare it with a current date byte |
| BNELAB_F835 | if not the same go compare the BST date |
| this branch should go to LAB_F845 | |
| DEX | decrement the byte count/index |
| BPLLAB_F826 | loop if more to do |
| DECLAB_7C | decrement the current hour |
| LDM#$00,LAB_82 | clear the GMT days |
| RTS | |
| LAB_F835: ; $F835 | |
| LDX#$02 | set the byte count/index |
| LAB_F837: ; $F837 | |
| LDALAB_83,X | get a BST date byte |
| EORLAB_79,X | compare it with a current date byte |
| BNELAB_F845 | if not the same just exit |
| DEX | decrement the byte count/index |
| BPLLAB_F837 | loop if more to do |
| INCLAB_7C | increment the current hour |
| LDM#$00,LAB_85 | clear the BST days |
| LAB_F845: ; $F845 | |
| RTS | |
| ************************************************************************************ | |
| max + 1 for date and time | |
| LAB_F846: ; $F846 | |
| .BYTE2099-1980+1 | max year + 1 |
| .BYTE12+1 | max month + 1 |
| .BYTE0 | max date is handled separately |
| .BYTE23+1 | max hour + 1 |
| .BYTE59+1 | max minute + 1 |
| .BYTE59+1 | max second + 1 |
| .BYTE7+1 | max part second + 1 |
| the interrupt is every 1/8ths of a second | |
| ************************************************************************************ | |
| default date and time | |
| LAB_F84D: ; $F84D | |
| .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_F854: ; $F854 | |
| .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, check for [CTRL][Q], [CTRL][S] or break | |
| LAB_F861: ; $F861 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| BBC1,LAB_FF,LAB_F869 | if no INT1 request skip the INT1 enable clear |
| CLB0,LAB_FF | clear the INT1 enable bit |
| LAB_F869: ; $F869 | |
| BBC0,LAB_E7,LAB_F892 | test b0 UART status register |
| if no Rx interrupt just exit | |
| BBS2,LAB_E7,LAB_F890 | test b2 UART status register |
| if parity error just the clear error bits and exit | |
| LDALAB_E5 | read the UART Rx buffer register |
| LDXLAB_03 | get the ?? buffer write index |
| STALAB_0300,X | save a character to the ?? buffer |
| INCLAB_03 | increment the ?? buffer write index |
| CLB7,A | mask 0xxx xxxx, 7 bit ASCII |
| CMP#$11 | compare the character with [CTRL][Q] |
| BEQLAB_F887 | if [CTRL][Q] go clear the pause bit |
| CMP#$13 | compare the character with [CTRL][S] |
| BEQLAB_F88B | if [CTRL][S] go set the pause bit |
| CMPLAB_0B | compare the character with the break value |
| BNELAB_F890 | if not break go clear eny error bits and exit |
| SEB7,LAB_0A | else set the break bit |
| LAB_F887: ; $F887 | |
| CLB6,LAB_0A | clear the pause bit |
| BRALAB_F890 | go clear eny error bits and exit |
| LAB_F88B: ; $F88B | |
| BBC5,LAB_0A,LAB_F890 | . |
| SEB6,LAB_0A | set the pause bit |
| LAB_F890: ; $F890 | |
| STALAB_E5 | write to the UART Rx buffer register |
| clear the error bits | |
| LAB_F892: ; $F892 | |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| TIMER 1, 2 or 3 | |
| LAB_F896: ; $F896 | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| BBC0,LAB_FE,LAB_F8DF | if timer 1 interrupts not enabled go handle timer 2 |
| BBC1,LAB_FE,LAB_F8DF | if timer 1 interrupt request clear go handle timer 2 |
| ************************ handle timer 1 ****************************************** | |
| Check for line activity | |
| CLB1,LAB_FE | clear the timer 1 interrupt request bit |
| JSRLAB_F06A | read the A2D channel 0 byte (Monitored line) |
| STALAB_1F | save the A2D channel 0 byte (Monitored line) |
| SEC | set carry for subtract |
| SBCLAB_20 | Subtract from A, the contents of LAB_20. Result stored in A |
| BCSLAB_F8B0 | if >= 0, branch to LAB_F8B0 (If A=0 then line condition not changed presumably) |
| EOR#$FF | Else, toggle the byte |
| INCA | make 2's complement |
| LAB_F8B0: ; $F8B0 | |
| STALAB_1E | save the absolute line voltage ?? |
| JSRLAB_F067 | read the A2D channel 1 byte (Monitored line) |
| STALAB_21 | save the A2D channel 1 byte (Monitored line) |
| BBC2,LAB_B9,LAB_F8BD | If Bit 2 of LAB_B9 is 0, branch to.... |
| JSRLAB_FAAF | Else |
| LAB_F8BD: ; $F8BD | |
| BBC3,LAB_B9,LAB_F8C3 | If Bit 3 of LAB_B9 is 0, branch to.... |
| JSRLAB_FA9F | Else, read the MT8870 tone decoder and save any new digit to |
| the dialed number buffer | |
| LAB_F8C3: ; $F8C3 | |
| BBC4,LAB_B9,LAB_F8C9 | If Bit 4 of LAB_B9 is 0, branch to.... |
| JSRLAB_FA46 | Else.... |
| LAB_F8C9: ; $F8C9 | |
| BBC7,LAB_B9,LAB_F8CF | If Bit 7 of LAB_B9 is 0, branch to.... |
| JSRLAB_F930 | Else.... |
| LAB_F8CF: ; $F8CF | |
| BBC5,LAB_B9,LAB_F8D5 | If Bit 5 of LAB_B9 is 0, branch to.... |
| JSRLAB_F9D9 | Else.... |
| LAB_F8D5: ; $F8D5 | |
| BBC6,LAB_B9,LAB_F8DB | If Bit 6 of LAB_B9 is 0, branch to.... |
| JSRLAB_F955 | Else.... |
| LAB_F8DB: ; $F8DB | |
| LDALAB_1F | get the A2D channel 0 byte (Monitored line) |
| STALAB_20 | Save the result to LAB_20 |
| ************************ handle timer 2 ****************************************** | |
| Keyboard scanning | |
| LAB_F8DF: ; $F8DF | |
| BBC2,LAB_FE,LAB_F92A | if timer 2 interrupts not enabled just exit |
| BBC3,LAB_FE,LAB_F92A | if timer 2 interrupt request not set go just exit |
| timer 2 timed out | |
| CLB3,LAB_FE | clear the timer 2 interrupt request bit |
| BBC4,LAB_E6,LAB_F907 | test b4 UART control register, Rx interrupt enable |
| if Rx interrupt disabled skip the UART handle | |
| BBS6,LAB_0A,LAB_F92A | if the pause bit is set just exit |
| LDXLAB_06 | get the Tx buffer read index |
| CPXLAB_05 | compare it with the Tx buffer write index |
| BEQLAB_F903 | if no bytes waiting go clear the timer 2 interrupt |
| enable and exit | |
| LDALAB_0400,X | read a Tx buffer byte |
| STALAB_E4 | save it to the UART Tx shift register |
| INX | increment the TX buffer read index |
| CPX#$06 | compare it with max + 1 |
| BCCLAB_F8FF | if less than max + 1 just use it |
| LDX#$00 | else wrap it to zero |
| LAB_F8FF: ; $F8FF | |
| STXLAB_06 | save the Tx buffer read index |
| BRALAB_F92A | and exit |
| LAB_F903: ; $F903 | |
| CLB2,LAB_FE | clear the timer 2 interrupt enable bit |
| BRALAB_F92A | and exit |
| dial a digit. the digit is in LAB_42 and when the digit is first set the pulse count | |
| in LAB_43 is zero. In this case the line is opened and a short pulse time is saved to | |
| the pulse count. | |
| if the pulse count is not zero it is decremented and a check is made to see if it has | |
| reached four. if it has the line is closed. if the pulse count reaches zero the digit | |
| to dial is decremented. | |
| the digit to dial is checked and if that is not now zero another short pulse is set | |
| and the cycle continues, otherwise a final long pulse is set. | |
| LAB_F907: ; $F907 | |
| LDALAB_43 | get the pulse count |
| BEQLAB_F911 | if zero go check if there is a digit to dial |
| DECLAB_43 | else decrement the pulse count |
| BNELAB_F922 | if not zero go check for pulse count |
| DECLAB_42 | decrement the digit to dial |
| LAB_F911: ; $F911 | |
| LDALAB_42 | get the digit to dial |
| BMILAB_F92A | if done just exit |
| BEQLAB_F91C | 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_F91C: ; $F91C | |
| LDA#$28 | set long pulse count |
| STALAB_43 | save the pulse count |
| BRALAB_F92A | and exit |
| LAB_F922: ; $F922 | |
| LDALAB_43 | get the pulse count |
| CMP#$04 | compare it with $04 |
| BNELAB_F92A | if not $04 skip the line seize |
| SEB3,LAB_F0 | set b3 port 2 data register, modem select, line seize |
| LAB_F92A: ; $F92A | |
| PLA | pull Y |
| TAY | restore Y |
| PLA | pull X |
| TAX | restore X |
| PLA | restore A |
| RTI | |
| ************************************************************************************ | |
| Called from Timer 1 routine | |
| LAB_F930: ; $F930 | |
| LDALAB_1E | Load the absolute line voltage |
| LSRA | . |
| LSRA | . |
| LSRA | . |
| CLC | clear carry for add |
| ADCLAB_87 | . |
| BCSLAB_F93C | . |
| BVCLAB_F943 | . |
| LAB_F93C: ; $F93C | |
| LDM#$18,LAB_92 | . |
| SEB3,LAB_8E | . |
| LDA#$FF | . |
| LAB_F943: ; $F943 | |
| SEC | set carry for subtract |
| SBC#$01 | . |
| BCCLAB_F94E | . |
| BVCLAB_F94C | . |
| LDA#$00 | . |
| LAB_F94C: ; $F94C | |
| STALAB_87 | . |
| LAB_F94E: ; $F94E | |
| TSTLAB_92 | . |
| BNELAB_F954 | . |
| CLB3,LAB_8E | . |
| LAB_F954: ; $F954 | |
| RTS | |
| ************************************************************************************ | |
| Called from Timer 1 handling routine (LAB_F8D5) | |
| If Bit 6 of LAB_B9 is 1 then do the following.... | |
| LAB_F955: ; $F955 | |
| LDX#$00 | clear high byte ?? |
| LDALAB_1F | get the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_F962 | if ch0 >= ch3 skip the 2's complement |
| DEX | toggle high byte |
| EOR#$FF | toggle low byte |
| INCA | make 2's complement |
| LAB_F962: ; $F962 | |
| CMP#$02 | compare A with $02 |
| BCCLAB_F98F | If A < $02, then just exit |
| TSTLAB_8D | else, test to see if LAB_8D is zero or not |
| BEQLAB_F98F | If it is, then |
| TXA | Else.... |
| EORLAB_8D | . |
| EORLAB_8E | . |
| BBC4,A,LAB_F988 | . |
| LDALAB_8B | . |
| INCA | . |
| CMP#$1E | . |
| BCCLAB_F98D | . |
| LDALAB_8E | . |
| EOR#$10 | . |
| STALAB_8E | . |
| BBC1,A,LAB_F984 | . |
| BBS4,A,LAB_F984 | . |
| SEB2,LAB_8E | . |
| LAB_F984: ; $F984 | |
| LDA#$00 | . |
| BRALAB_F98D | . |
| LAB_F988: ; $F988 | |
| LDALAB_8B | . |
| BEQLAB_F98F | exit |
| DECA | . |
| LAB_F98D: ; $F98D | |
| STALAB_8B | . |
| LAB_F98F: ; $F98F | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_F990: ; $F990 | |
| LDALAB_1F | get the A2D channel 0 byte |
| LDY#$0F | . |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_F99D | if ch0 >= ch3 skip the 2's complement |
| INY | . |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| LAB_F99D: ; $F99D | |
| BBC0,LAB_72,LAB_F9B2 | . |
| LSRA | do (ch0-ch3)/2 |
| TSX | copy the stack pointer |
| PHA | push (ch0-ch3)/2 |
| LDALAB_21 | get the A2D channel 1 byte |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_F9AD | if ch1 >= ch3 skip the 2's complement |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| LAB_F9AD: ; $F9AD | |
| CLC | clear carry for add |
| ADCLAB_0100,X | do (ch1-ch3) + (ch0-ch3)/2 |
| TXS | restore the stack pointer |
| LAB_F9B2: ; $F9B2 | |
| CMPLAB_95 | . |
| BCSLAB_F9D6 | . |
| BBS0,LAB_73,LAB_F9C1 | . |
| BBC1,LAB_73,LAB_F9D0 | . |
| BBC2,LAB_8E,LAB_F9D0 | . |
| BRALAB_F9D3 | . |
| LAB_F9C1: ; $F9C1 | |
| LDALAB_21 | get the A2D channel 1 byte |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_F9CB | if ch1 >= ch3 skip the 2's complement |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| LAB_F9CB: ; $F9CB | |
| ASLA | do (ch1-ch3)*2 |
| CMPLAB_95 | . |
| BCCLAB_F9D3 | . |
| LAB_F9D0: ; $F9D0 | |
| LDA#$80 | . |
| RTS | |
| LAB_F9D3: ; $F9D3 | |
| LDA#$40 | . |
| RTS | |
| LAB_F9D6: ; $F9D6 | |
| LDA#$00 | . |
| RTS | |
| ************************************************************************************ | |
| Called from LAB_F8CF, part of Timer 1 handling routine. | |
| If Bit 5 of LAB_B9 is 1 then do the following... | |
| LAB_F9D9: ; $F9D9 | |
| JSRLAB_F990 | Loads A with either $00, $40 or $80 |
| TAX | Transfer the returned value into X |
| BBC0,LAB_8E,LAB_F9E4 | . |
| EORLAB_8F | . |
| BRALAB_F9E6 | . |
| LAB_F9E4: ; $F9E4 | |
| EORLAB_8E | . |
| LAB_F9E6: ; $F9E6 | |
| AND#$C0 | . |
| BEQLAB_FA2D | . |
| TXA | Transfer the value in X stored earlier back to A |
| BEQLAB_FA00 | If value is $00 then... |
| BPLLAB_FA1C | Else... |
| INCLAB_88 | . |
| LDALAB_88 | . |
| CMP#$18 | . |
| BCCLAB_FA35 | . |
| BBS0,LAB_8E,LAB_FA16 | . |
| SEB7,LAB_8E | . |
| CLB6,LAB_8E | . |
| BRALAB_FA2D | . |
| LAB_FA00: ; $FA00 | |
| INCLAB_89 | . |
| LDALAB_89 | . |
| CMP#$18 | . |
| BCCLAB_FA35 | . |
| CLB1,LAB_8E | . |
| CLB2,LAB_8E | . |
| BBC0,LAB_8E,LAB_FA18 | . |
| CLB7,LAB_8F | . |
| LDM#$3C,LAB_90 | . |
| BRALAB_FA2D | . |
| LAB_FA16: ; $FA16 | |
| SEB7,LAB_8F | . |
| LAB_FA18: ; $FA18 | |
| CLB6,LAB_8E | . |
| BRALAB_FA28 | . |
| LAB_FA1C: ; $FA1C | |
| INCLAB_8A | . |
| LDALAB_8A | . |
| CMP#$C8 | . |
| BCCLAB_FA35 | . |
| CLB0,LAB_8E | . |
| SEB6,LAB_8E | . |
| LAB_FA28: ; $FA28 | |
| CLB7,LAB_8E | . |
| LDM#$00,LAB_90 | . |
| LAB_FA2D: ; $FA2D | |
| LDA#$00 | clear A |
| STALAB_88 | . |
| STALAB_89 | . |
| STALAB_8A | . |
| LAB_FA35: ; $FA35 | |
| TSTLAB_90 | . |
| BEQLAB_FA45 | . |
| DECLAB_90 | . |
| BNELAB_FA45 | . |
| ************************************************************************************ | |
| ?? | |
| LAB_FA3D: ; $FA3D | |
| LDALAB_8E | . |
| AND#$7E | . |
| ORALAB_8F | . |
| STALAB_8E | . |
| LAB_FA45: ; $FA45 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FA46: ; $FA46 | |
| LDALAB_1F | get the A2D channel 0 byte |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BCSLAB_FA50 | . |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| LAB_FA50: ; $FA50 | |
| CMPLAB_95 | . |
| LDALAB_96 | . |
| BCSLAB_FA8E | . |
| BEQLAB_FA5C | . |
| DECA | . |
| STALAB_96 | . |
| RTS | |
| LAB_FA5C: ; $FA5C | |
| BBC7,LAB_98,LAB_FA6B | . |
| CLB7,LAB_98 | . |
| TSTLAB_97 | . |
| BEQLAB_FA67 | . |
| INCLAB_99 | . |
| LAB_FA67: ; $FA67 | |
| LDM#$14,LAB_97 | . |
| RTS | |
| LAB_FA6B: ; $FA6B | |
| TSTLAB_97 | . |
| BEQLAB_FA8D | . |
| DECLAB_97 | . |
| BNELAB_FA8D | . |
| LDALAB_99 | . |
| LDM#$00,LAB_99 | . |
| CMP#$0B | . |
| BCCLAB_FA7E | . |
| LDA#$0B | . |
| save the digit to the dialed number buffer | |
| LAB_FA7E: ; $FA7E | |
| LDXLAB_91 | get the dialed number buffer index |
| CPX#$1F | compare it with the max + 1 |
| BCSLAB_FA8D | if > max go return the error |
| STALAB_0559,X | save the dialed number digit |
| INCLAB_91 | increment the dialed number buffer index |
| LDALAB_70 | get the TDial value |
| STALAB_93 | save the seconds countdown |
| LAB_FA8D: ; $FA8D | |
| RTS | |
| LAB_FA8E: ; $FA8E | |
| INCA | . |
| CMPLAB_6F | compare it with the TPulse value |
| BCSLAB_FA96 | . |
| STALAB_96 | . |
| RTS | |
| LAB_FA96: ; $FA96 | |
| BBS7,LAB_98,LAB_FA9E | . |
| SEB7,LAB_98 | . |
| LDM#$14,LAB_97 | . |
| LAB_FA9E: ; $FA9E | |
| RTS | |
| ************************************************************************************ | |
| read the MT8870 tone decoder and save any new digit to the dialed number buffer | |
| LAB_FA9F: ; $FA9F | |
| LDALAB_F3 | read the port 1 data register |
| TAX | copy it |
| EORLAB_8C | compare it with the port 1 last read value |
| BBC4,A,LAB_FA9E | if b4 hasn't changed just exit |
| TXA | get the port 1 value back |
| STALAB_8C | save it as the port 1 last read value |
| BBC4,A,LAB_FA9E | if b4 isn't set just exit |
| AND#$1F | else mask the read value |
| BRALAB_FA7E | and save the digit to the dialed number buffer |
| ************************************************************************************ | |
| Called from Timer 1 Interrupt routine | |
| LAB_FAAF: ; $FAAF | |
| LDALAB_6C | get the pulses value (0=REV, 1=SPM16, 2=SPM, 3=XSPM, 4=M+, 5=M-) |
| LSRA | 0 = REV = 0000 0000 -> 0000 0000 = 0 |
| 1= SPM16 = 0000 0001 -> 0000 0000 = 0 | |
| 2= SPM = 0000 0010 -> 0000 0001 = 1 | |
| 3= XSPM = 0000 0011 -> 0000 0001 = 1 | |
| 4= M+ = 0000 0100 -> 0000 0010 = 2 | |
| 5= M- = 0000 0101 -> 0000 0010 = 2 | |
| BEQLAB_FA9E | If REV or SPM16 then exit (RTS) |
| BBS1,A,LAB_FAF1 | If M+ or M- then branch to LAB_FAF1 |
| BCCLAB_FABE | If SPM, then branch to LAB_FABE |
| JSRLAB_F064 | Else it's XSPM. Read the A2D channel 2 byte (Meter wire) |
| TAX | copy the A2D channel 2 byte (Meter wire) |
| BRALAB_FAD0 | |
| ******************* SPM ************************ | |
| LAB_FABE: ; $FABE | |
| LDALAB_21 | get the A2D channel 1 byte |
| TAX | Transfer A2D channel 1 byte into X |
| SEC | set carry for subtract |
| SBCLAB_22 | |
| STXLAB_22 | |
| BCSLAB_FACC | |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| SEC | set carry for subtract |
| LAB_FACC: ; $FACC | |
| SBCLAB_1E | Subtract the absolute line voltage |
| BCCLAB_FB27 | . |
| ******************* XSPM *********************** | |
| LAB_FAD0: ; $FAD0 | |
| CPXLAB_24 | . |
| BEQLAB_FB27 | . |
| BCCLAB_FADA | . |
| STXLAB_24 | . |
| BRALAB_FAE0 | . |
| LAB_FADA: ; $FADA | |
| CPXLAB_23 | compare with the A2D channel 2 byte (Meter wire) |
| BCSLAB_FB27 | . |
| STXLAB_23 | save the A2D channel 2 byte (Meter wire) |
| LAB_FAE0: ; $FAE0 | |
| LDALAB_24 | . |
| SEC | set carry for subtract |
| SBCLAB_23 | subtract the A2D channel 2 byte (Meter wire) |
| CMP#$32 | . |
| BCCLAB_FB27 | . |
| STXLAB_24 | . |
| STXLAB_23 | save the A2D channel 2 byte (Meter wire) |
| LDA#$14 | . |
| BRALAB_FB08 | . |
| ******************* M+ or M- ******************** | |
| LAB_FAF1: ; $FAF1 | |
| JSRLAB_F064 | read the A2D channel 2 byte (Meter wire) |
| SEC | set carry for subtract |
| SBCLAB_25 | subtract the A2D channel 3 byte (Battery) |
| BBS0,LAB_6C,LAB_FB00 | . |
| BCSLAB_FB27 | . |
| EOR#$FF | toggle the byte |
| INCA | make 2's complement |
| SEC | . |
| LAB_FB00: ; $FB00 | |
| BCCLAB_FB27 | . |
| CMP#$12 | . |
| BCCLAB_FB27 | . |
| LDA#$08 | . |
| LAB_FB08: ; $FB08 | |
| CLC | clear carry for add |
| ADCLAB_86 | . |
| BCSLAB_FB23 | . |
| BVCLAB_FB32 | . |
| SEB5,LAB_8E | . |
| LDXLAB_0520 | get the record metered units low byte |
| INX | increment the record metered units low byte |
| BNELAB_FB20 | if no rollover skip the high byte increment |
| LDALAB_0521 | get the record metered units high byte |
| INCA | increment the record metered units high byte |
| BBS5,A,LAB_FB23 | if xx1x xxxx xxxx xxxx skip the metered units save |
| STALAB_0521 | save the record metered units high byte |
| LAB_FB20: ; $FB20 | |
| STXLAB_0520 | save the record metered units low byte |
| LAB_FB23: ; $FB23 | |
| LDA#$FF | . |
| BRALAB_FB32 | . |
| LAB_FB27: ; $FB27 | |
| LDALAB_86 | . |
| SEC | set carry for subtract |
| SBC#$04 | . |
| BCCLAB_FB34 | . |
| BVCLAB_FB32 | . |
| LDA#$00 | . |
| LAB_FB32: ; $FB32 | |
| STALAB_86 | . |
| LAB_FB34: ; $FB34 | |
| RTS | |
| ************************************************************************************ | |
| TC, CNTR, BRK, HE or VE | |
| LAB_FB35: ; $FB35 | |
| RTI | |
| ************************************************************************************ | |
| copy the current record pointer to the update point | |
| LAB_FB36: ; $FB36 | |
| LDYLAB_4D | get the current record pointer low byte |
| LDXLAB_4E | get the current record pointer mid byte |
| LDALAB_4F | get the current record pointer high byte |
| ************************************************************************************ | |
| save YXA as the update point | |
| LAB_FB3C: ; $FB3C | |
| STYLAB_4A | save the update pointer low byte |
| STXLAB_4B | save the update pointer mid byte |
| STALAB_4C | save the update pointer high byte |
| RTS | |
| ************************************************************************************ | |
| initialise the record pointers and logged values | |
| LAB_FB43: ; $FB43 | |
| LDY#$00 | clear the pointer low byte |
| LDXLAB_F1C5 | get the ?? start address mid byte $01 |
| LDALAB_F1C5+1 | get the ?? start address high byte $86 |
| STYLAB_B3 | save the record memory start pointer low byte |
| STXLAB_B4 | save the record memory start pointer mid byte |
| STALAB_B5 | save the record memory start pointer high byte |
| STYLAB_B6 | save the record memory end pointer low byte |
| STXLAB_B7 | save the record memory end pointer mid byte |
| STALAB_B8 | save the record memory end pointer high byte |
| STYLAB_4D | save the current record pointer low byte |
| STXLAB_4E | save the current record pointer mid byte |
| STALAB_4F | save the current record pointer high byte |
| JSRLAB_FB3C | save YXA as the update point |
| LDA#$00 | clear A |
| STALAB_74 | clear the calls logged low byte |
| STALAB_75 | clear the calls logged high byte |
| STALAB_76 | clear the meter value low byte |
| STALAB_77 | clear the meter value mid byte |
| STALAB_78 | clear the meter value high byte |
| RTS | |
| ************************************************************************************ | |
| set the default values | |
| LAB_FB6D: ; $FB6D | |
| LDX#$08 | set the count/index |
| LAB_FB6F: ; $FB6F | |
| LDALAB_E005,X | get a default byte |
| STALAB_6B,X | save a default value |
| DEX | decrement the count/index |
| BPLLAB_FB6F | loop if more to do |
| RTS | |
| ************************************************************************************ | |
| Called/Referenced by RESET routine ?? | |
| LAB_FB78: ; $FB78 | |
| JSRLAB_FB43 | initialise the record pointers and logged values |
| JSRLAB_FB6D | set the default values |
| JSRLAB_F024 | save the integer part of VThreshold * 2.277 in LAB_94 |
| LDA#$00 | clear A |
| STALAB_90 | . |
| STALAB_88 | . |
| STALAB_8E | . |
| STALAB_8D | . |
| STALAB_5A | . |
| JSRLAB_FF19 | set timer 1 to 5ms |
| LAB_FB90: ; $FB90 | |
| JSRLAB_FDD4 | turn MT8870 off and ?? |
| LDALAB_8E | . |
| AND#$C6 | . |
| STALAB_8E | . |
| LDA#$00 | clear A |
| STALAB_B9 | clear LAB_B9 |
| STALAB_91 | clear the dialed number buffer index |
| STALAB_8B | . |
| JSRLAB_FDBA | . |
| BBC0,LAB_71,LAB_FBAA | . |
| JSRLAB_FDC3 | . |
| LAB_FBAA: ; $FBAA | |
| SEB5,LAB_B9 | . |
| LDM#$10,LAB_92 | . |
| LAB_FBAF: ; $FBAF | |
| LDALAB_92 | . |
| ORALAB_88 | . |
| ORALAB_8B | . |
| ORALAB_87 | . |
| BNELAB_FBBB | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| LAB_FBBB: ; $FBBB | |
| JSRLAB_FFDC | swap the stack pointers |
| BBS7,LAB_8E,LAB_FBDB | . |
| BBS6,LAB_8E,LAB_FC40 | . |
| BBS4,LAB_8E,LAB_FBDE | . |
| BBC3,LAB_8E,LAB_FBAF | . |
| JSRLAB_FD97 | . |
| LAB_FBCD: ; $FBCD | |
| JSRLAB_FFDC | swap the stack pointers |
| BBS4,LAB_8E,LAB_FBE4 | . |
| BBS7,LAB_8E,LAB_FBF1 | Incoming Call answered ? |
| BBC3,LAB_8E,LAB_FC20 | . |
| BRALAB_FBCD | . |
| LAB_FBDB: ; $FBDB | |
| JMPLAB_FC68 | . |
| LAB_FBDE: ; $FBDE | |
| LDM#$18,LAB_92 | . |
| JSRLAB_FD97 | . |
| LAB_FBE4: ; $FBE4 | |
| JSRLAB_FFDC | swap the stack pointers |
| TSTLAB_92 | . |
| BEQLAB_FC37 | . |
| BBS4,LAB_8E,LAB_FBE4 | . |
| BBC7,LAB_8E,LAB_FC20 | . |
| LAB_FBF1: ; $FBF1 | |
| JSRLAB_FDC0 | . |
| JSRLAB_FDC9 | . |
| LDA#$21 | set the call type to "i/c_ans" ?? |
| STALAB_0517 | save the record call type |
| JSRLAB_FE28 | set the record ans/last time |
| LDALAB_0516 | get the record length |
| AND#$E0 | mask xxx0 0000, clear the length |
| ORA#$0A | set the length to $0A |
| STALAB_0516 | save the record length |
| LDM#$08,LAB_92 | . |
| JSRLAB_FD9F | . |
| LAB_FC0F: ; $FC0F | |
| JSRLAB_FFDC | swap the stack pointers |
| BBC0,LAB_FE,LAB_FC0F | if timer 1 interrupts not enabled go ?? |
| BBC7,LAB_8E,LAB_FC20 | . |
| TSTLAB_92 | . |
| BNELAB_FC0F | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_FC0F | . |
| LAB_FC20: ; $FC20 | |
| JSRLAB_FE95 | set the record cleared time |
| LDALAB_0517 | get the record call type |
| CMP#$21 | compare the call type with "i/c_ans" |
| BNELAB_FC2F | . |
| JSRLAB_F46B | copy the current time to the line seized time |
| BRALAB_FC32 | . |
| LAB_FC2F: ; $FC2F | |
| JSRLAB_F462 | clear the line seized time ?? |
| LAB_FC32: ; $FC32 | |
| JSRLAB_FF24 | copy the buffered record to memory ?? |
| BRALAB_FC3A | . |
| LAB_FC37: ; $FC37 | |
| LDM#$00,LAB_8D | . |
| LAB_FC3A: ; $FC3A | |
| JSRLAB_FDA2 | . |
| JMPLAB_FB90 | . |
| LAB_FC40: ; $FC40 | |
| JSRLAB_FDC9 | . |
| JSRLAB_FDC0 | . |
| LDA#$12 | set the call type to "parked" ?? |
| JSRLAB_FDF6 | initialise a new record in the write buffer |
| JSRLAB_FDA8 | . |
| LAB_FC4E: ; $FC4E | |
| JSRLAB_FFDC | swap the stack pointers |
| BBC6,LAB_8E,LAB_FC5C | . |
| TSTLAB_92 | . |
| BNELAB_FC4E | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_FC4E | . |
| LAB_FC5C: ; $FC5C | |
| JSRLAB_FE95 | set the record cleared time |
| JSRLAB_FDA2 | . |
| JSRLAB_FF24 | copy the buffered record to memory ?? |
| JMPLAB_FB90 | . |
| ************************************************************************************ | |
| Called from LAB_FBDB | |
| LAB_FC68: ; $FC68 | |
| JSRLAB_FDC9 | . |
| JSRLAB_FDC0 | . |
| LDA#$10 | set the call type to "seized" ?? |
| JSRLAB_FDF6 | initialise a new record in the write buffer |
| JSRLAB_FDA5 | . |
| LDALAB_70 | get the TDial value |
| STALAB_93 | save the seconds countdown |
| LDALAB_6B | get the digits value |
| BNELAB_FC80 | if not auto go ?? |
| ORA#$03 | else make it mixed |
| LAB_FC80: ; $FC80 | |
| BBC1,A,LAB_FC85 | if DTMF not enabled skip turning the MT8870 on |
| JSRLAB_FDCC | turn MT8870 on and ?? |
| LAB_FC85: ; $FC85 | |
| BBC0,A,LAB_FC8A | if pulse not enabled skip ?? |
| JSRLAB_FDD9 | . |
| LAB_FC8A: ; $FC8A | |
| LDY#$00 | clear ?? |
| LAB_FC8C: ; $FC8C | |
| JSRLAB_FFDC | swap the stack pointers |
| TSTLAB_93 | test the seconds countdown |
| BEQLAB_FCBE | . |
| BBS4,LAB_8E,LAB_FCE4 | . |
| BBS5,LAB_8E,LAB_FCE4 | . |
| BBC7,LAB_8E,LAB_FCFB | . |
| CPYLAB_91 | compare ?? with the dialed number buffer index |
| BEQLAB_FC8C | . |
| TYA | . |
| BNELAB_FCA6 | . |
| JSRLAB_FD5B | . |
| LAB_FCA6: ; $FCA6 | |
| JSRLAB_FE28 | set the record ans/last time |
| JSRLAB_FD92 | . |
| INY | . |
| CPY#$03 | . |
| BNELAB_FC8C | . |
| LDALAB_0559 | get the dialed number first digit |
| CLB4,A | . |
| EOR#$01 | . |
| BNELAB_FC8C | . |
| JSRLAB_FDD4 | turn MT8870 off and ?? |
| BRALAB_FC8C | . |
| LAB_FCBE: ; $FCBE | |
| JSRLAB_FDEF | turn off the MT8870 tone decoder |
| LDALAB_91 | get the dialed number buffer index |
| CMP#$02 | . |
| BCSLAB_FCD8 | . |
| JSRLAB_FDC9 | . |
| LAB_FCCA: ; $FCCA | |
| JSRLAB_FFDC | swap the stack pointers |
| BBC7,LAB_8E,LAB_FCFB | Sub has cleared down ? |
| TSTLAB_92 | . |
| BNELAB_FCCA | . |
| CLB0,LAB_FE | clear the timer 1 interrupt enable bit |
| BRALAB_FCCA | . |
| LAB_FCD8: ; $FCD8 | |
| JSRLAB_FFDC | swap the stack pointers |
| BBC7,LAB_8E,LAB_FCFB | Sub has cleared down |
| BBS5,LAB_8E,LAB_FCE4 | . |
| BBC4,LAB_8E,LAB_FCD8 | . |
| LAB_FCE4: ; $FCE4 | |
| JSRLAB_FDEF | turn of the MT8870 tone decoder |
| JSRLAB_FDC3 | . |
| LDA#$31 | set the call type to "o/g_ans" ?? |
| STALAB_0517 | save the record call type |
| JSRLAB_FE28 | set the record ans/last time |
| JSRLAB_FD9F | . |
| LAB_FCF5: ; $FCF5 | |
| JSRLAB_FFDC | swap the stack pointers |
| BBS7,LAB_8E,LAB_FCF5 | . |
| ******* Subscriber has cleared down ***************** | |
| LAB_FCFB: ; $FCFB | |
| JSRLAB_FE3F | add the units to the meter value and set the cleared time |
| LDALAB_0517 | get the record call type |
| CMP#$10 | compare the call type with "seized" |
| BNELAB_FD20 | . |
| LDALAB_AB | . |
| ORALAB_AC | . |
| BNELAB_FD11 | . |
| LDALAB_AD | . |
| CMPLAB_6E | compare it with the TSeized value |
| BCCLAB_FD3A | if ?? < TSeized go ?? |
| LAB_FD11: ; $FD11 | |
| JSRLAB_F47A | return Cb = 0 if time - line seized time < 30 seconds ?? |
| BCSLAB_FD37 | . |
| LDA#$23 | set the call type to "i/c_cont" ?? |
| STALAB_0517 | save the record call type |
| JSRLAB_F46B | copy the current time to the line seized time |
| BRALAB_FD37 | . |
| LAB_FD20: ; $FD20 | |
| JSRLAB_FEAC | copy the dialed number to the record ?? |
| CLC | clear carry for add |
| ADCLAB_0516 | add the record length |
| STALAB_0516 | save the record length |
| JSRLAB_F462 | clear the line seized time ?? |
| BBC6,LAB_8E,LAB_FD37 | . |
| LDALAB_0517 | get the record call type |
| SEB2,A | change the call type from "o/g_" to "o/g*" ?? |
| STALAB_0517 | save the record call type |
| LAB_FD37: ; $FD37 | |
| JSRLAB_FF24 | copy the buffered record to memory ?? |
| LAB_FD3A: ; $FD3A | |
| JSRLAB_FDA2 | . |
| BBC0,LAB_8E,LAB_FD43 | . |
| JSRLAB_FA3D | . |
| LAB_FD43: ; $FD43 | |
| BBC4,LAB_8E,LAB_FD58 | . |
| LDM#$08,LAB_92 | . |
| JSRLAB_FDC3 | . |
| LAB_FD4C: ; $FD4C | |
| JSRLAB_FFDC | swap the stack pointers |
| BBC4,LAB_8E,LAB_FD58 | . |
| LDALAB_92 | . |
| BNELAB_FD4C | . |
| STALAB_8D | . |
| LAB_FD58: ; $FD58 | |
| JMPLAB_FB90 | . |
| ************************************************************************************ | |
| ?? | |
| LAB_FD5B: ; $FD5B | |
| TSTLAB_6B | test the digits value |
| BNELAB_FD6C | . |
| LDALAB_0559 | get the dialed number first digit |
| BBS4,A,LAB_FD69 | . |
| JSRLAB_FDD4 | turn MT8870 off and ?? |
| BRALAB_FD6C | . |
| LAB_FD69: ; $FD69 | |
| JSRLAB_FDE6 | . |
| LAB_FD6C: ; $FD6C | |
| TSTLAB_6C | test the pulses value |
| BEQLAB_FD76 | . |
| JSRLAB_FDE9 | . |
| BBC1,LAB_73,LAB_FD7B | . |
| LAB_FD76: ; $FD76 | |
| JSRLAB_FDC3 | . |
| SEB1,LAB_8E | . |
| LAB_FD7B: ; $FD7B | |
| LDA#$30 | set the call type to "o/g" ?? |
| STALAB_0517 | save the record call type |
| LDALAB_0516 | get the record length |
| AND#$E0 | mask xxx0 0000, clear the length |
| ORA#$0C | set the length to $0C |
| STALAB_0516 | save the record length |
| LDA#$80 | . |
| STALAB_8F | . |
| SEB0,LAB_8E | . |
| BRALAB_FDAB | . |
| ************************************************************************************ | |
| ?? | |
| LAB_FD92: ; $FD92 | |
| LDALAB_0559,Y | get a dialed number digit |
| BRALAB_FDAD | . |
| ************************************************************************************ | |
| ?? | |
| LAB_FD97: ; $FD97 | |
| LDA#$20 | set the call type to "i/c" ?? |
| JSRLAB_FDF6 | initialise a new record in the write buffer |
| LDA#$80 | . |
| .BYTE$2C | make the next line BIT $xxxx |
| ************************************************************************************ | |
| ?? | |
| LAB_FD9F: ; $FD9F | |
| LDA#$85 | . |
| .BYTE$2C | make the next line BIT $xxxx |
| ************************************************************************************ | |
| ?? | |
| LAB_FDA2: ; $FDA2 | |
| LDA#$8B | . |
| .BYTE$2C | make the next line BIT $xxxx |
| ************************************************************************************ | |
| ?? | |
| LAB_FDA5: ; $FDA5 | |
| LDA#$94 | . |
| .BYTE$2C | make the next line BIT $xxxx |
| ************************************************************************************ | |
| ?? | |
| LAB_FDA8: ; $FDA8 | |
| LDA#$9B | . |
| .BYTE$2C | make the next line BIT $xxxx |
| ************************************************************************************ | |
| ?? | |
| LAB_FDAB: ; $FDAB | |
| LDA#$A2 | . |
| LAB_FDAD: ; $FDAD | |
| LDXLAB_5A | . |
| STALAB_0578,X | . |
| INX | . |
| CPX#$28 | . |
| BCSLAB_FDB9 | . |
| STXLAB_5A | . |
| LAB_FDB9: ; $FDB9 | |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDBA: ; $FDBA | |
| LDM#$00,LAB_87 | . |
| SEB7,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDC0: ; $FDC0 | |
| CLB7,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDC3: ; $FDC3 | |
| LDM#$00,LAB_8B | . |
| SEB6,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDC9: ; $FDC9 | |
| CLB6,LAB_B9 | Meter Pulses = REV ? (1 = Yes, 0 = No) {TJ} |
| RTS | |
| ************************************************************************************ | |
| turn MT8870 on and ?? | |
| LAB_FDCC: ; $FDCC | |
| CLB5,LAB_F3 | clear b5 port 1 data register, turn MT8870 on |
| LDM#$10,LAB_8C | set the port 1 last read value |
| SEB3,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| turn MT8870 off and ?? | |
| LAB_FDD4: ; $FDD4 | |
| CLB3,LAB_B9 | . |
| SEB5,LAB_F3 | set b5 port 1 data register, turn MT8870 off |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDD9: ; $FDD9 | |
| LDA#$00 | clear A |
| STALAB_99 | . |
| STALAB_96 | . |
| STALAB_98 | . |
| STALAB_97 | . |
| SEB4,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDE6: ; $FDE6 | |
| CLB4,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| ?? | |
| LAB_FDE9: ; $FDE9 | |
| LDM#$00,LAB_86 | . |
| SEB2,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| Turn off the MT8870 tone decoder | |
| LAB_FDEF: ; $FDEF | |
| CLB3,LAB_B9 | . |
| SEB5,LAB_F3 | set b5 port 1 data register, turn MT8870 off |
| CLB4,LAB_B9 | . |
| RTS | |
| ************************************************************************************ | |
| initialise a new record in the write buffer | |
| LAB_FDF6: ; $FDF6 | |
| STALAB_0517 | save the record call type |
| JSRLAB_F502 | copy the current date/time to LAB_9A and LAB_A1 on ?? |
| JSRLAB_F534 | get the LAB_9A/9B/9C YY:MM:DD in AX |
| STALAB_0518 | save the record year/month/date low byte |
| STXLAB_0519 | save the record year/month/date high byte |
| JSRLAB_F554 | compress LAB_9D/9E/9F into AX and Cb ?? |
| STALAB_0578 | save the minutes/seconds |
| STXLAB_0579 | save the hours/minutes |
| LDM#$02,LAB_5A | . |
| STALAB_051A | save the record start minutes and seconds |
| STXLAB_051B | save the record start hours and minutes |
| LDA#$08 | set the initial record length |
| BCCLAB_FE1C | if the seconds b0 is clear skip the bit set |
| SEB7,A | set the record start seconds b0 |
| LAB_FE1C: ; $FE1C | |
| STALAB_0516 | save the record length |
| LDA#$00 | clear A |
| STALAB_0520 | clear the record metered units low byte |
| STALAB_0521 | clear the record metered units high byte |
| RTS | |
| ************************************************************************************ | |
| set the record ans/last time | |
| LAB_FE28: ; $FE28 | |
| JSRLAB_F502 | copy the current date/time to LAB_9A and LAB_A1 on ?? |
| JSRLAB_F554 | compress LAB_9D/9E/9F into AX and Cb ?? |
| STALAB_051E | save the record ans/last minutes and seconds |
| STXLAB_051F | save the record ans/last hours and minutes |
| LDALAB_0516 | get the record seconds b0 byte |
| CLB5,A | clear the record ans/last seconds b0 |
| BCCLAB_FE3B | if the seconds b0 was clear skip the bit set |
| SEB5,A | set the record ans/last seconds b0 |
| LAB_FE3B: ; $FE3B | |
| STALAB_0516 | save the record seconds b0 byte |
| RTS | |
| ************************************************************************************ | |
| add the units to the meter value and set the cleared time | |
| LAB_FE3F: ; $FE3F | |
| CLC | clear carry for add |
| LDALAB_0520 | get the record metered units low byte |
| ADCLAB_76 | add the meter value low byte |
| STALAB_76 | save the meter value low byte |
| LDALAB_0521 | get the record metered units high byte |
| ADCLAB_77 | add the meter value mid byte |
| STALAB_77 | save the meter value mid byte |
| BCCLAB_FE52 | if no carry skip the high byte increment |
| INCLAB_78 | increment the meter value high byte |
| LAB_FE52: ; $FE52 | |
| SEC | set carry for subtract |
| LDALAB_76 | get the meter value low byte |
| SBC#$40 | subtract 1,000,000 low byte |
| TAY | copy the low byte result |
| LDALAB_77 | get the meter value mid byte |
| SBC#$42 | subtract 1,000,000 mid byte |
| TAX | copy the mid byte result |
| LDALAB_78 | get the meter value high byte |
| SBC#$0F | subtract 1,000,000 high byte |
| BCCLAB_FE69 | if the meter value was < 1,000,000 skip the save |
| STYLAB_76 | save the meter value low byte |
| STXLAB_77 | save the meter value mid byte |
| STALAB_78 | save the meter value high byte |
| LAB_FE69: ; $FE69 | |
| JSRLAB_F510 | copy the current date/time to LAB_9A and LAB_A1 diff |
| to LAB_A8 ?? | |
| LDALAB_0517 | get the record call type |
| CMP#$31 | compare the call type with "o/g_ans" |
| BNELAB_FE98 | if not "o/g_ans" just go save the cleared time |
| LDALAB_AE | get the call duration 1/8th seconds |
| ASLA | shift .. |
| ASLA | .. the .. |
| ASLA | .. 1/8th .. |
| ASLA | .. seconds .. |
| ASLA | .. to b7-b5 |
| ORALAB_0521 | OR with the record metered units high byte |
| STALAB_0521 | save the record metered units high byte |
| LDX#$05 | set the count/index |
| CLC | clear carry for add |
| LAB_FE83: ; $FE83 | |
| LDALAB_A1,X | get the current time |
| ADCLAB_A8,X | add the diff time |
| CMPLAB_26,X | compare it with the max + 1 for date and time |
| BCCLAB_FE8E | if no overflow skip the correct |
| SBCLAB_26,X | else subtract the max + 1 for date and time |
| SEC | and set the carry for ADC + 1 |
| LAB_FE8E: ; $FE8E | |
| STALAB_9A,X | save the cleared time |
| DEX | decrement the count/index |
| BPLLAB_FE83 | loop if more to do |
| BRALAB_FE98 | go save the cleared time to the record |
| ************************************************************************************ | |
| set the record cleared time | |
| LAB_FE95: ; $FE95 | |
| JSRLAB_F510 | copy the current date/time to LAB_9A and LAB_A1 diff |
| to LAB_A8 ?? | |
| LAB_FE98: ; $FE98 | |
| JSRLAB_F554 | compress LAB_9D/9E/9F into AX and Cb |
| STALAB_051C | save the record cleared minutes and seconds |
| STXLAB_051D | save the record cleared hours and minutes |
| LDALAB_0516 | get the record seconds b0 byte |
| CLB6,A | clear the record cleared seconds b0 |
| BCCLAB_FEA8 | if the seconds b0 was clear skip the bit set |
| SEB6,A | set the record cleared seconds b0 |
| LAB_FEA8: ; $FEA8 | |
| STALAB_0516 | save the record seconds b0 byte |
| RTS | |
| ************************************************************************************ | |
| copy the dialed number to the record ?? | |
| LAB_FEAC: ; $FEAC | |
| TSTLAB_91 | test the dialed number buffer index |
| BEQLAB_FEC3 | if no dialed number just exit |
| LDX#$00 | clear the number copy index |
| LDY#$00 | clear the record digit index |
| LAB_FEB4: ; $FEB4 | |
| JSRLAB_FEF1 | get a digit from the dialed number buffer and increment |
| the index | |
| BCSLAB_FEC0 | if done just exit |
| BBS4,A,LAB_FEC4 | . |
| JSRLAB_FEFA | save a digit to the record and increment the index |
| BCCLAB_FEB4 | if the index < max go get another digit |
| LAB_FEC0: ; $FEC0 | |
| TYA | copy the record digit index |
| INCA | + 1 |
| LSRA | / 2 gives the number length in bytes |
| LAB_FEC3: ; $FEC3 | |
| RTS | |
| the dialed digit had b4 set so ?? | |
| LAB_FEC4: ; $FEC4 | |
| INY | increment the record digit index ?? |
| INY | increment the record digit index ?? |
| STYLAB_B2 | save the record digit index ?? |
| LAB_FEC8: ; $FEC8 | |
| JSRLAB_FEFA | save a digit to the record and increment the index |
| BCSLAB_FED5 | . |
| JSRLAB_FEF1 | get a digit from the dialed number buffer and increment |
| the index | |
| BCSLAB_FED5 | . |
| BBS4,A,LAB_FEC8 | . |
| DEX | . |
| LAB_FED5: ; $FED5 | |
| PHA | save A |
| TYA | copy Y |
| PHA | save Y |
| SEC | set carry for subtract |
| SBCLAB_B2 | subtract the record digit index ?? |
| PHA | . |
| CMP#$10 | . |
| LDA#$07 | . |
| ROLA | . |
| LDYLAB_B2 | get the record digit index ?? |
| DEY | decrement the record digit index ?? |
| DEY | decrement the record digit index ?? |
| JSRLAB_FEFA | save a digit to the record and increment the index |
| PLA | . |
| JSRLAB_FEFA | save a digit to the record and increment the index |
| PLA | pull Y |
| TAY | restore Y |
| PLA | restore A |
| BRALAB_FEB4 | go get another digit |
| ************************************************************************************ | |
| get a digit from the dialed number buffer and increment the index | |
| LAB_FEF1: ; $FEF1 | |
| CPXLAB_91 | compare the number copy index with the dialed number |
| buffer length | |
| BCSLAB_FEF9 | if > length just exit |
| LDALAB_0559,X | else get a dialed number digit |
| INX | increment the number copy index |
| LAB_FEF9: ; $FEF9 | |
| RTS | |
| ************************************************************************************ | |
| save a digit to the record and increment the index | |
| LAB_FEFA: ; $FEFA | |
| CPY#$26 | compare the index with the max + 1 |
| BCSLAB_FF18 | 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_FF0E | 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 |
| BRALAB_FF11 | go save the high nibble |
| LAB_FF0E: ; $FF0E | |
| ORALAB_0522,Y | OR with the high nibble |
| LAB_FF11: ; $FF11 | |
| STALAB_0522,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_FF18: ; $FF18 | |
| RTS | |
| ************************************************************************************ | |
| set timer 1 to 5ms | |
| LAB_FF19: ; $FF19 | |
| 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 | |
| ************************************************************************************ | |
| copy the buffered record to memory ?? | |
| LAB_FF24: ; $FF24 | |
| LDALAB_0516 | get the record length |
| AND#$1F | mask 000x xxxx, the record length |
| STALAB_B2 | save the buffered record length |
| LDYLAB_B3 | get the record memory start pointer low byte |
| LDXLAB_B4 | get the record memory start pointer mid byte |
| LDALAB_B5 | get the record memory start pointer high byte |
| LAB_FF31: ; $FF31 | |
| JSRLAB_FFB8 | check if room in memory for a new record ?? |
| BCCLAB_FF47 | if room go copy the record to memory |
| LDYLAB_B3 | get the record memory start pointer low byte |
| LDXLAB_B4 | get the record memory start pointer mid byte |
| LDALAB_B5 | get the record memory start pointer high byte |
| JSRLAB_FF7C | increment, check and rollover the YXA word ?? |
| STYLAB_B3 | save the record memory start pointer low byte |
| STXLAB_B4 | save the record memory start pointer mid byte |
| STALAB_B5 | save the record memory start pointer high byte |
| BRALAB_FF31 | . |
| LAB_FF47: ; $FF47 | |
| LDA#$00 | clear the record buffer index |
| PHA | save the record buffer index |
| LDYLAB_B6 | get the record memory end pointer low byte |
| LDXLAB_B7 | get the record memory end pointer mid byte |
| LDALAB_B8 | get the record memory end pointer high byte |
| BRALAB_FF6A | branch into the copy loop |
| LAB_FF52: ; $FF52 | |
| LDALAB_0516,X | get a byte from the record buffer |
| STA(LAB_63),Y | save it to the record in memory |
| INX | increment the record buffer index |
| INY | increment the record memory index |
| STYLAB_B6 | save the record memory end pointer low byte |
| BNELAB_FF6F | if no rollover skip the record pointer rollover |
| TXA | copy the record buffer index |
| PHA | save the record buffer index |
| LDXLAB_B7 | get the record memory end pointer mid byte |
| LDALAB_B8 | get the record memory end pointer high byte |
| JSRLAB_FF90 | increment, check and rollover the XA word ?? |
| STXLAB_B7 | save the record memory end pointer mid byte |
| STALAB_B8 | save the record memory end pointer high byte |
| LAB_FF6A: ; $FF6A | |
| JSRLAB_FFA3 | set bank and LAB_63/64 pointer from A ?? |
| PLA | pull the record buffer index |
| TAX | restore the record buffer index |
| LAB_FF6F: ; $FF6F | |
| CPXLAB_B2 | compare the record buffer index with the buffered record |
| length | |
| BCCLAB_FF52 | loop if more record bytes to copy |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| INCLAB_74 | increment the calls logged low byte |
| BNELAB_FF7B | if no rollover skip the high byte increment |
| INCLAB_75 | increment the calls logged high byte |
| LAB_FF7B: ; $FF7B | |
| RTS | |
| ************************************************************************************ | |
| increment, check and rollover the YXA word ?? | |
| LAB_FF7C: ; $FF7C | |
| PHA | save the XA word high byte |
| JSRLAB_FFA3 | set bank and LAB_63/64 pointer from A ?? |
| LDA(LAB_63),Y | get the record length |
| CLB5,LAB_F5 | clear b5 port 0 function register, port 0 b5 = b5 |
| AND#$1F | . |
| STALAB_64 | save the record RAM pointer high byte |
| TYA | . |
| CLC | clear carry for add |
| ADCLAB_64 | add the record RAM pointer high byte |
| TAY | . |
| PLA | restore the XA word high byte |
| BCCLAB_FFA2 | . |
| ************************************************************************************ | |
| increment, check and rollover the XA word ?? | |
| LAB_FF90: ; $FF90 | |
| INX | increment the word low byte |
| BNELAB_FF94 | if no rollover skip the high byte increment |
| INCA | else increment the high byte |
| LAB_FF94: ; $FF94 | |
| CMPLAB_02 | compare ?? with the RAM end high byte |
| BNELAB_FFA2 | . |
| CPXLAB_01 | compare ?? with the RAM end low byte |
| BNELAB_FFA2 | . |
| LDXLAB_F1C5 | get the RAM start address low byte |
| LDALAB_F1C5+1 | get the RAM start address high byte |
| LAB_FFA2: ; $FFA2 | |
| RTS | |
| ************************************************************************************ | |
| set bank and LAB_63/64 pointer from A ?? | |
| LAB_FFA3: ; $FFA3 | |
| 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_FFAB | . |
| SEB4,LAB_F6 | set b4 port 0 data register, set RAM A16 |
| LAB_FFAB: ; $FFAB | |
| BBC1,A,LAB_FFAF | . |
| SEB5,LAB_F5 | set b5 port 0 function register, port 0 b5 = DME |
| LAB_FFAF: ; $FFAF | |
| TXA | . |
| EOR#$80 | . |
| STALAB_64 | save the record RAM pointer high byte |
| LDM#$00,LAB_63 | 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_FFB8: ; $FFB8 | |
| PHA | save the record memory start pointer high byte |
| TYA | copy the record memory start pointer low byte |
| SEC | set carry for subtract |
| SBCLAB_B6 | 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_B7 | subtract the record memory end pointer mid byte |
| TAX | copy the record length mid byte |
| PLA | restore A |
| SBCLAB_B8 | subtract the record memory end pointer high byte |
| BCSLAB_FFCF | . |
| PHA | . |
| TXA | . |
| ADCLAB_65 | add the ?? size low byte |
| TAX | . |
| PLA | . |
| ADCLAB_66 | add the ?? size high byte |
| LAB_FFCF: ; $FFCF | |
| BNELAB_FFDA | . |
| DEX | . |
| BNELAB_FFDA | . |
| CPYLAB_B2 | . |
| BCSLAB_FFDA | . |
| SEC | flag no room |
| RTS | |
| LAB_FFDA: ; $FFDA | |
| CLC | flag room |
| RTS | |
| ************************************************************************************ | |
| swap the stack pointers | |
| LAB_FFDC: ; $FFDC | |
| PHA | save A |
| TXA | copy X |
| PHA | save X |
| TYA | copy Y |
| PHA | save Y |
| TSX | copy the stack pointer |
| LDALAB_07 | get the alternate stack pointer |
| STXLAB_07 | 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 | |
| ************************************************************************************ | |
| unused | |
| .BYTE$FF,$FF | unused bytes |
| .BYTE$FF,$FF | unused bytes |
| .BYTE$FF,$FF | unused bytes |
| ************************************************************************************ | |
| processor vectors | |
| .ORG $FFF4 ; vectors start address | |
| .WORDLAB_FB35 | TC, CNTR or BRK |
| .WORDLAB_FB35 | HE or VE |
| .WORDLAB_F896 | TIMER 1, 2 or 3 |
| .WORDLAB_F861 | RI or INT1 |
| .WORDLAB_F766 | INT2 |
| .WORDLAB_E00F | RESET |
| .END | |
| ************************************************************************************ | |