open "Mz700fon.txt" for input as #1
open "mz700fon.dat" for output as #2
for j=0 to 511
file input #1, tx$
for k= 0 to 7
file input #1, tx$
if left$(tx$,1)="." or left$(tx$,1)="o" then
ctr=0
for i=0 to 7
if mid$(tx$,8-i,1)<>"." then
ctr+=(2^i)
end if
next
writebyte(2,ctr)
end if
next
file input #1, tx$
next
close #1:close #2