473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

about BigEndian and LittleEndian

hi all,

I generate binary text file (in Windows using Dev-C++)
Is the generated binary file using BigEndian?
Are there any method to generate binary file using LittleEndian?
Because I want the generated binary file to be used in Palm, is it necessary
to do so ?
thanks!
Nov 13 '05
55 3738
Da*****@cern.ch (Dan Pop) wrote in news:bq**********@sunnews.cern.ch:
The Unix semantics is: uninitialised data segment.
Which I always thought was a misnomer as the block is zeroed.


The idea is that there is no image for this segment in the executable
file. It comes already zeroed by the OS, as any piece of memory
obtained from the OS, for obvious security reasons.
I suppose it
means the programmer did not initialize items in this segment.


Anything initialised to all zeroes *by default* gets there.


Yes, of course.
If you
initialise to all zeroes explicitly, the stuff goes into the data
segment and actually increases the executable size. At least, this is
what gcc is doing:


I find this behaviour to be true for many toolchains. I'm for ever
removing the initializer on definitions like:

static int arr[ARR_SIZE] = { 0 };

to keep our image sizes down. I suppose, from an implementor's view, this
is correct although somewhat silly behavior.

--
- Mark ->
--
Nov 13 '05 #51
Chris Dollin wrote:
CBFalconer wrote:
Gene Wirchenko wrote:
<ir*******@freenet.de> wrote:
>"Mr. Ger" <as******@none.none> wrote:
>> > Sharon <sh************@hotmail.com> scribbled the following
>> >
>> >> I generate binary text file (in Windows using Dev-C++)
>> >> Is the generated binary file using BigEndian?
>> >
>> > Mu.
>>
>> Please speak English and not Finnish in English groups please.
>
> 'Mu' (at least in this case) isn't Finnish; it is a Zen reply,
> with the approximate meaning: "The only way to know the answer
> to this question is not asking this question.", or, in short:
> "I am un-asking your question."

Another way it is used is with the meaning: "Your question
assumes something that is not the case, and so is unaswerable."


Or, as has often arisen over the bridge table, at a suitable
point in play:

Nu?


Is that in Nu Trump play?


Not necessarily. Consider the following end position, where the
actual cards are known for one reason or another, and the lead is
with South, Diamonds trumps (or no trumps):

North:
S: x
H: Ax
East: West:
S: A C: xxx
H: KQ
South:
S: x
H: x
D: x

South places the x of D on the table, gazes sweetly upon East, and
clearly enunciates "Nu?". :-)

Note: you may interchange East and West if desired. I can also
construct scenarios that call for two Nus during one trick. For
the defence, no nus is good nus.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 13 '05 #52
Dan Pop wrote:
In <sl*******************@hehe.cl.cam.ac.uk> Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:

glen herrmannsfeldt wrote:
Dan Pop wrote:

It's also common Unix terminology:

fangorn:~/tmp 217> size a.out
text data bss dec hex filename
855 220 24 1099 44b a.out

I don't think I ever knew what bss stands for.


"Block started by symbol", according to Dennis Ritchie:

And, IIRC, it was introduced by an IBM assembler, which supported it as
a directive, along with BES, "block ended by symbol". Back in the late
fifties or so.


I started with OS/360 assembly, and it seems it was gone by then.

-- glen

Nov 13 '05 #53
On Wed, 26 Nov 2003 12:23:32 +0000, Jeremy Yallop wrote:
glen herrmannsfeldt wrote:
Dan Pop wrote:
It's also common Unix terminology:

fangorn:~/tmp 217> size a.out
text data bss dec hex filename
855 220 24 1099 44b a.out


I don't think I ever knew what bss stands for.


"Block started by symbol", according to Dennis Ritchie:
<news:3B*****************************@ifi.uio.no >.


There is an older meaning "binary symbolic subroutine" from
Fortran. From the John Backus paper "The History of FORTRAN I, II, II":

In the early fall of 1957 we started to plan ways of correcting these
shortcomings; a document dated September 25, 1957 ... This document is
titled "Proposed Specifications for FORTRAN II for the 704"; ...
It describes how symbolic information is retained in the relocatable
binary form of a subroutine so that the "binary symbolic subroutine
[BSS] loader" can implement references to separately compiled
subroutines.
Nov 13 '05 #54
On 25 Nov 2003 16:32:12 GMT, Da*****@cern.ch (Dan Pop) wrote:
In <2_Awb.225969$ao4.817994@attbi_s51> glen herrmannsfeldt <ga*@ugcs.caltech.edu> writes:
Martijn Lievaart wrote: <snip>
For those that don't know, 'text' is also use as a (terribly confusing)
term for the code of a program as it is layed out in an executable file or
in memory.


IBM, at least, seems to like it. The S/360 object code files contain a
few different types of records, ESD (external symbol dictionary), RLD
(relocation dictionary), TXT (the instructions and data),

^^^^^^^^^^^^^^^^^^^^^^^^^
Isn't it instructions and *read-only* data?

I believe it's all initialized data; read-only data, or at least
literals, will normally be put in the same CSECT as code and
modifiable data in another, so the first can be pure (originally and I
think still called reentrant) but the second not.

- David.Thompson1 at worldnet.att.net
Nov 13 '05 #55
Dave Thompson wrote:
On 25 Nov 2003 16:32:12 GMT, Da*****@cern.ch (Dan Pop) wrote: (snip regarding the use of the word "text" describing executable code)
I wrote:
IBM, at least, seems to like it. The S/360 object code files contain a
few different types of records, ESD (external symbol dictionary), RLD
(relocation dictionary), TXT (the instructions and data),

^^^^^^^^^^^^^^^^^^^^^^^^^ Isn't it instructions and *read-only* data?

I believe it's all initialized data; read-only data, or at least
literals, will normally be put in the same CSECT as code and
modifiable data in another, so the first can be pure (originally and I
think still called reentrant) but the second not.


Old Fortran compilers would put everything into the same CSECT. All
variables were static, and initialized ones were in the same CSECT, and
initialized with TXT records.

The PL/I compilers that I knew used a separate CSECT for initialized data.

Newer processors with large cache line size and separate instruction and
data caches run significantly slower if data and instructions are close
together. That is one reason to keep them separate.

uninitialized static external variables (not in C) would be COM
sections, initialized ones (from Fortran BLOCK DATA for example) would
be CSECTs.

-- glen

Nov 13 '05 #56

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
8
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
3
by: TF | last post by:
Hi, I've a byte array with 4 elements in BigEndian format i.e. {0, 0, 0, 12} and i want to convert it to 4-byte integer (Int32). I am trying Encoding.BigEndianUnicode property but it has no effect...
6
by: Snake | last post by:
Hey, where can I ask about little and big endian stuffs? here or another newsgroup?! I just need help in representing string c = "place" and long b = 0x11223344 in a 16 bit word memory in the...
14
by: Laszlo Szijarto | last post by:
Can BinaryReader be forced to read a stream, say a TCP/IP stream or memory stream or even file stream in big endian order or do I have to write something custom to reverse the byte order? So, for...
6
by: lovecreatesbeauty | last post by:
/* It seems that when an int with width of four bytes is assigned to a one byte width char, the first three bytes from left to right are discarded and the rightest byte is assigned to that char....
1
by: DR | last post by:
mySqlBytes.buffer is getting converted to BigEndian even though both SQL server 2005 and the CLR function are on the same machine which shows BitConverter.IsLittleEndian == true in tsql: select...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.