Home » CEEFAX disks » telesoftware4.adl » 25-12-87/CLKSET

25-12-87/CLKSET

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware4.adl
Filename: 25-12-87/CLKSET
Read OK:
File size: 3F51 bytes
Load address: FFFF1900
Exec address: FFFF8023
File contents
   10REM SETCLOCK PROGRAM FOR MASTER 128
   20REM (C) Ian Stubbs 1986
   30REM REQUIRES BBC ATS ROM
   40:
   50MODE 7
   60HIMEM=&7000
   70DIM code% 280
   80DIM hexaddr 5
   90osasci=&FFE3
  100osrdch=&FFE0
  110oswrch=&FFEE
  120osbyte=&FFF4
  130osword=&FFF1
  140oscli=&FFF7
  150PROCassemble_tools
  160PROCassemble(&7000)
  170PROCinstructions
  180PROCdemo
  190PROCcollect_data
  200PROCassemble(address)
  210PROCsave
  220PROCend
  230:
  240REM PROCEDURES
  250:
  260DEF PROCassemble(origin)
  270:
  280para%=origin+&1E0
  290FOR pass%=4 TO 6 STEP 2
  300P%=origin
  310O%=&7000
  320[OPT pass%
  330.begin
  340LDA #&D
  350STA para%
  360JSR ttx_command   \Switch on Telextext interrupts
  370LDA #1
  380STA para%
  390LDA #0
  400STA para%+1
  410JSR ttx_command   \Set channel to BBC-1
  420JSR delay
  430JSR delay
  440LDA #1
  450STA para%-4       \Set magazine number to 1 for BBC-1 target page (100)
  460LDA #17
  470STA para%
  480JSR ttx_command   \Read Teletext Adaptor Status
  490LDA para%+1
  500CMP #&FF
  510BEQ no_adaptor
  520CMP #2
  530BEQ adaptor_off
  540CMP #1
  550BEQ no_signal
  560JMP start
  570.no_adaptor
  580JSR exit
  590BRK
  600EQUB &FF
  610EQUS "No Adaptor"
  620BRK
  630.adaptor_off
  640JSR exit
  650BRK
  660EQUB 50
  670EQUS "Adaptor off"
  680BRK
  690.no_signal
  700LDA #1
  710STA para%
  720STA para%+1
  730JSR ttx_command        \Change channel to BBC-2
  740LDA #2
  750STA para%-4            \Change magazine number of target page to 2 (200), BBC-2
  760JSR delay
  770JSR delay
  780JSR delay
  790JSR delay
  800LDA #17
  810STA para%
  820JSR ttx_command        \Read Adaptor Status again
  830LDA para%+1
  840BEQ start              \If signal found then start program proper
  850JSR exit
  860BRK                    \else flag error.
  870EQUB 51
  880EQUS "No CEEFAX"
  890BRK
  900.start
  910LDA #7
  920STA para%
  930LDA #1
  940STA para%+1
  950JSR ttx_command     \Set page capture routine to get HEADER LINE ONLY
  960LDA #0
  970STA para%+16        \Set header detect byte
  980LDA #5
  990STA para%
 1000LDA #18
 1010STA para%+1
 1020LDA para%-4
 1030STA para%+2
 1040LDA #0
 1050STA para%+3
 1060LDA #&3F
 1070STA para%+4
 1080LDA #&7F
 1090STA para%+5
 1100LDA #(para% MOD 256)
 1110STA para%+6
 1120LDA #(para% DIV 256)
 1130STA para%+7
 1140JSR ttx_command     \Get page 100 from CEEFAX (BBC-1) or 200 (BBC-2)
 1150LDA #&FF            \Set "give up looking for header" threshold byte 1
 1160STA para%-1
 1170LDA #&3F            \Set byte 2
 1180STA para%-2
 1190.test_for_header
 1200LDA para%+16
 1210BNE get_time        \Check if header arrived
 1220LDY #0              \If not, wait a bit then test again
 1230.wait
 1240NOP
 1250DEY
 1260BNE wait
 1270DEC para%-1
 1280BNE test_for_header
 1290DEC para%-2
 1300BNE test_for_header
 1310JSR exit
 1320BRK
 1330EQUB 52
 1340EQUS "Can't find time/date"
 1350BRK
 1360.get_time
 1370\LDA #14
 1380\STA para%
 1390\JSR ttx_command      \Clear page grabber so it doesn't over-write data
 1400.try_again
 1410LDA #21
 1420STA para%
 1430JSR ttx_command      \Get time from TSDP
 1440LDA para%+10
 1450CMP #&FF             \Test to see if time found
 1460BEQ try_again        \Retry if not
 1470JSR delay            \1 second delay to bodge CMOS set routine to give
 1480JSR delay            \correct result
 1490JSR delay
 1500LDA #8
 1510STA para%
 1520LDA #&F
 1530LDX #para% MOD 256
 1540LDY #para% DIV 256
 1550JSR osword           \Set time in CMOS clock
 1560.get_date
 1570LDA #22
 1580STA para%
 1590JSR ttx_command      \Get date from TSDP (Only year will be used)
 1600LDA para%+12
 1610CMP #&FF             \Check to see if date found
 1620BEQ get_date         \Retry if not.
 1630LDY #&7              \Move year to correct pos. in parameter block
 1640LDX #&21             \to be used to set CMOS calender
 1650.nextchar
 1660LDA para%,Y
 1670STA para%,X
 1680INY
 1690INX
 1700CPX #&25
 1710BNE nextchar
 1720LDA #ASC(",")
 1730STA para%+&19        \Insert comma after day
 1740LDY #&16             \Then ensure the rest of the date is STANDARD ASCII
 1750.next
 1760LDA para%,Y
 1770AND #&7F
 1780STA para%,Y
 1790INY
 1800CPY #&20
 1810BNE next
 1820LDA #&F
 1830STA para%+&15
 1840LDA #&F
 1850LDX #(para%+&15) MOD 256
 1860LDY #(para%+&15) DIV 256
 1870JSR osword           \Set CMOS calender
 1880LDX #(time MOD 256)
 1890LDY #(time DIV 256)
 1900JSR oscli            \Perform *TIME
 1910.exit                \Reset previous values, switch off ttx and exit
 1920LDA #7
 1930STA para%
 1940LDA #30
 1950STA para%+1
 1960JSR ttx_command      \Reset no. of rows captured to 30
 1970\LDA #14
 1980\STA para%
 1990\JSR ttx_command      \Clear page grabber
 2000LDA #12
 2010STA para%
 2020JSR ttx_command      \Switch off Teletext interrupts
 2030RTS
 2040.ttx_command         \Ttx OSWORD subroutine
 2050LDA #&7A
 2060LDX #para% MOD 256
 2070LDY #para% DIV 256
 2080JSR osword
 2090RTS
 2100.delay               \Does nothing for about a third of a second
 2110LDX #&FF
 2120LDY #&FF
 2130.delay_loop
 2140DEY
 2150NOP:NOP
 2160BNE delay_loop
 2170DEX
 2180BNE delay_loop
 2190RTS
 2200.time
 2210EQUS "TI."
 2220EQUB &D
 2230.tel
 2240EQUS "B."
 2250EQUB &D
 2260]
 2270NEXT pass%
 2280ENDPROC
 2290:
 2300DEF PROCinstructions
 2310:
 2320CLS
 2330PRINT CHR$141CHR$130"     Setclock Instructions"
 2340PRINT CHR$141CHR$130"     Setclock Instructions"
 2350VDU28,0,23,39,3
 2360PRINT "SETCLOCK gets the date and time from   "
 2370PRINT "CEEFAX and sets the Master's internal  "
 2380PRINT "CMOS calender/clock. It uses BBC-1 by  "
 2390PRINT "default but, if it cannot find any     "
 2400PRINT "Teletext on BBC-1, it will try BBC-2.  "
 2410PRINT "It is, of course, only of value to     "
 2420PRINT "users of the Master and so use has"
 2430PRINT "been made of facilities provided only  "
 2440PRINT "on that machine. The program uses      "
 2450PRINT "OSWORD routines provided by the new BBC"
 2460PRINT "ATS ROM. It is not compatible with TFS."
 2470PRINT "   This Basic program will generate the"
 2480PRINT "machine code routine SETCLOCK. You will"
 2490PRINT "be able to choose where it will run in "
 2500PRINT "memory. The filename given to the code "
 2510PRINT "will depend on the filing system you   "
 2520PRINT "are using at the moment, as will the"
 2530PRINT "choice of assembly addresses offered."
 2540PROCspace
 2550PRINT "The best address for most users will be"
 2560PRINT "&B00. This is Econet workspace and will"
 2570PRINT "be unused in the majority of cases. If "
 2580PRINT "you are using the network facility then"
 2590PRINT "&900 is probably the best place to put "
 2600PRINT "the routine. This is the cassette/RS423"
 2610PRINT "input/output area. It's also used by   "
 2620PRINT "sound envelopes 5-16 and any speech    "
 2630PRINT "upgrade which may be present. If these "
 2640PRINT "two alternatives don't suit you may    "
 2650PRINT "assemble the routine to run anywhere   "
 2660PRINT "but don't expect sensible results if   "
 2670PRINT "you put it somewhere daft.             "
 2680PROCspace
 2690PRINT "Disc users should keep the program in  "
 2700PRINT "the current directory or library and   "
 2710PRINT "call it with *<filename>. Tape users   "
 2720PRINT "should use *RUN SETCLOCK."
 2730PRINT '"   Error messages will be given if the"
 2740PRINT "clock cannot be reset. The routine can "
 2750PRINT "be re-run using CALL &<address> if you "
 2760PRINT "wish. This may be useful if you are    "
 2770PRINT "using tape."
 2780PRINT '"   If the clock has been correctly    "
 2790PRINT "reset a *TIME command is issued        "
 2800PRINT "resulting in the contents of the CMOS  "
 2810PRINT "clock being printed out as usual.      "
 2820PROCspace
 2830PRINT "The next part of this program is a "
 2840PRINT "demonstration of SETCLOCK. The CMOS    "
 2850PRINT "clock can be scrambled and then reset  "
 2860PRINT "from CEEFAX. (Follow on-screen         "
 2870PRINT "instructions.)"
 2880PRINT '"  The CEEFAX header is displayed for  "
 2890PRINT "reference throughout the demonstration."
 2900PRINT "Do not be put off by the way the CMOS  "
 2910PRINT "clock appears to lead CEEFAX. SETCLOCK "
 2920PRINT "uses the Television Service Data Packet"
 2930PRINT "to set the clock and is more accurate  "
 2940PRINT "than the header.                       "
 2950PROCspace
 2960PRINT '"  To leave the demonstration press f2."
 2970PRINT "Then follow the directions to generate "
 2980PRINT "SETCLOCK itself and save it to your    "
 2990PRINT "current filing system. If you are using"
 3000PRINT "the ROM filing system or TFS the       "
 3010PRINT "program will not be saved.             "
 3020PRINT '"  The program contains many notes so  "
 3030PRINT "you should be able to adapt it. Any    "
 3040PRINT "comments would be welcome via PRESTEL  "
 3050PRINT "mailbox 012373797."
 3060PROCspace
 3070ENDPROC
 3080:
 3090DEF PROCspace
 3100:
 3110PRINT TAB(5,19)CHR$131"Press SPACE BAR to continue"
 3120REPEAT UNTIL INKEY(-99)
 3130*FX15
 3140CLS
 3150ENDPROC
 3160:
 3170DEF PROCdemo
 3180:
 3190ON ERROR PROCerror:END
 3200VDU26
 3210CLS
 3220PRINT TAB(0,0)CHR$134"SCLOCK";CHR$135;
 3230*TTXON
 3240*HON
 3250*FX225,240
 3260PROCc_off
 3270PRINT TAB(6,2)CHR$141CHR$131"Setclock demonstration"
 3280PRINT TAB(6)CHR$141CHR$131"Setclock demonstration"
 3290PRINT TAB(9,7)CHR$141CHR$133"CMOS Clock reads:"
 3300PRINT TAB(9)CHR$141CHR$133"CMOS Clock reads:"
 3310red$=CHR$129+CHR$157+CHR$135
 3320black$=CHR$156
 3330PRINT TAB(1,20)red$;"f0  ";black$;"      ";
 3340PRINT red$;"f1  ";black$;"      ";
 3350PRINT red$;"f2  ";black$
 3360PRINT 'TAB(2)"Reset";TAB(15)"Scramble";TAB(29)"Exit demo"
 3370REPEAT
 3380*FX15
 3390PROCupdate_time
 3400IF A=240 THEN PROCsetclock
 3410IF A=241 THEN PROCunset
 3420UNTIL A=242
 3430*HOFF
 3440*TTXOFF
 3450*FX225,1
 3460VDU26
 3470ON ERROR OFF
 3480ENDPROC
 3490:
 3500DEF PROCunset
 3510:
 3520TIME$="Sat,14 Mar 1982.10:10:10"
 3530ENDPROC
 3540:
 3550DEF PROCc_off
 3560:
 3570VDU23,1,0;0;0;0;0;
 3580ENDPROC
 3590:
 3600DEF PROCc_on
 3610:
 3620VDU23,1,1;0;0;0;0;
 3630ENDPROC
 3640:
 3650DEF PROCupdate_time
 3660:
 3670REPEAT
 3680PRINT TAB(5,9)CHR$141CHR$134;TIME$
 3690PRINT TAB(5)CHR$141CHR$134;TIME$
 3700UNTIL ADVAL(-1)>0
 3710A=GET
 3720ENDPROC
 3730:
 3740DEF PROCsetclock
 3750:
 3760PRINT TAB(7,5)red$;"SETTING CMOS CLOCK  ";black$
 3770PRINT TAB(5,13)CHR$141CHR$130"CMOS Clock last reset at:"
 3780PRINT TAB(5)CHR$141CHR$130"CMOS Clock last reset at:"'
 3790PRINT CHR$131"      ";
 3800CALL &7000
 3810*TTXON
 3820PRINT TAB(6,5);SPC(30);
 3830ENDPROC
 3840:
 3850DEF PROCerror
 3860:
 3870*TTXOFF
 3880IF ERR=17 REPORT:END
 3890IF ERR=&FF error$="Sorry, no Teletext adaptor"
 3900IF ERR=50 error$="Sorry, adaptor switched off"
 3910IF ERR=51 error$="Sorry, not receiving CEEFAX"
 3920IF ERR=52 error$="Sorry, can't find date/time"
 3930error$=error$+"  "
 3940PRINT TAB(18-(LEN(error$)/2),16)red$;error$;black$
 3950VDU28,0,22,39,19
 3960CLS
 3970VDU26
 3980PROCspace
 3990PROCcollect_data
 4000PROCsave
 4010PROCend
 4020ENDPROC
 4030:
 4040DEF PROCcollect_data
 4050:
 4060CLS
 4070PRINT CHR$141CHR$134TAB(12)"Save SETCLOCK"
 4080PRINT CHR$141CHR$134TAB(12)"Save SETCLOCK"
 4090VDU28,0,22,39,3
 4100file%=FNfile_sys
 4110IF file%=0 PROCnofile:ENDPROC
 4120IF file%=1 OR file%=2 PROCtape:ENDPROC
 4130IF file%=3 OR file%=6 PROCnosave:ENDPROC
 4140IF file%=4 PROCdfs:ENDPROC
 4150IF file%=5 OR file%=8 PROCnet_adfs:ENDPROC
 4160IF file%=6 PROCtfs:ENDPROC
 4170ENDPROC
 4180:
 4190DEF PROCnofile
 4200:
 4210PRINT "There is no filing system selected. Please"
 4220PRINT "select one and re-run the program."
 4230PROCend
 4240ENDPROC
 4250:
 4260DEF PROCtape
 4270:
 4280IF file%=1 fs$="TAPE (1200 Baud)" ELSE fs$="TAPE (300 Baud)"
 4290filename$="SETCLOCK"
 4300PROCprint_fs
 4310PROCget_address
 4320CLS
 4330PRINTTAB(0,5);CHR$136CHR$129;
 4340VDU28,10,22,27,13
 4350ENDPROC
 4360:
 4370DEF PROCnosave
 4380IF file%=3 fs$="ROM" ELSE fs$="Telesoftware"
 4390PRINT "Sorry, you cannot save to the ";fs$
 4400PRINT '"filing system. Please select another"
 4410PRINT '"(e.g. disc or tape) and re-run the"
 4420PRINT '"program."
 4430PROCc_on
 4440VDU26
 4450PRINT TAB(0,15);
 4460END
 4470ENDPROC
 4480:
 4490DEF PROCdfs
 4500:
 4510fs$="DISC (DFS)"
 4520filename$="SETCLK"
 4530PROCprint_fs
 4540PRINT CHR$131"Please enter any prefix to filename"
 4550PRINT CHR$131"(i.e. :1.W. to save file to drive 1,"
 4560PRINT CHR$131"directory W.) Press <RETURN> to"
 4570PRINT CHR$131"finish entry."
 4580PROCc_on
 4590PRINT ''TAB(12)CHR$134;:INPUT "PREFIX: "prefix$
 4600PROCc_off
 4610IF LEN(prefix$)<>0 IF RIGHT$(prefix$,1)<>"." prefix$=prefix$+"."
 4620filename$=prefix$+filename$
 4630PROCget_address
 4640ENDPROC
 4650:
 4660DEF PROCnet_adfs
 4670:
 4680IF file%=5 fs$="NETWORK" ELSE fs$="DISC (ADFS)"
 4690filename$="SETCLOCK"
 4700PROCprint_fs
 4710PRINT CHR$131"Please enter any pathname that you"
 4720PRINT CHR$131"require added to the beginning of"
 4730PRINT CHR$131"the filename. Press <RETURN> to"
 4740PRINT CHR$131"finish entry."
 4750PROCc_on
 4760PRINT ''CHR$134;:INPUT "PATHNAME: "prefix$
 4770PROCc_off
 4780IF LEN(prefix$)<>0 IF RIGHT$(prefix$,1)<>"." prefix$=prefix$+"."
 4790filename$=prefix$+filename$
 4800PROCget_address
 4810ENDPROC
 4820:
 4830DEF PROCprint_fs
 4840:
 4850PRINT CHR$131"Current filing system:"CHR$135;fs$
 4860PRINT 'CHR$131"The program will be saved as"CHR$135;filename$
 4870VDU28,0,22,39,8
 4880ENDPROC
 4890:
 4900DEF PROCget_address
 4910:
 4920PRINT ''CHR$130"  Where would you like the routine?"''
 4930IF file%>2 PRINT CHR$131"1. Serial/cassette port buffers (&900)"'
 4940PRINT 'CHR$131"2. Econet workspace (&B00)"'
 4950PRINT 'CHR$131"3. At another address"'
 4960REPEAT
 4970A=GET
 4980UNTIL (file%>2 AND (A>48 AND A<52)) OR (A>49 AND A<52)
 4990IF A=49 address=&900:ENDPROC
 5000IF A=50 address=&B00:ENDPROC
 5010IF A=51 PROCuser_address:ENDPROC
 5020ENDPROC
 5030:
 5040DEF PROCuser_address
 5050CLS
 5060PROCc_on
 5070PRINT 'CHR$131"Please enter the address you require:"
 5080PRINT 'TAB(14)CHR$134;"&";
 5090address=FNhex_input
 5100PROCc_off
 5110ENDPROC
 5120:
 5130DEF FNhex_input
 5140:
 5150=USR(hex_input) AND &FFFF
 5160:
 5170DEF FNhex_string(integer)
 5180:
 5190A%=integer MOD 256
 5200X%=integer DIV 256
 5210CALL hex_string
 5220=$hexaddr
 5230:
 5240DEF FNfile_sys
 5250:
 5260A%=0
 5270Y%=0
 5280=USR(&FFDA) AND &FF
 5290:
 5300DEF PROCsave
 5310:
 5320address$=FNhex_string(address)
 5330OSCLI ("SAVE "+filename$+" 7000 +200 FFFF"+address$+" FFFF"+address$)
 5340ENDPROC
 5350:
 5360DEF PROCend
 5370VDU26
 5380CLS
 5390PRINT '''CHR$131"   The program has been saved as:"
 5400PRINT 'TAB(19-(LEN(filename$)/2))CHR$134;filename$
 5410PRINT ''CHR$131"Don't forget to save THIS Basic program"
 5420PRINT CHR$131"   too, it contains the source code!"
 5430PRINT ''
 5440PROCc_on
 5450END
 5460ENDPROC
 5470:
 5480DEF PROCassemble_tools
 5490:
 5500FOR pass%=0 TO 2 STEP 2
 5510P%=code%
 5520[OPT pass%
 5530.hex_string
 5540STA &70           \Save bytes for future use
 5550STX &71
 5560LDA #0
 5570STA hexaddr       \Clear hex string to nothing
 5580STA hexaddr+1
 5590STA hexaddr+2
 5600STA hexaddr+3
 5610LDA #&D           \Set <CR> at end of hex string
 5620STA hexaddr+4
 5630LDA &70
 5640AND #&F           \Find lower nybble of low byte
 5650JSR convert       \Find ASCII value of nybble
 5660STA hexaddr+3     \Store in string
 5670TXA
 5680AND #&F           \Find lower nybble of high byte
 5690JSR convert       \as above
 5700STA hexaddr+1
 5710LDA &70           \Find higher nybble of low byte
 5720LSR A:LSR A:LSR A:LSR A
 5730JSR convert       \as above
 5740STA hexaddr+2
 5750LDA &71           \Find higher nybble of high byte
 5760LSR A:LSR A:LSR A:LSR A
 5770JSR convert       \as above
 5780STA hexaddr
 5790RTS
 5800.convert          \SUBROUTINE returns ASCII value of nybble in A
 5810CMP #10           \Is nybble alpha? (i.e. >9)
 5820BPL alpha         \If so, jump to alpha routine
 5830CLC               \Otherwise add 48 to it and return
 5840ADC #48
 5850RTS
 5860.alpha            \It's alpha so add 55 to it and return
 5870CLC
 5880ADC #55
 5890RTS
 5900.hex_input
 5910LDX #0           \Set character counter/pointer
 5920.get_char        \get a character from input stream
 5930JSR osrdch
 5940BCS error        \Trap invalid character
 5950CMP #13
 5960BEQ end_entry    \Detect and act upon <RETURN>
 5970CMP #127
 5980BEQ delete       \Detect and act upon <DELETE>
 5990CMP #48          \Range check. Pass only 0-9 and A-E (no lower case)
 6000BMI beep
 6010CMP #71
 6020BPL beep
 6030CMP #58
 6040BMI ok
 6050CMP #65
 6060BMI beep
 6070.ok
 6080CPX #4           \Detect sneaky try at entering a 5th digit
 6090BEQ beep
 6100STA hexaddr,X    \Add chracter to string
 6110INX              \Update counter/pointer
 6120JSR oswrch       \Put character on screen
 6130JMP get_char
 6140.beep            \Make a beep and go back to get_char
 6150LDA #7
 6160JSR oswrch
 6170JMP get_char
 6180.error           \Jump out on error
 6190RTS
 6200.delete          \Action <DELETE> key
 6210CPX #0
 6220BEQ beep         \If nothing to delete, beep and go to get_char
 6230LDA #8
 6240JSR oswrch
 6250LDA #32
 6260JSR oswrch
 6270LDA #8
 6280JSR oswrch
 6290DEX
 6300JMP get_char
 6310.end_entry       \Exit collection routine
 6320CPX #4           \All 4 characters used?
 6330BEQ evaluate
 6340CPX #0           \No characters entered?
 6350BEQ quick_exit
 6360STX &70          \If not, pad with leading zeros
 6370LDA #4
 6380SEC
 6390SBC &70          \Find how many spaces to pad
 6400STA &70
 6410DEX              \Change X from counter to pointer
 6420TXA
 6430CLC
 6440ADC &70
 6450TAY              \Set Y to point at target byte
 6460.shift           \Shift valid chars to end of string
 6470LDA hexaddr,X
 6480STA hexaddr,Y
 6490DEY
 6500DEX
 6510BMI continue
 6520JMP shift
 6530.continue
 6540LDY #0            \Add leading zeros
 6550LDA #48           \(ASCII "0")
 6560.pad
 6570STA hexaddr,Y
 6580INY
 6590CPY &70
 6600BNE pad
 6610.evaluate        \Decode hex string to 2 byte integer
 6620LDA hexaddr+3
 6630JSR decode       \Low nybble, low byte
 6640STA &70
 6650LDA hexaddr+2    \high nybble, low byte
 6660JSR decode
 6670ASL A:ASL A:ASL A:ASL A
 6680CLC
 6690ADC &70           \Add two nybbles together and store in Y
 6700TAY
 6710LDA hexaddr+1     \Low nybble, high byte
 6720JSR decode
 6730STA &70
 6740LDA hexaddr       \High nybble, high byte
 6750JSR decode
 6760ASL A:ASL A:ASL A:ASL A
 6770CLC
 6780ADC &70           \Add two nybbles together and store in X
 6790TAX
 6800TYA               \Move low byte back into A & exit
 6810RTS
 6820.decode           \Nybble decode subroutine
 6830CMP #58           \Is it > 9?
 6840BPL dec_alpha
 6850SEC               \If not, subtract 48
 6860SBC #48
 6870RTS
 6880.dec_alpha
 6890SEC               \If it is, subtract 55 (ALPHA)
 6900SBC #55
 6910RTS
 6920.quick_exit       \Used only if no characters entered (essential)
 6930LDA #0
 6940TAX
 6950RTS
 6960]
 6970NEXT pass%
 6980ENDPROC
 6990:

%� SETCLOCK PROGRAM FOR MASTER 128
� (C) Ian Stubbs 1986
� REQUIRES BBC ATS ROM
(:
2� 7
<�=&7000
F� code% 280
P� hexaddr 5
Zosasci=&FFE3
dosrdch=&FFE0
noswrch=&FFEE
xosbyte=&FFF4
�osword=&FFF1
�oscli=&FFF7
��assemble_tools
��assemble(&7000)
��instructions
�	�demo
��collect_data
��assemble(address)
�	�save
��end
�:
�� PROCEDURES
�:
� �assemble(origin)
:
para%=origin+&1E0
"� pass%=4 � 6 � 2
,
P%=origin
6O%=&7000
@[OPT pass%
J
.begin
TLDA #&D
^
STA para%
h5JSR ttx_command   \Switch on Telextext interrupts
r
LDA #1
|
STA para%
�
LDA #0
�STA para%+1
�+JSR ttx_command   \Set channel to BBC-1
�
JSR delay
�
JSR delay
�
LDA #1
�KSTA para%-4       \Set magazine number to 1 for BBC-1 target page (100)
�LDA #17
�
STA para%
�3JSR ttx_command   \Read Teletext Adaptor Status
�LDA para%+1
�CMP #&FF
�BEQ no_adaptor

CMP #2
BEQ adaptor_off

CMP #1
&BEQ no_signal
0
JMP start
:.no_adaptor
DJSR exit
NBRK
XEQUB &FF
bEQUS "No Adaptor"
lBRK
v.adaptor_off
�JSR exit
�BRK
�EQUB 50
�EQUS "Adaptor off"
�BRK
�.no_signal
�
LDA #1
�
STA para%
�STA para%+1
�3JSR ttx_command        \Change channel to BBC-2
�
LDA #2
�SSTA para%-4            \Change magazine number of target page to 2 (200), BBC-2
�
JSR delay

JSR delay

JSR delay

JSR delay
 LDA #17
*
STA para%
45JSR ttx_command        \Read Adaptor Status again
>LDA para%+1
HEBEQ start              \If signal found then start program proper
RJSR exit
\,BRK                    \else flag error.
fEQUB 51
pEQUS "No CEEFAX"
zBRK
�
.start
�
LDA #7
�
STA para%
�
LDA #1
�STA para%+1
�EJSR ttx_command     \Set page capture routine to get HEADER � �LY
�
LDA #0
�/STA para%+16        \Set header detect byte
�
LDA #5
�
STA para%
�LDA #18
�STA para%+1
�LDA para%-4
STA para%+2

LDA #0
STA para%+3
$LDA #&3F
.STA para%+4
8LDA #&7F
BSTA para%+5
LLDA #(para% � 256)
VSTA para%+6
`LDA #(para% � 256)
jSTA para%+7
tHJSR ttx_command     \Get page 100 from CEEFAX (BBC-1) or 200 (BBC-2)
~JLDA #&FF            \Set "give up looking for header" threshold byte 1
�STA para%-1
�#LDA #&3F            \Set byte 2
�STA para%-2
�.test_for_header
�LDA para%+16
�0BNE get_time        \Check if header arrived
�;LDY #0              \If not, wait a bit then test again
�	.wait
�NOP
�DEY
�BNE wait
�DEC para%-1
BNE test_for_header

DEC para%-2
BNE test_for_header
JSR exit
(BRK
2EQUB 52
<EQUS "Can't find time/date"
FBRK
P
.get_time
Z\LDA #14
d\STA para%
nK\JSR ttx_command      \Clear page grabber so it doesn't over-write data
x.try_again
�LDA #21
�
STA para%
�,JSR ttx_command      \Get time from TSDP
�LDA para%+10
�3CMP #&FF             \Test to see if time found
�&BEQ try_again        \Retry if not
�JJSR delay            \1 second delay to bodge CMOS set routine to give
�(JSR delay            \correct result
�
JSR delay
�
LDA #8
�
STA para%
�LDA #&F
�LDX #para% � 256
LDY #para% � 256
0JSR osword           \Set time in CMOS clock

.get_date
"LDA #22
,
STA para%
6EJSR ttx_command      \Get date from TSDP (Only year will be used)
@LDA para%+12
J4CMP #&FF             \Check to see if date found
T'BEQ get_date         \Retry if not.
^FLDY #&7              \Move year to correct pos. in parameter block
h9LDX #&21             \to be used to set CMOS calender
r
.nextchar
|LDA para%,Y
�STA para%,X
�INY
�INX
�CPX #&25
�BNE nextchar
�LDA #�(",")
�0STA para%+&19        \Insert comma after day
�JLDY #&16             \Then ensure the rest of the date is STANDARD �II
�	.next
�LDA para%,Y
�
� #&7F
�STA para%,Y
�INY
CPY #&20
BNE next
LDA #&F
&STA para%+&15
0LDA #&F
:LDX #(para%+&15) � 256
DLDY #(para%+&15) � 256
N+JSR osword           \Set CMOS calender
XLDX #(time � 256)
bLDY #(time � 256)
l$JSR oscli            \Perform *�
vH.exit                \Reset previous values, switch off ttx and exit
�
LDA #7
�
STA para%
�LDA #30
�STA para%+1
�:JSR ttx_command      \Reset no. of rows captured to 30
�\LDA #14
�\STA para%
�-\JSR ttx_command      \Clear page grabber
�LDA #12
�
STA para%
�8JSR ttx_command      \Switch off Teletext interrupts
�RTS
�/.ttx_command         \Ttx OSWORD subroutine
LDA #&7A
LDX #para% � 256
LDY #para% � 256
 JSR osword
*RTS
4D.delay               \Does nothing for about a third of a second
>LDX #&FF
HLDY #&FF
R.delay_loop
\DEY
fNOP:NOP
pBNE delay_loop
zDEX
�BNE delay_loop
�RTS
�	.time
�EQUS "TI."
�EQUB &D
�.tel
�
EQUS "B."
�EQUB &D
�]
�� pass%
��
�:
�� �instructions
	:
	�
	*� �141�130"     Setclock Instructions"
	$*� �141�130"     Setclock Instructions"
	.�28,0,23,39,3
	8/� "SETCLOCK gets the date and time from   "
	B/� "CEEFAX and sets the Master's internal  "
	L/� "CMOS calender/clock. It uses BBC-1 by  "
	V/� "default but, if it cannot find any     "
	`/� "Teletext on BBC-1, it will try BBC-2.  "
	j/� "It is, of course, only of value to     "
	t*� "users of the Master and so use has"
	~/� "been made of facilities provided only  "
	�/� "on that machine. The program uses      "
	�/� "OSWORD routines provided by the new BBC"
	�/� "ATS ROM. It is not compatible with TFS."
	�/� "   This Basic program will generate the"
	�/� "machine code routine SETCLOCK. You will"
	�/� "be able to choose where it will run in "
	�/� "memory. The filename given to the code "
	�/� "will depend on the filing system you   "
	�,� "are using at the moment, as will the"
	�-� "choice of assembly addresses offered."
	�
�space
	�/� "The best address for most users will be"
/� "&B00. This is Econet workspace and will"

/� "be unused in the majority of cases. If "
/� "you are using the network facility then"
/� "&900 is probably the best place to put "
(/� "the routine. This is the cassette/RS423"
2/� "input/output area. It's also used by   "
</� "sound envelopes 5-16 and any speech    "
F/� "upgrade which may be present. If these "
P/� "two alternatives don't suit you may    "
Z/� "assemble the routine to run anywhere   "
d/� "but don't expect sensible results if   "
n/� "you put it somewhere daft.             "
x
�space
�/� "Disc users should keep the program in  "
�/� "the current directory or library and   "
�/� "call it with *<filename>. Tape users   "
�!� "should use *RUN SETCLOCK."
�/� '"   Error messages will be given if the"
�/� "clock cannot be reset. The routine can "
�/� "be re-run using CALL &<address> if you "
�/� "wish. This may be useful if you are    "
�� "using tape."
�/� '"   If the clock has been correctly    "
�/� "reset a *TIME command is issued        "
�/� "resulting in the contents of the CMOS  "
�/� "clock being printed out as usual.      "

�space
+� "The next part of this program is a "
/� "demonstration of SETCLOCK. The CMOS    "
"/� "clock can be scrambled and then reset  "
,/� "from CEEFAX. (Follow on-screen         "
6� "instructions.)"
@/� '"  The CEEFAX header is displayed for  "
J/� "reference throughout the demonstration."
T/� "Do not be put off by the way the CMOS  "
^/� "clock appears to lead CEEFAX. SETCLOCK "
h/� "uses the Television Service Data Packet"
r/� "to set the clock and is more accurate  "
|/� "than the header.                       "
�
�space
�/� '"  To leave the demonstration press f2."
�/� "Then follow the directions to generate "
�/� "SETCLOCK itself and save it to your    "
�/� "current filing system. If you are using"
�/� "the ROM filing system or TFS the       "
�/� "program will not be saved.             "
�/� '"  The program contains many notes so  "
�/� "you should be able to adapt it. Any    "
�/� "comments would be welcome via PRESTEL  "
�� "mailbox 012373797."
�
�space
��
:
� �space
:
&-� �5,19)�131"Press SPACE BAR to continue"
0� � �(-99)
:	*FX15
D�
N�
X:
b� �demo
l:
v� � �error:�
��26
��
�� �0,0)�134"SCLOCK";�135;
�
*TTXON
�*HON
�*FX225,240
�
�c_off
�+� �6,2)�141�131"Setclock demonstration"
�)� �6)�141�131"Setclock demonstration"
�&� �9,7)�141�133"CMOS Clock reads:"
�$� �9)�141�133"CMOS Clock reads:"
�red$=�129+�157+�135
�black$=�156

(� �1,20)red$;"f0  ";black$;"      ";

"� red$;"f1  ";black$;"      ";

� red$;"f2  ";black$

 0� '�2)"Reset";�15)"Scramble";�29)"Exit demo"

*�

4	*FX15

>�update_time

H� A=240 � �setclock

R� A=241 � �unset

\� A=242

f	*HOFF

p*TTXOFF

z*FX225,1

��26

�	� � �

��

�:

�� �unset

�:

�!�$="Sat,14 Mar 1982.10:10:10"

��

�:

�� �c_off

�:

��23,1,0;0;0;0;0;

��
:
� �c_on
:
$�23,1,1;0;0;0;0;
.�
8:
B� �update_time
L:
V�
`� �5,9)�141�134;�$
j� �5)�141�134;�$
t
� �(-1)>0
~A=�
��
�:
�� �setclock
�:
�-� �7,5)red$;"SETTING CMOS CLOCK  ";black$
�/� �5,13)�141�130"CMOS Clock last reset at:"
�-� �5)�141�130"CMOS Clock last reset at:"'
�� �131"      ";
�� &7000
�
*TTXON
�� �6,5);�(30);
��
:

� �error
:
*TTXOFF
(� �=17 �:�
2/� �=&FF error$="Sorry, no Teletext adaptor"
</� �=50 error$="Sorry, adaptor switched off"
F/� �=51 error$="Sorry, not receiving CEEFAX"
P/� �=52 error$="Sorry, can't find date/time"
Zerror$=error$+"  "
d-� �18-(�(error$)/2),16)red$;error$;black$
n�28,0,22,39,19
x�
��26
�
�space
��collect_data
�	�save
��end
��
�:
�� �collect_data
�:
��
�!� �141�134�12)"Save SETCLOCK"
�!� �141�134�12)"Save SETCLOCK"
��28,0,22,39,3
file%=�file_sys
� file%=0 �nofile:�
� file%=1 � file%=2 �tape:�
"!� file%=3 � file%=6 �nosave:�
,� file%=4 �dfs:�
6#� file%=5 � file%=8 �net_adfs:�
@� file%=6 �tfs:�
J�
T:
^
� �nofile
h:
r2� "There is no filing system selected. Please"
|*� "select one and re-run the program."
��end
��
�:
�� �tape
�:
�<� file%=1 fs$="TAPE (1200 Baud)" � fs$="TAPE (300 Baud)"
�filename$="SETCLOCK"
�
�print_fs
��get_address
��
��0,5);�136�129;
��28,10,22,27,13
��
:

� �nosave
,� file%=3 fs$="ROM" � fs$="Telesoftware"
&*� "Sorry, you cannot save to the ";fs$
0-� '"filing system. Please select another"
:+� '"(e.g. disc or tape) and re-run the"
D� '"program."
N	�c_on
X�26
b
� �0,15);
l�
v�
�:
�
� �dfs
�:
�fs$="DISC (DFS)"
�filename$="SETCLK"
�
�print_fs
�/� �131"Please enter any prefix to filename"
�0� �131"(i.e. :1.W. to save file to drive 1,"
�+� �131"directory W.) Press <RETURN> to"
�� �131"finish entry."
�	�c_on
�%� ''�12)�134;:� "PREFIX: "prefix$
�
�c_off
:� �(prefix$)<>0 � �prefix$,1)<>"." prefix$=prefix$+"."
filename$=prefix$+filename$
�get_address
 �
*:
4� �net_adfs
>:
H/� file%=5 fs$="NETWORK" � fs$="DISC (ADFS)"
Rfilename$="SETCLOCK"
\
�print_fs
f.� �131"Please enter any pathname that you"
p-� �131"require added to the beginning of"
z+� �131"the filename. Press <RETURN> to"
�� �131"finish entry."
�	�c_on
�#� ''�134;:� "PATHNAME: "prefix$
�
�c_off
�:� �(prefix$)<>0 � �prefix$,1)<>"." prefix$=prefix$+"."
�filename$=prefix$+filename$
��get_address
��
�:
�� �print_fs
�:
�*� �131"Current filing system:"�135;fs$
�7� '�131"The program will be saved as"�135;filename$
�28,0,22,39,8
�
:
$� �get_address
.:
83� ''�130"  Where would you like the routine?"''
B=� file%>2 � �131"1. Serial/cassette port buffers (&900)"'
L(� '�131"2. Econet workspace (&B00)"'
V#� '�131"3. At another address"'
`�
jA=�
t/� (file%>2 � (A>48 � A<52)) � (A>49 � A<52)
~� A=49 address=&900:�
�� A=50 address=&B00:�
�� A=51 �user_address:�
��
�:
�� �user_address
��
�	�c_on
�2� '�131"Please enter the address you require:"
�� '�14)�134;"&";
�address=�hex_input
�
�c_off
��
:

� �hex_input
:
=�(hex_input) � &FFFF
(:
2� �hex_string(integer)
<:
FA%=integer � 256
PX%=integer � 256
Z� hex_string
d
=$hexaddr
n:
x� �file_sys
�:
�A%=0
�Y%=0
�=�(&FFDA) � &FF
�:
�� �save
�:
�!address$=�hex_string(address)
�E� ("SAVE "+filename$+" 7000 +200 FFFF"+address$+" FFFF"+address$)
��
�:
�
� �end
��26
�
0� '''�131"   The program has been saved as:"
*� '�19-(�(filename$)/2))�134;filename$
"5� ''�131"Don't forget to save THIS Basic program"
,0� �131"   too, it contains the source code!"
6� ''
@	�c_on
J�
T�
^:
h� �assemble_tools
r:
|� pass%=0 � 2 � 2
�P%=code%
�[OPT pass%
�.hex_string
�0STA &70           \Save bytes for future use
�STX &71
�
LDA #0
�2STA hexaddr       \Clear hex string to nothing
�STA hexaddr+1
�STA hexaddr+2
�STA hexaddr+3
�4LDA #&D           \Set <CR> at end of hex string
�STA hexaddr+4
�LDA &70
2� #&F           \Find lower nybble of low byte
/JSR convert       \Find �II value of nybble
&STA hexaddr+3     \Store in string
&TXA
03� #&F           \Find lower nybble of high byte
:JSR convert       \as above
DSTA hexaddr+1
N5LDA &70           \Find higher nybble of low byte
XLSR A:LSR A:LSR A:LSR A
bJSR convert       \as above
lSTA hexaddr+2
v6LDA &71           \Find higher nybble of high byte
�LSR A:LSR A:LSR A:LSR A
�JSR convert       \as above
�STA hexaddr
�RTS
�B.convert          \SUBROUTINE returns �II value of nybble in A
�1CMP #10           \Is nybble alpha? (i.e. >9)
�3BPL alpha         \If so, jump to alpha routine
�8CLC               \Otherwise add 48 to it and return
�ADC #48
�RTS
�<.alpha            \It's alpha so add 55 to it and return
�CLC
�ADC #55
RTS
.hex_input
3LDX #0           \Set character counter/pointer
 7.get_char        \get a character from input stream
*JSR osrdch
4,BCS error        \Trap invalid character
>CMP #13
H-BEQ end_entry    \Detect and act upon <�>
RCMP #127
\-BEQ delete       \Detect and act upon <�>
fHCMP #48          \Range check. Pass only 0-9 and A-E (no lower case)
pBMI beep
zCMP #71
�BPL beep
�CMP #58
�
BMI ok
�CMP #65
�BMI beep
�.ok
�?CPX #4           \Detect sneaky try at entering a 5th digit
�BEQ beep
�,STA hexaddr,X    \Add chracter to string
�,INX              \Update counter/pointer
�-JSR oswrch       \Put character on screen
�JMP get_char
�9.beep            \Make a beep and go back to get_char

LDA #7
JSR oswrch
JMP get_char
$'.error           \Jump out on error
.RTS
8$.delete          \Action <�> key
B
CPX #0
LCBEQ beep         \If nothing to delete, beep and go to get_char
V
LDA #8
`JSR oswrch
jLDA #32
tJSR oswrch
~
LDA #8
�JSR oswrch
�DEX
�JMP get_char
�-.end_entry       \Exit collection routine
�,CPX #4           \All 4 characters used?
�BEQ evaluate
�,CPX #0           \No characters entered?
�BEQ quick_exit
�4STX &70          \If not, pad with leading zeros
�
LDA #4
�SEC
�1SBC &70          \Find how many spaces to pad
STA &70

6DEX              \Change X from counter to pointer
TXA
CLC
(ADC &70
23TAY              \Set Y to point at target byte
<8.shift           \Shift valid chars to end of string
FLDA hexaddr,X
PSTA hexaddr,Y
ZDEY
dDEX
nBMI continue
x
JMP shift
�
.continue
�(LDY #0            \Add leading zeros
� LDA #48           \(�II "0")
�.pad
�STA hexaddr,Y
�INY
�CPY &70
�BNE pad
�9.evaluate        \Decode hex string to 2 byte integer
�LDA hexaddr+3
�*JSR decode       \Low nybble, low byte
�STA &70
�+LDA hexaddr+2    \high nybble, low byte
JSR decode
ASL A:ASL A:ASL A:ASL A
CLC
">ADC &70           \Add two nybbles together and store in Y
,TAY
6,LDA hexaddr+1     \Low nybble, high byte
@JSR decode
JSTA &70
T-LDA hexaddr       \High nybble, high byte
^JSR decode
hASL A:ASL A:ASL A:ASL A
rCLC
|>ADC &70           \Add two nybbles together and store in X
�TAX
�7TYA               \Move low byte back into A & exit
�RTS
�/.decode           \Nybble decode subroutine
�!CMP #58           \Is it > 9?
�BPL dec_alpha
�*SEC               \If not, subtract 48
�SBC #48
�RTS
�.dec_alpha
�4SEC               \If it is, subtract 55 (ALPHA)
�SBC #55
�RTS
E.quick_exit       \Used only if no characters entered (essential)

LDA #0
TAX
&RTS
0]
:� pass%
D�
N:
�
00000000  0d 00 0a 25 f4 20 53 45  54 43 4c 4f 43 4b 20 50  |...%. SETCLOCK P|
00000010  52 4f 47 52 41 4d 20 46  4f 52 20 4d 41 53 54 45  |ROGRAM FOR MASTE|
00000020  52 20 31 32 38 0d 00 14  19 f4 20 28 43 29 20 49  |R 128..... (C) I|
00000030  61 6e 20 53 74 75 62 62  73 20 31 39 38 36 0d 00  |an Stubbs 1986..|
00000040  1e 1a f4 20 52 45 51 55  49 52 45 53 20 42 42 43  |... REQUIRES BBC|
00000050  20 41 54 53 20 52 4f 4d  0d 00 28 05 3a 0d 00 32  | ATS ROM..(.:..2|
00000060  07 eb 20 37 0d 00 3c 0b  d3 3d 26 37 30 30 30 0d  |.. 7..<..=&7000.|
00000070  00 46 0f de 20 63 6f 64  65 25 20 32 38 30 0d 00  |.F.. code% 280..|
00000080  50 0f de 20 68 65 78 61  64 64 72 20 35 0d 00 5a  |P.. hexaddr 5..Z|
00000090  10 6f 73 61 73 63 69 3d  26 46 46 45 33 0d 00 64  |.osasci=&FFE3..d|
000000a0  10 6f 73 72 64 63 68 3d  26 46 46 45 30 0d 00 6e  |.osrdch=&FFE0..n|
000000b0  10 6f 73 77 72 63 68 3d  26 46 46 45 45 0d 00 78  |.oswrch=&FFEE..x|
000000c0  10 6f 73 62 79 74 65 3d  26 46 46 46 34 0d 00 82  |.osbyte=&FFF4...|
000000d0  10 6f 73 77 6f 72 64 3d  26 46 46 46 31 0d 00 8c  |.osword=&FFF1...|
000000e0  0f 6f 73 63 6c 69 3d 26  46 46 46 37 0d 00 96 13  |.oscli=&FFF7....|
000000f0  f2 61 73 73 65 6d 62 6c  65 5f 74 6f 6f 6c 73 0d  |.assemble_tools.|
00000100  00 a0 14 f2 61 73 73 65  6d 62 6c 65 28 26 37 30  |....assemble(&70|
00000110  30 30 29 0d 00 aa 11 f2  69 6e 73 74 72 75 63 74  |00).....instruct|
00000120  69 6f 6e 73 0d 00 b4 09  f2 64 65 6d 6f 0d 00 be  |ions.....demo...|
00000130  11 f2 63 6f 6c 6c 65 63  74 5f 64 61 74 61 0d 00  |..collect_data..|
00000140  c8 16 f2 61 73 73 65 6d  62 6c 65 28 61 64 64 72  |...assemble(addr|
00000150  65 73 73 29 0d 00 d2 09  f2 73 61 76 65 0d 00 dc  |ess).....save...|
00000160  08 f2 65 6e 64 0d 00 e6  05 3a 0d 00 f0 10 f4 20  |..end....:..... |
00000170  50 52 4f 43 45 44 55 52  45 53 0d 00 fa 05 3a 0d  |PROCEDURES....:.|
00000180  01 04 17 dd 20 f2 61 73  73 65 6d 62 6c 65 28 6f  |.... .assemble(o|
00000190  72 69 67 69 6e 29 0d 01  0e 05 3a 0d 01 18 15 70  |rigin)....:....p|
000001a0  61 72 61 25 3d 6f 72 69  67 69 6e 2b 26 31 45 30  |ara%=origin+&1E0|
000001b0  0d 01 22 15 e3 20 70 61  73 73 25 3d 34 20 b8 20  |..".. pass%=4 . |
000001c0  36 20 88 20 32 0d 01 2c  0d 50 25 3d 6f 72 69 67  |6 . 2..,.P%=orig|
000001d0  69 6e 0d 01 36 0c 4f 25  3d 26 37 30 30 30 0d 01  |in..6.O%=&7000..|
000001e0  40 0e 5b 4f 50 54 20 70  61 73 73 25 0d 01 4a 0a  |@.[OPT pass%..J.|
000001f0  2e 62 65 67 69 6e 0d 01  54 0b 4c 44 41 20 23 26  |.begin..T.LDA #&|
00000200  44 0d 01 5e 0d 53 54 41  20 70 61 72 61 25 0d 01  |D..^.STA para%..|
00000210  68 35 4a 53 52 20 74 74  78 5f 63 6f 6d 6d 61 6e  |h5JSR ttx_comman|
00000220  64 20 20 20 5c 53 77 69  74 63 68 20 6f 6e 20 54  |d   \Switch on T|
00000230  65 6c 65 78 74 65 78 74  20 69 6e 74 65 72 72 75  |elextext interru|
00000240  70 74 73 0d 01 72 0a 4c  44 41 20 23 31 0d 01 7c  |pts..r.LDA #1..||
00000250  0d 53 54 41 20 70 61 72  61 25 0d 01 86 0a 4c 44  |.STA para%....LD|
00000260  41 20 23 30 0d 01 90 0f  53 54 41 20 70 61 72 61  |A #0....STA para|
00000270  25 2b 31 0d 01 9a 2b 4a  53 52 20 74 74 78 5f 63  |%+1...+JSR ttx_c|
00000280  6f 6d 6d 61 6e 64 20 20  20 5c 53 65 74 20 63 68  |ommand   \Set ch|
00000290  61 6e 6e 65 6c 20 74 6f  20 42 42 43 2d 31 0d 01  |annel to BBC-1..|
000002a0  a4 0d 4a 53 52 20 64 65  6c 61 79 0d 01 ae 0d 4a  |..JSR delay....J|
000002b0  53 52 20 64 65 6c 61 79  0d 01 b8 0a 4c 44 41 20  |SR delay....LDA |
000002c0  23 31 0d 01 c2 4b 53 54  41 20 70 61 72 61 25 2d  |#1...KSTA para%-|
000002d0  34 20 20 20 20 20 20 20  5c 53 65 74 20 6d 61 67  |4       \Set mag|
000002e0  61 7a 69 6e 65 20 6e 75  6d 62 65 72 20 74 6f 20  |azine number to |
000002f0  31 20 66 6f 72 20 42 42  43 2d 31 20 74 61 72 67  |1 for BBC-1 targ|
00000300  65 74 20 70 61 67 65 20  28 31 30 30 29 0d 01 cc  |et page (100)...|
00000310  0b 4c 44 41 20 23 31 37  0d 01 d6 0d 53 54 41 20  |.LDA #17....STA |
00000320  70 61 72 61 25 0d 01 e0  33 4a 53 52 20 74 74 78  |para%...3JSR ttx|
00000330  5f 63 6f 6d 6d 61 6e 64  20 20 20 5c 52 65 61 64  |_command   \Read|
00000340  20 54 65 6c 65 74 65 78  74 20 41 64 61 70 74 6f  | Teletext Adapto|
00000350  72 20 53 74 61 74 75 73  0d 01 ea 0f 4c 44 41 20  |r Status....LDA |
00000360  70 61 72 61 25 2b 31 0d  01 f4 0c 43 4d 50 20 23  |para%+1....CMP #|
00000370  26 46 46 0d 01 fe 12 42  45 51 20 6e 6f 5f 61 64  |&FF....BEQ no_ad|
00000380  61 70 74 6f 72 0d 02 08  0a 43 4d 50 20 23 32 0d  |aptor....CMP #2.|
00000390  02 12 13 42 45 51 20 61  64 61 70 74 6f 72 5f 6f  |...BEQ adaptor_o|
000003a0  66 66 0d 02 1c 0a 43 4d  50 20 23 31 0d 02 26 11  |ff....CMP #1..&.|
000003b0  42 45 51 20 6e 6f 5f 73  69 67 6e 61 6c 0d 02 30  |BEQ no_signal..0|
000003c0  0d 4a 4d 50 20 73 74 61  72 74 0d 02 3a 0f 2e 6e  |.JMP start..:..n|
000003d0  6f 5f 61 64 61 70 74 6f  72 0d 02 44 0c 4a 53 52  |o_adaptor..D.JSR|
000003e0  20 65 78 69 74 0d 02 4e  07 42 52 4b 0d 02 58 0c  | exit..N.BRK..X.|
000003f0  45 51 55 42 20 26 46 46  0d 02 62 15 45 51 55 53  |EQUB &FF..b.EQUS|
00000400  20 22 4e 6f 20 41 64 61  70 74 6f 72 22 0d 02 6c  | "No Adaptor"..l|
00000410  07 42 52 4b 0d 02 76 10  2e 61 64 61 70 74 6f 72  |.BRK..v..adaptor|
00000420  5f 6f 66 66 0d 02 80 0c  4a 53 52 20 65 78 69 74  |_off....JSR exit|
00000430  0d 02 8a 07 42 52 4b 0d  02 94 0b 45 51 55 42 20  |....BRK....EQUB |
00000440  35 30 0d 02 9e 16 45 51  55 53 20 22 41 64 61 70  |50....EQUS "Adap|
00000450  74 6f 72 20 6f 66 66 22  0d 02 a8 07 42 52 4b 0d  |tor off"....BRK.|
00000460  02 b2 0e 2e 6e 6f 5f 73  69 67 6e 61 6c 0d 02 bc  |....no_signal...|
00000470  0a 4c 44 41 20 23 31 0d  02 c6 0d 53 54 41 20 70  |.LDA #1....STA p|
00000480  61 72 61 25 0d 02 d0 0f  53 54 41 20 70 61 72 61  |ara%....STA para|
00000490  25 2b 31 0d 02 da 33 4a  53 52 20 74 74 78 5f 63  |%+1...3JSR ttx_c|
000004a0  6f 6d 6d 61 6e 64 20 20  20 20 20 20 20 20 5c 43  |ommand        \C|
000004b0  68 61 6e 67 65 20 63 68  61 6e 6e 65 6c 20 74 6f  |hange channel to|
000004c0  20 42 42 43 2d 32 0d 02  e4 0a 4c 44 41 20 23 32  | BBC-2....LDA #2|
000004d0  0d 02 ee 53 53 54 41 20  70 61 72 61 25 2d 34 20  |...SSTA para%-4 |
000004e0  20 20 20 20 20 20 20 20  20 20 20 5c 43 68 61 6e  |           \Chan|
000004f0  67 65 20 6d 61 67 61 7a  69 6e 65 20 6e 75 6d 62  |ge magazine numb|
00000500  65 72 20 6f 66 20 74 61  72 67 65 74 20 70 61 67  |er of target pag|
00000510  65 20 74 6f 20 32 20 28  32 30 30 29 2c 20 42 42  |e to 2 (200), BB|
00000520  43 2d 32 0d 02 f8 0d 4a  53 52 20 64 65 6c 61 79  |C-2....JSR delay|
00000530  0d 03 02 0d 4a 53 52 20  64 65 6c 61 79 0d 03 0c  |....JSR delay...|
00000540  0d 4a 53 52 20 64 65 6c  61 79 0d 03 16 0d 4a 53  |.JSR delay....JS|
00000550  52 20 64 65 6c 61 79 0d  03 20 0b 4c 44 41 20 23  |R delay.. .LDA #|
00000560  31 37 0d 03 2a 0d 53 54  41 20 70 61 72 61 25 0d  |17..*.STA para%.|
00000570  03 34 35 4a 53 52 20 74  74 78 5f 63 6f 6d 6d 61  |.45JSR ttx_comma|
00000580  6e 64 20 20 20 20 20 20  20 20 5c 52 65 61 64 20  |nd        \Read |
00000590  41 64 61 70 74 6f 72 20  53 74 61 74 75 73 20 61  |Adaptor Status a|
000005a0  67 61 69 6e 0d 03 3e 0f  4c 44 41 20 70 61 72 61  |gain..>.LDA para|
000005b0  25 2b 31 0d 03 48 45 42  45 51 20 73 74 61 72 74  |%+1..HEBEQ start|
000005c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 49  |              \I|
000005d0  66 20 73 69 67 6e 61 6c  20 66 6f 75 6e 64 20 74  |f signal found t|
000005e0  68 65 6e 20 73 74 61 72  74 20 70 72 6f 67 72 61  |hen start progra|
000005f0  6d 20 70 72 6f 70 65 72  0d 03 52 0c 4a 53 52 20  |m proper..R.JSR |
00000600  65 78 69 74 0d 03 5c 2c  42 52 4b 20 20 20 20 20  |exit..\,BRK     |
00000610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00000620  65 6c 73 65 20 66 6c 61  67 20 65 72 72 6f 72 2e  |else flag error.|
00000630  0d 03 66 0b 45 51 55 42  20 35 31 0d 03 70 14 45  |..f.EQUB 51..p.E|
00000640  51 55 53 20 22 4e 6f 20  43 45 45 46 41 58 22 0d  |QUS "No CEEFAX".|
00000650  03 7a 07 42 52 4b 0d 03  84 0a 2e 73 74 61 72 74  |.z.BRK.....start|
00000660  0d 03 8e 0a 4c 44 41 20  23 37 0d 03 98 0d 53 54  |....LDA #7....ST|
00000670  41 20 70 61 72 61 25 0d  03 a2 0a 4c 44 41 20 23  |A para%....LDA #|
00000680  31 0d 03 ac 0f 53 54 41  20 70 61 72 61 25 2b 31  |1....STA para%+1|
00000690  0d 03 b6 45 4a 53 52 20  74 74 78 5f 63 6f 6d 6d  |...EJSR ttx_comm|
000006a0  61 6e 64 20 20 20 20 20  5c 53 65 74 20 70 61 67  |and     \Set pag|
000006b0  65 20 63 61 70 74 75 72  65 20 72 6f 75 74 69 6e  |e capture routin|
000006c0  65 20 74 6f 20 67 65 74  20 48 45 41 44 45 52 20  |e to get HEADER |
000006d0  86 20 ee 4c 59 0d 03 c0  0a 4c 44 41 20 23 30 0d  |. .LY....LDA #0.|
000006e0  03 ca 2f 53 54 41 20 70  61 72 61 25 2b 31 36 20  |../STA para%+16 |
000006f0  20 20 20 20 20 20 20 5c  53 65 74 20 68 65 61 64  |       \Set head|
00000700  65 72 20 64 65 74 65 63  74 20 62 79 74 65 0d 03  |er detect byte..|
00000710  d4 0a 4c 44 41 20 23 35  0d 03 de 0d 53 54 41 20  |..LDA #5....STA |
00000720  70 61 72 61 25 0d 03 e8  0b 4c 44 41 20 23 31 38  |para%....LDA #18|
00000730  0d 03 f2 0f 53 54 41 20  70 61 72 61 25 2b 31 0d  |....STA para%+1.|
00000740  03 fc 0f 4c 44 41 20 70  61 72 61 25 2d 34 0d 04  |...LDA para%-4..|
00000750  06 0f 53 54 41 20 70 61  72 61 25 2b 32 0d 04 10  |..STA para%+2...|
00000760  0a 4c 44 41 20 23 30 0d  04 1a 0f 53 54 41 20 70  |.LDA #0....STA p|
00000770  61 72 61 25 2b 33 0d 04  24 0c 4c 44 41 20 23 26  |ara%+3..$.LDA #&|
00000780  33 46 0d 04 2e 0f 53 54  41 20 70 61 72 61 25 2b  |3F....STA para%+|
00000790  34 0d 04 38 0c 4c 44 41  20 23 26 37 46 0d 04 42  |4..8.LDA #&7F..B|
000007a0  0f 53 54 41 20 70 61 72  61 25 2b 35 0d 04 4c 16  |.STA para%+5..L.|
000007b0  4c 44 41 20 23 28 70 61  72 61 25 20 83 20 32 35  |LDA #(para% . 25|
000007c0  36 29 0d 04 56 0f 53 54  41 20 70 61 72 61 25 2b  |6)..V.STA para%+|
000007d0  36 0d 04 60 16 4c 44 41  20 23 28 70 61 72 61 25  |6..`.LDA #(para%|
000007e0  20 81 20 32 35 36 29 0d  04 6a 0f 53 54 41 20 70  | . 256)..j.STA p|
000007f0  61 72 61 25 2b 37 0d 04  74 48 4a 53 52 20 74 74  |ara%+7..tHJSR tt|
00000800  78 5f 63 6f 6d 6d 61 6e  64 20 20 20 20 20 5c 47  |x_command     \G|
00000810  65 74 20 70 61 67 65 20  31 30 30 20 66 72 6f 6d  |et page 100 from|
00000820  20 43 45 45 46 41 58 20  28 42 42 43 2d 31 29 20  | CEEFAX (BBC-1) |
00000830  6f 72 20 32 30 30 20 28  42 42 43 2d 32 29 0d 04  |or 200 (BBC-2)..|
00000840  7e 4a 4c 44 41 20 23 26  46 46 20 20 20 20 20 20  |~JLDA #&FF      |
00000850  20 20 20 20 20 20 5c 53  65 74 20 22 67 69 76 65  |      \Set "give|
00000860  20 75 70 20 6c 6f 6f 6b  69 6e 67 20 66 6f 72 20  | up looking for |
00000870  68 65 61 64 65 72 22 20  74 68 72 65 73 68 6f 6c  |header" threshol|
00000880  64 20 62 79 74 65 20 31  0d 04 88 0f 53 54 41 20  |d byte 1....STA |
00000890  70 61 72 61 25 2d 31 0d  04 92 23 4c 44 41 20 23  |para%-1...#LDA #|
000008a0  26 33 46 20 20 20 20 20  20 20 20 20 20 20 20 5c  |&3F            \|
000008b0  53 65 74 20 62 79 74 65  20 32 0d 04 9c 0f 53 54  |Set byte 2....ST|
000008c0  41 20 70 61 72 61 25 2d  32 0d 04 a6 14 2e 74 65  |A para%-2.....te|
000008d0  73 74 5f 66 6f 72 5f 68  65 61 64 65 72 0d 04 b0  |st_for_header...|
000008e0  10 4c 44 41 20 70 61 72  61 25 2b 31 36 0d 04 ba  |.LDA para%+16...|
000008f0  30 42 4e 45 20 67 65 74  5f 74 69 6d 65 20 20 20  |0BNE get_time   |
00000900  20 20 20 20 20 5c 43 68  65 63 6b 20 69 66 20 68  |     \Check if h|
00000910  65 61 64 65 72 20 61 72  72 69 76 65 64 0d 04 c4  |eader arrived...|
00000920  3b 4c 44 59 20 23 30 20  20 20 20 20 20 20 20 20  |;LDY #0         |
00000930  20 20 20 20 20 5c 49 66  20 6e 6f 74 2c 20 77 61  |     \If not, wa|
00000940  69 74 20 61 20 62 69 74  20 74 68 65 6e 20 74 65  |it a bit then te|
00000950  73 74 20 61 67 61 69 6e  0d 04 ce 09 2e 77 61 69  |st again.....wai|
00000960  74 0d 04 d8 07 4e 4f 50  0d 04 e2 07 44 45 59 0d  |t....NOP....DEY.|
00000970  04 ec 0c 42 4e 45 20 77  61 69 74 0d 04 f6 0f 44  |...BNE wait....D|
00000980  45 43 20 70 61 72 61 25  2d 31 0d 05 00 17 42 4e  |EC para%-1....BN|
00000990  45 20 74 65 73 74 5f 66  6f 72 5f 68 65 61 64 65  |E test_for_heade|
000009a0  72 0d 05 0a 0f 44 45 43  20 70 61 72 61 25 2d 32  |r....DEC para%-2|
000009b0  0d 05 14 17 42 4e 45 20  74 65 73 74 5f 66 6f 72  |....BNE test_for|
000009c0  5f 68 65 61 64 65 72 0d  05 1e 0c 4a 53 52 20 65  |_header....JSR e|
000009d0  78 69 74 0d 05 28 07 42  52 4b 0d 05 32 0b 45 51  |xit..(.BRK..2.EQ|
000009e0  55 42 20 35 32 0d 05 3c  1f 45 51 55 53 20 22 43  |UB 52..<.EQUS "C|
000009f0  61 6e 27 74 20 66 69 6e  64 20 74 69 6d 65 2f 64  |an't find time/d|
00000a00  61 74 65 22 0d 05 46 07  42 52 4b 0d 05 50 0d 2e  |ate"..F.BRK..P..|
00000a10  67 65 74 5f 74 69 6d 65  0d 05 5a 0c 5c 4c 44 41  |get_time..Z.\LDA|
00000a20  20 23 31 34 0d 05 64 0e  5c 53 54 41 20 70 61 72  | #14..d.\STA par|
00000a30  61 25 0d 05 6e 4b 5c 4a  53 52 20 74 74 78 5f 63  |a%..nK\JSR ttx_c|
00000a40  6f 6d 6d 61 6e 64 20 20  20 20 20 20 5c 43 6c 65  |ommand      \Cle|
00000a50  61 72 20 70 61 67 65 20  67 72 61 62 62 65 72 20  |ar page grabber |
00000a60  73 6f 20 69 74 20 64 6f  65 73 6e 27 74 20 6f 76  |so it doesn't ov|
00000a70  65 72 2d 77 72 69 74 65  20 64 61 74 61 0d 05 78  |er-write data..x|
00000a80  0e 2e 74 72 79 5f 61 67  61 69 6e 0d 05 82 0b 4c  |..try_again....L|
00000a90  44 41 20 23 32 31 0d 05  8c 0d 53 54 41 20 70 61  |DA #21....STA pa|
00000aa0  72 61 25 0d 05 96 2c 4a  53 52 20 74 74 78 5f 63  |ra%...,JSR ttx_c|
00000ab0  6f 6d 6d 61 6e 64 20 20  20 20 20 20 5c 47 65 74  |ommand      \Get|
00000ac0  20 74 69 6d 65 20 66 72  6f 6d 20 54 53 44 50 0d  | time from TSDP.|
00000ad0  05 a0 10 4c 44 41 20 70  61 72 61 25 2b 31 30 0d  |...LDA para%+10.|
00000ae0  05 aa 33 43 4d 50 20 23  26 46 46 20 20 20 20 20  |..3CMP #&FF     |
00000af0  20 20 20 20 20 20 20 20  5c 54 65 73 74 20 74 6f  |        \Test to|
00000b00  20 73 65 65 20 69 66 20  74 69 6d 65 20 66 6f 75  | see if time fou|
00000b10  6e 64 0d 05 b4 26 42 45  51 20 74 72 79 5f 61 67  |nd...&BEQ try_ag|
00000b20  61 69 6e 20 20 20 20 20  20 20 20 5c 52 65 74 72  |ain        \Retr|
00000b30  79 20 69 66 20 6e 6f 74  0d 05 be 4a 4a 53 52 20  |y if not...JJSR |
00000b40  64 65 6c 61 79 20 20 20  20 20 20 20 20 20 20 20  |delay           |
00000b50  20 5c 31 20 73 65 63 6f  6e 64 20 64 65 6c 61 79  | \1 second delay|
00000b60  20 74 6f 20 62 6f 64 67  65 20 43 4d 4f 53 20 73  | to bodge CMOS s|
00000b70  65 74 20 72 6f 75 74 69  6e 65 20 74 6f 20 67 69  |et routine to gi|
00000b80  76 65 0d 05 c8 28 4a 53  52 20 64 65 6c 61 79 20  |ve...(JSR delay |
00000b90  20 20 20 20 20 20 20 20  20 20 20 5c 63 6f 72 72  |           \corr|
00000ba0  65 63 74 20 72 65 73 75  6c 74 0d 05 d2 0d 4a 53  |ect result....JS|
00000bb0  52 20 64 65 6c 61 79 0d  05 dc 0a 4c 44 41 20 23  |R delay....LDA #|
00000bc0  38 0d 05 e6 0d 53 54 41  20 70 61 72 61 25 0d 05  |8....STA para%..|
00000bd0  f0 0b 4c 44 41 20 23 26  46 0d 05 fa 14 4c 44 58  |..LDA #&F....LDX|
00000be0  20 23 70 61 72 61 25 20  83 20 32 35 36 0d 06 04  | #para% . 256...|
00000bf0  14 4c 44 59 20 23 70 61  72 61 25 20 81 20 32 35  |.LDY #para% . 25|
00000c00  36 0d 06 0e 30 4a 53 52  20 6f 73 77 6f 72 64 20  |6...0JSR osword |
00000c10  20 20 20 20 20 20 20 20  20 20 5c 53 65 74 20 74  |          \Set t|
00000c20  69 6d 65 20 69 6e 20 43  4d 4f 53 20 63 6c 6f 63  |ime in CMOS cloc|
00000c30  6b 0d 06 18 0d 2e 67 65  74 5f 64 61 74 65 0d 06  |k.....get_date..|
00000c40  22 0b 4c 44 41 20 23 32  32 0d 06 2c 0d 53 54 41  |".LDA #22..,.STA|
00000c50  20 70 61 72 61 25 0d 06  36 45 4a 53 52 20 74 74  | para%..6EJSR tt|
00000c60  78 5f 63 6f 6d 6d 61 6e  64 20 20 20 20 20 20 5c  |x_command      \|
00000c70  47 65 74 20 64 61 74 65  20 66 72 6f 6d 20 54 53  |Get date from TS|
00000c80  44 50 20 28 4f 6e 6c 79  20 79 65 61 72 20 77 69  |DP (Only year wi|
00000c90  6c 6c 20 62 65 20 75 73  65 64 29 0d 06 40 10 4c  |ll be used)..@.L|
00000ca0  44 41 20 70 61 72 61 25  2b 31 32 0d 06 4a 34 43  |DA para%+12..J4C|
00000cb0  4d 50 20 23 26 46 46 20  20 20 20 20 20 20 20 20  |MP #&FF         |
00000cc0  20 20 20 20 5c 43 68 65  63 6b 20 74 6f 20 73 65  |    \Check to se|
00000cd0  65 20 69 66 20 64 61 74  65 20 66 6f 75 6e 64 0d  |e if date found.|
00000ce0  06 54 27 42 45 51 20 67  65 74 5f 64 61 74 65 20  |.T'BEQ get_date |
00000cf0  20 20 20 20 20 20 20 20  5c 52 65 74 72 79 20 69  |        \Retry i|
00000d00  66 20 6e 6f 74 2e 0d 06  5e 46 4c 44 59 20 23 26  |f not...^FLDY #&|
00000d10  37 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |7              \|
00000d20  4d 6f 76 65 20 79 65 61  72 20 74 6f 20 63 6f 72  |Move year to cor|
00000d30  72 65 63 74 20 70 6f 73  2e 20 69 6e 20 70 61 72  |rect pos. in par|
00000d40  61 6d 65 74 65 72 20 62  6c 6f 63 6b 0d 06 68 39  |ameter block..h9|
00000d50  4c 44 58 20 23 26 32 31  20 20 20 20 20 20 20 20  |LDX #&21        |
00000d60  20 20 20 20 20 5c 74 6f  20 62 65 20 75 73 65 64  |     \to be used|
00000d70  20 74 6f 20 73 65 74 20  43 4d 4f 53 20 63 61 6c  | to set CMOS cal|
00000d80  65 6e 64 65 72 0d 06 72  0d 2e 6e 65 78 74 63 68  |ender..r..nextch|
00000d90  61 72 0d 06 7c 0f 4c 44  41 20 70 61 72 61 25 2c  |ar..|.LDA para%,|
00000da0  59 0d 06 86 0f 53 54 41  20 70 61 72 61 25 2c 58  |Y....STA para%,X|
00000db0  0d 06 90 07 49 4e 59 0d  06 9a 07 49 4e 58 0d 06  |....INY....INX..|
00000dc0  a4 0c 43 50 58 20 23 26  32 35 0d 06 ae 10 42 4e  |..CPX #&25....BN|
00000dd0  45 20 6e 65 78 74 63 68  61 72 0d 06 b8 0f 4c 44  |E nextchar....LD|
00000de0  41 20 23 97 28 22 2c 22  29 0d 06 c2 30 53 54 41  |A #.(",")...0STA|
00000df0  20 70 61 72 61 25 2b 26  31 39 20 20 20 20 20 20  | para%+&19      |
00000e00  20 20 5c 49 6e 73 65 72  74 20 63 6f 6d 6d 61 20  |  \Insert comma |
00000e10  61 66 74 65 72 20 64 61  79 0d 06 cc 4a 4c 44 59  |after day...JLDY|
00000e20  20 23 26 31 36 20 20 20  20 20 20 20 20 20 20 20  | #&16           |
00000e30  20 20 5c 54 68 65 6e 20  65 6e 73 75 72 65 20 74  |  \Then ensure t|
00000e40  68 65 20 72 65 73 74 20  6f 66 20 74 68 65 20 64  |he rest of the d|
00000e50  61 74 65 20 69 73 20 53  54 41 4e 44 41 52 44 20  |ate is STANDARD |
00000e60  97 49 49 0d 06 d6 09 2e  6e 65 78 74 0d 06 e0 0f  |.II.....next....|
00000e70  4c 44 41 20 70 61 72 61  25 2c 59 0d 06 ea 0a 80  |LDA para%,Y.....|
00000e80  20 23 26 37 46 0d 06 f4  0f 53 54 41 20 70 61 72  | #&7F....STA par|
00000e90  61 25 2c 59 0d 06 fe 07  49 4e 59 0d 07 08 0c 43  |a%,Y....INY....C|
00000ea0  50 59 20 23 26 32 30 0d  07 12 0c 42 4e 45 20 6e  |PY #&20....BNE n|
00000eb0  65 78 74 0d 07 1c 0b 4c  44 41 20 23 26 46 0d 07  |ext....LDA #&F..|
00000ec0  26 11 53 54 41 20 70 61  72 61 25 2b 26 31 35 0d  |&.STA para%+&15.|
00000ed0  07 30 0b 4c 44 41 20 23  26 46 0d 07 3a 1a 4c 44  |.0.LDA #&F..:.LD|
00000ee0  58 20 23 28 70 61 72 61  25 2b 26 31 35 29 20 83  |X #(para%+&15) .|
00000ef0  20 32 35 36 0d 07 44 1a  4c 44 59 20 23 28 70 61  | 256..D.LDY #(pa|
00000f00  72 61 25 2b 26 31 35 29  20 81 20 32 35 36 0d 07  |ra%+&15) . 256..|
00000f10  4e 2b 4a 53 52 20 6f 73  77 6f 72 64 20 20 20 20  |N+JSR osword    |
00000f20  20 20 20 20 20 20 20 5c  53 65 74 20 43 4d 4f 53  |       \Set CMOS|
00000f30  20 63 61 6c 65 6e 64 65  72 0d 07 58 15 4c 44 58  | calender..X.LDX|
00000f40  20 23 28 74 69 6d 65 20  83 20 32 35 36 29 0d 07  | #(time . 256)..|
00000f50  62 15 4c 44 59 20 23 28  74 69 6d 65 20 81 20 32  |b.LDY #(time . 2|
00000f60  35 36 29 0d 07 6c 24 4a  53 52 20 6f 73 63 6c 69  |56)..l$JSR oscli|
00000f70  20 20 20 20 20 20 20 20  20 20 20 20 5c 50 65 72  |            \Per|
00000f80  66 6f 72 6d 20 2a 91 0d  07 76 48 2e 65 78 69 74  |form *...vH.exit|
00000f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000fa0  5c 52 65 73 65 74 20 70  72 65 76 69 6f 75 73 20  |\Reset previous |
00000fb0  76 61 6c 75 65 73 2c 20  73 77 69 74 63 68 20 6f  |values, switch o|
00000fc0  66 66 20 74 74 78 20 61  6e 64 20 65 78 69 74 0d  |ff ttx and exit.|
00000fd0  07 80 0a 4c 44 41 20 23  37 0d 07 8a 0d 53 54 41  |...LDA #7....STA|
00000fe0  20 70 61 72 61 25 0d 07  94 0b 4c 44 41 20 23 33  | para%....LDA #3|
00000ff0  30 0d 07 9e 0f 53 54 41  20 70 61 72 61 25 2b 31  |0....STA para%+1|
00001000  0d 07 a8 3a 4a 53 52 20  74 74 78 5f 63 6f 6d 6d  |...:JSR ttx_comm|
00001010  61 6e 64 20 20 20 20 20  20 5c 52 65 73 65 74 20  |and      \Reset |
00001020  6e 6f 2e 20 6f 66 20 72  6f 77 73 20 63 61 70 74  |no. of rows capt|
00001030  75 72 65 64 20 74 6f 20  33 30 0d 07 b2 0c 5c 4c  |ured to 30....\L|
00001040  44 41 20 23 31 34 0d 07  bc 0e 5c 53 54 41 20 70  |DA #14....\STA p|
00001050  61 72 61 25 0d 07 c6 2d  5c 4a 53 52 20 74 74 78  |ara%...-\JSR ttx|
00001060  5f 63 6f 6d 6d 61 6e 64  20 20 20 20 20 20 5c 43  |_command      \C|
00001070  6c 65 61 72 20 70 61 67  65 20 67 72 61 62 62 65  |lear page grabbe|
00001080  72 0d 07 d0 0b 4c 44 41  20 23 31 32 0d 07 da 0d  |r....LDA #12....|
00001090  53 54 41 20 70 61 72 61  25 0d 07 e4 38 4a 53 52  |STA para%...8JSR|
000010a0  20 74 74 78 5f 63 6f 6d  6d 61 6e 64 20 20 20 20  | ttx_command    |
000010b0  20 20 5c 53 77 69 74 63  68 20 6f 66 66 20 54 65  |  \Switch off Te|
000010c0  6c 65 74 65 78 74 20 69  6e 74 65 72 72 75 70 74  |letext interrupt|
000010d0  73 0d 07 ee 07 52 54 53  0d 07 f8 2f 2e 74 74 78  |s....RTS.../.ttx|
000010e0  5f 63 6f 6d 6d 61 6e 64  20 20 20 20 20 20 20 20  |_command        |
000010f0  20 5c 54 74 78 20 4f 53  57 4f 52 44 20 73 75 62  | \Ttx OSWORD sub|
00001100  72 6f 75 74 69 6e 65 0d  08 02 0c 4c 44 41 20 23  |routine....LDA #|
00001110  26 37 41 0d 08 0c 14 4c  44 58 20 23 70 61 72 61  |&7A....LDX #para|
00001120  25 20 83 20 32 35 36 0d  08 16 14 4c 44 59 20 23  |% . 256....LDY #|
00001130  70 61 72 61 25 20 81 20  32 35 36 0d 08 20 0e 4a  |para% . 256.. .J|
00001140  53 52 20 6f 73 77 6f 72  64 0d 08 2a 07 52 54 53  |SR osword..*.RTS|
00001150  0d 08 34 44 2e 64 65 6c  61 79 20 20 20 20 20 20  |..4D.delay      |
00001160  20 20 20 20 20 20 20 20  20 5c 44 6f 65 73 20 6e  |         \Does n|
00001170  6f 74 68 69 6e 67 20 66  6f 72 20 61 62 6f 75 74  |othing for about|
00001180  20 61 20 74 68 69 72 64  20 6f 66 20 61 20 73 65  | a third of a se|
00001190  63 6f 6e 64 0d 08 3e 0c  4c 44 58 20 23 26 46 46  |cond..>.LDX #&FF|
000011a0  0d 08 48 0c 4c 44 59 20  23 26 46 46 0d 08 52 0f  |..H.LDY #&FF..R.|
000011b0  2e 64 65 6c 61 79 5f 6c  6f 6f 70 0d 08 5c 07 44  |.delay_loop..\.D|
000011c0  45 59 0d 08 66 0b 4e 4f  50 3a 4e 4f 50 0d 08 70  |EY..f.NOP:NOP..p|
000011d0  12 42 4e 45 20 64 65 6c  61 79 5f 6c 6f 6f 70 0d  |.BNE delay_loop.|
000011e0  08 7a 07 44 45 58 0d 08  84 12 42 4e 45 20 64 65  |.z.DEX....BNE de|
000011f0  6c 61 79 5f 6c 6f 6f 70  0d 08 8e 07 52 54 53 0d  |lay_loop....RTS.|
00001200  08 98 09 2e 74 69 6d 65  0d 08 a2 0e 45 51 55 53  |....time....EQUS|
00001210  20 22 54 49 2e 22 0d 08  ac 0b 45 51 55 42 20 26  | "TI."....EQUB &|
00001220  44 0d 08 b6 08 2e 74 65  6c 0d 08 c0 0d 45 51 55  |D.....tel....EQU|
00001230  53 20 22 42 2e 22 0d 08  ca 0b 45 51 55 42 20 26  |S "B."....EQUB &|
00001240  44 0d 08 d4 05 5d 0d 08  de 0b ed 20 70 61 73 73  |D....]..... pass|
00001250  25 0d 08 e8 05 e1 0d 08  f2 05 3a 0d 08 fc 13 dd  |%.........:.....|
00001260  20 f2 69 6e 73 74 72 75  63 74 69 6f 6e 73 0d 09  | .instructions..|
00001270  06 05 3a 0d 09 10 05 db  0d 09 1a 2a f1 20 bd 31  |..:........*. .1|
00001280  34 31 bd 31 33 30 22 20  20 20 20 20 53 65 74 63  |41.130"     Setc|
00001290  6c 6f 63 6b 20 49 6e 73  74 72 75 63 74 69 6f 6e  |lock Instruction|
000012a0  73 22 0d 09 24 2a f1 20  bd 31 34 31 bd 31 33 30  |s"..$*. .141.130|
000012b0  22 20 20 20 20 20 53 65  74 63 6c 6f 63 6b 20 49  |"     Setclock I|
000012c0  6e 73 74 72 75 63 74 69  6f 6e 73 22 0d 09 2e 11  |nstructions"....|
000012d0  ef 32 38 2c 30 2c 32 33  2c 33 39 2c 33 0d 09 38  |.28,0,23,39,3..8|
000012e0  2f f1 20 22 53 45 54 43  4c 4f 43 4b 20 67 65 74  |/. "SETCLOCK get|
000012f0  73 20 74 68 65 20 64 61  74 65 20 61 6e 64 20 74  |s the date and t|
00001300  69 6d 65 20 66 72 6f 6d  20 20 20 22 0d 09 42 2f  |ime from   "..B/|
00001310  f1 20 22 43 45 45 46 41  58 20 61 6e 64 20 73 65  |. "CEEFAX and se|
00001320  74 73 20 74 68 65 20 4d  61 73 74 65 72 27 73 20  |ts the Master's |
00001330  69 6e 74 65 72 6e 61 6c  20 20 22 0d 09 4c 2f f1  |internal  "..L/.|
00001340  20 22 43 4d 4f 53 20 63  61 6c 65 6e 64 65 72 2f  | "CMOS calender/|
00001350  63 6c 6f 63 6b 2e 20 49  74 20 75 73 65 73 20 42  |clock. It uses B|
00001360  42 43 2d 31 20 62 79 20  20 22 0d 09 56 2f f1 20  |BC-1 by  "..V/. |
00001370  22 64 65 66 61 75 6c 74  20 62 75 74 2c 20 69 66  |"default but, if|
00001380  20 69 74 20 63 61 6e 6e  6f 74 20 66 69 6e 64 20  | it cannot find |
00001390  61 6e 79 20 20 20 20 20  22 0d 09 60 2f f1 20 22  |any     "..`/. "|
000013a0  54 65 6c 65 74 65 78 74  20 6f 6e 20 42 42 43 2d  |Teletext on BBC-|
000013b0  31 2c 20 69 74 20 77 69  6c 6c 20 74 72 79 20 42  |1, it will try B|
000013c0  42 43 2d 32 2e 20 20 22  0d 09 6a 2f f1 20 22 49  |BC-2.  "..j/. "I|
000013d0  74 20 69 73 2c 20 6f 66  20 63 6f 75 72 73 65 2c  |t is, of course,|
000013e0  20 6f 6e 6c 79 20 6f 66  20 76 61 6c 75 65 20 74  | only of value t|
000013f0  6f 20 20 20 20 20 22 0d  09 74 2a f1 20 22 75 73  |o     "..t*. "us|
00001400  65 72 73 20 6f 66 20 74  68 65 20 4d 61 73 74 65  |ers of the Maste|
00001410  72 20 61 6e 64 20 73 6f  20 75 73 65 20 68 61 73  |r and so use has|
00001420  22 0d 09 7e 2f f1 20 22  62 65 65 6e 20 6d 61 64  |"..~/. "been mad|
00001430  65 20 6f 66 20 66 61 63  69 6c 69 74 69 65 73 20  |e of facilities |
00001440  70 72 6f 76 69 64 65 64  20 6f 6e 6c 79 20 20 22  |provided only  "|
00001450  0d 09 88 2f f1 20 22 6f  6e 20 74 68 61 74 20 6d  |.../. "on that m|
00001460  61 63 68 69 6e 65 2e 20  54 68 65 20 70 72 6f 67  |achine. The prog|
00001470  72 61 6d 20 75 73 65 73  20 20 20 20 20 20 22 0d  |ram uses      ".|
00001480  09 92 2f f1 20 22 4f 53  57 4f 52 44 20 72 6f 75  |../. "OSWORD rou|
00001490  74 69 6e 65 73 20 70 72  6f 76 69 64 65 64 20 62  |tines provided b|
000014a0  79 20 74 68 65 20 6e 65  77 20 42 42 43 22 0d 09  |y the new BBC"..|
000014b0  9c 2f f1 20 22 41 54 53  20 52 4f 4d 2e 20 49 74  |./. "ATS ROM. It|
000014c0  20 69 73 20 6e 6f 74 20  63 6f 6d 70 61 74 69 62  | is not compatib|
000014d0  6c 65 20 77 69 74 68 20  54 46 53 2e 22 0d 09 a6  |le with TFS."...|
000014e0  2f f1 20 22 20 20 20 54  68 69 73 20 42 61 73 69  |/. "   This Basi|
000014f0  63 20 70 72 6f 67 72 61  6d 20 77 69 6c 6c 20 67  |c program will g|
00001500  65 6e 65 72 61 74 65 20  74 68 65 22 0d 09 b0 2f  |enerate the".../|
00001510  f1 20 22 6d 61 63 68 69  6e 65 20 63 6f 64 65 20  |. "machine code |
00001520  72 6f 75 74 69 6e 65 20  53 45 54 43 4c 4f 43 4b  |routine SETCLOCK|
00001530  2e 20 59 6f 75 20 77 69  6c 6c 22 0d 09 ba 2f f1  |. You will".../.|
00001540  20 22 62 65 20 61 62 6c  65 20 74 6f 20 63 68 6f  | "be able to cho|
00001550  6f 73 65 20 77 68 65 72  65 20 69 74 20 77 69 6c  |ose where it wil|
00001560  6c 20 72 75 6e 20 69 6e  20 22 0d 09 c4 2f f1 20  |l run in ".../. |
00001570  22 6d 65 6d 6f 72 79 2e  20 54 68 65 20 66 69 6c  |"memory. The fil|
00001580  65 6e 61 6d 65 20 67 69  76 65 6e 20 74 6f 20 74  |ename given to t|
00001590  68 65 20 63 6f 64 65 20  22 0d 09 ce 2f f1 20 22  |he code ".../. "|
000015a0  77 69 6c 6c 20 64 65 70  65 6e 64 20 6f 6e 20 74  |will depend on t|
000015b0  68 65 20 66 69 6c 69 6e  67 20 73 79 73 74 65 6d  |he filing system|
000015c0  20 79 6f 75 20 20 20 22  0d 09 d8 2c f1 20 22 61  | you   "...,. "a|
000015d0  72 65 20 75 73 69 6e 67  20 61 74 20 74 68 65 20  |re using at the |
000015e0  6d 6f 6d 65 6e 74 2c 20  61 73 20 77 69 6c 6c 20  |moment, as will |
000015f0  74 68 65 22 0d 09 e2 2d  f1 20 22 63 68 6f 69 63  |the"...-. "choic|
00001600  65 20 6f 66 20 61 73 73  65 6d 62 6c 79 20 61 64  |e of assembly ad|
00001610  64 72 65 73 73 65 73 20  6f 66 66 65 72 65 64 2e  |dresses offered.|
00001620  22 0d 09 ec 0a f2 73 70  61 63 65 0d 09 f6 2f f1  |".....space.../.|
00001630  20 22 54 68 65 20 62 65  73 74 20 61 64 64 72 65  | "The best addre|
00001640  73 73 20 66 6f 72 20 6d  6f 73 74 20 75 73 65 72  |ss for most user|
00001650  73 20 77 69 6c 6c 20 62  65 22 0d 0a 00 2f f1 20  |s will be".../. |
00001660  22 26 42 30 30 2e 20 54  68 69 73 20 69 73 20 45  |"&B00. This is E|
00001670  63 6f 6e 65 74 20 77 6f  72 6b 73 70 61 63 65 20  |conet workspace |
00001680  61 6e 64 20 77 69 6c 6c  22 0d 0a 0a 2f f1 20 22  |and will".../. "|
00001690  62 65 20 75 6e 75 73 65  64 20 69 6e 20 74 68 65  |be unused in the|
000016a0  20 6d 61 6a 6f 72 69 74  79 20 6f 66 20 63 61 73  | majority of cas|
000016b0  65 73 2e 20 49 66 20 22  0d 0a 14 2f f1 20 22 79  |es. If ".../. "y|
000016c0  6f 75 20 61 72 65 20 75  73 69 6e 67 20 74 68 65  |ou are using the|
000016d0  20 6e 65 74 77 6f 72 6b  20 66 61 63 69 6c 69 74  | network facilit|
000016e0  79 20 74 68 65 6e 22 0d  0a 1e 2f f1 20 22 26 39  |y then".../. "&9|
000016f0  30 30 20 69 73 20 70 72  6f 62 61 62 6c 79 20 74  |00 is probably t|
00001700  68 65 20 62 65 73 74 20  70 6c 61 63 65 20 74 6f  |he best place to|
00001710  20 70 75 74 20 22 0d 0a  28 2f f1 20 22 74 68 65  | put "..(/. "the|
00001720  20 72 6f 75 74 69 6e 65  2e 20 54 68 69 73 20 69  | routine. This i|
00001730  73 20 74 68 65 20 63 61  73 73 65 74 74 65 2f 52  |s the cassette/R|
00001740  53 34 32 33 22 0d 0a 32  2f f1 20 22 69 6e 70 75  |S423"..2/. "inpu|
00001750  74 2f 6f 75 74 70 75 74  20 61 72 65 61 2e 20 49  |t/output area. I|
00001760  74 27 73 20 61 6c 73 6f  20 75 73 65 64 20 62 79  |t's also used by|
00001770  20 20 20 22 0d 0a 3c 2f  f1 20 22 73 6f 75 6e 64  |   "..</. "sound|
00001780  20 65 6e 76 65 6c 6f 70  65 73 20 35 2d 31 36 20  | envelopes 5-16 |
00001790  61 6e 64 20 61 6e 79 20  73 70 65 65 63 68 20 20  |and any speech  |
000017a0  20 20 22 0d 0a 46 2f f1  20 22 75 70 67 72 61 64  |  "..F/. "upgrad|
000017b0  65 20 77 68 69 63 68 20  6d 61 79 20 62 65 20 70  |e which may be p|
000017c0  72 65 73 65 6e 74 2e 20  49 66 20 74 68 65 73 65  |resent. If these|
000017d0  20 22 0d 0a 50 2f f1 20  22 74 77 6f 20 61 6c 74  | "..P/. "two alt|
000017e0  65 72 6e 61 74 69 76 65  73 20 64 6f 6e 27 74 20  |ernatives don't |
000017f0  73 75 69 74 20 79 6f 75  20 6d 61 79 20 20 20 20  |suit you may    |
00001800  22 0d 0a 5a 2f f1 20 22  61 73 73 65 6d 62 6c 65  |"..Z/. "assemble|
00001810  20 74 68 65 20 72 6f 75  74 69 6e 65 20 74 6f 20  | the routine to |
00001820  72 75 6e 20 61 6e 79 77  68 65 72 65 20 20 20 22  |run anywhere   "|
00001830  0d 0a 64 2f f1 20 22 62  75 74 20 64 6f 6e 27 74  |..d/. "but don't|
00001840  20 65 78 70 65 63 74 20  73 65 6e 73 69 62 6c 65  | expect sensible|
00001850  20 72 65 73 75 6c 74 73  20 69 66 20 20 20 22 0d  | results if   ".|
00001860  0a 6e 2f f1 20 22 79 6f  75 20 70 75 74 20 69 74  |.n/. "you put it|
00001870  20 73 6f 6d 65 77 68 65  72 65 20 64 61 66 74 2e  | somewhere daft.|
00001880  20 20 20 20 20 20 20 20  20 20 20 20 20 22 0d 0a  |             "..|
00001890  78 0a f2 73 70 61 63 65  0d 0a 82 2f f1 20 22 44  |x..space.../. "D|
000018a0  69 73 63 20 75 73 65 72  73 20 73 68 6f 75 6c 64  |isc users should|
000018b0  20 6b 65 65 70 20 74 68  65 20 70 72 6f 67 72 61  | keep the progra|
000018c0  6d 20 69 6e 20 20 22 0d  0a 8c 2f f1 20 22 74 68  |m in  ".../. "th|
000018d0  65 20 63 75 72 72 65 6e  74 20 64 69 72 65 63 74  |e current direct|
000018e0  6f 72 79 20 6f 72 20 6c  69 62 72 61 72 79 20 61  |ory or library a|
000018f0  6e 64 20 20 20 22 0d 0a  96 2f f1 20 22 63 61 6c  |nd   ".../. "cal|
00001900  6c 20 69 74 20 77 69 74  68 20 2a 3c 66 69 6c 65  |l it with *<file|
00001910  6e 61 6d 65 3e 2e 20 54  61 70 65 20 75 73 65 72  |name>. Tape user|
00001920  73 20 20 20 22 0d 0a a0  21 f1 20 22 73 68 6f 75  |s   "...!. "shou|
00001930  6c 64 20 75 73 65 20 2a  52 55 4e 20 53 45 54 43  |ld use *RUN SETC|
00001940  4c 4f 43 4b 2e 22 0d 0a  aa 2f f1 20 27 22 20 20  |LOCK.".../. '"  |
00001950  20 45 72 72 6f 72 20 6d  65 73 73 61 67 65 73 20  | Error messages |
00001960  77 69 6c 6c 20 62 65 20  67 69 76 65 6e 20 69 66  |will be given if|
00001970  20 74 68 65 22 0d 0a b4  2f f1 20 22 63 6c 6f 63  | the".../. "cloc|
00001980  6b 20 63 61 6e 6e 6f 74  20 62 65 20 72 65 73 65  |k cannot be rese|
00001990  74 2e 20 54 68 65 20 72  6f 75 74 69 6e 65 20 63  |t. The routine c|
000019a0  61 6e 20 22 0d 0a be 2f  f1 20 22 62 65 20 72 65  |an ".../. "be re|
000019b0  2d 72 75 6e 20 75 73 69  6e 67 20 43 41 4c 4c 20  |-run using CALL |
000019c0  26 3c 61 64 64 72 65 73  73 3e 20 69 66 20 79 6f  |&<address> if yo|
000019d0  75 20 22 0d 0a c8 2f f1  20 22 77 69 73 68 2e 20  |u ".../. "wish. |
000019e0  54 68 69 73 20 6d 61 79  20 62 65 20 75 73 65 66  |This may be usef|
000019f0  75 6c 20 69 66 20 79 6f  75 20 61 72 65 20 20 20  |ul if you are   |
00001a00  20 22 0d 0a d2 13 f1 20  22 75 73 69 6e 67 20 74  | "..... "using t|
00001a10  61 70 65 2e 22 0d 0a dc  2f f1 20 27 22 20 20 20  |ape.".../. '"   |
00001a20  49 66 20 74 68 65 20 63  6c 6f 63 6b 20 68 61 73  |If the clock has|
00001a30  20 62 65 65 6e 20 63 6f  72 72 65 63 74 6c 79 20  | been correctly |
00001a40  20 20 20 22 0d 0a e6 2f  f1 20 22 72 65 73 65 74  |   ".../. "reset|
00001a50  20 61 20 2a 54 49 4d 45  20 63 6f 6d 6d 61 6e 64  | a *TIME command|
00001a60  20 69 73 20 69 73 73 75  65 64 20 20 20 20 20 20  | is issued      |
00001a70  20 20 22 0d 0a f0 2f f1  20 22 72 65 73 75 6c 74  |  ".../. "result|
00001a80  69 6e 67 20 69 6e 20 74  68 65 20 63 6f 6e 74 65  |ing in the conte|
00001a90  6e 74 73 20 6f 66 20 74  68 65 20 43 4d 4f 53 20  |nts of the CMOS |
00001aa0  20 22 0d 0a fa 2f f1 20  22 63 6c 6f 63 6b 20 62  | ".../. "clock b|
00001ab0  65 69 6e 67 20 70 72 69  6e 74 65 64 20 6f 75 74  |eing printed out|
00001ac0  20 61 73 20 75 73 75 61  6c 2e 20 20 20 20 20 20  | as usual.      |
00001ad0  22 0d 0b 04 0a f2 73 70  61 63 65 0d 0b 0e 2b f1  |".....space...+.|
00001ae0  20 22 54 68 65 20 6e 65  78 74 20 70 61 72 74 20  | "The next part |
00001af0  6f 66 20 74 68 69 73 20  70 72 6f 67 72 61 6d 20  |of this program |
00001b00  69 73 20 61 20 22 0d 0b  18 2f f1 20 22 64 65 6d  |is a ".../. "dem|
00001b10  6f 6e 73 74 72 61 74 69  6f 6e 20 6f 66 20 53 45  |onstration of SE|
00001b20  54 43 4c 4f 43 4b 2e 20  54 68 65 20 43 4d 4f 53  |TCLOCK. The CMOS|
00001b30  20 20 20 20 22 0d 0b 22  2f f1 20 22 63 6c 6f 63  |    ".."/. "cloc|
00001b40  6b 20 63 61 6e 20 62 65  20 73 63 72 61 6d 62 6c  |k can be scrambl|
00001b50  65 64 20 61 6e 64 20 74  68 65 6e 20 72 65 73 65  |ed and then rese|
00001b60  74 20 20 22 0d 0b 2c 2f  f1 20 22 66 72 6f 6d 20  |t  "..,/. "from |
00001b70  43 45 45 46 41 58 2e 20  28 46 6f 6c 6c 6f 77 20  |CEEFAX. (Follow |
00001b80  6f 6e 2d 73 63 72 65 65  6e 20 20 20 20 20 20 20  |on-screen       |
00001b90  20 20 22 0d 0b 36 16 f1  20 22 69 6e 73 74 72 75  |  "..6.. "instru|
00001ba0  63 74 69 6f 6e 73 2e 29  22 0d 0b 40 2f f1 20 27  |ctions.)"..@/. '|
00001bb0  22 20 20 54 68 65 20 43  45 45 46 41 58 20 68 65  |"  The CEEFAX he|
00001bc0  61 64 65 72 20 69 73 20  64 69 73 70 6c 61 79 65  |ader is displaye|
00001bd0  64 20 66 6f 72 20 20 22  0d 0b 4a 2f f1 20 22 72  |d for  "..J/. "r|
00001be0  65 66 65 72 65 6e 63 65  20 74 68 72 6f 75 67 68  |eference through|
00001bf0  6f 75 74 20 74 68 65 20  64 65 6d 6f 6e 73 74 72  |out the demonstr|
00001c00  61 74 69 6f 6e 2e 22 0d  0b 54 2f f1 20 22 44 6f  |ation."..T/. "Do|
00001c10  20 6e 6f 74 20 62 65 20  70 75 74 20 6f 66 66 20  | not be put off |
00001c20  62 79 20 74 68 65 20 77  61 79 20 74 68 65 20 43  |by the way the C|
00001c30  4d 4f 53 20 20 22 0d 0b  5e 2f f1 20 22 63 6c 6f  |MOS  "..^/. "clo|
00001c40  63 6b 20 61 70 70 65 61  72 73 20 74 6f 20 6c 65  |ck appears to le|
00001c50  61 64 20 43 45 45 46 41  58 2e 20 53 45 54 43 4c  |ad CEEFAX. SETCL|
00001c60  4f 43 4b 20 22 0d 0b 68  2f f1 20 22 75 73 65 73  |OCK "..h/. "uses|
00001c70  20 74 68 65 20 54 65 6c  65 76 69 73 69 6f 6e 20  | the Television |
00001c80  53 65 72 76 69 63 65 20  44 61 74 61 20 50 61 63  |Service Data Pac|
00001c90  6b 65 74 22 0d 0b 72 2f  f1 20 22 74 6f 20 73 65  |ket"..r/. "to se|
00001ca0  74 20 74 68 65 20 63 6c  6f 63 6b 20 61 6e 64 20  |t the clock and |
00001cb0  69 73 20 6d 6f 72 65 20  61 63 63 75 72 61 74 65  |is more accurate|
00001cc0  20 20 22 0d 0b 7c 2f f1  20 22 74 68 61 6e 20 74  |  "..|/. "than t|
00001cd0  68 65 20 68 65 61 64 65  72 2e 20 20 20 20 20 20  |he header.      |
00001ce0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001cf0  20 22 0d 0b 86 0a f2 73  70 61 63 65 0d 0b 90 2f  | ".....space.../|
00001d00  f1 20 27 22 20 20 54 6f  20 6c 65 61 76 65 20 74  |. '"  To leave t|
00001d10  68 65 20 64 65 6d 6f 6e  73 74 72 61 74 69 6f 6e  |he demonstration|
00001d20  20 70 72 65 73 73 20 66  32 2e 22 0d 0b 9a 2f f1  | press f2.".../.|
00001d30  20 22 54 68 65 6e 20 66  6f 6c 6c 6f 77 20 74 68  | "Then follow th|
00001d40  65 20 64 69 72 65 63 74  69 6f 6e 73 20 74 6f 20  |e directions to |
00001d50  67 65 6e 65 72 61 74 65  20 22 0d 0b a4 2f f1 20  |generate ".../. |
00001d60  22 53 45 54 43 4c 4f 43  4b 20 69 74 73 65 6c 66  |"SETCLOCK itself|
00001d70  20 61 6e 64 20 73 61 76  65 20 69 74 20 74 6f 20  | and save it to |
00001d80  79 6f 75 72 20 20 20 20  22 0d 0b ae 2f f1 20 22  |your    ".../. "|
00001d90  63 75 72 72 65 6e 74 20  66 69 6c 69 6e 67 20 73  |current filing s|
00001da0  79 73 74 65 6d 2e 20 49  66 20 79 6f 75 20 61 72  |ystem. If you ar|
00001db0  65 20 75 73 69 6e 67 22  0d 0b b8 2f f1 20 22 74  |e using".../. "t|
00001dc0  68 65 20 52 4f 4d 20 66  69 6c 69 6e 67 20 73 79  |he ROM filing sy|
00001dd0  73 74 65 6d 20 6f 72 20  54 46 53 20 74 68 65 20  |stem or TFS the |
00001de0  20 20 20 20 20 20 22 0d  0b c2 2f f1 20 22 70 72  |      ".../. "pr|
00001df0  6f 67 72 61 6d 20 77 69  6c 6c 20 6e 6f 74 20 62  |ogram will not b|
00001e00  65 20 73 61 76 65 64 2e  20 20 20 20 20 20 20 20  |e saved.        |
00001e10  20 20 20 20 20 22 0d 0b  cc 2f f1 20 27 22 20 20  |     ".../. '"  |
00001e20  54 68 65 20 70 72 6f 67  72 61 6d 20 63 6f 6e 74  |The program cont|
00001e30  61 69 6e 73 20 6d 61 6e  79 20 6e 6f 74 65 73 20  |ains many notes |
00001e40  73 6f 20 20 22 0d 0b d6  2f f1 20 22 79 6f 75 20  |so  ".../. "you |
00001e50  73 68 6f 75 6c 64 20 62  65 20 61 62 6c 65 20 74  |should be able t|
00001e60  6f 20 61 64 61 70 74 20  69 74 2e 20 41 6e 79 20  |o adapt it. Any |
00001e70  20 20 20 22 0d 0b e0 2f  f1 20 22 63 6f 6d 6d 65  |   ".../. "comme|
00001e80  6e 74 73 20 77 6f 75 6c  64 20 62 65 20 77 65 6c  |nts would be wel|
00001e90  63 6f 6d 65 20 76 69 61  20 50 52 45 53 54 45 4c  |come via PRESTEL|
00001ea0  20 20 22 0d 0b ea 1a f1  20 22 6d 61 69 6c 62 6f  |  "..... "mailbo|
00001eb0  78 20 30 31 32 33 37 33  37 39 37 2e 22 0d 0b f4  |x 012373797."...|
00001ec0  0a f2 73 70 61 63 65 0d  0b fe 05 e1 0d 0c 08 05  |..space.........|
00001ed0  3a 0d 0c 12 0c dd 20 f2  73 70 61 63 65 0d 0c 1c  |:..... .space...|
00001ee0  05 3a 0d 0c 26 2d f1 20  8a 35 2c 31 39 29 bd 31  |.:..&-. .5,19).1|
00001ef0  33 31 22 50 72 65 73 73  20 53 50 41 43 45 20 42  |31"Press SPACE B|
00001f00  41 52 20 74 6f 20 63 6f  6e 74 69 6e 75 65 22 0d  |AR to continue".|
00001f10  0c 30 0e f5 20 fd 20 a6  28 2d 39 39 29 0d 0c 3a  |.0.. . .(-99)..:|
00001f20  09 2a 46 58 31 35 0d 0c  44 05 db 0d 0c 4e 05 e1  |.*FX15..D....N..|
00001f30  0d 0c 58 05 3a 0d 0c 62  0b dd 20 f2 64 65 6d 6f  |..X.:..b.. .demo|
00001f40  0d 0c 6c 05 3a 0d 0c 76  10 ee 20 85 20 f2 65 72  |..l.:..v.. . .er|
00001f50  72 6f 72 3a e0 0d 0c 80  07 ef 32 36 0d 0c 8a 05  |ror:......26....|
00001f60  db 0d 0c 94 1d f1 20 8a  30 2c 30 29 bd 31 33 34  |...... .0,0).134|
00001f70  22 53 43 4c 4f 43 4b 22  3b bd 31 33 35 3b 0d 0c  |"SCLOCK";.135;..|
00001f80  9e 0a 2a 54 54 58 4f 4e  0d 0c a8 08 2a 48 4f 4e  |..*TTXON....*HON|
00001f90  0d 0c b2 0e 2a 46 58 32  32 35 2c 32 34 30 0d 0c  |....*FX225,240..|
00001fa0  bc 0a f2 63 5f 6f 66 66  0d 0c c6 2b f1 20 8a 36  |...c_off...+. .6|
00001fb0  2c 32 29 bd 31 34 31 bd  31 33 31 22 53 65 74 63  |,2).141.131"Setc|
00001fc0  6c 6f 63 6b 20 64 65 6d  6f 6e 73 74 72 61 74 69  |lock demonstrati|
00001fd0  6f 6e 22 0d 0c d0 29 f1  20 8a 36 29 bd 31 34 31  |on"...). .6).141|
00001fe0  bd 31 33 31 22 53 65 74  63 6c 6f 63 6b 20 64 65  |.131"Setclock de|
00001ff0  6d 6f 6e 73 74 72 61 74  69 6f 6e 22 0d 0c da 26  |monstration"...&|
00002000  f1 20 8a 39 2c 37 29 bd  31 34 31 bd 31 33 33 22  |. .9,7).141.133"|
00002010  43 4d 4f 53 20 43 6c 6f  63 6b 20 72 65 61 64 73  |CMOS Clock reads|
00002020  3a 22 0d 0c e4 24 f1 20  8a 39 29 bd 31 34 31 bd  |:"...$. .9).141.|
00002030  31 33 33 22 43 4d 4f 53  20 43 6c 6f 63 6b 20 72  |133"CMOS Clock r|
00002040  65 61 64 73 3a 22 0d 0c  ee 17 72 65 64 24 3d bd  |eads:"....red$=.|
00002050  31 32 39 2b bd 31 35 37  2b bd 31 33 35 0d 0c f8  |129+.157+.135...|
00002060  0f 62 6c 61 63 6b 24 3d  bd 31 35 36 0d 0d 02 28  |.black$=.156...(|
00002070  f1 20 8a 31 2c 32 30 29  72 65 64 24 3b 22 66 30  |. .1,20)red$;"f0|
00002080  20 20 22 3b 62 6c 61 63  6b 24 3b 22 20 20 20 20  |  ";black$;"    |
00002090  20 20 22 3b 0d 0d 0c 22  f1 20 72 65 64 24 3b 22  |  ";...". red$;"|
000020a0  66 31 20 20 22 3b 62 6c  61 63 6b 24 3b 22 20 20  |f1  ";black$;"  |
000020b0  20 20 20 20 22 3b 0d 0d  16 18 f1 20 72 65 64 24  |    ";..... red$|
000020c0  3b 22 66 32 20 20 22 3b  62 6c 61 63 6b 24 0d 0d  |;"f2  ";black$..|
000020d0  20 30 f1 20 27 8a 32 29  22 52 65 73 65 74 22 3b  | 0. '.2)"Reset";|
000020e0  8a 31 35 29 22 53 63 72  61 6d 62 6c 65 22 3b 8a  |.15)"Scramble";.|
000020f0  32 39 29 22 45 78 69 74  20 64 65 6d 6f 22 0d 0d  |29)"Exit demo"..|
00002100  2a 05 f5 0d 0d 34 09 2a  46 58 31 35 0d 0d 3e 10  |*....4.*FX15..>.|
00002110  f2 75 70 64 61 74 65 5f  74 69 6d 65 0d 0d 48 17  |.update_time..H.|
00002120  e7 20 41 3d 32 34 30 20  8c 20 f2 73 65 74 63 6c  |. A=240 . .setcl|
00002130  6f 63 6b 0d 0d 52 14 e7  20 41 3d 32 34 31 20 8c  |ock..R.. A=241 .|
00002140  20 f2 75 6e 73 65 74 0d  0d 5c 0b fd 20 41 3d 32  | .unset..\.. A=2|
00002150  34 32 0d 0d 66 09 2a 48  4f 46 46 0d 0d 70 0b 2a  |42..f.*HOFF..p.*|
00002160  54 54 58 4f 46 46 0d 0d  7a 0c 2a 46 58 32 32 35  |TTXOFF..z.*FX225|
00002170  2c 31 0d 0d 84 07 ef 32  36 0d 0d 8e 09 ee 20 85  |,1.....26..... .|
00002180  20 87 0d 0d 98 05 e1 0d  0d a2 05 3a 0d 0d ac 0c  | ..........:....|
00002190  dd 20 f2 75 6e 73 65 74  0d 0d b6 05 3a 0d 0d c0  |. .unset....:...|
000021a0  21 d1 24 3d 22 53 61 74  2c 31 34 20 4d 61 72 20  |!.$="Sat,14 Mar |
000021b0  31 39 38 32 2e 31 30 3a  31 30 3a 31 30 22 0d 0d  |1982.10:10:10"..|
000021c0  ca 05 e1 0d 0d d4 05 3a  0d 0d de 0c dd 20 f2 63  |.......:..... .c|
000021d0  5f 6f 66 66 0d 0d e8 05  3a 0d 0d f2 14 ef 32 33  |_off....:.....23|
000021e0  2c 31 2c 30 3b 30 3b 30  3b 30 3b 30 3b 0d 0d fc  |,1,0;0;0;0;0;...|
000021f0  05 e1 0d 0e 06 05 3a 0d  0e 10 0b dd 20 f2 63 5f  |......:..... .c_|
00002200  6f 6e 0d 0e 1a 05 3a 0d  0e 24 14 ef 32 33 2c 31  |on....:..$..23,1|
00002210  2c 31 3b 30 3b 30 3b 30  3b 30 3b 0d 0e 2e 05 e1  |,1;0;0;0;0;.....|
00002220  0d 0e 38 05 3a 0d 0e 42  12 dd 20 f2 75 70 64 61  |..8.:..B.. .upda|
00002230  74 65 5f 74 69 6d 65 0d  0e 4c 05 3a 0d 0e 56 05  |te_time..L.:..V.|
00002240  f5 0d 0e 60 16 f1 20 8a  35 2c 39 29 bd 31 34 31  |...`.. .5,9).141|
00002250  bd 31 33 34 3b 91 24 0d  0e 6a 14 f1 20 8a 35 29  |.134;.$..j.. .5)|
00002260  bd 31 34 31 bd 31 33 34  3b 91 24 0d 0e 74 0d fd  |.141.134;.$..t..|
00002270  20 96 28 2d 31 29 3e 30  0d 0e 7e 07 41 3d a5 0d  | .(-1)>0..~.A=..|
00002280  0e 88 05 e1 0d 0e 92 05  3a 0d 0e 9c 0f dd 20 f2  |........:..... .|
00002290  73 65 74 63 6c 6f 63 6b  0d 0e a6 05 3a 0d 0e b0  |setclock....:...|
000022a0  2d f1 20 8a 37 2c 35 29  72 65 64 24 3b 22 53 45  |-. .7,5)red$;"SE|
000022b0  54 54 49 4e 47 20 43 4d  4f 53 20 43 4c 4f 43 4b  |TTING CMOS CLOCK|
000022c0  20 20 22 3b 62 6c 61 63  6b 24 0d 0e ba 2f f1 20  |  ";black$.../. |
000022d0  8a 35 2c 31 33 29 bd 31  34 31 bd 31 33 30 22 43  |.5,13).141.130"C|
000022e0  4d 4f 53 20 43 6c 6f 63  6b 20 6c 61 73 74 20 72  |MOS Clock last r|
000022f0  65 73 65 74 20 61 74 3a  22 0d 0e c4 2d f1 20 8a  |eset at:"...-. .|
00002300  35 29 bd 31 34 31 bd 31  33 30 22 43 4d 4f 53 20  |5).141.130"CMOS |
00002310  43 6c 6f 63 6b 20 6c 61  73 74 20 72 65 73 65 74  |Clock last reset|
00002320  20 61 74 3a 22 27 0d 0e  ce 13 f1 20 bd 31 33 31  | at:"'..... .131|
00002330  22 20 20 20 20 20 20 22  3b 0d 0e d8 0b d6 20 26  |"      ";..... &|
00002340  37 30 30 30 0d 0e e2 0a  2a 54 54 58 4f 4e 0d 0e  |7000....*TTXON..|
00002350  ec 12 f1 20 8a 36 2c 35  29 3b 89 28 33 30 29 3b  |... .6,5);.(30);|
00002360  0d 0e f6 05 e1 0d 0f 00  05 3a 0d 0f 0a 0c dd 20  |.........:..... |
00002370  f2 65 72 72 6f 72 0d 0f  14 05 3a 0d 0f 1e 0b 2a  |.error....:....*|
00002380  54 54 58 4f 46 46 0d 0f  28 0e e7 20 9f 3d 31 37  |TTXOFF..(.. .=17|
00002390  20 f6 3a e0 0d 0f 32 2f  e7 20 9f 3d 26 46 46 20  | .:...2/. .=&FF |
000023a0  65 72 72 6f 72 24 3d 22  53 6f 72 72 79 2c 20 6e  |error$="Sorry, n|
000023b0  6f 20 54 65 6c 65 74 65  78 74 20 61 64 61 70 74  |o Teletext adapt|
000023c0  6f 72 22 0d 0f 3c 2f e7  20 9f 3d 35 30 20 65 72  |or"..</. .=50 er|
000023d0  72 6f 72 24 3d 22 53 6f  72 72 79 2c 20 61 64 61  |ror$="Sorry, ada|
000023e0  70 74 6f 72 20 73 77 69  74 63 68 65 64 20 6f 66  |ptor switched of|
000023f0  66 22 0d 0f 46 2f e7 20  9f 3d 35 31 20 65 72 72  |f"..F/. .=51 err|
00002400  6f 72 24 3d 22 53 6f 72  72 79 2c 20 6e 6f 74 20  |or$="Sorry, not |
00002410  72 65 63 65 69 76 69 6e  67 20 43 45 45 46 41 58  |receiving CEEFAX|
00002420  22 0d 0f 50 2f e7 20 9f  3d 35 32 20 65 72 72 6f  |"..P/. .=52 erro|
00002430  72 24 3d 22 53 6f 72 72  79 2c 20 63 61 6e 27 74  |r$="Sorry, can't|
00002440  20 66 69 6e 64 20 64 61  74 65 2f 74 69 6d 65 22  | find date/time"|
00002450  0d 0f 5a 16 65 72 72 6f  72 24 3d 65 72 72 6f 72  |..Z.error$=error|
00002460  24 2b 22 20 20 22 0d 0f  64 2d f1 20 8a 31 38 2d  |$+"  "..d-. .18-|
00002470  28 a9 28 65 72 72 6f 72  24 29 2f 32 29 2c 31 36  |(.(error$)/2),16|
00002480  29 72 65 64 24 3b 65 72  72 6f 72 24 3b 62 6c 61  |)red$;error$;bla|
00002490  63 6b 24 0d 0f 6e 12 ef  32 38 2c 30 2c 32 32 2c  |ck$..n..28,0,22,|
000024a0  33 39 2c 31 39 0d 0f 78  05 db 0d 0f 82 07 ef 32  |39,19..x.......2|
000024b0  36 0d 0f 8c 0a f2 73 70  61 63 65 0d 0f 96 11 f2  |6.....space.....|
000024c0  63 6f 6c 6c 65 63 74 5f  64 61 74 61 0d 0f a0 09  |collect_data....|
000024d0  f2 73 61 76 65 0d 0f aa  08 f2 65 6e 64 0d 0f b4  |.save.....end...|
000024e0  05 e1 0d 0f be 05 3a 0d  0f c8 13 dd 20 f2 63 6f  |......:..... .co|
000024f0  6c 6c 65 63 74 5f 64 61  74 61 0d 0f d2 05 3a 0d  |llect_data....:.|
00002500  0f dc 05 db 0d 0f e6 21  f1 20 bd 31 34 31 bd 31  |.......!. .141.1|
00002510  33 34 8a 31 32 29 22 53  61 76 65 20 53 45 54 43  |34.12)"Save SETC|
00002520  4c 4f 43 4b 22 0d 0f f0  21 f1 20 bd 31 34 31 bd  |LOCK"...!. .141.|
00002530  31 33 34 8a 31 32 29 22  53 61 76 65 20 53 45 54  |134.12)"Save SET|
00002540  43 4c 4f 43 4b 22 0d 0f  fa 11 ef 32 38 2c 30 2c  |CLOCK".....28,0,|
00002550  32 32 2c 33 39 2c 33 0d  10 04 13 66 69 6c 65 25  |22,39,3....file%|
00002560  3d a4 66 69 6c 65 5f 73  79 73 0d 10 0e 17 e7 20  |=.file_sys..... |
00002570  66 69 6c 65 25 3d 30 20  f2 6e 6f 66 69 6c 65 3a  |file%=0 .nofile:|
00002580  e1 0d 10 18 1f e7 20 66  69 6c 65 25 3d 31 20 84  |...... file%=1 .|
00002590  20 66 69 6c 65 25 3d 32  20 f2 74 61 70 65 3a e1  | file%=2 .tape:.|
000025a0  0d 10 22 21 e7 20 66 69  6c 65 25 3d 33 20 84 20  |.."!. file%=3 . |
000025b0  66 69 6c 65 25 3d 36 20  f2 6e 6f 73 61 76 65 3a  |file%=6 .nosave:|
000025c0  e1 0d 10 2c 14 e7 20 66  69 6c 65 25 3d 34 20 f2  |...,.. file%=4 .|
000025d0  64 66 73 3a e1 0d 10 36  23 e7 20 66 69 6c 65 25  |dfs:...6#. file%|
000025e0  3d 35 20 84 20 66 69 6c  65 25 3d 38 20 f2 6e 65  |=5 . file%=8 .ne|
000025f0  74 5f 61 64 66 73 3a e1  0d 10 40 14 e7 20 66 69  |t_adfs:...@.. fi|
00002600  6c 65 25 3d 36 20 f2 74  66 73 3a e1 0d 10 4a 05  |le%=6 .tfs:...J.|
00002610  e1 0d 10 54 05 3a 0d 10  5e 0d dd 20 f2 6e 6f 66  |...T.:..^.. .nof|
00002620  69 6c 65 0d 10 68 05 3a  0d 10 72 32 f1 20 22 54  |ile..h.:..r2. "T|
00002630  68 65 72 65 20 69 73 20  6e 6f 20 66 69 6c 69 6e  |here is no filin|
00002640  67 20 73 79 73 74 65 6d  20 73 65 6c 65 63 74 65  |g system selecte|
00002650  64 2e 20 50 6c 65 61 73  65 22 0d 10 7c 2a f1 20  |d. Please"..|*. |
00002660  22 73 65 6c 65 63 74 20  6f 6e 65 20 61 6e 64 20  |"select one and |
00002670  72 65 2d 72 75 6e 20 74  68 65 20 70 72 6f 67 72  |re-run the progr|
00002680  61 6d 2e 22 0d 10 86 08  f2 65 6e 64 0d 10 90 05  |am.".....end....|
00002690  e1 0d 10 9a 05 3a 0d 10  a4 0b dd 20 f2 74 61 70  |.....:..... .tap|
000026a0  65 0d 10 ae 05 3a 0d 10  b8 3c e7 20 66 69 6c 65  |e....:...<. file|
000026b0  25 3d 31 20 66 73 24 3d  22 54 41 50 45 20 28 31  |%=1 fs$="TAPE (1|
000026c0  32 30 30 20 42 61 75 64  29 22 20 8b 20 66 73 24  |200 Baud)" . fs$|
000026d0  3d 22 54 41 50 45 20 28  33 30 30 20 42 61 75 64  |="TAPE (300 Baud|
000026e0  29 22 0d 10 c2 18 66 69  6c 65 6e 61 6d 65 24 3d  |)"....filename$=|
000026f0  22 53 45 54 43 4c 4f 43  4b 22 0d 10 cc 0d f2 70  |"SETCLOCK".....p|
00002700  72 69 6e 74 5f 66 73 0d  10 d6 10 f2 67 65 74 5f  |rint_fs.....get_|
00002710  61 64 64 72 65 73 73 0d  10 e0 05 db 0d 10 ea 14  |address.........|
00002720  f1 8a 30 2c 35 29 3b bd  31 33 36 bd 31 32 39 3b  |..0,5);.136.129;|
00002730  0d 10 f4 13 ef 32 38 2c  31 30 2c 32 32 2c 32 37  |.....28,10,22,27|
00002740  2c 31 33 0d 10 fe 05 e1  0d 11 08 05 3a 0d 11 12  |,13.........:...|
00002750  0d dd 20 f2 6e 6f 73 61  76 65 0d 11 1c 2c e7 20  |.. .nosave...,. |
00002760  66 69 6c 65 25 3d 33 20  66 73 24 3d 22 52 4f 4d  |file%=3 fs$="ROM|
00002770  22 20 8b 20 66 73 24 3d  22 54 65 6c 65 73 6f 66  |" . fs$="Telesof|
00002780  74 77 61 72 65 22 0d 11  26 2a f1 20 22 53 6f 72  |tware"..&*. "Sor|
00002790  72 79 2c 20 79 6f 75 20  63 61 6e 6e 6f 74 20 73  |ry, you cannot s|
000027a0  61 76 65 20 74 6f 20 74  68 65 20 22 3b 66 73 24  |ave to the ";fs$|
000027b0  0d 11 30 2d f1 20 27 22  66 69 6c 69 6e 67 20 73  |..0-. '"filing s|
000027c0  79 73 74 65 6d 2e 20 50  6c 65 61 73 65 20 73 65  |ystem. Please se|
000027d0  6c 65 63 74 20 61 6e 6f  74 68 65 72 22 0d 11 3a  |lect another"..:|
000027e0  2b f1 20 27 22 28 65 2e  67 2e 20 64 69 73 63 20  |+. '"(e.g. disc |
000027f0  6f 72 20 74 61 70 65 29  20 61 6e 64 20 72 65 2d  |or tape) and re-|
00002800  72 75 6e 20 74 68 65 22  0d 11 44 11 f1 20 27 22  |run the"..D.. '"|
00002810  70 72 6f 67 72 61 6d 2e  22 0d 11 4e 09 f2 63 5f  |program."..N..c_|
00002820  6f 6e 0d 11 58 07 ef 32  36 0d 11 62 0d f1 20 8a  |on..X..26..b.. .|
00002830  30 2c 31 35 29 3b 0d 11  6c 05 e0 0d 11 76 05 e1  |0,15);..l....v..|
00002840  0d 11 80 05 3a 0d 11 8a  0a dd 20 f2 64 66 73 0d  |....:..... .dfs.|
00002850  11 94 05 3a 0d 11 9e 14  66 73 24 3d 22 44 49 53  |...:....fs$="DIS|
00002860  43 20 28 44 46 53 29 22  0d 11 a8 16 66 69 6c 65  |C (DFS)"....file|
00002870  6e 61 6d 65 24 3d 22 53  45 54 43 4c 4b 22 0d 11  |name$="SETCLK"..|
00002880  b2 0d f2 70 72 69 6e 74  5f 66 73 0d 11 bc 2f f1  |...print_fs.../.|
00002890  20 bd 31 33 31 22 50 6c  65 61 73 65 20 65 6e 74  | .131"Please ent|
000028a0  65 72 20 61 6e 79 20 70  72 65 66 69 78 20 74 6f  |er any prefix to|
000028b0  20 66 69 6c 65 6e 61 6d  65 22 0d 11 c6 30 f1 20  | filename"...0. |
000028c0  bd 31 33 31 22 28 69 2e  65 2e 20 3a 31 2e 57 2e  |.131"(i.e. :1.W.|
000028d0  20 74 6f 20 73 61 76 65  20 66 69 6c 65 20 74 6f  | to save file to|
000028e0  20 64 72 69 76 65 20 31  2c 22 0d 11 d0 2b f1 20  | drive 1,"...+. |
000028f0  bd 31 33 31 22 64 69 72  65 63 74 6f 72 79 20 57  |.131"directory W|
00002900  2e 29 20 50 72 65 73 73  20 3c 52 45 54 55 52 4e  |.) Press <RETURN|
00002910  3e 20 74 6f 22 0d 11 da  19 f1 20 bd 31 33 31 22  |> to"..... .131"|
00002920  66 69 6e 69 73 68 20 65  6e 74 72 79 2e 22 0d 11  |finish entry."..|
00002930  e4 09 f2 63 5f 6f 6e 0d  11 ee 25 f1 20 27 27 8a  |...c_on...%. ''.|
00002940  31 32 29 bd 31 33 34 3b  3a e8 20 22 50 52 45 46  |12).134;:. "PREF|
00002950  49 58 3a 20 22 70 72 65  66 69 78 24 0d 11 f8 0a  |IX: "prefix$....|
00002960  f2 63 5f 6f 66 66 0d 12  02 3a e7 20 a9 28 70 72  |.c_off...:. .(pr|
00002970  65 66 69 78 24 29 3c 3e  30 20 e7 20 c2 70 72 65  |efix$)<>0 . .pre|
00002980  66 69 78 24 2c 31 29 3c  3e 22 2e 22 20 70 72 65  |fix$,1)<>"." pre|
00002990  66 69 78 24 3d 70 72 65  66 69 78 24 2b 22 2e 22  |fix$=prefix$+"."|
000029a0  0d 12 0c 1f 66 69 6c 65  6e 61 6d 65 24 3d 70 72  |....filename$=pr|
000029b0  65 66 69 78 24 2b 66 69  6c 65 6e 61 6d 65 24 0d  |efix$+filename$.|
000029c0  12 16 10 f2 67 65 74 5f  61 64 64 72 65 73 73 0d  |....get_address.|
000029d0  12 20 05 e1 0d 12 2a 05  3a 0d 12 34 0f dd 20 f2  |. ....*.:..4.. .|
000029e0  6e 65 74 5f 61 64 66 73  0d 12 3e 05 3a 0d 12 48  |net_adfs..>.:..H|
000029f0  2f e7 20 66 69 6c 65 25  3d 35 20 66 73 24 3d 22  |/. file%=5 fs$="|
00002a00  4e 45 54 57 4f 52 4b 22  20 8b 20 66 73 24 3d 22  |NETWORK" . fs$="|
00002a10  44 49 53 43 20 28 41 44  46 53 29 22 0d 12 52 18  |DISC (ADFS)"..R.|
00002a20  66 69 6c 65 6e 61 6d 65  24 3d 22 53 45 54 43 4c  |filename$="SETCL|
00002a30  4f 43 4b 22 0d 12 5c 0d  f2 70 72 69 6e 74 5f 66  |OCK"..\..print_f|
00002a40  73 0d 12 66 2e f1 20 bd  31 33 31 22 50 6c 65 61  |s..f.. .131"Plea|
00002a50  73 65 20 65 6e 74 65 72  20 61 6e 79 20 70 61 74  |se enter any pat|
00002a60  68 6e 61 6d 65 20 74 68  61 74 20 79 6f 75 22 0d  |hname that you".|
00002a70  12 70 2d f1 20 bd 31 33  31 22 72 65 71 75 69 72  |.p-. .131"requir|
00002a80  65 20 61 64 64 65 64 20  74 6f 20 74 68 65 20 62  |e added to the b|
00002a90  65 67 69 6e 6e 69 6e 67  20 6f 66 22 0d 12 7a 2b  |eginning of"..z+|
00002aa0  f1 20 bd 31 33 31 22 74  68 65 20 66 69 6c 65 6e  |. .131"the filen|
00002ab0  61 6d 65 2e 20 50 72 65  73 73 20 3c 52 45 54 55  |ame. Press <RETU|
00002ac0  52 4e 3e 20 74 6f 22 0d  12 84 19 f1 20 bd 31 33  |RN> to"..... .13|
00002ad0  31 22 66 69 6e 69 73 68  20 65 6e 74 72 79 2e 22  |1"finish entry."|
00002ae0  0d 12 8e 09 f2 63 5f 6f  6e 0d 12 98 23 f1 20 27  |.....c_on...#. '|
00002af0  27 bd 31 33 34 3b 3a e8  20 22 50 41 54 48 4e 41  |'.134;:. "PATHNA|
00002b00  4d 45 3a 20 22 70 72 65  66 69 78 24 0d 12 a2 0a  |ME: "prefix$....|
00002b10  f2 63 5f 6f 66 66 0d 12  ac 3a e7 20 a9 28 70 72  |.c_off...:. .(pr|
00002b20  65 66 69 78 24 29 3c 3e  30 20 e7 20 c2 70 72 65  |efix$)<>0 . .pre|
00002b30  66 69 78 24 2c 31 29 3c  3e 22 2e 22 20 70 72 65  |fix$,1)<>"." pre|
00002b40  66 69 78 24 3d 70 72 65  66 69 78 24 2b 22 2e 22  |fix$=prefix$+"."|
00002b50  0d 12 b6 1f 66 69 6c 65  6e 61 6d 65 24 3d 70 72  |....filename$=pr|
00002b60  65 66 69 78 24 2b 66 69  6c 65 6e 61 6d 65 24 0d  |efix$+filename$.|
00002b70  12 c0 10 f2 67 65 74 5f  61 64 64 72 65 73 73 0d  |....get_address.|
00002b80  12 ca 05 e1 0d 12 d4 05  3a 0d 12 de 0f dd 20 f2  |........:..... .|
00002b90  70 72 69 6e 74 5f 66 73  0d 12 e8 05 3a 0d 12 f2  |print_fs....:...|
00002ba0  2a f1 20 bd 31 33 31 22  43 75 72 72 65 6e 74 20  |*. .131"Current |
00002bb0  66 69 6c 69 6e 67 20 73  79 73 74 65 6d 3a 22 bd  |filing system:".|
00002bc0  31 33 35 3b 66 73 24 0d  12 fc 37 f1 20 27 bd 31  |135;fs$...7. '.1|
00002bd0  33 31 22 54 68 65 20 70  72 6f 67 72 61 6d 20 77  |31"The program w|
00002be0  69 6c 6c 20 62 65 20 73  61 76 65 64 20 61 73 22  |ill be saved as"|
00002bf0  bd 31 33 35 3b 66 69 6c  65 6e 61 6d 65 24 0d 13  |.135;filename$..|
00002c00  06 11 ef 32 38 2c 30 2c  32 32 2c 33 39 2c 38 0d  |...28,0,22,39,8.|
00002c10  13 10 05 e1 0d 13 1a 05  3a 0d 13 24 12 dd 20 f2  |........:..$.. .|
00002c20  67 65 74 5f 61 64 64 72  65 73 73 0d 13 2e 05 3a  |get_address....:|
00002c30  0d 13 38 33 f1 20 27 27  bd 31 33 30 22 20 20 57  |..83. ''.130"  W|
00002c40  68 65 72 65 20 77 6f 75  6c 64 20 79 6f 75 20 6c  |here would you l|
00002c50  69 6b 65 20 74 68 65 20  72 6f 75 74 69 6e 65 3f  |ike the routine?|
00002c60  22 27 27 0d 13 42 3d e7  20 66 69 6c 65 25 3e 32  |"''..B=. file%>2|
00002c70  20 f1 20 bd 31 33 31 22  31 2e 20 53 65 72 69 61  | . .131"1. Seria|
00002c80  6c 2f 63 61 73 73 65 74  74 65 20 70 6f 72 74 20  |l/cassette port |
00002c90  62 75 66 66 65 72 73 20  28 26 39 30 30 29 22 27  |buffers (&900)"'|
00002ca0  0d 13 4c 28 f1 20 27 bd  31 33 31 22 32 2e 20 45  |..L(. '.131"2. E|
00002cb0  63 6f 6e 65 74 20 77 6f  72 6b 73 70 61 63 65 20  |conet workspace |
00002cc0  28 26 42 30 30 29 22 27  0d 13 56 23 f1 20 27 bd  |(&B00)"'..V#. '.|
00002cd0  31 33 31 22 33 2e 20 41  74 20 61 6e 6f 74 68 65  |131"3. At anothe|
00002ce0  72 20 61 64 64 72 65 73  73 22 27 0d 13 60 05 f5  |r address"'..`..|
00002cf0  0d 13 6a 07 41 3d a5 0d  13 74 2f fd 20 28 66 69  |..j.A=...t/. (fi|
00002d00  6c 65 25 3e 32 20 80 20  28 41 3e 34 38 20 80 20  |le%>2 . (A>48 . |
00002d10  41 3c 35 32 29 29 20 84  20 28 41 3e 34 39 20 80  |A<52)) . (A>49 .|
00002d20  20 41 3c 35 32 29 0d 13  7e 19 e7 20 41 3d 34 39  | A<52)..~.. A=49|
00002d30  20 61 64 64 72 65 73 73  3d 26 39 30 30 3a e1 0d  | address=&900:..|
00002d40  13 88 19 e7 20 41 3d 35  30 20 61 64 64 72 65 73  |.... A=50 addres|
00002d50  73 3d 26 42 30 30 3a e1  0d 13 92 1a e7 20 41 3d  |s=&B00:...... A=|
00002d60  35 31 20 f2 75 73 65 72  5f 61 64 64 72 65 73 73  |51 .user_address|
00002d70  3a e1 0d 13 9c 05 e1 0d  13 a6 05 3a 0d 13 b0 13  |:..........:....|
00002d80  dd 20 f2 75 73 65 72 5f  61 64 64 72 65 73 73 0d  |. .user_address.|
00002d90  13 ba 05 db 0d 13 c4 09  f2 63 5f 6f 6e 0d 13 ce  |.........c_on...|
00002da0  32 f1 20 27 bd 31 33 31  22 50 6c 65 61 73 65 20  |2. '.131"Please |
00002db0  65 6e 74 65 72 20 74 68  65 20 61 64 64 72 65 73  |enter the addres|
00002dc0  73 20 79 6f 75 20 72 65  71 75 69 72 65 3a 22 0d  |s you require:".|
00002dd0  13 d8 14 f1 20 27 8a 31  34 29 bd 31 33 34 3b 22  |.... '.14).134;"|
00002de0  26 22 3b 0d 13 e2 16 61  64 64 72 65 73 73 3d a4  |&";....address=.|
00002df0  68 65 78 5f 69 6e 70 75  74 0d 13 ec 0a f2 63 5f  |hex_input.....c_|
00002e00  6f 66 66 0d 13 f6 05 e1  0d 14 00 05 3a 0d 14 0a  |off.........:...|
00002e10  10 dd 20 a4 68 65 78 5f  69 6e 70 75 74 0d 14 14  |.. .hex_input...|
00002e20  05 3a 0d 14 1e 19 3d ba  28 68 65 78 5f 69 6e 70  |.:....=.(hex_inp|
00002e30  75 74 29 20 80 20 26 46  46 46 46 0d 14 28 05 3a  |ut) . &FFFF..(.:|
00002e40  0d 14 32 1a dd 20 a4 68  65 78 5f 73 74 72 69 6e  |..2.. .hex_strin|
00002e50  67 28 69 6e 74 65 67 65  72 29 0d 14 3c 05 3a 0d  |g(integer)..<.:.|
00002e60  14 46 14 41 25 3d 69 6e  74 65 67 65 72 20 83 20  |.F.A%=integer . |
00002e70  32 35 36 0d 14 50 14 58  25 3d 69 6e 74 65 67 65  |256..P.X%=intege|
00002e80  72 20 81 20 32 35 36 0d  14 5a 10 d6 20 68 65 78  |r . 256..Z.. hex|
00002e90  5f 73 74 72 69 6e 67 0d  14 64 0d 3d 24 68 65 78  |_string..d.=$hex|
00002ea0  61 64 64 72 0d 14 6e 05  3a 0d 14 78 0f dd 20 a4  |addr..n.:..x.. .|
00002eb0  66 69 6c 65 5f 73 79 73  0d 14 82 05 3a 0d 14 8c  |file_sys....:...|
00002ec0  08 41 25 3d 30 0d 14 96  08 59 25 3d 30 0d 14 a0  |.A%=0....Y%=0...|
00002ed0  13 3d ba 28 26 46 46 44  41 29 20 80 20 26 46 46  |.=.(&FFDA) . &FF|
00002ee0  0d 14 aa 05 3a 0d 14 b4  0b dd 20 f2 73 61 76 65  |....:..... .save|
00002ef0  0d 14 be 05 3a 0d 14 c8  21 61 64 64 72 65 73 73  |....:...!address|
00002f00  24 3d a4 68 65 78 5f 73  74 72 69 6e 67 28 61 64  |$=.hex_string(ad|
00002f10  64 72 65 73 73 29 0d 14  d2 45 ff 20 28 22 53 41  |dress)...E. ("SA|
00002f20  56 45 20 22 2b 66 69 6c  65 6e 61 6d 65 24 2b 22  |VE "+filename$+"|
00002f30  20 37 30 30 30 20 2b 32  30 30 20 46 46 46 46 22  | 7000 +200 FFFF"|
00002f40  2b 61 64 64 72 65 73 73  24 2b 22 20 46 46 46 46  |+address$+" FFFF|
00002f50  22 2b 61 64 64 72 65 73  73 24 29 0d 14 dc 05 e1  |"+address$).....|
00002f60  0d 14 e6 05 3a 0d 14 f0  0a dd 20 f2 65 6e 64 0d  |....:..... .end.|
00002f70  14 fa 07 ef 32 36 0d 15  04 05 db 0d 15 0e 30 f1  |....26........0.|
00002f80  20 27 27 27 bd 31 33 31  22 20 20 20 54 68 65 20  | '''.131"   The |
00002f90  70 72 6f 67 72 61 6d 20  68 61 73 20 62 65 65 6e  |program has been|
00002fa0  20 73 61 76 65 64 20 61  73 3a 22 0d 15 18 2a f1  | saved as:"...*.|
00002fb0  20 27 8a 31 39 2d 28 a9  28 66 69 6c 65 6e 61 6d  | '.19-(.(filenam|
00002fc0  65 24 29 2f 32 29 29 bd  31 33 34 3b 66 69 6c 65  |e$)/2)).134;file|
00002fd0  6e 61 6d 65 24 0d 15 22  35 f1 20 27 27 bd 31 33  |name$.."5. ''.13|
00002fe0  31 22 44 6f 6e 27 74 20  66 6f 72 67 65 74 20 74  |1"Don't forget t|
00002ff0  6f 20 73 61 76 65 20 54  48 49 53 20 42 61 73 69  |o save THIS Basi|
00003000  63 20 70 72 6f 67 72 61  6d 22 0d 15 2c 30 f1 20  |c program"..,0. |
00003010  bd 31 33 31 22 20 20 20  74 6f 6f 2c 20 69 74 20  |.131"   too, it |
00003020  63 6f 6e 74 61 69 6e 73  20 74 68 65 20 73 6f 75  |contains the sou|
00003030  72 63 65 20 63 6f 64 65  21 22 0d 15 36 08 f1 20  |rce code!"..6.. |
00003040  27 27 0d 15 40 09 f2 63  5f 6f 6e 0d 15 4a 05 e0  |''..@..c_on..J..|
00003050  0d 15 54 05 e1 0d 15 5e  05 3a 0d 15 68 15 dd 20  |..T....^.:..h.. |
00003060  f2 61 73 73 65 6d 62 6c  65 5f 74 6f 6f 6c 73 0d  |.assemble_tools.|
00003070  15 72 05 3a 0d 15 7c 15  e3 20 70 61 73 73 25 3d  |.r.:..|.. pass%=|
00003080  30 20 b8 20 32 20 88 20  32 0d 15 86 0c 50 25 3d  |0 . 2 . 2....P%=|
00003090  63 6f 64 65 25 0d 15 90  0e 5b 4f 50 54 20 70 61  |code%....[OPT pa|
000030a0  73 73 25 0d 15 9a 0f 2e  68 65 78 5f 73 74 72 69  |ss%.....hex_stri|
000030b0  6e 67 0d 15 a4 30 53 54  41 20 26 37 30 20 20 20  |ng...0STA &70   |
000030c0  20 20 20 20 20 20 20 20  5c 53 61 76 65 20 62 79  |        \Save by|
000030d0  74 65 73 20 66 6f 72 20  66 75 74 75 72 65 20 75  |tes for future u|
000030e0  73 65 0d 15 ae 0b 53 54  58 20 26 37 31 0d 15 b8  |se....STX &71...|
000030f0  0a 4c 44 41 20 23 30 0d  15 c2 32 53 54 41 20 68  |.LDA #0...2STA h|
00003100  65 78 61 64 64 72 20 20  20 20 20 20 20 5c 43 6c  |exaddr       \Cl|
00003110  65 61 72 20 68 65 78 20  73 74 72 69 6e 67 20 74  |ear hex string t|
00003120  6f 20 6e 6f 74 68 69 6e  67 0d 15 cc 11 53 54 41  |o nothing....STA|
00003130  20 68 65 78 61 64 64 72  2b 31 0d 15 d6 11 53 54  | hexaddr+1....ST|
00003140  41 20 68 65 78 61 64 64  72 2b 32 0d 15 e0 11 53  |A hexaddr+2....S|
00003150  54 41 20 68 65 78 61 64  64 72 2b 33 0d 15 ea 34  |TA hexaddr+3...4|
00003160  4c 44 41 20 23 26 44 20  20 20 20 20 20 20 20 20  |LDA #&D         |
00003170  20 20 5c 53 65 74 20 3c  43 52 3e 20 61 74 20 65  |  \Set <CR> at e|
00003180  6e 64 20 6f 66 20 68 65  78 20 73 74 72 69 6e 67  |nd of hex string|
00003190  0d 15 f4 11 53 54 41 20  68 65 78 61 64 64 72 2b  |....STA hexaddr+|
000031a0  34 0d 15 fe 0b 4c 44 41  20 26 37 30 0d 16 08 32  |4....LDA &70...2|
000031b0  80 20 23 26 46 20 20 20  20 20 20 20 20 20 20 20  |. #&F           |
000031c0  5c 46 69 6e 64 20 6c 6f  77 65 72 20 6e 79 62 62  |\Find lower nybb|
000031d0  6c 65 20 6f 66 20 6c 6f  77 20 62 79 74 65 0d 16  |le of low byte..|
000031e0  12 2f 4a 53 52 20 63 6f  6e 76 65 72 74 20 20 20  |./JSR convert   |
000031f0  20 20 20 20 5c 46 69 6e  64 20 97 49 49 20 76 61  |    \Find .II va|
00003200  6c 75 65 20 6f 66 20 6e  79 62 62 6c 65 0d 16 1c  |lue of nybble...|
00003210  26 53 54 41 20 68 65 78  61 64 64 72 2b 33 20 20  |&STA hexaddr+3  |
00003220  20 20 20 5c 53 74 6f 72  65 20 69 6e 20 73 74 72  |   \Store in str|
00003230  69 6e 67 0d 16 26 07 54  58 41 0d 16 30 33 80 20  |ing..&.TXA..03. |
00003240  23 26 46 20 20 20 20 20  20 20 20 20 20 20 5c 46  |#&F           \F|
00003250  69 6e 64 20 6c 6f 77 65  72 20 6e 79 62 62 6c 65  |ind lower nybble|
00003260  20 6f 66 20 68 69 67 68  20 62 79 74 65 0d 16 3a  | of high byte..:|
00003270  1f 4a 53 52 20 63 6f 6e  76 65 72 74 20 20 20 20  |.JSR convert    |
00003280  20 20 20 5c 61 73 20 61  62 6f 76 65 0d 16 44 11  |   \as above..D.|
00003290  53 54 41 20 68 65 78 61  64 64 72 2b 31 0d 16 4e  |STA hexaddr+1..N|
000032a0  35 4c 44 41 20 26 37 30  20 20 20 20 20 20 20 20  |5LDA &70        |
000032b0  20 20 20 5c 46 69 6e 64  20 68 69 67 68 65 72 20  |   \Find higher |
000032c0  6e 79 62 62 6c 65 20 6f  66 20 6c 6f 77 20 62 79  |nybble of low by|
000032d0  74 65 0d 16 58 1b 4c 53  52 20 41 3a 4c 53 52 20  |te..X.LSR A:LSR |
000032e0  41 3a 4c 53 52 20 41 3a  4c 53 52 20 41 0d 16 62  |A:LSR A:LSR A..b|
000032f0  1f 4a 53 52 20 63 6f 6e  76 65 72 74 20 20 20 20  |.JSR convert    |
00003300  20 20 20 5c 61 73 20 61  62 6f 76 65 0d 16 6c 11  |   \as above..l.|
00003310  53 54 41 20 68 65 78 61  64 64 72 2b 32 0d 16 76  |STA hexaddr+2..v|
00003320  36 4c 44 41 20 26 37 31  20 20 20 20 20 20 20 20  |6LDA &71        |
00003330  20 20 20 5c 46 69 6e 64  20 68 69 67 68 65 72 20  |   \Find higher |
00003340  6e 79 62 62 6c 65 20 6f  66 20 68 69 67 68 20 62  |nybble of high b|
00003350  79 74 65 0d 16 80 1b 4c  53 52 20 41 3a 4c 53 52  |yte....LSR A:LSR|
00003360  20 41 3a 4c 53 52 20 41  3a 4c 53 52 20 41 0d 16  | A:LSR A:LSR A..|
00003370  8a 1f 4a 53 52 20 63 6f  6e 76 65 72 74 20 20 20  |..JSR convert   |
00003380  20 20 20 20 5c 61 73 20  61 62 6f 76 65 0d 16 94  |    \as above...|
00003390  0f 53 54 41 20 68 65 78  61 64 64 72 0d 16 9e 07  |.STA hexaddr....|
000033a0  52 54 53 0d 16 a8 42 2e  63 6f 6e 76 65 72 74 20  |RTS...B.convert |
000033b0  20 20 20 20 20 20 20 20  20 5c 53 55 42 52 4f 55  |         \SUBROU|
000033c0  54 49 4e 45 20 72 65 74  75 72 6e 73 20 97 49 49  |TINE returns .II|
000033d0  20 76 61 6c 75 65 20 6f  66 20 6e 79 62 62 6c 65  | value of nybble|
000033e0  20 69 6e 20 41 0d 16 b2  31 43 4d 50 20 23 31 30  | in A...1CMP #10|
000033f0  20 20 20 20 20 20 20 20  20 20 20 5c 49 73 20 6e  |           \Is n|
00003400  79 62 62 6c 65 20 61 6c  70 68 61 3f 20 28 69 2e  |ybble alpha? (i.|
00003410  65 2e 20 3e 39 29 0d 16  bc 33 42 50 4c 20 61 6c  |e. >9)...3BPL al|
00003420  70 68 61 20 20 20 20 20  20 20 20 20 5c 49 66 20  |pha         \If |
00003430  73 6f 2c 20 6a 75 6d 70  20 74 6f 20 61 6c 70 68  |so, jump to alph|
00003440  61 20 72 6f 75 74 69 6e  65 0d 16 c6 38 43 4c 43  |a routine...8CLC|
00003450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00003460  4f 74 68 65 72 77 69 73  65 20 61 64 64 20 34 38  |Otherwise add 48|
00003470  20 74 6f 20 69 74 20 61  6e 64 20 72 65 74 75 72  | to it and retur|
00003480  6e 0d 16 d0 0b 41 44 43  20 23 34 38 0d 16 da 07  |n....ADC #48....|
00003490  52 54 53 0d 16 e4 3c 2e  61 6c 70 68 61 20 20 20  |RTS...<.alpha   |
000034a0  20 20 20 20 20 20 20 20  20 5c 49 74 27 73 20 61  |         \It's a|
000034b0  6c 70 68 61 20 73 6f 20  61 64 64 20 35 35 20 74  |lpha so add 55 t|
000034c0  6f 20 69 74 20 61 6e 64  20 72 65 74 75 72 6e 0d  |o it and return.|
000034d0  16 ee 07 43 4c 43 0d 16  f8 0b 41 44 43 20 23 35  |...CLC....ADC #5|
000034e0  35 0d 17 02 07 52 54 53  0d 17 0c 0e 2e 68 65 78  |5....RTS.....hex|
000034f0  5f 69 6e 70 75 74 0d 17  16 33 4c 44 58 20 23 30  |_input...3LDX #0|
00003500  20 20 20 20 20 20 20 20  20 20 20 5c 53 65 74 20  |           \Set |
00003510  63 68 61 72 61 63 74 65  72 20 63 6f 75 6e 74 65  |character counte|
00003520  72 2f 70 6f 69 6e 74 65  72 0d 17 20 37 2e 67 65  |r/pointer.. 7.ge|
00003530  74 5f 63 68 61 72 20 20  20 20 20 20 20 20 5c 67  |t_char        \g|
00003540  65 74 20 61 20 63 68 61  72 61 63 74 65 72 20 66  |et a character f|
00003550  72 6f 6d 20 69 6e 70 75  74 20 73 74 72 65 61 6d  |rom input stream|
00003560  0d 17 2a 0e 4a 53 52 20  6f 73 72 64 63 68 0d 17  |..*.JSR osrdch..|
00003570  34 2c 42 43 53 20 65 72  72 6f 72 20 20 20 20 20  |4,BCS error     |
00003580  20 20 20 5c 54 72 61 70  20 69 6e 76 61 6c 69 64  |   \Trap invalid|
00003590  20 63 68 61 72 61 63 74  65 72 0d 17 3e 0b 43 4d  | character..>.CM|
000035a0  50 20 23 31 33 0d 17 48  2d 42 45 51 20 65 6e 64  |P #13..H-BEQ end|
000035b0  5f 65 6e 74 72 79 20 20  20 20 5c 44 65 74 65 63  |_entry    \Detec|
000035c0  74 20 61 6e 64 20 61 63  74 20 75 70 6f 6e 20 3c  |t and act upon <|
000035d0  f8 3e 0d 17 52 0c 43 4d  50 20 23 31 32 37 0d 17  |.>..R.CMP #127..|
000035e0  5c 2d 42 45 51 20 64 65  6c 65 74 65 20 20 20 20  |\-BEQ delete    |
000035f0  20 20 20 5c 44 65 74 65  63 74 20 61 6e 64 20 61  |   \Detect and a|
00003600  63 74 20 75 70 6f 6e 20  3c c7 3e 0d 17 66 48 43  |ct upon <.>..fHC|
00003610  4d 50 20 23 34 38 20 20  20 20 20 20 20 20 20 20  |MP #48          |
00003620  5c 52 61 6e 67 65 20 63  68 65 63 6b 2e 20 50 61  |\Range check. Pa|
00003630  73 73 20 6f 6e 6c 79 20  30 2d 39 20 61 6e 64 20  |ss only 0-9 and |
00003640  41 2d 45 20 28 6e 6f 20  6c 6f 77 65 72 20 63 61  |A-E (no lower ca|
00003650  73 65 29 0d 17 70 0c 42  4d 49 20 62 65 65 70 0d  |se)..p.BMI beep.|
00003660  17 7a 0b 43 4d 50 20 23  37 31 0d 17 84 0c 42 50  |.z.CMP #71....BP|
00003670  4c 20 62 65 65 70 0d 17  8e 0b 43 4d 50 20 23 35  |L beep....CMP #5|
00003680  38 0d 17 98 0a 42 4d 49  20 6f 6b 0d 17 a2 0b 43  |8....BMI ok....C|
00003690  4d 50 20 23 36 35 0d 17  ac 0c 42 4d 49 20 62 65  |MP #65....BMI be|
000036a0  65 70 0d 17 b6 07 2e 6f  6b 0d 17 c0 3f 43 50 58  |ep.....ok...?CPX|
000036b0  20 23 34 20 20 20 20 20  20 20 20 20 20 20 5c 44  | #4           \D|
000036c0  65 74 65 63 74 20 73 6e  65 61 6b 79 20 74 72 79  |etect sneaky try|
000036d0  20 61 74 20 65 6e 74 65  72 69 6e 67 20 61 20 35  | at entering a 5|
000036e0  74 68 20 64 69 67 69 74  0d 17 ca 0c 42 45 51 20  |th digit....BEQ |
000036f0  62 65 65 70 0d 17 d4 2c  53 54 41 20 68 65 78 61  |beep...,STA hexa|
00003700  64 64 72 2c 58 20 20 20  20 5c 41 64 64 20 63 68  |ddr,X    \Add ch|
00003710  72 61 63 74 65 72 20 74  6f 20 73 74 72 69 6e 67  |racter to string|
00003720  0d 17 de 2c 49 4e 58 20  20 20 20 20 20 20 20 20  |...,INX         |
00003730  20 20 20 20 20 5c 55 70  64 61 74 65 20 63 6f 75  |     \Update cou|
00003740  6e 74 65 72 2f 70 6f 69  6e 74 65 72 0d 17 e8 2d  |nter/pointer...-|
00003750  4a 53 52 20 6f 73 77 72  63 68 20 20 20 20 20 20  |JSR oswrch      |
00003760  20 5c 50 75 74 20 63 68  61 72 61 63 74 65 72 20  | \Put character |
00003770  6f 6e 20 73 63 72 65 65  6e 0d 17 f2 10 4a 4d 50  |on screen....JMP|
00003780  20 67 65 74 5f 63 68 61  72 0d 17 fc 39 2e 62 65  | get_char...9.be|
00003790  65 70 20 20 20 20 20 20  20 20 20 20 20 20 5c 4d  |ep            \M|
000037a0  61 6b 65 20 61 20 62 65  65 70 20 61 6e 64 20 67  |ake a beep and g|
000037b0  6f 20 62 61 63 6b 20 74  6f 20 67 65 74 5f 63 68  |o back to get_ch|
000037c0  61 72 0d 18 06 0a 4c 44  41 20 23 37 0d 18 10 0e  |ar....LDA #7....|
000037d0  4a 53 52 20 6f 73 77 72  63 68 0d 18 1a 10 4a 4d  |JSR oswrch....JM|
000037e0  50 20 67 65 74 5f 63 68  61 72 0d 18 24 27 2e 65  |P get_char..$'.e|
000037f0  72 72 6f 72 20 20 20 20  20 20 20 20 20 20 20 5c  |rror           \|
00003800  4a 75 6d 70 20 6f 75 74  20 6f 6e 20 65 72 72 6f  |Jump out on erro|
00003810  72 0d 18 2e 07 52 54 53  0d 18 38 24 2e 64 65 6c  |r....RTS..8$.del|
00003820  65 74 65 20 20 20 20 20  20 20 20 20 20 5c 41 63  |ete          \Ac|
00003830  74 69 6f 6e 20 3c c7 3e  20 6b 65 79 0d 18 42 0a  |tion <.> key..B.|
00003840  43 50 58 20 23 30 0d 18  4c 43 42 45 51 20 62 65  |CPX #0..LCBEQ be|
00003850  65 70 20 20 20 20 20 20  20 20 20 5c 49 66 20 6e  |ep         \If n|
00003860  6f 74 68 69 6e 67 20 74  6f 20 64 65 6c 65 74 65  |othing to delete|
00003870  2c 20 62 65 65 70 20 61  6e 64 20 67 6f 20 74 6f  |, beep and go to|
00003880  20 67 65 74 5f 63 68 61  72 0d 18 56 0a 4c 44 41  | get_char..V.LDA|
00003890  20 23 38 0d 18 60 0e 4a  53 52 20 6f 73 77 72 63  | #8..`.JSR oswrc|
000038a0  68 0d 18 6a 0b 4c 44 41  20 23 33 32 0d 18 74 0e  |h..j.LDA #32..t.|
000038b0  4a 53 52 20 6f 73 77 72  63 68 0d 18 7e 0a 4c 44  |JSR oswrch..~.LD|
000038c0  41 20 23 38 0d 18 88 0e  4a 53 52 20 6f 73 77 72  |A #8....JSR oswr|
000038d0  63 68 0d 18 92 07 44 45  58 0d 18 9c 10 4a 4d 50  |ch....DEX....JMP|
000038e0  20 67 65 74 5f 63 68 61  72 0d 18 a6 2d 2e 65 6e  | get_char...-.en|
000038f0  64 5f 65 6e 74 72 79 20  20 20 20 20 20 20 5c 45  |d_entry       \E|
00003900  78 69 74 20 63 6f 6c 6c  65 63 74 69 6f 6e 20 72  |xit collection r|
00003910  6f 75 74 69 6e 65 0d 18  b0 2c 43 50 58 20 23 34  |outine...,CPX #4|
00003920  20 20 20 20 20 20 20 20  20 20 20 5c 41 6c 6c 20  |           \All |
00003930  34 20 63 68 61 72 61 63  74 65 72 73 20 75 73 65  |4 characters use|
00003940  64 3f 0d 18 ba 10 42 45  51 20 65 76 61 6c 75 61  |d?....BEQ evalua|
00003950  74 65 0d 18 c4 2c 43 50  58 20 23 30 20 20 20 20  |te...,CPX #0    |
00003960  20 20 20 20 20 20 20 5c  4e 6f 20 63 68 61 72 61  |       \No chara|
00003970  63 74 65 72 73 20 65 6e  74 65 72 65 64 3f 0d 18  |cters entered?..|
00003980  ce 12 42 45 51 20 71 75  69 63 6b 5f 65 78 69 74  |..BEQ quick_exit|
00003990  0d 18 d8 34 53 54 58 20  26 37 30 20 20 20 20 20  |...4STX &70     |
000039a0  20 20 20 20 20 5c 49 66  20 6e 6f 74 2c 20 70 61  |     \If not, pa|
000039b0  64 20 77 69 74 68 20 6c  65 61 64 69 6e 67 20 7a  |d with leading z|
000039c0  65 72 6f 73 0d 18 e2 0a  4c 44 41 20 23 34 0d 18  |eros....LDA #4..|
000039d0  ec 07 53 45 43 0d 18 f6  31 53 42 43 20 26 37 30  |..SEC...1SBC &70|
000039e0  20 20 20 20 20 20 20 20  20 20 5c 46 69 6e 64 20  |          \Find |
000039f0  68 6f 77 20 6d 61 6e 79  20 73 70 61 63 65 73 20  |how many spaces |
00003a00  74 6f 20 70 61 64 0d 19  00 0b 53 54 41 20 26 37  |to pad....STA &7|
00003a10  30 0d 19 0a 36 44 45 58  20 20 20 20 20 20 20 20  |0...6DEX        |
00003a20  20 20 20 20 20 20 5c 43  68 61 6e 67 65 20 58 20  |      \Change X |
00003a30  66 72 6f 6d 20 63 6f 75  6e 74 65 72 20 74 6f 20  |from counter to |
00003a40  70 6f 69 6e 74 65 72 0d  19 14 07 54 58 41 0d 19  |pointer....TXA..|
00003a50  1e 07 43 4c 43 0d 19 28  0b 41 44 43 20 26 37 30  |..CLC..(.ADC &70|
00003a60  0d 19 32 33 54 41 59 20  20 20 20 20 20 20 20 20  |..23TAY         |
00003a70  20 20 20 20 20 5c 53 65  74 20 59 20 74 6f 20 70  |     \Set Y to p|
00003a80  6f 69 6e 74 20 61 74 20  74 61 72 67 65 74 20 62  |oint at target b|
00003a90  79 74 65 0d 19 3c 38 2e  73 68 69 66 74 20 20 20  |yte..<8.shift   |
00003aa0  20 20 20 20 20 20 20 20  5c 53 68 69 66 74 20 76  |        \Shift v|
00003ab0  61 6c 69 64 20 63 68 61  72 73 20 74 6f 20 65 6e  |alid chars to en|
00003ac0  64 20 6f 66 20 73 74 72  69 6e 67 0d 19 46 11 4c  |d of string..F.L|
00003ad0  44 41 20 68 65 78 61 64  64 72 2c 58 0d 19 50 11  |DA hexaddr,X..P.|
00003ae0  53 54 41 20 68 65 78 61  64 64 72 2c 59 0d 19 5a  |STA hexaddr,Y..Z|
00003af0  07 44 45 59 0d 19 64 07  44 45 58 0d 19 6e 10 42  |.DEY..d.DEX..n.B|
00003b00  4d 49 20 63 6f 6e 74 69  6e 75 65 0d 19 78 0d 4a  |MI continue..x.J|
00003b10  4d 50 20 73 68 69 66 74  0d 19 82 0d 2e 63 6f 6e  |MP shift.....con|
00003b20  74 69 6e 75 65 0d 19 8c  28 4c 44 59 20 23 30 20  |tinue...(LDY #0 |
00003b30  20 20 20 20 20 20 20 20  20 20 20 5c 41 64 64 20  |           \Add |
00003b40  6c 65 61 64 69 6e 67 20  7a 65 72 6f 73 0d 19 96  |leading zeros...|
00003b50  20 4c 44 41 20 23 34 38  20 20 20 20 20 20 20 20  | LDA #48        |
00003b60  20 20 20 5c 28 97 49 49  20 22 30 22 29 0d 19 a0  |   \(.II "0")...|
00003b70  08 2e 70 61 64 0d 19 aa  11 53 54 41 20 68 65 78  |..pad....STA hex|
00003b80  61 64 64 72 2c 59 0d 19  b4 07 49 4e 59 0d 19 be  |addr,Y....INY...|
00003b90  0b 43 50 59 20 26 37 30  0d 19 c8 0b 42 4e 45 20  |.CPY &70....BNE |
00003ba0  70 61 64 0d 19 d2 39 2e  65 76 61 6c 75 61 74 65  |pad...9.evaluate|
00003bb0  20 20 20 20 20 20 20 20  5c 44 65 63 6f 64 65 20  |        \Decode |
00003bc0  68 65 78 20 73 74 72 69  6e 67 20 74 6f 20 32 20  |hex string to 2 |
00003bd0  62 79 74 65 20 69 6e 74  65 67 65 72 0d 19 dc 11  |byte integer....|
00003be0  4c 44 41 20 68 65 78 61  64 64 72 2b 33 0d 19 e6  |LDA hexaddr+3...|
00003bf0  2a 4a 53 52 20 64 65 63  6f 64 65 20 20 20 20 20  |*JSR decode     |
00003c00  20 20 5c 4c 6f 77 20 6e  79 62 62 6c 65 2c 20 6c  |  \Low nybble, l|
00003c10  6f 77 20 62 79 74 65 0d  19 f0 0b 53 54 41 20 26  |ow byte....STA &|
00003c20  37 30 0d 19 fa 2b 4c 44  41 20 68 65 78 61 64 64  |70...+LDA hexadd|
00003c30  72 2b 32 20 20 20 20 5c  68 69 67 68 20 6e 79 62  |r+2    \high nyb|
00003c40  62 6c 65 2c 20 6c 6f 77  20 62 79 74 65 0d 1a 04  |ble, low byte...|
00003c50  0e 4a 53 52 20 64 65 63  6f 64 65 0d 1a 0e 1b 41  |.JSR decode....A|
00003c60  53 4c 20 41 3a 41 53 4c  20 41 3a 41 53 4c 20 41  |SL A:ASL A:ASL A|
00003c70  3a 41 53 4c 20 41 0d 1a  18 07 43 4c 43 0d 1a 22  |:ASL A....CLC.."|
00003c80  3e 41 44 43 20 26 37 30  20 20 20 20 20 20 20 20  |>ADC &70        |
00003c90  20 20 20 5c 41 64 64 20  74 77 6f 20 6e 79 62 62  |   \Add two nybb|
00003ca0  6c 65 73 20 74 6f 67 65  74 68 65 72 20 61 6e 64  |les together and|
00003cb0  20 73 74 6f 72 65 20 69  6e 20 59 0d 1a 2c 07 54  | store in Y..,.T|
00003cc0  41 59 0d 1a 36 2c 4c 44  41 20 68 65 78 61 64 64  |AY..6,LDA hexadd|
00003cd0  72 2b 31 20 20 20 20 20  5c 4c 6f 77 20 6e 79 62  |r+1     \Low nyb|
00003ce0  62 6c 65 2c 20 68 69 67  68 20 62 79 74 65 0d 1a  |ble, high byte..|
00003cf0  40 0e 4a 53 52 20 64 65  63 6f 64 65 0d 1a 4a 0b  |@.JSR decode..J.|
00003d00  53 54 41 20 26 37 30 0d  1a 54 2d 4c 44 41 20 68  |STA &70..T-LDA h|
00003d10  65 78 61 64 64 72 20 20  20 20 20 20 20 5c 48 69  |exaddr       \Hi|
00003d20  67 68 20 6e 79 62 62 6c  65 2c 20 68 69 67 68 20  |gh nybble, high |
00003d30  62 79 74 65 0d 1a 5e 0e  4a 53 52 20 64 65 63 6f  |byte..^.JSR deco|
00003d40  64 65 0d 1a 68 1b 41 53  4c 20 41 3a 41 53 4c 20  |de..h.ASL A:ASL |
00003d50  41 3a 41 53 4c 20 41 3a  41 53 4c 20 41 0d 1a 72  |A:ASL A:ASL A..r|
00003d60  07 43 4c 43 0d 1a 7c 3e  41 44 43 20 26 37 30 20  |.CLC..|>ADC &70 |
00003d70  20 20 20 20 20 20 20 20  20 20 5c 41 64 64 20 74  |          \Add t|
00003d80  77 6f 20 6e 79 62 62 6c  65 73 20 74 6f 67 65 74  |wo nybbles toget|
00003d90  68 65 72 20 61 6e 64 20  73 74 6f 72 65 20 69 6e  |her and store in|
00003da0  20 58 0d 1a 86 07 54 41  58 0d 1a 90 37 54 59 41  | X....TAX...7TYA|
00003db0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00003dc0  4d 6f 76 65 20 6c 6f 77  20 62 79 74 65 20 62 61  |Move low byte ba|
00003dd0  63 6b 20 69 6e 74 6f 20  41 20 26 20 65 78 69 74  |ck into A & exit|
00003de0  0d 1a 9a 07 52 54 53 0d  1a a4 2f 2e 64 65 63 6f  |....RTS.../.deco|
00003df0  64 65 20 20 20 20 20 20  20 20 20 20 20 5c 4e 79  |de           \Ny|
00003e00  62 62 6c 65 20 64 65 63  6f 64 65 20 73 75 62 72  |bble decode subr|
00003e10  6f 75 74 69 6e 65 0d 1a  ae 21 43 4d 50 20 23 35  |outine...!CMP #5|
00003e20  38 20 20 20 20 20 20 20  20 20 20 20 5c 49 73 20  |8           \Is |
00003e30  69 74 20 3e 20 39 3f 0d  1a b8 11 42 50 4c 20 64  |it > 9?....BPL d|
00003e40  65 63 5f 61 6c 70 68 61  0d 1a c2 2a 53 45 43 20  |ec_alpha...*SEC |
00003e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 49  |              \I|
00003e60  66 20 6e 6f 74 2c 20 73  75 62 74 72 61 63 74 20  |f not, subtract |
00003e70  34 38 0d 1a cc 0b 53 42  43 20 23 34 38 0d 1a d6  |48....SBC #48...|
00003e80  07 52 54 53 0d 1a e0 0e  2e 64 65 63 5f 61 6c 70  |.RTS.....dec_alp|
00003e90  68 61 0d 1a ea 34 53 45  43 20 20 20 20 20 20 20  |ha...4SEC       |
00003ea0  20 20 20 20 20 20 20 20  5c 49 66 20 69 74 20 69  |        \If it i|
00003eb0  73 2c 20 73 75 62 74 72  61 63 74 20 35 35 20 28  |s, subtract 55 (|
00003ec0  41 4c 50 48 41 29 0d 1a  f4 0b 53 42 43 20 23 35  |ALPHA)....SBC #5|
00003ed0  35 0d 1a fe 07 52 54 53  0d 1b 08 45 2e 71 75 69  |5....RTS...E.qui|
00003ee0  63 6b 5f 65 78 69 74 20  20 20 20 20 20 20 5c 55  |ck_exit       \U|
00003ef0  73 65 64 20 6f 6e 6c 79  20 69 66 20 6e 6f 20 63  |sed only if no c|
00003f00  68 61 72 61 63 74 65 72  73 20 65 6e 74 65 72 65  |haracters entere|
00003f10  64 20 28 65 73 73 65 6e  74 69 61 6c 29 0d 1b 12  |d (essential)...|
00003f20  0a 4c 44 41 20 23 30 0d  1b 1c 07 54 41 58 0d 1b  |.LDA #0....TAX..|
00003f30  26 07 52 54 53 0d 1b 30  05 5d 0d 1b 3a 0b ed 20  |&.RTS..0.]..:.. |
00003f40  70 61 73 73 25 0d 1b 44  05 e1 0d 1b 4e 05 3a 0d  |pass%..D....N.:.|
00003f50  ff                                                |.|
00003f51
25-12-87/CLKSET.m0
25-12-87/CLKSET.m1
25-12-87/CLKSET.m2
25-12-87/CLKSET.m4
25-12-87/CLKSET.m5