endianness Questions

1

Solved

In other words, do L1, L2, L3, etc. caches always reflect the endianness of their CPU? Or does it make more sense to always store data in caches in some specific endianness? Is there a general de...
Lute asked 5/11, 2015 at 10:12

1

Solved

Excuse the poor wording, but I couldn't find a better way to explain it. From my understanding, C# is a WORA language- you can write it on one machine and deploy it on another, because the MSIL is...
Diagenesis asked 23/9, 2015 at 18:6

2

First of all, forgive my extremely amateur coding knowledge. I am intern at a company and have been assigned to create a code in C++ that swaps bytes in order to get the correct checksum value. I ...
Bioastronautics asked 14/9, 2015 at 21:4

6

Solved

In the documentation of hardware that allows us to control it via UDP/IP, I found the following fragment: In this communication protocol, DWORD is a 4 bytes data, WORD is a 2 bytes data, BYTE i...
Factious asked 20/10, 2008 at 10:13

5

Solved

I'm using DataOutputStream to write to a file, however I want to change the endian of the data. This is how i'm writing the byte data to the file (it outputs in Little endian by default) public ...
Weirick asked 11/8, 2011 at 10:4

1

Solved

I have the following structure and "getter" function that returns a cast to an unsigned integer: struct s { uint32_t a; }; void get_a(struct s *st, unsigned *ret) { *ret = (unsigned)st->a; }...
Foilsman asked 24/7, 2015 at 10:1

2

Kindly clarify my doubt as i got so confused with the below stuff and i couldnt get a clean anwser any where else on net. #include<stdio.h> int main() { int a = 0x44332211; printf("Netwo...
Brahear asked 7/4, 2013 at 14:58

3

Solved

I have a string of 256*4 bytes of data. These 256* 4 bytes need to be converted into 256 unsigned integers. The order in which they come is little endian, i.e. the first four bytes in the string ar...
Imtiaz asked 29/7, 2013 at 5:4

1

Solved

I am using the two methods BitConverter.GetBytes and Array.Reverse to read and write binary data from a file due the endianness. My unit tests are passing and the implementation seems fine. How c...
Diabetic asked 11/5, 2015 at 10:24

2

Solved

This is a rather basic problem with which, to my surprise, I've had a problem today. It looks to me like inet_pton and inet_ntoa are reversing the bytes of the IP address they're given: DWORD IP;...
Forevermore asked 10/5, 2015 at 16:44

2

Solved

I'm trying to do something that I thought would be pretty basic but either I'm just ignoring something obvious or it is actually a bit tricky. My problem is: I have an array of 4 chars that contain...
Eras asked 30/4, 2015 at 13:28

7

Solved

In the code below, why do X and Y take on different values than what I would think intuitively? If the bytes 0-7 are written to the buffer, shouldn't the resulting long have bytes in the same orde...
Cantrell asked 5/1, 2010 at 0:32

3

Solved

I have an array of longs I want to write to disk. The most efficient disk I/O functions take in byte arrays, for example: FileOutputStream.write(byte[] b, int offset, int length) ...so I want to...
Standardbearer asked 28/4, 2015 at 18:32

2

Solved

When I use std::bitset<N>::bitset( unsigned long long ) this constructs a bitset and when I access it via the operator[], the bits seems to be ordered in the little-endian fashion. Example: ...
Pend asked 7/4, 2015 at 3:16

1

Solved

I'm reading Words from byte arrays and need to make parts of my code endian-aware. Does GHC expose anything (like MachDeps.h) which I can use to make code conditional on processor endianness? If no...
Tattler asked 30/3, 2015 at 15:12

2

Solved

My library needs to read-in big-endian integers (4-bytes) and convert them to the endian order of the host for processing. While on *nix ntohl has worked a treat under Windows use of ntohl requires...
Tacmahack asked 6/10, 2010 at 22:18

8

Solved

This is what I offered at an interview today. int is_little_endian(void) { union { long l; char c; } u; u.l = 1; return u.c == 1; } My interviewer insisted that c and l are not guarantee...
Atal asked 20/8, 2009 at 2:45

4

Solved

I am trying to decode some data sent from a big-endian machine to the decoder, which is residing on a little-endian machine. I haven't worked with this very much, and I feel like I am confusing mys...
Preen asked 25/10, 2013 at 20:21

2

Solved

I have to make a two way communication between a legacy system and an android device. The legacy system uses little endian byte ordering. I have successfully implemented the receiving part, however...
Forrestforrester asked 25/11, 2012 at 17:12

4

Solved

I have a special unsigned long (32 bits) and I need to convert the endianness of it bit by bit - my long represents several things all smooshed together into one piece of binary. How do I do it?
Vacillatory asked 23/10, 2009 at 15:57

2

Solved

I have a radiograph .img file without the header file. However, the researchers who have published the file have given this information about it High resolution (2048 x 2048 matrix size, 0.175mm p...
Geraldina asked 17/4, 2014 at 18:54

2

Solved

I have this snippet with a strange result (279.1... vs. 279.6...): $ perl -e "print unpack('f>', pack ('f>', 279.117156982422));" 279.617156982422 While this one works $ perl -e "print un...
Attrahent asked 23/9, 2013 at 22:7

2

Solved

I am trying to switch endianess of ByteBuffer, but there is no effects from it. What am doing wrong? Maybe my debug main function is incorrect? @Override public byte[] toBytes(BigDecimal type) { ...
Electrolyze asked 14/11, 2014 at 12:29

2

Solved

The Intel Software Developer's Manual Volume 1, Section 7.3.1.2 states that the BSWAP instruction "speeds execution of decimal arithmetic". It doesn't explain how this is so, and Google i...
Hirsutism asked 31/10, 2014 at 21:21

4

Solved

I ran the following program on little-endian [LE] machine [Linux, Intel processor]. I am unable to explain the 3 outputs in below code snippet. Since machine is LE, the value of a is stored as 0x78...
Deli asked 10/7, 2012 at 23:11

© 2022 - 2024 — McMap. All rights reserved.