home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
packet
/
bsq
/
bsqboot.bas
< prev
next >
Wrap
BASIC Source File
|
1986-02-03
|
707b
|
20 lines
10 PRINT "BSQ Bootstrap: reads BSQ.BSQ, writes BSQ.COM - W1GOH 1/86
100 OPEN "bsq.bsq" FOR INPUT AS #1
110 OPEN "bsq.com" FOR OUTPUT AS #2
200 A%=0:B%=0:C%=0:D%=0:INPUT #1,L$:PRINT L$
400 IF EOF(1) THEN 4900
410 C%=ASC(INPUT$(1,#1)) AND 127
420 IF (C%<33) THEN 400
430 IF (C%>96) THEN 3000
440 GOSUB 1000 : GOTO 400
1000 C%=C%-33:A%=A%*64+C%:B%=B%+6
1010 IF B%<8 THEN RETURN
1011 IF B%=8 THEN B%=0:C%=A%:A%=0:GOTO 2000
1012 IF B%=10 THEN C%=INT(A%/4):A%=A% MOD 4:B%=2:GOTO 2000
1013 IF B%=12 THEN C%=INT(A%/16):A%=A% MOD 16:B%=4:GOTO 2000
2000 PRINT #2,CHR$(C% MOD 256);:D%=D%+1:GOTO 1010
3000 PRINT "Unrecognized BSQ code.. can't translate!":STOP
4900 CLOSE #2
4910 CLOSE #1
4999 END