Gebruikershulpmiddelen

Site-hulpmiddelen


linux:architectuur:endian.html

Little Endian versus Big Endian

Compare JUMP instructions
Little Endian CPU
Intel 8080
Big Endian CPU
RCA/GE 1806
Address Data Instruction Comment
1000 C3 JMP 4000 ; Jump to 4000
1001 00 ; Low Byte
1002 40 ; High Byte
Address Data Instruction Comment
1000 C0 LBR 4000 ; Jump to 4000
1001 40 ; High Byte
1002 00 ; Low Byte

16-bit as an extension of 8-bit
Little Endian CPU
Intel 8080
Big Endian CPU
RCA/GE 1806
Addr Data Instruction Comment
4000 3E MVI A,01 ; Load Accu, 01
4001 01 ; Data
Addr Data Instruction Comment
4000 F8 LDI 01 ; Load Accu, 01
4001 01 ; Data
Addr Data Instruction Comment
4002 21 LXI H,0001 ; Load HL, 0001
4003 01 ; Low Byte
4004 00 ; High Byte
Addr Data Instruction Comment
4002 68C0 RLDI R0,0001 ; Load R0, 0001
4004 00 ; High Byte
4005 01 ; Low Byte

Little Endian versus Big Endian

When dealing with multibyte values (eg. 16-bit or 32-bit data) in memory a Big Endian CPU stores the most significant byte on the lowest memory address.
In datacommunication systems a Big Endian CPU will first transmit the most significant byte of a multibyte value.

A Little Endian CPU stores the least significant byte on the lowest memory address.
In datacommunication systems a Little Endian CPU will tend to transmit the least significant byte first, resulting in a presentation problem when communicating to a Big Endian CPU.

Since TCP/IP was developed using PDP-11 Big Endian CPUs, Big Endian is the standard on the network. When communicating to the network, classical TCP/IP applications (eg. Telnet, FTP) convert all data to/from Big Endian using libraries. RPC applications use a separate protocol: XDR.

Copyright (C) 2003 Integrated Services; tux4u.nl
Author: Ing.J.M.Waldorp
endian.html 20020630

linux/architectuur/endian.html.txt · Laatst gewijzigd: 2018/12/30 17:17 (Externe bewerking)