Nп/п : 4 из 100
 От   : Janis Papanagnou                    2:5075/128        22 авг 23 16:49:05
 К    : Hongy                                                 22 авг 23 17:51:02
 Тема : Re: About the big-endian and little-endian.
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> db331fc3
@REPLY:
<3b93482a-421e-43a8-9d9a-d1cf557a4612n@googlegroups.com> 097c99fd
@REPLYADDR Janis Papanagnou
<janis_papanagnou+ng@hotmail.com>
@REPLYTO 2:5075/128 Janis Papanagnou
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References:
<3b93482a-421e-43a8-9d9a-d1cf557a4612n@googlegroups.com>
@TZUTC: 0200
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:45.0)
Gecko/20100101 Thunderbird/45.8.0
@TID: FIDOGATE-5.12-ge4e8b94
On 22.08.2023 15:58, hongy...@gmail.com wrote:
> See my following example:

> werner@X10DAi:~$ echo -n -e "4Vx" | od -An -x --endian=big
>  1234 5678
> werner@X10DAi:~$ echo -n -e "4Vx" | od -An -x --endian=little
>  3412 7856

(My `od` doesn`t support `--endian`; I use different options below
and show only the little-endian results.)


> Could you tell me why the latter doesn`t give the following result?

Endian-ness swaps bytes in "words" (default "word" is 2 octets; you
define what a "word" is).

$ echo -n -e $`4Vx` | od -An -t x1
 12 34 56 78
$ echo -n -e $`4Vx` | od -An -t x2
 3412 7856
$ echo -n -e $`4Vx` | od -An -t x4
 78563412
 0000ab9078563412


Janis


> 7856   3412, 
> aka,
> 0x78      0x56      0x34      0x12

> Regards,
> Zhao


--- Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх