%!PS-Adobe-2.0
%%Title: Blue Book Program 17, on page 207
%%Creator: Adobe Systems Incorporated 
%%CreationDate: Fri Dec 29 12:58:53 PST 1989
%%EndComments

/reencodedict 5 dict def
/ReEncode
  { reencodedict begin
	/newencoding exch def
	/newfontname exch def
	/basefontname exch def

	/basefontdict basefontname findfont def
	
	/newfont basefontdict maxlength dict def
	basefontdict
	  { exch dup /FID ne dup /Encoding ne and
		  { exch newfont 3 1 roll put }
		  { pop pop }
		  ifelse
	  } forall
	newfont /FontName newfontname put
	newfont /Encoding newencoding put
	newfontname newfont definefont pop
	end
  } def

/EBCDIC 256 array def
0 1 255 { EBCDIC exch /.notdef put } for
EBCDIC
dup 8#100 /space put
dup 8#112 /cent put
dup 8#113 /period put
dup 8#114 /less put
dup 8#115 /parenleft put
dup 8#116 /plus put
dup 8#117 /bar put
dup 8#120 /ampersand put

dup 8#132 /exclam put
dup 8#133 /dollar put
dup 8#134 /asterisk put
dup 8#135 /parenright put
dup 8#136 /semicolon put
dup 8#137 /asciitilde put
dup 8#140 /hyphen put
dup 8#141 /slash put

dup 8#153 /comma put
dup 8#154 /percent put
dup 8#155 /underscore put
dup 8#156 /greater put
dup 8#157 /question put

dup 8#172 /colon put
dup 8#173 /numbersign put
dup 8#174 /at put
dup 8#175 /quoteright put
dup 8#176 /equal put
dup 8#177 /quotedbl put

dup 8#201 /a put    dup 8#206 /f put
dup 8#202 /b put    dup 8#207 /g put
dup 8#203 /c put    dup 8#210 /h put
dup 8#204 /d put    dup 8#211 /i put
dup 8#205 /e put

dup 8#221 /j put    dup 8#226 /o put
dup 8#222 /k put    dup 8#227 /p put
dup 8#223 /l put    dup 8#230 /q put
dup 8#224 /m put    dup 8#231 /r put
dup 8#225 /n put

dup 8#242 /s put    dup 8#246 /w put
dup 8#243 /t put    dup 8#247 /x put
dup 8#244 /u put    dup 8#250 /y put
dup 8#245 /v put    dup 8#251 /z put

dup 8#301 /A put    dup 8#306 /F put
dup 8#302 /B put    dup 8#307 /G put
dup 8#303 /C put    dup 8#310 /H put
dup 8#304 /D put    dup 8#311 /I put
dup 8#305 /E put

dup 8#321 /J put    dup 8#326 /O put
dup 8#322 /K put    dup 8#327 /P put
dup 8#323 /L put    dup 8#330 /Q put
dup 8#324 /M put    dup 8#331 /R put
dup 8#325 /N put

dup 8#342 /S put    dup 8#346 /W put
dup 8#343 /T put    dup 8#347 /X put
dup 8#344 /U put    dup 8#350 /Y put
dup 8#345 /V put    dup 8#351 /Z put

dup 8#360 /zero put   dup 8#365 /five put
dup 8#361 /one put    dup 8#366 /six put
dup 8#362 /two put    dup 8#367 /seven put
dup 8#363 /three put  dup 8#370 /eight put
dup 8#364 /four put   dup 8#371 /nine put
pop

/TR /Times-Roman findfont 10 scalefont def
/Times-Roman /Times-Roman-EBCDIC EBCDIC
  ReEncode
/TRE /Times-Roman-EBCDIC findfont 10 scalefont 
  def
  
TR setfont
0 1 3
  { /counter exch def
	40 counter 133 mul add 720 moveto
	(  Octal     Standard   EBCDIC) show
	40 counter 133 mul add 720 10 sub moveto
	(Number       Char        Char) show
  } for

/showstring 1 string def
/counterstring 3 string def
  
/yline 690 def
/xstart 52 def
0 1 255
  { /counter exch def
    /charstring showstring dup 0 counter put def
    TR setfont  xstart yline moveto
    counter 8 counterstring cvrs show
    xstart 42 add yline moveto
    charstring show
    TRE setfont  xstart 86 add yline moveto
    charstring show
    /yline yline 10 sub def
    counter 1 add 64 mod 0 eq
      { /xstart xstart 133 add def
        /yline 690 def
      } if
  } for
  
showpage
% But what does it do?