Commit 1318ab5d authored by rdubner's avatar rdubner

Adjust display order of p/x variables on little-endian machines

parent d22899be
......@@ -1346,11 +1346,11 @@ class CobolVariable() :
retval = "0x"
output_bytes = self.data[:]
if (self.AttrFlags & (COB_FLAG_REAL_BINARY | COB_FLAG_IS_POINTER)) \
and GV_GlobalVariables.byteorder == "little" != 0 :
output_bytes.reverse()
if (self.AttrFlags & COB_FLAG_BINARY_SWAP) != 0 :
output_bytes.reverse()
if GV_GlobalVariables.byteorder == "little" :
if (self.AttrFlags & COB_FLAG_BINARY_SWAP) == 0 : # If this is ON, then it is already in display order
if (self.AttrFlags & (COB_FLAG_REAL_BINARY | COB_FLAG_IS_POINTER | COB_FLAG_IS_FP )) != 0 :
# These three types are little-endian; flip them so they display with the big byte to the left
output_bytes.reverse()
for byte in output_bytes :
hexout = hex(byte)[-2:]
if hexout[0:1] == 'x' :
......
......@@ -4484,7 +4484,7 @@ $ 1.23+
12 : 01 def-SIGNED-SHORT/test [W-S] : +00025
13 : 01 def-UNSIGNED-INT/test [W-S] : 0000000026
14 : 01 def-COMPUTATIONAL/test [W-S] : -988776654.1223345
01 def-COMP-1/test [W-S] : 0x7b148e3f
01 def-COMP-1/test [W-S] : 0x3f8e147b
7.77 def-FLOAT-LONG
202 DISPLAY def-FLOAT-SHORT " def-FLOAT-SHORT "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4555,7 +4555,7 @@ $ 1.23+
12 : 01 def-SIGNED-SHORT/test [W-S] : +00025
13 : 01 def-UNSIGNED-INT/test [W-S] : 0000000026
14 : 01 def-UNSIGNED-LONG/test [W-S] : 00000000000000000027
01 def-COMP-1/test [W-S] : 0x7b148e3f
01 def-COMP-1/test [W-S] : 0x3f8e147b
8.8800001 def-FLOAT-SHORT
203 DISPLAY def-INDEX " def-INDEX "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4626,7 +4626,7 @@ $ 1.23+
12 : 01 def-UNSIGNED-INT/test [W-S] : 0000000026
13 : 01 def-UNSIGNED-LONG/test [W-S] : 00000000000000000027
14 : 01 def-UNSIGNED-SHORT/test [W-S] : 00028
01 def-COMPUTATIONAL-1/test [W-S] : 0xb81e5540
01 def-COMPUTATIONAL-1/test [W-S] : 0x40551eb8
+000000019 def-INDEX
204 DISPLAY def-SIGNED-INT " def-SIGNED-INT "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4697,7 +4697,7 @@ $ 1.23+
12 : 01 def-UNSIGNED-LONG/test [W-S] : 00000000000000000027
13 : 01 def-UNSIGNED-SHORT/test [W-S] : 00028
14 : 01 def-COMP-3/test [W-S] : +988776654.1223345
01 def-COMPUTATIONAL-1/test [W-S] : 0xb81e5540
01 def-COMPUTATIONAL-1/test [W-S] : 0x40551eb8
+0000000023 def-SIGNED-INT
205 DISPLAY def-SIGNED-LONG " def-SIGNED-LONG "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4768,7 +4768,7 @@ $ 1.23+
12 : 01 def-UNSIGNED-SHORT/test [W-S] : 00028
13 : 01 def-COMP-3/test [W-S] : +988776654.1223345
14 : 01 def-COMPUTATIONAL-3/test [W-S] : -988776654.1223345
01 def-COMPUTATIONAL-2/test [W-S] : 0xc2f5285c8fc21140
01 def-COMPUTATIONAL-2/test [W-S] : 0x4011c28f5c28f5c2
+00000000000000000024 def-SIGNED-LONG
206 DISPLAY def-SIGNED-SHORT " def-SIGNED-SHORT "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4839,7 +4839,7 @@ $ 1.23+
12 : 01 def-COMP-3/test [W-S] : +988776654.1223345
13 : 01 def-COMPUTATIONAL-3/test [W-S] : -988776654.1223345
14 : 01 def-PACKED-DECIMAL/test [W-S] : +988776654.1223345
01 def-FLOAT-DECIMAL-16/test [W-S] : 0x2b02000000008031
01 def-FLOAT-DECIMAL-16/test [W-S] : 0x318000000000022b
+00025 def-SIGNED-SHORT
207 DISPLAY def-UNSIGNED-INT " def-UNSIGNED-INT "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4910,7 +4910,7 @@ $ 1.23+
12 : 01 def-COMPUTATIONAL-3/test [W-S] : -988776654.1223345
13 : 01 def-PACKED-DECIMAL/test [W-S] : +988776654.1223345
14 : 01 def-PACKED-DECIMAL-S/test [W-S] : -88776654.1223345
01 def-FLOAT-DECIMAL-34/test [W-S] : 0xffffffff638e8d37c087adbe09ed4130
01 def-FLOAT-DECIMAL-34/test [W-S] : 0x3041ed09bead87c0378d8e63ffffffff
0000000026 def-UNSIGNED-INT
208 DISPLAY def-UNSIGNED-LONG " def-UNSIGNED-LONG "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -4981,7 +4981,7 @@ $ 1.23+
12 : 01 def-PACKED-DECIMAL/test [W-S] : +988776654.1223345
13 : 01 def-PACKED-DECIMAL-S/test [W-S] : -88776654.1223345
14 : 01 def-BINARY/test [W-S] : +000000001.0000000
01 def-FLOAT-LONG/test [W-S] : 0x14ae47e17a141f40
01 def-FLOAT-LONG/test [W-S] : 0x401f147ae147ae14
00000000000000000027 def-UNSIGNED-LONG
209 DISPLAY def-UNSIGNED-SHORT " def-UNSIGNED-SHORT "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -5052,7 +5052,7 @@ $ 1.23+
12 : 01 def-PACKED-DECIMAL-S/test [W-S] : -88776654.1223345
13 : 01 def-BINARY/test [W-S] : +000000001.0000000
14 : 01 def-BINARY-S/test [W-S] : -988776654.1223345
01 def-FLOAT-SHORT/test [W-S] : 0x7b140e41
01 def-FLOAT-SHORT/test [W-S] : 0x410e147b
00028 def-UNSIGNED-SHORT
210 DISPLAY def-COMP-3 " def-COMP-3 "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -5903,7 +5903,7 @@ $ 1.23+
11 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
12 : 01 def-COMP-XX/test [W-S] : 009887766541223345
13 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-BINARY/test [W-S] : 0x8096980000000000
01 def-BINARY/test [W-S] : 0x0000000000989680
-00009887766541223345 def-COMPUTATIONAL-5
222 DISPLAY def-COMP-6 " def-COMP-6 "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -5972,7 +5972,7 @@ $ 1.23+
10 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
11 : 01 def-COMP-XX/test [W-S] : 009887766541223345
12 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-BINARY-S/test [W-S] : 0x4f3ab0f320dfdcff
01 def-BINARY-S/test [W-S] : 0xffdcdf20f3b03a4f
88776654.1223345 def-COMP-6
223 DISPLAY def-COMP-X " def-COMP-X "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -6040,7 +6040,7 @@ $ 1.23+
9 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
10 : 01 def-COMP-XX/test [W-S] : 009887766541223345
11 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-COMP/test [W-S] : 0xb1c54f0cdf202300
01 def-COMP/test [W-S] : 0x002320df0c4fc5b1
+988776654.1223345 def-COMP-X
224 DISPLAY def-COMPUTATIONAL-X " def-COMPUTATIONAL-X "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -6107,7 +6107,7 @@ $ 1.23+
8 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
9 : 01 def-COMP-XX/test [W-S] : 009887766541223345
10 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-COMPUTATIONAL/test [W-S] : 0x4f3ab0f320dfdcff
01 def-COMPUTATIONAL/test [W-S] : 0xffdcdf20f3b03a4f
+988776654.1223345 def-COMPUTATIONAL-X
225 DISPLAY def-COMP-XX " def-COMP-XX "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -6173,7 +6173,7 @@ $ 1.23+
7 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
8 : 01 def-COMP-XX/test [W-S] : 009887766541223345
9 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-COMP-4/test [W-S] : 0xb1c54f0cdf202300
01 def-COMP-4/test [W-S] : 0x002320df0c4fc5b1
009887766541223345 def-COMP-XX
226 DISPLAY def-DISPLAY " def-DISPLAY "
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......@@ -6238,7 +6238,7 @@ $ 1.23+
6 : 01 def-COMPUTATIONAL-X/test [W-S] : +988776654.1223345
7 : 01 def-COMP-XX/test [W-S] : 009887766541223345
8 : 01 def-DISPLAY/test [W-S] : +988776654.1223345
01 def-COMPUTATIONAL-4/test [W-S] : 0x4f3ab0f320dfdcff
01 def-COMPUTATIONAL-4/test [W-S] : 0xffdcdf20f3b03a4f
+988776654.1223345 def-DISPLAY
228 STOP RUN.
1 : 01 header/test [W-S] : "An extravaganza of variables!", ' ' <repeats 11 times>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment