From f8a61f15e3b490e3d0f162a81431fd40f0c06441 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Tue, 12 Dec 2023 18:58:45 +0000 Subject: [PATCH] init --- README | 7 ++++ ascii.c | 21 +++++++++++ build.sh | 5 +++ raw | Bin 0 -> 5118 bytes table | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 161 insertions(+) create mode 100644 README create mode 100644 ascii.c create mode 100755 build.sh create mode 100644 raw create mode 100644 table diff --git a/README b/README new file mode 100644 index 0000000..7c65e0a --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +It just dumps ascii data to stdout. +Files are already included in the git. + +Building is simple, + sh ./build.sh; + +Public Domain. diff --git a/ascii.c b/ascii.c new file mode 100644 index 0000000..a551811 --- /dev/null +++ b/ascii.c @@ -0,0 +1,21 @@ +/* ascii.c - The ASCII Table */ +#include +#include + +int main(void) +{ + unsigned int c; + const char codes[32][4] = + { "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "TAB", "LF", + "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", + "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" }; + puts(" DEC HEX OCT"); + for (c = 0; c < 127; ++c) { + if (c == 127) + { printf( "DEL %4u %4x %4o\n", c, c, c); } + else if (c > 31) + { printf("'%c' %4u %4x %4o\n", (char16_t) c, c, c, c); } + else + { printf( "%3s %4u %4x %4o\n", codes[c], c, c, c); } + } +} diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..9434eef --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh +OPTION=-O2 -Wall -Wextra -Wpedantic -s +cc $OPTION -o ascii ascii.c && ./ascii > table +cc $OPTION -DRAW -o ascii ascii.c && ./ascii > raw +rm -f ascii diff --git a/raw b/raw new file mode 100644 index 0000000000000000000000000000000000000000..a668f38e3255347eb7b25e59150742cdcf43a9e4 G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fWSW!(+^T^zSq?JjU!t|GsF3 z$C&---|1#}jM_`93Hj@YY(Z6%dHfcud%j{#{^($Atap-#b$U+*pL2w%?ytT`_aFzo5_Ry=-(w~@?byucd3~? z*pL2QW+o5zqkor+>GyoXe)R7OGkLHd{kzf(k7?{z=-)TY@R-KKh5lV-hQ~A>F7)qe zGd!m8aG`(KnBg&vhYS6?)(nqnJY4ACH_h;v#>0jFU1x^JG#)PW?|N8N85R#0`gemF z9@BWZ(7zkaa)QBlauw?`AW3#D0bTeaB25v0tHo z-!;Qy#(wngduDjd*pL2wUrfK}Gxno@x0vBEV?X+Ls~H|M_M?A4FvDZUe)R7)GdyPO zNB@3khR2Nk=--db@R+e5{rj;Q9y9i%e?Kvk2m8^#pPI>o{pjD%#PoYUV?X+LyO})L zkN(|ZCJ*+be?K>q2m8^#Uzp)BXFvLPrx_k|_M?BlG{a-ge)R8GW_ZlmkN*AI439bc z(Z9RQ@R+k7{rioWe$VIZNB@3nhR2-!=-=Lcr4hD{{7Poj|KbDzkiwGv0y*?_ir;i7VJm=?lr?>!G84bKW2C= s*pL4GS4_X>3-+Ub|1*;Z`_aGuo5_Ry=-+*2@?byucfXlD*f09`0E%Z?h5!Hn literal 0 HcmV?d00001 diff --git a/table b/table new file mode 100644 index 0000000..6c8b4e4 --- /dev/null +++ b/table @@ -0,0 +1,128 @@ + DEC HEX OCT +NUL 0 0 0 +SOH 1 1 1 +STX 2 2 2 +ETX 3 3 3 +EOT 4 4 4 +ENQ 5 5 5 +ACK 6 6 6 +BEL 7 7 7 + BS 8 8 10 +TAB 9 9 11 + LF 10 a 12 + VT 11 b 13 + FF 12 c 14 + CR 13 d 15 + SO 14 e 16 + SI 15 f 17 +DLE 16 10 20 +DC1 17 11 21 +DC2 18 12 22 +DC3 19 13 23 +DC4 20 14 24 +NAK 21 15 25 +SYN 22 16 26 +ETB 23 17 27 +CAN 24 18 30 + EM 25 19 31 +SUB 26 1a 32 +ESC 27 1b 33 + FS 28 1c 34 + GS 29 1d 35 + RS 30 1e 36 + US 31 1f 37 +' ' 32 20 40 +'!' 33 21 41 +'"' 34 22 42 +'#' 35 23 43 +'$' 36 24 44 +'%' 37 25 45 +'&' 38 26 46 +''' 39 27 47 +'(' 40 28 50 +')' 41 29 51 +'*' 42 2a 52 +'+' 43 2b 53 +',' 44 2c 54 +'-' 45 2d 55 +'.' 46 2e 56 +'/' 47 2f 57 +'0' 48 30 60 +'1' 49 31 61 +'2' 50 32 62 +'3' 51 33 63 +'4' 52 34 64 +'5' 53 35 65 +'6' 54 36 66 +'7' 55 37 67 +'8' 56 38 70 +'9' 57 39 71 +':' 58 3a 72 +';' 59 3b 73 +'<' 60 3c 74 +'=' 61 3d 75 +'>' 62 3e 76 +'?' 63 3f 77 +'@' 64 40 100 +'A' 65 41 101 +'B' 66 42 102 +'C' 67 43 103 +'D' 68 44 104 +'E' 69 45 105 +'F' 70 46 106 +'G' 71 47 107 +'H' 72 48 110 +'I' 73 49 111 +'J' 74 4a 112 +'K' 75 4b 113 +'L' 76 4c 114 +'M' 77 4d 115 +'N' 78 4e 116 +'O' 79 4f 117 +'P' 80 50 120 +'Q' 81 51 121 +'R' 82 52 122 +'S' 83 53 123 +'T' 84 54 124 +'U' 85 55 125 +'V' 86 56 126 +'W' 87 57 127 +'X' 88 58 130 +'Y' 89 59 131 +'Z' 90 5a 132 +'[' 91 5b 133 +'\' 92 5c 134 +']' 93 5d 135 +'^' 94 5e 136 +'_' 95 5f 137 +'`' 96 60 140 +'a' 97 61 141 +'b' 98 62 142 +'c' 99 63 143 +'d' 100 64 144 +'e' 101 65 145 +'f' 102 66 146 +'g' 103 67 147 +'h' 104 68 150 +'i' 105 69 151 +'j' 106 6a 152 +'k' 107 6b 153 +'l' 108 6c 154 +'m' 109 6d 155 +'n' 110 6e 156 +'o' 111 6f 157 +'p' 112 70 160 +'q' 113 71 161 +'r' 114 72 162 +'s' 115 73 163 +'t' 116 74 164 +'u' 117 75 165 +'v' 118 76 166 +'w' 119 77 167 +'x' 120 78 170 +'y' 121 79 171 +'z' 122 7a 172 +'{' 123 7b 173 +'|' 124 7c 174 +'}' 125 7d 175 +'~' 126 7e 176