Next: , Up: Endianness   [Contents][Index]


14.13.1 .set endian

GNU poke maintains a global variable that holds the current endianness. This is the endianness that will be used when mapping integers whose types do not specify an explicit endianness.

Like other poke global state, this global variable can be modified using the .set dot-command:

.set endian little
.set endian big
.set endian host

The current endianness can be obtained like this:

(poke) .set endian
little

We can easily see how changing the current endianness indeed impacts the way integers are mapped:

(poke) dump :from 0#B :size 4#B :ruler 0 :ascii 0
00000000: 8845 4c46
(poke) .set endian little
(poke) int @ 0#B
0x464c4588
(poke) .set endian big
(poke) int @ 0#B
0x88454c46