blob: 13f29f821be2a496cfb1fcd59d52dee7ea01c249 (
plain) (
blame)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
# -*- sh -*-
# See LICENSE file for copyright and license details.
check_endian () {
xvalue="$1"
text0="$2"
text1="$3"
textoff="$4"
bits="$5"
shift 5
sxvalue="$(printf '%s\n' "$xvalue" | sed 's/^0*//' | sed 's/^$/0/')"
test "$(to-tracer-endian.tu $text0 $textoff $bits $@)" = "$sxvalue"
test "$(to-tracer-endian.tu $text1 $textoff $bits $@)" = "$sxvalue"
test "$(to-tracee-endian.tu $xvalue $textoff $bits $@)" = "$text0 $text1"
}
check_endian0 () {
xvalue="$1"
text="$2"
textoff="$3"
bits="$4"
shift 4
check_endian $xvalue $text $text $textoff $bits $@
}
check_endian 0 00 FE 0 1 0
check_endian 0 00 FD 1 1 0
check_endian 0 00 FB 2 1 0
check_endian 0 00 F7 3 1 0
check_endian 0 00 EF 4 1 0
check_endian 0 00 DF 5 1 0
check_endian 0 00 BF 6 1 0
check_endian 0 00 7F 7 1 0
check_endian 0 0000 FFFE 8 1 0
check_endian 1 01 FF 0 1 0
check_endian 1 02 FF 1 1 0
check_endian 1 04 FF 2 1 0
check_endian 1 08 FF 3 1 0
check_endian 1 10 FF 4 1 0
check_endian 1 20 FF 5 1 0
check_endian 1 40 FF 6 1 0
check_endian 1 80 FF 7 1 0
check_endian 1 0001 FFFF 8 1 0
check_endian 0 00 F0 0 4 0
check_endian 1 01 F1 0 4 0
check_endian 2 02 F2 0 4 0
check_endian 3 03 F3 0 4 0
check_endian 4 04 F4 0 4 0
check_endian 8 08 F8 0 4 0
check_endian A 0A FA 0 4 0
check_endian F 0F FF 0 4 0
check_endian 0 00 E1 1 4 0
check_endian 0 00 C3 2 4 0
check_endian 0 00 87 3 4 0
check_endian 0 00 0F 4 4 0
check_endian F 1E FF 1 4 0
check_endian F 3C FF 2 4 0
check_endian F 78 FF 3 4 0
check_endian F F0 FF 4 4 0
check_endian 0 0000 1FFE 5 4 0
check_endian F E001 FFFF 5 4 0
check_endian 0 0000 3FFC 6 4 0
check_endian F C003 FFFF 6 4 0
check_endian0 00 00 0 8 0
check_endian0 10 10 0 8 0
check_endian0 01 01 0 8 0
check_endian0 80 80 0 8 0
check_endian0 08 08 0 8 0
check_endian0 FF FF 0 8 0
check_endian 00 0000 01FE 1 8 0
check_endian FF FE01 FFFF 1 8 0
check_endian 000 0000 00FE 0 9 0
check_endian 1FF FF01 FFFF 0 9 0
check_endian 000 0000 00FC 0 10 0
check_endian 3FF FF03 FFFF 0 10 0
check_endian 000 0000 01FC 1 9 0
check_endian 1FF FE03 FFFF 1 9 0
check_endian 000 0000 01F8 1 10 0
check_endian 3FF FE07 FFFF 1 10 0
check_endian0 0000 0000 0 16 8 0
check_endian0 FFFF FFFF 0 16 8 0
check_endian0 1234 1234 0 16 8 0
check_endian0 0800 0800 0 16 8 0
check_endian0 0000 0000 0 16 0 8
check_endian0 FFFF FFFF 0 16 0 8
check_endian0 1234 3412 0 16 0 8
check_endian0 0800 0008 0 16 0 8
check_endian0 0000 0000 0 16 0
check_endian0 FFFF FFFF 0 16 0
check_endian0 1234 3412 0 16 0
check_endian0 0800 0008 0 16 0
check_endian0 000000 000000 0 24 16 8 0
check_endian0 FFFFFF FFFFFF 0 24 16 8 0
check_endian0 160800 160800 0 24 16 8 0
check_endian0 000000 000000 0 24 16 0 8
check_endian0 FFFFFF FFFFFF 0 24 16 0 8
check_endian0 160800 160008 0 24 16 0 8
check_endian0 000000 000000 0 24 0 8 16
check_endian0 FFFFFF FFFFFF 0 24 0 8 16
check_endian0 160800 000816 0 24 0 8 16
check_endian0 000000 000000 0 24 8 0 16
check_endian0 FFFFFF FFFFFF 0 24 8 0 16
check_endian0 160800 080016 0 24 8 0 16
check_endian0 000000 000000 0 24 0 16 8
check_endian0 FFFFFF FFFFFF 0 24 0 16 8
check_endian0 160800 001608 0 24 0 16 8
check_endian0 000000 000000 0 24 8 16 0
check_endian0 FFFFFF FFFFFF 0 24 8 16 0
check_endian0 160800 081600 0 24 8 16 0
check_endian0 00000000 00000000 0 32 24 16 8 0
check_endian0 FFFFFFFF FFFFFFFF 0 32 24 16 8 0
check_endian0 12345678 12345678 0 32 24 16 8 0
check_endian0 24160800 24160800 0 32 24 16 8 0
check_endian0 00000000 00000000 0 32 8 0 24 16
check_endian0 FFFFFFFF FFFFFFFF 0 32 8 0 24 16
check_endian0 12345678 56781234 0 32 8 0 24 16
check_endian0 24160800 08002416 0 32 8 0 24 16
check_endian0 00000000 00000000 0 32 0 8 16 24
check_endian0 FFFFFFFF FFFFFFFF 0 32 0 8 16 24
check_endian0 12345678 78563412 0 32 0 8 16 24
check_endian0 24160800 00081624 0 32 0 8 16 24
check_endian0 00000000 00000000 0 32 0 16 8 24
check_endian0 FFFFFFFF FFFFFFFF 0 32 0 16 8 24
check_endian0 12345678 78345612 0 32 0 16 8 24
check_endian0 24160800 00160824 0 32 0 16 8 24
check_endian0 0000000000000000 0000000000000000 0 64 56 48 40 32 24 16 8 0
check_endian0 FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 0 64 56 48 40 32 24 16 8 0
check_endian0 0123456789ABCDEF 0123456789ABCDEF 0 64 56 48 40 32 24 16 8 0
check_endian0 5648403224160800 5648403224160800 0 64 56 48 40 32 24 16 8 0
check_endian0 0000000000000000 0000000000000000 0 64 24 16 8 0 56 48 40 32
check_endian0 FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 0 64 24 16 8 0 56 48 40 32
check_endian0 0123456789ABCDEF 89ABCDEF01234567 0 64 24 16 8 0 56 48 40 32
check_endian0 5648403224160800 2416080056484032 0 64 24 16 8 0 56 48 40 32
check_endian0 0000000000000000 0000000000000000 0 64 8 0 24 16 40 32 56 48
check_endian0 FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 0 64 8 0 24 16 40 32 56 48
check_endian0 0123456789ABCDEF CDEF89AB45670123 0 64 8 0 24 16 40 32 56 48
check_endian0 5648403224160800 0800241640325648 0 64 8 0 24 16 40 32 56 48
check_endian0 0000000000000000 0000000000000000 0 64 0 8 16 24 32 40 48 56
check_endian0 FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 0 64 0 8 16 24 32 40 48 56
check_endian0 0123456789ABCDEF EFCDAB8967452301 0 64 0 8 16 24 32 40 48 56
check_endian0 5648403224160800 0008162432404856 0 64 0 8 16 24 32 40 48 56
check_endian 000 0000 00FE 0 9 0 8
check_endian 1FF FF01 FFFF 0 9 0 8
check_endian 000 0000 FE00 0 9 8 0
check_endian 1FF 01FF FFFF 0 9 8 0
|