program asciicode(ascii, code, output); (* asciicode: converts ascii table to Pascal code Tom Schneider NCI/FCRDC Bldg 469. Room 144 P.O. Box B Frederick, MD 21702-1201 (301) 846-5581 (-5532 for messages) network address: toms@ncifcrf.gov National Cancer Institute Laboratory of Mathematical Biology 1993 *) label 1; (* end of program *) const (* begin module version *) version = 1.01; (* of asciicode.p 1993 January 26 origin 1993 Jan 8 *) (* end module version *) (* begin module describe.asciicode *) (* name asciicode: converts ascii table to Pascal code synopsis asciicode(ascii: in, code: out, output: out) files ascii: The ascii file must contain this table: | 0 NUL| 1 SOH| 2 STX| 3 ETX| 4 EOT| 5 ENQ| 6 ACK| 7 BEL | 8 BS | 9 HT | 10 NL | 11 VT | 12 NP | 13 CR | 14 SO | 15 SI | 16 DLE| 17 DC1| 18 DC2| 19 DC3| 20 DC4| 21 NAK| 22 SYN| 23 ETB | 24 CAN| 25 EM | 26 SUB| 27 ESC| 28 FS | 29 GS | 30 RS | 31 US | 32 SP | 33 ! | 34 " | 35 # | 36 $ | 37 % | 38 & | 39 ' | 40 ( | 41 ) | 42 * | 43 + | 44 , | 45 - | 46 . | 47 / | 48 0 | 49 1 | 50 2 | 51 3 | 52 4 | 53 5 | 54 6 | 55 7 | 56 8 | 57 9 | 58 : | 59 ; | 60 < | 61 = | 62 > | 63 ? | 64 @ | 65 A | 66 B | 67 C | 68 D | 69 E | 70 F | 71 G | 72 H | 73 I | 74 J | 75 K | 76 L | 77 M | 78 N | 79 O | 80 P | 81 Q | 82 R | 83 S | 84 T | 85 U | 86 V | 87 W | 88 X | 89 Y | 90 Z | 91 [ | 92 \ | 93 ] | 94 ^ | 95 _ | 96 ` | 97 a | 98 b | 99 c |100 d |101 e |102 f |103 g |104 h |105 i |106 j |107 k |108 l |109 m |110 n |111 o |112 p |113 q |114 r |115 s |116 t |117 u |118 v |119 w |120 x |121 y |122 z |123 { |124 | |125 } |126 ~ |127 DEL code: Pascal code that converts integers to these names. output: messages to the user description This program generates a chunk of Pascal code that is useful for detailed investigation of file characters. examples documentation see also lochas.p author Thomas Dana Schneider bugs technical notes *) (* end module describe.asciicode *) var ascii, code: text; (* a file used by this program *) (* begin module halt *) procedure halt; (* stop the program. the procedure performs a goto to the end of the program. you must have a label: label 1; declared, and also the end of the program must have this label: 1: end. examples are in the module libraries. this is the only goto in the delila system. *) begin writeln(output,' program halt.'); goto 1 end; (* end module halt version = 'delmod 6.16 84 mar 12 tds/gds'; *) (* begin module asciicode.word *) procedure word(var ascii,code: text; var count: integer); (* do one word of the table *) var n: integer; (* number of the character *) x,a,b,c: char; (* a space and the three letter name of the character *) begin read(ascii,x,n,x,a,b,c); if count <> n then writeln(output,count,'<>',n); write(code,' ',n:3,': write(f,''',a); (* single quote! *) if b = '''' then write(code,'''''') (* double quote! *) else write(code,b); writeln(code,c,''');'); (* single quote! *) count := succ(count); end; (* end module asciicode.word *) (* begin module asciicode.line *) procedure line(var ascii, code: text; var count: integer); (* do one line of the table *) var x: integer; (* index to the words *) begin for x := 1 to 8 do word(ascii,code,count); readln(ascii) end; (* end module asciicode.line *) (* begin module asciicode.themain *) procedure themain(var ascii,code: text); (* the main procedure of the program *) var count: integer; (* count of the characters done *) y: integer; (* index for the lines to produce *) begin writeln(output,'asciicode ',version:4:2); reset(ascii); rewrite(code); count := 0; for y := 1 to 16 do line(ascii,code,count); end; (* end module asciicode.themain *) begin themain(ascii,code); 1: end.