-
Notifications
You must be signed in to change notification settings - Fork 0
/
hexdump.f
52 lines (39 loc) · 845 Bytes
/
hexdump.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ hexdump -C }
{ format %x }
[$9> [10-'a+ ,] ['0+ ,] ¿] d:
[
a;16≤ ["00000000"] ?
{ reverse }
0i: [i;n;<] [i;™ i;1+i:] #
{ duplicate }
0i: [i;n;<] [n;1-ø i;1+i:] #
{ asciihex section }
" "
0i: [i;16<]
[
i;n;< [16÷ d;! d;! " "] [" "] ¿
i;1+$i:
8= [" "] ?
] #
{ character section }
" |"
[n;0≠ $n;+n:] [$32<£126>| [%'.] ? ,] #
"|" 10,
{ beginning of line: format address %08x }
a;
16 16 16 16 16 16 16 ****** ÷ d;!
16 16 16 16 16 16 ***** ÷ d;!
16 16 16 16 16 **** ÷ d;!
16 16 16 16 *** ÷ d;!
16 16 16 ** ÷ d;!
16 16 * ÷ d;!
16 ÷ d;!
d;!
]o:
0a:
0n:
{ fragments of 16 characters }
[^$1_=~] [a;1+a: n;1+n: n;16= [o;!] ?] # %
{ final fragment }
n;0> [o;!] ?
a;0> [10,] ?