3 function join
(array
, start
, sep
, end, result
, i
)
7 else if (sep == SUBSEP
) # magic value
10 for (i = start
+ 1; i
<=
end; i
++)
11 result = result sep array
[i
]
15 function hex2dec
(xx
) {
18 aa =
substr(xx
, 1, 1);
19 ii =
index("0123456789ABCDEF", aa
);
20 if (!ii
) ii =
index("0123456789abcdef", aa
);
22 nn = nn
* 16 + ii
- 1;
30 split(substr($
0, 3), z
, ":")
31 printf("0x%08x:%s\n", hex2dec
(z
[1]), join
(z
, 2, ":"));
34 c = hex2dec
(substr($
1, 3));
35 for (i =
2; i
<=
NF; i
++) {
36 if (substr($i
, 1, 1) ==
"#") break;
37 if (p =
index($i
, "-")) {
38 p1 = hex2dec
(substr($i
, 3, p
- 3));
39 p2 = hex2dec
(substr($i
, p
+ 3));
41 p1 = hex2dec
(substr($i
, 3));
44 for (p = p1
; p
<= p2
; p
++) printf("0x%08x:%c\n", p
, c
);
48 printf("0x000000a0:\\001\n0x000000ad:\n");