Show ASCII table: Difference between revisions

(Add 8080 assembly version)
 
(107 intermediate revisions by 55 users not shown)
Line 2:
 
;Task:
Show   [httphttps://kepkezeloupload.comwikimedia.org/imageswikipedia/anuscoqy8ejyr5bnhvnucommons/thumb/d/dd/ASCII-Table.jpgsvg/1261px-ASCII-Table.svg.png the ASCII character set]   from values   '''32'''   to   '''127'''   (decimal)   in a table format.
 
 
{{Template:Strings}}
<br><br>
 
=={{header|11l}}==
{{trans|Python}}
 
<syntaxhighlight lang="11l">L(i) 16
L(j) (32 + i .. 127).step(16)
String k
I j == 32
k = ‘Spc’
E I j == 127
k = ‘Del’
E
k = Char(code' j)
print(‘#3 : #<3’.format(j, k), end' ‘’)
print()</syntaxhighlight>
 
{{out}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|6502 Assembly}}==
<langsyntaxhighlight lang="asm">==========================================================================
; task : show ascii table
; language: 6502 Assembly
Line 126 ⟶ 163:
column .byte 0
ascii .byte 0
</syntaxhighlight>
</lang>
 
=={{header|8080 Assembly}}==
 
<langsyntaxhighlight lang="8080asm"> org 100h
mvi a,32 ; Start with space
mvi d,16 ; 16 lines
Line 197 ⟶ 234:
spc: db 'Spc ',0 ; Space
del: db 'Del ',0 ; Del
chr: db '* ',0 ; Placeholder for character</langsyntaxhighlight>
 
{{out}}
Line 221 ⟶ 258:
=={{header|8086 Assembly}}==
 
<langsyntaxhighlight lang="asm"> cpu 8086
bits 16
putch: equ 2h
Line 278 ⟶ 315:
spc: db 'Spc ',0 ; Space
del: db 'Del ',0 ; Del
chr: db '* ',0 ; Placeholder for character</langsyntaxhighlight>
 
{{out}}
Line 298 ⟶ 335:
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|Action!}}==
Atari 8-bit computers use [https://en.wikipedia.org/wiki/ATASCII ATASCII] character set which is a variation of ASCII.
<syntaxhighlight lang="action!">PROC Main()
BYTE
count=[96],rows=[16],
first=[32],last=[127],
i,j
 
Put(125) ;clear screen
FOR i=0 TO rows-1
DO
Position(2,3+i)
 
FOR j=first+i TO last STEP rows
DO
IF j>=96 AND j<=99 THEN
Put(' )
FI
PrintB(j)
Put(' )
 
IF j=32 THEN
Print("SP ")
ELSEIF j=125 THEN
Print("CL")
ELSEIF j=126 THEN
Print("DL")
ELSEIF j=127 THEN
Print("TB")
ELSE
PrintF("%C ",j)
FI
OD
PutE()
OD
RETURN</syntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Show_ASCII_table.png Screenshot from Atari 8-bit computer]
<pre>
32 SP 48 0 64 @ 80 P 96 ♦ 112 p
33 ! 49 1 65 A 81 Q 97 a 113 q
34 " 50 2 66 B 82 R 98 b 114 r
35 # 51 3 67 C 83 S 99 c 115 s
36 $ 52 4 68 D 84 T 100 d 116 t
37 % 53 5 69 E 85 U 101 e 117 u
38 & 54 6 70 F 86 V 102 f 118 v
39 ' 55 7 71 G 87 W 103 g 119 w
40 ( 56 8 72 H 88 X 104 h 120 x
41 ) 57 9 73 I 89 Y 105 i 121 y
42 * 58 : 74 J 90 Z 106 j 122 z
43 + 59 ; 75 K 91 [ 107 k 123 ♠
44 , 60 < 76 L 92 \ 108 l 124 |
45 - 61 = 77 M 93 ] 109 m 125 CL
46 . 62 > 78 N 94 ^ 110 n 126 DL
47 / 63 ? 79 O 95 _ 111 o 127 TB
</pre>
 
=={{header|Ada}}==
<langsyntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
 
Line 322 ⟶ 417:
New_Line;
end loop;
end Ascii_Table;</langsyntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 342 ⟶ 437:
 
=={{header|ALGOL 68}}==
<langsyntaxhighlight lang="algol68">BEGIN
# generate an ascii table for characters 32 - 127 #
FOR c FROM 32 TO 32 + 15 DO
INT char count := 1;
FOR cach FROM 32c BY 16 TO 127c + ( 16 * 5 ) DO
print( ( whole( cach, -4 )
, ": "
, IF cach = 32 THEN "SPC"
ELIF cach = 127 THEN "DEL"
ELSE " " + REPR cach + " "
FI
)
);
OD;
IF char count = 0 THEN print( ( newline ) ) FI;
print( ( charnewline count PLUSAB 1) ) MODAB 6
OD
</syntaxhighlight>
END</lang>
{{out}}
<pre> 32: SPC 3348: !0 3464: "@ 3580: #P 3696: $` 37112: %p
3833: &! 3949: '1 4065: (A 4181: )Q 4297: *a 43113: +q
4434: ," 4550: -2 4666: .B 4782: /R 4898: 0b 49114: 1r
5035: 2# 51: 3 5267: 4C 5383: 5S 5499: 6c 55115: 7s
5636: 8$ 5752: 94 5868: :D 5984: ;T 60100: < d 61116: =t
6237: >% 6353: ?5 6469: @E 6585: AU 66101: B e 67117: Cu
6838: D& 6954: E6 70: F 7186: GV 72102: H f 73118: Iv
7439: J' 7555: K7 7671: LG 7787: MW 78103: N g 79119: Ow
8040: P( 8156: Q8 8272: RH 8388: SX 84104: T h 85120: Ux
8641: V) 8757: W9 8873: XI 89: Y 90105: Z i 91121: [y
9242: \* 9358: ]: 9474: ^J 9590: _Z 96106: ` j 97122: az
9843: b+ 9959: c; 100 75: dK 10191: e[ 102107: fk 103123: g{
104 44: h, 105 60: i< 106 76: jL 10792: k\ 108: l 109124: m|
110 45: n- 111 61: o= 112 77: pM 11393: q] 114109: rm 115125: s}
116 46: t. 117 62: u> 118 78: vN 11994: w^ 120110: xn 121126: y~
122 47: z/ 123 63: {? 124 79: |O 125 95: }_ 126111: ~o 127: DEL</pre>
</pre>
 
=={{header|ALGOL W}}==
This assumes the ASCII character set is used by the Algol W compiler/runtime - the original Algol W implementation used EBCDIC.
<lang algolw>begin
<syntaxhighlight lang="algolw">% generate an ascii table for chars 32 - 127 %
for i := 32 until 32 + 15 do begin
integer cPos;
cPos := 0write();
for ic := 32i step 16 until 127i + ( 16 * 5 ) do begin
ifwriteon( cPosi_w := 3, s_w := 0, thenc, ": " write();
cPosif := ( cPos + 1 )c rem= 6; 32 then writeon( "Spc ")
writeon(else i_wif c := 3,127 s_wthen := 0, i,writeon( ":Del " );
ifelse i = 32 then writeon( code( c ), "Spc " )
end for_ach
else if i = 127 then writeon( "Del " )
end for_i.
else writeon( code( i ), " " )
</syntaxhighlight>
end for_i
end.</lang>
{{out}}
<pre>
<pre> 32: Spc 33: ! 34: " 35: # 36: $ 37: %
3832: &Spc 3948: '0 4064: (@ 4180: )P 4296: * ` 43112: +p
4433: ,! 4549: -1 4665: .A 4781: /Q 4897: 0a 49113: 1q
5034: 2" 5150: 32 5266: 4B 5382: 5R 5498: 6 b 55114: 7r
5635: 8# 5751: 93 5867: :C 5983: ;S 6099: < c 61115: =s
6236: >$ 6352: ?4 6468: @D 6584: AT 66100: B d 67116: Ct
6837: D% 6953: E5 7069: FE 7185: GU 72101: H e 73117: Iu
7438: J& 7554: K6 7670: LF 7786: MV 78102: N f 79118: Ov
8039: P' 8155: Q7 8271: RG 8387: SW 84103: T g 85119: Uw
8640: V( 8756: W8 8872: XH 8988: YX 90104: Z h 91120: [x
9241: \) 9357: ]9 9473: ^I 9589: _Y 96105: ` i 97121: ay
9842: b* 9958: c: 100 74: dJ 10190: eZ 102106: fj 103122: gz
104 43: h+ 105 59: i; 106 75: jK 107 91: k[ 108107: lk 109123: m{
110 44: n, 111 60: o< 112 76: pL 11392: q\ 114108: rl 115124: s|
116 45: t- 117 61: u= 118 77: vM 11993: w] 120109: xm 121125: y}
122 46: z. 123 62: {> 124 78: |N 125 94: }^ 126110: ~n 127126: Del</pre>~
47: / 63: ? 79: O 95: _ 111: o 127: Del
</pre>
 
=={{header|APL}}==
 
<langsyntaxhighlight APLlang="apl">{(¯3↑⍕⍵),': ',∊('Spc' 'Del'(⎕UCS ⍵))[32 127⍳⍵]}¨⍉6 16⍴31+⍳96</langsyntaxhighlight>
 
{{out}}
Line 432 ⟶ 529:
 
=={{header|AppleScript}}==
<langsyntaxhighlight lang="applescript">-- asciiTable :: () -> String
on asciiTable()
script row
Line 687 ⟶ 784:
set my text item delimiters to dlm
str
end unlines</langsyntaxhighlight>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 706 ⟶ 803:
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|AutoHotKeyApplesoft BASIC}}==
This is similar to the Commodore BASIC program in that it clears the screen and displays the version of BASIC. It uses enterable Applesoft BASIC to embed a 6502 machine language routine that XORs $87 with the character stored at $41 and prints the character.<syntaxhighlight lang="basic"> 0 GOTO 10: ONERR AI READ LY RND
<lang AutoHotKey>AutoTrim,Off ;Allows for whitespace at end of variable to separate converted characters
10 LET X = 256 * PEEK (104)
11 LET X = X + PEEK (103) + 7
20 CALL - 1184:B$ = CHR$ (8)
21 NORMAL : PRINT :E = 61588
22 PRINT TAB( 29)"APPLESOFT";
23 PRINT " II"B$:M = - 1
24 PRINT TAB( 22)"BASED ON ";
25 FOR I = E + 9 TO E STEP M
26 POKE 65, PEEK (I): CALL X
27 NEXT : PRINT B$:S$ = " "
28 PRINT TAB( 28)"6502 ";
29 PRINT "BASIC V2" CHR$ (8)
30 PRINT "CHARACTER SET"
40 FOR R = 0 TO 15: PRINT
50 FOR C = 2 TO 7:A = C * 16
60 LET N$ = S$ + STR$ (A + R)
70 LET N$ = RIGHT$ (N$,4)
80 PRINT N$":" CHR$ (A + R);
90 NEXT C,R: PRINT</syntaxhighlight>
The 6502 routine is embedded at line 0 and is used to display the string "!TFOSORCIM" backwards.
<syntaxhighlight lang="asm"> LDA $41 ; ONERR A
EOR #$87 ; I READ
JMP $DB59 ; LY RND</syntaxhighlight>
=={{header|ARM Assembly}}==
Thanks to Keith of [https://www.chibiakumas.com ChibiAkumas] for creating the GBA bitmap font and I/O routines.
 
<syntaxhighlight lang="arm assembly">.equ CursorX,0x02000000
.equ CursorY,0x02000001
ProgramStart:
mov sp,#0x03000000 ;Init Stack Pointer
mov r4,#0x04000000 ;DISPCNT -LCD Control
mov r2,#0x403 ;4= Layer 2 on / 3= ScreenMode 3
str r2,[r4] ;now the screen is visible
bl ResetTextCursors ;set text cursors to top left of screen
mov r2,#32
mov r3,#32+20 ;screen height is 20 chars
mov r5,#0 ;column spacer
mov r6,#5
;R0 = Character to print (working copy)
;R2 = real copy
;R3 = compare factor
loop_printAscii:
mov r0,r2
bl ShowHex
mov r0,#32
bl PrintChar
mov r0,r2
bl PrintChar
bl CustomNewLine
add r2,r2,#1
cmp r2,#128
beq forever ;exit early
cmp r2,r3
bne loop_printAscii
add r3,r3,#20 ;next section
;inc to next column
add r5,r5,#5
mov r0,r5
mov r1,#0
bl SetTextCursors
subs r6,r6,#1
bne loop_printAscii
 
 
 
forever:
b forever
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;; INPUT/OUTPUT SUBROUTINES - CREATED BY KEITH OF CHIBIAKUMAS.COM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
PrintString: ;Print 255 terminated string
STMFD sp!,{r0-r12, lr}
PrintStringAgain:
ldrB r0,[r1],#1
cmp r0,#255
beq PrintStringDone ;Repeat until 255
bl printchar ;Print Char
b PrintStringAgain
PrintStringDone:
LDMFD sp!,{r0-r12, pc}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PrintChar:
STMFD sp!,{r0-r12, lr}
mov r4,#0
mov r5,#0
mov r3,#CursorX
ldrB r4,[r3] ;X pos
mov r3,#CursorY
ldrB r5,[r3] ;Y pos
mov r3,#0x06000000 ;VRAM base
mov r6,#8*2 ;Xpos, 2 bytes per pixel, 8 bytes per char
mul r2,r4,r6
add r3,r3,r2
mov r4,#240*8*2 ;Ypos, 240 pixels per line,
mul r2,r5,r4 ;2 bytes per pixel, 8 lines per char
add r3,r3,r2
adr r4,BitmapFont ;Font source
sub r0,r0,#32 ;First Char is 32 (space)
add r4,r4,r0,asl #3 ;8 bytes per char
mov r1,#8 ;8 lines
DrawLine:
mov r7,#8 ;8 pixels per line
ldrb r8,[r4],#1 ;Load Letter
mov r9,#0b100000000 ;Mask
mov r2, #0b1111111101000000; Color: ABBBBBGGGGGRRRRR A=Alpha
DrawPixel:
tst r8,r9 ;Is bit 1?
strneh r2,[r3] ;Yes? then fill pixel (HalfWord)
add r3,r3,#2
mov r9,r9,ror #1 ;Bitshift Mask
subs r7,r7,#1
bne DrawPixel ;Next Hpixel
add r3,r3,#480-16 ;Move Down a line (240 pixels *2 bytes)
subs r1,r1,#1 ;-1 char (16 px)
bne DrawLine ;Next Vline
LineDone:
mov r3,#CursorX
ldrB r0,[r3]
add r0,r0,#1 ;Move across screen
strB r0,[r3]
mov r10,#30
cmp r0,r10
bleq NewLine
LDMFD sp!,{r0-r12, pc}
 
NewLine:
STMFD sp!,{r0-r12, lr}
mov r3,#CursorX
mov r0,#0
strB r0,[r3]
mov r4,#CursorY
ldrB r0,[r4]
add r0,r0,#1
strB r0,[r4]
LDMFD sp!,{r0-r12, pc}
CustomNewLine:
STMFD sp!,{r0-r12, lr}
mov r3,#CursorX
mov r0,r5
strB r0,[r3]
mov r4,#CursorY
ldrB r0,[r4]
add r0,r0,#1
strB r0,[r4]
LDMFD sp!,{r0-r12, pc}
ResetTextCursors:
STMFD sp!,{r4-r6,lr}
mov r4,#0
mov r5,#CursorX
mov r6,#CursorY
strB r4,[r5]
strB r4,[r6]
LDMFD sp!,{r4-r6,lr}
bx lr
SetTextCursors:
;input: R0 = new X
; R1 = new Y
STMFD sp!,{r5-r6}
mov r5,#CursorX
mov r6,#CursorY
strB r0,[r5]
strB r1,[r6]
LDMFD sp!,{r5-r6}
bx lr
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
ShowHex:
STMFD sp!,{r0-r12, lr}
mov r2,r0,ror #4
bl ShowHexChar
mov r2,r0
bl ShowHexChar
LDMFD sp!,{r0-r12, pc}
ShowHexChar:
STMFD sp!,{r0-r12, lr}
;mov r3,
and r0,r2,#0x0F ; r3
cmp r0,#10
addge r0,r0,#7 ;if 10 or greater convert to alphabet letters a-f
add r0,r0,#48
bl PrintChar
LDMFD sp!,{r0-r12, pc}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BitmapFont:
;each byte represents a row of 8 pixels. This is a 1BPP font that is converted to the GBA's 16bpp screen format at runtime
.byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ; 20
.byte 0x10,0x18,0x18,0x18,0x18,0x00,0x18,0x00 ; 21
.byte 0x28,0x6C,0x28,0x00,0x00,0x00,0x00,0x00 ; 22
.byte 0x00,0x28,0x7C,0x28,0x7C,0x28,0x00,0x00 ; 23
.byte 0x18,0x3E,0x48,0x3C,0x12,0x7C,0x18,0x00 ; 24
.byte 0x02,0xC4,0xC8,0x10,0x20,0x46,0x86,0x00 ; 25
.byte 0x10,0x28,0x28,0x72,0x94,0x8C,0x72,0x00 ; 26
.byte 0x0C,0x1C,0x30,0x00,0x00,0x00,0x00,0x00 ; 27
.byte 0x18,0x18,0x30,0x30,0x30,0x18,0x18,0x00 ; 28
.byte 0x18,0x18,0x0C,0x0C,0x0C,0x18,0x18,0x00 ; 29
.byte 0x08,0x49,0x2A,0x1C,0x14,0x22,0x41,0x00 ; 2A
.byte 0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00 ; 2B
.byte 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30 ; 2C
.byte 0x00,0x00,0x00,0x7E,0x7E,0x00,0x00,0x00 ; 2D
.byte 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00 ; 2E
.byte 0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00 ; 2F
.byte 0x7C,0xC6,0xD6,0xD6,0xD6,0xC6,0x7C,0x00 ; 30
.byte 0x10,0x18,0x18,0x18,0x18,0x18,0x08,0x00 ; 31
.byte 0x3C,0x7E,0x06,0x3C,0x60,0x7E,0x3C,0x00 ; 32
.byte 0x3C,0x7E,0x06,0x1C,0x06,0x7E,0x3C,0x00 ; 33
.byte 0x18,0x3C,0x64,0xCC,0x7C,0x0C,0x08,0x00 ; 34
.byte 0x3C,0x7E,0x60,0x7C,0x06,0x7E,0x3E,0x00 ; 35
.byte 0x3C,0x7E,0x60,0x7C,0x66,0x66,0x3C,0x00 ; 36
.byte 0x3C,0x7E,0x06,0x0C,0x18,0x18,0x10,0x00 ; 37
.byte 0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00 ; 38
.byte 0x3C,0x66,0x66,0x3E,0x06,0x7E,0x3C,0x00 ; 39
.byte 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x00 ; 3A
.byte 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x30 ; 3B
.byte 0x0C,0x1C,0x38,0x60,0x38,0x1C,0x0C,0x00 ; 3C
.byte 0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00 ; 3D
.byte 0x60,0x70,0x38,0x0C,0x38,0x70,0x60,0x00 ; 3E
.byte 0x3C,0x76,0x06,0x1C,0x00,0x18,0x18,0x00 ; 3F
.byte 0x7C,0xCE,0xA6,0xB6,0xC6,0xF0,0x7C,0x00 ; 40 @
.byte 0x18,0x3C,0x66,0x66,0x7E,0x66,0x24,0x00 ; 41 A
.byte 0x3C,0x66,0x66,0x7C,0x66,0x66,0x3C,0x00 ; 42 B
.byte 0x38,0x7C,0xC0,0xC0,0xC0,0x7C,0x38,0x00 ; 43 C
.byte 0x3C,0x64,0x66,0x66,0x66,0x64,0x38,0x00 ; 44 D
.byte 0x3C,0x7E,0x60,0x78,0x60,0x7E,0x3C,0x00 ; 45 E
.byte 0x38,0x7C,0x60,0x78,0x60,0x60,0x20,0x00 ; 46 F
.byte 0x3C,0x66,0xC0,0xC0,0xCC,0x66,0x3C,0x00 ; 47 G
.byte 0x24,0x66,0x66,0x7E,0x66,0x66,0x24,0x00 ; 48 H
.byte 0x10,0x18,0x18,0x18,0x18,0x18,0x08,0x00 ; 49 I
.byte 0x08,0x0C,0x0C,0x0C,0x4C,0xFC,0x78,0x00 ; 4A J
.byte 0x24,0x66,0x6C,0x78,0x6C,0x66,0x24,0x00 ; 4B K
.byte 0x20,0x60,0x60,0x60,0x60,0x7E,0x3E,0x00 ; 4C L
.byte 0x44,0xEE,0xFE,0xD6,0xD6,0xD6,0x44,0x00 ; 4D M
.byte 0x44,0xE6,0xF6,0xDE,0xCE,0xC6,0x44,0x00 ; 4E N
.byte 0x38,0x6C,0xC6,0xC6,0xC6,0x6C,0x38,0x00 ; 4F O
.byte 0x38,0x6C,0x64,0x7C,0x60,0x60,0x20,0x00 ; 50 P
.byte 0x38,0x6C,0xC6,0xC6,0xCA,0x74,0x3A,0x00 ; 51 Q
.byte 0x3C,0x66,0x66,0x7C,0x6C,0x66,0x26,0x00 ; 52 R
.byte 0x3C,0x7E,0x60,0x3C,0x06,0x7E,0x3C,0x00 ; 53 S
.byte 0x3C,0x7E,0x18,0x18,0x18,0x18,0x08,0x00 ; 54 T
.byte 0x24,0x66,0x66,0x66,0x66,0x66,0x3C,0x00 ; 55 U
.byte 0x24,0x66,0x66,0x66,0x66,0x3C,0x18,0x00 ; 56 V
.byte 0x44,0xC6,0xD6,0xD6,0xFE,0xEE,0x44,0x00 ; 57 W
.byte 0xC6,0x6C,0x38,0x38,0x6C,0xC6,0x44,0x00 ; 58 X
.byte 0x24,0x66,0x66,0x3C,0x18,0x18,0x08,0x00 ; 59 Y
.byte 0x7C,0xFC,0x0C,0x18,0x30,0x7E,0x7C,0x00 ; 5A Z
.byte 0x1C,0x30,0x30,0x30,0x30,0x30,0x1C,0x00 ; 5B [
.byte 0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x00 ; 5C Backslash
.byte 0x38,0x0C,0x0C,0x0C,0x0C,0x0C,0x38,0x00 ; 5D ]
.byte 0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00 ; 5E ^
.byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C ; 5F _
.byte 0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00 ; 60 `
.byte 0x00,0x00,0x38,0x0C,0x7C,0xCC,0x78,0x00 ; 61
.byte 0x20,0x60,0x7C,0x66,0x66,0x66,0x3C,0x00 ; 62
.byte 0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x00 ; 63
.byte 0x08,0x0C,0x7C,0xCC,0xCC,0xCC,0x78,0x00 ; 64
.byte 0x00,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00 ; 65
.byte 0x1C,0x36,0x30,0x38,0x30,0x30,0x10,0x00 ; 66
.byte 0x00,0x00,0x3C,0x66,0x66,0x3E,0x06,0x3C ; 67
.byte 0x20,0x60,0x6C,0x76,0x66,0x66,0x24,0x00 ; 68
.byte 0x18,0x00,0x18,0x18,0x18,0x18,0x08,0x00 ; 69
.byte 0x06,0x00,0x04,0x06,0x06,0x26,0x66,0x3C ; 6A
.byte 0x20,0x60,0x66,0x6C,0x78,0x6C,0x26,0x00 ; 6B
.byte 0x10,0x18,0x18,0x18,0x18,0x18,0x08,0x00 ; 6C
.byte 0x00,0x00,0x6C,0xFE,0xD6,0xD6,0xC6,0x00 ; 6D
.byte 0x00,0x00,0x3C,0x66,0x66,0x66,0x24,0x00 ; 6E
.byte 0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00 ; 6F
.byte 0x00,0x00,0x3C,0x66,0x66,0x7C,0x60,0x20 ; 70
.byte 0x00,0x00,0x78,0xCC,0xCC,0x7C,0x0C,0x08 ; 71
.byte 0x00,0x00,0x38,0x7C,0x60,0x60,0x20,0x00 ; 72
.byte 0x00,0x00,0x3C,0x60,0x3C,0x06,0x7C,0x00 ; 73
.byte 0x10,0x30,0x3C,0x30,0x30,0x3E,0x1C,0x00 ; 74
.byte 0x00,0x00,0x24,0x66,0x66,0x66,0x3C,0x00 ; 75
.byte 0x00,0x00,0x24,0x66,0x66,0x3C,0x18,0x00 ; 76
.byte 0x00,0x00,0x44,0xD6,0xD6,0xFE,0x6C,0x00 ; 77
.byte 0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00 ; 78
.byte 0x00,0x00,0x24,0x66,0x66,0x3E,0x06,0x7C ; 79
.byte 0x00,0x00,0x7E,0x0C,0x18,0x30,0x7E,0x00 ; 7A
.byte 0x10,0x20,0x20,0x40,0x40,0x20,0x20,0x10 ; 7B {
.byte 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 ; 7C |
.byte 0x08,0x04,0x04,0x02,0x02,0x04,0x04,0x08 ; 7D }
.byte 0x00,0x00,0x00,0x20,0x52,0x0C,0x00,0x00 ; 7E ~
.byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ; 7F
.byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF ; 80</syntaxhighlight>
 
{{out}}
[https://ibb.co/gyfdwhJ Picture of output on VisualBoyAdvance screen]
 
=={{header|Arturo}}==
 
<syntaxhighlight lang="rebol">loop 32..127 'num [
k: ø
case [num]
when? [=32] -> k: "␠"
when? [=127] -> k: "␡"
else -> k: to :string to :char num
 
prints pad ~"|num|: |k|" 10
if 1 = num%6 -> print ""
]</syntaxhighlight>
 
{{out}}
 
<pre> 32: ␠ 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: ␡</pre>
 
=={{header|AutoHotkey}}==
<syntaxhighlight lang="autohotkey">AutoTrim,Off ;Allows for whitespace at end of variable to separate converted characters
 
MessageText := ;The text to display in the final message box.
Line 736 ⟶ 1,186:
}
MsgBox, % MessageText ;Displays a message box with the ASCII conversion table, from the MessageText variable
return</langsyntaxhighlight>
{{out}}
<pre>
Line 759 ⟶ 1,209:
{{works with|GAWK}}
{{works with|MAWK}}
<langsyntaxhighlight AWKlang="awk"># syntax: GAWK -f SHOW_ASCII_TABLE.AWK
# syntax: MAWK -f SHOW_ASCII_TABLE.AWK
BEGIN {
n00_15 = "NUL,SOH,STX,ETX,EOT,ENQ,ACK,BEL,BS,HT,LF,VT,FF,CR,SO,SI"
n16_31 = "DLE,DC1,DC2,DC3,DC4,NAK,SYN,ETB,CAN,EM,SUB,ESC,FS,GS,RS,US"
split(n00_15 "," n16_31,arr,",")
for (i=0; i<16; i++) {
for (j=032+i; j<128; j+=16) {
if (j <== 3132) { x = "SPC" }
x = arr[j+1]
continue # don't show values 0 - 31
}
else if (j == 32) { x = "SP" }
else if (j == 127) { x = "DEL" }
else { x = sprintf("%c",j) }
printf("%3d: %-5s",j,x)
}
printf(print "\n")
}
}</syntaxhighlight>
exit(0)
}</lang>
{{out}}
<pre> 32: SP SPC 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
Line 797 ⟶ 1,239:
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: DEL</pre>
 
=={{header|BASIC}}==
==={{header|BASIC256}}===
<syntaxhighlight lang="vb">for i = 32 to 47
for j = i to i + 80 step 16
begin case
case j = 32
s$ = "Spc"
case j = 127
s$ = "Del"
else
s$ = chr(j)
end case
print rjust(" "+string(j),5); ": "; ljust(s$,3);
next j
print
next i</syntaxhighlight>
 
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">10 cls
20 for r = 0 to 15
30 for c = 1 to 6
40 a = 16+r+c*16
50 print right$(" "+str$(a),4)": " chr$(a)tab (10*c);
60 next c
70 print
80 next r</syntaxhighlight>
{{out}}
<pre> 32: 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: ⌂</pre>
 
==={{header|GW-BASIC}}===
{{works with|BASICA}}
<syntaxhighlight lang="gwbasic">10 DEFINT I,J: DEFSTR S: DIM S(2)
20 S(0)="* "
30 S(1)="Spc"
40 S(2)="Del"
50 FOR I=32 TO 47
60 FOR J=I TO 127 STEP 16
70 MID$(S(0),1,1) = CHR$(J)
80 PRINT USING "###: \ \ ";J;S(-(J=32)-2*(J=127));
90 NEXT J
100 PRINT
110 NEXT I</syntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
==={{header|IS-BASIC}}===
<syntaxhighlight lang="is-basic">100 TEXT 80
110 FOR R=0 TO 15
120 FOR C=32+R TO 112+R STEP 16
130 PRINT USING "###":C;:PRINT ": ";CHR$(C),
140 NEXT
150 PRINT
160 NEXT</syntaxhighlight>
 
==={{header|MSX Basic}}===
The [[#GW-BASIC|GW-BASIC]] solution works without any changes.
 
==={{header|QBasic}}===
The [[#QB64|QB64]] solution works without any changes.
 
==={{header|Run BASIC}}===
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
<syntaxhighlight lang="vb">for i = 32 to 47
for j = i to i + 80 step 16
select case j
case 32
s$ = "Spc"
case 127
s$ = "Del"
case else
s$ = chr$(j)
end select
print right$(" "+str$(j),4); ": "; s$; space$(3);
next j
print
next i</syntaxhighlight>
 
==={{header|True BASIC}}===
<syntaxhighlight lang="qbasic">FOR i = 32 TO 47
FOR j = i TO i+80 STEP 16
SELECT CASE j
CASE 32
LET s$ = "Spc"
CASE 127
LET s$ = "Del"
CASE else
LET s$ = CHR$(j)
END SELECT
PRINT USING "###: ### ": j, s$;
NEXT j
PRINT
NEXT</syntaxhighlight>
{{out}}
<pre>Same as QB64 entry.</pre>
 
==={{header|XBasic}}===
{{works with|Windows XBasic}}
<syntaxhighlight lang="qbasic">PROGRAM "ASCII table"
VERSION "0.0000"
 
DECLARE FUNCTION Entry ()
 
FUNCTION Entry ()
FOR i = 32 TO 47
FOR j = i TO i + 80 STEP 16
SELECT CASE j
CASE 32
s$ = "Spc"
CASE 127
s$ = "Del"
CASE ELSE
s$ = CHR$(j)
END SELECT
PRINT RJUST$(" "+STRING(j),4); ": "; LJUST$(s$,3);
NEXT j
PRINT
NEXT i
END FUNCTION
END PROGRAM</syntaxhighlight>
 
==={{header|Yabasic}}===
<syntaxhighlight lang="vb">for i = 32 to 47
for j = i to i + 80 step 16
s$ = chr$(j)
if j = 32 s$ = "Spc"
if j = 127 s$ = "Del"
print str$(j, "#####"), ": ", s$;
next j
print
next i</syntaxhighlight>
 
=={{header|BaCon}}==
<syntaxhighlight lang="bacon">FOR j = 0 TO 15
FOR i = 32+j TO 127 STEP 16
PRINT i FORMAT " %3d - ";
SELECT i
CASE 32
PRINT "Spc";
CASE 127
PRINT "Del";
DEFAULT
PRINT i FORMAT "%c "
ENDSELECT
NEXT
PRINT
NEXT</syntaxhighlight>
 
{{out}}
<pre> 32 - Spc 48 - 0 64 - @ 80 - P 96 - ` 112 - p
33 - ! 49 - 1 65 - A 81 - Q 97 - a 113 - q
34 - " 50 - 2 66 - B 82 - R 98 - b 114 - r
35 - # 51 - 3 67 - C 83 - S 99 - c 115 - s
36 - $ 52 - 4 68 - D 84 - T 100 - d 116 - t
37 - % 53 - 5 69 - E 85 - U 101 - e 117 - u
38 - & 54 - 6 70 - F 86 - V 102 - f 118 - v
39 - ' 55 - 7 71 - G 87 - W 103 - g 119 - w
40 - ( 56 - 8 72 - H 88 - X 104 - h 120 - x
41 - ) 57 - 9 73 - I 89 - Y 105 - i 121 - y
42 - * 58 - : 74 - J 90 - Z 106 - j 122 - z
43 - + 59 - ; 75 - K 91 - [ 107 - k 123 - {
44 - , 60 - < 76 - L 92 - \ 108 - l 124 - |
45 - - 61 - = 77 - M 93 - ] 109 - m 125 - }
46 - . 62 - > 78 - N 94 - ^ 110 - n 126 - ~
47 - / 63 - ? 79 - O 95 - _ 111 - o 127 - Del</pre>
 
=={{header|BCPL}}==
<syntaxhighlight lang="bcpl">get "libhdr"
 
let str(n) =
n=32 -> "%I3: Spc ",
n=127 -> "%I3: Del ",
"%I3: %C "
let start() be
for i=32 to 47 do
$( for j=i to 127 by 16 do
writef(str(j), j, j)
wrch('*N')
$)</syntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|BQN}}==
The final result is a 2D array of characters which is output line by line with <code>•Out</code>.
<syntaxhighlight lang="bqn">chs←⟨"SPC"⟩∾(@+33+↕94)∾⟨"DEL"⟩
J←{𝕨∾' '∾𝕩}´
_pad←{(𝕗×·⌈´≠¨)⊸(↑¨)}
•Out˘J˘J¨⍉6‿16⥊<˘⍉(∾⟜':'¨¯1 _pad •Fmt¨32+↕96)≍1 _pad chs</syntaxhighlight>
<syntaxhighlight lang="text"> 32: SPC 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: DEL</syntaxhighlight>
 
=={{header|Brainf***}}==
{{trans|M2000 Interpreter}}
 
<syntaxhighlight lang="bf">
> ++++++ ; 6 rows
> ++++ ++++ ++++ ++++ ; 16 columns
> ++++ ++++ ++++ ++++ ++++ ++++ ++++ ++++ ; 32: the starting character
<< ; move to row counter
[
> ; move to the column counter
[> ; move to character
. ; print it
+ ; increase it
<- ; decrease the column counter
]
+++++ +++++.[-] ; print newline
++++ ++++ ++++ ++++ ; set column counter again
<-] ; decrease row counter and loop
</syntaxhighlight>
 
{{out}}
 
<pre>
!"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~
</pre>
 
=={{header|C}}==
{{trans|Go}}
<langsyntaxhighlight lang="c">#include <stdio.h>
 
int main() {
Line 817 ⟶ 1,543:
}
return 0;
}</langsyntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 835 ⟶ 1,561:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|C++}}==
<syntaxhighlight lang="cpp">#include <string>
#include <iomanip>
#include <iostream>
 
inline constexpr auto HEIGHT = 16;
inline constexpr auto WIDTH = 6;
inline constexpr auto ASCII_START = 32;
// ASCII special characters
inline constexpr auto SPACE = 32;
inline constexpr auto DELETE = 127;
 
std::string displayAscii(char ascii) {
switch (ascii) {
case SPACE: return "Spc";
case DELETE: return "Del";
default: return std::string(1, ascii);
}
}
 
int main() {
for (std::size_t row = 0; row < HEIGHT; ++row) {
for (std::size_t col = 0; col < WIDTH; ++col) {
const auto ascii = ASCII_START + row + col * HEIGHT;
std::cout << std::right << std::setw(3) << ascii << " : " << std::left << std::setw(6) << displayAscii(ascii);
}
std::cout << '\n';
}
}</syntaxhighlight>
{{out}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|C sharp}}==
<langsyntaxhighlight lang="csharp">using static System.Console;
using static System.Linq.Enumerable;
 
Line 850 ⟶ 1,625:
string Text(int index) => index == 32 ? "Sp" : index == 127 ? "Del" : (char)index + "";
}
}</langsyntaxhighlight>
{{out}}
<pre> 32 : Sp 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 870 ⟶ 1,645:
 
=={{header|Caché ObjectScript}}==
<langsyntaxhighlight Cachélang="caché ObjectScriptobjectscript">SHOWASCII
; this is 96 characters, so do 6 columns of 16
for i = 32:1:127 {
Line 887 ⟶ 1,662:
}
 
quit</langsyntaxhighlight>
 
{{out}}
Line 914 ⟶ 1,689:
 
Further down, the code will be modified to handle the more general case of a grid where the number of codes to be displayed doesn't match the product of the numbers of rows and columns in the desired grid. That case is made a little trickier by the desire to print the table in "column-major order", which seems the friendlier to the end-user reading the table.
<syntaxhighlight lang="clojure">
<lang Clojure>
(defn cell [code]
(let [text (get {32 "Spc", 127 "Del"} code (char code))]
Line 933 ⟶ 1,708:
(defn pr-ascii-table [n-cols st-code end-code]
(println (ascii-table n-cols st-code end-code)))
</syntaxhighlight>
</lang>
 
{{out}}
Line 979 ⟶ 1,754:
There are 2 output examples, the first simply creates a grid with an incomplete final column. The second case additionally demonstrates the ability to modify the range of ASCII codes displayed.
 
<syntaxhighlight lang="clojure">
<lang Clojure>
(defn cell [code]
(if (nil? code)
Line 1,002 ⟶ 1,777:
(defn pr-ascii-table [n-cols st-code end-code]
(println (ascii-table n-cols st-code end-code)))
</syntaxhighlight>
</lang>
 
{{out}}
Line 1,039 ⟶ 1,814:
47: / 60: < 73: I 86: V 99: c 112: p
48: 0 61: = 74: J 87: W 100: d 113: q
</pre>
 
=={{header|CLU}}==
<syntaxhighlight lang="clu">ascii = proc (n: int) returns (string)
if n=32 then return("Spc")
elseif n=127 then return("Del")
else return(string$c2s(char$i2c(n)))
end
end ascii
 
start_up = proc ()
po: stream := stream$primary_output()
for i: int in int$from_to(32, 47) do
for j: int in int$from_to_by(i, 127, 16) do
stream$putright(po, int$unparse(j), 3)
stream$puts(po, ": ")
stream$putleft(po, ascii(j), 5)
end
stream$putl(po, "")
end
end start_up</syntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|COBOL}}==
{{works with|OpenCOBOL|3.1.2}}
Uses free form syntax.
<syntaxhighlight lang="cobol">
IDENTIFICATION DIVISION.
PROGRAM-ID. CHARSET.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CHARCODE PIC 9(3) VALUE 32.
PROCEDURE DIVISION.
MAIN-PROCEDURE.
PERFORM UNTIL CHARCODE=128
DISPLAY FUNCTION CONCATENATE(
FUNCTION CONCATENATE(
CHARCODE,
" : "
),
FUNCTION CONCATENATE(
FUNCTION CHAR(CHARCODE),
" "
)
)
WITH NO ADVANCING
ADD 1 TO CHARCODE
END-PERFORM.
END PROGRAM CHARSET.
</syntaxhighlight>
 
{{out}}
<pre>
032 : 033 : 034 : ! 035 : " 036 : # 037 : $ 038 : % 039 : & 040 : ' 041 : ( 042 : ) 043 : * 044 : + 045 : , 046 : - 047 : . 048 : / 049 : 0 050 : 1 051 : 2 052 : 3 053 : 4 054 : 5 055 : 6 056 : 7 057 : 8 058 : 9 059 : : 060 : ; 061 : < 062 : = 063 : > 064 : ? 065 : @ 066 : A 067 : B 068 : C 069 : D 070 : E 071 : F 072 : G 073 : H 074 : I 075 : J 076 : K 077 : L 078 : M 079 : N 080 : O 081 : P 082 : Q 083 : R 084 : S 085 : T 086 : U 087 : V 088 : W 089 : X 090 : Y 091 : Z 092 : [ 093 : \ 094 : ] 095 : ^ 096 : _ 097 : ` 098 : a 099 : b 100 : c 101 : d 102 : e 103 : f 104 : g 105 : h 106 : i 107 : j 108 : k 109 : l 110 : m 111 : n 112 : o 113 : p 114 : q 115 : r 116 : s 117 : t 118 : u 119 : v 120 : w 121 : x 122 : y 123 : z 124 : { 125 : | 126 : } 127 : ~
</pre>
 
=={{header|Commodore BASIC}}==
<langsyntaxhighlight lang="qbasic">100 PRINT CHR$(147);:REM CLEAR SCREEN
110 PRINT CHR$(14);:REM CHARACTER SET 2
120 PRINT "COMMODORE 64 - BASIC V2"
Line 1,054 ⟶ 1,899:
200 PRINT
210 NEXT R
</syntaxhighlight>
</lang>
{{out}}
[[File:c64asciitable.jpg]]
Line 1,061 ⟶ 1,906:
 
=={{header|Common Lisp}}==
<langsyntaxhighlight lang="lisp">(setq startVal 32)
(setq endVal 127)
(setq cols 6)
Line 1,078 ⟶ 1,923:
(if (> lower upper) '() (cons lower (get-range (+ 1 lower) upper))))
 
(mapcar #'print-val (get-range startVal endVal))</langsyntaxhighlight>
{{out}}
<pre> 32: SPC 33: ! 34: " 35: # 36: $ 37: %
Line 1,096 ⟶ 1,941:
116: t 117: u 118: v 119: w 120: x 121: y
122: z 123: { 124: | 125: } 126: ~ 127: DEL</pre>
 
=={{header|Cowgol}}==
<syntaxhighlight lang="cowgol">include "cowgol.coh";
 
# Print number with preceding space if <100 and trailing colon
sub print_num(n: uint8) is
if n < 100 then print_char(' '); end if;
print_i8(n);
print(": ");
end sub;
 
# Print character / Spc / Del padded to 5 spaces
sub print_ch(c: uint8) is
if c == ' ' then print("Spc ");
elseif c == 127 then print("Del ");
else
print_char(c);
print(" ");
end if;
end sub;
 
var c: uint8 := 32;
loop
print_num(c);
print_ch(c);
if c == 127 then
break;
end if;
c := c + 16;
if c > 127 then
print_nl();
c := c - 95;
end if;
end loop;
print_nl();</syntaxhighlight>
 
{{out}}
 
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|D}}==
{{trans|C}}
<syntaxhighlight lang="d">import std.stdio;
 
void main() {
for (int i = 0; i < 16; ++i) {
for (int j = 32 + i; j < 128; j += 16) {
switch (j) {
case 32:
writef("%3d : Spc ", j);
break;
case 127:
writef("%3d : Del ", j);
break;
default:
writef("%3d : %-3s ", j, cast(char)j);
break;
}
}
writeln;
}
}</syntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del</pre>
 
=={{header|Dc}}==
Line 1,101 ⟶ 2,040:
{{Works with|GNU dc|1.3.95}}
 
<langsyntaxhighlight lang="dc">[ [1q]S.[>.0]xs.L. ] sl ## l: islt
## for initcode condcode incrcode body
Line 1,132 ⟶ 2,071:
] lfx
[]pP
] lfx</langsyntaxhighlight>
{{out}}
<pre>
Line 1,152 ⟶ 2,091:
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|Delphi}}==
{{Trans|Go}}
 
<syntaxhighlight lang="delphi">
program Show_Ascii_table;
 
{$APPTYPE CONSOLE}
 
var
i, j: Integer;
k: string;
 
begin
for i := 0 to 15 do
begin
j := 32 + i;
while j < 128 do
begin
case j of
32:
k := 'Spc';
127:
k := 'Del';
else
k := chr(j);
end;
Write(j: 3, ' : ', k: 3, ' ');
inc(j, 16);
end;
Writeln;
end;
Readln;
end.
 
</syntaxhighlight>
 
{{out}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|Draco}}==
<syntaxhighlight lang="draco">proc write_item(byte n) void:
*char chrstr = "* ";
chrstr* := pretend(n, char);
write(n:3, " : ",
case n
incase 32: "Spc "
incase 127: "Del "
default: chrstr
esac)
corp
 
proc main() void:
byte row, col;
for row from 32 upto 47 do
for col from row by 16 upto 127 do
write_item(col)
od;
writeln()
od
corp</syntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del</pre>
 
=={{header|EasyLang}}==
{{trans|AWK}}
 
<syntaxhighlight lang="easylang">
numfmt 0 3
for i range0 16
for j = 32 + i step 16 to 127
if j = 32
x$ = "Spc"
elif j = 127
x$ = "Del"
else
x$ = strchar j & " "
.
write j & ": " & x$
.
print ""
.
</syntaxhighlight>
 
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module ShowAsciiTable {
@Inject Console console;
void run() {
for (Int offset : 0..<16) {
for (Int ascii = 32+offset; ascii < 128; ascii += 16) {
console.print($|{ascii.toString().rightJustify(3)}/\
|{ascii.toByte().toByteArray()}: \
|{new Char(ascii).quoted().leftJustify(5)}
, suppressNewline=True);
}
console.print();
}
}
}
</syntaxhighlight>
 
{{out}}
<pre>
32/0x20: ' ' 48/0x30: '0' 64/0x40: '@' 80/0x50: 'P' 96/0x60: '`' 112/0x70: 'p'
33/0x21: '!' 49/0x31: '1' 65/0x41: 'A' 81/0x51: 'Q' 97/0x61: 'a' 113/0x71: 'q'
34/0x22: '\"' 50/0x32: '2' 66/0x42: 'B' 82/0x52: 'R' 98/0x62: 'b' 114/0x72: 'r'
35/0x23: '#' 51/0x33: '3' 67/0x43: 'C' 83/0x53: 'S' 99/0x63: 'c' 115/0x73: 's'
36/0x24: '$' 52/0x34: '4' 68/0x44: 'D' 84/0x54: 'T' 100/0x64: 'd' 116/0x74: 't'
37/0x25: '%' 53/0x35: '5' 69/0x45: 'E' 85/0x55: 'U' 101/0x65: 'e' 117/0x75: 'u'
38/0x26: '&' 54/0x36: '6' 70/0x46: 'F' 86/0x56: 'V' 102/0x66: 'f' 118/0x76: 'v'
39/0x27: '\'' 55/0x37: '7' 71/0x47: 'G' 87/0x57: 'W' 103/0x67: 'g' 119/0x77: 'w'
40/0x28: '(' 56/0x38: '8' 72/0x48: 'H' 88/0x58: 'X' 104/0x68: 'h' 120/0x78: 'x'
41/0x29: ')' 57/0x39: '9' 73/0x49: 'I' 89/0x59: 'Y' 105/0x69: 'i' 121/0x79: 'y'
42/0x2A: '*' 58/0x3A: ':' 74/0x4A: 'J' 90/0x5A: 'Z' 106/0x6A: 'j' 122/0x7A: 'z'
43/0x2B: '+' 59/0x3B: ';' 75/0x4B: 'K' 91/0x5B: '[' 107/0x6B: 'k' 123/0x7B: '{'
44/0x2C: ',' 60/0x3C: '<' 76/0x4C: 'L' 92/0x5C: '\\' 108/0x6C: 'l' 124/0x7C: '|'
45/0x2D: '-' 61/0x3D: '=' 77/0x4D: 'M' 93/0x5D: ']' 109/0x6D: 'm' 125/0x7D: '}'
46/0x2E: '.' 62/0x3E: '>' 78/0x4E: 'N' 94/0x5E: '^' 110/0x6E: 'n' 126/0x7E: '~'
47/0x2F: '/' 63/0x3F: '?' 79/0x4F: 'O' 95/0x5F: '_' 111/0x6F: 'o' 127/0x7F: '\d'
</pre>
 
=={{header|Excel}}==
===LAMBDA===
 
Binding the name '''asciiTable''' to the following lambda expression in the Name Manager of the Excel WorkBook:
 
(See [https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ LAMBDA: The ultimate Excel worksheet function])
 
{{Works with|Office 365 betas 2021}}
<syntaxhighlight lang="lisp">asciiTable
=LAMBDA(i,
justifyRight(3)(" ")(i) & ": " & (
justifyRight(
3
)(" ")(
IF(32 = i,
"Spc",
IF(127 = i,
"Del",
CHAR(i)
)
)
)
)
)(
SEQUENCE(16, 6, 32, 1)
)</syntaxhighlight>
 
and also assuming the following generic binding in the Name Manager for the WorkBook:
 
<syntaxhighlight lang="lisp">justifyRight
=LAMBDA(n,
LAMBDA(c,
LAMBDA(s,
LET(
lng, LEN(s),
 
IF(
lng < n,
MID(
REPT(c, n),
lng, n - lng
) & s,
s
)
)
)
)
)</syntaxhighlight>
 
{{Out}}
The formula in cell B2 defines an array which populates the whole '''B2:G17''' range.
 
(Justification within the cells depends on applying a monospaced font in Excel).
 
{| class="wikitable"
|-
|||style="text-align:right; font-family:serif; font-style:italic; font-size:120%;"|fx
! colspan="7" style="text-align:left; vertical-align: bottom; font-family:Arial, Helvetica, sans-serif !important;"|=asciiTable
|- style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff;"
|
| A
| B
| C
| D
| E
| F
| G
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 1
| style="font-weight:bold" | Ascii Table
|
|
|
|
|
|
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 2
|
| style="background-color:#cbcefb" | 32:&nbsp;Spc
| 33:&nbsp;&nbsp;&nbsp;!
| 34:&nbsp;&nbsp;&nbsp;"
| 35:&nbsp;&nbsp;&nbsp;#
| 36:&nbsp;&nbsp;&nbsp;$
| 37:&nbsp;&nbsp;&nbsp;%
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 3
|
| 38:&nbsp;&nbsp;&nbsp;&
| 39:&nbsp;&nbsp;&nbsp;'
| 40:&nbsp;&nbsp;&nbsp;(
| 41:&nbsp;&nbsp;&nbsp;)
| 42:&nbsp;&nbsp;&nbsp;*
| 43:&nbsp;&nbsp;&nbsp;+
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 4
|
| 44:&nbsp;&nbsp;&nbsp;,
| 45:&nbsp;&nbsp;&nbsp;-
| 46:&nbsp;&nbsp;&nbsp;.
| 47:&nbsp;&nbsp;&nbsp;/
| 48:&nbsp;&nbsp;&nbsp;0
| 49:&nbsp;&nbsp;&nbsp;1
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 5
|
| 50:&nbsp;&nbsp;&nbsp;2
| 51:&nbsp;&nbsp;&nbsp;3
| 52:&nbsp;&nbsp;&nbsp;4
| 53:&nbsp;&nbsp;&nbsp;5
| 54:&nbsp;&nbsp;&nbsp;6
| 55:&nbsp;&nbsp;&nbsp;7
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 6
|
| 56:&nbsp;&nbsp;&nbsp;8
| 57:&nbsp;&nbsp;&nbsp;9
| 58:&nbsp;&nbsp;&nbsp;:
| 59:&nbsp;&nbsp;&nbsp;;
| 60:&nbsp;&nbsp;&nbsp;<
| 61:&nbsp;&nbsp;&nbsp;=
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 7
|
| 62:&nbsp;&nbsp;&nbsp;>
| 63:&nbsp;&nbsp;&nbsp;?
| 64:&nbsp;&nbsp;&nbsp;@
| 65:&nbsp;&nbsp;&nbsp;A
| 66:&nbsp;&nbsp;&nbsp;B
| 67:&nbsp;&nbsp;&nbsp;C
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 8
|
| 68:&nbsp;&nbsp;&nbsp;D
| 69:&nbsp;&nbsp;&nbsp;E
| 70:&nbsp;&nbsp;&nbsp;F
| 71:&nbsp;&nbsp;&nbsp;G
| 72:&nbsp;&nbsp;&nbsp;H
| 73:&nbsp;&nbsp;&nbsp;I
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 9
|
| 74:&nbsp;&nbsp;&nbsp;J
| 75:&nbsp;&nbsp;&nbsp;K
| 76:&nbsp;&nbsp;&nbsp;L
| 77:&nbsp;&nbsp;&nbsp;M
| 78:&nbsp;&nbsp;&nbsp;N
| 79:&nbsp;&nbsp;&nbsp;O
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 10
|
| 80:&nbsp;&nbsp;&nbsp;P
| 81:&nbsp;&nbsp;&nbsp;Q
| 82:&nbsp;&nbsp;&nbsp;R
| 83:&nbsp;&nbsp;&nbsp;S
| 84:&nbsp;&nbsp;&nbsp;T
| 85:&nbsp;&nbsp;&nbsp;U
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 11
|
| 86:&nbsp;&nbsp;&nbsp;V
| 87:&nbsp;&nbsp;&nbsp;W
| 88:&nbsp;&nbsp;&nbsp;X
| 89:&nbsp;&nbsp;&nbsp;Y
| 90:&nbsp;&nbsp;&nbsp;Z
| 91:&nbsp;&nbsp;&nbsp;[
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 12
|
| 92:&nbsp;&nbsp;&nbsp;\
| 93:&nbsp;&nbsp;&nbsp;]
| 94:&nbsp;&nbsp;&nbsp;^
| 95:&nbsp;&nbsp;&nbsp;_
| 96:&nbsp;&nbsp;&nbsp;`
| 97:&nbsp;&nbsp;&nbsp;a
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 13
|
| 98:&nbsp;&nbsp;&nbsp;b
| 99:&nbsp;&nbsp;&nbsp;c
| 100:&nbsp;&nbsp;d
| 101:&nbsp;&nbsp;e
| 102:&nbsp;&nbsp;f
| 103:&nbsp;&nbsp;g
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 14
|
| 104:&nbsp;&nbsp;h
| 105:&nbsp;&nbsp;i
| 106:&nbsp;&nbsp;j
| 107:&nbsp;&nbsp;k
| 108:&nbsp;&nbsp;l
| 109:&nbsp;&nbsp;m
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 15
|
| 110:&nbsp;&nbsp;n
| 111:&nbsp;&nbsp;o
| 112:&nbsp;&nbsp;p
| 113:&nbsp;&nbsp;q
| 114:&nbsp;&nbsp;r
| 115:&nbsp;&nbsp;s
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 16
|
| 116:&nbsp;&nbsp;t
| 117:&nbsp;&nbsp;u
| 118:&nbsp;&nbsp;v
| 119:&nbsp;&nbsp;w
| 120:&nbsp;&nbsp;x
| 121:&nbsp;&nbsp;y
|- style="font-family:monospace"
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 17
|
| 122:&nbsp;&nbsp;z
| 123:&nbsp;&nbsp;{
| 124:&nbsp;&nbsp;|
| 125:&nbsp;&nbsp;}
| 126:&nbsp;&nbsp;~
| 127: Del
|}
 
 
Or, separating code and character into adjacent Excel cells:
 
<syntaxhighlight lang="lisp">asciiTable2
=LAMBDA(i,
IF(0 <> MOD(i, 1),
LET(
code, FLOOR.MATH(i),
IF(32 = code,
"Spc",
IF(127 = code,
"Del",
CHAR(code)
)
)
),
i
)
)(
SEQUENCE(16, 12, 32, 0.5)
)</syntaxhighlight>
 
{{Out}}
The formula in cell B2 defines an array which populates the whole '''B2:M17''' range:
 
{| class="wikitable"
|-
|||style="text-align:right; font-family:serif; font-style:italic; font-size:120%;"|fx
! colspan="13" style="text-align:left; vertical-align: bottom; font-family:Arial, Helvetica, sans-serif !important;"|=asciiTable2
|- style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff;"
|
| A
| B
| C
| D
| E
| F
| G
| H
| I
| J
| K
| L
| M
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 1
| Ascii table
|
|
|
|
|
|
|
|
|
|
|
|
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 2
|
| style="text-align:right; background-color:#cbcefb" | 32
| style="font-weight:bold" | Spc
| style="text-align:right" | 33
| style="font-weight:bold" | !
| style="text-align:right" | 34
| style="font-weight:bold" | "
| style="text-align:right" | 35
| style="font-weight:bold" | #
| style="text-align:right" | 36
| style="font-weight:bold" | $
| style="text-align:right" | 37
| style="font-weight:bold" | %
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 3
|
| style="text-align:right" | 38
| style="font-weight:bold" | &
| style="text-align:right" | 39
| style="font-weight:bold" | '
| style="text-align:right" | 40
| style="font-weight:bold" | (
| style="text-align:right" | 41
| style="font-weight:bold" | )
| style="text-align:right" | 42
| style="font-weight:bold" | *
| style="text-align:right" | 43
| style="font-weight:bold" | +
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 4
|
| style="text-align:right" | 44
| style="font-weight:bold" | ,
| style="text-align:right" | 45
| style="font-weight:bold" | -
| style="text-align:right" | 46
| style="font-weight:bold" | .
| style="text-align:right" | 47
| style="font-weight:bold" | /
| style="text-align:right" | 48
| style="font-weight:bold" | 0
| style="text-align:right" | 49
| style="font-weight:bold" | 1
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 5
|
| style="text-align:right" | 50
| style="font-weight:bold" | 2
| style="text-align:right" | 51
| style="font-weight:bold" | 3
| style="text-align:right" | 52
| style="font-weight:bold" | 4
| style="text-align:right" | 53
| style="font-weight:bold" | 5
| style="text-align:right" | 54
| style="font-weight:bold" | 6
| style="text-align:right" | 55
| style="font-weight:bold" | 7
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 6
|
| style="text-align:right" | 56
| style="font-weight:bold" | 8
| style="text-align:right" | 57
| style="font-weight:bold" | 9
| style="text-align:right" | 58
| style="font-weight:bold" | :
| style="text-align:right" | 59
| style="font-weight:bold" | ;
| style="text-align:right" | 60
| style="font-weight:bold" | <
| style="text-align:right" | 61
| style="font-weight:bold" | =
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 7
|
| style="text-align:right" | 62
| style="font-weight:bold" | >
| style="text-align:right" | 63
| style="font-weight:bold" | ?
| style="text-align:right" | 64
| style="font-weight:bold" | @
| style="text-align:right" | 65
| style="font-weight:bold" | A
| style="text-align:right" | 66
| style="font-weight:bold" | B
| style="text-align:right" | 67
| style="font-weight:bold" | C
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 8
|
| style="text-align:right" | 68
| style="font-weight:bold" | D
| style="text-align:right" | 69
| style="font-weight:bold" | E
| style="text-align:right" | 70
| style="font-weight:bold" | F
| style="text-align:right" | 71
| style="font-weight:bold" | G
| style="text-align:right" | 72
| style="font-weight:bold" | H
| style="text-align:right" | 73
| style="font-weight:bold" | I
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 9
|
| style="text-align:right" | 74
| style="font-weight:bold" | J
| style="text-align:right" | 75
| style="font-weight:bold" | K
| style="text-align:right" | 76
| style="font-weight:bold" | L
| style="text-align:right" | 77
| style="font-weight:bold" | M
| style="text-align:right" | 78
| style="font-weight:bold" | N
| style="text-align:right" | 79
| style="font-weight:bold" | O
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 10
|
| style="text-align:right" | 80
| style="font-weight:bold" | P
| style="text-align:right" | 81
| style="font-weight:bold" | Q
| style="text-align:right" | 82
| style="font-weight:bold" | R
| style="text-align:right" | 83
| style="font-weight:bold" | S
| style="text-align:right" | 84
| style="font-weight:bold" | T
| style="text-align:right" | 85
| style="font-weight:bold" | U
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 11
|
| style="text-align:right" | 86
| style="font-weight:bold" | V
| style="text-align:right" | 87
| style="font-weight:bold" | W
| style="text-align:right" | 88
| style="font-weight:bold" | X
| style="text-align:right" | 89
| style="font-weight:bold" | Y
| style="text-align:right" | 90
| style="font-weight:bold" | Z
| style="text-align:right" | 91
| style="font-weight:bold" | [
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 12
|
| style="text-align:right" | 92
| style="font-weight:bold" | \
| style="text-align:right" | 93
| style="font-weight:bold" | ]
| style="text-align:right" | 94
| style="font-weight:bold" | ^
| style="text-align:right" | 95
| style="font-weight:bold" | _
| style="text-align:right" | 96
| style="font-weight:bold" | `
| style="text-align:right" | 97
| style="font-weight:bold" | a
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 13
|
| style="text-align:right" | 98
| style="font-weight:bold" | b
| style="text-align:right" | 99
| style="font-weight:bold" | c
| style="text-align:right" | 100
| style="font-weight:bold" | d
| style="text-align:right" | 101
| style="font-weight:bold" | e
| style="text-align:right" | 102
| style="font-weight:bold" | f
| style="text-align:right" | 103
| style="font-weight:bold" | g
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 14
|
| style="text-align:right" | 104
| style="font-weight:bold" | h
| style="text-align:right" | 105
| style="font-weight:bold" | i
| style="text-align:right" | 106
| style="font-weight:bold" | j
| style="text-align:right" | 107
| style="font-weight:bold" | k
| style="text-align:right" | 108
| style="font-weight:bold" | l
| style="text-align:right" | 109
| style="font-weight:bold" | m
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 15
|
| style="text-align:right" | 110
| style="font-weight:bold" | n
| style="text-align:right" | 111
| style="font-weight:bold" | o
| style="text-align:right" | 112
| style="font-weight:bold" | p
| style="text-align:right" | 113
| style="font-weight:bold" | q
| style="text-align:right" | 114
| style="font-weight:bold" | r
| style="text-align:right" | 115
| style="font-weight:bold" | s
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 16
|
| style="text-align:right" | 116
| style="font-weight:bold" | t
| style="text-align:right" | 117
| style="font-weight:bold" | u
| style="text-align:right" | 118
| style="font-weight:bold" | v
| style="text-align:right" | 119
| style="font-weight:bold" | w
| style="text-align:right" | 120
| style="font-weight:bold" | x
| style="text-align:right" | 121
| style="font-weight:bold" | y
|-
| style="text-align:center; font-family:Arial, Helvetica, sans-serif !important; background-color:#000000; color:#ffffff" | 17
|
| style="text-align:right" | 122
| style="font-weight:bold" | z
| style="text-align:right" | 123
| style="font-weight:bold" | {
| style="text-align:right" | 124
| style="font-weight:bold" | |
| style="text-align:right" | 125
| style="font-weight:bold" | }
| style="text-align:right" | 126
| style="font-weight:bold" | ~
| style="text-align:right" | 127
| style="font-weight:bold" | Del
|}
 
=={{header|Factor}}==
===Idiomatic version===
{{Works with|Factor|0.98}}
<langsyntaxhighlight lang="factor">USING: combinators formatting io kernel math math.ranges
pair-rocket sequences ;
IN: rosetta-code.ascii-table
Line 1,170 ⟶ 2,786:
: print-ascii-table ( -- ) 16 <iota> [ print-row ] each ;
 
MAIN: print-ascii-table</langsyntaxhighlight>
===Go translation===
{{Trans|Go}}
{{Works with|Factor|0.98}}
<langsyntaxhighlight lang="factor">USING: combinators formatting io kernel math math.ranges
pair-rocket sequences ;
IN: rosetta-code.ascii-table
Line 1,192 ⟶ 2,808:
;
 
MAIN: main</langsyntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 1,213 ⟶ 2,829:
=={{header|Forth}}==
Idiomatic Forth version is factored differently than conventional languages, allowing each factor to be tested independently at the console, bottom up.
<langsyntaxhighlight lang="forth">DECIMAL
: ###: ( c -- ) 3 .R ." : " ;
 
Line 1,229 ⟶ 2,845:
 
: ASCII.TABLE ( -- )
16 0 DO 113 I + 32 I + .ROW LOOP ;</langsyntaxhighlight>
 
Test Output at the console
<langsyntaxhighlight lang="forth">ASCII.TABLE
32: spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
Line 1,248 ⟶ 2,864:
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: del ok</lang>
</syntaxhighlight>
 
=={{header|Free Pascal}}==
 
=={{transheader|GoFortran}}==
{{works with|f2c|20160102}}
{{works with|gfortran|8.3.0}}
The dollar sign $ in the format string isn't part of the standard but is a common extension.
ACHAR may not be part of the standard, either.
<syntaxhighlight lang="fortran"> PROGRAM ASCTBL ! show the ASCII characters from 32-127
IMPLICIT NONE
INTEGER I, J
CHARACTER*3 H
 
10 FORMAT (I3, ':', A3, ' ', $)
<lang pascal>program ShowASCIITable;
20 FORMAT ()
DO J = 0, 15, +1
DO I = 32+J, 127, +16
IF (I > 32 .AND. I < 127) THEN
H = ' ' // ACHAR(I) // ' '
ELSE IF (I .EQ. 32) THEN
H = 'Spc'
ELSE IF (I .EQ. 127) THEN
H = 'Del'
ELSE
STOP 'bad value of i'
END IF
PRINT 10, I, H
END DO
PRINT 20
END DO
 
END
// https://rosettacode.org/wiki/Show_Ascii_table
</syntaxhighlight>
output:
<pre> 32:Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127:Del
</pre>
 
 
uses
=={{header|FreeBASIC}}==
sysutils, strutils;
 
<syntaxhighlight lang="freebasic">function getasc( n as unsigned byte ) as string
if n=32 then return "Spc"
if n=127 then return "Del"
return chr(n)+" "
end function
 
function padto( i as ubyte, j as integer ) as string
return wspace(i-len(str(j)))+str(j)
end function
 
dim as unsigned byte r, c, n
dim as string disp
 
for r = 0 to 15
disp = ""
for c = 0 to 5
n = 32 + 6*r + c
disp = disp + padto(3, n) + ": " + getasc(n) + " "
next c
print disp
next r
</syntaxhighlight>
 
{{out}}
<pre> 32: Spc 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
</pre>
 
 
=={{header|Free Pascal}}==
 
<syntaxhighlight lang="pascal">// The FPC (FreePascal compiler) discards the program header
// (except in ISO-compliant “compiler modes”).
program showAsciiTable(output);
 
const
columnsTotal = 6;
 
type
// The hash indicates a char-data type.
asciiCharacter = #32..#127;
asciiCharacters = set of asciiCharacter;
 
var
character: asciiCharacter;
i, j: Integer;
characters: asciiCharacters;
s: String;
column, line: integer;
begin
// characters needs to be initialized,
i := 0;
// because the next `include` below
j := 0;
// will _read_ the value `characters`.
s := '';
// Reading _unintialized_ values, however,
// is considered bad practice in Pascal.
characters := [];
// `div` denotes integer division in Pascal,
// that means the result will be an _integer_-value.
line := (ord(high(asciiCharacter)) - ord(low(asciiCharacter)))
div columnsTotal + 1;
// Note: In Pascal for-loop limits are _inclusive_.
for column := 0 to columnsTotal do
begin
// This is equivalent to
// characters := characters + […];
// i.e. the union of two sets.
include(characters, chr(ord(low(asciiCharacter)) + column * line));
end;
for line := line downto 1 do
begin
// the for..in..do statement is an Extended Pascal extension
for character in characters do
begin
// `:6` specifies minimum width of argument
// [only works for write/writeLn/writeStr]
write(ord(character):6, ' : ', character);
end;
// emit proper newline character on `output`
writeLn;
// `characters` is evaluated prior entering the loop,
// not every time an iteration finished.
for character in characters do
begin
// These statements are equivalent to
// characters := characters + [character];
// characters := characters - [succ(character)];
// respectively, but shorter to write,
// i.e. less susceptible to spelling mistakes.
exclude(characters, character);
include(characters, succ(character));
end;
end;
end.</syntaxhighlight>
 
{{out}}
for i := 0 to 15 do begin
<pre> 32 : 48 : 0 64 : @ 80 : P 96 : ` 112 : p
j := 32 + i;
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
while j < 128 do begin
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
case j of
35 : # 32 51 : s3 67 := 'Spc';C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
127: s := 'Del';
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
otherwise s := chr(j);
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
end;
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
write(format('%s : %s', [padLeft(IntToStr(j), 3), padRight(s, 5)]));
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
Inc(j, 16);
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
end;
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
writeln(' ');
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
end;
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 :
</pre>
 
=={{header|Frink}}==
end.</lang>
<syntaxhighlight lang="frink">a = ["32 Space"]
for i = 33 to 126
a.push["$i " + char[i]]
a.push["127 Delete"]
 
println[formatTableBoxed[columnize[a,8].transpose[], "left"]]</syntaxhighlight>
{{out}}
<pre>
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
┌────────┬────┬────┬────┬────┬────┬────┬────┬─────┬─────┬─────┬──────────┐
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
│32 Space│40 (│48 0│56 8│64 @│72 H│80 P│88 X│96 ` │104 h│112 p│120 x │
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
│33 ! │41 )│49 1│57 9│65 A│73 I│81 Q│89 Y│97 a │105 i│113 q│121 y │
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
│34 " │42 *│50 2│58 :│66 B│74 J│82 R│90 Z│98 b │106 j│114 r│122 z │
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
│35 # │43 +│51 3│59 ;│67 C│75 K│83 S│91 [│99 c │107 k│115 s│123 { │
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
│36 $ │44 ,│52 4│60 <│68 D│76 L│84 T│92 \│100 d│108 l│116 t│124 | │
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
│37 % │45 -│53 5│61 =│69 E│77 M│85 U│93 ]│101 e│109 m│117 u│125 } │
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
│38 & │46 .│54 6│62 >│70 F│78 N│86 V│94 ^│102 f│110 n│118 v│126 ~ │
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
├────────┼────┼────┼────┼────┼────┼────┼────┼─────┼─────┼─────┼──────────┤
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
│39 ' │47 /│55 7│63 ?│71 G│79 O│87 W│95 _│103 g│111 o│119 w│127 Delete│
└────────┴────┴────┴────┴────┴────┴────┴────┴─────┴─────┴─────┴──────────┘
</pre>
 
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Show_ASCII_table}}
 
'''Solution'''
 
[[File:Fōrmulæ - Show ASCII table 01.png]]
 
[[File:Fōrmulæ - Show ASCII table 02.png]]
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
include "NSLog.incl"
 
local fn ASCIITable as CFStringRef
NSinteger i
CFStringRef temp
CFMutableStringRef mutStr = fn MutableStringWithCapacity( 0 )
for i = 32 to 127
temp = fn StringWithFormat( @"%c", i )
if i == 32 then temp = @"Spc"
if i == 127 then temp = @"Del"
MutableStringAppendString( mutStr, fn StringWithFormat( @"%-1d : %@\n", i, temp ) )
next
CFArrayRef colArr = fn StringComponentsSeparatedByString( mutStr, @"\n" )
MutableStringSetString( mutStr, @"" )
for i = 0 to 15
ObjectRef col0 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i ) )
ObjectRef col1 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i + 16 ) )
ObjectRef col2 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i + 32 ) )
ObjectRef col3 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i + 48 ) )
ObjectRef col4 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i + 64 ) )
ObjectRef col5 = fn StringUTF8String( fn ArrayObjectAtIndex( colArr, i + 80 ) )
MutableStringAppendString( mutStr, fn StringWithFormat( @"%-10s %-10s %-10s %-10s %-10s %-10s\n", col0, col1, col2, col3, col4, col5 ) )
next
end fn = fn StringWithString( mutStr )
 
NSLog( @"%@", fn ASCIITable )
 
HandleEvents
</syntaxhighlight>
{{output}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|Go}}==
<langsyntaxhighlight lang="go">package main
 
import "fmt"
Line 1,322 ⟶ 3,157:
fmt.Println()
}
}</langsyntaxhighlight>
 
{{out}}
Line 1,341 ⟶ 3,176:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
 
=={{header|Groovy}}==
{{trans|Java}}
<syntaxhighlight lang="groovy">class ShowAsciiTable {
static void main(String[] args) {
for (int i = 32; i <= 127; i++) {
if (i == 32 || i == 127) {
String s = i == 32 ? "Spc" : "Del"
printf("%3d: %s ", i, s)
} else {
printf("%3d: %c ", i, i)
}
if ((i - 1) % 6 == 0) {
println()
}
}
}
}</syntaxhighlight>
{{out}}
<pre> 32: Spc 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 </pre>
 
=={{header|Haskell}}==
<syntaxhighlight lang ="haskell">import Data.ListChar (intercalate, transposechr)
import Data.CharList (chrtranspose)
import Data.List.Split (chunksOf)
import Text.Printf (printf)
 
----------------------- ASCII TABLE ----------------------
 
asciiTable :: String
asciiTable =
unlines $
(justifyLeft 12 '(printf '"%-12s" =<<) <$>
<$> transpose
transpose (chunksOf 16 $ asciiEntry <$> [32 .. 127])
(chunksOf 16 $ asciiEntry <$> [32 .. 127])
 
main :: IO ()
main = putStrLn asciiTable
 
-------------------------------------------------------------
asciiEntry :: Int -> String
asciiEntry n =
let| null k = asciiName nk
| otherwise = concat [printf "%3d" n, " : ", k]
in case k of
where
[] -> k
k = asciiName n
_ -> concat [justifyRight 4 ' ' (show n), " : ", k]
 
asciiName :: Int -> String
Line 1,371 ⟶ 3,243:
| otherwise = [chr n]
 
chunksOf :: Int -> [a] -> [[a]]
chunksOf k = go
where
go t =
case splitAt k t of
(a, b)
| null a -> []
| otherwise -> a : go b
 
--------------------------- TEST -------------------------
justifyLeft, justifyRight :: Int -> Char -> String -> String
main :: IO ()
justifyLeft n c s = take n (s ++ replicate n c)
main = putStrLn asciiTable</syntaxhighlight>
 
justifyRight n c s = drop (length s) (replicate n c ++ s)</lang>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 1,402 ⟶ 3,265:
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{headerHeader|IS-BASICInsitux}}==
<syntaxhighlight lang="insitux">
<lang IS-BASIC>100 TEXT 80
(-> (for i (range 16)
110 FOR R=0 TO 15
120 FOR C=32+R TO 112 j (range (+R STEPi 32) 128 16)
(let k (match j 32 "Spc" 127 "Del" (str (char-code j) " ")))
130 PRINT USING "###":C;:PRINT ": ";CHR$(C),
(strn ((< j 100) " ") j " : " k))
140 NEXT
(partition 6)
150 PRINT
(map (join " "))
160 NEXT</lang>
(join "\n"))
</syntaxhighlight>
{{out}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|J}}==
<pre> ;"1 (_9{.":,': ',ucp)each 32+|:i.6 16
a. is the 256 ASCII character set. We'll do a bit of work to make it pretty as the other examples.
32: 48: 0 64: @ 80: P 96: ` 112: p
<pre> 32}._129}.a.
33: ! 49: 1 65: A 81: Q 97: a 113: q
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
34: " 50: 2 66: B 82: R 98: b 114: r
 
35: # 51: 3 67: C 83: S 99: c 115: s
NB. A are the decimal ASCII values
[A =36: 10$ |."1 ] 12 "52: |4 68: _16D [\ 32 }. i.84: T 100: d 116: 128t
32 37: % 53: 485 69: E 85: 64 80 96 112 U 101: e 117: u
33 38: & 54: 496 70: F 86: 65 81 97 113 V 102: f 118: v
34 39: ' 55: 507 71: G 87: 66 82 98 114 W 103: g 119: w
35 40: ( 56: 518 72: H 88: 67 83 99 115 X 104: h 120: x
36 41: ) 57: 529 73: I 89: 68 84 100 116 Y 105: i 121: y
37 42: * 58: 53: 74: J 90: 69 85 101 117 Z 106: j 122: z
38 43: + 59: 54; 75: K 91: 70 86 102 118 [ 107: k 123: {
39 44: , 60: 55< 76: L 92: 71 87 103 119 \ 108: l 124: |
40 45: - 61: 56= 77: M 93: 72 88 104 120 ] 109: m 125: }
41 46: . 62: 57> 78: N 94: 73 89 105 121 ^ 110: n 126: ~
42 47: / 63: 58? 79: O 95: 74 90 106 122 _ 111: o 127: 
</pre>
43 59 75 91 107 123
44 60 76 92 108 124
45 61 77 93 109 125
46 62 78 94 110 126
47 63 79 95 111 127
 
NB. B are the corresponding ASCII characters
[B =: |:_16[\32}._128}.a.
0@P`p
!1AQaq
"2BRbr
#3CScs
$4DTdt
%5EUeu
&6FVfv
'7GWgw
(8HXhx
)9IYiy
*:JZjz
+;K[k{
,<L\l|
-=M]m}
.>N^n~
/?O_o�
 
Note that ascii 127 does not have a standard representation, so its appearance will depend on a variety of issues.
NB. stuff the characters into the text array of numbers
B [`((4 12 p. i. 6)"_)`]}"1 A
32 48 0 64 @ 80 P 96 ` 112 p
33 ! 49 1 65 A 81 Q 97 a 113 q
34 " 50 2 66 B 82 R 98 b 114 r
35 # 51 3 67 C 83 S 99 c 115 s
36 $ 52 4 68 D 84 T 100 d 116 t
37 % 53 5 69 E 85 U 101 e 117 u
38 & 54 6 70 F 86 V 102 f 118 v
39 ' 55 7 71 G 87 W 103 g 119 w
40 ( 56 8 72 H 88 X 104 h 120 x
41 ) 57 9 73 I 89 Y 105 i 121 y
42 * 58 : 74 J 90 Z 106 j 122 z
43 + 59 ; 75 K 91 [ 107 k 123 {
44 , 60 < 76 L 92 \ 108 l 124 |
45 - 61 = 77 M 93 ] 109 m 125 }
46 . 62 > 78 N 94 ^ 110 n 126 ~
47 / 63 ? 79 O 95 _ 111 o 127 � </pre>
 
=={{header|Java}}==
<langsyntaxhighlight lang="java">
public class ShowAsciiTable {
 
Line 1,493 ⟶ 3,337:
 
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 1,512 ⟶ 3,356:
116: t 117: u 118: v 119: w 120: x 121: y
122: z 123: { 124: | 125: } 126: ~ 127: Del
</pre>
You could also do this:<br />
<syntaxhighlight lang="java">
String printASCIITable() {
StringBuilder string = new StringBuilder();
String newline = System.lineSeparator();
string.append("dec hex binary oct char").append(newline);
for (int decimal = 32; decimal <= 127; decimal++) {
string.append(format(decimal));
switch (decimal) {
case 32 -> string.append("[SPACE]");
case 127 -> string.append("[DELETE]");
default -> string.append((char) decimal);
}
string.append(newline);
}
return string.toString();
}
 
String format(int value) {
return "%-3d %01$-2x %7s %01$-3o ".formatted(value, Integer.toBinaryString(value));
}
</syntaxhighlight>
<pre>
dec hex binary oct char
32 20 100000 40 [SPACE]
33 21 100001 41 !
34 22 100010 42 "
35 23 100011 43 #
36 24 100100 44 $
37 25 100101 45 %
38 26 100110 46 &
39 27 100111 47 '
40 28 101000 50 (
41 29 101001 51 )
42 2a 101010 52 *
43 2b 101011 53 +
44 2c 101100 54 ,
45 2d 101101 55 -
46 2e 101110 56 .
47 2f 101111 57 /
48 30 110000 60 0
49 31 110001 61 1
50 32 110010 62 2
51 33 110011 63 3
52 34 110100 64 4
53 35 110101 65 5
54 36 110110 66 6
55 37 110111 67 7
56 38 111000 70 8
57 39 111001 71 9
58 3a 111010 72 :
59 3b 111011 73 ;
60 3c 111100 74 <
61 3d 111101 75 =
62 3e 111110 76 >
63 3f 111111 77 ?
64 40 1000000 100 @
65 41 1000001 101 A
66 42 1000010 102 B
67 43 1000011 103 C
68 44 1000100 104 D
69 45 1000101 105 E
70 46 1000110 106 F
71 47 1000111 107 G
72 48 1001000 110 H
73 49 1001001 111 I
74 4a 1001010 112 J
75 4b 1001011 113 K
76 4c 1001100 114 L
77 4d 1001101 115 M
78 4e 1001110 116 N
79 4f 1001111 117 O
80 50 1010000 120 P
81 51 1010001 121 Q
82 52 1010010 122 R
83 53 1010011 123 S
84 54 1010100 124 T
85 55 1010101 125 U
86 56 1010110 126 V
87 57 1010111 127 W
88 58 1011000 130 X
89 59 1011001 131 Y
90 5a 1011010 132 Z
91 5b 1011011 133 [
92 5c 1011100 134 \
93 5d 1011101 135 ]
94 5e 1011110 136 ^
95 5f 1011111 137 _
96 60 1100000 140 `
97 61 1100001 141 a
98 62 1100010 142 b
99 63 1100011 143 c
100 64 1100100 144 d
101 65 1100101 145 e
102 66 1100110 146 f
103 67 1100111 147 g
104 68 1101000 150 h
105 69 1101001 151 i
106 6a 1101010 152 j
107 6b 1101011 153 k
108 6c 1101100 154 l
109 6d 1101101 155 m
110 6e 1101110 156 n
111 6f 1101111 157 o
112 70 1110000 160 p
113 71 1110001 161 q
114 72 1110010 162 r
115 73 1110011 163 s
116 74 1110100 164 t
117 75 1110101 165 u
118 76 1110110 166 v
119 77 1110111 167 w
120 78 1111000 170 x
121 79 1111001 171 y
122 7a 1111010 172 z
123 7b 1111011 173 {
124 7c 1111100 174 |
125 7d 1111101 175 }
126 7e 1111110 176 ~
127 7f 1111111 177 [DELETE]
</pre>
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang="javascript">(() => {
 
"use strict";
 
// ------------------- ASCII TABLE -------------------
 
// asciiTable :: String
const asciiTable = () =>
unlinestranspose(
mapchunksOf(xs => concat16)(
mapenumFromTo(justifyLeft32)(12, ' '127),
xs.map(asciiEntry)
)
),
transpose(
chunksOf(
16,
map(asciiEntry,
enumFromTo(32, 127)
)
)
)
)
);
.map(
xs => xs.map(justifyLeft(12)(" "))
.join("")
)
.join("\n");
 
// asciiEntry :: Int -> String
const asciiEntry = n => {
const k = asciiName(n);
 
return '' === k ? (
return "" === k ''? (
""
) : (justifyRight(4, ' ', n.toString()) + ' : ' + k);
) : `${justifyRight(4)(" ")(n.toString())} : ${k}`;
};
 
Line 1,547 ⟶ 3,512:
const asciiName = n =>
32 > n || 127 < n ? (
''""
) : 32 === n ? (
'"Spc'"
) : 127 === n ? (
'"Del'"
) : chr(n);
 
// GENERIC FUNCTIONS ------------------ GENERIC FUNCTIONS ----------------
 
// chunksOf :: Int -> [a] -> [[a]]
const chunksOf = (n, xs) =>
xs.reduce((a, _, i, xs) =>
i % n ? a : a.concat([xs.slice(i, i + n)]), []);
 
// chr :: Int -> Char
const chr = String.fromCodePoint;x =>
// The character at unix code-point x.
String.fromCodePoint(x);
 
 
// comparing :: (a -> b) -> (a -> a -> Ordering)
const// comparingchunksOf =:: fInt =-> [a] -> [[a]]
const chunksOf = (x, y)n => {
// xs split into constsublists of length n.
// The last sublist will be short if a = f(x),n
// does not evenly divide the length of bxs = f(y);.
const go = xs return a < b ? -1 : (a => b ? 1 : 0);{
const chunk = xs.slice(0, n);
 
return 0 < chunk.length ? (
[chunk].concat(
go(xs.slice(n))
)
) : [];
};
 
// concat :: [[a]] ->return [a]go;
};
// concat :: [String] -> String
const concat = xs =>
0 < xs.length ? (() => {
const unit = 'string' !== typeof xs[0] ? (
[]
) : '';
return unit.concat.apply(unit, xs);
})() : [];
 
// concatMap :: (a -> [b]) -> [a] -> [b]
const concatMap = (f, xs) =>
0 < xs.length ? (() => {
const unit = 'string' !== typeof xs ? (
[]
) : '';
return unit.concat.apply(unit, xs.map(f))
})() : [];
 
// enumFromTo :: Int -> Int -> [Int]
const enumFromTo = (m, n) =>
mn <=> n ? iterateUntilArray.from({
xlength: =>1 + n <=- x,m
}, (_, xi) => 1m + x,i);
m
) : [];
 
// iterateUntil :: (a -> Bool) -> (a -> a) -> a -> [a]
const iterateUntil = (p, f, x) => {
const vs = [x];
let h = x;
while (!p(h))(h = f(h), vs.push(h));
return vs;
};
 
// justifyLeft :: Int -> Char -> String -> String
const justifyLeft = (n, cFiller) => strText =>
// The string s, followed by enough padding (with
n > strText.length ? (
// the character c) to reach the string length n.
(strText + cFiller.repeat(n))
c => s => n > s.substr(0,length n)? (
) : strText; s.padEnd(n, c)
) : s;
 
 
// justifyRight :: Int -> Char -> String -> String
const justifyRight = (n, cFiller, strText) =>
// The string s, preceded by enough padding (with
n > strText.length ? (
// the character c) to reach the string length n.
(cFiller.repeat(n) + strText)
c => s => .sliceBoolean(-ns) ? (
) : strText; s.padStart(n, c)
) : "";
 
// length :: [a] -> Int
const length = xs => xs.length;
 
// map :: (a -> b) -> [a] -> [b]
const map = (f, xs) => xs.map(f);
 
// maximumBy :: (a -> a -> Ordering) -> [a] -> a
const maximumBy = (f, xs) =>
0 < xs.length ? (
xs.slice(1)
.reduce((a, x) => 0 < f(x, a) ? x : a, xs[0])
) : undefined;
 
// replicate :: Int -> a -> [a]
const replicate = (n, x) =>
Array.from({
length: n
}, () => x);
 
// transpose :: [[a]] -> [[a]]
const transpose = tblrows => {
// The columns of the input transposed
const
// into new gaps = replicate(rows.
// This version assumes input rows of even length(maximumBy(comparing(length), tbl)), [].
0 < rows.length ? ),rows[0].map(
rows(x, = map(xsi) => xsrows.concatflatMap(gaps.slice(xs.length)), tbl);
return map( v => v[i]
(_, col) => concatMap(row => [row[col]], rows),
) : rows[0];
);
};
 
// unlines :: [String] -> String
const unlines = xs => xs.join('\n');
 
// MAIN -----------------------------------------------
return asciiTable();
})();</langsyntaxhighlight>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 1,679 ⟶ 3,605:
 
=={{header|Jsish}}==
<langsyntaxhighlight lang="javascript">#!/usr/bin/env jsish
 
/* Show ASCII table, -showAll true to include control codes */
Line 1,745 ⟶ 3,671:
015 SI 031 US 047 / 063 ? 079 O 095 _ 111 o 127 DEL
=!EXPECTEND!=
*/</langsyntaxhighlight>
{{out}}
<pre>prompt$ jsish -u showASCIITable.jsi
Line 1,768 ⟶ 3,694:
046 . 062 > 078 N 094 ^ 110 n 126 ~
047 / 063 ? 079 O 095 _ 111 o 127 DEL</pre>
 
=={{header|jq}}==
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
 
The following program generalizes the task to produce a table for wide stretches of Unicode characters, not just 32 .. 127. In addition, the functions for producing both row-wise and column-wise tables are provided and illustrated.
<syntaxhighlight lang="jq">
# Pretty printing
def lpad($len): tostring | ($len - length) as $l | (" " * $l)[:$l] + .;
 
def nwise($n):
def n: if length <= $n then . else .[0:$n] , (.[$n:] | n) end;
n;
 
def table($ncols; $colwidth):
nwise($ncols) | map(lpad($colwidth)) | join(" ");
 
# transposed table
def ttable($rows):
[nwise($rows)] | transpose[] | join(" ");
 
# Representation of control characters, etc
def humanize:
def special:
{ "0": "NUL", "7": "BEL", "8": "BKS",
"9": "TAB", "10": "LF ", "13": "CR ",
"27": "ESC", "127": "DEL", "155": "CSI" };
 
if . < 32 or . == 127 or . == 155
then (special[tostring] // "^" + ([64+.]|implode))
elif . > 127 and . < 160 then "\\\(.+72|tostring)"
else [.] | implode
end
| lpad(4) ;
</syntaxhighlight>
===Base Task===
<syntaxhighlight lang="jq"># produce a flat array
def prepare($m;$n):
[range($m; $n) | "\(lpad(7)): \(humanize)" ];
 
# Row-wise presentation of 32 through 127 in 6 columns
prepare(32;128) | table(6; 10)
 
# Column-wise with 16 rows would be produced by:
# prepare(32;128) | ttable(16)
</syntaxhighlight>
{{out}}
<pre>
32 : 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
</pre>
 
===Column-wise table of 128..255===
<syntaxhighlight lang="jq">
# Column-wise representation with 16 rows
(prepare(128;256) | ttable(16))
</syntaxhighlight>
{{out}}
<pre>
128: \200 144: \216 160:   176: ° 192: À 208: Ð 224: à 240: ð
129: \201 145: \217 161: ¡ 177: ± 193: Á 209: Ñ 225: á 241: ñ
130: \202 146: \218 162: ¢ 178: ² 194: Â 210: Ò 226: â 242: ò
131: \203 147: \219 163: £ 179: ³ 195: Ã 211: Ó 227: ã 243: ó
132: \204 148: \220 164: ¤ 180: ´ 196: Ä 212: Ô 228: ä 244: ô
133: \205 149: \221 165: ¥ 181: µ 197: Å 213: Õ 229: å 245: õ
134: \206 150: \222 166: ¦ 182: ¶ 198: Æ 214: Ö 230: æ 246: ö
135: \207 151: \223 167: § 183: · 199: Ç 215: × 231: ç 247: ÷
136: \208 152: \224 168: ¨ 184: ¸ 200: È 216: Ø 232: è 248: ø
137: \209 153: \225 169: © 185: ¹ 201: É 217: Ù 233: é 249: ù
138: \210 154: \226 170: ª 186: º 202: Ê 218: Ú 234: ê 250: ú
139: \211 155: CSI 171: « 187: » 203: Ë 219: Û 235: ë 251: û
140: \212 156: \228 172: ¬ 188: ¼ 204: Ì 220: Ü 236: ì 252: ü
141: \213 157: \229 173: ­ 189: ½ 205: Í 221: Ý 237: í 253: ý
142: \214 158: \230 174: ® 190: ¾ 206: Î 222: Þ 238: î 254: þ
143: \215 159: \231 175: ¯ 191: ¿ 207: Ï 223: ß 239: ï 255: ÿ
</pre>
 
=={{header|Julia}}==
===Base Task===
<langsyntaxhighlight lang="julia">for i in 32:127
c= i== 0 ? "NUL" : i== 7 ? "BEL" : i== 8 ? "BKS" : i== 9 ? "TAB" :
i==10 ? "LF " : i==13 ? "CR " : i==27 ? "ESC" : i==155 ? "CSI" : "|$(Char(i))|"
print("$(lpad(i,3)) $(string(i,base=16,pad=2)) $c")
(i&7)==7 ? println() : print(" ")
end</langsyntaxhighlight>{{out}}
<pre>
32 20 | | 33 21 |!| 34 22 |"| 35 23 |#| 36 24 |$| 37 25 |%| 38 26 |&| 39 27 |'|
Line 1,795 ⟶ 3,811:
{{works with|Julia|1.0}}
 
<langsyntaxhighlight lang="julia">for i in 0:255
c= i== 0 ? "NUL" : i== 7 ? "BEL" : i== 8 ? "BKS" : i== 9 ? "TAB" :
i==10 ? "LF " : i==13 ? "CR " : i==27 ? "ESC" : i==155 ? "CSI" : "|$(Char(i))|"
print("$(lpad(i,3)) $(string(i,base=16,pad=2)) $c")
(i&7)==7 ? println() : print(" ")
end</langsyntaxhighlight>
{{out}}
<pre> 0 00 NUL 1 01 |☺| 2 02 |☻| 3 03 |♥| 4 04 |♦| 5 05 |♣| 6 06 |♠| 7 07 BEL
Line 1,838 ⟶ 3,854:
This version draws a more fancy table, positioning the items on the console monitor with ANSI control sequences:
 
<langsyntaxhighlight lang="julia">print("\e[2J") # clear screen
print("""
0 1 2 3 4 5 6 7 8 9 A B C D E F
Line 1,862 ⟶ 3,878:
6<i<11 || i==155 || i==173 || print("\e[$r;$(c)H$(Char(i))")
end
print("\e[54;1H")</langsyntaxhighlight>
{{out}}
<pre> 0 1 2 3 4 5 6 7 8 9 A B C D E F
Line 1,917 ⟶ 3,933:
 
A similar output can be produced without ANSI control sequences, just filling up a huge string and printing it. Below is a general Object (struct) and the corresponding methods to draw a table of arbitrary shape in the console. It is the Julia way of OOP. The Table structure holds the relevant data and the constructor. The Base.iterate function extends the general iterate function, and allows using the field names in a function, w/o prefixing them with "<structName>." The function prt() fills up a string with data, formatting spaces and new-lines, and prints it to the console.
<langsyntaxhighlight lang="julia">#= CONSOLE TABLES =============================================================
rn: nrows, rh: height of rows
cn: ncols, cw: width of columns
Line 1,964 ⟶ 3,980:
end
println("\n$t\n")
end</langsyntaxhighlight>
Using these is simple, only provide the data, and prt it.
<langsyntaxhighlight lang="julia">Tbl = Table(16,2,16,3, 2,3) # construct table
Tbl.CH[1,:] = string.(0:15,base=16) # Column headers
Tbl.RH[:,2] = string.(0:15,base=16) # Row headers
Line 1,972 ⟶ 3,988:
Tbl.T[i>>4+1,i&15+1,1:2]=["$i",i∈(0,7,8,9,10,13,27,155) ? "" : "$(Char(i))"]
end
prt(Tbl) # format and print table on console</langsyntaxhighlight>
 
=={{header|K}}==
{{works with|ngn/k}}
<syntaxhighlight lang=K>`0:"\n"/" "/'+6 16#{-6$($x),-2$`c$x}'32+!96
32 48 0 64 @ 80 P 96 ` 112 p
33 ! 49 1 65 A 81 Q 97 a 113 q
34 " 50 2 66 B 82 R 98 b 114 r
35 # 51 3 67 C 83 S 99 c 115 s
36 $ 52 4 68 D 84 T 100 d 116 t
37 % 53 5 69 E 85 U 101 e 117 u
38 & 54 6 70 F 86 V 102 f 118 v
39 ' 55 7 71 G 87 W 103 g 119 w
40 ( 56 8 72 H 88 X 104 h 120 x
41 ) 57 9 73 I 89 Y 105 i 121 y
42 * 58 : 74 J 90 Z 106 j 122 z
43 + 59 ; 75 K 91 [ 107 k 123 {
44 , 60 < 76 L 92 \ 108 l 124 |
45 - 61 = 77 M 93 ] 109 m 125 }
46 . 62 > 78 N 94 ^ 110 n 126 ~
47 / 63 ? 79 O 95 _ 111 o 127</syntaxhighlight>
 
=={{header|Kotlin}}==
{{trans|Go}}
<langsyntaxhighlight lang="scala">// Version 1.2.60
 
fun main(args: Array<String>) {
Line 1,990 ⟶ 4,026:
println()
}
}</langsyntaxhighlight>
 
{{output}}
Line 2,009 ⟶ 4,045:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|Lambdatalk}}==
<syntaxhighlight lang="scheme">
{def format
{lambda {:i :c}
{if {< :i 100}
then {span {@ style="color:white;"}.}:i : :c
else :i : :c}}}
-> format
 
{S.map
{lambda {:i}
{div}
{S.map {lambda {:i}
{if {= :i 32} then {format :i {span {@ style="color:#fff;"}.}}
else {if {= :i 123} then {format :i left brace}
else {if {= :i 125} then {format :i right brace}
else {if {= :i 127} then {format :i del}
else {format :i {code2char :i}}}}}}}
{S.serie {+ 32 :i} 127 16}}}
{S.serie 0 15}}
 
32 : 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : left brace
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : right brace
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : del
 
</syntaxhighlight>
 
 
 
=={{header|Lang}}==
<syntaxhighlight lang="lang">
$i
repeat($[i], 16) {
$j $= $i + 32
while($j < 128) {
if($j == 32) {
$val = SPC
}elif($j == 127) {
$val = DEL
}else {
$val = fn.char($j)
}
fn.printf(%4d : %-3s, $j, $val)
$j += 16
}
fn.println()
}
</syntaxhighlight>
 
{{out}}
<pre>
32 : SPC 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : DEL
</pre>
 
=={{header|langur}}==
{{trans|Go}}
<syntaxhighlight lang="langur">for .i of 16 {
{{works with|langur|0.6.8}}
<lang langur>for .i of 16 {
for .j = 31 + .i ; .j < 128 ; .j += 16 {
val .L = givenswitch(.j; 32: "spc"; 127: "del"; cp2s .j)
write $"\{{.j:3;}} : \{{.L:-4;}}"
}
writeln()
}
}</lang>
</syntaxhighlight>
 
{{out}}
Line 2,038 ⟶ 4,159:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : del </pre>
 
=={{header|Locomotive Basic}}==
 
<syntaxhighlight lang="locobasic">10 mode 1:defint a-z
20 for x=1 to 6
30 for y=1 to 16
40 n=16*(x-1)+y+31
50 locate 6*(x-1)+1,y
60 print using "###";n;
70 print " ";chr$(n);
80 next
90 next</syntaxhighlight>
 
{{out}}
<pre> 32 48 0 64 @ 80 P 96 ` 112 p
33 ! 49 1 65 A 81 Q 97 a 113 q
34 " 50 2 66 B 82 R 98 b 114 r
35 # 51 3 67 C 83 S 99 c 115 s
36 $ 52 4 68 D 84 T 100 d 116 t
37 % 53 5 69 E 85 U 101 e 117 u
38 & 54 6 70 F 86 V 102 f 118 v
39 ' 55 7 71 G 87 W 103 g 119 w
40 ( 56 8 72 H 88 X 104 h 120 x
41 ) 57 9 73 I 89 Y 105 i 121 y
42 * 58 : 74 J 90 Z 106 j 122 z
43 + 59 ; 75 K 91 [ 107 k 123 {
44 , 60 < 76 L 92 \ 108 l 124 |
45 - 61 = 77 M 93 ] 109 m 125 }
46 . 62 > 78 N 94 🠅 110 n 126 ~
47 / 63 ? 79 O 95 _ 111 o 127 🮕</pre>
 
=={{header|Lua}}==
{{trans|Go}}
<langsyntaxhighlight lang="lua">
-- map of character values to desired representation
local chars = setmetatable({[32] = "Spc", [127] = "Del"}, {__index = function(_, k) return string.char(k) end})
Line 2,057 ⟶ 4,208:
end
io.write"\n"
end</langsyntaxhighlight>
 
{{out}}
Line 2,076 ⟶ 4,227:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|M2000 Interpreter}}==
Addition: Show all Ascii from 0, using 0x2400 to 0x2420 unicode symbols.
 
<syntaxhighlight lang="m2000 interpreter">
Function ProduceAscii$ {
Document Ascii$="\"
DelUnicode$=ChrCode$(0x2421)
j=0
Print Ascii$;
For i=0 to 15
Print Hex$(i, .5);
Ascii$=Hex$(i, .5)
Next
For i=0 to 32
If pos>16 then
Ascii$={
}+Hex$(j, .5)
Print : Print Hex$(j, .5);: j++
End if
Print Chrcode$(i+0x2400);
Ascii$=Chrcode$(i+0x2400)
Next
For i=33 to 126
If pos>16 then
Ascii$={
}+Hex$(j, .5)
Print : Print Hex$(j, .5);: j++
End if
Print Chr$(i);
Ascii$=Chr$(i)
Next
Print DelUnicode$
=Ascii$+DelUnicode$+{
}
}
Clipboard ProduceAscii$()
</syntaxhighlight>
{{out}}
<pre>
\0123456789ABCDEF
0␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏
1␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟
2␠!"#$%&'()*+,-./
30123456789:;<=>?
4@ABCDEFGHIJKLMNO
5PQRSTUVWXYZ[\]^_
6`abcdefghijklmno
7pqrstuvwxyz{|}~␡
 
</pre>
 
=={{header|MACRO-11}}==
<syntaxhighlight lang="macro11"> .TITLE ASCTAB
.MCALL .PRINT,.EXIT
ASCTAB::MOV #40,R5
MOV #20,R4
1$: MOV #NBUF,R1
MOV R5,R2
2$: MOV #-1,R3
3$: INC R3
SUB #12,R2
BCC 3$
ADD #72,R2
MOVB R2,-(R1)
MOV R3,R2
BNE 2$
CMP R1,#NUM
BEQ 4$
MOVB #40,-(R1)
4$: .PRINT #NUM
CMP #40,R5
BEQ 5$
CMP #177,R5
BEQ 6$
MOVB R5,CHR
.PRINT #CHR
BR 7$
5$: .PRINT #SPC
BR 7$
6$: .PRINT #DEL
7$: ADD #20,R5
CMP R5,#200
BLT 1$
SUB #137,R5
.PRINT #NL
DEC R4
BNE 1$
.EXIT
NUM: .ASCII / /
NBUF: .ASCII /: /<200>
CHR: .ASCII /. /<200>
SPC: .ASCII /SPC /<200>
DEL: .ASCII /DEL /<200>
NL: .ASCIZ //
.END ASCTAB</syntaxhighlight>
{{out}}
<pre> 32: SPC 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: DEL</pre>
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<syntaxhighlight lang="mathematica">StringRiffle[StringJoin@@@Transpose[Partition[ToString[#]<>": "<>Switch[#,32,"Spc ",127,"Del ",_,FromCharacterCode[#]<>" "]&/@Range[32,127],16]],"\n"]</syntaxhighlight>
{{out}}
<pre>32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del </pre>
 
=={{header|Miranda}}==
<syntaxhighlight lang="miranda">main :: [sys_message]
main = [Stdout table]
 
table :: [char]
table = lay [concat [item n | n<-[row, (row+16)..127]] | row<-[32..47]]
 
item :: num->[char]
item n = num ++ " : " ++ desc
where num = reverse (take 3 (reverse (shownum n) ++ repeat ' '))
desc = "Spc ", if n = 32
= "Del ", if n = 127
= decode n : " ", otherwise</syntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del</pre>
 
=={{header|MiniScript}}==
<langsyntaxhighlight MiniScriptlang="miniscript">// Prints ASCII table
// Note changing the values of startChar and endChar will print
// a flexible table in that range
Line 2,111 ⟶ 4,426:
end if
end for
if line then print line // final check for odd incomplete line output</langsyntaxhighlight>
{{out}}
<pre>
Line 2,131 ⟶ 4,446:
122 : z 123 : { 124 : | 125 : } 126 : ~ 127 : DEL
</pre>
 
=={{header|Modula-2}}==
<syntaxhighlight lang="modula2">MODULE AsciiTable;
FROM InOut IMPORT Write, WriteCard, WriteString, WriteLn;
 
VAR row, col: CARDINAL;
 
PROCEDURE WriteItem(n: CARDINAL);
BEGIN
WriteCard(n, 3);
WriteString(": ");
CASE n OF
32: WriteString("Spc ")
| 127: WriteString("Del ")
ELSE
Write(CHR(n));
WriteString(" ")
END
END WriteItem;
 
BEGIN
FOR row := 32 TO 47 DO
FOR col := row TO 127 BY 16 DO
WriteItem(col)
END;
WriteLn
END
END AsciiTable.</syntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|Nanoquery}}==
{{trans|C}}
<langsyntaxhighlight Nanoquerylang="nanoquery">k = ""
for i in range(0, 15)
for j in range(32 + i, 127, 16)
Line 2,147 ⟶ 4,507:
end
println
end</langsyntaxhighlight>
 
{{out}}
Line 2,168 ⟶ 4,528:
 
=={{header|Nim}}==
<langsyntaxhighlight Nimlang="nim">import strformat
 
for i in 0..15:
for j in countup(32 + i, 127, step = 16):
varlet k = ""case j
of 32: "Spc"
case j
of 32127: "Del"
k = "Spc" else: $chr(j)
of 127:
k = "Del"
else:
k = $char(j)
write(stdout, fmt"{j:3d} : {k:<6s}")
write(stdout, "\n")</langsyntaxhighlight>
 
{{out}}
<pre>
Line 2,201 ⟶ 4,558:
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|Objeck}}==
{{trans|Java}}
<syntaxhighlight lang="objeck">class AsciiTable {
function : Main(args : String[]) ~ Nil {
for(i := 32; i <= 127 ; i += 1;) {
if(i = 32 | i = 127) {
s := i = 32 ? "Spc" : "Del";
"{$i}:\t{$s}\t"->Print();
}
else {
c := i->ToChar();
"{$i}:\t{$c}\t"->Print();
};
if((i-1) % 6 = 0 ) {
"\n"->Print();
};
};
}
}</syntaxhighlight>
 
{{output}}
<pre>
32: Spc 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
</pre>
 
=={{header|OCaml}}==
<syntaxhighlight lang="ocaml">let show_char i =
Printf.printf "%5u: %s" i (match i with 32 -> "SPC" | 127 -> "DEL"
| _ -> Printf.sprintf " %c " (char_of_int i))
 
let () =
for i = 32 to 47 do
for j = 0 to 5 do show_char (j lsl 4 + i) done |> print_newline
done</syntaxhighlight>
{{out}}
<pre>
32: SPC 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: DEL
</pre>
 
=={{header|OxygenBasic}}==
<syntaxhighlight lang="text">
uses console
int i,j
string c
for i=32 to 127
select case i
case 32 : c="spc"
case 127: c="del"
case else c=chr i
end select
print i ": " c tab
j++
if j = 8 'columns
print cr
j=0
endif
next
pause
</syntaxhighlight>
 
=={{header|Perl}}==
Output in the same style as Raku.
{{trans|Raku}}
<langsyntaxhighlight lang="perl">use charnames ':full';
binmode STDOUT, ':utf8';
 
Line 2,224 ⟶ 4,671:
}
}
print qq[|}\n];</langsyntaxhighlight>
 
=={{header|Phix}}==
{{libheader|Phix/basics}}
<lang Phix>sequence ascii = {}
<!--<syntaxhighlight lang="phix">(phixonline)-->
for ch=32 to 127 do
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
ascii = append(ascii,sprintf("%4d (#%02x): %c ",ch))
end for
<span style="color: #004080;">sequence</span> <span style="color: #000000;">ascii</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{}</span>
puts(1,substitute(join_by(ascii,16,6),x"7F","del"))</lang>
<span style="color: #008080;">for</span> <span style="color: #000000;">ch</span><span style="color: #0000FF;">=</span><span style="color: #000000;">32</span> <span style="color: #008080;">to</span> <span style="color: #000000;">127</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">ascii</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">append</span><span style="color: #0000FF;">(</span><span style="color: #000000;">ascii</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%4d (#%02x): %c "</span><span style="color: #0000FF;">,</span><span style="color: #000000;">ch</span><span style="color: #0000FF;">))</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">substitute</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">join_by</span><span style="color: #0000FF;">(</span><span style="color: #000000;">ascii</span><span style="color: #0000FF;">,</span><span style="color: #000000;">16</span><span style="color: #0000FF;">,</span><span style="color: #000000;">6</span><span style="color: #0000FF;">),</span><span style="color: #008000;">"\x7F"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"del"</span><span style="color: #0000FF;">))</span>
<!--</syntaxhighlight>-->
{{out}}
<pre> 32 (#20): 48 (#30): 0 64 (#40): @ 80 (#50): P 96 (#60): ` 112 (#70): p
Line 2,252 ⟶ 4,704:
=={{header|PHP}}==
 
<langsyntaxhighlight PHPlang="php"><?php
 
echo '+' . str_repeat('----------+', 6), PHP_EOL;
Line 2,267 ⟶ 4,719:
echo '|', PHP_EOL;
}
echo '+' . str_repeat('----------+', 6), PHP_EOL;</langsyntaxhighlight>
 
{{out}}
Line 2,288 ⟶ 4,740:
| 47: / | 63: ? | 79: O | 95: _ | 111: o | 127: Del |
+----------+----------+----------+----------+----------+----------+</pre>
 
=={{header|PL/M}}==
<syntaxhighlight lang="pli">
100H: /* SHOW AN ASCII TABLE FROM 32 TO 127 */
/* CP/M BDOS SYSTEM CALL */
BDOS: PROCEDURE( FN, ARG ); DECLARE FN BYTE, ARG ADDRESS; GOTO 5; END;
/* I/O ROUTINES */
PR$CHAR: PROCEDURE( C ); DECLARE C BYTE; CALL BDOS( 2, C ); END;
PR$STRING: PROCEDURE( S ); DECLARE S ADDRESS; CALL BDOS( 9, S ); END;
PR$BYTE: PROCEDURE( N );
DECLARE N BYTE;
DECLARE V BYTE;
V = N MOD 100;
CALL PR$CHAR( ' ' );
CALL PR$CHAR( '0' + ( N / 100 ) );
CALL PR$CHAR( '0' + ( V / 10 ) );
CALL PR$CHAR( '0' + ( V MOD 10 ) );
END PR$BYTE;
/* ASCII TABLE */
DECLARE ( A, C ) BYTE;
DO C = 32 TO 32 + 15;
DO A = C TO C + ( 16 * 5 ) BY 16;
CALL PR$BYTE( A );
CALL PR$STRING( .': $' );
IF A = 32 THEN CALL PR$STRING( .'SPC$' );
ELSE IF A = 127 THEN CALL PR$STRING( .'DEL$' );
ELSE DO;
CALL PR$CHAR( ' ' );
CALL PR$CHAR( A );
CALL PR$CHAR( ' ' );
END;
END;
CALL PR$STRING( .( 0DH, 0AH, '$' ) );
END;
EOF
</syntaxhighlight>
{{out}}
<pre>
032: SPC 048: 0 064: @ 080: P 096: ` 112: p
033: ! 049: 1 065: A 081: Q 097: a 113: q
034: " 050: 2 066: B 082: R 098: b 114: r
035: # 051: 3 067: C 083: S 099: c 115: s
036: $ 052: 4 068: D 084: T 100: d 116: t
037: % 053: 5 069: E 085: U 101: e 117: u
038: & 054: 6 070: F 086: V 102: f 118: v
039: ' 055: 7 071: G 087: W 103: g 119: w
040: ( 056: 8 072: H 088: X 104: h 120: x
041: ) 057: 9 073: I 089: Y 105: i 121: y
042: * 058: : 074: J 090: Z 106: j 122: z
043: + 059: ; 075: K 091: [ 107: k 123: {
044: , 060: < 076: L 092: \ 108: l 124: |
045: - 061: = 077: M 093: ] 109: m 125: }
046: . 062: > 078: N 094: ^ 110: n 126: ~
047: / 063: ? 079: O 095: _ 111: o 127: DEL
</pre>
 
=={{header|Prolog}}==
<langsyntaxhighlight Prologlang="prolog">ascii :-
forall(between(32, 47, N), row(N)).
 
Line 2,305 ⟶ 4,812:
ascii(32) :- write(' Spc '), !.
ascii(127) :- write(' Del '), !.
ascii(A) :- char_code(D,A), format(' ~w ', D).</langsyntaxhighlight>
{{out}}
<pre>
Line 2,331 ⟶ 4,838:
 
=={{header|PureBasic}}==
<langsyntaxhighlight PureBasiclang="purebasic">If OpenConsole("Show_Ascii_table: rosettacode.org")
Define r.i, c.i
For r=0 To 15
Line 2,349 ⟶ 4,856:
Next
Input()
EndIf</langsyntaxhighlight>
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 2,371 ⟶ 4,878:
===Imperative===
{{trans|Go}}
<langsyntaxhighlight lang="python">
for i in range(16):
for j in range(32+i, 127+1, 16):
Line 2,382 ⟶ 4,889:
print("%3d : %-3s" % (j,k), end="")
print()
</syntaxhighlight>
</lang>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 2,403 ⟶ 4,910:
===HTML===
After Raku, but creating an HTML table:
<langsyntaxhighlight lang="python">from unicodedata import name
from html import escape
 
Line 2,418 ⟶ 4,925:
print(" </tr><tr>")
print(f' <td style="center">{n}<br>0x{n:02x}<br><big><b title="{escape(name(pp(n)))}">{escape(pp(n))}</b></big></td>')
print(""" </tr>\n</table>""")</langsyntaxhighlight>
 
{{out}}
Line 2,564 ⟶ 5,071:
 
Composed from generic abstractions:
<langsyntaxhighlight lang="python">'''Plain text ASCII code table'''
 
from functools import reduce
Line 2,671 ⟶ 5,178:
# MAIN ---
if __name__ == '__main__':
main()</langsyntaxhighlight>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 2,691 ⟶ 5,198:
 
===List Comprehensions===
<langsyntaxhighlight lang="python">
# One-liner
# print('\n'.join([''.join(["%3d : %-3s" % (a, 'Spc' if a == 32 else 'Del' if a == 127 else chr(a)) for a in lst]) for lst in [[i+c*16 for c in range(6)] for i in range(32, 47+1)]])
Line 2,707 ⟶ 5,214:
 
# Joining columns into rows and printing rows one in a separate line
print('\n'.join([''.join(row) for row in rows_as_strings]))</langsyntaxhighlight>
{{Out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 2,725 ⟶ 5,232:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del</pre>
 
=={{header|QB64}}==
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
<syntaxhighlight lang="qbasic">DIM s AS STRING
 
FOR i% = 32 TO 47
FOR j% = i% TO i% + 80 STEP 16
SELECT CASE j%
CASE 32
s$ = "Spc"
CASE 127
s$ = "Del"
CASE ELSE
s$ = CHR$(j%)
END SELECT
PRINT USING "###: \ \"; j%; s$;
NEXT j%
PRINT
NEXT i%</syntaxhighlight>
{{out}}
<pre>
32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del
</pre>
 
=={{header|Quackery}}==
<syntaxhighlight lang="quackery">
[ dup 32 = iff
[ drop say 'spc' ] done
dup 127 = iff
[ drop say 'del' ] done
emit sp sp ] is echoascii ( n --> )
 
[ dup echo say ': '
dup echoascii
84 < 3 + times sp ] is echoelt ( n --> )
 
[ sp 81 times
[ dup i^ + echoelt 16 step ]
drop cr ] is echorow ( n --> )
 
[ 16 times [ i^ 32 + echorow ] ] is echotable ( --> )
 
echotable
</syntaxhighlight>
{{out}}
<pre>
32: spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: del
</pre>
 
=={{header|R}}==
<langsyntaxhighlight lang="rsplus">chr <- function(n) {
rawToChar(as.raw(n))
}
Line 2,743 ⟶ 5,329:
idx <- idx + 6
cat("\n")
}</langsyntaxhighlight>
{{out}}
<pre> 32 : Spc 33 : ! 34 : " 35 : # 36 : $ 37 : %
Line 2,764 ⟶ 5,350:
=={{header|Racket}}==
 
<langsyntaxhighlight lang="racket">#lang racket
 
(for ([i (in-range 16)])
Line 2,775 ⟶ 5,361:
[127 "DEL"]
[_ (integer->char n)]) #:min-width 5)))
(newline))</langsyntaxhighlight>
 
{{out}}
Line 2,800 ⟶ 5,386:
Alternately, and perhaps more usefully, output as a wiki-table rather than ASCII art. Hover mouse over the glyph to get the name.
 
<syntaxhighlight lang="raku" perl6line>sub glyph ($_) {
when * < 33 { (0x2400 + $_).chr } # display symbol names for invisible glyphs
when 127 { '␡' }
Line 2,815 ⟶ 5,401:
}
 
say '|}';</langsyntaxhighlight>
{{out}}
{|class="wikitable" style="text-align:center;background-color:hsl(39, 90%, 95%)"
Line 2,955 ⟶ 5,541:
|127<br>0x7F<br><big><big title="DELETE">␡</big></big>
|}
 
=={{header|Red}}==
<syntaxhighlight lang="rebol">Red ["ASCII table"]
 
repeat i 16 [
repeat j 6 [
n: j - 1 * 16 + i + 31
prin append pad/left n 3 ": "
prin pad switch/default n [
32 ["spc"]
127 ["del"]
] [to-char n] 4
]
prin newline
]</syntaxhighlight>
{{out}}
<pre>
32: spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: del
</pre>
 
=={{header|REXX}}==
Line 2,971 ⟶ 5,591:
:::* &nbsp; the suppression of displaying particular glyphs by REXX that are preempted by the OS.
:::* &nbsp; adding homage to the adage of: &nbsp; ''anything worth doing is worth doing well''.
<langsyntaxhighlight lang="rexx">/*REXX program displays an ASCII table of characters (within a 16x16 indexed grid).*/
parse upper version !ver . /*some REXXes can't display '1b'x glyph*/
!pcRexx= 'REXX/PERSONAL'==!ver | "REXX/PC"==!ver /*is this PC/REXX or REXX/Personal? */
Line 3,012 ⟶ 5,632:
/*──────────────────────────────────────────────────────────────────────────────────────*/
xhdr: say; _= hdr; sep= b; do k=0 for 16; _=_||b d2x(k)b; end; say _; say; return
grid: arg $1,$2,$3,$4; _=hdr; do 16; _=_ || $1 || $4; $1= $2; end; say _ || $3; return</langsyntaxhighlight>
{{out|output|text=&nbsp; showing a &nbsp; ''horizontal'' &nbsp; formatted grid (table):}}
 
(Code page &nbsp;'''437'''&nbsp; was used for the example below &nbsp; using DOS under Microsoft Windows.)
<pre>
x'07' x'08' x'09' x'0a' x'0d' x'1a' x'1b' x'20'
Line 3,067 ⟶ 5,687:
 
=={{header|Ring}}==
<langsyntaxhighlight lang="ring">
# Project : Show Ascii table
 
Line 3,114 ⟶ 5,734:
}
exec()
}</langsyntaxhighlight>
Output:
 
Line 3,120 ⟶ 5,740:
 
=={{header|Ruby}}==
<langsyntaxhighlight lang="ruby">chars = (32..127).map do |ord|
k = case ord
when 32 then "␠"
Line 3,129 ⟶ 5,749:
end
chars.each_slice(chars.size/6).to_a.transpose.each{|s| puts s.join(" ")}</langsyntaxhighlight>
{{out}}
<pre>32 : ␠ 48 : 0 64 : @ 80 : P 96 : ` 112: p
Line 3,151 ⟶ 5,771:
=={{header|Rust}}==
{{trans|Go}}
<langsyntaxhighlight Rustlang="rust">fn main() {
for i in 0u8..16 {
for j in ((32+i)..128).step_by(16) {
Line 3,163 ⟶ 5,783:
println!();
}
}</langsyntaxhighlight>
 
{{out}}
Line 3,186 ⟶ 5,806:
{{Out}}Best seen in running your browser either by [https://scalafiddle.io/sf/ouiyD9x/0 ScalaFiddle (your local ES aka JavaScript execution, non JVM)] or [https://scastie.scala-lang.org/OD7rBCSMQgKSyKKcGB24cg Scastie (remote JVM)].
{{works with|Scala|2.13}}
<langsyntaxhighlight Scalalang="scala">object AsciiTable extends App {
val (strtCharVal, lastCharVal, nColumns) = (' '.toByte, '\u007F'.toByte, 6)
require(nColumns % 2 == 0, "Number of columns must be even.")
Line 3,210 ⟶ 5,830:
.map(_.map(byte => f"$byte%3d : ${k(byte)}"))
.foreach(line => println(line.mkString(" ")))
}</langsyntaxhighlight>
 
=={{header|Seed7}}==
<langsyntaxhighlight lang="seed7">$ include "seed7_05.s7i";
 
const proc: main is func
Line 3,233 ⟶ 5,853:
writeln;
end for;
end func;</langsyntaxhighlight>
 
{{out}}
Line 3,258 ⟶ 5,878:
{{works with|HomeSpun}}
{{works with|OpenSpin}}
<langsyntaxhighlight lang="spin">con
_clkmode = xtal1+pll16x
_clkfreq = 80_000_000
Line 3,287 ⟶ 5,907:
 
waitcnt(_clkfreq + cnt)
ser.stop</langsyntaxhighlight>
{{out}}
<pre> 32: SPC 48: 0 64: @ 80: P 96: ` 112: p
Line 3,307 ⟶ 5,927:
 
=={{header|Standard ML}}==
<syntaxhighlight lang="text">fun Table n 127 = " 127: 'DEL'\n"
| Table 0 x = "\n" ^ (Table 10 x)
| Table n x = (StringCvt.padLeft #" " 4 (Int.toString x)) ^ ": '" ^ (str (chr x)) ^ "' " ^ ( Table (n-1) (x+1)) ;
 
print (Table 10 32) ;</langsyntaxhighlight>
32: ' ' 33: '!' 34: '"' 35: '#' 36: '$' 37: '%' 38: '&' 39: '&apos;' 40: '(' 41: ')'
42: '*' 43: '+' 44: ',' 45: '-' 46: '.' 47: '/' 48: '0' 49: '1' 50: '2' 51: '3'
Line 3,325 ⟶ 5,945:
=={{header|Tcl}}==
{{trans|AWK}}
<syntaxhighlight lang="tcl">
<lang Tcl>
for {set i 0} {$i < 16} {incr i} {
for {set j $i} {$j < 128} {incr j 16} {
Line 3,337 ⟶ 5,957:
puts ""
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Line 3,357 ⟶ 5,977:
47: / 63: ? 79: O 95: _ 111: o 127: DEL
</pre>
 
=={{header|TXR}}==
 
<syntaxhighlight lang="txrlisp">(let ((spcdel (relate " \x7f" #("Spc" "Del"))))
(each ((r 32..48))
(each ((c (take 6 (range r : 16))))
(put-string (pic "###: <<<" c [spcdel (chr-num c)])))
(put-line)))</syntaxhighlight>
 
{{out}}
 
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|VBA}}==
<syntaxhighlight lang="vb">
<lang VB>
Public Sub ascii()
Dim s As String, i As Integer, j As Integer
Line 3,373 ⟶ 6,020:
Debug.Print vbCrLf
Next i
End Sub</langsyntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
Line 3,395 ⟶ 6,042:
=={{header|Visual Basic .NET}}==
{{trans|C#}}
<langsyntaxhighlight lang="vbnet">Imports System.Console
Imports System.Linq.Enumerable
 
Line 3,408 ⟶ 6,055:
Loop While start + 16 * 5 < 128
End Sub
End Module</langsyntaxhighlight>
{{out}}
<pre>32 : Sp 48 : 0 64 : @ 80 : P 96 : ` 112 : p
Line 3,426 ⟶ 6,073:
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|V (Vlang)}}==
{{trans|go}}
<syntaxhighlight lang="v (vlang)">fn main() {
for i in 0..16{
for j := 32 + i; j < 128; j += 16 {
mut k := u8(j).ascii_str()
match j {
32 {
k = "Spc"
}
127 {
k = "Del"
} else {
}
}
print("${j:3} : ${k:-3} ")
}
println('')
}
}</syntaxhighlight>
 
{{out}}
<pre> 32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del </pre>
 
=={{header|VTL-2}}==
<syntaxhighlight lang="vtl2">10 C=32
20 L=16
30 #=C>100*50
40 $=32
50 ?=C
60 ?=": ";
70 #=C=32*120
80 #=C=127*140
90 $=C
100 ?=" ";
110 #=150
120 ?="Spc ";
130 #=150
140 ?="Del ";
150 C=C+16
160 #=C<128*30
170 C=C-95
180 L=L-1
190 ?=""
200 #=L=0=0*30</syntaxhighlight>
{{out}}
<pre> 32: Spc 48: 0 64: @ 80: P 96: ` 112: p
33: ! 49: 1 65: A 81: Q 97: a 113: q
34: " 50: 2 66: B 82: R 98: b 114: r
35: # 51: 3 67: C 83: S 99: c 115: s
36: $ 52: 4 68: D 84: T 100: d 116: t
37: % 53: 5 69: E 85: U 101: e 117: u
38: & 54: 6 70: F 86: V 102: f 118: v
39: ' 55: 7 71: G 87: W 103: g 119: w
40: ( 56: 8 72: H 88: X 104: h 120: x
41: ) 57: 9 73: I 89: Y 105: i 121: y
42: * 58: : 74: J 90: Z 106: j 122: z
43: + 59: ; 75: K 91: [ 107: k 123: {
44: , 60: < 76: L 92: \ 108: l 124: |
45: - 61: = 77: M 93: ] 109: m 125: }
46: . 62: > 78: N 94: ^ 110: n 126: ~
47: / 63: ? 79: O 95: _ 111: o 127: Del</pre>
 
=={{header|Wren}}==
{{trans|Go}}
{{libheader|Wren-fmt}}
<langsyntaxhighlight ecmascriptlang="wren">import "./fmt" for Fmt
 
for (i in 0...16) {
Line 3,445 ⟶ 6,170:
}
System.print()
}</langsyntaxhighlight>
 
{{out}}
Line 3,468 ⟶ 6,193:
 
=={{header|XPL0}}==
<langsyntaxhighlight XPL0lang="xpl0">int Hi, Lo;
[SetHexDigits(2);
Text(0, " ");
Line 3,480 ⟶ 6,205:
CrLf(0);
];
]</langsyntaxhighlight>
 
{{out}}
Line 3,502 ⟶ 6,227:
0F / ? O _ o
</pre>
=={{header|Z80 Assembly}}==
{{works with|CP/M 3.1|YAZE-AG-2.51.2 Z80 emulator}}
{{works with|ZSM4 macro assembler|YAZE-AG-2.51.2 Z80 emulator}}
Use the /S8 switch on the ZSM4 assembler for 8 significant characters for labels and names
<syntaxhighlight lang="z80">
;
; Print ASCII table using Z80 assembly language
;
; Runs under CP/M 3.1 on YAZE-AG-2.51.2 Z80 emulator
; Assembled with zsm4 on same emulator/OS, uses macro capabilities of said assembler
; Created with vim under Windows
;
; Thanks to https://wikiti.brandonw.net for the idea for the conversion routine hl -> decimal ASCII
;
; 2023-04-04 Xorph
;
 
;
; Useful definitions
;
 
bdos equ 05h ; Call to CP/M BDOS function
strdel equ 6eh ; Set string delimiter
wrtstr equ 09h ; Write string to console
 
numrows equ 16d ; Number of rows for output
numcols equ 6d ; Number of columns for output
 
nul equ 00h ; ASCII control characters
esc equ 1bh
cr equ 0dh
lf equ 0ah
 
cnull equ '0' ; ASCII character constants
spc equ 20h
del equ 7fh
 
;
; Macros for BDOS calls
;
 
setdel macro char ; Set string delimiter to char
ld c,strdel
ld e,char
call bdos
endm
 
print macro msg ; Output string to console
ld c,wrtstr
ld de,msg
call bdos
endm
 
newline macro ; Print newline
ld c,wrtstr
ld de,crlf
call bdos
endm
 
pushall macro ; Save all registers to stack
push af
push bc
push de
push hl
push ix
push iy
endm
 
popall macro ; Recall all registers from stack
pop iy
pop ix
pop hl
pop de
pop bc
pop af
endm
 
;
; =====================
; Start of main program
; =====================
;
 
cseg
 
asciitab:
setdel nul ; Set string terminator to nul ('\0') - '$' is default in CP/M
 
ld a,spc ; First ASCII code to print
loop:
ld (char),a ; Put ASCII code in output placeholder
ld h,0 ; Register pair hl is used for printing the number, register h remains 0
ld l,a ; Put ASCII code in hl for decimal conversion
ld ix,buffer
call dispHL ; Create decimal representation
 
ld d,3d ; Pad decimal representation to 3 places with leading blanks
ld e,' ' ; Registers d and e are modified in macro, so assign each time
ld hl,buffer
ld bc,format
call padstrl
 
print format ; Print the whole thing
print colon
 
chkspc:
ld a,(char) ; Load again, register a was lost during BDOS calls
cp spc ; Check if Spc
jr nz,chkdel ; If not, check if Del
print txtspc ; If yes, print the text for Spc
jr nextcol ; ...and skip to the next column
 
chkdel:
ld a,(char) ; Load again, register a was lost during BDOS calls
cp del ; Check if Del
jr nz,printc ; If not, print normal char
print txtdel ; If yes, print the text for Del
jr nextcol ; ...and skip to the next column
 
printc:
print char ; Normal char
 
nextcol:
ld a,(curcol) ; Increase output column
inc a
cp numcols ; If last column, go to next row
jr z,nextrow
ld (curcol),a ; Save column counter
ld a,(char) ; Increase ASCII code by the number of rows for next column in same row
add a,numrows
jr loop ; Next code
 
nextrow:
newline ; Display next row
xor a ; Set column counter back to 0
ld (curcol),a
ld a,(currow) ; Increase row counter
inc a
cp numrows ; When last row has been finished, we are done
jr z,exitprg
 
ld (currow),a ; Save row counter
ld a,(char) ; Set ASCII code back to starting code of next row
sub a,numrows * (numcols - 1d) - 1d
jp loop ; Use jp instead of jr because of jump distance!
 
exitprg:
newline
ret ; Return to CP/M
 
;
; ===================
; End of main program
; ===================
;
 
;
; Helper routines - notice that the Z80 does not have a divide instruction
; Notice further that CP/M does not have any support for pretty-printing
; formatted numbers and stuff like that. So we have to do all this by hand...
;
 
;
; Converts the value (unsigned int) in register hl to its decimal representation
; Register ix has memory address of target for converted value
; String is terminated with nul character (\0)
;
 
dispHL:
pushall
ld b,1 ; Flag for leading '0'
irp x,<-10000,-1000,-100,-10,-1>
ld de,x ; Subtract powers of 10 and determine digit
call calcdig
endm
 
ld a,nul ; Terminate result string with nul
ld (ix+0),a
 
popall
ret ; End of conversion routine
 
calcdig:
ld a,cnull-1 ; Determine the digit character
incrdig:
inc a ; Start with '0'
add hl,de ; As long as subtraction is possible, increment digit character
jr c,incrdig
 
sbc hl,de ; If negative, undo last subtraction and continue with remainder
cp cnull ; Check for leading '0', these are ignored
jr nz,adddig
bit 0,b ; Use bit instruction for check if flag set, register a contains digit
ret nz ; If '0' found and flag set, it is a leading '0' and we return
adddig:
ld b,0 ; Reset flag for leading '0', we are now outputting digits
ld (ix+0),a ; Store character in memory and set ix to next location
inc ix
 
ret ; End of conversion helper routine
 
;
; Formats a string to the specified minimum width with the specified filler character
; Register hl has memory address of nul-terminated string
; Register bc has memory address of target for padded string
; Register d has width
; Register e has filler character/byte
; Padding is on the left (function is intended for padding integer numbers)
;
 
padstrl:
pushall
push hl ; Save address of source for copy later on
ld a,d ; Check if width is 0, just copy string if so
cp 0
jr z,copysrc
ld a,nul ; Search for end of string. Each non-nul character decrements d
 
findnul:
cp (hl)
jr z,nulfound ; Found end of string, d contains number of padding to add
dec d
jr z,copysrc
inc hl
jr findnul ; Repeat with next character
 
nulfound:
ld a,e ; Store as many padding characters to target as specified in register d
inspad:
ld (bc),a
inc bc ; Move to next memory address and decrease d
dec d
jr nz,inspad
 
copysrc:
pop hl ; Transfer source to target, bc points to first memory address after padding
movechar:
ld a,(hl)
ld (bc),a
inc hl
inc bc
cp nul ; Check if nul character copied
jr nz,movechar ; If no, repeat with next character
 
popall
ret ; End of padding routine
 
;
; ================
; Data definitions
; ================
;
 
dseg
 
crlf: defb cr,lf,nul ; Generic newline
buffer: defs 10 ; Buffer for conversion of number to text
format: defs 10 ; Formatted number for output
colon: defz ' : ' ; Separator number/character, nul-terminated
char: defz ' ' ; Placeholder for ASCII character, nul-terminated
txtspc: defz 'Spc ' ; Space character 20h
txtdel: defz 'Del ' ; Del character 7fh
currow: defb 0d ; Current row
curcol: defb 0d ; Current column
</syntaxhighlight>
 
{{out}}
<pre>
32 : Spc 48 : 0 64 : @ 80 : P 96 : ` 112 : p
33 : ! 49 : 1 65 : A 81 : Q 97 : a 113 : q
34 : " 50 : 2 66 : B 82 : R 98 : b 114 : r
35 : # 51 : 3 67 : C 83 : S 99 : c 115 : s
36 : $ 52 : 4 68 : D 84 : T 100 : d 116 : t
37 : % 53 : 5 69 : E 85 : U 101 : e 117 : u
38 : & 54 : 6 70 : F 86 : V 102 : f 118 : v
39 : ' 55 : 7 71 : G 87 : W 103 : g 119 : w
40 : ( 56 : 8 72 : H 88 : X 104 : h 120 : x
41 : ) 57 : 9 73 : I 89 : Y 105 : i 121 : y
42 : * 58 : : 74 : J 90 : Z 106 : j 122 : z
43 : + 59 : ; 75 : K 91 : [ 107 : k 123 : {
44 : , 60 : < 76 : L 92 : \ 108 : l 124 : |
45 : - 61 : = 77 : M 93 : ] 109 : m 125 : }
46 : . 62 : > 78 : N 94 : ^ 110 : n 126 : ~
47 : / 63 : ? 79 : O 95 : _ 111 : o 127 : Del
</pre>
 
=={{header|Zig}}==
{{trans|Java}}
<syntaxhighlight lang="zig">const print = @import("std").debug.print;
pub fn main() void {
var i: u8 = 33;
print(" 32: Spc", .{});
while (i < 127) : (i += 1) {
print("{:03}: {c} ", .{ i, i });
if (@mod(i, 6) == 1) {
print("\n", .{});
}
}
print("127: Del", .{});
}</syntaxhighlight>
 
=={{header|zkl}}==
<langsyntaxhighlight lang="zkl">const width=9;
println(" ",[0..width].pump(String,"%4d".fmt));
[30..127].pump("".println,T(Void.Read,width,False), // don't fail on short lines
Line 3,513 ⟶ 6,539:
T("replace"," ","spc"),T("replace","\x7f","del"), "%-4s".fmt)
)
})</langsyntaxhighlight>
{{out}}
<pre> 0 1 2 3 4 5 6 7 8 9
Line 3,529 ⟶ 6,555:
=={{header|ZX Spectrum Basic}}==
Note in particular entries 94, 96 and 127.
<langsyntaxhighlight lang="zxbasic">10 FOR x=0 TO 9
20 PRINT AT 0,4+2*x;x
30 PRINT AT x+1,0;10*(3+x)
Line 3,537 ⟶ 6,563:
70 LET t=(x-d)/10
80 PRINT AT t-2,4+2*d;CHR$ x
90 NEXT x</langsyntaxhighlight>
 
{{out}}
890

edits