<<戻る

2004年08月28日

ACSII Character set (ASCII 7bitコード表)

[s-okita@stoc c]$ cat hexadecimal.c
#include 

char *control_code3[32] = {
                "NUL", /* NULl */
                "SOH", /* Start Of Heading */
                "STX", /* Start of TeXt */
                "ETX", /* End of TeXt */
                "EOT", /* End Of Transmission */
                "ENQ", /* ENQuery */
                "ACK", /* ACKnowledge */
                "BEL", /* BELl */
                "BS" , /* BackSpace */
                "HT" , /* Horizonal Tab */
                "LF" , /* LineFeed */
                "VT" , /* Vertical Tab */
                "FF" , /* Form Feed */
                "CR" , /* Carrage Return */
                "SO" , /* Shift Out */
                "SI" , /* Shift In */
                "DLE", /* Data Link Escape */
                "DC1", /* Device Control 1 */
                "DC2", /* Device Control 2 */
                "DC3", /* Device Control 3 */
                "DC4", /* Device Control 4 */
                "NAK", /* Negative AKnowledge */
                "SYN", /* SYNchronous file */
                "ETB", /* End of Transmission Block */
                "CAN", /* CANcel */
                "EM" , /* End of Medium */
                "SUB", /* SUBstitue character */
                "ESC", /* ESCape */
                "FS" , /* File Separator */
                "GS" , /* Group Separator */
                "RS" , /* Record Separator */
                "US" , /* Unit Separator */
};

int main(int argc, char *argv[])
{
                int i;
                for ( i = 0x00; i < 0x80; i += 0x01 )
                {
                                if ( i >= 0x00 && i <= 0x1f )
                                                printf("%2x %-7s",i, control_code3[i]);
                                else if ( i == 0x7f )
                                                printf("%x %-7s",i, "DEL");
                                else
                                                printf("%x %-7c",i, i);
                }

                return 0;
}
[s-okita@stoc c]$ ./a.out
 0 NUL     1 SOH     2 STX     3 ETX     4 EOT     5 ENQ     6 ACK     7 BEL    
 8 BS      9 HT      a LF      b VT      c FF      d CR      e SO      f SI     
10 DLE    11 DC1    12 DC2    13 DC3    14 DC4    15 NAK    16 SYN    17 ETB    
18 CAN    19 EM     1a SUB    1b ESC    1c FS     1d GS     1e RS     1f US     
20        21 !      22 "      23 #      24 $      25 %      26 &      27 '      
28 (      29 )      2a *      2b +      2c ,      2d -      2e .      2f /      
30 0      31 1      32 2      33 3      34 4      35 5      36 6      37 7      
38 8      39 9      3a :      3b ;      3c <      3d =      3e >      3f ?      
40 @      41 A      42 B      43 C      44 D      45 E      46 F      47 G      
48 H      49 I      4a J      4b K      4c L      4d M      4e N      4f O      
50 P      51 Q      52 R      53 S      54 T      55 U      56 V      57 W      
58 X      59 Y      5a Z      5b [      5c \      5d ]      5e ^      5f _      
60 `      61 a      62 b      63 c      64 d      65 e      66 f      67 g      
68 h      69 i      6a j      6b k      6c l      6d m      6e n      6f o      
70 p      71 q      72 r      73 s      74 t      75 u      76 v      77 w      
78 x      79 y      7a z      7b {      7c |      7d }      7e ~      7f DEL