hex$() -- convert a number into hexadecimal
The hex$-function converts a number into a string with its hexadecimal representation. hex$ is the inverse of the dec-function.
print right$("0"+hex$(peek(1)),2)," "
if (mod(i,10)=0) print
This program reads the file foo and prints its output as a hex-dump using the hex-function.