Home » Personal collection » Acorn DFS disks » dfs_box04_disk06b_pilot_one.scp » A.ANEMOM
A.ANEMOM
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: | A.ANEMOM |
Read OK: | ✔ |
File size: | 0D47 bytes |
Load address: | FF1900 |
Exec address: | FF8023 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Acorn DFS disks » dfs_box04_disk06_pilot_one.scp » A.ANEMOM
- Personal collection » Acorn DFS disks » dfs_box04_disk06b_pilot_one.scp » A.ANEMOM
File contents
10PROCset_up_port 20REPEAT 30C=0: TIME=0 40REPEAT 50 REPEAT UNTIL FNtest(7)="ON" 60 REPEAT UNTIL FNtest(7)="OFF" 70 C=C+1 80UNTIL TIME>500 90PRINT C 100UNTIL FALSE 9999 CLS:END 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
�set_up_port � C=0: �=0 (� 2 � � �test(7)="ON" < � � �test(7)="OFF" F C=C+1 P� �>500 Z� C d� � ' �:� '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 10 f2 73 65 74 5f 75 70 5f 70 6f 72 74 |.....set_up_port| 00000010 0d 00 14 05 f5 0d 00 1e 0c 43 3d 30 3a 20 d1 3d |.........C=0: .=| 00000020 30 0d 00 28 05 f5 0d 00 32 17 20 20 f5 20 fd 20 |0..(....2. . . | 00000030 a4 74 65 73 74 28 37 29 3d 22 4f 4e 22 0d 00 3c |.test(7)="ON"..<| 00000040 18 20 20 f5 20 fd 20 a4 74 65 73 74 28 37 29 3d |. . . .test(7)=| 00000050 22 4f 46 46 22 0d 00 46 0b 20 20 43 3d 43 2b 31 |"OFF"..F. C=C+1| 00000060 0d 00 50 0b fd 20 91 3e 35 30 30 0d 00 5a 07 f1 |..P.. .>500..Z..| 00000070 20 43 0d 00 64 07 fd 20 a3 0d 27 0f 08 20 db 3a | C..d.. ..'.. .:| 00000080 e0 0d 27 10 6e 20 f4 20 2a 2a 2a 55 53 45 53 20 |..'.n . ***USES | 00000090 4f 53 42 59 54 45 2f 2a 46 58 31 35 30 20 54 4f |OSBYTE/*FX150 TO| 000000a0 20 45 58 41 4d 49 4e 45 20 56 49 41 20 52 45 47 | EXAMINE VIA REG| 000000b0 49 53 54 45 52 2e 20 52 45 51 55 49 52 45 53 20 |ISTER. REQUIRES | 000000c0 4f 46 46 53 45 54 20 4f 46 20 52 45 47 49 53 54 |OFFSET OF REGIST| 000000d0 45 52 20 49 4e 20 50 41 47 45 20 26 46 45 20 41 |ER IN PAGE &FE A| 000000e0 53 20 50 41 52 41 4d 45 54 45 52 2e 2a 2a 2a 0d |S PARAMETER.***.| 000000f0 27 1a 15 20 dd 20 a4 70 65 65 6b 28 6f 66 66 73 |'.. . .peek(offs| 00000100 65 74 29 20 0d 27 24 0c 20 ea 20 76 61 6c 75 65 |et) .'$. . value| 00000110 0d 27 2e 3a 20 41 25 3d 31 35 30 3a 58 25 3d 6f |.'.: A%=150:X%=o| 00000120 66 66 73 65 74 3a 76 61 6c 75 65 3d 28 ba 28 26 |ffset:value=(.(&| 00000130 46 46 46 34 29 20 80 20 26 46 46 30 30 30 30 29 |FFF4) . &FF0000)| 00000140 20 81 20 26 31 30 30 30 30 20 0d 27 38 0b 20 3d | . &10000 .'8. =| 00000150 76 61 6c 75 65 0d 2a f8 94 20 f4 20 2a 2a 2a 55 |value.*.. . ***U| 00000160 53 45 53 20 4f 53 42 59 54 45 2f 2a 46 58 31 35 |SES OSBYTE/*FX15| 00000170 31 20 54 4f 20 57 52 49 54 45 20 41 20 56 41 4c |1 TO WRITE A VAL| 00000180 55 45 20 54 4f 20 41 20 56 49 41 20 52 45 47 49 |UE TO A VIA REGI| 00000190 53 54 45 52 2e 20 20 52 45 51 55 49 52 45 53 20 |STER. REQUIRES | 000001a0 4f 46 46 53 45 54 20 4f 46 20 52 45 47 49 53 54 |OFFSET OF REGIST| 000001b0 45 52 20 49 4e 20 50 41 47 45 20 26 46 45 2c 20 |ER IN PAGE &FE, | 000001c0 41 4e 44 20 56 41 4c 55 45 20 54 4f 20 42 45 20 |AND VALUE TO BE | 000001d0 57 52 49 54 54 45 4e 20 41 53 20 50 41 52 41 4d |WRITTEN AS PARAM| 000001e0 45 54 45 52 53 2e 2a 2a 2a 0d 2b 02 1a 20 dd 20 |ETERS.***.+.. . | 000001f0 f2 70 6f 6b 65 28 6f 66 66 73 65 74 2c 76 61 6c |.poke(offset,val| 00000200 75 65 29 0d 2b 0c 27 20 41 25 3d 31 35 31 3a 58 |ue).+.' A%=151:X| 00000210 25 3d 6f 66 66 73 65 74 3a 59 25 3d 76 61 6c 75 |%=offset:Y%=valu| 00000220 65 3a d6 20 26 46 46 46 34 20 0d 2b 16 08 20 e1 |e:. &FFF4 .+.. .| 00000230 20 20 0d 2e e0 51 20 f4 20 2a 2a 2a 45 58 41 4d | ...Q . ***EXAM| 00000240 49 4e 45 53 20 54 48 45 20 43 55 52 52 45 4e 54 |INES THE CURRENT| 00000250 20 53 54 41 54 45 20 4f 46 20 54 48 45 20 52 45 | STATE OF THE RE| 00000260 4c 41 59 20 53 50 45 43 49 46 49 45 44 20 41 4e |LAY SPECIFIED AN| 00000270 44 20 53 57 41 50 53 20 49 54 20 4f 56 45 52 2e |D SWAPS IT OVER.| 00000280 2a 2a 2a 0d 2e ea 1b 20 dd 20 f2 74 6f 67 67 6c |***.... . .toggl| 00000290 65 28 6c 69 6e 65 6e 75 6d 62 65 72 29 20 0d 2e |e(linenumber) ..| 000002a0 f4 2e 20 e7 20 28 6c 69 6e 65 6e 75 6d 62 65 72 |.. . (linenumber| 000002b0 3e 33 20 84 20 6c 69 6e 65 6e 75 6d 62 65 72 3c |>3 . linenumber<| 000002c0 30 29 20 8c 20 2a 46 58 31 32 35 20 0d 2e fe 21 |0) . *FX125 ...!| 000002d0 20 ea 20 62 69 74 76 61 6c 75 65 2c 6f 6c 64 76 | . bitvalue,oldv| 000002e0 61 6c 75 65 2c 6e 65 77 76 61 6c 75 65 0d 2f 08 |alue,newvalue./.| 000002f0 1a 20 62 69 74 76 61 6c 75 65 3d 32 5e 6c 69 6e |. bitvalue=2^lin| 00000300 65 6e 75 6d 62 65 72 0d 2f 12 1a 20 6f 6c 64 76 |enumber./.. oldv| 00000310 61 6c 75 65 3d a4 70 65 65 6b 28 26 36 30 29 20 |alue=.peek(&60) | 00000320 20 0d 2f 1c 21 20 6e 65 77 76 61 6c 75 65 3d 6f | ./.! newvalue=o| 00000330 6c 64 76 61 6c 75 65 20 82 20 62 69 74 76 61 6c |ldvalue . bitval| 00000340 75 65 0d 2f 26 18 20 f2 70 6f 6b 65 28 26 36 30 |ue./&. .poke(&60| 00000350 2c 6e 65 77 76 61 6c 75 65 29 0d 2f 30 08 20 e1 |,newvalue)./0. .| 00000360 20 20 0d 32 c8 7e 20 f4 20 2a 2a 2a 54 55 52 4e | .2.~ . ***TURN| 00000370 53 20 4f 4e 20 4f 52 20 4f 46 46 20 41 20 53 50 |S ON OR OFF A SP| 00000380 45 43 49 46 49 45 44 20 52 45 4c 41 59 2e 20 20 |ECIFIED RELAY. | 00000390 52 45 51 55 49 52 45 53 20 41 43 54 49 4f 4e 20 |REQUIRES ACTION | 000003a0 54 4f 20 42 45 20 54 41 4b 45 4e 20 69 65 2e 20 |TO BE TAKEN ie. | 000003b0 22 4f 4e 22 20 4f 52 20 22 4f 46 46 22 2c 20 41 |"ON" OR "OFF", A| 000003c0 4e 44 20 52 45 4c 41 59 20 4e 55 4d 42 45 52 20 |ND RELAY NUMBER | 000003d0 41 53 20 50 41 52 41 4d 45 54 45 52 53 2a 2a 2a |AS PARAMETERS***| 000003e0 0d 32 d2 21 20 dd 20 f2 74 75 72 6e 28 6f 6e 4f |.2.! . .turn(onO| 000003f0 52 6f 66 66 24 2c 6c 69 6e 65 6e 75 6d 62 65 72 |Roff$,linenumber| 00000400 29 0d 32 dc 32 20 e7 20 ac 28 6f 6e 4f 52 6f 66 |).2.2 . .(onORof| 00000410 66 24 3d 22 4f 4e 22 20 84 20 6f 6e 4f 52 6f 66 |f$="ON" . onORof| 00000420 66 24 3d 22 4f 46 46 22 29 20 8c 20 2a 46 58 31 |f$="OFF") . *FX1| 00000430 32 35 20 0d 32 e6 2e 20 e7 20 28 6c 69 6e 65 6e |25 .2.. . (linen| 00000440 75 6d 62 65 72 3e 33 20 84 20 6c 69 6e 65 6e 75 |umber>3 . linenu| 00000450 6d 62 65 72 3c 30 29 20 8c 20 2a 46 58 31 32 35 |mber<0) . *FX125| 00000460 20 0d 32 f0 21 20 ea 20 62 69 74 76 61 6c 75 65 | .2.! . bitvalue| 00000470 2c 6f 6c 64 76 61 6c 75 65 2c 6e 65 77 76 61 6c |,oldvalue,newval| 00000480 75 65 0d 32 fa 1a 20 62 69 74 76 61 6c 75 65 3d |ue.2.. bitvalue=| 00000490 32 5e 6c 69 6e 65 6e 75 6d 62 65 72 0d 33 04 19 |2^linenumber.3..| 000004a0 20 6f 6c 64 76 61 6c 75 65 3d a4 70 65 65 6b 28 | oldvalue=.peek(| 000004b0 26 36 30 29 20 0d 33 0e 58 20 e7 20 6f 6e 4f 52 |&60) .3.X . onOR| 000004c0 6f 66 66 24 3d 22 4f 4e 22 20 8c 20 6e 65 77 76 |off$="ON" . newv| 000004d0 61 6c 75 65 3d 6f 6c 64 76 61 6c 75 65 20 84 20 |alue=oldvalue . | 000004e0 62 69 74 76 61 6c 75 65 20 8b 20 6e 65 77 76 61 |bitvalue . newva| 000004f0 6c 75 65 3d 6f 6c 64 76 61 6c 75 65 20 80 20 28 |lue=oldvalue . (| 00000500 32 35 35 2d 62 69 74 76 61 6c 75 65 29 0d 33 18 |255-bitvalue).3.| 00000510 18 20 f2 70 6f 6b 65 28 26 36 30 2c 6e 65 77 76 |. .poke(&60,newv| 00000520 61 6c 75 65 29 0d 33 22 06 20 e1 0d 36 b0 66 20 |alue).3". ..6.f | 00000530 f4 20 2a 2a 2a 54 45 53 54 53 20 54 48 45 20 43 |. ***TESTS THE C| 00000540 55 52 52 45 4e 54 20 53 54 41 54 45 20 4f 46 20 |URRENT STATE OF | 00000550 54 48 45 20 53 50 45 43 49 46 49 45 44 20 49 4e |THE SPECIFIED IN| 00000560 50 55 54 20 28 34 2d 37 29 20 41 4e 44 20 52 45 |PUT (4-7) AND RE| 00000570 54 55 52 4e 53 20 54 48 45 20 56 41 4c 55 45 20 |TURNS THE VALUE | 00000580 22 4f 4e 22 20 4f 52 20 22 4f 46 46 22 2e 2a 2a |"ON" OR "OFF".**| 00000590 2a 0d 36 ba 19 20 dd 20 a4 74 65 73 74 28 6c 69 |*.6.. . .test(li| 000005a0 6e 65 6e 75 6d 62 65 72 29 20 0d 36 c4 2f 20 e7 |nenumber) .6./ .| 000005b0 20 28 6c 69 6e 65 6e 75 6d 62 65 72 3e 37 20 84 | (linenumber>7 .| 000005c0 20 6c 69 6e 65 6e 75 6d 62 65 72 3c 34 29 20 8c | linenumber<4) .| 000005d0 20 2a 46 58 31 32 35 20 20 0d 36 ce 0f 20 ea 20 | *FX125 .6.. . | 000005e0 62 69 74 76 61 6c 75 65 0d 36 d8 1a 20 62 69 74 |bitvalue.6.. bit| 000005f0 76 61 6c 75 65 3d 32 5e 6c 69 6e 65 6e 75 6d 62 |value=2^linenumb| 00000600 65 72 0d 36 e2 2e 20 72 65 73 75 6c 74 3d 28 28 |er.6.. result=((| 00000610 a4 70 65 65 6b 28 26 36 30 29 20 80 20 62 69 74 |.peek(&60) . bit| 00000620 76 61 6c 75 65 29 3d 62 69 74 76 61 6c 75 65 29 |value)=bitvalue)| 00000630 0d 36 ec 1e 20 e7 20 72 65 73 75 6c 74 20 8c 20 |.6.. . result . | 00000640 3d 22 4f 4e 22 20 8b 20 3d 22 4f 46 46 22 0d 3a |="ON" . ="OFF".:| 00000650 98 99 20 f4 20 2a 2a 2a 54 45 53 54 53 20 54 48 |.. . ***TESTS TH| 00000660 45 20 53 54 41 54 45 20 4f 46 20 54 48 45 20 53 |E STATE OF THE S| 00000670 50 45 43 49 46 49 45 44 20 52 45 4c 41 59 53 20 |PECIFIED RELAYS | 00000680 49 4e 20 54 55 52 4e 20 41 4e 44 20 53 57 41 50 |IN TURN AND SWAP| 00000690 53 20 54 48 45 4d 2e 20 52 45 51 55 49 52 45 53 |S THEM. REQUIRES| 000006a0 20 41 20 53 54 52 49 4e 47 20 52 45 50 52 45 53 | A STRING REPRES| 000006b0 45 4e 54 49 4e 47 20 54 48 45 20 52 45 4c 41 59 |ENTING THE RELAY| 000006c0 53 20 54 4f 20 42 45 20 54 4f 47 47 4c 45 44 20 |S TO BE TOGGLED | 000006d0 41 53 20 41 20 42 49 4e 41 52 59 20 50 41 54 54 |AS A BINARY PATT| 000006e0 45 52 4e 2e 2a 2a 2a 0d 3a a2 1e 20 dd 20 f2 6d |ERN.***.:.. . .m| 000006f0 75 6c 74 69 74 6f 67 67 6c 65 28 70 61 74 74 65 |ultitoggle(patte| 00000700 72 6e 24 29 20 0d 3a ac 23 20 ea 20 4c 2c 4c 24 |rn$) .:.# . L,L$| 00000710 2c 6d 61 73 6b 25 2c 6f 6c 64 76 61 6c 75 65 2c |,mask%,oldvalue,| 00000720 6e 65 77 76 61 6c 75 65 0d 3a b6 1e 20 e7 20 a9 |newvalue.:.. . .| 00000730 28 70 61 74 74 65 72 6e 24 29 3c 3e 34 20 8c 20 |(pattern$)<>4 . | 00000740 2a 46 58 31 32 35 0d 3a c0 3e 20 e3 20 4c 3d 31 |*FX125.:.> . L=1| 00000750 20 b8 20 34 3a 4c 24 3d c1 70 61 74 74 65 72 6e | . 4:L$=.pattern| 00000760 24 2c 4c 2c 31 29 3a e7 20 ac 28 4c 24 3d 22 31 |$,L,1):. .(L$="1| 00000770 22 20 84 20 4c 24 3d 22 30 22 29 20 8c 20 2a 46 |" . L$="0") . *F| 00000780 58 31 32 35 0d 3a ca 06 20 ed 0d 3a d4 45 20 6d |X125.:.. ..:.E m| 00000790 61 73 6b 25 3d 30 3a e3 20 4c 3d 31 20 b8 20 34 |ask%=0:. L=1 . 4| 000007a0 3a e7 20 28 c1 70 61 74 74 65 72 6e 24 2c 4c 2c |:. (.pattern$,L,| 000007b0 31 29 3d 22 31 22 29 20 8c 20 6d 61 73 6b 25 3d |1)="1") . mask%=| 000007c0 6d 61 73 6b 25 2b 32 5e 28 34 2d 4c 29 20 20 0d |mask%+2^(4-L) .| 000007d0 3a de 06 20 ed 0d 3a e8 32 20 6f 6c 64 76 61 6c |:.. ..:.2 oldval| 000007e0 75 65 3d a4 70 65 65 6b 28 26 36 30 29 3a 6e 65 |ue=.peek(&60):ne| 000007f0 77 76 61 6c 75 65 3d 6f 6c 64 76 61 6c 75 65 20 |wvalue=oldvalue | 00000800 82 20 6d 61 73 6b 25 0d 3a f2 18 20 f2 70 6f 6b |. mask%.:.. .pok| 00000810 65 28 26 36 30 2c 6e 65 77 76 61 6c 75 65 29 0d |e(&60,newvalue).| 00000820 3a fc 06 20 e1 0d 3e 80 ca 20 f4 20 2a 2a 2a 54 |:.. ..>.. . ***T| 00000830 55 52 4e 53 20 4f 4e 20 4f 52 20 4f 46 46 20 54 |URNS ON OR OFF T| 00000840 48 45 20 53 50 45 43 49 46 49 45 44 20 47 52 4f |HE SPECIFIED GRO| 00000850 55 50 20 4f 46 20 52 45 4c 41 59 53 2e 20 20 52 |UP OF RELAYS. R| 00000860 45 51 55 49 52 45 53 20 54 57 4f 20 50 41 52 41 |EQUIRES TWO PARA| 00000870 4d 45 54 45 52 53 3a 2d 28 69 29 54 48 45 20 41 |METERS:-(i)THE A| 00000880 43 54 49 4f 4e 20 54 4f 20 42 45 20 54 41 4b 45 |CTION TO BE TAKE| 00000890 4e 20 69 65 2e 22 4f 4e 22 20 4f 52 20 22 4f 46 |N ie."ON" OR "OF| 000008a0 46 22 2c 20 28 69 69 29 41 20 53 54 52 49 4e 47 |F", (ii)A STRING| 000008b0 20 52 45 50 52 45 53 45 4e 54 49 4e 47 20 54 48 | REPRESENTING TH| 000008c0 45 20 52 45 4c 41 59 53 20 54 4f 20 42 45 20 53 |E RELAYS TO BE S| 000008d0 57 49 54 43 48 45 44 20 41 53 20 41 20 42 49 4e |WITCHED AS A BIN| 000008e0 41 52 59 20 50 41 54 54 45 52 4e 2e 2a 2a 2a 0d |ARY PATTERN.***.| 000008f0 3e 8a 24 20 dd 20 f2 6d 75 6c 74 69 74 75 72 6e |>.$ . .multiturn| 00000900 28 6f 6e 4f 52 6f 66 66 24 2c 70 61 74 74 65 72 |(onORoff$,patter| 00000910 6e 24 29 0d 3e 94 23 20 ea 20 4c 2c 4c 24 2c 6d |n$).>.# . L,L$,m| 00000920 61 73 6b 25 2c 6f 6c 64 76 61 6c 75 65 2c 6e 65 |ask%,oldvalue,ne| 00000930 77 76 61 6c 75 65 0d 3e 9e 42 20 e7 20 a9 28 70 |wvalue.>.B . .(p| 00000940 61 74 74 65 72 6e 24 29 3c 3e 34 20 84 20 ac 28 |attern$)<>4 . .(| 00000950 6f 6e 4f 52 6f 66 66 24 3d 22 4f 4e 22 20 84 20 |onORoff$="ON" . | 00000960 6f 6e 4f 52 6f 66 66 24 3d 22 4f 46 46 22 29 20 |onORoff$="OFF") | 00000970 8c 20 2a 46 58 31 32 35 0d 3e a8 3e 20 e3 20 4c |. *FX125.>.> . L| 00000980 3d 31 20 b8 20 34 3a 4c 24 3d c1 70 61 74 74 65 |=1 . 4:L$=.patte| 00000990 72 6e 24 2c 4c 2c 31 29 3a e7 20 ac 28 4c 24 3d |rn$,L,1):. .(L$=| 000009a0 22 31 22 20 84 20 4c 24 3d 22 30 22 29 20 8c 20 |"1" . L$="0") . | 000009b0 2a 46 58 31 32 35 0d 3e b2 06 20 ed 0d 3e bc 45 |*FX125.>.. ..>.E| 000009c0 20 6d 61 73 6b 25 3d 30 3a e3 20 4c 3d 31 20 b8 | mask%=0:. L=1 .| 000009d0 20 34 3a e7 20 28 c1 70 61 74 74 65 72 6e 24 2c | 4:. (.pattern$,| 000009e0 4c 2c 31 29 3d 22 31 22 29 20 8c 20 6d 61 73 6b |L,1)="1") . mask| 000009f0 25 3d 6d 61 73 6b 25 2b 32 5e 28 34 2d 4c 29 20 |%=mask%+2^(4-L) | 00000a00 20 0d 3e c6 06 20 ed 0d 3e d0 66 20 6f 6c 64 76 | .>.. ..>.f oldv| 00000a10 61 6c 75 65 3d a4 70 65 65 6b 28 26 36 30 29 3a |alue=.peek(&60):| 00000a20 e7 20 6f 6e 4f 52 6f 66 66 24 3d 22 4f 4e 22 20 |. onORoff$="ON" | 00000a30 8c 20 6e 65 77 76 61 6c 75 65 3d 6f 6c 64 76 61 |. newvalue=oldva| 00000a40 6c 75 65 20 84 20 6d 61 73 6b 25 20 8b 20 6e 65 |lue . mask% . ne| 00000a50 77 76 61 6c 75 65 3d 6f 6c 64 76 61 6c 75 65 20 |wvalue=oldvalue | 00000a60 80 20 28 32 35 35 2d 6d 61 73 6b 25 29 0d 3e da |. (255-mask%).>.| 00000a70 18 20 f2 70 6f 6b 65 28 26 36 30 2c 6e 65 77 76 |. .poke(&60,newv| 00000a80 61 6c 75 65 29 0d 3e e4 06 20 e1 0d 42 68 d3 20 |alue).>.. ..Bh. | 00000a90 f4 20 2a 2a 2a 54 45 53 54 53 20 54 48 45 20 53 |. ***TESTS THE S| 00000aa0 50 45 43 49 46 49 45 44 20 47 52 4f 55 50 20 4f |PECIFIED GROUP O| 00000ab0 46 20 49 4e 50 55 54 53 20 41 4e 44 20 52 45 54 |F INPUTS AND RET| 00000ac0 55 52 4e 53 20 54 48 45 20 56 41 4c 55 45 20 22 |URNS THE VALUE "| 00000ad0 4f 4e 22 20 49 46 20 41 4c 4c 20 4f 46 20 54 48 |ON" IF ALL OF TH| 00000ae0 45 4d 20 41 52 45 20 4f 4e 20 41 4e 44 20 22 4f |EM ARE ON AND "O| 00000af0 46 46 22 20 49 46 20 41 4e 59 20 4f 4e 45 20 4f |FF" IF ANY ONE O| 00000b00 46 20 54 48 45 4d 20 49 53 20 4f 46 46 2e 20 20 |F THEM IS OFF. | 00000b10 52 45 51 55 49 52 45 53 20 41 20 53 54 52 49 4e |REQUIRES A STRIN| 00000b20 47 20 52 45 50 52 45 53 45 4e 54 49 4e 47 20 54 |G REPRESENTING T| 00000b30 48 45 20 49 4e 50 55 54 53 20 54 4f 20 42 45 20 |HE INPUTS TO BE | 00000b40 54 45 53 54 45 44 20 41 53 20 41 20 42 49 4e 41 |TESTED AS A BINA| 00000b50 52 59 20 50 41 54 54 45 52 4e 2e 2a 2a 2a 0d 42 |RY PATTERN.***.B| 00000b60 72 1c 20 dd 20 a4 6d 75 6c 74 69 74 65 73 74 28 |r. . .multitest(| 00000b70 70 61 74 74 65 72 6e 24 29 20 0d 42 7c 1c 20 ea |pattern$) .B|. .| 00000b80 20 4c 2c 4c 24 2c 74 65 73 74 6d 61 73 6b 25 2c | L,L$,testmask%,| 00000b90 72 65 73 75 6c 74 0d 42 86 1e 20 e7 20 a9 28 70 |result.B.. . .(p| 00000ba0 61 74 74 65 72 6e 24 29 3c 3e 34 20 8c 20 2a 46 |attern$)<>4 . *F| 00000bb0 58 31 32 35 0d 42 90 3e 20 e3 20 4c 3d 31 20 b8 |X125.B.> . L=1 .| 00000bc0 20 34 3a 4c 24 3d c1 70 61 74 74 65 72 6e 24 2c | 4:L$=.pattern$,| 00000bd0 4c 2c 31 29 3a e7 20 ac 28 4c 24 3d 22 31 22 20 |L,1):. .(L$="1" | 00000be0 84 20 4c 24 3d 22 30 22 29 20 8c 20 2a 46 58 31 |. L$="0") . *FX1| 00000bf0 32 35 0d 42 9a 06 20 ed 0d 42 a4 50 20 74 65 73 |25.B.. ..B.P tes| 00000c00 74 6d 61 73 6b 25 3d 30 3a e3 20 4c 3d 31 20 b8 |tmask%=0:. L=1 .| 00000c10 20 34 3a e7 20 28 c1 70 61 74 74 65 72 6e 24 2c | 4:. (.pattern$,| 00000c20 4c 2c 31 29 3d 22 31 22 29 20 8c 20 74 65 73 74 |L,1)="1") . test| 00000c30 6d 61 73 6b 25 3d 74 65 73 74 6d 61 73 6b 25 2b |mask%=testmask%+| 00000c40 32 5e 28 38 2d 4c 29 20 0d 42 ae 06 20 ed 0d 42 |2^(8-L) .B.. ..B| 00000c50 b8 31 20 72 65 73 75 6c 74 3d 28 28 a4 70 65 65 |.1 result=((.pee| 00000c60 6b 28 26 36 30 29 20 80 20 74 65 73 74 6d 61 73 |k(&60) . testmas| 00000c70 6b 25 29 3d 74 65 73 74 6d 61 73 6b 25 29 20 0d |k%)=testmask%) .| 00000c80 42 c2 1e 20 e7 20 72 65 73 75 6c 74 20 8c 20 3d |B.. . result . =| 00000c90 22 4f 4e 22 20 8b 20 3d 22 4f 46 46 22 0d 46 50 |"ON" . ="OFF".FP| 00000ca0 6c 20 f4 20 2a 2a 2a 49 4e 49 54 49 41 4c 49 53 |l . ***INITIALIS| 00000cb0 45 53 20 55 53 45 52 20 50 4f 52 54 20 41 53 20 |ES USER PORT AS | 00000cc0 46 4f 55 52 20 4f 55 54 50 55 54 53 20 4f 4e 20 |FOUR OUTPUTS ON | 00000cd0 50 42 30 2d 33 20 41 4e 44 20 46 4f 55 52 20 49 |PB0-3 AND FOUR I| 00000ce0 4e 50 55 54 53 20 4f 4e 20 50 42 34 2d 37 2e 20 |NPUTS ON PB4-7. | 00000cf0 54 55 52 4e 53 20 41 4c 4c 20 4f 55 54 50 55 54 |TURNS ALL OUTPUT| 00000d00 53 20 4f 46 46 2e 2a 2a 2a 0d 46 5a 13 20 dd 20 |S OFF.***.FZ. . | 00000d10 f2 73 65 74 5f 75 70 5f 70 6f 72 74 0d 46 64 12 |.set_up_port.Fd.| 00000d20 20 f2 70 6f 6b 65 28 26 36 32 2c 31 35 29 0d 46 | .poke(&62,15).F| 00000d30 6e 11 20 f2 70 6f 6b 65 28 26 36 30 2c 30 29 0d |n. .poke(&60,0).| 00000d40 46 78 06 20 e1 0d ff |Fx. ...| 00000d47