Home » Personal collection » Acorn DFS disks » dfs_box04_disk06b_pilot_one.scp » INTTEST

INTTEST

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 » Personal collection » Acorn DFS disks » dfs_box04_disk06b_pilot_one.scp
Filename: INTTEST
Read OK:
File size: 3460 bytes
Load address: FF1600
Exec address: FF8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10 REM *************************
   20 REM INTTEST - AN INTRODUCTION
   30 REM TO   CONTROL  PROGRAMMING
   40 REM WITH THE PILOT 1  DIGITAL
   50 REM INTERFACE. THE  IMPORTANT
   60 REM PROCEDURES  ARE  NUMBERED
   70 REM FROM 10000 UPWARDS. THESE
   80 REM BEAR NO COPYRIGHT. PLEASE
   90 REM USE THEM FREELY.      DMB
  100 REM *************************
  110 REM V1.0 
  120 REM COPYRIGHT PILOT ONE LTD., 1984
  130 REM *************************
  140 REM ***INITIALISE STRINGS,FLAGS,POINTERS,OPERATING SYSTEM,ETC......***
  150 ARR$=CHR$136+CHR$91+CHR$137:NOA$="   "
  160 FLAG=FALSE
  170 on$=CHR$34+"ON"+CHR$34  
  180 off$=CHR$34+"OFF"+CHR$34 
  190 *FX4,1
  200 *FX229,1 
  210 *FX18
  220 MODE7:VDU23,1,0;0;0;0;
  230 PROCcover
  240 REM ***MAIN PROGRAM LOOP BEGINS HERE***
  250 REPEAT
  260 CLS:PROCmessage("CONTROL PROGRAMMING - MENU","�","�")
  270 PROCprocmenu:PROCinstruct
  280 V=0:H=0:PROCfind(30,4,1,9,0,2)
  290 IF V=0 PROCtrysetup 
  300 IF V=1 PROCtryonoff
  310 IF V=2 PROCtrytog 
  320 IF V=3 PROCtrytest
  330 IF V=4 PROCtrymulonoff
  340 IF V=5 PROCtrymultog
  350 IF V=6 PROCtrymultest
  360 IF V=7 PROCprogram
  370 IF V=8 MODE 7:PROCend
  380 UNTIL FALSE
  390 REM ***MAIN PROCEDURES FOR INTTEST BEGIN HERE***
  400 DEFPROCcover 
  410 PRINT'''''''
  420 PROCmessage("SOME SIMPLE AIDS TO","�","�"):PROCmessage("CONTROL PROGRAMMING","�","�"):PROCmessage("USING THE USER PORT","�","�"):PROCmessage("OF THE BBC MICRO","�","�") 
  430 PROCprompt
  440 ENDPROC 
  450 DEFPROCfind(X,Y,M,N,W,D)
  460 REPEAT 
  470 REPEAT
  480 PRINTTAB(X+(H*W),Y+(V*D));ARR$
  490 A=GET
  500 UNTIL(A>135ANDA<140)ORA=13
  510 PRINTTAB(X+(H*W),Y+(V*D));NOA$ 
  520 IFA=138ANDV<(N-1)THENV=V+1ELSEIFA=139ANDV>0V=V-1 
  530 IFA=137ANDH<(M-1)THENH=H+1ELSEIFA=136ANDH>0H=H-1
  540 UNTILA=13:VDU7
  550 ENDPROC
  560 DEFPROCend
  570 VDU 23,1,1;0;0;0;
  580 *FX229,0
  590 *FX4,0
  600 END
  610 DEFPROCmessage(M$,fo$,ba$) 
  620 FORI%=0TO1
  630 IF ba$="":PRINT; ELSE PRINTba$;CHR$157;
  640 PRINTfo$;CHR$141TAB(INT(40-LEN(M$))/2);M$
  650 NEXT
  660 ENDPROC 
  670 DEF PROCprocmenu
  680 PRINTTAB(7,4)"SET UP INTERFACE"TAB(7,6)"SWITCH ONE OUTPUT"TAB(7,8)"TOGGLE ONE OUTPUT"TAB(7,10)"TEST ONE INPUT"TAB(7,12)"SWITCH SEVERAL OUTPUTS"TAB(7,14)"TOGGLE SEVERAL OUTPUTS"TAB(7,16)"TEST SEVERAL INPUTS"TAB(7,18);   
  690 PRINT"START PROGRAMMING"TAB(6,20)"�EXIT FROM PROGRAM�"
  700 ENDPROC
  710 DEF PROCprompt
  720 PRINTTAB(0,23)" �     PRESS ANY KEY TO CONTINUE        ";
  730 dummy=GET
  740 ENDPROC
  750 DEFPROCinstruct
  760 PRINTTAB(2,23)CHR$131"USE ARROW KEYS AND RETURN TO SELECT" 
  770 ENDPROC
  780 CLS:PROCmessage("SILLY MISTAKE!!!","�","�") 
  790 PRINT''''''''
  800 PROCmessage("TRY AGAIN!!!!!","�","")
  810 PRINT'':PROCmessage("THIS TIME�READ�THE INSTRUCTIONS!","�","")
  820 PROCprompt
  830 GOTO 250
  840 DEFPROCok
  850 CLS:VDU7:PRINT'''''''''':PROCmessage("IT WORKED!!!!!!","�","")
  860 PROCprompt
  870 ENDPROC
  880 DEFPROCtell
  890 CLS:PRINT''''''''':PROCmessage("INTERFACE NOT SET UP","�","")
  900 PROCprompt:ENDPROC
  910 DEFPROCinput(x%,y%,maxlen%)
  920 VDU 23,1,1;0;0;0;
  930 le%=0
  940 ut$="":PRINT TAB(x%,y%+1);
  950 REPEAT
  960 REPEAT:A=GET:UNTIL (A>31 AND A<128) OR A=13
  970 IF (A=127 AND le%>0) PRINTCHR$(A);CHR$(9);CHR$(11);CHR$(A);CHR$(10); ELSE IF A<>13 AND le%<maxlen% AND A<>127 PRINTCHR$(A);CHR$(8);CHR$(11);CHR$(A);CHR$(10);
  980 IF A<>13 AND le%=maxlen% AND A<>127 VDU7  
  990 IF A=127 AND le%>0 ut$=LEFT$(ut$,le%-1):le%=le%-1 ELSE IF A<>13 AND A<>127 AND le%<maxlen% ut$=ut$+CHR$A:le%=le%+1
 1000 UNTIL A=13
 1010 VDU 23,1,0;0;0;0;
 1020 ENDPROC
 1030 DEFPROCprogram
 1040 CLS:PROCmessage("GETTING STARTED.....","�","�")  
 1050 PRINT'"The PROCEDURES and  FUNCTIONS  describedin  this program  begin at  line  10000.The red function keys have  been  set upto help  you  start  writing  your   ownprogram.  The  key  definitions  are  asfollows:"
 1060 PRINT'TAB(10)"KEY0 - gets you going"'TAB(10)"KEY1 - PROCset_up_port"'TAB(10)"KEY2 - PROCturn("'TAB(10)"KEY3 - PROCtoggle("'TAB(10)"KEY4 - FNtest("'TAB(10)"KEY5 - PROCmultiturn("'TAB(10)"KEY6 - PROCmultitoggle("'TAB(10)"KEY7 - FNmu";
 1070 PRINT"ltitest("'TAB(10)"KEY8 - auto line numbering"'TAB(10)"KEY9 - lists routine"'
 1080 FORI%=0TO1:PRINTTAB(11)"�"CHR$141"GOOD LUCK!!":NEXT 
 1090 *FX229,0
 1100 *FX4,0
 1110 VDU 23,1;1;0;0;0;
 1120 *KEY0 CH."A.INTPROC"|M*KEY0|M
 1130 *KEY1 PROCset_up_port
 1140 *KEY2 PROCturn(
 1150 *KEY3 PROCtoggle(
 1160 *KEY4 FNtest(
 1170 *KEY5 PROCmultiturn(
 1180 *KEY6 PROCmultitoggle(
 1190 *KEY7 PROCmultitest(
 1200 *KEY8 AUTO|M
 1210 *KEY9 L.0,9999|N|M
 1220 *KEY10 O.|M
 1225 END
 1230 DEF PROCtrysetup
 1240 CLS:PROCmessage("PROCset_up_port","�","�") 
 1250 PRINT'''"This  procedure  sets  up  the interfaceand  should be included at the beginningof  every  program  or  session  at  thekeyboard."'"Simply type:"''
 1260 PROCmessage("PROCset_up_port","�","")
 1270 PRINT''"being  very careful over capital lettersand  small  letters.  N.B.the '_' is theunderline character!" 
 1280 PRINTTAB(0,23)"�PRESS RETURN TO EXECUTE PROCset_up_port";:REPEAT:dummy=GET:UNTIL dummy=13  
 1290 PROCset_up_port:PROCprompt
 1300 FLAG=TRUE
 1310 ENDPROC
 1320 DEFPROCtryonoff
 1330 IF FLAG=FALSE PROCtell:ENDPROC 
 1340 CLS:PROCmessage("PROCturn(onORoff$,linenumber)","�","�")
 1350 PRINT''"This procedure  allows you to turn on oroff  any of  the relay  outputs numbered0 to 3.  First type:"'
 1360 PROCmessage("PROCturn(","�","")
 1370 PRINT'"then  include  two  'parameters'  in thebrackets.   The  first   should  specifywhether  you  want to  turn on  or off -type  "on$" or "off$"  in capital  lettersand enclosed  in  inverted  commas.  Thesecond parameter ";
 1380 PRINT" should  be the  numberof the relay you want to switch.  eg."' 
 1390 PROCmessage("PROCturn("+on$+",2)","�","")
 1400 PROCprompt
 1410 CLS:PROCmessage("PROCturn(onORoff$,linenumber)","�","�") 
 1420 PRINT''"Now try one out.   Complete the  commandand press return."'''
 1430 PROCmessage("PROCturn(        ","�","") 
 1440 ONERROR GOSUB 780
 1450 PROCinput(20,9,8)
 1460 IF RIGHT$(ut$,1)=" " ut$=LEFT$(ut$,LEN(ut$)-1)
 1470 IF MID$(ut$,4,2)=CHR$34+"," o$=MID$(ut$,2,2) ELSE IF MID$(ut$,5,2)=CHR$34+"," o$=MID$(ut$,2,3) ELSE o$=""
 1480 IF RIGHT$(ut$,1)<>")" THEN *FX125  
 1490 IF LEFT$(ut$,1)<>CHR$34THEN *FX125
 1500 line=VAL(MID$(ut$,LEN(ut$)-1,1))
 1510 PROCturn(o$,line)
 1520 PROCok
 1530 ONERROROFF
 1540 ENDPROC
 1550 DEFPROCtrytog
 1560 IF FLAG=FALSE PROCtell:ENDPROC  
 1570 CLS:PROCmessage("PROCtoggle(linenumber)","�","�")
 1580 PRINT''"This  procedure  allows  you to  reversethe state  of any  of the  relay outputsnumbered 0 to 3.  First type:"'
 1590 PROCmessage("PROCtoggle(","�","")  
 1600 PRINT'"then  include  one  'parameter'  in  thebrackets.  This  should be the number ofthe relay you want to 'toggle'.  eg."'
 1610 PROCmessage("PROCtoggle(2)","�","") 
 1620 PROCprompt
 1630 CLS:PROCmessage("PROCtoggle(linenumber)","�","�")
 1640 PRINT''"Now try one out.   Complete the  commandand press return."'''
 1650 PROCmessage("PROCtoggle(        ","�","")
 1660 ONERROR GOSUB 780
 1670 PROCinput(21,9,2)
 1680 IF ASC(LEFT$(ut$,1))>51 OR ASC(LEFT$(ut$,1))<48 THEN *FX125
 1690 IF RIGHT$(ut$,1)<>")" THEN *FX125  
 1700 PROCtoggle(VAL(LEFT$(ut$,1)))
 1710 PROCok
 1720 ONERROROFF
 1730 ENDPROC
 1740 DEFPROCtrytest
 1750 IF FLAG=FALSE PROCtell:ENDPROC 
 1760 CLS:PROCmessage("FNtest(linenumber)","�","�") 
 1770 PRINT''"This  function  allows you to  test  thestate  of  any  of  the  digital  inputsnumbered 4 to 7.  First type:"'
 1780 PROCmessage("PRINT FNtest(","�","")
 1790 PRINT'"then  include  one  'parameter'  in  thebrackets.  This  should be the number ofthe input you want to test.  eg."'
 1800 PROCmessage("PRINT FNtest(7)","�","")
 1810 PRINT'"This  will print out "on$" if the  yellowsocket  marked '7' is  connected to  oneof  the red sockets,  and "off$" if it isconnected  to one of  the green sockets."  
 1820 PROCprompt
 1830 CLS:PROCmessage("FNtest(linenumber)","�","�") 
 1840 PRINT''"Now try one out.   Complete the  commandand press return."''' 
 1850 PROCmessage("PRINT FNtest(        ","�","")
 1860 ONERROR GOSUB 780
 1870 PROCinput(22,9,2)
 1880 IF ASC(LEFT$(ut$,1))>ASC"7" OR ASC(LEFT$(ut$,1))<ASC"4" THEN *FX125
 1890 IF RIGHT$(ut$,1)<>")" THEN *FX125  
 1900 line=VAL(LEFT$(ut$,1))
 1910 result$=FNtest(line)
 1920 PRINT'''':PROCmessage("LINE "+STR$(line)+" IS�"+result$+"       ","�","") 
 1930 PRINT'':PROCprompt
 1940 ONERROROFF
 1950 ENDPROC
 1960 DEFPROCtrymulonoff
 1970 IF FLAG=FALSE PROCtell:ENDPROC
 1980 CLS:PROCmessage("PROCmultiturn(onORoff$,pattern$)","�","�") 
 1990 PRINT'"This procedure  allows you to turn on oroff any group of the relay outputs."'"First type:"
 2000 PROCmessage("PROCmultiturn(","�","")
 2010 PRINT"then  include  two  'parameters'  in thebrackets.   The  first  should   specifywhether  you  want to turn  on or  off -type  "on$" or "off$"  in capital  lettersand  enclosed  in inverted commas.   Thesecond  parameter  shou";
 2020 PRINT"ld  represent therelays  you want to  switch  as a binarynumber with four digits.  eg."
 2030 PROCmessage("PROCmultiturn("+on$+",""1010"")","�","")
 2040 PRINT"would turn  on relays 3 and 1. Try a fewto see how it works."
 2050 PROCprompt
 2060 CLS:PROCmessage("PROCmultiturn(onORoff$,pattern$)","�","�") 
 2070 PRINT''"Complete the command  and  press return."''
 2080 PROCmessage("PROCmultiturn(           ","�","")
 2090 ONERROR GOSUB 780
 2100 PROCinput(21,8,13) 
 2110 IF RIGHT$(ut$,1)=" " ut$=LEFT$(ut$,LEN(ut$)-1) 
 2120 IF MID$(ut$,4,2)=CHR$34+"," o$=MID$(ut$,2,2) ELSE IF MID$(ut$,5,2)=CHR$34+"," o$=MID$(ut$,2,3) ELSE o$=""
 2130 IF RIGHT$(ut$,2)<>CHR$34+")" THEN  *FX125  
 2140 pattern$=MID$(ut$,LEN(ut$)-5,4) 
 2150 PROCmultiturn(o$,pattern$)
 2160 PROCok
 2170 ONERROROFF
 2180 ENDPROC
 2190 DEFPROCtrymultog
 2200 IF FLAG=FALSE PROCtell:ENDPROC
 2210 CLS:PROCmessage("PROCmultitoggle(pattern$)","�","�") 
 2220 PRINT''"This  procedure allows  you to  'toggle'on or off any group of the relays."'"First type:"
 2230 PROCmessage("PROCmultitoggle(","�","") 
 2240 PRINT'"then  include  one  'parameter'  in  thebrackets.   This  should  be  a   binaryrepresentation  of the relays  you  wantto  toggle.  Four  binary  digits shouldbe given,  enclosed in  inverted commas.eg."  
 2250 PROCmessage("PROCmultitoggle(""0101"")","�","")
 2260 PRINT'"This would toggle relays 0 and 2.  Try afew and see how it works."   
 2270 PROCprompt
 2280 CLS:PROCmessage("PROCmultitoggle(pattern$)","�","�") 
 2290 PRINT''"Complete  the command and press  return."''
 2300 PROCmessage("PROCmultitoggle(           ","�","") 
 2310 ONERROR GOSUB 780
 2320 PROCinput(22,8,7) 
 2330 IF NOT(RIGHT$(ut$,2)=CHR$34+")" AND LEFT$(ut$,1)=CHR$34) THEN *FX125
 2340 pattern$=MID$(ut$,LEN(ut$)-5,4)
 2350 PROCmultitoggle(pattern$)
 2360 PROCok
 2370 ONERROROFF 
 2380 ENDPROC
 2390 DEFPROCtrymultest
 2400 IF FLAG=FALSE PROCtell:ENDPROC 
 2410 CLS:PROCmessage("FNmultitest(pattern$)","�","�")  
 2420 PRINT'"This  function  allows you  to test  anygroup of the digital inputs.  It returnsthe result "on$" if ALL  the given inputsare on and "off$" otherwise.  First type:"
 2430 PROCmessage("PRINT FNmultitest(","�","") 
 2440 PRINT'"then  include  one  'parameter'  in  thebrackets.    This  should  be  a  binaryrepresentation  of the  inputs you  wantto  test.  Four  binary digits should begiven, enclosed in inverted commas. eg."'
 2450 PROCmessage("PRINT FNmultitest(""0101"")","�","")
 2460 PRINT'"This  would  test inputs 4 and 6.  Try afew and see how it works." 
 2470 PROCprompt
 2480 CLS:PROCmessage("FNmultitest(pattern$)","�","�")
 2490 PRINT''"Complete  the command and press  return."''
 2500 PROCmessage("PRINT FNmultitest(           ","�","") 
 2510 ONERROR GOSUB 780
 2520 PROCinput(23,8,7) 
 2530 IF NOT(RIGHT$(ut$,2)=CHR$34+")" AND LEFT$(ut$,1)=CHR$34) THEN *FX125  
 2540 pattern$=MID$(ut$,LEN(ut$)-5,4)
 2550 result$=FNmultitest(pattern$)
 2560 PRINT'':PROCmessage("LINES�"+result$+"   ","�","")
 2570 PROCprompt
 2580 ONERROROFF
 2590 ENDPROC
 2600 REM **********************
 2610 REM *INTERFACE PROCEDURES*
 2620 REM ********************** 
10000 REM ***USES OSBYTE/*FX150 TO EXAMINE VIA REGISTER. REQUIRES OFFSET OF REGISTER IN PAGE &FE AS PARAMETER.***
10010 DEF FNpeek(offset) 
10020 LOCAL value
10030 A%=150:X%=offset:value=(USR(&FFF4) AND &FF0000) DIV &10000 
10040 =value
11000 REM ***USES OSBYTE/*FX151 TO WRITE A VALUE TO A VIA REGISTER.  REQUIRES OFFSET OF REGISTER IN PAGE &FE, AND VALUE TO BE WRITTEN AS PARAMETERS.***
11010 DEF PROCpoke(offset,value)
11020 A%=151:X%=offset:Y%=value:CALL &FFF4 
11030 ENDPROC  
12000 REM ***EXAMINES THE CURRENT STATE OF THE RELAY SPECIFIED AND SWAPS IT OVER.***
12010 DEF PROCtoggle(linenumber) 
12020 IF (linenumber>3 OR linenumber<0) THEN *FX125 
12030 LOCAL bitvalue,oldvalue,newvalue
12040 bitvalue=2^linenumber
12050 oldvalue=FNpeek(&60)  
12060 newvalue=oldvalue EOR bitvalue
12070 PROCpoke(&60,newvalue)
12080 ENDPROC  
13000 REM ***TURNS ON OR OFF A SPECIFIED RELAY.  REQUIRES ACTION TO BE TAKEN ie. "ON" OR "OFF", AND RELAY NUMBER AS PARAMETERS***
13010 DEF PROCturn(onORoff$,linenumber)
13020 IF NOT(onORoff$="ON" OR onORoff$="OFF") THEN *FX125 
13030 IF (linenumber>3 OR linenumber<0) THEN *FX125 
13040 LOCAL bitvalue,oldvalue,newvalue
13050 bitvalue=2^linenumber
13060 oldvalue=FNpeek(&60) 
13070 IF onORoff$="ON" THEN newvalue=oldvalue OR bitvalue ELSE newvalue=oldvalue AND (255-bitvalue)
13080 PROCpoke(&60,newvalue)
13090 ENDPROC
14000 REM ***TESTS THE CURRENT STATE OF THE SPECIFIED INPUT (4-7) AND RETURNS THE VALUE "ON" OR "OFF".***
14010 DEF FNtest(linenumber) 
14020 IF (linenumber>7 OR linenumber<4) THEN *FX125  
14030 LOCAL bitvalue
14040 bitvalue=2^linenumber
14050 result=((FNpeek(&60) AND bitvalue)=bitvalue)
14060 IF result THEN ="ON" ELSE ="OFF"
15000 REM ***TESTS THE STATE OF THE SPECIFIED RELAYS IN TURN AND SWAPS THEM. REQUIRES A STRING REPRESENTING THE RELAYS TO BE TOGGLED AS A BINARY PATTERN.***
15010 DEF PROCmultitoggle(pattern$) 
15020 LOCAL L,L$,mask%,oldvalue,newvalue
15030 IF LEN(pattern$)<>4 THEN *FX125
15040 FOR L=1 TO 4:L$=MID$(pattern$,L,1):IF NOT(L$="1" OR L$="0") THEN *FX125
15050 NEXT
15060 mask%=0:FOR L=1 TO 4:IF (MID$(pattern$,L,1)="1") THEN mask%=mask%+2^(4-L)  
15070 NEXT
15080 oldvalue=FNpeek(&60):newvalue=oldvalue EOR mask%
15090 PROCpoke(&60,newvalue)
15100 ENDPROC
16000 REM ***TURNS ON OR OFF THE SPECIFIED GROUP OF RELAYS.  REQUIRES TWO PARAMETERS:-(i)THE ACTION TO BE TAKEN ie."ON" OR "OFF", (ii)A STRING REPRESENTING THE RELAYS TO BE SWITCHED AS A BINARY PATTERN.***
16010 DEF PROCmultiturn(onORoff$,pattern$)
16020 LOCAL L,L$,mask%,oldvalue,newvalue
16030 IF LEN(pattern$)<>4 OR NOT(onORoff$="ON" OR onORoff$="OFF") THEN *FX125
16040 FOR L=1 TO 4:L$=MID$(pattern$,L,1):IF NOT(L$="1" OR L$="0") THEN *FX125
16050 NEXT
16060 mask%=0:FOR L=1 TO 4:IF (MID$(pattern$,L,1)="1") THEN mask%=mask%+2^(4-L)  
16070 NEXT
16080 oldvalue=FNpeek(&60):IF onORoff$="ON" THEN newvalue=oldvalue OR mask% ELSE newvalue=oldvalue AND (255-mask%)
16090 PROCpoke(&60,newvalue)
16100 ENDPROC
17000 REM ***TESTS THE SPECIFIED GROUP OF INPUTS AND RETURNS THE VALUE "ON" IF ALL OF THEM ARE ON AND "OFF" IF ANY ONE OF THEM IS OFF.  REQUIRES A STRING REPRESENTING THE INPUTS TO BE TESTED AS A BINARY PATTERN.***
17010 DEF FNmultitest(pattern$) 
17020 LOCAL L,L$,testmask%,result
17030 IF LEN(pattern$)<>4 THEN *FX125
17040 FOR L=1 TO 4:L$=MID$(pattern$,L,1):IF NOT(L$="1" OR L$="0") THEN *FX125
17050 NEXT
17060 testmask%=0:FOR L=1 TO 4:IF (MID$(pattern$,L,1)="1") THEN testmask%=testmask%+2^(8-L) 
17070 NEXT
17080 result=((FNpeek(&60) AND testmask%)=testmask%) 
17090 IF result THEN ="ON" ELSE ="OFF"
18000 REM ***INITIALISES USER PORT AS FOUR OUTPUTS ON PB0-3 AND FOUR INPUTS ON PB4-7. TURNS ALL OUTPUTS OFF.***
18010 DEF PROCset_up_port
18020 PROCpoke(&62,15)
18030 PROCpoke(&60,0)
18040 ENDPROC

  � *************************
  � INTTEST - AN INTRODUCTION
  � TO   CONTROL  PROGRAMMING
(  � WITH THE PILOT 1  DIGITAL
2  � INTERFACE. THE  IMPORTANT
<  � PROCEDURES  ARE  NUMBERED
F  � FROM 10000 UPWARDS. THESE
P  � BEAR NO COPYRIGHT. PLEASE
Z  � USE THEM FREELY.      DMB
d  � *************************
n � V1.0 
x% � COPYRIGHT PILOT ONE LTD., 1984
�  � *************************
�I � ***INITIALISE STRINGS,FLAGS,POINTERS,OPERATING SYSTEM,ETC......***
�" ARR$=�136+�91+�137:NOA$="   "
� FLAG=�
� on$=�34+"ON"+�34  
� off$=�34+"OFF"+�34 
� *FX4,1
� *FX229,1 
�
 *FX18
� �7:�23,1,0;0;0;0;
� �cover
�* � ***MAIN PROGRAM LOOP BEGINS HERE***
� �
5 �:�message("CONTROL PROGRAMMING - MENU","�","�")
 �procmenu:�instruct
  V=0:H=0:�find(30,4,1,9,0,2)
" � V=0 �trysetup 
, � V=1 �tryonoff
6 � V=2 �trytog 
@ � V=3 �trytest
J � V=4 �trymulonoff
T � V=5 �trymultog
^ � V=6 �trymultest
h � V=7 �program
r � V=8 � 7:�end
| � �
�3 � ***MAIN PROCEDURES FOR INTTEST BEGIN HERE***
�
 ��cover 
�
 �'''''''
�� �message("SOME SIMPLE AIDS TO","�","�"):�message("CONTROL PROGRAMMING","�","�"):�message("USING THE USER PORT","�","�"):�message("OF THE BBC MICRO","�","�") 
� �prompt
� � 
� ��find(X,Y,M,N,W,D)
� � 
� �
� �X+(H*W),Y+(V*D));ARR$
� A=�
� �(A>135�A<140)�A=13
� �X+(H*W),Y+(V*D));NOA$ 
* �A=138�V<(N-1)�V=V+1��A=139�V>0V=V-1 
) �A=137�H<(M-1)�H=H+1��A=136�H>0H=H-1

 �A=13:�7
& �
0
 ��end
: � 23,1,1;0;0;0;
D
 *FX229,0
N *FX4,0
X �
b ��message(M$,fo$,ba$) 
l �I%=0�1
v � ba$="":�; � �ba$;�157;
�  �fo$;�141��(40-�(M$))/2);M$
� �
� � 
� � �procmenu
�� �7,4)"SET UP INTERFACE"�7,6)"SWITCH ONE OUTPUT"�7,8)"TOGGLE ONE OUTPUT"�7,10)"TEST ONE INPUT"�7,12)"SWITCH SEVERAL OUTPUTS"�7,14)"TOGGLE SEVERAL OUTPUTS"�7,16)"TEST SEVERAL INPUTS"�7,18);   
�4 �"START PROGRAMMING"�6,20)"�EXIT FROM PROGRAM�"
� �
� � �prompt
�7 �0,23)" �     PRESS ANY KEY TO CONTINUE        ";
� dummy=�
� �
� ��instruct
�6 �2,23)�131"USE ARROW KEYS AND RETURN TO SELECT" 
 �
, �:�message("SILLY MISTAKE!!!","�","�") 
 �''''''''
 & �message("TRY AGAIN!!!!!","�","")
*< �'':�message("THIS TIME�READ�THE INSTRUCTIONS!","�","")
4 �prompt
> � �dz@
H	 ��ok
R8 �:�7:�'''''''''':�message("IT WORKED!!!!!!","�","")
\ �prompt
f �
p ��tell
z9 �:�''''''''':�message("INTERFACE NOT SET UP","�","")
� �prompt:�
� ��input(x%,y%,maxlen%)
� � 23,1,1;0;0;0;
�
 le%=0
� ut$="":� �x%,y%+1);
� �
�" �:A=�:� (A>31 � A<128) � A=13
�q � (A=127 � le%>0) �(A);�(9);�(11);�(A);�(10); � � A<>13 � le%<maxlen% � A<>127 �(A);�(8);�(11);�(A);�(10);
�( � A<>13 � le%=maxlen% � A<>127 �7  
�d � A=127 � le%>0 ut$=�ut$,le%-1):le%=le%-1 � � A<>13 � A<>127 � le%<maxlen% ut$=ut$+�A:le%=le%+1
� � A=13
� � 23,1,0;0;0;0;
� �
 ��program
1 �:�message("GETTING STARTED.....","�","�")  
� �'"The PROCEDURES and  FUNCTIONS  describedin  this program  begin at  line  10000.The red function keys have  been  set upto help  you  start  writing  your   ownprogram.  The  key  definitions  are  asfollows:"
$� �'�10)"KEY0 - gets you going"'�10)"KEY1 - PROCset_up_port"'�10)"KEY2 - PROCturn("'�10)"KEY3 - PROCtoggle("'�10)"KEY4 - FNtest("'�10)"KEY5 - PROCmultiturn("'�10)"KEY6 - PROCmultitoggle("'�10)"KEY7 - FNmu";
.M �"ltitest("'�10)"KEY8 - auto line numbering"'�10)"KEY9 - lists routine"'
8) �I%=0�1:�11)"�"�141"GOOD LUCK!!":� 
B
 *FX229,0
L *FX4,0
V � 23,1;1;0;0;0;
`" *KEY0 CH."A.INTPROC"|M*KEY0|M
j *KEY1 PROCset_up_port
t *KEY2 PROCturn(
~ *KEY3 PROCtoggle(
� *KEY4 FNtest(
� *KEY5 PROCmultiturn(
� *KEY6 PROCmultitoggle(
� *KEY7 PROCmultitest(
� *KEY8 AUTO|M
� *KEY9 L.0,9999|N|M
� *KEY10 O.|M
� �
� � �trysetup
�+ �:�message("PROCset_up_port","�","�") 
� �'''"This  procedure  sets  up  the interfaceand  should be included at the beginningof  every  program  or  session  at  thekeyboard."'"Simply type:"''
�' �message("PROCset_up_port","�","")
�o �''"being  very careful over capital lettersand  small  letters.  N.B.the '_' is theunderline character!" 
N �0,23)"�PRESS RETURN TO EXECUTE PROCset_up_port";:�:dummy=�:� dummy=13  

 �set_up_port:�prompt
 FLAG=�
 �
( ��tryonoff
2 � FLAG=� �tell:� 
<8 �:�message("PROCturn(onORoff$,linenumber)","�","�")
Fo �''"This procedure  allows you to turn on oroff  any of  the relay  outputs numbered0 to 3.  First type:"'
P! �message("PROCturn(","�","")
Z� �'"then  include  two  'parameters'  in thebrackets.   The  first   should  specifywhether  you  want to  turn on  or off -type  "on$" or "off$"  in capital  lettersand enclosed  in  inverted  commas.  Thesecond parameter ";
dF �" should  be the  numberof the relay you want to switch.  eg."' 
n+ �message("PROCturn("+on$+",2)","�","")
x �prompt
�9 �:�message("PROCturn(onORoff$,linenumber)","�","�") 
�F �''"Now try one out.   Complete the  commandand press return."'''
�* �message("PROCturn(        ","�","") 
� � � �TLC
� �input(20,9,8)
�% � �ut$,1)=" " ut$=�ut$,�(ut$)-1)
�P � �ut$,4,2)=�34+"," o$=�ut$,2,2) � � �ut$,5,2)=�34+"," o$=�ut$,2,3) � o$=""
� � �ut$,1)<>")" � *FX125  
� � �ut$,1)<>�34� *FX125
� line=�(�ut$,�(ut$)-1,1))
� �turn(o$,line)
� �ok
� 
 �

 ��trytog
 � FLAG=� �tell:�  
"1 �:�message("PROCtoggle(linenumber)","�","�")
,x �''"This  procedure  allows  you to  reversethe state  of any  of the  relay outputsnumbered 0 to 3.  First type:"'
6% �message("PROCtoggle(","�","")  
@~ �'"then  include  one  'parameter'  in  thebrackets.  This  should be the number ofthe relay you want to 'toggle'.  eg."'
J& �message("PROCtoggle(2)","�","") 
T �prompt
^1 �:�message("PROCtoggle(linenumber)","�","�")
hF �''"Now try one out.   Complete the  commandand press return."'''
r+ �message("PROCtoggle(        ","�","")
| � � �TLC
� �input(21,9,2)
�- � �(�ut$,1))>51 � �(�ut$,1))<48 � *FX125
� � �ut$,1)<>")" � *FX125  
� �toggle(�(�ut$,1)))
� �ok
� 
� �
� ��trytest
� � FLAG=� �tell:� 
�. �:�message("FNtest(linenumber)","�","�") 
�x �''"This  function  allows you to  test  thestate  of  any  of  the  digital  inputsnumbered 4 to 7.  First type:"'
�% �message("PRINT FNtest(","�","")
�z �'"then  include  one  'parameter'  in  thebrackets.  This  should be the number ofthe input you want to test.  eg."'
' �message("PRINT FNtest(7)","�","")
� �'"This  will print out "on$" if the  yellowsocket  marked '7' is  connected to  oneof  the red sockets,  and "off$" if it isconnected  to one of  the green sockets."  
 �prompt
&. �:�message("FNtest(linenumber)","�","�") 
0G �''"Now try one out.   Complete the  commandand press return."''' 
:- �message("PRINT FNtest(        ","�","")
D � � �TLC
N �input(22,9,2)
X1 � �(�ut$,1))>�"7" � �(�ut$,1))<�"4" � *FX125
b � �ut$,1)<>")" � *FX125  
l line=�(�ut$,1))
v result$=�test(line)
�E �'''':�message("LINE "+�(line)+" IS�"+result$+"       ","�","") 
� �'':�prompt
� 
� �
� ��trymulonoff
� � FLAG=� �tell:�
�< �:�message("PROCmultiturn(onORoff$,pattern$)","�","�") 
�b �'"This procedure  allows you to turn on oroff any group of the relay outputs."'"First type:"
�& �message("PROCmultiturn(","�","")
�� �"then  include  two  'parameters'  in thebrackets.   The  first  should   specifywhether  you  want to turn  on or  off -type  "on$" or "off$"  in capital  lettersand  enclosed  in inverted commas.   Thesecond  parameter  shou";
�^ �"ld  represent therelays  you want to  switch  as a binarynumber with four digits.  eg."
�7 �message("PROCmultiturn("+on$+",""1010"")","�","")
�D �"would turn  on relays 3 and 1. Try a fewto see how it works."
 �prompt
< �:�message("PROCmultiturn(onORoff$,pattern$)","�","�") 
4 �''"Complete the command  and  press return."''
 1 �message("PROCmultiturn(           ","�","")
* � � �TLC
4 �input(21,8,13) 
>& � �ut$,1)=" " ut$=�ut$,�(ut$)-1) 
HP � �ut$,4,2)=�34+"," o$=�ut$,2,2) � � �ut$,5,2)=�34+"," o$=�ut$,2,3) � o$=""
R# � �ut$,2)<>�34+")" �  *FX125  
\ pattern$=�ut$,�(ut$)-5,4) 
f �multiturn(o$,pattern$)
p �ok
z 
� �
� ��trymultog
� � FLAG=� �tell:�
�5 �:�message("PROCmultitoggle(pattern$)","�","�") 
�b �''"This  procedure allows  you to  'toggle'on or off any group of the relays."'"First type:"
�) �message("PROCmultitoggle(","�","") 
�� �'"then  include  one  'parameter'  in  thebrackets.   This  should  be  a   binaryrepresentation  of the relays  you  wantto  toggle.  Four  binary  digits shouldbe given,  enclosed in  inverted commas.eg."  
�1 �message("PROCmultitoggle(""0101"")","�","")
�M �'"This would toggle relays 0 and 2.  Try afew and see how it works."   
� �prompt
�5 �:�message("PROCmultitoggle(pattern$)","�","�") 
�4 �''"Complete  the command and press  return."''
�4 �message("PROCmultitoggle(           ","�","") 
	 � � �TLC
	 �input(22,8,7) 
	0 � �(�ut$,2)=�34+")" � �ut$,1)=�34) � *FX125
	$ pattern$=�ut$,�(ut$)-5,4)
	. �multitoggle(pattern$)
	8 �ok
	B	  
	L �
	V ��trymultest
	` � FLAG=� �tell:� 
	j2 �:�message("FNmultitest(pattern$)","�","�")  
	t� �'"This  function  allows you  to test  anygroup of the digital inputs.  It returnsthe result "on$" if ALL  the given inputsare on and "off$" otherwise.  First type:"
	~+ �message("PRINT FNmultitest(","�","") 
	�� �'"then  include  one  'parameter'  in  thebrackets.    This  should  be  a  binaryrepresentation  of the  inputs you  wantto  test.  Four  binary digits should begiven, enclosed in inverted commas. eg."'
	�3 �message("PRINT FNmultitest(""0101"")","�","")
	�K �'"This  would  test inputs 4 and 6.  Try afew and see how it works." 
	� �prompt
	�0 �:�message("FNmultitest(pattern$)","�","�")
	�4 �''"Complete  the command and press  return."''
	�6 �message("PRINT FNmultitest(           ","�","") 
	� � � �TLC
	� �input(23,8,7) 
	�2 � �(�ut$,2)=�34+")" � �ut$,1)=�34) � *FX125  
	� pattern$=�ut$,�(ut$)-5,4)
	�! result$=�multitest(pattern$)
0 �'':�message("LINES�"+result$+"   ","�","")

 �prompt
 
 �
( � **********************
2 � *INTERFACE PROCEDURES*
< � ********************** 
'n � ***USES OSBYTE/*FX150 TO EXAMINE VIA REGISTER. REQUIRES OFFSET OF REGISTER IN PAGE &FE AS PARAMETER.***
' � �peek(offset) 
'$ � value
'.: A%=150:X%=offset:value=(�(&FFF4) � &FF0000) � &10000 
'8 =value
*�� � ***USES OSBYTE/*FX151 TO WRITE A VALUE TO A VIA REGISTER.  REQUIRES OFFSET OF REGISTER IN PAGE &FE, AND VALUE TO BE WRITTEN AS PARAMETERS.***
+ � �poke(offset,value)
+' A%=151:X%=offset:Y%=value:� &FFF4 
+ �  
.�Q � ***EXAMINES THE CURRENT STATE OF THE RELAY SPECIFIED AND SWAPS IT OVER.***
.� � �toggle(linenumber) 
.�. � (linenumber>3 � linenumber<0) � *FX125 
.�! � bitvalue,oldvalue,newvalue
/ bitvalue=2^linenumber
/ oldvalue=�peek(&60)  
/! newvalue=oldvalue � bitvalue
/& �poke(&60,newvalue)
/0 �  
2�~ � ***TURNS ON OR OFF A SPECIFIED RELAY.  REQUIRES ACTION TO BE TAKEN ie. "ON" OR "OFF", AND RELAY NUMBER AS PARAMETERS***
2�! � �turn(onORoff$,linenumber)
2�2 � �(onORoff$="ON" � onORoff$="OFF") � *FX125 
2�. � (linenumber>3 � linenumber<0) � *FX125 
2�! � bitvalue,oldvalue,newvalue
2� bitvalue=2^linenumber
3 oldvalue=�peek(&60) 
3X � onORoff$="ON" � newvalue=oldvalue � bitvalue � newvalue=oldvalue � (255-bitvalue)
3 �poke(&60,newvalue)
3" �
6�f � ***TESTS THE CURRENT STATE OF THE SPECIFIED INPUT (4-7) AND RETURNS THE VALUE "ON" OR "OFF".***
6� � �test(linenumber) 
6�/ � (linenumber>7 � linenumber<4) � *FX125  
6� � bitvalue
6� bitvalue=2^linenumber
6�. result=((�peek(&60) � bitvalue)=bitvalue)
6� � result � ="ON" � ="OFF"
:�� � ***TESTS THE STATE OF THE SPECIFIED RELAYS IN TURN AND SWAPS THEM. REQUIRES A STRING REPRESENTING THE RELAYS TO BE TOGGLED AS A BINARY PATTERN.***
:� � �multitoggle(pattern$) 
:�# � L,L$,mask%,oldvalue,newvalue
:� � �(pattern$)<>4 � *FX125
:�> � L=1 � 4:L$=�pattern$,L,1):� �(L$="1" � L$="0") � *FX125
:� �
:�E mask%=0:� L=1 � 4:� (�pattern$,L,1)="1") � mask%=mask%+2^(4-L)  
:� �
:�2 oldvalue=�peek(&60):newvalue=oldvalue � mask%
:� �poke(&60,newvalue)
:� �
>�� � ***TURNS ON OR OFF THE SPECIFIED GROUP OF RELAYS.  REQUIRES TWO PARAMETERS:-(i)THE ACTION TO BE TAKEN ie."ON" OR "OFF", (ii)A STRING REPRESENTING THE RELAYS TO BE SWITCHED AS A BINARY PATTERN.***
>�$ � �multiturn(onORoff$,pattern$)
>�# � L,L$,mask%,oldvalue,newvalue
>�B � �(pattern$)<>4 � �(onORoff$="ON" � onORoff$="OFF") � *FX125
>�> � L=1 � 4:L$=�pattern$,L,1):� �(L$="1" � L$="0") � *FX125
>� �
>�E mask%=0:� L=1 � 4:� (�pattern$,L,1)="1") � mask%=mask%+2^(4-L)  
>� �
>�f oldvalue=�peek(&60):� onORoff$="ON" � newvalue=oldvalue � mask% � newvalue=oldvalue � (255-mask%)
>� �poke(&60,newvalue)
>� �
Bh� � ***TESTS THE SPECIFIED GROUP OF INPUTS AND RETURNS THE VALUE "ON" IF ALL OF THEM ARE ON AND "OFF" IF ANY ONE OF THEM IS OFF.  REQUIRES A STRING REPRESENTING THE INPUTS TO BE TESTED AS A BINARY PATTERN.***
Br � �multitest(pattern$) 
B| � L,L$,testmask%,result
B� � �(pattern$)<>4 � *FX125
B�> � L=1 � 4:L$=�pattern$,L,1):� �(L$="1" � L$="0") � *FX125
B� �
B�P testmask%=0:� L=1 � 4:� (�pattern$,L,1)="1") � testmask%=testmask%+2^(8-L) 
B� �
B�1 result=((�peek(&60) � testmask%)=testmask%) 
B� � result � ="ON" � ="OFF"
FPl � ***INITIALISES USER PORT AS FOUR OUTPUTS ON PB0-3 AND FOUR INPUTS ON PB4-7. TURNS ALL OUTPUTS OFF.***
FZ � �set_up_port
Fd �poke(&62,15)
Fn �poke(&60,0)
Fx �
�
00000000  0d 00 0a 20 20 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |...  . *********|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000020  0d 00 14 20 20 f4 20 49  4e 54 54 45 53 54 20 2d  |...  . INTTEST -|
00000030  20 41 4e 20 49 4e 54 52  4f 44 55 43 54 49 4f 4e  | AN INTRODUCTION|
00000040  0d 00 1e 20 20 f4 20 54  4f 20 20 20 43 4f 4e 54  |...  . TO   CONT|
00000050  52 4f 4c 20 20 50 52 4f  47 52 41 4d 4d 49 4e 47  |ROL  PROGRAMMING|
00000060  0d 00 28 20 20 f4 20 57  49 54 48 20 54 48 45 20  |..(  . WITH THE |
00000070  50 49 4c 4f 54 20 31 20  20 44 49 47 49 54 41 4c  |PILOT 1  DIGITAL|
00000080  0d 00 32 20 20 f4 20 49  4e 54 45 52 46 41 43 45  |..2  . INTERFACE|
00000090  2e 20 54 48 45 20 20 49  4d 50 4f 52 54 41 4e 54  |. THE  IMPORTANT|
000000a0  0d 00 3c 20 20 f4 20 50  52 4f 43 45 44 55 52 45  |..<  . PROCEDURE|
000000b0  53 20 20 41 52 45 20 20  4e 55 4d 42 45 52 45 44  |S  ARE  NUMBERED|
000000c0  0d 00 46 20 20 f4 20 46  52 4f 4d 20 31 30 30 30  |..F  . FROM 1000|
000000d0  30 20 55 50 57 41 52 44  53 2e 20 54 48 45 53 45  |0 UPWARDS. THESE|
000000e0  0d 00 50 20 20 f4 20 42  45 41 52 20 4e 4f 20 43  |..P  . BEAR NO C|
000000f0  4f 50 59 52 49 47 48 54  2e 20 50 4c 45 41 53 45  |OPYRIGHT. PLEASE|
00000100  0d 00 5a 20 20 f4 20 55  53 45 20 54 48 45 4d 20  |..Z  . USE THEM |
00000110  46 52 45 45 4c 59 2e 20  20 20 20 20 20 44 4d 42  |FREELY.      DMB|
00000120  0d 00 64 20 20 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..d  . *********|
00000130  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000140  0d 00 6e 0c 20 f4 20 56  31 2e 30 20 0d 00 78 25  |..n. . V1.0 ..x%|
00000150  20 f4 20 43 4f 50 59 52  49 47 48 54 20 50 49 4c  | . COPYRIGHT PIL|
00000160  4f 54 20 4f 4e 45 20 4c  54 44 2e 2c 20 31 39 38  |OT ONE LTD., 198|
00000170  34 0d 00 82 20 20 f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |4...  . ********|
00000180  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000190  2a 0d 00 8c 49 20 f4 20  2a 2a 2a 49 4e 49 54 49  |*...I . ***INITI|
000001a0  41 4c 49 53 45 20 53 54  52 49 4e 47 53 2c 46 4c  |ALISE STRINGS,FL|
000001b0  41 47 53 2c 50 4f 49 4e  54 45 52 53 2c 4f 50 45  |AGS,POINTERS,OPE|
000001c0  52 41 54 49 4e 47 20 53  59 53 54 45 4d 2c 45 54  |RATING SYSTEM,ET|
000001d0  43 2e 2e 2e 2e 2e 2e 2a  2a 2a 0d 00 96 22 20 41  |C......***..." A|
000001e0  52 52 24 3d bd 31 33 36  2b bd 39 31 2b bd 31 33  |RR$=.136+.91+.13|
000001f0  37 3a 4e 4f 41 24 3d 22  20 20 20 22 0d 00 a0 0b  |7:NOA$="   "....|
00000200  20 46 4c 41 47 3d a3 0d  00 aa 17 20 6f 6e 24 3d  | FLAG=..... on$=|
00000210  bd 33 34 2b 22 4f 4e 22  2b bd 33 34 20 20 0d 00  |.34+"ON"+.34  ..|
00000220  b4 18 20 6f 66 66 24 3d  bd 33 34 2b 22 4f 46 46  |.. off$=.34+"OFF|
00000230  22 2b bd 33 34 20 0d 00  be 0b 20 2a 46 58 34 2c  |"+.34 .... *FX4,|
00000240  31 0d 00 c8 0e 20 2a 46  58 32 32 39 2c 31 20 0d  |1.... *FX229,1 .|
00000250  00 d2 0a 20 2a 46 58 31  38 0d 00 dc 16 20 eb 37  |... *FX18.... .7|
00000260  3a ef 32 33 2c 31 2c 30  3b 30 3b 30 3b 30 3b 0d  |:.23,1,0;0;0;0;.|
00000270  00 e6 0b 20 f2 63 6f 76  65 72 0d 00 f0 2a 20 f4  |... .cover...* .|
00000280  20 2a 2a 2a 4d 41 49 4e  20 50 52 4f 47 52 41 4d  | ***MAIN PROGRAM|
00000290  20 4c 4f 4f 50 20 42 45  47 49 4e 53 20 48 45 52  | LOOP BEGINS HER|
000002a0  45 2a 2a 2a 0d 00 fa 06  20 f5 0d 01 04 35 20 db  |E***.... ....5 .|
000002b0  3a f2 6d 65 73 73 61 67  65 28 22 43 4f 4e 54 52  |:.message("CONTR|
000002c0  4f 4c 20 50 52 4f 47 52  41 4d 4d 49 4e 47 20 2d  |OL PROGRAMMING -|
000002d0  20 4d 45 4e 55 22 2c 22  81 22 2c 22 83 22 29 0d  | MENU",".",".").|
000002e0  01 0e 18 20 f2 70 72 6f  63 6d 65 6e 75 3a f2 69  |... .procmenu:.i|
000002f0  6e 73 74 72 75 63 74 0d  01 18 20 20 56 3d 30 3a  |nstruct...  V=0:|
00000300  48 3d 30 3a f2 66 69 6e  64 28 33 30 2c 34 2c 31  |H=0:.find(30,4,1|
00000310  2c 39 2c 30 2c 32 29 0d  01 22 15 20 e7 20 56 3d  |,9,0,2)..". . V=|
00000320  30 20 f2 74 72 79 73 65  74 75 70 20 0d 01 2c 14  |0 .trysetup ..,.|
00000330  20 e7 20 56 3d 31 20 f2  74 72 79 6f 6e 6f 66 66  | . V=1 .tryonoff|
00000340  0d 01 36 13 20 e7 20 56  3d 32 20 f2 74 72 79 74  |..6. . V=2 .tryt|
00000350  6f 67 20 0d 01 40 13 20  e7 20 56 3d 33 20 f2 74  |og ..@. . V=3 .t|
00000360  72 79 74 65 73 74 0d 01  4a 17 20 e7 20 56 3d 34  |rytest..J. . V=4|
00000370  20 f2 74 72 79 6d 75 6c  6f 6e 6f 66 66 0d 01 54  | .trymulonoff..T|
00000380  15 20 e7 20 56 3d 35 20  f2 74 72 79 6d 75 6c 74  |. . V=5 .trymult|
00000390  6f 67 0d 01 5e 16 20 e7  20 56 3d 36 20 f2 74 72  |og..^. . V=6 .tr|
000003a0  79 6d 75 6c 74 65 73 74  0d 01 68 13 20 e7 20 56  |ymultest..h. . V|
000003b0  3d 37 20 f2 70 72 6f 67  72 61 6d 0d 01 72 13 20  |=7 .program..r. |
000003c0  e7 20 56 3d 38 20 eb 20  37 3a f2 65 6e 64 0d 01  |. V=8 . 7:.end..|
000003d0  7c 08 20 fd 20 a3 0d 01  86 33 20 f4 20 2a 2a 2a  ||. . ....3 . ***|
000003e0  4d 41 49 4e 20 50 52 4f  43 45 44 55 52 45 53 20  |MAIN PROCEDURES |
000003f0  46 4f 52 20 49 4e 54 54  45 53 54 20 42 45 47 49  |FOR INTTEST BEGI|
00000400  4e 20 48 45 52 45 2a 2a  2a 0d 01 90 0d 20 dd f2  |N HERE***.... ..|
00000410  63 6f 76 65 72 20 0d 01  9a 0d 20 f1 27 27 27 27  |cover .... .''''|
00000420  27 27 27 0d 01 a4 a2 20  f2 6d 65 73 73 61 67 65  |'''.... .message|
00000430  28 22 53 4f 4d 45 20 53  49 4d 50 4c 45 20 41 49  |("SOME SIMPLE AI|
00000440  44 53 20 54 4f 22 2c 22  84 22 2c 22 83 22 29 3a  |DS TO",".","."):|
00000450  f2 6d 65 73 73 61 67 65  28 22 43 4f 4e 54 52 4f  |.message("CONTRO|
00000460  4c 20 50 52 4f 47 52 41  4d 4d 49 4e 47 22 2c 22  |L PROGRAMMING","|
00000470  84 22 2c 22 83 22 29 3a  f2 6d 65 73 73 61 67 65  |.","."):.message|
00000480  28 22 55 53 49 4e 47 20  54 48 45 20 55 53 45 52  |("USING THE USER|
00000490  20 50 4f 52 54 22 2c 22  84 22 2c 22 83 22 29 3a  | PORT",".","."):|
000004a0  f2 6d 65 73 73 61 67 65  28 22 4f 46 20 54 48 45  |.message("OF THE|
000004b0  20 42 42 43 20 4d 49 43  52 4f 22 2c 22 84 22 2c  | BBC MICRO",".",|
000004c0  22 83 22 29 20 0d 01 ae  0c 20 f2 70 72 6f 6d 70  |".") .... .promp|
000004d0  74 0d 01 b8 07 20 e1 20  0d 01 c2 18 20 dd f2 66  |t.... . .... ..f|
000004e0  69 6e 64 28 58 2c 59 2c  4d 2c 4e 2c 57 2c 44 29  |ind(X,Y,M,N,W,D)|
000004f0  0d 01 cc 07 20 f5 20 0d  01 d6 06 20 f5 0d 01 e0  |.... . .... ....|
00000500  1c 20 f1 8a 58 2b 28 48  2a 57 29 2c 59 2b 28 56  |. ..X+(H*W),Y+(V|
00000510  2a 44 29 29 3b 41 52 52  24 0d 01 ea 08 20 41 3d  |*D));ARR$.... A=|
00000520  a5 0d 01 f4 18 20 fd 28  41 3e 31 33 35 80 41 3c  |..... .(A>135.A<|
00000530  31 34 30 29 84 41 3d 31  33 0d 01 fe 1d 20 f1 8a  |140).A=13.... ..|
00000540  58 2b 28 48 2a 57 29 2c  59 2b 28 56 2a 44 29 29  |X+(H*W),Y+(V*D))|
00000550  3b 4e 4f 41 24 20 0d 02  08 2a 20 e7 41 3d 31 33  |;NOA$ ...* .A=13|
00000560  38 80 56 3c 28 4e 2d 31  29 8c 56 3d 56 2b 31 8b  |8.V<(N-1).V=V+1.|
00000570  e7 41 3d 31 33 39 80 56  3e 30 56 3d 56 2d 31 20  |.A=139.V>0V=V-1 |
00000580  0d 02 12 29 20 e7 41 3d  31 33 37 80 48 3c 28 4d  |...) .A=137.H<(M|
00000590  2d 31 29 8c 48 3d 48 2b  31 8b e7 41 3d 31 33 36  |-1).H=H+1..A=136|
000005a0  80 48 3e 30 48 3d 48 2d  31 0d 02 1c 0d 20 fd 41  |.H>0H=H-1.... .A|
000005b0  3d 31 33 3a ef 37 0d 02  26 06 20 e1 0d 02 30 0a  |=13:.7..&. ...0.|
000005c0  20 dd f2 65 6e 64 0d 02  3a 14 20 ef 20 32 33 2c  | ..end..:. . 23,|
000005d0  31 2c 31 3b 30 3b 30 3b  30 3b 0d 02 44 0d 20 2a  |1,1;0;0;0;..D. *|
000005e0  46 58 32 32 39 2c 30 0d  02 4e 0b 20 2a 46 58 34  |FX229,0..N. *FX4|
000005f0  2c 30 0d 02 58 06 20 e0  0d 02 62 1b 20 dd f2 6d  |,0..X. ...b. ..m|
00000600  65 73 73 61 67 65 28 4d  24 2c 66 6f 24 2c 62 61  |essage(M$,fo$,ba|
00000610  24 29 20 0d 02 6c 0c 20  e3 49 25 3d 30 b8 31 0d  |$) ..l. .I%=0.1.|
00000620  02 76 1d 20 e7 20 62 61  24 3d 22 22 3a f1 3b 20  |.v. . ba$="":.; |
00000630  8b 20 f1 62 61 24 3b bd  31 35 37 3b 0d 02 80 20  |. .ba$;.157;... |
00000640  20 f1 66 6f 24 3b bd 31  34 31 8a a8 28 34 30 2d  | .fo$;.141..(40-|
00000650  a9 28 4d 24 29 29 2f 32  29 3b 4d 24 0d 02 8a 06  |.(M$))/2);M$....|
00000660  20 ed 0d 02 94 07 20 e1  20 0d 02 9e 10 20 dd 20  | ..... . .... . |
00000670  f2 70 72 6f 63 6d 65 6e  75 0d 02 a8 c4 20 f1 8a  |.procmenu.... ..|
00000680  37 2c 34 29 22 53 45 54  20 55 50 20 49 4e 54 45  |7,4)"SET UP INTE|
00000690  52 46 41 43 45 22 8a 37  2c 36 29 22 53 57 49 54  |RFACE".7,6)"SWIT|
000006a0  43 48 20 4f 4e 45 20 4f  55 54 50 55 54 22 8a 37  |CH ONE OUTPUT".7|
000006b0  2c 38 29 22 54 4f 47 47  4c 45 20 4f 4e 45 20 4f  |,8)"TOGGLE ONE O|
000006c0  55 54 50 55 54 22 8a 37  2c 31 30 29 22 54 45 53  |UTPUT".7,10)"TES|
000006d0  54 20 4f 4e 45 20 49 4e  50 55 54 22 8a 37 2c 31  |T ONE INPUT".7,1|
000006e0  32 29 22 53 57 49 54 43  48 20 53 45 56 45 52 41  |2)"SWITCH SEVERA|
000006f0  4c 20 4f 55 54 50 55 54  53 22 8a 37 2c 31 34 29  |L OUTPUTS".7,14)|
00000700  22 54 4f 47 47 4c 45 20  53 45 56 45 52 41 4c 20  |"TOGGLE SEVERAL |
00000710  4f 55 54 50 55 54 53 22  8a 37 2c 31 36 29 22 54  |OUTPUTS".7,16)"T|
00000720  45 53 54 20 53 45 56 45  52 41 4c 20 49 4e 50 55  |EST SEVERAL INPU|
00000730  54 53 22 8a 37 2c 31 38  29 3b 20 20 20 0d 02 b2  |TS".7,18);   ...|
00000740  34 20 f1 22 53 54 41 52  54 20 50 52 4f 47 52 41  |4 ."START PROGRA|
00000750  4d 4d 49 4e 47 22 8a 36  2c 32 30 29 22 85 45 58  |MMING".6,20)".EX|
00000760  49 54 20 46 52 4f 4d 20  50 52 4f 47 52 41 4d 87  |IT FROM PROGRAM.|
00000770  22 0d 02 bc 06 20 e1 0d  02 c6 0e 20 dd 20 f2 70  |".... ..... . .p|
00000780  72 6f 6d 70 74 0d 02 d0  37 20 f1 8a 30 2c 32 33  |rompt...7 ..0,23|
00000790  29 22 20 83 20 20 20 20  20 50 52 45 53 53 20 41  |)" .     PRESS A|
000007a0  4e 59 20 4b 45 59 20 54  4f 20 43 4f 4e 54 49 4e  |NY KEY TO CONTIN|
000007b0  55 45 20 20 20 20 20 20  20 20 22 3b 0d 02 da 0c  |UE        ";....|
000007c0  20 64 75 6d 6d 79 3d a5  0d 02 e4 06 20 e1 0d 02  | dummy=..... ...|
000007d0  ee 0f 20 dd f2 69 6e 73  74 72 75 63 74 0d 02 f8  |.. ..instruct...|
000007e0  36 20 f1 8a 32 2c 32 33  29 bd 31 33 31 22 55 53  |6 ..2,23).131"US|
000007f0  45 20 41 52 52 4f 57 20  4b 45 59 53 20 41 4e 44  |E ARROW KEYS AND|
00000800  20 52 45 54 55 52 4e 20  54 4f 20 53 45 4c 45 43  | RETURN TO SELEC|
00000810  54 22 20 0d 03 02 06 20  e1 0d 03 0c 2c 20 db 3a  |T" .... ...., .:|
00000820  f2 6d 65 73 73 61 67 65  28 22 53 49 4c 4c 59 20  |.message("SILLY |
00000830  4d 49 53 54 41 4b 45 21  21 21 22 2c 22 81 22 2c  |MISTAKE!!!",".",|
00000840  22 82 22 29 20 0d 03 16  0e 20 f1 27 27 27 27 27  |".") .... .'''''|
00000850  27 27 27 0d 03 20 26 20  f2 6d 65 73 73 61 67 65  |'''.. & .message|
00000860  28 22 54 52 59 20 41 47  41 49 4e 21 21 21 21 21  |("TRY AGAIN!!!!!|
00000870  22 2c 22 81 22 2c 22 22  29 0d 03 2a 3c 20 f1 27  |",".","")..*< .'|
00000880  27 3a f2 6d 65 73 73 61  67 65 28 22 54 48 49 53  |':.message("THIS|
00000890  20 54 49 4d 45 88 52 45  41 44 89 54 48 45 20 49  | TIME.READ.THE I|
000008a0  4e 53 54 52 55 43 54 49  4f 4e 53 21 22 2c 22 85  |NSTRUCTIONS!",".|
000008b0  22 2c 22 22 29 0d 03 34  0c 20 f2 70 72 6f 6d 70  |","")..4. .promp|
000008c0  74 0d 03 3e 0b 20 e5 20  8d 64 7a 40 0d 03 48 09  |t..>. . .dz@..H.|
000008d0  20 dd f2 6f 6b 0d 03 52  38 20 db 3a ef 37 3a f1  | ..ok..R8 .:.7:.|
000008e0  27 27 27 27 27 27 27 27  27 27 3a f2 6d 65 73 73  |'''''''''':.mess|
000008f0  61 67 65 28 22 49 54 20  57 4f 52 4b 45 44 21 21  |age("IT WORKED!!|
00000900  21 21 21 21 22 2c 22 82  22 2c 22 22 29 0d 03 5c  |!!!!",".","")..\|
00000910  0c 20 f2 70 72 6f 6d 70  74 0d 03 66 06 20 e1 0d  |. .prompt..f. ..|
00000920  03 70 0b 20 dd f2 74 65  6c 6c 0d 03 7a 39 20 db  |.p. ..tell..z9 .|
00000930  3a f1 27 27 27 27 27 27  27 27 27 3a f2 6d 65 73  |:.''''''''':.mes|
00000940  73 61 67 65 28 22 49 4e  54 45 52 46 41 43 45 20  |sage("INTERFACE |
00000950  4e 4f 54 20 53 45 54 20  55 50 22 2c 22 81 22 2c  |NOT SET UP",".",|
00000960  22 22 29 0d 03 84 0e 20  f2 70 72 6f 6d 70 74 3a  |"").... .prompt:|
00000970  e1 0d 03 8e 1b 20 dd f2  69 6e 70 75 74 28 78 25  |..... ..input(x%|
00000980  2c 79 25 2c 6d 61 78 6c  65 6e 25 29 0d 03 98 14  |,y%,maxlen%)....|
00000990  20 ef 20 32 33 2c 31 2c  31 3b 30 3b 30 3b 30 3b  | . 23,1,1;0;0;0;|
000009a0  0d 03 a2 0a 20 6c 65 25  3d 30 0d 03 ac 18 20 75  |.... le%=0.... u|
000009b0  74 24 3d 22 22 3a f1 20  8a 78 25 2c 79 25 2b 31  |t$="":. .x%,y%+1|
000009c0  29 3b 0d 03 b6 06 20 f5  0d 03 c0 22 20 f5 3a 41  |);.... ...." .:A|
000009d0  3d a5 3a fd 20 28 41 3e  33 31 20 80 20 41 3c 31  |=.:. (A>31 . A<1|
000009e0  32 38 29 20 84 20 41 3d  31 33 0d 03 ca 71 20 e7  |28) . A=13...q .|
000009f0  20 28 41 3d 31 32 37 20  80 20 6c 65 25 3e 30 29  | (A=127 . le%>0)|
00000a00  20 f1 bd 28 41 29 3b bd  28 39 29 3b bd 28 31 31  | ..(A);.(9);.(11|
00000a10  29 3b bd 28 41 29 3b bd  28 31 30 29 3b 20 8b 20  |);.(A);.(10); . |
00000a20  e7 20 41 3c 3e 31 33 20  80 20 6c 65 25 3c 6d 61  |. A<>13 . le%<ma|
00000a30  78 6c 65 6e 25 20 80 20  41 3c 3e 31 32 37 20 f1  |xlen% . A<>127 .|
00000a40  bd 28 41 29 3b bd 28 38  29 3b bd 28 31 31 29 3b  |.(A);.(8);.(11);|
00000a50  bd 28 41 29 3b bd 28 31  30 29 3b 0d 03 d4 28 20  |.(A);.(10);...( |
00000a60  e7 20 41 3c 3e 31 33 20  80 20 6c 65 25 3d 6d 61  |. A<>13 . le%=ma|
00000a70  78 6c 65 6e 25 20 80 20  41 3c 3e 31 32 37 20 ef  |xlen% . A<>127 .|
00000a80  37 20 20 0d 03 de 64 20  e7 20 41 3d 31 32 37 20  |7  ...d . A=127 |
00000a90  80 20 6c 65 25 3e 30 20  75 74 24 3d c0 75 74 24  |. le%>0 ut$=.ut$|
00000aa0  2c 6c 65 25 2d 31 29 3a  6c 65 25 3d 6c 65 25 2d  |,le%-1):le%=le%-|
00000ab0  31 20 8b 20 e7 20 41 3c  3e 31 33 20 80 20 41 3c  |1 . . A<>13 . A<|
00000ac0  3e 31 32 37 20 80 20 6c  65 25 3c 6d 61 78 6c 65  |>127 . le%<maxle|
00000ad0  6e 25 20 75 74 24 3d 75  74 24 2b bd 41 3a 6c 65  |n% ut$=ut$+.A:le|
00000ae0  25 3d 6c 65 25 2b 31 0d  03 e8 0b 20 fd 20 41 3d  |%=le%+1.... . A=|
00000af0  31 33 0d 03 f2 14 20 ef  20 32 33 2c 31 2c 30 3b  |13.... . 23,1,0;|
00000b00  30 3b 30 3b 30 3b 0d 03  fc 06 20 e1 0d 04 06 0e  |0;0;0;.... .....|
00000b10  20 dd f2 70 72 6f 67 72  61 6d 0d 04 10 31 20 db  | ..program...1 .|
00000b20  3a f2 6d 65 73 73 61 67  65 28 22 47 45 54 54 49  |:.message("GETTI|
00000b30  4e 47 20 53 54 41 52 54  45 44 2e 2e 2e 2e 2e 22  |NG STARTED....."|
00000b40  2c 22 81 22 2c 22 83 22  29 20 20 0d 04 1a d9 20  |,".",".")  .... |
00000b50  f1 27 22 54 68 65 20 50  52 4f 43 45 44 55 52 45  |.'"The PROCEDURE|
00000b60  53 20 61 6e 64 20 20 46  55 4e 43 54 49 4f 4e 53  |S and  FUNCTIONS|
00000b70  20 20 64 65 73 63 72 69  62 65 64 69 6e 20 20 74  |  describedin  t|
00000b80  68 69 73 20 70 72 6f 67  72 61 6d 20 20 62 65 67  |his program  beg|
00000b90  69 6e 20 61 74 20 20 6c  69 6e 65 20 20 31 30 30  |in at  line  100|
00000ba0  30 30 2e 54 68 65 20 72  65 64 20 66 75 6e 63 74  |00.The red funct|
00000bb0  69 6f 6e 20 6b 65 79 73  20 68 61 76 65 20 20 62  |ion keys have  b|
00000bc0  65 65 6e 20 20 73 65 74  20 75 70 74 6f 20 68 65  |een  set upto he|
00000bd0  6c 70 20 20 79 6f 75 20  20 73 74 61 72 74 20 20  |lp  you  start  |
00000be0  77 72 69 74 69 6e 67 20  20 79 6f 75 72 20 20 20  |writing  your   |
00000bf0  6f 77 6e 70 72 6f 67 72  61 6d 2e 20 20 54 68 65  |ownprogram.  The|
00000c00  20 20 6b 65 79 20 20 64  65 66 69 6e 69 74 69 6f  |  key  definitio|
00000c10  6e 73 20 20 61 72 65 20  20 61 73 66 6f 6c 6c 6f  |ns  are  asfollo|
00000c20  77 73 3a 22 0d 04 24 d1  20 f1 27 8a 31 30 29 22  |ws:"..$. .'.10)"|
00000c30  4b 45 59 30 20 2d 20 67  65 74 73 20 79 6f 75 20  |KEY0 - gets you |
00000c40  67 6f 69 6e 67 22 27 8a  31 30 29 22 4b 45 59 31  |going"'.10)"KEY1|
00000c50  20 2d 20 50 52 4f 43 73  65 74 5f 75 70 5f 70 6f  | - PROCset_up_po|
00000c60  72 74 22 27 8a 31 30 29  22 4b 45 59 32 20 2d 20  |rt"'.10)"KEY2 - |
00000c70  50 52 4f 43 74 75 72 6e  28 22 27 8a 31 30 29 22  |PROCturn("'.10)"|
00000c80  4b 45 59 33 20 2d 20 50  52 4f 43 74 6f 67 67 6c  |KEY3 - PROCtoggl|
00000c90  65 28 22 27 8a 31 30 29  22 4b 45 59 34 20 2d 20  |e("'.10)"KEY4 - |
00000ca0  46 4e 74 65 73 74 28 22  27 8a 31 30 29 22 4b 45  |FNtest("'.10)"KE|
00000cb0  59 35 20 2d 20 50 52 4f  43 6d 75 6c 74 69 74 75  |Y5 - PROCmultitu|
00000cc0  72 6e 28 22 27 8a 31 30  29 22 4b 45 59 36 20 2d  |rn("'.10)"KEY6 -|
00000cd0  20 50 52 4f 43 6d 75 6c  74 69 74 6f 67 67 6c 65  | PROCmultitoggle|
00000ce0  28 22 27 8a 31 30 29 22  4b 45 59 37 20 2d 20 46  |("'.10)"KEY7 - F|
00000cf0  4e 6d 75 22 3b 0d 04 2e  4d 20 f1 22 6c 74 69 74  |Nmu";...M ."ltit|
00000d00  65 73 74 28 22 27 8a 31  30 29 22 4b 45 59 38 20  |est("'.10)"KEY8 |
00000d10  2d 20 61 75 74 6f 20 6c  69 6e 65 20 6e 75 6d 62  |- auto line numb|
00000d20  65 72 69 6e 67 22 27 8a  31 30 29 22 4b 45 59 39  |ering"'.10)"KEY9|
00000d30  20 2d 20 6c 69 73 74 73  20 72 6f 75 74 69 6e 65  | - lists routine|
00000d40  22 27 0d 04 38 29 20 e3  49 25 3d 30 b8 31 3a f1  |"'..8) .I%=0.1:.|
00000d50  8a 31 31 29 22 82 22 bd  31 34 31 22 47 4f 4f 44  |.11)".".141"GOOD|
00000d60  20 4c 55 43 4b 21 21 22  3a ed 20 0d 04 42 0d 20  | LUCK!!":. ..B. |
00000d70  2a 46 58 32 32 39 2c 30  0d 04 4c 0b 20 2a 46 58  |*FX229,0..L. *FX|
00000d80  34 2c 30 0d 04 56 14 20  ef 20 32 33 2c 31 3b 31  |4,0..V. . 23,1;1|
00000d90  3b 30 3b 30 3b 30 3b 0d  04 60 22 20 2a 4b 45 59  |;0;0;0;..`" *KEY|
00000da0  30 20 43 48 2e 22 41 2e  49 4e 54 50 52 4f 43 22  |0 CH."A.INTPROC"|
00000db0  7c 4d 2a 4b 45 59 30 7c  4d 0d 04 6a 1a 20 2a 4b  ||M*KEY0|M..j. *K|
00000dc0  45 59 31 20 50 52 4f 43  73 65 74 5f 75 70 5f 70  |EY1 PROCset_up_p|
00000dd0  6f 72 74 0d 04 74 14 20  2a 4b 45 59 32 20 50 52  |ort..t. *KEY2 PR|
00000de0  4f 43 74 75 72 6e 28 0d  04 7e 16 20 2a 4b 45 59  |OCturn(..~. *KEY|
00000df0  33 20 50 52 4f 43 74 6f  67 67 6c 65 28 0d 04 88  |3 PROCtoggle(...|
00000e00  12 20 2a 4b 45 59 34 20  46 4e 74 65 73 74 28 0d  |. *KEY4 FNtest(.|
00000e10  04 92 19 20 2a 4b 45 59  35 20 50 52 4f 43 6d 75  |... *KEY5 PROCmu|
00000e20  6c 74 69 74 75 72 6e 28  0d 04 9c 1b 20 2a 4b 45  |ltiturn(.... *KE|
00000e30  59 36 20 50 52 4f 43 6d  75 6c 74 69 74 6f 67 67  |Y6 PROCmultitogg|
00000e40  6c 65 28 0d 04 a6 19 20  2a 4b 45 59 37 20 50 52  |le(.... *KEY7 PR|
00000e50  4f 43 6d 75 6c 74 69 74  65 73 74 28 0d 04 b0 11  |OCmultitest(....|
00000e60  20 2a 4b 45 59 38 20 41  55 54 4f 7c 4d 0d 04 ba  | *KEY8 AUTO|M...|
00000e70  17 20 2a 4b 45 59 39 20  4c 2e 30 2c 39 39 39 39  |. *KEY9 L.0,9999|
00000e80  7c 4e 7c 4d 0d 04 c4 10  20 2a 4b 45 59 31 30 20  ||N|M.... *KEY10 |
00000e90  4f 2e 7c 4d 0d 04 c9 06  20 e0 0d 04 ce 10 20 dd  |O.|M.... ..... .|
00000ea0  20 f2 74 72 79 73 65 74  75 70 0d 04 d8 2b 20 db  | .trysetup...+ .|
00000eb0  3a f2 6d 65 73 73 61 67  65 28 22 50 52 4f 43 73  |:.message("PROCs|
00000ec0  65 74 5f 75 70 5f 70 6f  72 74 22 2c 22 84 22 2c  |et_up_port",".",|
00000ed0  22 83 22 29 20 0d 04 e2  9d 20 f1 27 27 27 22 54  |".") .... .'''"T|
00000ee0  68 69 73 20 20 70 72 6f  63 65 64 75 72 65 20 20  |his  procedure  |
00000ef0  73 65 74 73 20 20 75 70  20 20 74 68 65 20 69 6e  |sets  up  the in|
00000f00  74 65 72 66 61 63 65 61  6e 64 20 20 73 68 6f 75  |terfaceand  shou|
00000f10  6c 64 20 62 65 20 69 6e  63 6c 75 64 65 64 20 61  |ld be included a|
00000f20  74 20 74 68 65 20 62 65  67 69 6e 6e 69 6e 67 6f  |t the beginningo|
00000f30  66 20 20 65 76 65 72 79  20 20 70 72 6f 67 72 61  |f  every  progra|
00000f40  6d 20 20 6f 72 20 20 73  65 73 73 69 6f 6e 20 20  |m  or  session  |
00000f50  61 74 20 20 74 68 65 6b  65 79 62 6f 61 72 64 2e  |at  thekeyboard.|
00000f60  22 27 22 53 69 6d 70 6c  79 20 74 79 70 65 3a 22  |"'"Simply type:"|
00000f70  27 27 0d 04 ec 27 20 f2  6d 65 73 73 61 67 65 28  |''...' .message(|
00000f80  22 50 52 4f 43 73 65 74  5f 75 70 5f 70 6f 72 74  |"PROCset_up_port|
00000f90  22 2c 22 81 22 2c 22 22  29 0d 04 f6 6f 20 f1 27  |",".","")...o .'|
00000fa0  27 22 62 65 69 6e 67 20  20 76 65 72 79 20 63 61  |'"being  very ca|
00000fb0  72 65 66 75 6c 20 6f 76  65 72 20 63 61 70 69 74  |reful over capit|
00000fc0  61 6c 20 6c 65 74 74 65  72 73 61 6e 64 20 20 73  |al lettersand  s|
00000fd0  6d 61 6c 6c 20 20 6c 65  74 74 65 72 73 2e 20 20  |mall  letters.  |
00000fe0  4e 2e 42 2e 74 68 65 20  27 5f 27 20 69 73 20 74  |N.B.the '_' is t|
00000ff0  68 65 75 6e 64 65 72 6c  69 6e 65 20 63 68 61 72  |heunderline char|
00001000  61 63 74 65 72 21 22 20  0d 05 00 4e 20 f1 8a 30  |acter!" ...N ..0|
00001010  2c 32 33 29 22 83 50 52  45 53 53 20 52 45 54 55  |,23)".PRESS RETU|
00001020  52 4e 20 54 4f 20 45 58  45 43 55 54 45 20 50 52  |RN TO EXECUTE PR|
00001030  4f 43 73 65 74 5f 75 70  5f 70 6f 72 74 22 3b 3a  |OCset_up_port";:|
00001040  f5 3a 64 75 6d 6d 79 3d  a5 3a fd 20 64 75 6d 6d  |.:dummy=.:. dumm|
00001050  79 3d 31 33 20 20 0d 05  0a 19 20 f2 73 65 74 5f  |y=13  .... .set_|
00001060  75 70 5f 70 6f 72 74 3a  f2 70 72 6f 6d 70 74 0d  |up_port:.prompt.|
00001070  05 14 0b 20 46 4c 41 47  3d b9 0d 05 1e 06 20 e1  |... FLAG=..... .|
00001080  0d 05 28 0f 20 dd f2 74  72 79 6f 6e 6f 66 66 0d  |..(. ..tryonoff.|
00001090  05 32 16 20 e7 20 46 4c  41 47 3d a3 20 f2 74 65  |.2. . FLAG=. .te|
000010a0  6c 6c 3a e1 20 0d 05 3c  38 20 db 3a f2 6d 65 73  |ll:. ..<8 .:.mes|
000010b0  73 61 67 65 28 22 50 52  4f 43 74 75 72 6e 28 6f  |sage("PROCturn(o|
000010c0  6e 4f 52 6f 66 66 24 2c  6c 69 6e 65 6e 75 6d 62  |nORoff$,linenumb|
000010d0  65 72 29 22 2c 22 84 22  2c 22 83 22 29 0d 05 46  |er)",".",".")..F|
000010e0  6f 20 f1 27 27 22 54 68  69 73 20 70 72 6f 63 65  |o .''"This proce|
000010f0  64 75 72 65 20 20 61 6c  6c 6f 77 73 20 79 6f 75  |dure  allows you|
00001100  20 74 6f 20 74 75 72 6e  20 6f 6e 20 6f 72 6f 66  | to turn on orof|
00001110  66 20 20 61 6e 79 20 6f  66 20 20 74 68 65 20 72  |f  any of  the r|
00001120  65 6c 61 79 20 20 6f 75  74 70 75 74 73 20 6e 75  |elay  outputs nu|
00001130  6d 62 65 72 65 64 30 20  74 6f 20 33 2e 20 20 46  |mbered0 to 3.  F|
00001140  69 72 73 74 20 74 79 70  65 3a 22 27 0d 05 50 21  |irst type:"'..P!|
00001150  20 f2 6d 65 73 73 61 67  65 28 22 50 52 4f 43 74  | .message("PROCt|
00001160  75 72 6e 28 22 2c 22 82  22 2c 22 22 29 0d 05 5a  |urn(",".","")..Z|
00001170  e5 20 f1 27 22 74 68 65  6e 20 20 69 6e 63 6c 75  |. .'"then  inclu|
00001180  64 65 20 20 74 77 6f 20  20 27 70 61 72 61 6d 65  |de  two  'parame|
00001190  74 65 72 73 27 20 20 69  6e 20 74 68 65 62 72 61  |ters'  in thebra|
000011a0  63 6b 65 74 73 2e 20 20  20 54 68 65 20 20 66 69  |ckets.   The  fi|
000011b0  72 73 74 20 20 20 73 68  6f 75 6c 64 20 20 73 70  |rst   should  sp|
000011c0  65 63 69 66 79 77 68 65  74 68 65 72 20 20 79 6f  |ecifywhether  yo|
000011d0  75 20 20 77 61 6e 74 20  74 6f 20 20 74 75 72 6e  |u  want to  turn|
000011e0  20 6f 6e 20 20 6f 72 20  6f 66 66 20 2d 74 79 70  | on  or off -typ|
000011f0  65 20 20 22 6f 6e 24 22  20 6f 72 20 22 6f 66 66  |e  "on$" or "off|
00001200  24 22 20 20 69 6e 20 63  61 70 69 74 61 6c 20 20  |$"  in capital  |
00001210  6c 65 74 74 65 72 73 61  6e 64 20 65 6e 63 6c 6f  |lettersand enclo|
00001220  73 65 64 20 20 69 6e 20  20 69 6e 76 65 72 74 65  |sed  in  inverte|
00001230  64 20 20 63 6f 6d 6d 61  73 2e 20 20 54 68 65 73  |d  commas.  Thes|
00001240  65 63 6f 6e 64 20 70 61  72 61 6d 65 74 65 72 20  |econd parameter |
00001250  22 3b 0d 05 64 46 20 f1  22 20 73 68 6f 75 6c 64  |";..dF ." should|
00001260  20 20 62 65 20 74 68 65  20 20 6e 75 6d 62 65 72  |  be the  number|
00001270  6f 66 20 74 68 65 20 72  65 6c 61 79 20 79 6f 75  |of the relay you|
00001280  20 77 61 6e 74 20 74 6f  20 73 77 69 74 63 68 2e  | want to switch.|
00001290  20 20 65 67 2e 22 27 20  0d 05 6e 2b 20 f2 6d 65  |  eg."' ..n+ .me|
000012a0  73 73 61 67 65 28 22 50  52 4f 43 74 75 72 6e 28  |ssage("PROCturn(|
000012b0  22 2b 6f 6e 24 2b 22 2c  32 29 22 2c 22 82 22 2c  |"+on$+",2)",".",|
000012c0  22 22 29 0d 05 78 0c 20  f2 70 72 6f 6d 70 74 0d  |"")..x. .prompt.|
000012d0  05 82 39 20 db 3a f2 6d  65 73 73 61 67 65 28 22  |..9 .:.message("|
000012e0  50 52 4f 43 74 75 72 6e  28 6f 6e 4f 52 6f 66 66  |PROCturn(onORoff|
000012f0  24 2c 6c 69 6e 65 6e 75  6d 62 65 72 29 22 2c 22  |$,linenumber)","|
00001300  84 22 2c 22 83 22 29 20  0d 05 8c 46 20 f1 27 27  |.",".") ...F .''|
00001310  22 4e 6f 77 20 74 72 79  20 6f 6e 65 20 6f 75 74  |"Now try one out|
00001320  2e 20 20 20 43 6f 6d 70  6c 65 74 65 20 74 68 65  |.   Complete the|
00001330  20 20 63 6f 6d 6d 61 6e  64 61 6e 64 20 70 72 65  |  commandand pre|
00001340  73 73 20 72 65 74 75 72  6e 2e 22 27 27 27 0d 05  |ss return."'''..|
00001350  96 2a 20 f2 6d 65 73 73  61 67 65 28 22 50 52 4f  |.* .message("PRO|
00001360  43 74 75 72 6e 28 20 20  20 20 20 20 20 20 22 2c  |Cturn(        ",|
00001370  22 82 22 2c 22 22 29 20  0d 05 a0 0e 20 ee 85 20  |".","") .... .. |
00001380  e4 20 8d 54 4c 43 0d 05  aa 13 20 f2 69 6e 70 75  |. .TLC.... .inpu|
00001390  74 28 32 30 2c 39 2c 38  29 0d 05 b4 25 20 e7 20  |t(20,9,8)...% . |
000013a0  c2 75 74 24 2c 31 29 3d  22 20 22 20 75 74 24 3d  |.ut$,1)=" " ut$=|
000013b0  c0 75 74 24 2c a9 28 75  74 24 29 2d 31 29 0d 05  |.ut$,.(ut$)-1)..|
000013c0  be 50 20 e7 20 c1 75 74  24 2c 34 2c 32 29 3d bd  |.P . .ut$,4,2)=.|
000013d0  33 34 2b 22 2c 22 20 6f  24 3d c1 75 74 24 2c 32  |34+"," o$=.ut$,2|
000013e0  2c 32 29 20 8b 20 e7 20  c1 75 74 24 2c 35 2c 32  |,2) . . .ut$,5,2|
000013f0  29 3d bd 33 34 2b 22 2c  22 20 6f 24 3d c1 75 74  |)=.34+"," o$=.ut|
00001400  24 2c 32 2c 33 29 20 8b  20 6f 24 3d 22 22 0d 05  |$,2,3) . o$=""..|
00001410  c8 1e 20 e7 20 c2 75 74  24 2c 31 29 3c 3e 22 29  |.. . .ut$,1)<>")|
00001420  22 20 8c 20 2a 46 58 31  32 35 20 20 0d 05 d2 1b  |" . *FX125  ....|
00001430  20 e7 20 c0 75 74 24 2c  31 29 3c 3e bd 33 34 8c  | . .ut$,1)<>.34.|
00001440  20 2a 46 58 31 32 35 0d  05 dc 1d 20 6c 69 6e 65  | *FX125.... line|
00001450  3d bb 28 c1 75 74 24 2c  a9 28 75 74 24 29 2d 31  |=.(.ut$,.(ut$)-1|
00001460  2c 31 29 29 0d 05 e6 13  20 f2 74 75 72 6e 28 6f  |,1)).... .turn(o|
00001470  24 2c 6c 69 6e 65 29 0d  05 f0 08 20 f2 6f 6b 0d  |$,line).... .ok.|
00001480  05 fa 08 20 ee 85 87 0d  06 04 06 20 e1 0d 06 0e  |... ....... ....|
00001490  0d 20 dd f2 74 72 79 74  6f 67 0d 06 18 17 20 e7  |. ..trytog.... .|
000014a0  20 46 4c 41 47 3d a3 20  f2 74 65 6c 6c 3a e1 20  | FLAG=. .tell:. |
000014b0  20 0d 06 22 31 20 db 3a  f2 6d 65 73 73 61 67 65  | .."1 .:.message|
000014c0  28 22 50 52 4f 43 74 6f  67 67 6c 65 28 6c 69 6e  |("PROCtoggle(lin|
000014d0  65 6e 75 6d 62 65 72 29  22 2c 22 84 22 2c 22 83  |enumber)",".",".|
000014e0  22 29 0d 06 2c 78 20 f1  27 27 22 54 68 69 73 20  |")..,x .''"This |
000014f0  20 70 72 6f 63 65 64 75  72 65 20 20 61 6c 6c 6f  | procedure  allo|
00001500  77 73 20 20 79 6f 75 20  74 6f 20 20 72 65 76 65  |ws  you to  reve|
00001510  72 73 65 74 68 65 20 73  74 61 74 65 20 20 6f 66  |rsethe state  of|
00001520  20 61 6e 79 20 20 6f 66  20 74 68 65 20 20 72 65  | any  of the  re|
00001530  6c 61 79 20 6f 75 74 70  75 74 73 6e 75 6d 62 65  |lay outputsnumbe|
00001540  72 65 64 20 30 20 74 6f  20 33 2e 20 20 46 69 72  |red 0 to 3.  Fir|
00001550  73 74 20 74 79 70 65 3a  22 27 0d 06 36 25 20 f2  |st type:"'..6% .|
00001560  6d 65 73 73 61 67 65 28  22 50 52 4f 43 74 6f 67  |message("PROCtog|
00001570  67 6c 65 28 22 2c 22 82  22 2c 22 22 29 20 20 0d  |gle(",".","")  .|
00001580  06 40 7e 20 f1 27 22 74  68 65 6e 20 20 69 6e 63  |.@~ .'"then  inc|
00001590  6c 75 64 65 20 20 6f 6e  65 20 20 27 70 61 72 61  |lude  one  'para|
000015a0  6d 65 74 65 72 27 20 20  69 6e 20 20 74 68 65 62  |meter'  in  theb|
000015b0  72 61 63 6b 65 74 73 2e  20 20 54 68 69 73 20 20  |rackets.  This  |
000015c0  73 68 6f 75 6c 64 20 62  65 20 74 68 65 20 6e 75  |should be the nu|
000015d0  6d 62 65 72 20 6f 66 74  68 65 20 72 65 6c 61 79  |mber ofthe relay|
000015e0  20 79 6f 75 20 77 61 6e  74 20 74 6f 20 27 74 6f  | you want to 'to|
000015f0  67 67 6c 65 27 2e 20 20  65 67 2e 22 27 0d 06 4a  |ggle'.  eg."'..J|
00001600  26 20 f2 6d 65 73 73 61  67 65 28 22 50 52 4f 43  |& .message("PROC|
00001610  74 6f 67 67 6c 65 28 32  29 22 2c 22 82 22 2c 22  |toggle(2)",".","|
00001620  22 29 20 0d 06 54 0c 20  f2 70 72 6f 6d 70 74 0d  |") ..T. .prompt.|
00001630  06 5e 31 20 db 3a f2 6d  65 73 73 61 67 65 28 22  |.^1 .:.message("|
00001640  50 52 4f 43 74 6f 67 67  6c 65 28 6c 69 6e 65 6e  |PROCtoggle(linen|
00001650  75 6d 62 65 72 29 22 2c  22 84 22 2c 22 83 22 29  |umber)",".",".")|
00001660  0d 06 68 46 20 f1 27 27  22 4e 6f 77 20 74 72 79  |..hF .''"Now try|
00001670  20 6f 6e 65 20 6f 75 74  2e 20 20 20 43 6f 6d 70  | one out.   Comp|
00001680  6c 65 74 65 20 74 68 65  20 20 63 6f 6d 6d 61 6e  |lete the  comman|
00001690  64 61 6e 64 20 70 72 65  73 73 20 72 65 74 75 72  |dand press retur|
000016a0  6e 2e 22 27 27 27 0d 06  72 2b 20 f2 6d 65 73 73  |n."'''..r+ .mess|
000016b0  61 67 65 28 22 50 52 4f  43 74 6f 67 67 6c 65 28  |age("PROCtoggle(|
000016c0  20 20 20 20 20 20 20 20  22 2c 22 82 22 2c 22 22  |        ",".",""|
000016d0  29 0d 06 7c 0e 20 ee 85  20 e4 20 8d 54 4c 43 0d  |)..|. .. . .TLC.|
000016e0  06 86 13 20 f2 69 6e 70  75 74 28 32 31 2c 39 2c  |... .input(21,9,|
000016f0  32 29 0d 06 90 2d 20 e7  20 97 28 c0 75 74 24 2c  |2)...- . .(.ut$,|
00001700  31 29 29 3e 35 31 20 84  20 97 28 c0 75 74 24 2c  |1))>51 . .(.ut$,|
00001710  31 29 29 3c 34 38 20 8c  20 2a 46 58 31 32 35 0d  |1))<48 . *FX125.|
00001720  06 9a 1e 20 e7 20 c2 75  74 24 2c 31 29 3c 3e 22  |... . .ut$,1)<>"|
00001730  29 22 20 8c 20 2a 46 58  31 32 35 20 20 0d 06 a4  |)" . *FX125  ...|
00001740  18 20 f2 74 6f 67 67 6c  65 28 bb 28 c0 75 74 24  |. .toggle(.(.ut$|
00001750  2c 31 29 29 29 0d 06 ae  08 20 f2 6f 6b 0d 06 b8  |,1))).... .ok...|
00001760  08 20 ee 85 87 0d 06 c2  06 20 e1 0d 06 cc 0e 20  |. ....... ..... |
00001770  dd f2 74 72 79 74 65 73  74 0d 06 d6 16 20 e7 20  |..trytest.... . |
00001780  46 4c 41 47 3d a3 20 f2  74 65 6c 6c 3a e1 20 0d  |FLAG=. .tell:. .|
00001790  06 e0 2e 20 db 3a f2 6d  65 73 73 61 67 65 28 22  |... .:.message("|
000017a0  46 4e 74 65 73 74 28 6c  69 6e 65 6e 75 6d 62 65  |FNtest(linenumbe|
000017b0  72 29 22 2c 22 84 22 2c  22 83 22 29 20 0d 06 ea  |r)",".",".") ...|
000017c0  78 20 f1 27 27 22 54 68  69 73 20 20 66 75 6e 63  |x .''"This  func|
000017d0  74 69 6f 6e 20 20 61 6c  6c 6f 77 73 20 79 6f 75  |tion  allows you|
000017e0  20 74 6f 20 20 74 65 73  74 20 20 74 68 65 73 74  | to  test  thest|
000017f0  61 74 65 20 20 6f 66 20  20 61 6e 79 20 20 6f 66  |ate  of  any  of|
00001800  20 20 74 68 65 20 20 64  69 67 69 74 61 6c 20 20  |  the  digital  |
00001810  69 6e 70 75 74 73 6e 75  6d 62 65 72 65 64 20 34  |inputsnumbered 4|
00001820  20 74 6f 20 37 2e 20 20  46 69 72 73 74 20 74 79  | to 7.  First ty|
00001830  70 65 3a 22 27 0d 06 f4  25 20 f2 6d 65 73 73 61  |pe:"'...% .messa|
00001840  67 65 28 22 50 52 49 4e  54 20 46 4e 74 65 73 74  |ge("PRINT FNtest|
00001850  28 22 2c 22 82 22 2c 22  22 29 0d 06 fe 7a 20 f1  |(",".","")...z .|
00001860  27 22 74 68 65 6e 20 20  69 6e 63 6c 75 64 65 20  |'"then  include |
00001870  20 6f 6e 65 20 20 27 70  61 72 61 6d 65 74 65 72  | one  'parameter|
00001880  27 20 20 69 6e 20 20 74  68 65 62 72 61 63 6b 65  |'  in  thebracke|
00001890  74 73 2e 20 20 54 68 69  73 20 20 73 68 6f 75 6c  |ts.  This  shoul|
000018a0  64 20 62 65 20 74 68 65  20 6e 75 6d 62 65 72 20  |d be the number |
000018b0  6f 66 74 68 65 20 69 6e  70 75 74 20 79 6f 75 20  |ofthe input you |
000018c0  77 61 6e 74 20 74 6f 20  74 65 73 74 2e 20 20 65  |want to test.  e|
000018d0  67 2e 22 27 0d 07 08 27  20 f2 6d 65 73 73 61 67  |g."'...' .messag|
000018e0  65 28 22 50 52 49 4e 54  20 46 4e 74 65 73 74 28  |e("PRINT FNtest(|
000018f0  37 29 22 2c 22 82 22 2c  22 22 29 0d 07 12 ad 20  |7)",".","").... |
00001900  f1 27 22 54 68 69 73 20  20 77 69 6c 6c 20 70 72  |.'"This  will pr|
00001910  69 6e 74 20 6f 75 74 20  22 6f 6e 24 22 20 69 66  |int out "on$" if|
00001920  20 74 68 65 20 20 79 65  6c 6c 6f 77 73 6f 63 6b  | the  yellowsock|
00001930  65 74 20 20 6d 61 72 6b  65 64 20 27 37 27 20 69  |et  marked '7' i|
00001940  73 20 20 63 6f 6e 6e 65  63 74 65 64 20 74 6f 20  |s  connected to |
00001950  20 6f 6e 65 6f 66 20 20  74 68 65 20 72 65 64 20  | oneof  the red |
00001960  73 6f 63 6b 65 74 73 2c  20 20 61 6e 64 20 22 6f  |sockets,  and "o|
00001970  66 66 24 22 20 69 66 20  69 74 20 69 73 63 6f 6e  |ff$" if it iscon|
00001980  6e 65 63 74 65 64 20 20  74 6f 20 6f 6e 65 20 6f  |nected  to one o|
00001990  66 20 20 74 68 65 20 67  72 65 65 6e 20 73 6f 63  |f  the green soc|
000019a0  6b 65 74 73 2e 22 20 20  0d 07 1c 0c 20 f2 70 72  |kets."  .... .pr|
000019b0  6f 6d 70 74 0d 07 26 2e  20 db 3a f2 6d 65 73 73  |ompt..&. .:.mess|
000019c0  61 67 65 28 22 46 4e 74  65 73 74 28 6c 69 6e 65  |age("FNtest(line|
000019d0  6e 75 6d 62 65 72 29 22  2c 22 84 22 2c 22 83 22  |number)",".","."|
000019e0  29 20 0d 07 30 47 20 f1  27 27 22 4e 6f 77 20 74  |) ..0G .''"Now t|
000019f0  72 79 20 6f 6e 65 20 6f  75 74 2e 20 20 20 43 6f  |ry one out.   Co|
00001a00  6d 70 6c 65 74 65 20 74  68 65 20 20 63 6f 6d 6d  |mplete the  comm|
00001a10  61 6e 64 61 6e 64 20 70  72 65 73 73 20 72 65 74  |andand press ret|
00001a20  75 72 6e 2e 22 27 27 27  20 0d 07 3a 2d 20 f2 6d  |urn."''' ..:- .m|
00001a30  65 73 73 61 67 65 28 22  50 52 49 4e 54 20 46 4e  |essage("PRINT FN|
00001a40  74 65 73 74 28 20 20 20  20 20 20 20 20 22 2c 22  |test(        ","|
00001a50  82 22 2c 22 22 29 0d 07  44 0e 20 ee 85 20 e4 20  |.","")..D. .. . |
00001a60  8d 54 4c 43 0d 07 4e 13  20 f2 69 6e 70 75 74 28  |.TLC..N. .input(|
00001a70  32 32 2c 39 2c 32 29 0d  07 58 31 20 e7 20 97 28  |22,9,2)..X1 . .(|
00001a80  c0 75 74 24 2c 31 29 29  3e 97 22 37 22 20 84 20  |.ut$,1))>."7" . |
00001a90  97 28 c0 75 74 24 2c 31  29 29 3c 97 22 34 22 20  |.(.ut$,1))<."4" |
00001aa0  8c 20 2a 46 58 31 32 35  0d 07 62 1e 20 e7 20 c2  |. *FX125..b. . .|
00001ab0  75 74 24 2c 31 29 3c 3e  22 29 22 20 8c 20 2a 46  |ut$,1)<>")" . *F|
00001ac0  58 31 32 35 20 20 0d 07  6c 14 20 6c 69 6e 65 3d  |X125  ..l. line=|
00001ad0  bb 28 c0 75 74 24 2c 31  29 29 0d 07 76 18 20 72  |.(.ut$,1))..v. r|
00001ae0  65 73 75 6c 74 24 3d a4  74 65 73 74 28 6c 69 6e  |esult$=.test(lin|
00001af0  65 29 0d 07 80 45 20 f1  27 27 27 27 3a f2 6d 65  |e)...E .'''':.me|
00001b00  73 73 61 67 65 28 22 4c  49 4e 45 20 22 2b c3 28  |ssage("LINE "+.(|
00001b10  6c 69 6e 65 29 2b 22 20  49 53 81 22 2b 72 65 73  |line)+" IS."+res|
00001b20  75 6c 74 24 2b 22 20 20  20 20 20 20 20 22 2c 22  |ult$+"       ","|
00001b30  85 22 2c 22 22 29 20 0d  07 8a 10 20 f1 27 27 3a  |.","") .... .'':|
00001b40  f2 70 72 6f 6d 70 74 0d  07 94 08 20 ee 85 87 0d  |.prompt.... ....|
00001b50  07 9e 06 20 e1 0d 07 a8  12 20 dd f2 74 72 79 6d  |... ..... ..trym|
00001b60  75 6c 6f 6e 6f 66 66 0d  07 b2 15 20 e7 20 46 4c  |ulonoff.... . FL|
00001b70  41 47 3d a3 20 f2 74 65  6c 6c 3a e1 0d 07 bc 3c  |AG=. .tell:....<|
00001b80  20 db 3a f2 6d 65 73 73  61 67 65 28 22 50 52 4f  | .:.message("PRO|
00001b90  43 6d 75 6c 74 69 74 75  72 6e 28 6f 6e 4f 52 6f  |Cmultiturn(onORo|
00001ba0  66 66 24 2c 70 61 74 74  65 72 6e 24 29 22 2c 22  |ff$,pattern$)","|
00001bb0  84 22 2c 22 83 22 29 20  0d 07 c6 62 20 f1 27 22  |.",".") ...b .'"|
00001bc0  54 68 69 73 20 70 72 6f  63 65 64 75 72 65 20 20  |This procedure  |
00001bd0  61 6c 6c 6f 77 73 20 79  6f 75 20 74 6f 20 74 75  |allows you to tu|
00001be0  72 6e 20 6f 6e 20 6f 72  6f 66 66 20 61 6e 79 20  |rn on oroff any |
00001bf0  67 72 6f 75 70 20 6f 66  20 74 68 65 20 72 65 6c  |group of the rel|
00001c00  61 79 20 6f 75 74 70 75  74 73 2e 22 27 22 46 69  |ay outputs."'"Fi|
00001c10  72 73 74 20 74 79 70 65  3a 22 0d 07 d0 26 20 f2  |rst type:"...& .|
00001c20  6d 65 73 73 61 67 65 28  22 50 52 4f 43 6d 75 6c  |message("PROCmul|
00001c30  74 69 74 75 72 6e 28 22  2c 22 82 22 2c 22 22 29  |titurn(",".","")|
00001c40  0d 07 da ea 20 f1 22 74  68 65 6e 20 20 69 6e 63  |.... ."then  inc|
00001c50  6c 75 64 65 20 20 74 77  6f 20 20 27 70 61 72 61  |lude  two  'para|
00001c60  6d 65 74 65 72 73 27 20  20 69 6e 20 74 68 65 62  |meters'  in theb|
00001c70  72 61 63 6b 65 74 73 2e  20 20 20 54 68 65 20 20  |rackets.   The  |
00001c80  66 69 72 73 74 20 20 73  68 6f 75 6c 64 20 20 20  |first  should   |
00001c90  73 70 65 63 69 66 79 77  68 65 74 68 65 72 20 20  |specifywhether  |
00001ca0  79 6f 75 20 20 77 61 6e  74 20 74 6f 20 74 75 72  |you  want to tur|
00001cb0  6e 20 20 6f 6e 20 6f 72  20 20 6f 66 66 20 2d 74  |n  on or  off -t|
00001cc0  79 70 65 20 20 22 6f 6e  24 22 20 6f 72 20 22 6f  |ype  "on$" or "o|
00001cd0  66 66 24 22 20 20 69 6e  20 63 61 70 69 74 61 6c  |ff$"  in capital|
00001ce0  20 20 6c 65 74 74 65 72  73 61 6e 64 20 20 65 6e  |  lettersand  en|
00001cf0  63 6c 6f 73 65 64 20 20  69 6e 20 69 6e 76 65 72  |closed  in inver|
00001d00  74 65 64 20 63 6f 6d 6d  61 73 2e 20 20 20 54 68  |ted commas.   Th|
00001d10  65 73 65 63 6f 6e 64 20  20 70 61 72 61 6d 65 74  |esecond  paramet|
00001d20  65 72 20 20 73 68 6f 75  22 3b 0d 07 e4 5e 20 f1  |er  shou";...^ .|
00001d30  22 6c 64 20 20 72 65 70  72 65 73 65 6e 74 20 74  |"ld  represent t|
00001d40  68 65 72 65 6c 61 79 73  20 20 79 6f 75 20 77 61  |herelays  you wa|
00001d50  6e 74 20 74 6f 20 20 73  77 69 74 63 68 20 20 61  |nt to  switch  a|
00001d60  73 20 61 20 62 69 6e 61  72 79 6e 75 6d 62 65 72  |s a binarynumber|
00001d70  20 77 69 74 68 20 66 6f  75 72 20 64 69 67 69 74  | with four digit|
00001d80  73 2e 20 20 65 67 2e 22  0d 07 ee 37 20 f2 6d 65  |s.  eg."...7 .me|
00001d90  73 73 61 67 65 28 22 50  52 4f 43 6d 75 6c 74 69  |ssage("PROCmulti|
00001da0  74 75 72 6e 28 22 2b 6f  6e 24 2b 22 2c 22 22 31  |turn("+on$+",""1|
00001db0  30 31 30 22 22 29 22 2c  22 82 22 2c 22 22 29 0d  |010"")",".","").|
00001dc0  07 f8 44 20 f1 22 77 6f  75 6c 64 20 74 75 72 6e  |..D ."would turn|
00001dd0  20 20 6f 6e 20 72 65 6c  61 79 73 20 33 20 61 6e  |  on relays 3 an|
00001de0  64 20 31 2e 20 54 72 79  20 61 20 66 65 77 74 6f  |d 1. Try a fewto|
00001df0  20 73 65 65 20 68 6f 77  20 69 74 20 77 6f 72 6b  | see how it work|
00001e00  73 2e 22 0d 08 02 0c 20  f2 70 72 6f 6d 70 74 0d  |s.".... .prompt.|
00001e10  08 0c 3c 20 db 3a f2 6d  65 73 73 61 67 65 28 22  |..< .:.message("|
00001e20  50 52 4f 43 6d 75 6c 74  69 74 75 72 6e 28 6f 6e  |PROCmultiturn(on|
00001e30  4f 52 6f 66 66 24 2c 70  61 74 74 65 72 6e 24 29  |ORoff$,pattern$)|
00001e40  22 2c 22 84 22 2c 22 83  22 29 20 0d 08 16 34 20  |",".",".") ...4 |
00001e50  f1 27 27 22 43 6f 6d 70  6c 65 74 65 20 74 68 65  |.''"Complete the|
00001e60  20 63 6f 6d 6d 61 6e 64  20 20 61 6e 64 20 20 70  | command  and  p|
00001e70  72 65 73 73 20 72 65 74  75 72 6e 2e 22 27 27 0d  |ress return."''.|
00001e80  08 20 31 20 f2 6d 65 73  73 61 67 65 28 22 50 52  |. 1 .message("PR|
00001e90  4f 43 6d 75 6c 74 69 74  75 72 6e 28 20 20 20 20  |OCmultiturn(    |
00001ea0  20 20 20 20 20 20 20 22  2c 22 82 22 2c 22 22 29  |       ",".","")|
00001eb0  0d 08 2a 0e 20 ee 85 20  e4 20 8d 54 4c 43 0d 08  |..*. .. . .TLC..|
00001ec0  34 15 20 f2 69 6e 70 75  74 28 32 31 2c 38 2c 31  |4. .input(21,8,1|
00001ed0  33 29 20 0d 08 3e 26 20  e7 20 c2 75 74 24 2c 31  |3) ..>& . .ut$,1|
00001ee0  29 3d 22 20 22 20 75 74  24 3d c0 75 74 24 2c a9  |)=" " ut$=.ut$,.|
00001ef0  28 75 74 24 29 2d 31 29  20 0d 08 48 50 20 e7 20  |(ut$)-1) ..HP . |
00001f00  c1 75 74 24 2c 34 2c 32  29 3d bd 33 34 2b 22 2c  |.ut$,4,2)=.34+",|
00001f10  22 20 6f 24 3d c1 75 74  24 2c 32 2c 32 29 20 8b  |" o$=.ut$,2,2) .|
00001f20  20 e7 20 c1 75 74 24 2c  35 2c 32 29 3d bd 33 34  | . .ut$,5,2)=.34|
00001f30  2b 22 2c 22 20 6f 24 3d  c1 75 74 24 2c 32 2c 33  |+"," o$=.ut$,2,3|
00001f40  29 20 8b 20 6f 24 3d 22  22 0d 08 52 23 20 e7 20  |) . o$=""..R# . |
00001f50  c2 75 74 24 2c 32 29 3c  3e bd 33 34 2b 22 29 22  |.ut$,2)<>.34+")"|
00001f60  20 8c 20 20 2a 46 58 31  32 35 20 20 0d 08 5c 1f  | .  *FX125  ..\.|
00001f70  20 70 61 74 74 65 72 6e  24 3d c1 75 74 24 2c a9  | pattern$=.ut$,.|
00001f80  28 75 74 24 29 2d 35 2c  34 29 20 0d 08 66 1c 20  |(ut$)-5,4) ..f. |
00001f90  f2 6d 75 6c 74 69 74 75  72 6e 28 6f 24 2c 70 61  |.multiturn(o$,pa|
00001fa0  74 74 65 72 6e 24 29 0d  08 70 08 20 f2 6f 6b 0d  |ttern$)..p. .ok.|
00001fb0  08 7a 08 20 ee 85 87 0d  08 84 06 20 e1 0d 08 8e  |.z. ....... ....|
00001fc0  10 20 dd f2 74 72 79 6d  75 6c 74 6f 67 0d 08 98  |. ..trymultog...|
00001fd0  15 20 e7 20 46 4c 41 47  3d a3 20 f2 74 65 6c 6c  |. . FLAG=. .tell|
00001fe0  3a e1 0d 08 a2 35 20 db  3a f2 6d 65 73 73 61 67  |:....5 .:.messag|
00001ff0  65 28 22 50 52 4f 43 6d  75 6c 74 69 74 6f 67 67  |e("PROCmultitogg|
00002000  6c 65 28 70 61 74 74 65  72 6e 24 29 22 2c 22 84  |le(pattern$)",".|
00002010  22 2c 22 83 22 29 20 0d  08 ac 62 20 f1 27 27 22  |",".") ...b .''"|
00002020  54 68 69 73 20 20 70 72  6f 63 65 64 75 72 65 20  |This  procedure |
00002030  61 6c 6c 6f 77 73 20 20  79 6f 75 20 74 6f 20 20  |allows  you to  |
00002040  27 74 6f 67 67 6c 65 27  6f 6e 20 6f 72 20 6f 66  |'toggle'on or of|
00002050  66 20 61 6e 79 20 67 72  6f 75 70 20 6f 66 20 74  |f any group of t|
00002060  68 65 20 72 65 6c 61 79  73 2e 22 27 22 46 69 72  |he relays."'"Fir|
00002070  73 74 20 74 79 70 65 3a  22 0d 08 b6 29 20 f2 6d  |st type:"...) .m|
00002080  65 73 73 61 67 65 28 22  50 52 4f 43 6d 75 6c 74  |essage("PROCmult|
00002090  69 74 6f 67 67 6c 65 28  22 2c 22 82 22 2c 22 22  |itoggle(",".",""|
000020a0  29 20 0d 08 c0 d6 20 f1  27 22 74 68 65 6e 20 20  |) .... .'"then  |
000020b0  69 6e 63 6c 75 64 65 20  20 6f 6e 65 20 20 27 70  |include  one  'p|
000020c0  61 72 61 6d 65 74 65 72  27 20 20 69 6e 20 20 74  |arameter'  in  t|
000020d0  68 65 62 72 61 63 6b 65  74 73 2e 20 20 20 54 68  |hebrackets.   Th|
000020e0  69 73 20 20 73 68 6f 75  6c 64 20 20 62 65 20 20  |is  should  be  |
000020f0  61 20 20 20 62 69 6e 61  72 79 72 65 70 72 65 73  |a   binaryrepres|
00002100  65 6e 74 61 74 69 6f 6e  20 20 6f 66 20 74 68 65  |entation  of the|
00002110  20 72 65 6c 61 79 73 20  20 79 6f 75 20 20 77 61  | relays  you  wa|
00002120  6e 74 74 6f 20 20 74 6f  67 67 6c 65 2e 20 20 46  |ntto  toggle.  F|
00002130  6f 75 72 20 20 62 69 6e  61 72 79 20 20 64 69 67  |our  binary  dig|
00002140  69 74 73 20 73 68 6f 75  6c 64 62 65 20 67 69 76  |its shouldbe giv|
00002150  65 6e 2c 20 20 65 6e 63  6c 6f 73 65 64 20 69 6e  |en,  enclosed in|
00002160  20 20 69 6e 76 65 72 74  65 64 20 63 6f 6d 6d 61  |  inverted comma|
00002170  73 2e 65 67 2e 22 20 20  0d 08 ca 31 20 f2 6d 65  |s.eg."  ...1 .me|
00002180  73 73 61 67 65 28 22 50  52 4f 43 6d 75 6c 74 69  |ssage("PROCmulti|
00002190  74 6f 67 67 6c 65 28 22  22 30 31 30 31 22 22 29  |toggle(""0101"")|
000021a0  22 2c 22 82 22 2c 22 22  29 0d 08 d4 4d 20 f1 27  |",".","")...M .'|
000021b0  22 54 68 69 73 20 77 6f  75 6c 64 20 74 6f 67 67  |"This would togg|
000021c0  6c 65 20 72 65 6c 61 79  73 20 30 20 61 6e 64 20  |le relays 0 and |
000021d0  32 2e 20 20 54 72 79 20  61 66 65 77 20 61 6e 64  |2.  Try afew and|
000021e0  20 73 65 65 20 68 6f 77  20 69 74 20 77 6f 72 6b  | see how it work|
000021f0  73 2e 22 20 20 20 0d 08  de 0c 20 f2 70 72 6f 6d  |s."   .... .prom|
00002200  70 74 0d 08 e8 35 20 db  3a f2 6d 65 73 73 61 67  |pt...5 .:.messag|
00002210  65 28 22 50 52 4f 43 6d  75 6c 74 69 74 6f 67 67  |e("PROCmultitogg|
00002220  6c 65 28 70 61 74 74 65  72 6e 24 29 22 2c 22 84  |le(pattern$)",".|
00002230  22 2c 22 83 22 29 20 0d  08 f2 34 20 f1 27 27 22  |",".") ...4 .''"|
00002240  43 6f 6d 70 6c 65 74 65  20 20 74 68 65 20 63 6f  |Complete  the co|
00002250  6d 6d 61 6e 64 20 61 6e  64 20 70 72 65 73 73 20  |mmand and press |
00002260  20 72 65 74 75 72 6e 2e  22 27 27 0d 08 fc 34 20  | return."''...4 |
00002270  f2 6d 65 73 73 61 67 65  28 22 50 52 4f 43 6d 75  |.message("PROCmu|
00002280  6c 74 69 74 6f 67 67 6c  65 28 20 20 20 20 20 20  |ltitoggle(      |
00002290  20 20 20 20 20 22 2c 22  82 22 2c 22 22 29 20 0d  |     ",".","") .|
000022a0  09 06 0e 20 ee 85 20 e4  20 8d 54 4c 43 0d 09 10  |... .. . .TLC...|
000022b0  14 20 f2 69 6e 70 75 74  28 32 32 2c 38 2c 37 29  |. .input(22,8,7)|
000022c0  20 0d 09 1a 30 20 e7 20  ac 28 c2 75 74 24 2c 32  | ...0 . .(.ut$,2|
000022d0  29 3d bd 33 34 2b 22 29  22 20 80 20 c0 75 74 24  |)=.34+")" . .ut$|
000022e0  2c 31 29 3d bd 33 34 29  20 8c 20 2a 46 58 31 32  |,1)=.34) . *FX12|
000022f0  35 0d 09 24 1e 20 70 61  74 74 65 72 6e 24 3d c1  |5..$. pattern$=.|
00002300  75 74 24 2c a9 28 75 74  24 29 2d 35 2c 34 29 0d  |ut$,.(ut$)-5,4).|
00002310  09 2e 1b 20 f2 6d 75 6c  74 69 74 6f 67 67 6c 65  |... .multitoggle|
00002320  28 70 61 74 74 65 72 6e  24 29 0d 09 38 08 20 f2  |(pattern$)..8. .|
00002330  6f 6b 0d 09 42 09 20 ee  85 87 20 0d 09 4c 06 20  |ok..B. ... ..L. |
00002340  e1 0d 09 56 11 20 dd f2  74 72 79 6d 75 6c 74 65  |...V. ..trymulte|
00002350  73 74 0d 09 60 16 20 e7  20 46 4c 41 47 3d a3 20  |st..`. . FLAG=. |
00002360  f2 74 65 6c 6c 3a e1 20  0d 09 6a 32 20 db 3a f2  |.tell:. ..j2 .:.|
00002370  6d 65 73 73 61 67 65 28  22 46 4e 6d 75 6c 74 69  |message("FNmulti|
00002380  74 65 73 74 28 70 61 74  74 65 72 6e 24 29 22 2c  |test(pattern$)",|
00002390  22 84 22 2c 22 83 22 29  20 20 0d 09 74 ab 20 f1  |".",".")  ..t. .|
000023a0  27 22 54 68 69 73 20 20  66 75 6e 63 74 69 6f 6e  |'"This  function|
000023b0  20 20 61 6c 6c 6f 77 73  20 79 6f 75 20 20 74 6f  |  allows you  to|
000023c0  20 74 65 73 74 20 20 61  6e 79 67 72 6f 75 70 20  | test  anygroup |
000023d0  6f 66 20 74 68 65 20 64  69 67 69 74 61 6c 20 69  |of the digital i|
000023e0  6e 70 75 74 73 2e 20 20  49 74 20 72 65 74 75 72  |nputs.  It retur|
000023f0  6e 73 74 68 65 20 72 65  73 75 6c 74 20 22 6f 6e  |nsthe result "on|
00002400  24 22 20 69 66 20 41 4c  4c 20 20 74 68 65 20 67  |$" if ALL  the g|
00002410  69 76 65 6e 20 69 6e 70  75 74 73 61 72 65 20 6f  |iven inputsare o|
00002420  6e 20 61 6e 64 20 22 6f  66 66 24 22 20 6f 74 68  |n and "off$" oth|
00002430  65 72 77 69 73 65 2e 20  20 46 69 72 73 74 20 74  |erwise.  First t|
00002440  79 70 65 3a 22 0d 09 7e  2b 20 f2 6d 65 73 73 61  |ype:"..~+ .messa|
00002450  67 65 28 22 50 52 49 4e  54 20 46 4e 6d 75 6c 74  |ge("PRINT FNmult|
00002460  69 74 65 73 74 28 22 2c  22 82 22 2c 22 22 29 20  |itest(",".","") |
00002470  0d 09 88 d1 20 f1 27 22  74 68 65 6e 20 20 69 6e  |.... .'"then  in|
00002480  63 6c 75 64 65 20 20 6f  6e 65 20 20 27 70 61 72  |clude  one  'par|
00002490  61 6d 65 74 65 72 27 20  20 69 6e 20 20 74 68 65  |ameter'  in  the|
000024a0  62 72 61 63 6b 65 74 73  2e 20 20 20 20 54 68 69  |brackets.    Thi|
000024b0  73 20 20 73 68 6f 75 6c  64 20 20 62 65 20 20 61  |s  should  be  a|
000024c0  20 20 62 69 6e 61 72 79  72 65 70 72 65 73 65 6e  |  binaryrepresen|
000024d0  74 61 74 69 6f 6e 20 20  6f 66 20 74 68 65 20 20  |tation  of the  |
000024e0  69 6e 70 75 74 73 20 79  6f 75 20 20 77 61 6e 74  |inputs you  want|
000024f0  74 6f 20 20 74 65 73 74  2e 20 20 46 6f 75 72 20  |to  test.  Four |
00002500  20 62 69 6e 61 72 79 20  64 69 67 69 74 73 20 73  | binary digits s|
00002510  68 6f 75 6c 64 20 62 65  67 69 76 65 6e 2c 20 65  |hould begiven, e|
00002520  6e 63 6c 6f 73 65 64 20  69 6e 20 69 6e 76 65 72  |nclosed in inver|
00002530  74 65 64 20 63 6f 6d 6d  61 73 2e 20 65 67 2e 22  |ted commas. eg."|
00002540  27 0d 09 92 33 20 f2 6d  65 73 73 61 67 65 28 22  |'...3 .message("|
00002550  50 52 49 4e 54 20 46 4e  6d 75 6c 74 69 74 65 73  |PRINT FNmultites|
00002560  74 28 22 22 30 31 30 31  22 22 29 22 2c 22 82 22  |t(""0101"")","."|
00002570  2c 22 22 29 0d 09 9c 4b  20 f1 27 22 54 68 69 73  |,"")...K .'"This|
00002580  20 20 77 6f 75 6c 64 20  20 74 65 73 74 20 69 6e  |  would  test in|
00002590  70 75 74 73 20 34 20 61  6e 64 20 36 2e 20 20 54  |puts 4 and 6.  T|
000025a0  72 79 20 61 66 65 77 20  61 6e 64 20 73 65 65 20  |ry afew and see |
000025b0  68 6f 77 20 69 74 20 77  6f 72 6b 73 2e 22 20 0d  |how it works." .|
000025c0  09 a6 0c 20 f2 70 72 6f  6d 70 74 0d 09 b0 30 20  |... .prompt...0 |
000025d0  db 3a f2 6d 65 73 73 61  67 65 28 22 46 4e 6d 75  |.:.message("FNmu|
000025e0  6c 74 69 74 65 73 74 28  70 61 74 74 65 72 6e 24  |ltitest(pattern$|
000025f0  29 22 2c 22 84 22 2c 22  83 22 29 0d 09 ba 34 20  |)",".",".")...4 |
00002600  f1 27 27 22 43 6f 6d 70  6c 65 74 65 20 20 74 68  |.''"Complete  th|
00002610  65 20 63 6f 6d 6d 61 6e  64 20 61 6e 64 20 70 72  |e command and pr|
00002620  65 73 73 20 20 72 65 74  75 72 6e 2e 22 27 27 0d  |ess  return."''.|
00002630  09 c4 36 20 f2 6d 65 73  73 61 67 65 28 22 50 52  |..6 .message("PR|
00002640  49 4e 54 20 46 4e 6d 75  6c 74 69 74 65 73 74 28  |INT FNmultitest(|
00002650  20 20 20 20 20 20 20 20  20 20 20 22 2c 22 82 22  |           ","."|
00002660  2c 22 22 29 20 0d 09 ce  0e 20 ee 85 20 e4 20 8d  |,"") .... .. . .|
00002670  54 4c 43 0d 09 d8 14 20  f2 69 6e 70 75 74 28 32  |TLC.... .input(2|
00002680  33 2c 38 2c 37 29 20 0d  09 e2 32 20 e7 20 ac 28  |3,8,7) ...2 . .(|
00002690  c2 75 74 24 2c 32 29 3d  bd 33 34 2b 22 29 22 20  |.ut$,2)=.34+")" |
000026a0  80 20 c0 75 74 24 2c 31  29 3d bd 33 34 29 20 8c  |. .ut$,1)=.34) .|
000026b0  20 2a 46 58 31 32 35 20  20 0d 09 ec 1e 20 70 61  | *FX125  .... pa|
000026c0  74 74 65 72 6e 24 3d c1  75 74 24 2c a9 28 75 74  |ttern$=.ut$,.(ut|
000026d0  24 29 2d 35 2c 34 29 0d  09 f6 21 20 72 65 73 75  |$)-5,4)...! resu|
000026e0  6c 74 24 3d a4 6d 75 6c  74 69 74 65 73 74 28 70  |lt$=.multitest(p|
000026f0  61 74 74 65 72 6e 24 29  0d 0a 00 30 20 f1 27 27  |attern$)...0 .''|
00002700  3a f2 6d 65 73 73 61 67  65 28 22 4c 49 4e 45 53  |:.message("LINES|
00002710  81 22 2b 72 65 73 75 6c  74 24 2b 22 20 20 20 22  |."+result$+"   "|
00002720  2c 22 85 22 2c 22 22 29  0d 0a 0a 0c 20 f2 70 72  |,".","").... .pr|
00002730  6f 6d 70 74 0d 0a 14 08  20 ee 85 87 0d 0a 1e 06  |ompt.... .......|
00002740  20 e1 0d 0a 28 1d 20 f4  20 2a 2a 2a 2a 2a 2a 2a  | ...(. . *******|
00002750  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
00002760  0a 32 1d 20 f4 20 2a 49  4e 54 45 52 46 41 43 45  |.2. . *INTERFACE|
00002770  20 50 52 4f 43 45 44 55  52 45 53 2a 0d 0a 3c 1e  | PROCEDURES*..<.|
00002780  20 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | . *************|
00002790  2a 2a 2a 2a 2a 2a 2a 2a  2a 20 0d 27 10 6e 20 f4  |********* .'.n .|
000027a0  20 2a 2a 2a 55 53 45 53  20 4f 53 42 59 54 45 2f  | ***USES OSBYTE/|
000027b0  2a 46 58 31 35 30 20 54  4f 20 45 58 41 4d 49 4e  |*FX150 TO EXAMIN|
000027c0  45 20 56 49 41 20 52 45  47 49 53 54 45 52 2e 20  |E VIA REGISTER. |
000027d0  52 45 51 55 49 52 45 53  20 4f 46 46 53 45 54 20  |REQUIRES OFFSET |
000027e0  4f 46 20 52 45 47 49 53  54 45 52 20 49 4e 20 50  |OF REGISTER IN P|
000027f0  41 47 45 20 26 46 45 20  41 53 20 50 41 52 41 4d  |AGE &FE AS PARAM|
00002800  45 54 45 52 2e 2a 2a 2a  0d 27 1a 15 20 dd 20 a4  |ETER.***.'.. . .|
00002810  70 65 65 6b 28 6f 66 66  73 65 74 29 20 0d 27 24  |peek(offset) .'$|
00002820  0c 20 ea 20 76 61 6c 75  65 0d 27 2e 3a 20 41 25  |. . value.'.: A%|
00002830  3d 31 35 30 3a 58 25 3d  6f 66 66 73 65 74 3a 76  |=150:X%=offset:v|
00002840  61 6c 75 65 3d 28 ba 28  26 46 46 46 34 29 20 80  |alue=(.(&FFF4) .|
00002850  20 26 46 46 30 30 30 30  29 20 81 20 26 31 30 30  | &FF0000) . &100|
00002860  30 30 20 0d 27 38 0b 20  3d 76 61 6c 75 65 0d 2a  |00 .'8. =value.*|
00002870  f8 94 20 f4 20 2a 2a 2a  55 53 45 53 20 4f 53 42  |.. . ***USES OSB|
00002880  59 54 45 2f 2a 46 58 31  35 31 20 54 4f 20 57 52  |YTE/*FX151 TO WR|
00002890  49 54 45 20 41 20 56 41  4c 55 45 20 54 4f 20 41  |ITE A VALUE TO A|
000028a0  20 56 49 41 20 52 45 47  49 53 54 45 52 2e 20 20  | VIA REGISTER.  |
000028b0  52 45 51 55 49 52 45 53  20 4f 46 46 53 45 54 20  |REQUIRES OFFSET |
000028c0  4f 46 20 52 45 47 49 53  54 45 52 20 49 4e 20 50  |OF REGISTER IN P|
000028d0  41 47 45 20 26 46 45 2c  20 41 4e 44 20 56 41 4c  |AGE &FE, AND VAL|
000028e0  55 45 20 54 4f 20 42 45  20 57 52 49 54 54 45 4e  |UE TO BE WRITTEN|
000028f0  20 41 53 20 50 41 52 41  4d 45 54 45 52 53 2e 2a  | AS PARAMETERS.*|
00002900  2a 2a 0d 2b 02 1a 20 dd  20 f2 70 6f 6b 65 28 6f  |**.+.. . .poke(o|
00002910  66 66 73 65 74 2c 76 61  6c 75 65 29 0d 2b 0c 27  |ffset,value).+.'|
00002920  20 41 25 3d 31 35 31 3a  58 25 3d 6f 66 66 73 65  | A%=151:X%=offse|
00002930  74 3a 59 25 3d 76 61 6c  75 65 3a d6 20 26 46 46  |t:Y%=value:. &FF|
00002940  46 34 20 0d 2b 16 08 20  e1 20 20 0d 2e e0 51 20  |F4 .+.. .  ...Q |
00002950  f4 20 2a 2a 2a 45 58 41  4d 49 4e 45 53 20 54 48  |. ***EXAMINES TH|
00002960  45 20 43 55 52 52 45 4e  54 20 53 54 41 54 45 20  |E CURRENT STATE |
00002970  4f 46 20 54 48 45 20 52  45 4c 41 59 20 53 50 45  |OF THE RELAY SPE|
00002980  43 49 46 49 45 44 20 41  4e 44 20 53 57 41 50 53  |CIFIED AND SWAPS|
00002990  20 49 54 20 4f 56 45 52  2e 2a 2a 2a 0d 2e ea 1b  | IT OVER.***....|
000029a0  20 dd 20 f2 74 6f 67 67  6c 65 28 6c 69 6e 65 6e  | . .toggle(linen|
000029b0  75 6d 62 65 72 29 20 0d  2e f4 2e 20 e7 20 28 6c  |umber) .... . (l|
000029c0  69 6e 65 6e 75 6d 62 65  72 3e 33 20 84 20 6c 69  |inenumber>3 . li|
000029d0  6e 65 6e 75 6d 62 65 72  3c 30 29 20 8c 20 2a 46  |nenumber<0) . *F|
000029e0  58 31 32 35 20 0d 2e fe  21 20 ea 20 62 69 74 76  |X125 ...! . bitv|
000029f0  61 6c 75 65 2c 6f 6c 64  76 61 6c 75 65 2c 6e 65  |alue,oldvalue,ne|
00002a00  77 76 61 6c 75 65 0d 2f  08 1a 20 62 69 74 76 61  |wvalue./.. bitva|
00002a10  6c 75 65 3d 32 5e 6c 69  6e 65 6e 75 6d 62 65 72  |lue=2^linenumber|
00002a20  0d 2f 12 1a 20 6f 6c 64  76 61 6c 75 65 3d a4 70  |./.. oldvalue=.p|
00002a30  65 65 6b 28 26 36 30 29  20 20 0d 2f 1c 21 20 6e  |eek(&60)  ./.! n|
00002a40  65 77 76 61 6c 75 65 3d  6f 6c 64 76 61 6c 75 65  |ewvalue=oldvalue|
00002a50  20 82 20 62 69 74 76 61  6c 75 65 0d 2f 26 18 20  | . bitvalue./&. |
00002a60  f2 70 6f 6b 65 28 26 36  30 2c 6e 65 77 76 61 6c  |.poke(&60,newval|
00002a70  75 65 29 0d 2f 30 08 20  e1 20 20 0d 32 c8 7e 20  |ue)./0. .  .2.~ |
00002a80  f4 20 2a 2a 2a 54 55 52  4e 53 20 4f 4e 20 4f 52  |. ***TURNS ON OR|
00002a90  20 4f 46 46 20 41 20 53  50 45 43 49 46 49 45 44  | OFF A SPECIFIED|
00002aa0  20 52 45 4c 41 59 2e 20  20 52 45 51 55 49 52 45  | RELAY.  REQUIRE|
00002ab0  53 20 41 43 54 49 4f 4e  20 54 4f 20 42 45 20 54  |S ACTION TO BE T|
00002ac0  41 4b 45 4e 20 69 65 2e  20 22 4f 4e 22 20 4f 52  |AKEN ie. "ON" OR|
00002ad0  20 22 4f 46 46 22 2c 20  41 4e 44 20 52 45 4c 41  | "OFF", AND RELA|
00002ae0  59 20 4e 55 4d 42 45 52  20 41 53 20 50 41 52 41  |Y NUMBER AS PARA|
00002af0  4d 45 54 45 52 53 2a 2a  2a 0d 32 d2 21 20 dd 20  |METERS***.2.! . |
00002b00  f2 74 75 72 6e 28 6f 6e  4f 52 6f 66 66 24 2c 6c  |.turn(onORoff$,l|
00002b10  69 6e 65 6e 75 6d 62 65  72 29 0d 32 dc 32 20 e7  |inenumber).2.2 .|
00002b20  20 ac 28 6f 6e 4f 52 6f  66 66 24 3d 22 4f 4e 22  | .(onORoff$="ON"|
00002b30  20 84 20 6f 6e 4f 52 6f  66 66 24 3d 22 4f 46 46  | . onORoff$="OFF|
00002b40  22 29 20 8c 20 2a 46 58  31 32 35 20 0d 32 e6 2e  |") . *FX125 .2..|
00002b50  20 e7 20 28 6c 69 6e 65  6e 75 6d 62 65 72 3e 33  | . (linenumber>3|
00002b60  20 84 20 6c 69 6e 65 6e  75 6d 62 65 72 3c 30 29  | . linenumber<0)|
00002b70  20 8c 20 2a 46 58 31 32  35 20 0d 32 f0 21 20 ea  | . *FX125 .2.! .|
00002b80  20 62 69 74 76 61 6c 75  65 2c 6f 6c 64 76 61 6c  | bitvalue,oldval|
00002b90  75 65 2c 6e 65 77 76 61  6c 75 65 0d 32 fa 1a 20  |ue,newvalue.2.. |
00002ba0  62 69 74 76 61 6c 75 65  3d 32 5e 6c 69 6e 65 6e  |bitvalue=2^linen|
00002bb0  75 6d 62 65 72 0d 33 04  19 20 6f 6c 64 76 61 6c  |umber.3.. oldval|
00002bc0  75 65 3d a4 70 65 65 6b  28 26 36 30 29 20 0d 33  |ue=.peek(&60) .3|
00002bd0  0e 58 20 e7 20 6f 6e 4f  52 6f 66 66 24 3d 22 4f  |.X . onORoff$="O|
00002be0  4e 22 20 8c 20 6e 65 77  76 61 6c 75 65 3d 6f 6c  |N" . newvalue=ol|
00002bf0  64 76 61 6c 75 65 20 84  20 62 69 74 76 61 6c 75  |dvalue . bitvalu|
00002c00  65 20 8b 20 6e 65 77 76  61 6c 75 65 3d 6f 6c 64  |e . newvalue=old|
00002c10  76 61 6c 75 65 20 80 20  28 32 35 35 2d 62 69 74  |value . (255-bit|
00002c20  76 61 6c 75 65 29 0d 33  18 18 20 f2 70 6f 6b 65  |value).3.. .poke|
00002c30  28 26 36 30 2c 6e 65 77  76 61 6c 75 65 29 0d 33  |(&60,newvalue).3|
00002c40  22 06 20 e1 0d 36 b0 66  20 f4 20 2a 2a 2a 54 45  |". ..6.f . ***TE|
00002c50  53 54 53 20 54 48 45 20  43 55 52 52 45 4e 54 20  |STS THE CURRENT |
00002c60  53 54 41 54 45 20 4f 46  20 54 48 45 20 53 50 45  |STATE OF THE SPE|
00002c70  43 49 46 49 45 44 20 49  4e 50 55 54 20 28 34 2d  |CIFIED INPUT (4-|
00002c80  37 29 20 41 4e 44 20 52  45 54 55 52 4e 53 20 54  |7) AND RETURNS T|
00002c90  48 45 20 56 41 4c 55 45  20 22 4f 4e 22 20 4f 52  |HE VALUE "ON" OR|
00002ca0  20 22 4f 46 46 22 2e 2a  2a 2a 0d 36 ba 19 20 dd  | "OFF".***.6.. .|
00002cb0  20 a4 74 65 73 74 28 6c  69 6e 65 6e 75 6d 62 65  | .test(linenumbe|
00002cc0  72 29 20 0d 36 c4 2f 20  e7 20 28 6c 69 6e 65 6e  |r) .6./ . (linen|
00002cd0  75 6d 62 65 72 3e 37 20  84 20 6c 69 6e 65 6e 75  |umber>7 . linenu|
00002ce0  6d 62 65 72 3c 34 29 20  8c 20 2a 46 58 31 32 35  |mber<4) . *FX125|
00002cf0  20 20 0d 36 ce 0f 20 ea  20 62 69 74 76 61 6c 75  |  .6.. . bitvalu|
00002d00  65 0d 36 d8 1a 20 62 69  74 76 61 6c 75 65 3d 32  |e.6.. bitvalue=2|
00002d10  5e 6c 69 6e 65 6e 75 6d  62 65 72 0d 36 e2 2e 20  |^linenumber.6.. |
00002d20  72 65 73 75 6c 74 3d 28  28 a4 70 65 65 6b 28 26  |result=((.peek(&|
00002d30  36 30 29 20 80 20 62 69  74 76 61 6c 75 65 29 3d  |60) . bitvalue)=|
00002d40  62 69 74 76 61 6c 75 65  29 0d 36 ec 1e 20 e7 20  |bitvalue).6.. . |
00002d50  72 65 73 75 6c 74 20 8c  20 3d 22 4f 4e 22 20 8b  |result . ="ON" .|
00002d60  20 3d 22 4f 46 46 22 0d  3a 98 99 20 f4 20 2a 2a  | ="OFF".:.. . **|
00002d70  2a 54 45 53 54 53 20 54  48 45 20 53 54 41 54 45  |*TESTS THE STATE|
00002d80  20 4f 46 20 54 48 45 20  53 50 45 43 49 46 49 45  | OF THE SPECIFIE|
00002d90  44 20 52 45 4c 41 59 53  20 49 4e 20 54 55 52 4e  |D RELAYS IN TURN|
00002da0  20 41 4e 44 20 53 57 41  50 53 20 54 48 45 4d 2e  | AND SWAPS THEM.|
00002db0  20 52 45 51 55 49 52 45  53 20 41 20 53 54 52 49  | REQUIRES A STRI|
00002dc0  4e 47 20 52 45 50 52 45  53 45 4e 54 49 4e 47 20  |NG REPRESENTING |
00002dd0  54 48 45 20 52 45 4c 41  59 53 20 54 4f 20 42 45  |THE RELAYS TO BE|
00002de0  20 54 4f 47 47 4c 45 44  20 41 53 20 41 20 42 49  | TOGGLED AS A BI|
00002df0  4e 41 52 59 20 50 41 54  54 45 52 4e 2e 2a 2a 2a  |NARY PATTERN.***|
00002e00  0d 3a a2 1e 20 dd 20 f2  6d 75 6c 74 69 74 6f 67  |.:.. . .multitog|
00002e10  67 6c 65 28 70 61 74 74  65 72 6e 24 29 20 0d 3a  |gle(pattern$) .:|
00002e20  ac 23 20 ea 20 4c 2c 4c  24 2c 6d 61 73 6b 25 2c  |.# . L,L$,mask%,|
00002e30  6f 6c 64 76 61 6c 75 65  2c 6e 65 77 76 61 6c 75  |oldvalue,newvalu|
00002e40  65 0d 3a b6 1e 20 e7 20  a9 28 70 61 74 74 65 72  |e.:.. . .(patter|
00002e50  6e 24 29 3c 3e 34 20 8c  20 2a 46 58 31 32 35 0d  |n$)<>4 . *FX125.|
00002e60  3a c0 3e 20 e3 20 4c 3d  31 20 b8 20 34 3a 4c 24  |:.> . L=1 . 4:L$|
00002e70  3d c1 70 61 74 74 65 72  6e 24 2c 4c 2c 31 29 3a  |=.pattern$,L,1):|
00002e80  e7 20 ac 28 4c 24 3d 22  31 22 20 84 20 4c 24 3d  |. .(L$="1" . L$=|
00002e90  22 30 22 29 20 8c 20 2a  46 58 31 32 35 0d 3a ca  |"0") . *FX125.:.|
00002ea0  06 20 ed 0d 3a d4 45 20  6d 61 73 6b 25 3d 30 3a  |. ..:.E mask%=0:|
00002eb0  e3 20 4c 3d 31 20 b8 20  34 3a e7 20 28 c1 70 61  |. L=1 . 4:. (.pa|
00002ec0  74 74 65 72 6e 24 2c 4c  2c 31 29 3d 22 31 22 29  |ttern$,L,1)="1")|
00002ed0  20 8c 20 6d 61 73 6b 25  3d 6d 61 73 6b 25 2b 32  | . mask%=mask%+2|
00002ee0  5e 28 34 2d 4c 29 20 20  0d 3a de 06 20 ed 0d 3a  |^(4-L)  .:.. ..:|
00002ef0  e8 32 20 6f 6c 64 76 61  6c 75 65 3d a4 70 65 65  |.2 oldvalue=.pee|
00002f00  6b 28 26 36 30 29 3a 6e  65 77 76 61 6c 75 65 3d  |k(&60):newvalue=|
00002f10  6f 6c 64 76 61 6c 75 65  20 82 20 6d 61 73 6b 25  |oldvalue . mask%|
00002f20  0d 3a f2 18 20 f2 70 6f  6b 65 28 26 36 30 2c 6e  |.:.. .poke(&60,n|
00002f30  65 77 76 61 6c 75 65 29  0d 3a fc 06 20 e1 0d 3e  |ewvalue).:.. ..>|
00002f40  80 ca 20 f4 20 2a 2a 2a  54 55 52 4e 53 20 4f 4e  |.. . ***TURNS ON|
00002f50  20 4f 52 20 4f 46 46 20  54 48 45 20 53 50 45 43  | OR OFF THE SPEC|
00002f60  49 46 49 45 44 20 47 52  4f 55 50 20 4f 46 20 52  |IFIED GROUP OF R|
00002f70  45 4c 41 59 53 2e 20 20  52 45 51 55 49 52 45 53  |ELAYS.  REQUIRES|
00002f80  20 54 57 4f 20 50 41 52  41 4d 45 54 45 52 53 3a  | TWO PARAMETERS:|
00002f90  2d 28 69 29 54 48 45 20  41 43 54 49 4f 4e 20 54  |-(i)THE ACTION T|
00002fa0  4f 20 42 45 20 54 41 4b  45 4e 20 69 65 2e 22 4f  |O BE TAKEN ie."O|
00002fb0  4e 22 20 4f 52 20 22 4f  46 46 22 2c 20 28 69 69  |N" OR "OFF", (ii|
00002fc0  29 41 20 53 54 52 49 4e  47 20 52 45 50 52 45 53  |)A STRING REPRES|
00002fd0  45 4e 54 49 4e 47 20 54  48 45 20 52 45 4c 41 59  |ENTING THE RELAY|
00002fe0  53 20 54 4f 20 42 45 20  53 57 49 54 43 48 45 44  |S TO BE SWITCHED|
00002ff0  20 41 53 20 41 20 42 49  4e 41 52 59 20 50 41 54  | AS A BINARY PAT|
00003000  54 45 52 4e 2e 2a 2a 2a  0d 3e 8a 24 20 dd 20 f2  |TERN.***.>.$ . .|
00003010  6d 75 6c 74 69 74 75 72  6e 28 6f 6e 4f 52 6f 66  |multiturn(onORof|
00003020  66 24 2c 70 61 74 74 65  72 6e 24 29 0d 3e 94 23  |f$,pattern$).>.#|
00003030  20 ea 20 4c 2c 4c 24 2c  6d 61 73 6b 25 2c 6f 6c  | . L,L$,mask%,ol|
00003040  64 76 61 6c 75 65 2c 6e  65 77 76 61 6c 75 65 0d  |dvalue,newvalue.|
00003050  3e 9e 42 20 e7 20 a9 28  70 61 74 74 65 72 6e 24  |>.B . .(pattern$|
00003060  29 3c 3e 34 20 84 20 ac  28 6f 6e 4f 52 6f 66 66  |)<>4 . .(onORoff|
00003070  24 3d 22 4f 4e 22 20 84  20 6f 6e 4f 52 6f 66 66  |$="ON" . onORoff|
00003080  24 3d 22 4f 46 46 22 29  20 8c 20 2a 46 58 31 32  |$="OFF") . *FX12|
00003090  35 0d 3e a8 3e 20 e3 20  4c 3d 31 20 b8 20 34 3a  |5.>.> . L=1 . 4:|
000030a0  4c 24 3d c1 70 61 74 74  65 72 6e 24 2c 4c 2c 31  |L$=.pattern$,L,1|
000030b0  29 3a e7 20 ac 28 4c 24  3d 22 31 22 20 84 20 4c  |):. .(L$="1" . L|
000030c0  24 3d 22 30 22 29 20 8c  20 2a 46 58 31 32 35 0d  |$="0") . *FX125.|
000030d0  3e b2 06 20 ed 0d 3e bc  45 20 6d 61 73 6b 25 3d  |>.. ..>.E mask%=|
000030e0  30 3a e3 20 4c 3d 31 20  b8 20 34 3a e7 20 28 c1  |0:. L=1 . 4:. (.|
000030f0  70 61 74 74 65 72 6e 24  2c 4c 2c 31 29 3d 22 31  |pattern$,L,1)="1|
00003100  22 29 20 8c 20 6d 61 73  6b 25 3d 6d 61 73 6b 25  |") . mask%=mask%|
00003110  2b 32 5e 28 34 2d 4c 29  20 20 0d 3e c6 06 20 ed  |+2^(4-L)  .>.. .|
00003120  0d 3e d0 66 20 6f 6c 64  76 61 6c 75 65 3d a4 70  |.>.f oldvalue=.p|
00003130  65 65 6b 28 26 36 30 29  3a e7 20 6f 6e 4f 52 6f  |eek(&60):. onORo|
00003140  66 66 24 3d 22 4f 4e 22  20 8c 20 6e 65 77 76 61  |ff$="ON" . newva|
00003150  6c 75 65 3d 6f 6c 64 76  61 6c 75 65 20 84 20 6d  |lue=oldvalue . m|
00003160  61 73 6b 25 20 8b 20 6e  65 77 76 61 6c 75 65 3d  |ask% . newvalue=|
00003170  6f 6c 64 76 61 6c 75 65  20 80 20 28 32 35 35 2d  |oldvalue . (255-|
00003180  6d 61 73 6b 25 29 0d 3e  da 18 20 f2 70 6f 6b 65  |mask%).>.. .poke|
00003190  28 26 36 30 2c 6e 65 77  76 61 6c 75 65 29 0d 3e  |(&60,newvalue).>|
000031a0  e4 06 20 e1 0d 42 68 d3  20 f4 20 2a 2a 2a 54 45  |.. ..Bh. . ***TE|
000031b0  53 54 53 20 54 48 45 20  53 50 45 43 49 46 49 45  |STS THE SPECIFIE|
000031c0  44 20 47 52 4f 55 50 20  4f 46 20 49 4e 50 55 54  |D GROUP OF INPUT|
000031d0  53 20 41 4e 44 20 52 45  54 55 52 4e 53 20 54 48  |S AND RETURNS TH|
000031e0  45 20 56 41 4c 55 45 20  22 4f 4e 22 20 49 46 20  |E VALUE "ON" IF |
000031f0  41 4c 4c 20 4f 46 20 54  48 45 4d 20 41 52 45 20  |ALL OF THEM ARE |
00003200  4f 4e 20 41 4e 44 20 22  4f 46 46 22 20 49 46 20  |ON AND "OFF" IF |
00003210  41 4e 59 20 4f 4e 45 20  4f 46 20 54 48 45 4d 20  |ANY ONE OF THEM |
00003220  49 53 20 4f 46 46 2e 20  20 52 45 51 55 49 52 45  |IS OFF.  REQUIRE|
00003230  53 20 41 20 53 54 52 49  4e 47 20 52 45 50 52 45  |S A STRING REPRE|
00003240  53 45 4e 54 49 4e 47 20  54 48 45 20 49 4e 50 55  |SENTING THE INPU|
00003250  54 53 20 54 4f 20 42 45  20 54 45 53 54 45 44 20  |TS TO BE TESTED |
00003260  41 53 20 41 20 42 49 4e  41 52 59 20 50 41 54 54  |AS A BINARY PATT|
00003270  45 52 4e 2e 2a 2a 2a 0d  42 72 1c 20 dd 20 a4 6d  |ERN.***.Br. . .m|
00003280  75 6c 74 69 74 65 73 74  28 70 61 74 74 65 72 6e  |ultitest(pattern|
00003290  24 29 20 0d 42 7c 1c 20  ea 20 4c 2c 4c 24 2c 74  |$) .B|. . L,L$,t|
000032a0  65 73 74 6d 61 73 6b 25  2c 72 65 73 75 6c 74 0d  |estmask%,result.|
000032b0  42 86 1e 20 e7 20 a9 28  70 61 74 74 65 72 6e 24  |B.. . .(pattern$|
000032c0  29 3c 3e 34 20 8c 20 2a  46 58 31 32 35 0d 42 90  |)<>4 . *FX125.B.|
000032d0  3e 20 e3 20 4c 3d 31 20  b8 20 34 3a 4c 24 3d c1  |> . L=1 . 4:L$=.|
000032e0  70 61 74 74 65 72 6e 24  2c 4c 2c 31 29 3a e7 20  |pattern$,L,1):. |
000032f0  ac 28 4c 24 3d 22 31 22  20 84 20 4c 24 3d 22 30  |.(L$="1" . L$="0|
00003300  22 29 20 8c 20 2a 46 58  31 32 35 0d 42 9a 06 20  |") . *FX125.B.. |
00003310  ed 0d 42 a4 50 20 74 65  73 74 6d 61 73 6b 25 3d  |..B.P testmask%=|
00003320  30 3a e3 20 4c 3d 31 20  b8 20 34 3a e7 20 28 c1  |0:. L=1 . 4:. (.|
00003330  70 61 74 74 65 72 6e 24  2c 4c 2c 31 29 3d 22 31  |pattern$,L,1)="1|
00003340  22 29 20 8c 20 74 65 73  74 6d 61 73 6b 25 3d 74  |") . testmask%=t|
00003350  65 73 74 6d 61 73 6b 25  2b 32 5e 28 38 2d 4c 29  |estmask%+2^(8-L)|
00003360  20 0d 42 ae 06 20 ed 0d  42 b8 31 20 72 65 73 75  | .B.. ..B.1 resu|
00003370  6c 74 3d 28 28 a4 70 65  65 6b 28 26 36 30 29 20  |lt=((.peek(&60) |
00003380  80 20 74 65 73 74 6d 61  73 6b 25 29 3d 74 65 73  |. testmask%)=tes|
00003390  74 6d 61 73 6b 25 29 20  0d 42 c2 1e 20 e7 20 72  |tmask%) .B.. . r|
000033a0  65 73 75 6c 74 20 8c 20  3d 22 4f 4e 22 20 8b 20  |esult . ="ON" . |
000033b0  3d 22 4f 46 46 22 0d 46  50 6c 20 f4 20 2a 2a 2a  |="OFF".FPl . ***|
000033c0  49 4e 49 54 49 41 4c 49  53 45 53 20 55 53 45 52  |INITIALISES USER|
000033d0  20 50 4f 52 54 20 41 53  20 46 4f 55 52 20 4f 55  | PORT AS FOUR OU|
000033e0  54 50 55 54 53 20 4f 4e  20 50 42 30 2d 33 20 41  |TPUTS ON PB0-3 A|
000033f0  4e 44 20 46 4f 55 52 20  49 4e 50 55 54 53 20 4f  |ND FOUR INPUTS O|
00003400  4e 20 50 42 34 2d 37 2e  20 54 55 52 4e 53 20 41  |N PB4-7. TURNS A|
00003410  4c 4c 20 4f 55 54 50 55  54 53 20 4f 46 46 2e 2a  |LL OUTPUTS OFF.*|
00003420  2a 2a 0d 46 5a 13 20 dd  20 f2 73 65 74 5f 75 70  |**.FZ. . .set_up|
00003430  5f 70 6f 72 74 0d 46 64  12 20 f2 70 6f 6b 65 28  |_port.Fd. .poke(|
00003440  26 36 32 2c 31 35 29 0d  46 6e 11 20 f2 70 6f 6b  |&62,15).Fn. .pok|
00003450  65 28 26 36 30 2c 30 29  0d 46 78 06 20 e1 0d ff  |e(&60,0).Fx. ...|
00003460
INTTEST.m0
INTTEST.m1
INTTEST.m2
INTTEST.m4
INTTEST.m5