10 ! DECODE BOOSTRAP AS 16 BITS
11 DIM A$[8],B$[6],C$[132]V,X(16),XX$[132]V
12 DIM DE(16) : ! DECODING BITS FOR BOOTSTRAP BIT VERSUS ROM BIT
13 DE(16)=3 : DE(15)=2 : DE(14)=1 : DE(13)=8 : DE(12)=7 : DE(11)=6
14 DE(10)=5 : DE(9)=4 : DE(8)=11 : DE(7)=10 : DE(6)=9 : DE(5)=0
15 DE(4)=15 : DE(3)=14 : DE(2)=13 : DE(1)=12
16 ! DE(N)=X MEANS ROM BIT N = DATA BIT X
20 OPEN #3, "BOOTDPALT.DAT/RO/LN:132"
25 IF END #3 THEN 200
30 OPEN #4,"BOOTDPALT.OUT/WR/LN:132"
40 INPUT LINE #3, XX$ : ZZ=ZZ+1
41 IF LEN(XX$)>5 THEN 45
42 PRINT #4, XX$
43 GOTO 40
45 A$=SBS$(XX$,1,8) : B$=SBS$(XX$,9,6) : C$=SBS$(XX$,15)
46 AD=OCT(SBS$(A$,5,3))
47 IF AD<128 GOTO 49
48 AD=AD-128 : GOTO 47
49 AD=AD*2
50 B=OCT(B$)
51 FOR I=1 TO 16
52 X(I)=B-INT(B/2)*2
54 IF I=11 THEN  LET X(I)=1-X(I)	: ! INVERT DATA BITS 10 THRU 12
55 IF I=12 THEN  LET X(I)=1-X(I)	: ! (11-13 COUNTING FROM 1 INSTEAD OF 0)
56 IF I=13 THEN  LET X(I)=1-X(I)
57 B=INT(B/2)
58 NEXT I
60 FOR XX=1 TO 4
61 PRINT #4, OCT$(AD+XX-1);"	";
65 FOR I=1 TO 4 : PRINT #4, FRMT$(X(DE(21-XX*4-I)+1),1);" "; : NEXT I
70 IF XX=4 THEN  PRINT #4,C$;
71 PRINT #4
72 NEXT XX
80 GOTO 40
200 CLOSE 
204 PRINT XX$
