Выбрать главу

370 IF C$ = "00001" THEN PRINT "0";

380 IF C$ = "10000" THEN PRINT "1";

390 IF С$ = "01000" THEN PRINT "2";

400 IF C$ = "11001" THEN PRINT "3";

410 IF C$ = "00100" THEN PRINT "4";

420 IF C$ = "10101" THEN PRINT "5";

430 IF C$ = "01101" THEN PRINT "6";

440 IF C$ = "11100" THEN PRINT -7";

450 IF C$ = "00010" THEN PRINT "8";

460 IF C$ = "10011" THEN PRINT "9";

470 RETURN

480 REM (с) 1996 Patrick GUEULLE

ДЕКОДИРОВАНИЕ СЕМИБИТНЫХ СИМВОЛОВ

Программа DEC7.BAS выполняет функцию, аналогичную выполняемой программой DEC5, но с алфавитно-цифровыми файлами, символы которых закодированы семью битами.

10 REM — DEC7.BAS —

20 KEY OFF: CLS

30 PRINT "Имя декодируемого файла?";

40 INPUT N$: IF N$="" THEN END

50 FOR F=1 TO LEN(N$)

60 IF MID$ (N$,F,1) = "." THEN 90

70 NEXT F

80 N$=N$+".CAR"

90 OPEN N$ FOR INPUT AS #1

100 L=INT(LOF(1)/2)-1

110 DIM T (LOF (1))

120 F=1: WHILE NOT EOF(1)

130 INPUT#1,T(F): F=F+1

140 WEND

150 J=1

160 IF T(J)<>1 THEN 240

170 IF T(J+1)<>0 THEN 240

180 IF T(J+2)<>1 THEN 240

190 IF T(J+3)<>0 THEN 240

200 IF T(J+4)<>0 THEN 240

210 IF T(J+5)<>0 THEN 240

220 IF T(J+6)<>1 THEN 240

230 K=J: GOTO 250

240 J=J+1: GOTO 160

250 C$=""

260 FOR F=0 TO 6

270 IF T(K+F)=0 THEN C$=C$+"0"

280 IF T(K+F)=1 THEN C$=C$+"1"

290 NEXT F

300 GOSUB 330

310 K=K+7: IF K>L-1 THEN END

320 GOTO 250

330 IF C$="1010001" THEN PRINT "{start}"

340 IF C$="0111110" THEN PRINT "{sep}"

350 IF C$="1111100" THEN PRINT "{end}"

360 IF C$="0000001" THEN PRINT " ";

370 IF C$="1000000" THEN PRINT "{1H}";

380 IF C$="0100000" THEN PRINT "{2H}";

390 IF C$="1100001" THEN PRINT "{3H}";

400 IF C$="0010000" THEN PRINT "{4H}";

410 IF C$="0110001" THEN PRINT "{6H}";

420 IF C$="1110000" THEN PRINT "{7H}";

430 IF C$="0001000" THEN PRINT "{8H}";

440 IF C$="1001001" THEN PRINT "{9H}";

450 IF C$="0101001" THEN PRINT "{AH}";

460 IF C$="1101000" THEN PRINT "{BH}";

470 IF C$="0011001" THEN PRINT "{CH}";

480 IF C$="1011000" THEN PRINT "{DH}";

490 IF C$="0111000" THEN PRINT "{EH}";

500 IF C$="1111001" THEN PRINT "{FH}";

510 IF C$="0000100" THEN PRINT "0";

520 IF C$="1000101" THEN PRINT "1";

530 IF C$="0100101" THEN PRINT "2";

540 IF C$="1100100" THEN PRINT "3";

550 IF C$="0010101" THEN PRINT "4";

560 IF C$="1010100" THEN PRINT "5";

570 IF C$="0110100" THEN PRINT "6";

580 IF C$="1110101" THEN PRINT "7";

590 IF C$="0001101" THEN PRINT "8";

600 IF C$="1001100" THEN PRINT "9";

610 IF C$="0101100“ THEN PRINT "{1AH}";

620 IF C$="1101101" THEN PRINT "{1BH}";

630 IF C$="0011100" THEN PRINT "{1CH}";

640 IF C$="1011101" THEN PRINT "{1DH}";

650 IF C$="0111101" THEN PRINT "{1EH}";

660 IF С$="1000011" THEN PRINT "A";

670 IF C$="0100011" THEN PRINT "В";

680 IF C$="1100010" THEN PRINT "C";

690 IF C$="0010011" THEN PRINT "D";

700 IF С$="1010010" THEN PRINT "E";

710 IF C$="0110010" THEN PRINT "F";

720 IF C$="1110011" THEN PRINT "G";

730 IF C$="0001011" THEN PRINT "H";

740 IF C$="1001010" THEN PRINT "I";

750 IF C$="0101010" THEN PRINT "J";

760 IF C$="1101011" THEN PRINT "K";

770 IF C$="0011010" THEN PRINT "L";

780 IF C$="1011011" THEN PRINT "M";

790 IF C$="0111011" THEN PRINT "N";

800 IF C$="1111010" THEN PRINT "O";

810 IF C$="0000111" THEN PRINT "P";

820 IF C$="1000110" THEN PRINT "Q";

830 IF C$="0100110" THEN PRINT "R";

840 IF C$="1100111" THEN PRINT "S";

850 IF C$="0010110" THEN PRINT "T";

860 IF C$="1010111" THEN PRINT "U";

870 IF C$="0110111" THEN PRINT "V";

880 IF C$="1110110" THEN PRINT "W";

890 IF C$="0001110' THEN PRINT "X";

900 IF C$="1001111" THEN PRINT "Y";

910 IF C$="0101111" THEN PRINT "Z";

920 IF C$="1101110'' THEN PRINT "{3BH}";

930 IF C$="0011111" THEN PRINT "{3DH}";

940 IF C$="1011110" THEN PRINT "{3EH}"

950 IF C$="1111111" THEN PRINT "{40H}";