1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
openb 1,"readbinary_test.data"
for t = 0 to 255
writebyte 1,t
next t
close 1
openb 1,"readbinary_test.data"
n = 0
s$ = ""
while not eof(1)
c = readbyte(1)
if n%8 = 0 then
print " " + s$
s$ = ""
print hex$(n\256) + hex$(n%256) + " ";
end if
print hex$(c) + " ";
if c < 32 or c > 127 then
s$ = s$ + "."
else
s$ = s$ + chr(c)
end if
n = n + 1
end while
print " " + s$
close 1
end
function hex$(n)
x$ = "0123456789abcdef"
hex$=mid(x$,n\16+1,1)+mid(x$,n%16+1,1)
end function
|