Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_36.ADF » F/CODE13

F/CODE13

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 ADFS disks » Electron_User_Group » EUG_36.ADF
Filename: F/CODE13
Read OK:
File size: 0C20 bytes
Load address: FFFFFB48
Exec address: FFFF1FC8
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Read barcode scanner & decode
   20DIM bar% 128
   30DIM width% 256
   40REM Arrays for the lookup tables
   50DIM setA%(9),setB%(9),setC%(9)
   60DIM order$(9)
   70:
   80FORX=0 TO2 STEP2
   90P%=bar%
  100[OPTX
  110.null
  120LDX#0:\X=offset into table
  130\Poll until sync pulse starts
  140LDA&FE60:CMP#255:BEQnull
  150.sync
  160\Poll until the sync pulse ends
  170LDA&FE60:AND#1:BEQsync
  180.delta 
  190STAlast:\Copy previous value
  200LDA#0:STAwidth%,X:\Reset table 
  210.addon
  220INCwidth%,X:BEQexit
  230.load 
  240LDA&FE60:AND#1:\Data in on PB0
  250CMPlast:BEQaddon:\Changed?
  260INX:JMPdelta:\Move on 1 & repeat
  270.exit 
  280RTS:\Returns length in X
  290.last 
  300EQUB0 
  310]
  320NEXT 
  330:
  340FORoffset%=0TO9
  350READsetA%(offset%),setB%(offset%),setC%(offset%),order$(offset%)
  360NEXT
  370: 
  380REPEAT
  390PRINT"Waiting for scan..."
  400length%=(USRnull AND&FF00)DIV256
  410length%=length%-1 
  420PRINT"Processing..."
  430: 
  440REM Find unit width by averaging the 6 start & stop bars (always 1 wide)
  450U%=0
  460FORptr%=0 TO(length%-2) STEP(length%-2)
  470FORoffset%=ptr% TO(ptr%+2) 
  480U%=U%+?(width%+offset%) 
  490NEXT
  500NEXT:U%=U% DIV6:REM Average it
  510: 
  520REM Now convert to 1's and 0's
  530W%=U% DIV2:REM Set an allowed window width W% for errors either side of the expected unit width U%
  540bar$=""
  550FORoffset%=0 TOlength% 
  560data%=?(width%+offset%)
  570FORbar%=1TO4 
  580IFdata%>((bar%*U%)-W%) ANDdata%<((bar%*U%)+W%) THENR%=bar%:REM Look through window
  590NEXT 
  600bar$=bar$+STRING$(R%,STR$((offset%+1)MOD2)):REM Add to string
  610NEXT 
  620:
  630REM Check the extremities
  640IFLEFT$(bar$,3)<>"101" ORRIGHT$(bar$,3)<>"101" THENPRINT"Missing start or stop bits":GOTO920
  650:
  660REM Discard start/stop bits
  670bar$=MID$(bar$,4,LEN(bar$)-6)
  680IFLENbar$<>((12*7)+5) THENPRINT"Wrong length for a code 13 barcode":GOTO920
  690:
  700REM Can't guess this bit,so ask
  710PRINT"Enter COMBINATION number:";:REPEAT:key%=GET-48:UNTIL(key%>-1 ANDkey%<10):PRINTkey%
  720:
  730REM Isolate first 6 bit patterns
  740FORoffset%=1TO36STEP7
  750subset$=MID$(order$(key%),1+(offset% DIV7),1):REM This selects the relevant subset from the "AABBABA..." pattern based on the key pressed above
  760byte$=MID$(bar$,offset%,7)
  770PRINTbyte$;" => ";
  780PROCdecode(byte$,subset$)
  790NEXT
  800:
  810REM Test guard bit
  820PRINT'"[";MID$(bar$,43,5);"]"'
  830IFMID$(bar$,43,5)<>"01010" THENPRINT"Bad guard bits":GOTO920
  840:
  850REM List last 6 bit patterns
  860FORoffset%=48TO83STEP7
  870byte$=MID$(bar$,offset%,7)
  880PRINTbyte$;" => ";:REM All're "C"
  890PROCdecode(byte$,"C")
  900NEXT
  910:
  920key%=GET
  930UNTIL0 
  940:
  950DEFFNtodecimal(binary$)
  960LOCAL result%,bit%
  970FORbit%=6TO0STEP-1
  980IFMID$(binary$,6-bit%+1,1)="1" THENresult%=result%+(2^bit%)
  990NEXT
 1000=result%
 1010:
 1020DEFPROCdecode(value$,table$)
 1030LOCAL lookup%,value%,table%
 1040value%=FNtodecimal(value$)
 1050table$="set"+table$+"%(":REM Choose the array name during run time,the individual array element is chosen below
 1060REPEAT
 1070array$=table$+"lookup%)"
 1080IFEVAL(array$)=value% THENPRINT;lookup%:lookup%=-2
 1090lookup%=lookup%+1
 1100UNTILlookup%<0 ORlookup%>9
 1110IFlookup%>9 THENPRINT"Not decodable"
 1120ENDPROC
 1130:
 1140REM Data to be read in COLUMNs
 1150REM  A   B   C    order 
 1160DATA 013,039,114,"AAAAAA"
 1170DATA 025,051,102,"AABABB"
 1180DATA 019,027,108,"AABBAB"
 1190DATA 061,033,066,"AABBBA"
 1200DATA 035,029,092,"ABAABB"
 1210DATA 051,057,078,"ABBAAB"
 1220DATA 047,005,080,"ABBBAA"
 1230DATA 059,017,068,"ABABAB"
 1240DATA 055,009,072,"ABABBA"
 1250DATA 011,023,116,"ABBABA"

#� Read barcode scanner & decode
� bar% 128
� width% 256
("� Arrays for the lookup tables
2 � setA%(9),setB%(9),setC%(9)
<� order$(9)
F:
P�X=0 �2 �2
ZP%=bar%
d	[OPTX
n	.null
xLDX#0:\X=offset into table
�!\Poll until sync pulse starts
�LDA&FE60:CMP#255:BEQnull
�	.sync
�#\Poll until the sync pulse ends
�LDA&FE60:�#1:BEQsync
�.delta 
� STAlast:\Copy previous value
�#LDA#0:STAwidth%,X:\Reset table 
�
.addon
�INCwidth%,X:BEQexit
�
.load 
� LDA&FE60:�#1:\Data in on PB0
�CMPlast:BEQaddon:\Changed?
$INX:JMPdelta:\Move on 1 & repeat

.exit 
RTS:\Returns length in X
"
.last 
,
EQUB0 
6]
@� 
J:
T�offset%=0�9
^A�setA%(offset%),setB%(offset%),setC%(offset%),order$(offset%)
h�
r: 
|�
��"Waiting for scan..."
�length%=(�null �&FF00)�256
�length%=length%-1 
��"Processing..."
�: 
�J� Find unit width by averaging the 6 start & stop bars (always 1 wide)
�U%=0
�%�ptr%=0 �(length%-2) �(length%-2)
��offset%=ptr% �(ptr%+2) 
�U%=U%+?(width%+offset%) 
��
��:U%=U% �6:� Average it
�: 
 � Now convert to 1's and 0's
bW%=U% �2:� Set an allowed window width W% for errors either side of the expected unit width U%
bar$=""
&�offset%=0 �length% 
0data%=?(width%+offset%)
:�bar%=1�4 
DN�data%>((bar%*U%)-W%) �data%<((bar%*U%)+W%) �R%=bar%:� Look through window
N� 
X3bar$=bar$+�R%,�((offset%+1)�2)):� Add to string
b� 
l:
v� Check the extremities
�J�bar$,3)<>"101" ��bar$,3)<>"101" ��"Missing start or stop bits":�tXC
�:
�� Discard start/stop bits
�bar$=�bar$,4,�(bar$)-6)
�C�bar$<>((12*7)+5) ��"Wrong length for a code 13 barcode":�tXC
�:
�!� Can't guess this bit,so ask
�G�"Enter COMBINATION number:";:�:key%=�-48:�(key%>-1 �key%<10):�key%
�:
�"� Isolate first 6 bit patterns
��offset%=1�36�7
�subset$=�order$(key%),1+(offset% �7),1):� This selects the relevant subset from the "AABBABA..." pattern based on the key pressed above
�byte$=�bar$,offset%,7)
�byte$;" => ";
�decode(byte$,subset$)
�
 :
*� Test guard bit
4�'"[";�bar$,43,5);"]"'
>2�bar$,43,5)<>"01010" ��"Bad guard bits":�tXC
H:
R� List last 6 bit patterns
\�offset%=48�83�7
fbyte$=�bar$,offset%,7)
p�byte$;" => ";:� All're "C"
z�decode(byte$,"C")
��
�:
�
key%=�
��0 
�:
�ݤtodecimal(binary$)
�� result%,bit%
��bit%=6�0�-1
�7�binary$,6-bit%+1,1)="1" �result%=result%+(2^bit%)
��
�=result%
�:
���decode(value$,table$)
� lookup%,value%,table%
value%=�todecimal(value$)
qtable$="set"+table$+"%(":� Choose the array name during run time,the individual array element is chosen below
$�
.array$=table$+"lookup%)"
8+�(array$)=value% ��;lookup%:lookup%=-2
Blookup%=lookup%+1
L�lookup%<0 �lookup%>9
V �lookup%>9 ��"Not decodable"
`�
j:
t � Data to be read in COLUMNs
~�  A   B   C    order 
�� 013,039,114,"AAAAAA"
�� 025,051,102,"AABABB"
�� 019,027,108,"AABBAB"
�� 061,033,066,"AABBBA"
�� 035,029,092,"ABAABB"
�� 051,057,078,"ABBAAB"
�� 047,005,080,"ABBBAA"
�� 059,017,068,"ABABAB"
�� 055,009,072,"ABABBA"
�� 011,023,116,"ABBABA"
�
00000000  0d 00 0a 23 f4 20 52 65  61 64 20 62 61 72 63 6f  |...#. Read barco|
00000010  64 65 20 73 63 61 6e 6e  65 72 20 26 20 64 65 63  |de scanner & dec|
00000020  6f 64 65 0d 00 14 0e de  20 62 61 72 25 20 31 32  |ode..... bar% 12|
00000030  38 0d 00 1e 10 de 20 77  69 64 74 68 25 20 32 35  |8..... width% 25|
00000040  36 0d 00 28 22 f4 20 41  72 72 61 79 73 20 66 6f  |6..(". Arrays fo|
00000050  72 20 74 68 65 20 6c 6f  6f 6b 75 70 20 74 61 62  |r the lookup tab|
00000060  6c 65 73 0d 00 32 20 de  20 73 65 74 41 25 28 39  |les..2 . setA%(9|
00000070  29 2c 73 65 74 42 25 28  39 29 2c 73 65 74 43 25  |),setB%(9),setC%|
00000080  28 39 29 0d 00 3c 0f de  20 6f 72 64 65 72 24 28  |(9)..<.. order$(|
00000090  39 29 0d 00 46 05 3a 0d  00 50 0e e3 58 3d 30 20  |9)..F.:..P..X=0 |
000000a0  b8 32 20 88 32 0d 00 5a  0b 50 25 3d 62 61 72 25  |.2 .2..Z.P%=bar%|
000000b0  0d 00 64 09 5b 4f 50 54  58 0d 00 6e 09 2e 6e 75  |..d.[OPTX..n..nu|
000000c0  6c 6c 0d 00 78 1e 4c 44  58 23 30 3a 5c 58 3d 6f  |ll..x.LDX#0:\X=o|
000000d0  66 66 73 65 74 20 69 6e  74 6f 20 74 61 62 6c 65  |ffset into table|
000000e0  0d 00 82 21 5c 50 6f 6c  6c 20 75 6e 74 69 6c 20  |...!\Poll until |
000000f0  73 79 6e 63 20 70 75 6c  73 65 20 73 74 61 72 74  |sync pulse start|
00000100  73 0d 00 8c 1c 4c 44 41  26 46 45 36 30 3a 43 4d  |s....LDA&FE60:CM|
00000110  50 23 32 35 35 3a 42 45  51 6e 75 6c 6c 0d 00 96  |P#255:BEQnull...|
00000120  09 2e 73 79 6e 63 0d 00  a0 23 5c 50 6f 6c 6c 20  |..sync...#\Poll |
00000130  75 6e 74 69 6c 20 74 68  65 20 73 79 6e 63 20 70  |until the sync p|
00000140  75 6c 73 65 20 65 6e 64  73 0d 00 aa 18 4c 44 41  |ulse ends....LDA|
00000150  26 46 45 36 30 3a 80 23  31 3a 42 45 51 73 79 6e  |&FE60:.#1:BEQsyn|
00000160  63 0d 00 b4 0b 2e 64 65  6c 74 61 20 0d 00 be 20  |c.....delta ... |
00000170  53 54 41 6c 61 73 74 3a  5c 43 6f 70 79 20 70 72  |STAlast:\Copy pr|
00000180  65 76 69 6f 75 73 20 76  61 6c 75 65 0d 00 c8 23  |evious value...#|
00000190  4c 44 41 23 30 3a 53 54  41 77 69 64 74 68 25 2c  |LDA#0:STAwidth%,|
000001a0  58 3a 5c 52 65 73 65 74  20 74 61 62 6c 65 20 0d  |X:\Reset table .|
000001b0  00 d2 0a 2e 61 64 64 6f  6e 0d 00 dc 17 49 4e 43  |....addon....INC|
000001c0  77 69 64 74 68 25 2c 58  3a 42 45 51 65 78 69 74  |width%,X:BEQexit|
000001d0  0d 00 e6 0a 2e 6c 6f 61  64 20 0d 00 f0 20 4c 44  |.....load ... LD|
000001e0  41 26 46 45 36 30 3a 80  23 31 3a 5c 44 61 74 61  |A&FE60:.#1:\Data|
000001f0  20 69 6e 20 6f 6e 20 50  42 30 0d 00 fa 1e 43 4d  | in on PB0....CM|
00000200  50 6c 61 73 74 3a 42 45  51 61 64 64 6f 6e 3a 5c  |Plast:BEQaddon:\|
00000210  43 68 61 6e 67 65 64 3f  0d 01 04 24 49 4e 58 3a  |Changed?...$INX:|
00000220  4a 4d 50 64 65 6c 74 61  3a 5c 4d 6f 76 65 20 6f  |JMPdelta:\Move o|
00000230  6e 20 31 20 26 20 72 65  70 65 61 74 0d 01 0e 0a  |n 1 & repeat....|
00000240  2e 65 78 69 74 20 0d 01  18 1c 52 54 53 3a 5c 52  |.exit ....RTS:\R|
00000250  65 74 75 72 6e 73 20 6c  65 6e 67 74 68 20 69 6e  |eturns length in|
00000260  20 58 0d 01 22 0a 2e 6c  61 73 74 20 0d 01 2c 0a  | X.."..last ..,.|
00000270  45 51 55 42 30 20 0d 01  36 05 5d 0d 01 40 06 ed  |EQUB0 ..6.]..@..|
00000280  20 0d 01 4a 05 3a 0d 01  54 10 e3 6f 66 66 73 65  | ..J.:..T..offse|
00000290  74 25 3d 30 b8 39 0d 01  5e 41 f3 73 65 74 41 25  |t%=0.9..^A.setA%|
000002a0  28 6f 66 66 73 65 74 25  29 2c 73 65 74 42 25 28  |(offset%),setB%(|
000002b0  6f 66 66 73 65 74 25 29  2c 73 65 74 43 25 28 6f  |offset%),setC%(o|
000002c0  66 66 73 65 74 25 29 2c  6f 72 64 65 72 24 28 6f  |ffset%),order$(o|
000002d0  66 66 73 65 74 25 29 0d  01 68 05 ed 0d 01 72 06  |ffset%)..h....r.|
000002e0  3a 20 0d 01 7c 05 f5 0d  01 86 1a f1 22 57 61 69  |: ..|......."Wai|
000002f0  74 69 6e 67 20 66 6f 72  20 73 63 61 6e 2e 2e 2e  |ting for scan...|
00000300  22 0d 01 90 1e 6c 65 6e  67 74 68 25 3d 28 ba 6e  |"....length%=(.n|
00000310  75 6c 6c 20 80 26 46 46  30 30 29 81 32 35 36 0d  |ull .&FF00).256.|
00000320  01 9a 16 6c 65 6e 67 74  68 25 3d 6c 65 6e 67 74  |...length%=lengt|
00000330  68 25 2d 31 20 0d 01 a4  14 f1 22 50 72 6f 63 65  |h%-1 ....."Proce|
00000340  73 73 69 6e 67 2e 2e 2e  22 0d 01 ae 06 3a 20 0d  |ssing..."....: .|
00000350  01 b8 4a f4 20 46 69 6e  64 20 75 6e 69 74 20 77  |..J. Find unit w|
00000360  69 64 74 68 20 62 79 20  61 76 65 72 61 67 69 6e  |idth by averagin|
00000370  67 20 74 68 65 20 36 20  73 74 61 72 74 20 26 20  |g the 6 start & |
00000380  73 74 6f 70 20 62 61 72  73 20 28 61 6c 77 61 79  |stop bars (alway|
00000390  73 20 31 20 77 69 64 65  29 0d 01 c2 08 55 25 3d  |s 1 wide)....U%=|
000003a0  30 0d 01 cc 25 e3 70 74  72 25 3d 30 20 b8 28 6c  |0...%.ptr%=0 .(l|
000003b0  65 6e 67 74 68 25 2d 32  29 20 88 28 6c 65 6e 67  |ength%-2) .(leng|
000003c0  74 68 25 2d 32 29 0d 01  d6 1c e3 6f 66 66 73 65  |th%-2).....offse|
000003d0  74 25 3d 70 74 72 25 20  b8 28 70 74 72 25 2b 32  |t%=ptr% .(ptr%+2|
000003e0  29 20 0d 01 e0 1c 55 25  3d 55 25 2b 3f 28 77 69  |) ....U%=U%+?(wi|
000003f0  64 74 68 25 2b 6f 66 66  73 65 74 25 29 20 0d 01  |dth%+offset%) ..|
00000400  ea 05 ed 0d 01 f4 1b ed  3a 55 25 3d 55 25 20 81  |........:U%=U% .|
00000410  36 3a f4 20 41 76 65 72  61 67 65 20 69 74 0d 01  |6:. Average it..|
00000420  fe 06 3a 20 0d 02 08 20  f4 20 4e 6f 77 20 63 6f  |..: ... . Now co|
00000430  6e 76 65 72 74 20 74 6f  20 31 27 73 20 61 6e 64  |nvert to 1's and|
00000440  20 30 27 73 0d 02 12 62  57 25 3d 55 25 20 81 32  | 0's...bW%=U% .2|
00000450  3a f4 20 53 65 74 20 61  6e 20 61 6c 6c 6f 77 65  |:. Set an allowe|
00000460  64 20 77 69 6e 64 6f 77  20 77 69 64 74 68 20 57  |d window width W|
00000470  25 20 66 6f 72 20 65 72  72 6f 72 73 20 65 69 74  |% for errors eit|
00000480  68 65 72 20 73 69 64 65  20 6f 66 20 74 68 65 20  |her side of the |
00000490  65 78 70 65 63 74 65 64  20 75 6e 69 74 20 77 69  |expected unit wi|
000004a0  64 74 68 20 55 25 0d 02  1c 0b 62 61 72 24 3d 22  |dth U%....bar$="|
000004b0  22 0d 02 26 18 e3 6f 66  66 73 65 74 25 3d 30 20  |"..&..offset%=0 |
000004c0  b8 6c 65 6e 67 74 68 25  20 0d 02 30 1b 64 61 74  |.length% ..0.dat|
000004d0  61 25 3d 3f 28 77 69 64  74 68 25 2b 6f 66 66 73  |a%=?(width%+offs|
000004e0  65 74 25 29 0d 02 3a 0e  e3 62 61 72 25 3d 31 b8  |et%)..:..bar%=1.|
000004f0  34 20 0d 02 44 4e e7 64  61 74 61 25 3e 28 28 62  |4 ..DN.data%>((b|
00000500  61 72 25 2a 55 25 29 2d  57 25 29 20 80 64 61 74  |ar%*U%)-W%) .dat|
00000510  61 25 3c 28 28 62 61 72  25 2a 55 25 29 2b 57 25  |a%<((bar%*U%)+W%|
00000520  29 20 8c 52 25 3d 62 61  72 25 3a f4 20 4c 6f 6f  |) .R%=bar%:. Loo|
00000530  6b 20 74 68 72 6f 75 67  68 20 77 69 6e 64 6f 77  |k through window|
00000540  0d 02 4e 06 ed 20 0d 02  58 33 62 61 72 24 3d 62  |..N.. ..X3bar$=b|
00000550  61 72 24 2b c4 52 25 2c  c3 28 28 6f 66 66 73 65  |ar$+.R%,.((offse|
00000560  74 25 2b 31 29 83 32 29  29 3a f4 20 41 64 64 20  |t%+1).2)):. Add |
00000570  74 6f 20 73 74 72 69 6e  67 0d 02 62 06 ed 20 0d  |to string..b.. .|
00000580  02 6c 05 3a 0d 02 76 1b  f4 20 43 68 65 63 6b 20  |.l.:..v.. Check |
00000590  74 68 65 20 65 78 74 72  65 6d 69 74 69 65 73 0d  |the extremities.|
000005a0  02 80 4a e7 c0 62 61 72  24 2c 33 29 3c 3e 22 31  |..J..bar$,3)<>"1|
000005b0  30 31 22 20 84 c2 62 61  72 24 2c 33 29 3c 3e 22  |01" ..bar$,3)<>"|
000005c0  31 30 31 22 20 8c f1 22  4d 69 73 73 69 6e 67 20  |101" .."Missing |
000005d0  73 74 61 72 74 20 6f 72  20 73 74 6f 70 20 62 69  |start or stop bi|
000005e0  74 73 22 3a e5 8d 74 58  43 0d 02 8a 05 3a 0d 02  |ts":..tXC....:..|
000005f0  94 1d f4 20 44 69 73 63  61 72 64 20 73 74 61 72  |... Discard star|
00000600  74 2f 73 74 6f 70 20 62  69 74 73 0d 02 9e 1b 62  |t/stop bits....b|
00000610  61 72 24 3d c1 62 61 72  24 2c 34 2c a9 28 62 61  |ar$=.bar$,4,.(ba|
00000620  72 24 29 2d 36 29 0d 02  a8 43 e7 a9 62 61 72 24  |r$)-6)...C..bar$|
00000630  3c 3e 28 28 31 32 2a 37  29 2b 35 29 20 8c f1 22  |<>((12*7)+5) .."|
00000640  57 72 6f 6e 67 20 6c 65  6e 67 74 68 20 66 6f 72  |Wrong length for|
00000650  20 61 20 63 6f 64 65 20  31 33 20 62 61 72 63 6f  | a code 13 barco|
00000660  64 65 22 3a e5 8d 74 58  43 0d 02 b2 05 3a 0d 02  |de":..tXC....:..|
00000670  bc 21 f4 20 43 61 6e 27  74 20 67 75 65 73 73 20  |.!. Can't guess |
00000680  74 68 69 73 20 62 69 74  2c 73 6f 20 61 73 6b 0d  |this bit,so ask.|
00000690  02 c6 47 f1 22 45 6e 74  65 72 20 43 4f 4d 42 49  |..G."Enter COMBI|
000006a0  4e 41 54 49 4f 4e 20 6e  75 6d 62 65 72 3a 22 3b  |NATION number:";|
000006b0  3a f5 3a 6b 65 79 25 3d  a5 2d 34 38 3a fd 28 6b  |:.:key%=.-48:.(k|
000006c0  65 79 25 3e 2d 31 20 80  6b 65 79 25 3c 31 30 29  |ey%>-1 .key%<10)|
000006d0  3a f1 6b 65 79 25 0d 02  d0 05 3a 0d 02 da 22 f4  |:.key%....:...".|
000006e0  20 49 73 6f 6c 61 74 65  20 66 69 72 73 74 20 36  | Isolate first 6|
000006f0  20 62 69 74 20 70 61 74  74 65 72 6e 73 0d 02 e4  | bit patterns...|
00000700  13 e3 6f 66 66 73 65 74  25 3d 31 b8 33 36 88 37  |..offset%=1.36.7|
00000710  0d 02 ee 8b 73 75 62 73  65 74 24 3d c1 6f 72 64  |....subset$=.ord|
00000720  65 72 24 28 6b 65 79 25  29 2c 31 2b 28 6f 66 66  |er$(key%),1+(off|
00000730  73 65 74 25 20 81 37 29  2c 31 29 3a f4 20 54 68  |set% .7),1):. Th|
00000740  69 73 20 73 65 6c 65 63  74 73 20 74 68 65 20 72  |is selects the r|
00000750  65 6c 65 76 61 6e 74 20  73 75 62 73 65 74 20 66  |elevant subset f|
00000760  72 6f 6d 20 74 68 65 20  22 41 41 42 42 41 42 41  |rom the "AABBABA|
00000770  2e 2e 2e 22 20 70 61 74  74 65 72 6e 20 62 61 73  |..." pattern bas|
00000780  65 64 20 6f 6e 20 74 68  65 20 6b 65 79 20 70 72  |ed on the key pr|
00000790  65 73 73 65 64 20 61 62  6f 76 65 0d 02 f8 1a 62  |essed above....b|
000007a0  79 74 65 24 3d c1 62 61  72 24 2c 6f 66 66 73 65  |yte$=.bar$,offse|
000007b0  74 25 2c 37 29 0d 03 02  12 f1 62 79 74 65 24 3b  |t%,7).....byte$;|
000007c0  22 20 3d 3e 20 22 3b 0d  03 0c 1a f2 64 65 63 6f  |" => ";.....deco|
000007d0  64 65 28 62 79 74 65 24  2c 73 75 62 73 65 74 24  |de(byte$,subset$|
000007e0  29 0d 03 16 05 ed 0d 03  20 05 3a 0d 03 2a 14 f4  |)....... .:..*..|
000007f0  20 54 65 73 74 20 67 75  61 72 64 20 62 69 74 0d  | Test guard bit.|
00000800  03 34 1a f1 27 22 5b 22  3b c1 62 61 72 24 2c 34  |.4..'"[";.bar$,4|
00000810  33 2c 35 29 3b 22 5d 22  27 0d 03 3e 32 e7 c1 62  |3,5);"]"'..>2..b|
00000820  61 72 24 2c 34 33 2c 35  29 3c 3e 22 30 31 30 31  |ar$,43,5)<>"0101|
00000830  30 22 20 8c f1 22 42 61  64 20 67 75 61 72 64 20  |0" .."Bad guard |
00000840  62 69 74 73 22 3a e5 8d  74 58 43 0d 03 48 05 3a  |bits":..tXC..H.:|
00000850  0d 03 52 1e f4 20 4c 69  73 74 20 6c 61 73 74 20  |..R.. List last |
00000860  36 20 62 69 74 20 70 61  74 74 65 72 6e 73 0d 03  |6 bit patterns..|
00000870  5c 14 e3 6f 66 66 73 65  74 25 3d 34 38 b8 38 33  |\..offset%=48.83|
00000880  88 37 0d 03 66 1a 62 79  74 65 24 3d c1 62 61 72  |.7..f.byte$=.bar|
00000890  24 2c 6f 66 66 73 65 74  25 2c 37 29 0d 03 70 1f  |$,offset%,7)..p.|
000008a0  f1 62 79 74 65 24 3b 22  20 3d 3e 20 22 3b 3a f4  |.byte$;" => ";:.|
000008b0  20 41 6c 6c 27 72 65 20  22 43 22 0d 03 7a 16 f2  | All're "C"..z..|
000008c0  64 65 63 6f 64 65 28 62  79 74 65 24 2c 22 43 22  |decode(byte$,"C"|
000008d0  29 0d 03 84 05 ed 0d 03  8e 05 3a 0d 03 98 0a 6b  |).........:....k|
000008e0  65 79 25 3d a5 0d 03 a2  07 fd 30 20 0d 03 ac 05  |ey%=......0 ....|
000008f0  3a 0d 03 b6 18 dd a4 74  6f 64 65 63 69 6d 61 6c  |:......todecimal|
00000900  28 62 69 6e 61 72 79 24  29 0d 03 c0 12 ea 20 72  |(binary$)..... r|
00000910  65 73 75 6c 74 25 2c 62  69 74 25 0d 03 ca 10 e3  |esult%,bit%.....|
00000920  62 69 74 25 3d 36 b8 30  88 2d 31 0d 03 d4 37 e7  |bit%=6.0.-1...7.|
00000930  c1 62 69 6e 61 72 79 24  2c 36 2d 62 69 74 25 2b  |.binary$,6-bit%+|
00000940  31 2c 31 29 3d 22 31 22  20 8c 72 65 73 75 6c 74  |1,1)="1" .result|
00000950  25 3d 72 65 73 75 6c 74  25 2b 28 32 5e 62 69 74  |%=result%+(2^bit|
00000960  25 29 0d 03 de 05 ed 0d  03 e8 0c 3d 72 65 73 75  |%).........=resu|
00000970  6c 74 25 0d 03 f2 05 3a  0d 03 fc 1b dd f2 64 65  |lt%....:......de|
00000980  63 6f 64 65 28 76 61 6c  75 65 24 2c 74 61 62 6c  |code(value$,tabl|
00000990  65 24 29 0d 04 06 1b ea  20 6c 6f 6f 6b 75 70 25  |e$)..... lookup%|
000009a0  2c 76 61 6c 75 65 25 2c  74 61 62 6c 65 25 0d 04  |,value%,table%..|
000009b0  10 1d 76 61 6c 75 65 25  3d a4 74 6f 64 65 63 69  |..value%=.todeci|
000009c0  6d 61 6c 28 76 61 6c 75  65 24 29 0d 04 1a 71 74  |mal(value$)...qt|
000009d0  61 62 6c 65 24 3d 22 73  65 74 22 2b 74 61 62 6c  |able$="set"+tabl|
000009e0  65 24 2b 22 25 28 22 3a  f4 20 43 68 6f 6f 73 65  |e$+"%(":. Choose|
000009f0  20 74 68 65 20 61 72 72  61 79 20 6e 61 6d 65 20  | the array name |
00000a00  64 75 72 69 6e 67 20 72  75 6e 20 74 69 6d 65 2c  |during run time,|
00000a10  74 68 65 20 69 6e 64 69  76 69 64 75 61 6c 20 61  |the individual a|
00000a20  72 72 61 79 20 65 6c 65  6d 65 6e 74 20 69 73 20  |rray element is |
00000a30  63 68 6f 73 65 6e 20 62  65 6c 6f 77 0d 04 24 05  |chosen below..$.|
00000a40  f5 0d 04 2e 1c 61 72 72  61 79 24 3d 74 61 62 6c  |.....array$=tabl|
00000a50  65 24 2b 22 6c 6f 6f 6b  75 70 25 29 22 0d 04 38  |e$+"lookup%)"..8|
00000a60  2b e7 a0 28 61 72 72 61  79 24 29 3d 76 61 6c 75  |+..(array$)=valu|
00000a70  65 25 20 8c f1 3b 6c 6f  6f 6b 75 70 25 3a 6c 6f  |e% ..;lookup%:lo|
00000a80  6f 6b 75 70 25 3d 2d 32  0d 04 42 15 6c 6f 6f 6b  |okup%=-2..B.look|
00000a90  75 70 25 3d 6c 6f 6f 6b  75 70 25 2b 31 0d 04 4c  |up%=lookup%+1..L|
00000aa0  19 fd 6c 6f 6f 6b 75 70  25 3c 30 20 84 6c 6f 6f  |..lookup%<0 .loo|
00000ab0  6b 75 70 25 3e 39 0d 04  56 20 e7 6c 6f 6f 6b 75  |kup%>9..V .looku|
00000ac0  70 25 3e 39 20 8c f1 22  4e 6f 74 20 64 65 63 6f  |p%>9 .."Not deco|
00000ad0  64 61 62 6c 65 22 0d 04  60 05 e1 0d 04 6a 05 3a  |dable"..`....j.:|
00000ae0  0d 04 74 20 f4 20 44 61  74 61 20 74 6f 20 62 65  |..t . Data to be|
00000af0  20 72 65 61 64 20 69 6e  20 43 4f 4c 55 4d 4e 73  | read in COLUMNs|
00000b00  0d 04 7e 1a f4 20 20 41  20 20 20 42 20 20 20 43  |..~..  A   B   C|
00000b10  20 20 20 20 6f 72 64 65  72 20 0d 04 88 1a dc 20  |    order ..... |
00000b20  30 31 33 2c 30 33 39 2c  31 31 34 2c 22 41 41 41  |013,039,114,"AAA|
00000b30  41 41 41 22 0d 04 92 1a  dc 20 30 32 35 2c 30 35  |AAA"..... 025,05|
00000b40  31 2c 31 30 32 2c 22 41  41 42 41 42 42 22 0d 04  |1,102,"AABABB"..|
00000b50  9c 1a dc 20 30 31 39 2c  30 32 37 2c 31 30 38 2c  |... 019,027,108,|
00000b60  22 41 41 42 42 41 42 22  0d 04 a6 1a dc 20 30 36  |"AABBAB"..... 06|
00000b70  31 2c 30 33 33 2c 30 36  36 2c 22 41 41 42 42 42  |1,033,066,"AABBB|
00000b80  41 22 0d 04 b0 1a dc 20  30 33 35 2c 30 32 39 2c  |A"..... 035,029,|
00000b90  30 39 32 2c 22 41 42 41  41 42 42 22 0d 04 ba 1a  |092,"ABAABB"....|
00000ba0  dc 20 30 35 31 2c 30 35  37 2c 30 37 38 2c 22 41  |. 051,057,078,"A|
00000bb0  42 42 41 41 42 22 0d 04  c4 1a dc 20 30 34 37 2c  |BBAAB"..... 047,|
00000bc0  30 30 35 2c 30 38 30 2c  22 41 42 42 42 41 41 22  |005,080,"ABBBAA"|
00000bd0  0d 04 ce 1a dc 20 30 35  39 2c 30 31 37 2c 30 36  |..... 059,017,06|
00000be0  38 2c 22 41 42 41 42 41  42 22 0d 04 d8 1a dc 20  |8,"ABABAB"..... |
00000bf0  30 35 35 2c 30 30 39 2c  30 37 32 2c 22 41 42 41  |055,009,072,"ABA|
00000c00  42 42 41 22 0d 04 e2 1a  dc 20 30 31 31 2c 30 32  |BBA"..... 011,02|
00000c10  33 2c 31 31 36 2c 22 41  42 42 41 42 41 22 0d ff  |3,116,"ABBABA"..|
00000c20
F/CODE13.m0
F/CODE13.m1
F/CODE13.m2
F/CODE13.m4
F/CODE13.m5