Home » Personal collection » Acorn DFS disks » dfs_box04_disk06_pilot_one.scp » INTCAR

INTCAR

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_disk06_pilot_one.scp
Filename: INTCAR
Read OK:
File size: 20D9 bytes
Load address: FF1600
Exec address: FF8023
Duplicates

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

File contents
   10 REM ***COPYRIGHT PILOT ONE LTD., 1984***
   20 MODE 7
   30 ARR$=CHR$136+CHR$91+CHR$137:NOA$="   "  
   40 *FX229,1
   50 *KEY10 O.|M
   60 *FX4,1
   70 VDU 23,1,0;0;0;0;
   80 DIM drive_index%(1,19),no_of_steps%(19)
   90 DIM ctrbl% 4,buffer% 4
  100 DIM dir$(2),code$(2)
  110 dir$(0)="FORWARDS ":dir$(1)="BACKWARDS":dir$(2)="OFF      "
  120 code$(0)="01":code$(1)="10":code$(2)="00"
  130 n%=10
  140 PROCset_up_port
  150 s%=0
  160 REPEAT
  170 PROCmenu
  180 V=0:H=0:PROCfind(28,4,1,5,0,2)  
  190 IF V=0 AND s%>0 PROCdisplay:V=0 
  200 IF V=1 PROCclear_route:s%=0:PROCmake_route:V=1
  210 IF V=2 AND s%>0 PROCedit_route:V=2
  220 IF V=3 AND s%>0 PROCdrive_route:V=3 
  230 IF V=4 MODE 7:PROCend
  240 UNTILFALSE
  250 DEF PROCend
  260 *FX229,0
  270 *FX4,0
  280 VDU 23,1,1;0;0;0;
  290 END
  300 DEF PROCclear_route
  310 FOR I%=0 TO 19:drive_index%(0,I%)=0:drive_index%(1,I%)=0:no_of_steps%(I%)=0:NEXTI% 
  320 ENDPROC
  330 DEF PROCmake_route
  340 REPEAT
  350 REPEAT
  360 PROCget(s%) 
  370 PRINTTAB(0,23)"�RETURN TO CONFIRM, ESCAPE TO REENTER";:REPEAT:dummy=GET:UNTILdummy=13 OR dummy=27 
  380 UNTIL dummy=13
  390 IF s%<=19 PRINTTAB(0,23)"�        ANOTHER STEP?   (Y/N)       ";:REPEAT:dummy=GET:dummy=dummy AND 223:UNTILdummy=ASC"Y" OR dummy=ASC"N" 
  400 IF s%<=19 AND dummy=ASC"Y" s%=s%+1 
  410 UNTIL s%>19 OR dummy=ASC"N"  
  420 IF s%<=19 s%=s%+1
  430 ENDPROC
  440 DEF PROCget(stage%)  
  450 CLS:PROCmessage("STAGE NO."+STR$(stage%+1),"�","�"):PRINT'''' 
  460 PRINTTAB(7);"LEFT  MOTOR? ";:FOR I%=0TO2:PRINTTAB(22,I%+7)dir$(I%):NEXT 
  470 PROCinstruct
  480 V=0:H=0:PROCfind(33,7,1,3,0,1)
  490 drive_index%(0,stage%)=V
  500 PRINT TAB(21,7)"�";dir$(V)TAB(22,8)SPC9TAB(22,9)SPC9
  510 PRINT'''TAB(7);"RIGHT MOTOR? ";:FOR I%=0TO2:PRINTTAB(22,I%+13)dir$(I%):NEXT   
  520 V=0:H=0:PROCfind(33,13,1,3,0,1)
  530 drive_index%(1,stage%)=V
  540 PRINT TAB(21,13)"�";dir$(V)TAB(22,14)SPC9TAB(22,15)SPC9
  550 PROCinstruct2
  560 REPEAT:PRINTTAB(7,19)"STEPS? (1-100)�     ";:VDU 8,8,8,8,8:PROCinput(48,57,3)
  570 VDU7
  580 IF LENut$>0 no_of_steps%=EVAL(ut$) ELSE no_of_steps%=0
  590 VDU 11:UNTILno_of_steps%>0 AND no_of_steps%<=100  
  600 no_of_steps%(stage%)=no_of_steps%
  610 ENDPROC
  620 DEFPROCinstruct2
  630 PRINT TAB(0,23)SPC7;"�ENTER AND PRESS RETURN"SPC9
  640 ENDPROC
  650 DEFPROCfind(X,Y,M,N,W,D)
  660 REPEAT 
  670 REPEAT
  680 PRINTTAB(X+(H*W),Y+(V*D));ARR$
  690 A=GET
  700 UNTIL(A>135ANDA<140)ORA=13
  710 PRINTTAB(X+(H*W),Y+(V*D));NOA$ 
  720 IFA=138ANDV<(N-1)THENV=V+1ELSEIFA=139ANDV>0V=V-1 
  730 IFA=137ANDH<(M-1)THENH=H+1ELSEIFA=136ANDH>0H=H-1
  740 UNTILA=13:VDU7
  750 ENDPROC
  760 DEFPROCinput(minchar%,maxchar%,maxlen%)
  770 VDU 23,1,1;0;0;0;
  780 le%=0
  790 ut$=""
  800 REPEAT
  810 REPEAT:A=GET:IF (A<minchar% OR A>maxchar%) AND A<>13 AND A<>127 VDU 7
  820 UNTIL (A>=minchar% AND A<=maxchar%) OR A=13 OR A=127
  830 IF (A=127 AND le%>0) VDU 127 ELSE IF A<>13 AND le%<maxlen% AND A<>127 PRINTCHR$(A);
  840 IF (A<>13 AND le%=maxlen% AND A<>127) OR (A=127 AND le%=0) VDU 7
  850 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
  860 UNTIL A=13
  870 VDU 23,1,0;0;0;0;
  880 ENDPROC
  890 DEFPROCmessage(M$,fo$,ba$) 
  900 FORI%=0TO1
  910 IF ba$="":PRINT; ELSE PRINTba$;CHR$157;
  920 PRINTfo$;CHR$141TAB(INT(40-LEN(M$))/2);M$
  930 NEXT
  940 ENDPROC 
  950 DEF PROCmenu  
  960 CLS:PROCmessage("PILOT ONE - INTCAR","�","�") 
  970 PRINTTAB(10,4)"DISPLAY SEQUENCE"TAB(10,6)"CREATE SEQUENCE"TAB(10,8)"EDIT SEQUENCE"TAB(10,10)"RUN SEQUENCE"TAB(9,12)"�EXIT FROM PROGRAM�"  
  980 PROCinstruct
  990 ENDPROC
 1000 DEFPROCinstruct
 1010 PRINTTAB(2,23)CHR$131"USE ARROW KEYS AND RETURN TO SELECT" 
 1020 ENDPROC
 1030 DEF PROCdrive_route
 1040 FOR stage%=0 TO s%-1
 1050 CLS:PROCmessage("STAGE NO."+STR$(stage%+1),"�","�")
 1060 PRINT'''
 1070 PROCmessage("LEFT  MOTOR - "+dir$(drive_index%(0,stage%)),"�","")
 1080 PRINT'''
 1090 PROCmessage("RIGHT MOTOR - "+dir$(drive_index%(1,stage%)),"�","") 
 1100 PRINT'''
 1110 PROCmessage(STR$(no_of_steps%(stage%))+" STEPS","�","")
 1120 TIME=0:PROCmultiturn("ON",code$(drive_index%(1,stage%))+code$(drive_index%(0,stage%)))
 1130 REPEAT:UNTILTIME>no_of_steps%(stage%)*n%  
 1140 PROCmultiturn("OFF","1111")  
 1150 NEXT stage%
 1160 PRINTTAB(6,23)"�PRESS ANY KEY TO CONTINUE":dummy=GET
 1170 ENDPROC
 1180 DEF PROCedit_route
 1190 REPEAT
 1200 PROCedit_menu
 1210 V=0:H=0:PROCfind(30,4,1,6,0,2)
 1220 IF V=0 AND s%>0 PROCdisplay:V=0
 1230 IF V=1 PROCdelete(FNwhich_stage):V=1
 1240 IF V=2 AND s%<20 PROCinsert(FNwhich_stage):V=2 
 1250 IF V=3 PROCget(FNwhich_stage-1):V=3
 1260 IF V=4 AND s%<20 PROCmake_route:V=4
 1270 UNTILV=5 OR s%=0 
 1280 ENDPROC
 1290 DEF PROCedit_menu
 1300 CLS:PROCmessage("INTCAR - EDIT MENU","�","�") 
 1310 PRINTTAB(10,4)"DISPLAY SEQUENCE"TAB(10,6)"DELETE STAGE"TAB(10,8)"INSERT STAGE"TAB(10,10)"EDIT STAGE"TAB(10,12)"ADD TO SEQUENCE"TAB(9,14)"�RETURN TO MAIN MENU�"
 1320 PROCinstruct
 1330 ENDPROC
 1340 DEF PROCdisplay
 1350 CLS:PROCmessage("INTCAR - SEQUENCE DISPLAY","�","�")
 1360 PRINT TAB(2,3)"�LEFT  MOTOR"TAB(18,3)"RIGHT MOTOR"TAB(33,3)"STEPS"
 1370 PRINTTAB(8,23)"�PRESS SHIFT TO SCROLL" 
 1380 VDU 28,0,21,39,5,14
 1390 FOR I%=0 TO s%-1
 1400 PRINTSPC(2-LEN(STR$(I%+1)))STR$(I%+1);
 1410 PRINTTAB(4)dir$(drive_index%(0,I%))TAB(19)dir$(drive_index%(1,I%));
 1420 PRINTTAB(34)SPC(3-LEN(STR$(no_of_steps%(I%))))STR$(no_of_steps%(I%))'
 1430 NEXT
 1440 VDU 26,15:PRINTTAB(6,23)"�PRESS ANY KEY TO CONTINUE"  
 1450 *FX21,0
 1460 A=GET
 1470 VDU7
 1480 ENDPROC
 1490 DEF FNwhich_stage
 1500 IF s%=1 THEN =1
 1510 CLS:PROCmessage("SELECT STAGE","�","�")
 1520 REPEAT
 1530 PROCinstruct2
 1540 PRINTTAB(8,10)"�STAGE NUMBER (1-"STR$s%")...  ";:VDU8,8
 1550 PROCinput(48,57,2)
 1560 IF LENut$>0 stage%=EVAL(ut$) ELSE stage%=0  
 1570 VDU 11:UNTILstage%>0 AND stage%<=s%
 1580 =stage%
 1590 DEF PROCdelete(stage%)
 1600 IF stage%=20 s%=19:ENDPROC
 1610 FOR I%=stage% TO s%-1
 1620 drive_index%(0,I%-1)=drive_index%(0,I%):drive_index%(1,I%-1)=drive_index%(1,I%):no_of_steps%(I%-1)=no_of_steps%(I%)
 1630 NEXT
 1640 s%=s%-1
 1650 ENDPROC
 1660 DEF PROCinsert(stage%)
 1670 FOR I%=s% TO stage% STEP -1
 1680 drive_index%(0,I%)=drive_index%(0,I%-1):drive_index%(1,I%)=drive_index%(1,I%-1):no_of_steps%(I%)=no_of_steps%(I%-1)
 1690 NEXT
 1700 REPEAT
 1710 PROCget(stage%-1)
 1720 PRINTTAB(0,23)"�RETURN TO CONFIRM, ESCAPE TO REENTER";:REPEAT:dummy=GET:UNTILdummy=13 OR dummy=27
 1730 UNTILdummy=13
 1740 s%=s%+1
 1750 ENDPROC
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

+ � ***COPYRIGHT PILOT ONE LTD., 1984***
 � 7
$ ARR$=�136+�91+�137:NOA$="   "  
(
 *FX229,1
2 *KEY10 O.|M
< *FX4,1
F � 23,1,0;0;0;0;
P* � drive_index%(1,19),no_of_steps%(19)
Z � ctrbl% 4,buffer% 4
d � dir$(2),code$(2)
n@ dir$(0)="FORWARDS ":dir$(1)="BACKWARDS":dir$(2)="OFF      "
x. code$(0)="01":code$(1)="10":code$(2)="00"
�
 n%=10
� �set_up_port
�	 s%=0
� �
�
 �menu
�" V=0:H=0:�find(28,4,1,5,0,2)  
� � V=0 � s%>0 �display:V=0 
�, � V=1 �clear_route:s%=0:�make_route:V=1
�! � V=2 � s%>0 �edit_route:V=2
�# � V=3 � s%>0 �drive_route:V=3 
� � V=4 � 7:�end
� ��
� � �end

 *FX229,0
 *FX4,0
 � 23,1,1;0;0;0;
" �
, � �clear_route
6R � I%=0 � 19:drive_index%(0,I%)=0:drive_index%(1,I%)=0:no_of_steps%(I%)=0:�I% 
@ �
J � �make_route
T �
^ �
h �get(s%) 
rT �0,23)"�RETURN TO CONFIRM, ESCAPE TO REENTER";:�:dummy=�:�dummy=13 � dummy=27 
| � dummy=13
�s � s%<=19 �0,23)"�        ANOTHER STEP?   (Y/N)       ";:�:dummy=�:dummy=dummy � 223:�dummy=�"Y" � dummy=�"N" 
�# � s%<=19 � dummy=�"Y" s%=s%+1 
� � s%>19 � dummy=�"N"  
� � s%<=19 s%=s%+1
� �
� � �get(stage%)  
�7 �:�message("STAGE NO."+�(stage%+1),"�","�"):�'''' 
�9 �7);"LEFT  MOTOR? ";:� I%=0�2:�22,I%+7)dir$(I%):� 
� �instruct
�  V=0:H=0:�find(33,7,1,3,0,1)
� drive_index%(0,stage%)=V
�( � �21,7)"�";dir$(V)�22,8)�9�22,9)�9
�? �'''�7);"RIGHT MOTOR? ";:� I%=0�2:�22,I%+13)dir$(I%):�   
! V=0:H=0:�find(33,13,1,3,0,1)
 drive_index%(1,stage%)=V
+ � �21,13)"�";dir$(V)�22,14)�9�22,15)�9
& �instruct2
0A �:�7,19)"STEPS? (1-100)�     ";:� 8,8,8,8,8:�input(48,57,3)
: �7
D2 � �ut$>0 no_of_steps%=�(ut$) � no_of_steps%=0
N/ � 11:�no_of_steps%>0 � no_of_steps%<=100  
X& no_of_steps%(stage%)=no_of_steps%
b �
l ��instruct2
v+ � �0,23)�7;"�ENTER AND PRESS RETURN"�9
� �
� ��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
� �
�' ��input(minchar%,maxchar%,maxlen%)
 � 23,1,1;0;0;0;

 le%=0
 ut$=""
  �
*; �:A=�:� (A<minchar% � A>maxchar%) � A<>13 � A<>127 � 7
41 � (A>=minchar% � A<=maxchar%) � A=13 � A=127
>D � (A=127 � le%>0) � 127 � � A<>13 � le%<maxlen% � A<>127 �(A);
H; � (A<>13 � le%=maxlen% � A<>127) � (A=127 � le%=0) � 7
Rd � 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
f � 23,1,0;0;0;0;
p �
z ��message(M$,fo$,ba$) 
� �I%=0�1
� � ba$="":�; � �ba$;�157;
�  �fo$;�141��(40-�(M$))/2);M$
� �
� � 
� � �menu  
�. �:�message("PILOT ONE - INTCAR","�","�") 
�| �10,4)"DISPLAY SEQUENCE"�10,6)"CREATE SEQUENCE"�10,8)"EDIT SEQUENCE"�10,10)"RUN SEQUENCE"�9,12)"�EXIT FROM PROGRAM�"  
� �instruct
� �
� ��instruct
�6 �2,23)�131"USE ARROW KEYS AND RETURN TO SELECT" 
� �
 � �drive_route
 � stage%=0 � s%-1
0 �:�message("STAGE NO."+�(stage%+1),"�","�")
$	 �'''
.C �message("LEFT  MOTOR - "+dir$(drive_index%(0,stage%)),"�","")
8	 �'''
BD �message("RIGHT MOTOR - "+dir$(drive_index%(1,stage%)),"�","") 
L	 �'''
V6 �message(�(no_of_steps%(stage%))+" STEPS","�","")
`U �=0:�multiturn("ON",code$(drive_index%(1,stage%))+code$(drive_index%(0,stage%)))
j# �:��>no_of_steps%(stage%)*n%  
t �multiturn("OFF","1111")  
~
 � stage%
�0 �6,23)"�PRESS ANY KEY TO CONTINUE":dummy=�
� �
� � �edit_route
� �
� �edit_menu
�  V=0:H=0:�find(30,4,1,6,0,2)
� � V=0 � s%>0 �display:V=0
�$ � V=1 �delete(�which_stage):V=1
�- � V=2 � s%<20 �insert(�which_stage):V=2 
�# � V=3 �get(�which_stage-1):V=3
�" � V=4 � s%<20 �make_route:V=4
� �V=5 � s%=0 
 �

 � �edit_menu
. �:�message("INTCAR - EDIT MENU","�","�") 
� �10,4)"DISPLAY SEQUENCE"�10,6)"DELETE STAGE"�10,8)"INSERT STAGE"�10,10)"EDIT STAGE"�10,12)"ADD TO SEQUENCE"�9,14)"�RETURN TO MAIN MENU�"
( �instruct
2 �
< � �display
F4 �:�message("INTCAR - SEQUENCE DISPLAY","�","�")
P: � �2,3)"�LEFT  MOTOR"�18,3)"RIGHT MOTOR"�33,3)"STEPS"
Z% �8,23)"�PRESS SHIFT TO SCROLL" 
d � 28,0,21,39,5,14
n � I%=0 � s%-1
x �(2-�(�(I%+1)))�(I%+1);
�> �4)dir$(drive_index%(0,I%))�19)dir$(drive_index%(1,I%));
�9 �34)�(3-�(�(no_of_steps%(I%))))�(no_of_steps%(I%))'
� �
�2 � 26,15:�6,23)"�PRESS ANY KEY TO CONTINUE"  
� *FX21,0
� A=�
� �7
� �
� � �which_stage
� � s%=1 � =1
�' �:�message("SELECT STAGE","�","�")
� �
� �instruct2
0 �8,10)"�STAGE NUMBER (1-"�s%")...  ";:�8,8
 �input(48,57,2)
( � �ut$>0 stage%=�(ut$) � stage%=0  
"  � 11:�stage%>0 � stage%<=s%
, =stage%
6 � �delete(stage%)
@ � stage%=20 s%=19:�
J � I%=stage% � s%-1
Tx drive_index%(0,I%-1)=drive_index%(0,I%):drive_index%(1,I%-1)=drive_index%(1,I%):no_of_steps%(I%-1)=no_of_steps%(I%)
^ �
h s%=s%-1
r �
| � �insert(stage%)
� � I%=s% � stage% � -1
�x drive_index%(0,I%)=drive_index%(0,I%-1):drive_index%(1,I%)=drive_index%(1,I%-1):no_of_steps%(I%)=no_of_steps%(I%-1)
� �
� �
� �get(stage%-1)
�S �0,23)"�RETURN TO CONFIRM, ESCAPE TO REENTER";:�:dummy=�:�dummy=13 � dummy=27
� �dummy=13
� s%=s%+1
� �
'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 2b 20 f4 20 2a  2a 2a 43 4f 50 59 52 49  |...+ . ***COPYRI|
00000010  47 48 54 20 50 49 4c 4f  54 20 4f 4e 45 20 4c 54  |GHT PILOT ONE LT|
00000020  44 2e 2c 20 31 39 38 34  2a 2a 2a 0d 00 14 08 20  |D., 1984***.... |
00000030  eb 20 37 0d 00 1e 24 20  41 52 52 24 3d bd 31 33  |. 7...$ ARR$=.13|
00000040  36 2b bd 39 31 2b bd 31  33 37 3a 4e 4f 41 24 3d  |6+.91+.137:NOA$=|
00000050  22 20 20 20 22 20 20 0d  00 28 0d 20 2a 46 58 32  |"   "  ..(. *FX2|
00000060  32 39 2c 31 0d 00 32 10  20 2a 4b 45 59 31 30 20  |29,1..2. *KEY10 |
00000070  4f 2e 7c 4d 0d 00 3c 0b  20 2a 46 58 34 2c 31 0d  |O.|M..<. *FX4,1.|
00000080  00 46 14 20 ef 20 32 33  2c 31 2c 30 3b 30 3b 30  |.F. . 23,1,0;0;0|
00000090  3b 30 3b 0d 00 50 2a 20  de 20 64 72 69 76 65 5f  |;0;..P* . drive_|
000000a0  69 6e 64 65 78 25 28 31  2c 31 39 29 2c 6e 6f 5f  |index%(1,19),no_|
000000b0  6f 66 5f 73 74 65 70 73  25 28 31 39 29 0d 00 5a  |of_steps%(19)..Z|
000000c0  19 20 de 20 63 74 72 62  6c 25 20 34 2c 62 75 66  |. . ctrbl% 4,buf|
000000d0  66 65 72 25 20 34 0d 00  64 17 20 de 20 64 69 72  |fer% 4..d. . dir|
000000e0  24 28 32 29 2c 63 6f 64  65 24 28 32 29 0d 00 6e  |$(2),code$(2)..n|
000000f0  40 20 64 69 72 24 28 30  29 3d 22 46 4f 52 57 41  |@ dir$(0)="FORWA|
00000100  52 44 53 20 22 3a 64 69  72 24 28 31 29 3d 22 42  |RDS ":dir$(1)="B|
00000110  41 43 4b 57 41 52 44 53  22 3a 64 69 72 24 28 32  |ACKWARDS":dir$(2|
00000120  29 3d 22 4f 46 46 20 20  20 20 20 20 22 0d 00 78  |)="OFF      "..x|
00000130  2e 20 63 6f 64 65 24 28  30 29 3d 22 30 31 22 3a  |. code$(0)="01":|
00000140  63 6f 64 65 24 28 31 29  3d 22 31 30 22 3a 63 6f  |code$(1)="10":co|
00000150  64 65 24 28 32 29 3d 22  30 30 22 0d 00 82 0a 20  |de$(2)="00".... |
00000160  6e 25 3d 31 30 0d 00 8c  11 20 f2 73 65 74 5f 75  |n%=10.... .set_u|
00000170  70 5f 70 6f 72 74 0d 00  96 09 20 73 25 3d 30 0d  |p_port.... s%=0.|
00000180  00 a0 06 20 f5 0d 00 aa  0a 20 f2 6d 65 6e 75 0d  |... ..... .menu.|
00000190  00 b4 22 20 56 3d 30 3a  48 3d 30 3a f2 66 69 6e  |.." V=0:H=0:.fin|
000001a0  64 28 32 38 2c 34 2c 31  2c 35 2c 30 2c 32 29 20  |d(28,4,1,5,0,2) |
000001b0  20 0d 00 be 1f 20 e7 20  56 3d 30 20 80 20 73 25  | .... . V=0 . s%|
000001c0  3e 30 20 f2 64 69 73 70  6c 61 79 3a 56 3d 30 20  |>0 .display:V=0 |
000001d0  0d 00 c8 2c 20 e7 20 56  3d 31 20 f2 63 6c 65 61  |..., . V=1 .clea|
000001e0  72 5f 72 6f 75 74 65 3a  73 25 3d 30 3a f2 6d 61  |r_route:s%=0:.ma|
000001f0  6b 65 5f 72 6f 75 74 65  3a 56 3d 31 0d 00 d2 21  |ke_route:V=1...!|
00000200  20 e7 20 56 3d 32 20 80  20 73 25 3e 30 20 f2 65  | . V=2 . s%>0 .e|
00000210  64 69 74 5f 72 6f 75 74  65 3a 56 3d 32 0d 00 dc  |dit_route:V=2...|
00000220  23 20 e7 20 56 3d 33 20  80 20 73 25 3e 30 20 f2  |# . V=3 . s%>0 .|
00000230  64 72 69 76 65 5f 72 6f  75 74 65 3a 56 3d 33 20  |drive_route:V=3 |
00000240  0d 00 e6 13 20 e7 20 56  3d 34 20 eb 20 37 3a f2  |.... . V=4 . 7:.|
00000250  65 6e 64 0d 00 f0 07 20  fd a3 0d 00 fa 0b 20 dd  |end.... ...... .|
00000260  20 f2 65 6e 64 0d 01 04  0d 20 2a 46 58 32 32 39  | .end.... *FX229|
00000270  2c 30 0d 01 0e 0b 20 2a  46 58 34 2c 30 0d 01 18  |,0.... *FX4,0...|
00000280  14 20 ef 20 32 33 2c 31  2c 31 3b 30 3b 30 3b 30  |. . 23,1,1;0;0;0|
00000290  3b 0d 01 22 06 20 e0 0d  01 2c 13 20 dd 20 f2 63  |;..". ...,. . .c|
000002a0  6c 65 61 72 5f 72 6f 75  74 65 0d 01 36 52 20 e3  |lear_route..6R .|
000002b0  20 49 25 3d 30 20 b8 20  31 39 3a 64 72 69 76 65  | I%=0 . 19:drive|
000002c0  5f 69 6e 64 65 78 25 28  30 2c 49 25 29 3d 30 3a  |_index%(0,I%)=0:|
000002d0  64 72 69 76 65 5f 69 6e  64 65 78 25 28 31 2c 49  |drive_index%(1,I|
000002e0  25 29 3d 30 3a 6e 6f 5f  6f 66 5f 73 74 65 70 73  |%)=0:no_of_steps|
000002f0  25 28 49 25 29 3d 30 3a  ed 49 25 20 0d 01 40 06  |%(I%)=0:.I% ..@.|
00000300  20 e1 0d 01 4a 12 20 dd  20 f2 6d 61 6b 65 5f 72  | ...J. . .make_r|
00000310  6f 75 74 65 0d 01 54 06  20 f5 0d 01 5e 06 20 f5  |oute..T. ...^. .|
00000320  0d 01 68 0e 20 f2 67 65  74 28 73 25 29 20 0d 01  |..h. .get(s%) ..|
00000330  72 54 20 f1 8a 30 2c 32  33 29 22 83 52 45 54 55  |rT ..0,23)".RETU|
00000340  52 4e 20 54 4f 20 43 4f  4e 46 49 52 4d 2c 20 45  |RN TO CONFIRM, E|
00000350  53 43 41 50 45 20 54 4f  20 52 45 45 4e 54 45 52  |SCAPE TO REENTER|
00000360  22 3b 3a f5 3a 64 75 6d  6d 79 3d a5 3a fd 64 75  |";:.:dummy=.:.du|
00000370  6d 6d 79 3d 31 33 20 84  20 64 75 6d 6d 79 3d 32  |mmy=13 . dummy=2|
00000380  37 20 0d 01 7c 0f 20 fd  20 64 75 6d 6d 79 3d 31  |7 ..|. . dummy=1|
00000390  33 0d 01 86 73 20 e7 20  73 25 3c 3d 31 39 20 f1  |3...s . s%<=19 .|
000003a0  8a 30 2c 32 33 29 22 83  20 20 20 20 20 20 20 20  |.0,23)".        |
000003b0  41 4e 4f 54 48 45 52 20  53 54 45 50 3f 20 20 20  |ANOTHER STEP?   |
000003c0  28 59 2f 4e 29 20 20 20  20 20 20 20 22 3b 3a f5  |(Y/N)       ";:.|
000003d0  3a 64 75 6d 6d 79 3d a5  3a 64 75 6d 6d 79 3d 64  |:dummy=.:dummy=d|
000003e0  75 6d 6d 79 20 80 20 32  32 33 3a fd 64 75 6d 6d  |ummy . 223:.dumm|
000003f0  79 3d 97 22 59 22 20 84  20 64 75 6d 6d 79 3d 97  |y=."Y" . dummy=.|
00000400  22 4e 22 20 0d 01 90 23  20 e7 20 73 25 3c 3d 31  |"N" ...# . s%<=1|
00000410  39 20 80 20 64 75 6d 6d  79 3d 97 22 59 22 20 73  |9 . dummy=."Y" s|
00000420  25 3d 73 25 2b 31 20 0d  01 9a 1b 20 fd 20 73 25  |%=s%+1 .... . s%|
00000430  3e 31 39 20 84 20 64 75  6d 6d 79 3d 97 22 4e 22  |>19 . dummy=."N"|
00000440  20 20 0d 01 a4 15 20 e7  20 73 25 3c 3d 31 39 20  |  .... . s%<=19 |
00000450  73 25 3d 73 25 2b 31 0d  01 ae 06 20 e1 0d 01 b8  |s%=s%+1.... ....|
00000460  15 20 dd 20 f2 67 65 74  28 73 74 61 67 65 25 29  |. . .get(stage%)|
00000470  20 20 0d 01 c2 37 20 db  3a f2 6d 65 73 73 61 67  |  ...7 .:.messag|
00000480  65 28 22 53 54 41 47 45  20 4e 4f 2e 22 2b c3 28  |e("STAGE NO."+.(|
00000490  73 74 61 67 65 25 2b 31  29 2c 22 84 22 2c 22 83  |stage%+1),".",".|
000004a0  22 29 3a f1 27 27 27 27  20 0d 01 cc 39 20 f1 8a  |"):.'''' ...9 ..|
000004b0  37 29 3b 22 4c 45 46 54  20 20 4d 4f 54 4f 52 3f  |7);"LEFT  MOTOR?|
000004c0  20 22 3b 3a e3 20 49 25  3d 30 b8 32 3a f1 8a 32  | ";:. I%=0.2:..2|
000004d0  32 2c 49 25 2b 37 29 64  69 72 24 28 49 25 29 3a  |2,I%+7)dir$(I%):|
000004e0  ed 20 0d 01 d6 0e 20 f2  69 6e 73 74 72 75 63 74  |. .... .instruct|
000004f0  0d 01 e0 20 20 56 3d 30  3a 48 3d 30 3a f2 66 69  |...  V=0:H=0:.fi|
00000500  6e 64 28 33 33 2c 37 2c  31 2c 33 2c 30 2c 31 29  |nd(33,7,1,3,0,1)|
00000510  0d 01 ea 1d 20 64 72 69  76 65 5f 69 6e 64 65 78  |.... drive_index|
00000520  25 28 30 2c 73 74 61 67  65 25 29 3d 56 0d 01 f4  |%(0,stage%)=V...|
00000530  28 20 f1 20 8a 32 31 2c  37 29 22 81 22 3b 64 69  |( . .21,7)".";di|
00000540  72 24 28 56 29 8a 32 32  2c 38 29 89 39 8a 32 32  |r$(V).22,8).9.22|
00000550  2c 39 29 89 39 0d 01 fe  3f 20 f1 27 27 27 8a 37  |,9).9...? .'''.7|
00000560  29 3b 22 52 49 47 48 54  20 4d 4f 54 4f 52 3f 20  |);"RIGHT MOTOR? |
00000570  22 3b 3a e3 20 49 25 3d  30 b8 32 3a f1 8a 32 32  |";:. I%=0.2:..22|
00000580  2c 49 25 2b 31 33 29 64  69 72 24 28 49 25 29 3a  |,I%+13)dir$(I%):|
00000590  ed 20 20 20 0d 02 08 21  20 56 3d 30 3a 48 3d 30  |.   ...! V=0:H=0|
000005a0  3a f2 66 69 6e 64 28 33  33 2c 31 33 2c 31 2c 33  |:.find(33,13,1,3|
000005b0  2c 30 2c 31 29 0d 02 12  1d 20 64 72 69 76 65 5f  |,0,1).... drive_|
000005c0  69 6e 64 65 78 25 28 31  2c 73 74 61 67 65 25 29  |index%(1,stage%)|
000005d0  3d 56 0d 02 1c 2b 20 f1  20 8a 32 31 2c 31 33 29  |=V...+ . .21,13)|
000005e0  22 81 22 3b 64 69 72 24  28 56 29 8a 32 32 2c 31  |".";dir$(V).22,1|
000005f0  34 29 89 39 8a 32 32 2c  31 35 29 89 39 0d 02 26  |4).9.22,15).9..&|
00000600  0f 20 f2 69 6e 73 74 72  75 63 74 32 0d 02 30 41  |. .instruct2..0A|
00000610  20 f5 3a f1 8a 37 2c 31  39 29 22 53 54 45 50 53  | .:..7,19)"STEPS|
00000620  3f 20 28 31 2d 31 30 30  29 81 20 20 20 20 20 22  |? (1-100).     "|
00000630  3b 3a ef 20 38 2c 38 2c  38 2c 38 2c 38 3a f2 69  |;:. 8,8,8,8,8:.i|
00000640  6e 70 75 74 28 34 38 2c  35 37 2c 33 29 0d 02 3a  |nput(48,57,3)..:|
00000650  07 20 ef 37 0d 02 44 32  20 e7 20 a9 75 74 24 3e  |. .7..D2 . .ut$>|
00000660  30 20 6e 6f 5f 6f 66 5f  73 74 65 70 73 25 3d a0  |0 no_of_steps%=.|
00000670  28 75 74 24 29 20 8b 20  6e 6f 5f 6f 66 5f 73 74  |(ut$) . no_of_st|
00000680  65 70 73 25 3d 30 0d 02  4e 2f 20 ef 20 31 31 3a  |eps%=0..N/ . 11:|
00000690  fd 6e 6f 5f 6f 66 5f 73  74 65 70 73 25 3e 30 20  |.no_of_steps%>0 |
000006a0  80 20 6e 6f 5f 6f 66 5f  73 74 65 70 73 25 3c 3d  |. no_of_steps%<=|
000006b0  31 30 30 20 20 0d 02 58  26 20 6e 6f 5f 6f 66 5f  |100  ..X& no_of_|
000006c0  73 74 65 70 73 25 28 73  74 61 67 65 25 29 3d 6e  |steps%(stage%)=n|
000006d0  6f 5f 6f 66 5f 73 74 65  70 73 25 0d 02 62 06 20  |o_of_steps%..b. |
000006e0  e1 0d 02 6c 10 20 dd f2  69 6e 73 74 72 75 63 74  |...l. ..instruct|
000006f0  32 0d 02 76 2b 20 f1 20  8a 30 2c 32 33 29 89 37  |2..v+ . .0,23).7|
00000700  3b 22 83 45 4e 54 45 52  20 41 4e 44 20 50 52 45  |;".ENTER AND PRE|
00000710  53 53 20 52 45 54 55 52  4e 22 89 39 0d 02 80 06  |SS RETURN".9....|
00000720  20 e1 0d 02 8a 18 20 dd  f2 66 69 6e 64 28 58 2c  | ..... ..find(X,|
00000730  59 2c 4d 2c 4e 2c 57 2c  44 29 0d 02 94 07 20 f5  |Y,M,N,W,D).... .|
00000740  20 0d 02 9e 06 20 f5 0d  02 a8 1c 20 f1 8a 58 2b  | .... ..... ..X+|
00000750  28 48 2a 57 29 2c 59 2b  28 56 2a 44 29 29 3b 41  |(H*W),Y+(V*D));A|
00000760  52 52 24 0d 02 b2 08 20  41 3d a5 0d 02 bc 18 20  |RR$.... A=..... |
00000770  fd 28 41 3e 31 33 35 80  41 3c 31 34 30 29 84 41  |.(A>135.A<140).A|
00000780  3d 31 33 0d 02 c6 1d 20  f1 8a 58 2b 28 48 2a 57  |=13.... ..X+(H*W|
00000790  29 2c 59 2b 28 56 2a 44  29 29 3b 4e 4f 41 24 20  |),Y+(V*D));NOA$ |
000007a0  0d 02 d0 2a 20 e7 41 3d  31 33 38 80 56 3c 28 4e  |...* .A=138.V<(N|
000007b0  2d 31 29 8c 56 3d 56 2b  31 8b e7 41 3d 31 33 39  |-1).V=V+1..A=139|
000007c0  80 56 3e 30 56 3d 56 2d  31 20 0d 02 da 29 20 e7  |.V>0V=V-1 ...) .|
000007d0  41 3d 31 33 37 80 48 3c  28 4d 2d 31 29 8c 48 3d  |A=137.H<(M-1).H=|
000007e0  48 2b 31 8b e7 41 3d 31  33 36 80 48 3e 30 48 3d  |H+1..A=136.H>0H=|
000007f0  48 2d 31 0d 02 e4 0d 20  fd 41 3d 31 33 3a ef 37  |H-1.... .A=13:.7|
00000800  0d 02 ee 06 20 e1 0d 02  f8 27 20 dd f2 69 6e 70  |.... ....' ..inp|
00000810  75 74 28 6d 69 6e 63 68  61 72 25 2c 6d 61 78 63  |ut(minchar%,maxc|
00000820  68 61 72 25 2c 6d 61 78  6c 65 6e 25 29 0d 03 02  |har%,maxlen%)...|
00000830  14 20 ef 20 32 33 2c 31  2c 31 3b 30 3b 30 3b 30  |. . 23,1,1;0;0;0|
00000840  3b 0d 03 0c 0a 20 6c 65  25 3d 30 0d 03 16 0b 20  |;.... le%=0.... |
00000850  75 74 24 3d 22 22 0d 03  20 06 20 f5 0d 03 2a 3b  |ut$="".. . ...*;|
00000860  20 f5 3a 41 3d a5 3a e7  20 28 41 3c 6d 69 6e 63  | .:A=.:. (A<minc|
00000870  68 61 72 25 20 84 20 41  3e 6d 61 78 63 68 61 72  |har% . A>maxchar|
00000880  25 29 20 80 20 41 3c 3e  31 33 20 80 20 41 3c 3e  |%) . A<>13 . A<>|
00000890  31 32 37 20 ef 20 37 0d  03 34 31 20 fd 20 28 41  |127 . 7..41 . (A|
000008a0  3e 3d 6d 69 6e 63 68 61  72 25 20 80 20 41 3c 3d  |>=minchar% . A<=|
000008b0  6d 61 78 63 68 61 72 25  29 20 84 20 41 3d 31 33  |maxchar%) . A=13|
000008c0  20 84 20 41 3d 31 32 37  0d 03 3e 44 20 e7 20 28  | . A=127..>D . (|
000008d0  41 3d 31 32 37 20 80 20  6c 65 25 3e 30 29 20 ef  |A=127 . le%>0) .|
000008e0  20 31 32 37 20 8b 20 e7  20 41 3c 3e 31 33 20 80  | 127 . . A<>13 .|
000008f0  20 6c 65 25 3c 6d 61 78  6c 65 6e 25 20 80 20 41  | le%<maxlen% . A|
00000900  3c 3e 31 32 37 20 f1 bd  28 41 29 3b 0d 03 48 3b  |<>127 ..(A);..H;|
00000910  20 e7 20 28 41 3c 3e 31  33 20 80 20 6c 65 25 3d  | . (A<>13 . le%=|
00000920  6d 61 78 6c 65 6e 25 20  80 20 41 3c 3e 31 32 37  |maxlen% . A<>127|
00000930  29 20 84 20 28 41 3d 31  32 37 20 80 20 6c 65 25  |) . (A=127 . le%|
00000940  3d 30 29 20 ef 20 37 0d  03 52 64 20 e7 20 41 3d  |=0) . 7..Rd . A=|
00000950  31 32 37 20 80 20 6c 65  25 3e 30 20 75 74 24 3d  |127 . le%>0 ut$=|
00000960  c0 75 74 24 2c 6c 65 25  2d 31 29 3a 6c 65 25 3d  |.ut$,le%-1):le%=|
00000970  6c 65 25 2d 31 20 8b 20  e7 20 41 3c 3e 31 33 20  |le%-1 . . A<>13 |
00000980  80 20 41 3c 3e 31 32 37  20 80 20 6c 65 25 3c 6d  |. A<>127 . le%<m|
00000990  61 78 6c 65 6e 25 20 75  74 24 3d 75 74 24 2b bd  |axlen% ut$=ut$+.|
000009a0  41 3a 6c 65 25 3d 6c 65  25 2b 31 0d 03 5c 0b 20  |A:le%=le%+1..\. |
000009b0  fd 20 41 3d 31 33 0d 03  66 14 20 ef 20 32 33 2c  |. A=13..f. . 23,|
000009c0  31 2c 30 3b 30 3b 30 3b  30 3b 0d 03 70 06 20 e1  |1,0;0;0;0;..p. .|
000009d0  0d 03 7a 1b 20 dd f2 6d  65 73 73 61 67 65 28 4d  |..z. ..message(M|
000009e0  24 2c 66 6f 24 2c 62 61  24 29 20 0d 03 84 0c 20  |$,fo$,ba$) .... |
000009f0  e3 49 25 3d 30 b8 31 0d  03 8e 1d 20 e7 20 62 61  |.I%=0.1.... . ba|
00000a00  24 3d 22 22 3a f1 3b 20  8b 20 f1 62 61 24 3b bd  |$="":.; . .ba$;.|
00000a10  31 35 37 3b 0d 03 98 20  20 f1 66 6f 24 3b bd 31  |157;...  .fo$;.1|
00000a20  34 31 8a a8 28 34 30 2d  a9 28 4d 24 29 29 2f 32  |41..(40-.(M$))/2|
00000a30  29 3b 4d 24 0d 03 a2 06  20 ed 0d 03 ac 07 20 e1  |);M$.... ..... .|
00000a40  20 0d 03 b6 0e 20 dd 20  f2 6d 65 6e 75 20 20 0d  | .... . .menu  .|
00000a50  03 c0 2e 20 db 3a f2 6d  65 73 73 61 67 65 28 22  |... .:.message("|
00000a60  50 49 4c 4f 54 20 4f 4e  45 20 2d 20 49 4e 54 43  |PILOT ONE - INTC|
00000a70  41 52 22 2c 22 81 22 2c  22 83 22 29 20 0d 03 ca  |AR",".",".") ...|
00000a80  7c 20 f1 8a 31 30 2c 34  29 22 44 49 53 50 4c 41  || ..10,4)"DISPLA|
00000a90  59 20 53 45 51 55 45 4e  43 45 22 8a 31 30 2c 36  |Y SEQUENCE".10,6|
00000aa0  29 22 43 52 45 41 54 45  20 53 45 51 55 45 4e 43  |)"CREATE SEQUENC|
00000ab0  45 22 8a 31 30 2c 38 29  22 45 44 49 54 20 53 45  |E".10,8)"EDIT SE|
00000ac0  51 55 45 4e 43 45 22 8a  31 30 2c 31 30 29 22 52  |QUENCE".10,10)"R|
00000ad0  55 4e 20 53 45 51 55 45  4e 43 45 22 8a 39 2c 31  |UN SEQUENCE".9,1|
00000ae0  32 29 22 85 45 58 49 54  20 46 52 4f 4d 20 50 52  |2)".EXIT FROM PR|
00000af0  4f 47 52 41 4d 87 22 20  20 0d 03 d4 0e 20 f2 69  |OGRAM."  .... .i|
00000b00  6e 73 74 72 75 63 74 0d  03 de 06 20 e1 0d 03 e8  |nstruct.... ....|
00000b10  0f 20 dd f2 69 6e 73 74  72 75 63 74 0d 03 f2 36  |. ..instruct...6|
00000b20  20 f1 8a 32 2c 32 33 29  bd 31 33 31 22 55 53 45  | ..2,23).131"USE|
00000b30  20 41 52 52 4f 57 20 4b  45 59 53 20 41 4e 44 20  | ARROW KEYS AND |
00000b40  52 45 54 55 52 4e 20 54  4f 20 53 45 4c 45 43 54  |RETURN TO SELECT|
00000b50  22 20 0d 03 fc 06 20 e1  0d 04 06 13 20 dd 20 f2  |" .... ..... . .|
00000b60  64 72 69 76 65 5f 72 6f  75 74 65 0d 04 10 16 20  |drive_route.... |
00000b70  e3 20 73 74 61 67 65 25  3d 30 20 b8 20 73 25 2d  |. stage%=0 . s%-|
00000b80  31 0d 04 1a 30 20 db 3a  f2 6d 65 73 73 61 67 65  |1...0 .:.message|
00000b90  28 22 53 54 41 47 45 20  4e 4f 2e 22 2b c3 28 73  |("STAGE NO."+.(s|
00000ba0  74 61 67 65 25 2b 31 29  2c 22 84 22 2c 22 83 22  |tage%+1),".","."|
00000bb0  29 0d 04 24 09 20 f1 27  27 27 0d 04 2e 43 20 f2  |)..$. .'''...C .|
00000bc0  6d 65 73 73 61 67 65 28  22 4c 45 46 54 20 20 4d  |message("LEFT  M|
00000bd0  4f 54 4f 52 20 2d 20 22  2b 64 69 72 24 28 64 72  |OTOR - "+dir$(dr|
00000be0  69 76 65 5f 69 6e 64 65  78 25 28 30 2c 73 74 61  |ive_index%(0,sta|
00000bf0  67 65 25 29 29 2c 22 82  22 2c 22 22 29 0d 04 38  |ge%)),".","")..8|
00000c00  09 20 f1 27 27 27 0d 04  42 44 20 f2 6d 65 73 73  |. .'''..BD .mess|
00000c10  61 67 65 28 22 52 49 47  48 54 20 4d 4f 54 4f 52  |age("RIGHT MOTOR|
00000c20  20 2d 20 22 2b 64 69 72  24 28 64 72 69 76 65 5f  | - "+dir$(drive_|
00000c30  69 6e 64 65 78 25 28 31  2c 73 74 61 67 65 25 29  |index%(1,stage%)|
00000c40  29 2c 22 82 22 2c 22 22  29 20 0d 04 4c 09 20 f1  |),".","") ..L. .|
00000c50  27 27 27 0d 04 56 36 20  f2 6d 65 73 73 61 67 65  |'''..V6 .message|
00000c60  28 c3 28 6e 6f 5f 6f 66  5f 73 74 65 70 73 25 28  |(.(no_of_steps%(|
00000c70  73 74 61 67 65 25 29 29  2b 22 20 53 54 45 50 53  |stage%))+" STEPS|
00000c80  22 2c 22 82 22 2c 22 22  29 0d 04 60 55 20 d1 3d  |",".","")..`U .=|
00000c90  30 3a f2 6d 75 6c 74 69  74 75 72 6e 28 22 4f 4e  |0:.multiturn("ON|
00000ca0  22 2c 63 6f 64 65 24 28  64 72 69 76 65 5f 69 6e  |",code$(drive_in|
00000cb0  64 65 78 25 28 31 2c 73  74 61 67 65 25 29 29 2b  |dex%(1,stage%))+|
00000cc0  63 6f 64 65 24 28 64 72  69 76 65 5f 69 6e 64 65  |code$(drive_inde|
00000cd0  78 25 28 30 2c 73 74 61  67 65 25 29 29 29 0d 04  |x%(0,stage%)))..|
00000ce0  6a 23 20 f5 3a fd 91 3e  6e 6f 5f 6f 66 5f 73 74  |j# .:..>no_of_st|
00000cf0  65 70 73 25 28 73 74 61  67 65 25 29 2a 6e 25 20  |eps%(stage%)*n% |
00000d00  20 0d 04 74 1f 20 f2 6d  75 6c 74 69 74 75 72 6e  | ..t. .multiturn|
00000d10  28 22 4f 46 46 22 2c 22  31 31 31 31 22 29 20 20  |("OFF","1111")  |
00000d20  0d 04 7e 0d 20 ed 20 73  74 61 67 65 25 0d 04 88  |..~. . stage%...|
00000d30  30 20 f1 8a 36 2c 32 33  29 22 83 50 52 45 53 53  |0 ..6,23)".PRESS|
00000d40  20 41 4e 59 20 4b 45 59  20 54 4f 20 43 4f 4e 54  | ANY KEY TO CONT|
00000d50  49 4e 55 45 22 3a 64 75  6d 6d 79 3d a5 0d 04 92  |INUE":dummy=....|
00000d60  06 20 e1 0d 04 9c 12 20  dd 20 f2 65 64 69 74 5f  |. ..... . .edit_|
00000d70  72 6f 75 74 65 0d 04 a6  06 20 f5 0d 04 b0 0f 20  |route.... ..... |
00000d80  f2 65 64 69 74 5f 6d 65  6e 75 0d 04 ba 20 20 56  |.edit_menu...  V|
00000d90  3d 30 3a 48 3d 30 3a f2  66 69 6e 64 28 33 30 2c  |=0:H=0:.find(30,|
00000da0  34 2c 31 2c 36 2c 30 2c  32 29 0d 04 c4 1e 20 e7  |4,1,6,0,2).... .|
00000db0  20 56 3d 30 20 80 20 73  25 3e 30 20 f2 64 69 73  | V=0 . s%>0 .dis|
00000dc0  70 6c 61 79 3a 56 3d 30  0d 04 ce 24 20 e7 20 56  |play:V=0...$ . V|
00000dd0  3d 31 20 f2 64 65 6c 65  74 65 28 a4 77 68 69 63  |=1 .delete(.whic|
00000de0  68 5f 73 74 61 67 65 29  3a 56 3d 31 0d 04 d8 2d  |h_stage):V=1...-|
00000df0  20 e7 20 56 3d 32 20 80  20 73 25 3c 32 30 20 f2  | . V=2 . s%<20 .|
00000e00  69 6e 73 65 72 74 28 a4  77 68 69 63 68 5f 73 74  |insert(.which_st|
00000e10  61 67 65 29 3a 56 3d 32  20 0d 04 e2 23 20 e7 20  |age):V=2 ...# . |
00000e20  56 3d 33 20 f2 67 65 74  28 a4 77 68 69 63 68 5f  |V=3 .get(.which_|
00000e30  73 74 61 67 65 2d 31 29  3a 56 3d 33 0d 04 ec 22  |stage-1):V=3..."|
00000e40  20 e7 20 56 3d 34 20 80  20 73 25 3c 32 30 20 f2  | . V=4 . s%<20 .|
00000e50  6d 61 6b 65 5f 72 6f 75  74 65 3a 56 3d 34 0d 04  |make_route:V=4..|
00000e60  f6 11 20 fd 56 3d 35 20  84 20 73 25 3d 30 20 0d  |.. .V=5 . s%=0 .|
00000e70  05 00 06 20 e1 0d 05 0a  11 20 dd 20 f2 65 64 69  |... ..... . .edi|
00000e80  74 5f 6d 65 6e 75 0d 05  14 2e 20 db 3a f2 6d 65  |t_menu.... .:.me|
00000e90  73 73 61 67 65 28 22 49  4e 54 43 41 52 20 2d 20  |ssage("INTCAR - |
00000ea0  45 44 49 54 20 4d 45 4e  55 22 2c 22 81 22 2c 22  |EDIT MENU",".","|
00000eb0  83 22 29 20 0d 05 1e 8e  20 f1 8a 31 30 2c 34 29  |.") .... ..10,4)|
00000ec0  22 44 49 53 50 4c 41 59  20 53 45 51 55 45 4e 43  |"DISPLAY SEQUENC|
00000ed0  45 22 8a 31 30 2c 36 29  22 44 45 4c 45 54 45 20  |E".10,6)"DELETE |
00000ee0  53 54 41 47 45 22 8a 31  30 2c 38 29 22 49 4e 53  |STAGE".10,8)"INS|
00000ef0  45 52 54 20 53 54 41 47  45 22 8a 31 30 2c 31 30  |ERT STAGE".10,10|
00000f00  29 22 45 44 49 54 20 53  54 41 47 45 22 8a 31 30  |)"EDIT STAGE".10|
00000f10  2c 31 32 29 22 41 44 44  20 54 4f 20 53 45 51 55  |,12)"ADD TO SEQU|
00000f20  45 4e 43 45 22 8a 39 2c  31 34 29 22 85 52 45 54  |ENCE".9,14)".RET|
00000f30  55 52 4e 20 54 4f 20 4d  41 49 4e 20 4d 45 4e 55  |URN TO MAIN MENU|
00000f40  87 22 0d 05 28 0e 20 f2  69 6e 73 74 72 75 63 74  |."..(. .instruct|
00000f50  0d 05 32 06 20 e1 0d 05  3c 0f 20 dd 20 f2 64 69  |..2. ...<. . .di|
00000f60  73 70 6c 61 79 0d 05 46  34 20 db 3a f2 6d 65 73  |splay..F4 .:.mes|
00000f70  73 61 67 65 28 22 49 4e  54 43 41 52 20 2d 20 53  |sage("INTCAR - S|
00000f80  45 51 55 45 4e 43 45 20  44 49 53 50 4c 41 59 22  |EQUENCE DISPLAY"|
00000f90  2c 22 81 22 2c 22 83 22  29 0d 05 50 3a 20 f1 20  |,".",".")..P: . |
00000fa0  8a 32 2c 33 29 22 81 4c  45 46 54 20 20 4d 4f 54  |.2,3)".LEFT  MOT|
00000fb0  4f 52 22 8a 31 38 2c 33  29 22 52 49 47 48 54 20  |OR".18,3)"RIGHT |
00000fc0  4d 4f 54 4f 52 22 8a 33  33 2c 33 29 22 53 54 45  |MOTOR".33,3)"STE|
00000fd0  50 53 22 0d 05 5a 25 20  f1 8a 38 2c 32 33 29 22  |PS"..Z% ..8,23)"|
00000fe0  83 50 52 45 53 53 20 53  48 49 46 54 20 54 4f 20  |.PRESS SHIFT TO |
00000ff0  53 43 52 4f 4c 4c 22 20  0d 05 64 16 20 ef 20 32  |SCROLL" ..d. . 2|
00001000  38 2c 30 2c 32 31 2c 33  39 2c 35 2c 31 34 0d 05  |8,0,21,39,5,14..|
00001010  6e 12 20 e3 20 49 25 3d  30 20 b8 20 73 25 2d 31  |n. . I%=0 . s%-1|
00001020  0d 05 78 1d 20 f1 89 28  32 2d a9 28 c3 28 49 25  |..x. ..(2-.(.(I%|
00001030  2b 31 29 29 29 c3 28 49  25 2b 31 29 3b 0d 05 82  |+1))).(I%+1);...|
00001040  3e 20 f1 8a 34 29 64 69  72 24 28 64 72 69 76 65  |> ..4)dir$(drive|
00001050  5f 69 6e 64 65 78 25 28  30 2c 49 25 29 29 8a 31  |_index%(0,I%)).1|
00001060  39 29 64 69 72 24 28 64  72 69 76 65 5f 69 6e 64  |9)dir$(drive_ind|
00001070  65 78 25 28 31 2c 49 25  29 29 3b 0d 05 8c 39 20  |ex%(1,I%));...9 |
00001080  f1 8a 33 34 29 89 28 33  2d a9 28 c3 28 6e 6f 5f  |..34).(3-.(.(no_|
00001090  6f 66 5f 73 74 65 70 73  25 28 49 25 29 29 29 29  |of_steps%(I%))))|
000010a0  c3 28 6e 6f 5f 6f 66 5f  73 74 65 70 73 25 28 49  |.(no_of_steps%(I|
000010b0  25 29 29 27 0d 05 96 06  20 ed 0d 05 a0 32 20 ef  |%))'.... ....2 .|
000010c0  20 32 36 2c 31 35 3a f1  8a 36 2c 32 33 29 22 83  | 26,15:..6,23)".|
000010d0  50 52 45 53 53 20 41 4e  59 20 4b 45 59 20 54 4f  |PRESS ANY KEY TO|
000010e0  20 43 4f 4e 54 49 4e 55  45 22 20 20 0d 05 aa 0c  | CONTINUE"  ....|
000010f0  20 2a 46 58 32 31 2c 30  0d 05 b4 08 20 41 3d a5  | *FX21,0.... A=.|
00001100  0d 05 be 07 20 ef 37 0d  05 c8 06 20 e1 0d 05 d2  |.... .7.... ....|
00001110  13 20 dd 20 a4 77 68 69  63 68 5f 73 74 61 67 65  |. . .which_stage|
00001120  0d 05 dc 10 20 e7 20 73  25 3d 31 20 8c 20 3d 31  |.... . s%=1 . =1|
00001130  0d 05 e6 27 20 db 3a f2  6d 65 73 73 61 67 65 28  |...' .:.message(|
00001140  22 53 45 4c 45 43 54 20  53 54 41 47 45 22 2c 22  |"SELECT STAGE","|
00001150  85 22 2c 22 83 22 29 0d  05 f0 06 20 f5 0d 05 fa  |.",".").... ....|
00001160  0f 20 f2 69 6e 73 74 72  75 63 74 32 0d 06 04 30  |. .instruct2...0|
00001170  20 f1 8a 38 2c 31 30 29  22 81 53 54 41 47 45 20  | ..8,10)".STAGE |
00001180  4e 55 4d 42 45 52 20 28  31 2d 22 c3 73 25 22 29  |NUMBER (1-".s%")|
00001190  2e 2e 2e 20 20 22 3b 3a  ef 38 2c 38 0d 06 0e 14  |...  ";:.8,8....|
000011a0  20 f2 69 6e 70 75 74 28  34 38 2c 35 37 2c 32 29  | .input(48,57,2)|
000011b0  0d 06 18 28 20 e7 20 a9  75 74 24 3e 30 20 73 74  |...( . .ut$>0 st|
000011c0  61 67 65 25 3d a0 28 75  74 24 29 20 8b 20 73 74  |age%=.(ut$) . st|
000011d0  61 67 65 25 3d 30 20 20  0d 06 22 20 20 ef 20 31  |age%=0  .."  . 1|
000011e0  31 3a fd 73 74 61 67 65  25 3e 30 20 80 20 73 74  |1:.stage%>0 . st|
000011f0  61 67 65 25 3c 3d 73 25  0d 06 2c 0c 20 3d 73 74  |age%<=s%..,. =st|
00001200  61 67 65 25 0d 06 36 16  20 dd 20 f2 64 65 6c 65  |age%..6. . .dele|
00001210  74 65 28 73 74 61 67 65  25 29 0d 06 40 18 20 e7  |te(stage%)..@. .|
00001220  20 73 74 61 67 65 25 3d  32 30 20 73 25 3d 31 39  | stage%=20 s%=19|
00001230  3a e1 0d 06 4a 17 20 e3  20 49 25 3d 73 74 61 67  |:...J. . I%=stag|
00001240  65 25 20 b8 20 73 25 2d  31 0d 06 54 78 20 64 72  |e% . s%-1..Tx dr|
00001250  69 76 65 5f 69 6e 64 65  78 25 28 30 2c 49 25 2d  |ive_index%(0,I%-|
00001260  31 29 3d 64 72 69 76 65  5f 69 6e 64 65 78 25 28  |1)=drive_index%(|
00001270  30 2c 49 25 29 3a 64 72  69 76 65 5f 69 6e 64 65  |0,I%):drive_inde|
00001280  78 25 28 31 2c 49 25 2d  31 29 3d 64 72 69 76 65  |x%(1,I%-1)=drive|
00001290  5f 69 6e 64 65 78 25 28  31 2c 49 25 29 3a 6e 6f  |_index%(1,I%):no|
000012a0  5f 6f 66 5f 73 74 65 70  73 25 28 49 25 2d 31 29  |_of_steps%(I%-1)|
000012b0  3d 6e 6f 5f 6f 66 5f 73  74 65 70 73 25 28 49 25  |=no_of_steps%(I%|
000012c0  29 0d 06 5e 06 20 ed 0d  06 68 0c 20 73 25 3d 73  |)..^. ...h. s%=s|
000012d0  25 2d 31 0d 06 72 06 20  e1 0d 06 7c 16 20 dd 20  |%-1..r. ...|. . |
000012e0  f2 69 6e 73 65 72 74 28  73 74 61 67 65 25 29 0d  |.insert(stage%).|
000012f0  06 86 1a 20 e3 20 49 25  3d 73 25 20 b8 20 73 74  |... . I%=s% . st|
00001300  61 67 65 25 20 88 20 2d  31 0d 06 90 78 20 64 72  |age% . -1...x dr|
00001310  69 76 65 5f 69 6e 64 65  78 25 28 30 2c 49 25 29  |ive_index%(0,I%)|
00001320  3d 64 72 69 76 65 5f 69  6e 64 65 78 25 28 30 2c  |=drive_index%(0,|
00001330  49 25 2d 31 29 3a 64 72  69 76 65 5f 69 6e 64 65  |I%-1):drive_inde|
00001340  78 25 28 31 2c 49 25 29  3d 64 72 69 76 65 5f 69  |x%(1,I%)=drive_i|
00001350  6e 64 65 78 25 28 31 2c  49 25 2d 31 29 3a 6e 6f  |ndex%(1,I%-1):no|
00001360  5f 6f 66 5f 73 74 65 70  73 25 28 49 25 29 3d 6e  |_of_steps%(I%)=n|
00001370  6f 5f 6f 66 5f 73 74 65  70 73 25 28 49 25 2d 31  |o_of_steps%(I%-1|
00001380  29 0d 06 9a 06 20 ed 0d  06 a4 06 20 f5 0d 06 ae  |).... ..... ....|
00001390  13 20 f2 67 65 74 28 73  74 61 67 65 25 2d 31 29  |. .get(stage%-1)|
000013a0  0d 06 b8 53 20 f1 8a 30  2c 32 33 29 22 83 52 45  |...S ..0,23)".RE|
000013b0  54 55 52 4e 20 54 4f 20  43 4f 4e 46 49 52 4d 2c  |TURN TO CONFIRM,|
000013c0  20 45 53 43 41 50 45 20  54 4f 20 52 45 45 4e 54  | ESCAPE TO REENT|
000013d0  45 52 22 3b 3a f5 3a 64  75 6d 6d 79 3d a5 3a fd  |ER";:.:dummy=.:.|
000013e0  64 75 6d 6d 79 3d 31 33  20 84 20 64 75 6d 6d 79  |dummy=13 . dummy|
000013f0  3d 32 37 0d 06 c2 0e 20  fd 64 75 6d 6d 79 3d 31  |=27.... .dummy=1|
00001400  33 0d 06 cc 0c 20 73 25  3d 73 25 2b 31 0d 06 d6  |3.... s%=s%+1...|
00001410  06 20 e1 0d 27 10 6e 20  f4 20 2a 2a 2a 55 53 45  |. ..'.n . ***USE|
00001420  53 20 4f 53 42 59 54 45  2f 2a 46 58 31 35 30 20  |S OSBYTE/*FX150 |
00001430  54 4f 20 45 58 41 4d 49  4e 45 20 56 49 41 20 52  |TO EXAMINE VIA R|
00001440  45 47 49 53 54 45 52 2e  20 52 45 51 55 49 52 45  |EGISTER. REQUIRE|
00001450  53 20 4f 46 46 53 45 54  20 4f 46 20 52 45 47 49  |S OFFSET OF REGI|
00001460  53 54 45 52 20 49 4e 20  50 41 47 45 20 26 46 45  |STER IN PAGE &FE|
00001470  20 41 53 20 50 41 52 41  4d 45 54 45 52 2e 2a 2a  | AS PARAMETER.**|
00001480  2a 0d 27 1a 15 20 dd 20  a4 70 65 65 6b 28 6f 66  |*.'.. . .peek(of|
00001490  66 73 65 74 29 20 0d 27  24 0c 20 ea 20 76 61 6c  |fset) .'$. . val|
000014a0  75 65 0d 27 2e 3a 20 41  25 3d 31 35 30 3a 58 25  |ue.'.: A%=150:X%|
000014b0  3d 6f 66 66 73 65 74 3a  76 61 6c 75 65 3d 28 ba  |=offset:value=(.|
000014c0  28 26 46 46 46 34 29 20  80 20 26 46 46 30 30 30  |(&FFF4) . &FF000|
000014d0  30 29 20 81 20 26 31 30  30 30 30 20 0d 27 38 0b  |0) . &10000 .'8.|
000014e0  20 3d 76 61 6c 75 65 0d  2a f8 94 20 f4 20 2a 2a  | =value.*.. . **|
000014f0  2a 55 53 45 53 20 4f 53  42 59 54 45 2f 2a 46 58  |*USES OSBYTE/*FX|
00001500  31 35 31 20 54 4f 20 57  52 49 54 45 20 41 20 56  |151 TO WRITE A V|
00001510  41 4c 55 45 20 54 4f 20  41 20 56 49 41 20 52 45  |ALUE TO A VIA RE|
00001520  47 49 53 54 45 52 2e 20  20 52 45 51 55 49 52 45  |GISTER.  REQUIRE|
00001530  53 20 4f 46 46 53 45 54  20 4f 46 20 52 45 47 49  |S OFFSET OF REGI|
00001540  53 54 45 52 20 49 4e 20  50 41 47 45 20 26 46 45  |STER IN PAGE &FE|
00001550  2c 20 41 4e 44 20 56 41  4c 55 45 20 54 4f 20 42  |, AND VALUE TO B|
00001560  45 20 57 52 49 54 54 45  4e 20 41 53 20 50 41 52  |E WRITTEN AS PAR|
00001570  41 4d 45 54 45 52 53 2e  2a 2a 2a 0d 2b 02 1a 20  |AMETERS.***.+.. |
00001580  dd 20 f2 70 6f 6b 65 28  6f 66 66 73 65 74 2c 76  |. .poke(offset,v|
00001590  61 6c 75 65 29 0d 2b 0c  27 20 41 25 3d 31 35 31  |alue).+.' A%=151|
000015a0  3a 58 25 3d 6f 66 66 73  65 74 3a 59 25 3d 76 61  |:X%=offset:Y%=va|
000015b0  6c 75 65 3a d6 20 26 46  46 46 34 20 0d 2b 16 08  |lue:. &FFF4 .+..|
000015c0  20 e1 20 20 0d 2e e0 51  20 f4 20 2a 2a 2a 45 58  | .  ...Q . ***EX|
000015d0  41 4d 49 4e 45 53 20 54  48 45 20 43 55 52 52 45  |AMINES THE CURRE|
000015e0  4e 54 20 53 54 41 54 45  20 4f 46 20 54 48 45 20  |NT STATE OF THE |
000015f0  52 45 4c 41 59 20 53 50  45 43 49 46 49 45 44 20  |RELAY SPECIFIED |
00001600  41 4e 44 20 53 57 41 50  53 20 49 54 20 4f 56 45  |AND SWAPS IT OVE|
00001610  52 2e 2a 2a 2a 0d 2e ea  1b 20 dd 20 f2 74 6f 67  |R.***.... . .tog|
00001620  67 6c 65 28 6c 69 6e 65  6e 75 6d 62 65 72 29 20  |gle(linenumber) |
00001630  0d 2e f4 2e 20 e7 20 28  6c 69 6e 65 6e 75 6d 62  |.... . (linenumb|
00001640  65 72 3e 33 20 84 20 6c  69 6e 65 6e 75 6d 62 65  |er>3 . linenumbe|
00001650  72 3c 30 29 20 8c 20 2a  46 58 31 32 35 20 0d 2e  |r<0) . *FX125 ..|
00001660  fe 21 20 ea 20 62 69 74  76 61 6c 75 65 2c 6f 6c  |.! . bitvalue,ol|
00001670  64 76 61 6c 75 65 2c 6e  65 77 76 61 6c 75 65 0d  |dvalue,newvalue.|
00001680  2f 08 1a 20 62 69 74 76  61 6c 75 65 3d 32 5e 6c  |/.. bitvalue=2^l|
00001690  69 6e 65 6e 75 6d 62 65  72 0d 2f 12 1a 20 6f 6c  |inenumber./.. ol|
000016a0  64 76 61 6c 75 65 3d a4  70 65 65 6b 28 26 36 30  |dvalue=.peek(&60|
000016b0  29 20 20 0d 2f 1c 21 20  6e 65 77 76 61 6c 75 65  |)  ./.! newvalue|
000016c0  3d 6f 6c 64 76 61 6c 75  65 20 82 20 62 69 74 76  |=oldvalue . bitv|
000016d0  61 6c 75 65 0d 2f 26 18  20 f2 70 6f 6b 65 28 26  |alue./&. .poke(&|
000016e0  36 30 2c 6e 65 77 76 61  6c 75 65 29 0d 2f 30 08  |60,newvalue)./0.|
000016f0  20 e1 20 20 0d 32 c8 7e  20 f4 20 2a 2a 2a 54 55  | .  .2.~ . ***TU|
00001700  52 4e 53 20 4f 4e 20 4f  52 20 4f 46 46 20 41 20  |RNS ON OR OFF A |
00001710  53 50 45 43 49 46 49 45  44 20 52 45 4c 41 59 2e  |SPECIFIED RELAY.|
00001720  20 20 52 45 51 55 49 52  45 53 20 41 43 54 49 4f  |  REQUIRES ACTIO|
00001730  4e 20 54 4f 20 42 45 20  54 41 4b 45 4e 20 69 65  |N TO BE TAKEN ie|
00001740  2e 20 22 4f 4e 22 20 4f  52 20 22 4f 46 46 22 2c  |. "ON" OR "OFF",|
00001750  20 41 4e 44 20 52 45 4c  41 59 20 4e 55 4d 42 45  | AND RELAY NUMBE|
00001760  52 20 41 53 20 50 41 52  41 4d 45 54 45 52 53 2a  |R AS PARAMETERS*|
00001770  2a 2a 0d 32 d2 21 20 dd  20 f2 74 75 72 6e 28 6f  |**.2.! . .turn(o|
00001780  6e 4f 52 6f 66 66 24 2c  6c 69 6e 65 6e 75 6d 62  |nORoff$,linenumb|
00001790  65 72 29 0d 32 dc 32 20  e7 20 ac 28 6f 6e 4f 52  |er).2.2 . .(onOR|
000017a0  6f 66 66 24 3d 22 4f 4e  22 20 84 20 6f 6e 4f 52  |off$="ON" . onOR|
000017b0  6f 66 66 24 3d 22 4f 46  46 22 29 20 8c 20 2a 46  |off$="OFF") . *F|
000017c0  58 31 32 35 20 0d 32 e6  2e 20 e7 20 28 6c 69 6e  |X125 .2.. . (lin|
000017d0  65 6e 75 6d 62 65 72 3e  33 20 84 20 6c 69 6e 65  |enumber>3 . line|
000017e0  6e 75 6d 62 65 72 3c 30  29 20 8c 20 2a 46 58 31  |number<0) . *FX1|
000017f0  32 35 20 0d 32 f0 21 20  ea 20 62 69 74 76 61 6c  |25 .2.! . bitval|
00001800  75 65 2c 6f 6c 64 76 61  6c 75 65 2c 6e 65 77 76  |ue,oldvalue,newv|
00001810  61 6c 75 65 0d 32 fa 1a  20 62 69 74 76 61 6c 75  |alue.2.. bitvalu|
00001820  65 3d 32 5e 6c 69 6e 65  6e 75 6d 62 65 72 0d 33  |e=2^linenumber.3|
00001830  04 19 20 6f 6c 64 76 61  6c 75 65 3d a4 70 65 65  |.. oldvalue=.pee|
00001840  6b 28 26 36 30 29 20 0d  33 0e 58 20 e7 20 6f 6e  |k(&60) .3.X . on|
00001850  4f 52 6f 66 66 24 3d 22  4f 4e 22 20 8c 20 6e 65  |ORoff$="ON" . ne|
00001860  77 76 61 6c 75 65 3d 6f  6c 64 76 61 6c 75 65 20  |wvalue=oldvalue |
00001870  84 20 62 69 74 76 61 6c  75 65 20 8b 20 6e 65 77  |. bitvalue . new|
00001880  76 61 6c 75 65 3d 6f 6c  64 76 61 6c 75 65 20 80  |value=oldvalue .|
00001890  20 28 32 35 35 2d 62 69  74 76 61 6c 75 65 29 0d  | (255-bitvalue).|
000018a0  33 18 18 20 f2 70 6f 6b  65 28 26 36 30 2c 6e 65  |3.. .poke(&60,ne|
000018b0  77 76 61 6c 75 65 29 0d  33 22 06 20 e1 0d 36 b0  |wvalue).3". ..6.|
000018c0  66 20 f4 20 2a 2a 2a 54  45 53 54 53 20 54 48 45  |f . ***TESTS THE|
000018d0  20 43 55 52 52 45 4e 54  20 53 54 41 54 45 20 4f  | CURRENT STATE O|
000018e0  46 20 54 48 45 20 53 50  45 43 49 46 49 45 44 20  |F THE SPECIFIED |
000018f0  49 4e 50 55 54 20 28 34  2d 37 29 20 41 4e 44 20  |INPUT (4-7) AND |
00001900  52 45 54 55 52 4e 53 20  54 48 45 20 56 41 4c 55  |RETURNS THE VALU|
00001910  45 20 22 4f 4e 22 20 4f  52 20 22 4f 46 46 22 2e  |E "ON" OR "OFF".|
00001920  2a 2a 2a 0d 36 ba 19 20  dd 20 a4 74 65 73 74 28  |***.6.. . .test(|
00001930  6c 69 6e 65 6e 75 6d 62  65 72 29 20 0d 36 c4 2f  |linenumber) .6./|
00001940  20 e7 20 28 6c 69 6e 65  6e 75 6d 62 65 72 3e 37  | . (linenumber>7|
00001950  20 84 20 6c 69 6e 65 6e  75 6d 62 65 72 3c 34 29  | . linenumber<4)|
00001960  20 8c 20 2a 46 58 31 32  35 20 20 0d 36 ce 0f 20  | . *FX125  .6.. |
00001970  ea 20 62 69 74 76 61 6c  75 65 0d 36 d8 1a 20 62  |. bitvalue.6.. b|
00001980  69 74 76 61 6c 75 65 3d  32 5e 6c 69 6e 65 6e 75  |itvalue=2^linenu|
00001990  6d 62 65 72 0d 36 e2 2e  20 72 65 73 75 6c 74 3d  |mber.6.. result=|
000019a0  28 28 a4 70 65 65 6b 28  26 36 30 29 20 80 20 62  |((.peek(&60) . b|
000019b0  69 74 76 61 6c 75 65 29  3d 62 69 74 76 61 6c 75  |itvalue)=bitvalu|
000019c0  65 29 0d 36 ec 1e 20 e7  20 72 65 73 75 6c 74 20  |e).6.. . result |
000019d0  8c 20 3d 22 4f 4e 22 20  8b 20 3d 22 4f 46 46 22  |. ="ON" . ="OFF"|
000019e0  0d 3a 98 99 20 f4 20 2a  2a 2a 54 45 53 54 53 20  |.:.. . ***TESTS |
000019f0  54 48 45 20 53 54 41 54  45 20 4f 46 20 54 48 45  |THE STATE OF THE|
00001a00  20 53 50 45 43 49 46 49  45 44 20 52 45 4c 41 59  | SPECIFIED RELAY|
00001a10  53 20 49 4e 20 54 55 52  4e 20 41 4e 44 20 53 57  |S IN TURN AND SW|
00001a20  41 50 53 20 54 48 45 4d  2e 20 52 45 51 55 49 52  |APS THEM. REQUIR|
00001a30  45 53 20 41 20 53 54 52  49 4e 47 20 52 45 50 52  |ES A STRING REPR|
00001a40  45 53 45 4e 54 49 4e 47  20 54 48 45 20 52 45 4c  |ESENTING THE REL|
00001a50  41 59 53 20 54 4f 20 42  45 20 54 4f 47 47 4c 45  |AYS TO BE TOGGLE|
00001a60  44 20 41 53 20 41 20 42  49 4e 41 52 59 20 50 41  |D AS A BINARY PA|
00001a70  54 54 45 52 4e 2e 2a 2a  2a 0d 3a a2 1e 20 dd 20  |TTERN.***.:.. . |
00001a80  f2 6d 75 6c 74 69 74 6f  67 67 6c 65 28 70 61 74  |.multitoggle(pat|
00001a90  74 65 72 6e 24 29 20 0d  3a ac 23 20 ea 20 4c 2c  |tern$) .:.# . L,|
00001aa0  4c 24 2c 6d 61 73 6b 25  2c 6f 6c 64 76 61 6c 75  |L$,mask%,oldvalu|
00001ab0  65 2c 6e 65 77 76 61 6c  75 65 0d 3a b6 1e 20 e7  |e,newvalue.:.. .|
00001ac0  20 a9 28 70 61 74 74 65  72 6e 24 29 3c 3e 34 20  | .(pattern$)<>4 |
00001ad0  8c 20 2a 46 58 31 32 35  0d 3a c0 3e 20 e3 20 4c  |. *FX125.:.> . L|
00001ae0  3d 31 20 b8 20 34 3a 4c  24 3d c1 70 61 74 74 65  |=1 . 4:L$=.patte|
00001af0  72 6e 24 2c 4c 2c 31 29  3a e7 20 ac 28 4c 24 3d  |rn$,L,1):. .(L$=|
00001b00  22 31 22 20 84 20 4c 24  3d 22 30 22 29 20 8c 20  |"1" . L$="0") . |
00001b10  2a 46 58 31 32 35 0d 3a  ca 06 20 ed 0d 3a d4 45  |*FX125.:.. ..:.E|
00001b20  20 6d 61 73 6b 25 3d 30  3a e3 20 4c 3d 31 20 b8  | mask%=0:. L=1 .|
00001b30  20 34 3a e7 20 28 c1 70  61 74 74 65 72 6e 24 2c  | 4:. (.pattern$,|
00001b40  4c 2c 31 29 3d 22 31 22  29 20 8c 20 6d 61 73 6b  |L,1)="1") . mask|
00001b50  25 3d 6d 61 73 6b 25 2b  32 5e 28 34 2d 4c 29 20  |%=mask%+2^(4-L) |
00001b60  20 0d 3a de 06 20 ed 0d  3a e8 32 20 6f 6c 64 76  | .:.. ..:.2 oldv|
00001b70  61 6c 75 65 3d a4 70 65  65 6b 28 26 36 30 29 3a  |alue=.peek(&60):|
00001b80  6e 65 77 76 61 6c 75 65  3d 6f 6c 64 76 61 6c 75  |newvalue=oldvalu|
00001b90  65 20 82 20 6d 61 73 6b  25 0d 3a f2 18 20 f2 70  |e . mask%.:.. .p|
00001ba0  6f 6b 65 28 26 36 30 2c  6e 65 77 76 61 6c 75 65  |oke(&60,newvalue|
00001bb0  29 0d 3a fc 06 20 e1 0d  3e 80 ca 20 f4 20 2a 2a  |).:.. ..>.. . **|
00001bc0  2a 54 55 52 4e 53 20 4f  4e 20 4f 52 20 4f 46 46  |*TURNS ON OR OFF|
00001bd0  20 54 48 45 20 53 50 45  43 49 46 49 45 44 20 47  | THE SPECIFIED G|
00001be0  52 4f 55 50 20 4f 46 20  52 45 4c 41 59 53 2e 20  |ROUP OF RELAYS. |
00001bf0  20 52 45 51 55 49 52 45  53 20 54 57 4f 20 50 41  | REQUIRES TWO PA|
00001c00  52 41 4d 45 54 45 52 53  3a 2d 28 69 29 54 48 45  |RAMETERS:-(i)THE|
00001c10  20 41 43 54 49 4f 4e 20  54 4f 20 42 45 20 54 41  | ACTION TO BE TA|
00001c20  4b 45 4e 20 69 65 2e 22  4f 4e 22 20 4f 52 20 22  |KEN ie."ON" OR "|
00001c30  4f 46 46 22 2c 20 28 69  69 29 41 20 53 54 52 49  |OFF", (ii)A STRI|
00001c40  4e 47 20 52 45 50 52 45  53 45 4e 54 49 4e 47 20  |NG REPRESENTING |
00001c50  54 48 45 20 52 45 4c 41  59 53 20 54 4f 20 42 45  |THE RELAYS TO BE|
00001c60  20 53 57 49 54 43 48 45  44 20 41 53 20 41 20 42  | SWITCHED AS A B|
00001c70  49 4e 41 52 59 20 50 41  54 54 45 52 4e 2e 2a 2a  |INARY PATTERN.**|
00001c80  2a 0d 3e 8a 24 20 dd 20  f2 6d 75 6c 74 69 74 75  |*.>.$ . .multitu|
00001c90  72 6e 28 6f 6e 4f 52 6f  66 66 24 2c 70 61 74 74  |rn(onORoff$,patt|
00001ca0  65 72 6e 24 29 0d 3e 94  23 20 ea 20 4c 2c 4c 24  |ern$).>.# . L,L$|
00001cb0  2c 6d 61 73 6b 25 2c 6f  6c 64 76 61 6c 75 65 2c  |,mask%,oldvalue,|
00001cc0  6e 65 77 76 61 6c 75 65  0d 3e 9e 42 20 e7 20 a9  |newvalue.>.B . .|
00001cd0  28 70 61 74 74 65 72 6e  24 29 3c 3e 34 20 84 20  |(pattern$)<>4 . |
00001ce0  ac 28 6f 6e 4f 52 6f 66  66 24 3d 22 4f 4e 22 20  |.(onORoff$="ON" |
00001cf0  84 20 6f 6e 4f 52 6f 66  66 24 3d 22 4f 46 46 22  |. onORoff$="OFF"|
00001d00  29 20 8c 20 2a 46 58 31  32 35 0d 3e a8 3e 20 e3  |) . *FX125.>.> .|
00001d10  20 4c 3d 31 20 b8 20 34  3a 4c 24 3d c1 70 61 74  | L=1 . 4:L$=.pat|
00001d20  74 65 72 6e 24 2c 4c 2c  31 29 3a e7 20 ac 28 4c  |tern$,L,1):. .(L|
00001d30  24 3d 22 31 22 20 84 20  4c 24 3d 22 30 22 29 20  |$="1" . L$="0") |
00001d40  8c 20 2a 46 58 31 32 35  0d 3e b2 06 20 ed 0d 3e  |. *FX125.>.. ..>|
00001d50  bc 45 20 6d 61 73 6b 25  3d 30 3a e3 20 4c 3d 31  |.E mask%=0:. L=1|
00001d60  20 b8 20 34 3a e7 20 28  c1 70 61 74 74 65 72 6e  | . 4:. (.pattern|
00001d70  24 2c 4c 2c 31 29 3d 22  31 22 29 20 8c 20 6d 61  |$,L,1)="1") . ma|
00001d80  73 6b 25 3d 6d 61 73 6b  25 2b 32 5e 28 34 2d 4c  |sk%=mask%+2^(4-L|
00001d90  29 20 20 0d 3e c6 06 20  ed 0d 3e d0 66 20 6f 6c  |)  .>.. ..>.f ol|
00001da0  64 76 61 6c 75 65 3d a4  70 65 65 6b 28 26 36 30  |dvalue=.peek(&60|
00001db0  29 3a e7 20 6f 6e 4f 52  6f 66 66 24 3d 22 4f 4e  |):. onORoff$="ON|
00001dc0  22 20 8c 20 6e 65 77 76  61 6c 75 65 3d 6f 6c 64  |" . newvalue=old|
00001dd0  76 61 6c 75 65 20 84 20  6d 61 73 6b 25 20 8b 20  |value . mask% . |
00001de0  6e 65 77 76 61 6c 75 65  3d 6f 6c 64 76 61 6c 75  |newvalue=oldvalu|
00001df0  65 20 80 20 28 32 35 35  2d 6d 61 73 6b 25 29 0d  |e . (255-mask%).|
00001e00  3e da 18 20 f2 70 6f 6b  65 28 26 36 30 2c 6e 65  |>.. .poke(&60,ne|
00001e10  77 76 61 6c 75 65 29 0d  3e e4 06 20 e1 0d 42 68  |wvalue).>.. ..Bh|
00001e20  d3 20 f4 20 2a 2a 2a 54  45 53 54 53 20 54 48 45  |. . ***TESTS THE|
00001e30  20 53 50 45 43 49 46 49  45 44 20 47 52 4f 55 50  | SPECIFIED GROUP|
00001e40  20 4f 46 20 49 4e 50 55  54 53 20 41 4e 44 20 52  | OF INPUTS AND R|
00001e50  45 54 55 52 4e 53 20 54  48 45 20 56 41 4c 55 45  |ETURNS THE VALUE|
00001e60  20 22 4f 4e 22 20 49 46  20 41 4c 4c 20 4f 46 20  | "ON" IF ALL OF |
00001e70  54 48 45 4d 20 41 52 45  20 4f 4e 20 41 4e 44 20  |THEM ARE ON AND |
00001e80  22 4f 46 46 22 20 49 46  20 41 4e 59 20 4f 4e 45  |"OFF" IF ANY ONE|
00001e90  20 4f 46 20 54 48 45 4d  20 49 53 20 4f 46 46 2e  | OF THEM IS OFF.|
00001ea0  20 20 52 45 51 55 49 52  45 53 20 41 20 53 54 52  |  REQUIRES A STR|
00001eb0  49 4e 47 20 52 45 50 52  45 53 45 4e 54 49 4e 47  |ING REPRESENTING|
00001ec0  20 54 48 45 20 49 4e 50  55 54 53 20 54 4f 20 42  | THE INPUTS TO B|
00001ed0  45 20 54 45 53 54 45 44  20 41 53 20 41 20 42 49  |E TESTED AS A BI|
00001ee0  4e 41 52 59 20 50 41 54  54 45 52 4e 2e 2a 2a 2a  |NARY PATTERN.***|
00001ef0  0d 42 72 1c 20 dd 20 a4  6d 75 6c 74 69 74 65 73  |.Br. . .multites|
00001f00  74 28 70 61 74 74 65 72  6e 24 29 20 0d 42 7c 1c  |t(pattern$) .B|.|
00001f10  20 ea 20 4c 2c 4c 24 2c  74 65 73 74 6d 61 73 6b  | . L,L$,testmask|
00001f20  25 2c 72 65 73 75 6c 74  0d 42 86 1e 20 e7 20 a9  |%,result.B.. . .|
00001f30  28 70 61 74 74 65 72 6e  24 29 3c 3e 34 20 8c 20  |(pattern$)<>4 . |
00001f40  2a 46 58 31 32 35 0d 42  90 3e 20 e3 20 4c 3d 31  |*FX125.B.> . L=1|
00001f50  20 b8 20 34 3a 4c 24 3d  c1 70 61 74 74 65 72 6e  | . 4:L$=.pattern|
00001f60  24 2c 4c 2c 31 29 3a e7  20 ac 28 4c 24 3d 22 31  |$,L,1):. .(L$="1|
00001f70  22 20 84 20 4c 24 3d 22  30 22 29 20 8c 20 2a 46  |" . L$="0") . *F|
00001f80  58 31 32 35 0d 42 9a 06  20 ed 0d 42 a4 50 20 74  |X125.B.. ..B.P t|
00001f90  65 73 74 6d 61 73 6b 25  3d 30 3a e3 20 4c 3d 31  |estmask%=0:. L=1|
00001fa0  20 b8 20 34 3a e7 20 28  c1 70 61 74 74 65 72 6e  | . 4:. (.pattern|
00001fb0  24 2c 4c 2c 31 29 3d 22  31 22 29 20 8c 20 74 65  |$,L,1)="1") . te|
00001fc0  73 74 6d 61 73 6b 25 3d  74 65 73 74 6d 61 73 6b  |stmask%=testmask|
00001fd0  25 2b 32 5e 28 38 2d 4c  29 20 0d 42 ae 06 20 ed  |%+2^(8-L) .B.. .|
00001fe0  0d 42 b8 31 20 72 65 73  75 6c 74 3d 28 28 a4 70  |.B.1 result=((.p|
00001ff0  65 65 6b 28 26 36 30 29  20 80 20 74 65 73 74 6d  |eek(&60) . testm|
00002000  61 73 6b 25 29 3d 74 65  73 74 6d 61 73 6b 25 29  |ask%)=testmask%)|
00002010  20 0d 42 c2 1e 20 e7 20  72 65 73 75 6c 74 20 8c  | .B.. . result .|
00002020  20 3d 22 4f 4e 22 20 8b  20 3d 22 4f 46 46 22 0d  | ="ON" . ="OFF".|
00002030  46 50 6c 20 f4 20 2a 2a  2a 49 4e 49 54 49 41 4c  |FPl . ***INITIAL|
00002040  49 53 45 53 20 55 53 45  52 20 50 4f 52 54 20 41  |ISES USER PORT A|
00002050  53 20 46 4f 55 52 20 4f  55 54 50 55 54 53 20 4f  |S FOUR OUTPUTS O|
00002060  4e 20 50 42 30 2d 33 20  41 4e 44 20 46 4f 55 52  |N PB0-3 AND FOUR|
00002070  20 49 4e 50 55 54 53 20  4f 4e 20 50 42 34 2d 37  | INPUTS ON PB4-7|
00002080  2e 20 54 55 52 4e 53 20  41 4c 4c 20 4f 55 54 50  |. TURNS ALL OUTP|
00002090  55 54 53 20 4f 46 46 2e  2a 2a 2a 0d 46 5a 13 20  |UTS OFF.***.FZ. |
000020a0  dd 20 f2 73 65 74 5f 75  70 5f 70 6f 72 74 0d 46  |. .set_up_port.F|
000020b0  64 12 20 f2 70 6f 6b 65  28 26 36 32 2c 31 35 29  |d. .poke(&62,15)|
000020c0  0d 46 6e 11 20 f2 70 6f  6b 65 28 26 36 30 2c 30  |.Fn. .poke(&60,0|
000020d0  29 0d 46 78 06 20 e1 0d  ff                       |).Fx. ...|
000020d9
INTCAR.m0
INTCAR.m1
INTCAR.m2
INTCAR.m4
INTCAR.m5