Host byte order in a computer system is either little endian or big endian depen
ID: 3637908 • Letter: H
Question
Host byte order in a computer system is either little endian or big endian depending on the computer arhitecture. For example in Intel architecture computers the host byte order is little endian , while in Motorola computers , the host byte order is big endian. Network byte order on the other hand is always big endian. This is necessary to make sure the systems from different manufacturers are compatible on the network.uint32_t htonl(uint32_t hostlong)
uint32_t ntohl(uint32_t netlong)
are two functions that are desired to convert from host byte order to network byte order or vice versa.
The htonl() function converts the unsigned integer hostlong from host byte order to network byte order.
The ntohl() function converts the unsigned integer netlong from network byte order to host byte order.
Write a function htonl in assembly that will accept an integer variable and covert it from host byte order to network byte order.
Write a function ntohl in assembly that will accept an integer in network byte order and return an integer in host byte order.