Search This Blog

Disclosure

Everything Tech Review is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on Amazon.com. Amazon and the Amazon logo are trademarks of Amazon.com, Inc, or its affiliates.

Saturday, July 2, 2022

ASCII Table for programmers

Hello World Ascii Art


I am programming in my Computer Architecture course, and several times I had to look for the ASCII table to properly perform some conversions. For example, when converting a HEX String to Base 10 (Decimal) in integers, you will need to reference many characters such as '0' through '9', 'A' to 'F', and 'a' to 'f' too! 

Feel free to share the post with fellow programmers too ;) 

Note that MIPS doesn't traditionally use the Extended ascii table... 

If we want to convert the ascii value of a number, we can essentially subtract '0' from it (48). Then, check that it's <= 9 and >= 0 and you will be done for single digit positive numbers. It gets a tiny bit more complex for negative numbers, as '-' is in itself a character. In addition, with multi-digit numbers you will need to convert each character separately. 


    0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
0  NUL SOH STX ETX EOT ENQ ACK BEL BS  HT  LF  VT  FF  CR  SO  SI
1  DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM  SUB ESC FS  GS  RS  US
2   SP  !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /
3   0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
4   @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O
5   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _
6   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o
7   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~ DEL

or in a nicer/more expanded form:



Control Codes (0-31)

DecimalOctalHexadecimalCodeDescription
00000NULNull (\0)
10011SOHStart of Heading
20022STXStart of Text
30033ETXEnd of Text
40044EOTEnd Of Transmission
50055ENQEnquiry
60066ACKAcknowledge
70077BELBell (\a)
80108BSBackspace (\b)
90119HTHorizontal Tab (\t)
10012ALFNew Line Feed (\n)
11013BVTVertical Tab
12014CFFForm Feed (\f)
13015DCRCarriage Return (\r)
14016ESOShift Out
15017FSIShift In
1602010DLEData Link Escape
1702111DC1Device Control 1
1802212DC2Device Control 2
1902313DC3Device Control 3
2002414DC4Device Control 4
2102515NAKNegative Acknowledge
2202616SYNSynchronous Idle
2302717ETBEnd of Transmission Block
2403018CANCancel
2503119EMEnd of Medium
260321ASUBSubstitute
270331BESCEscape
280341CFSFile Separator
290351DGSGroup Separator
300361ERSRecord Separator
310371FUSUnit Separator

Standard ASCII Characters (32-127)

DecimalOctalHexadecimalCodeDescription
3204020Space
3304121!
3404222"
3504323#
3604424$
3704525%
3804626&
4005028(
4105129)
420522A*
430532B+
440542C,
450552D-
460562E.
470572F/
48060300
49061311
50062322
51063333
52064344
53065355
54066366
55067377
56070388
57071399
580723A:
590733B;
600743C<
610753D=
620763E>
630773F?
6410040@
6510141A
6610242B
6710343C
6810444D
6910545E
7010646F
7110747G
7211048H
7311149I
741124AJ
751134BK
761144CL
771154DM
781164EN
791174FO
8012050P
8112151Q
8212252R
8312353S
8412454T
8512555U
8612656V
8712757W
8813058X
8913159Y
901325AZ
911335B[
931355D]
941365E^
951375F_
9614060`
9714161a
9814262b
9914363c
10014464d
10114565e
10214666f
10314767g
10415068h
10515169i
1061526Aj
1071536Bk
1081546Cl
1091556Dm
1101566En
1111576Fo
11216070p
11316171q
11416272r
11516373s
11616474t
11716575u
11816676v
11916777w
12017078x
12117179y
1221727Az
1231737B{
1241747C|
1251757D}
1261767E~
1271777FDELDelete 


Anything > than 127 is considered "extended" ascii and not supported on some machines or environments.


Unfortunately, blogger doesn't do a good job at formatting html tables...
I am working on a more interactive table which will display better than the table below.

1's

 

16's

0

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

0

NUL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

HT

LF

VT

FF

CR

SO

SI

1

DLE

DC1

DC2

DC3

DC4

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

2

SP

!

"

#

$

%

&

'

(

)

*

+

,

-

.

/

3

0

1

2

3

4

5

6

7

8

9

:

;

< 

=

> 

?

4

@

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

5

P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_

6

`

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

7

p

q

r

s

t

u

v

w

x

y

z

{

|

}

~

DEL

 






No comments:

Post a Comment

Thank you for posting a comment, it will be reviewed and then posted shortly.