# File lib/native_file_types/apple2/NADOLFile.rb, line 150
  def to_listing
  s=""
  index=0
  while (index<contents.length)
    line_length=contents[index]
    index+=1
    end_of_line=index+line_length-2
    while(index<end_of_line)
      b=contents[index]
      if (b<=0x64) then
        s+=NADOL_EDITOR_TOKENS[b]
      elsif(b>0x70 and b<0x80) then
        s+=" "*(b-0x70)
      elsif(b>=0x80) then
        s+=(b-0x80).chr
      else
        raise sprintf("unknown token %02X at offset %04X",b,index)
      end
      index+=1 #move to next char
    end
    index+=1 #skip over end-of-line marker
    s+="\n"
  end
  s

  end