473,766 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A byte can be greater than 8 bits?

As I read it, C99 states that a byte is an:

"addressabl e unit of data storage large enough to hold any member of
the basic character
set of the execution environment" (3.6)

and that a byte must be at least 8 bits:

"The values given below shall be replaced by constant expressions
suitable for use in #if
preprocessing directives. Moreover, except for CHAR_BIT and
MB_LEN_MAX, the
following shall be replaced by expressions that have the same type as
would an
expression that is an object of the corresponding type converted
according to the integer
promotions. Their implementation-defined values shall be equal or
greater in magnitude
(absolute value) to those shown, with the same sign."

number of bits for smallest object that is not a bit-field (byte)
CHAR_BIT 8 (5.2.4.2.1)

Does this mean that a byte can be larger than 8 bits (ie CHAR_BIT >
8)? I have gotten the impression that a byte, or unsigned char, was
always 8 bits, but perhaps I was wrong. If I am not, is there
somewhere in the standard that defines a byte as always being 8 bits?

Regards,
B.

Oct 1 '07
77 4283
jacob navia wrote:
CBFalconer wrote:
>jacob navia wrote:
>>Martin Wells wrote:
jacob:

Of course, there are maybe 10-20 installations all over the
world, but... I would not care really.

Given you don't care about porting from one version of windows to
the next, it's hardly suprising you don't care about this.

????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)

It even runs under windows ME!

No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.

lcc-win32 should run in windows 98 unless you use a 486
That's not what you claimed. You apparently don't even know why it
doesn't run on a '486. You lost the ability in one of your
untested revisions years ago. The point is that your claims are
inaccurate, and cannot be trusted.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Oct 3 '07 #71
Charlie Gordon wrote:
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
>jacob navia wrote:
>>Martin Wells wrote:
jacob:

Of course, there are maybe 10-20 installations all over the
world, but... I would not care really.

Given you don't care about porting from one version of windows to
the next, it's hardly suprising you don't care about this.

????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)

It even runs under windows ME!

No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.

Come on, W98 does not run on a '486, it merely crawls there like a
lame dog.
It runs fine. Some applications don't.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
--
Posted via a free Usenet account from http://www.teranews.com

Oct 3 '07 #72
CBFalconer wrote:
jacob navia wrote:
>CBFalconer wrote:
>>jacob navia wrote:
Martin Wells wrote:
jacob:
>
>Of course, there are maybe 10-20 installations all over the
>world, but... I would not care really.
Given you don't care about porting from one version of windows to
the next, it's hardly suprising you don't care about this.
????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)

It even runs under windows ME!
No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.
lcc-win32 should run in windows 98 unless you use a 486

That's not what you claimed. You apparently don't even know why it
doesn't run on a '486. You lost the ability in one of your
untested revisions years ago. The point is that your claims are
inaccurate, and cannot be trusted.
I told you thousand times that, Chuck but you will not
listen. I used the instruction xadd in the generated code
and that instruction is pentium only. This doesn't happen
in the compiler, if I remember correctly, but only in the debugger.

Since you did NOT want to pay me my consulting fees to backport
lcc-win32 to your 486 and you are the ONLY user of that backport
you will excuse me but I did not do it.

And you will complain the next 10 years, I know, but that's life
Chuck. No money, no work

:-)
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Oct 4 '07 #73
jacob navia wrote:
CBFalconer wrote:
>jacob navia wrote:
>>CBFalconer wrote:
jacob navia wrote:
Martin Wells wrote:
>jacob:
>>
>>Of course, there are maybe 10-20 installations all over the
>>world, but... I would not care really.
>>
>Given you don't care about porting from one version of windows to
>the next, it's hardly suprising you don't care about this.
>
????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)
>
It even runs under windows ME!

No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.

lcc-win32 should run in windows 98 unless you use a 486

That's not what you claimed. You apparently don't even know why it
doesn't run on a '486. You lost the ability in one of your
untested revisions years ago. The point is that your claims are
inaccurate, and cannot be trusted.

I told you thousand times that, Chuck but you will not
listen. I used the instruction xadd in the generated code
and that instruction is pentium only. This doesn't happen
in the compiler, if I remember correctly, but only in the debugger.

Since you did NOT want to pay me my consulting fees to backport
lcc-win32 to your 486 and you are the ONLY user of that backport
you will excuse me but I did not do it.

And you will complain the next 10 years, I know, but that's life
Chuck. No money, no work
No, you are the one confused. I told you what Pentium instruction
was trapping (I don't recall xadd, but I may be mistaken). I am
not complaining, I am simply pointing out that your claims are
flawed, for the benefit of others.

--
<http://www.cs.auckland .ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfoc us.com/columnists/423>
<http://www.schneier.co m/crypto-gram-0702.html#8>
<http://www.aaxnet.com/editor/edit043.html>

--
Posted via a free Usenet account from http://www.teranews.com

Oct 4 '07 #74
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
47************* **@yahoo.com...
Charlie Gordon wrote:
>"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
>>jacob navia wrote:
Martin Wells wrote:
jacob:
>
>Of course, there are maybe 10-20 installations all over the
>world, but... I would not care really.
>
Given you don't care about porting from one version of windows to
the next, it's hardly suprising you don't care about this.

????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)

It even runs under windows ME!

No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.

Come on, W98 does not run on a '486, it merely crawls there like a
lame dog.

It runs fine. Some applications don't.
Notepad ?
Oct 4 '07 #75
Charlie Gordon wrote:
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
47************* **@yahoo.com...
>Charlie Gordon wrote:
>>"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
jacob navia wrote:
Martin Wells wrote:
>jacob:
>>
>>Of course, there are maybe 10-20 installations all over the
>>world, but... I would not care really.
>Given you don't care about porting from one version of windows to
>the next, it's hardly suprising you don't care about this.
????
lcc-win runs under
o windows 2000
o windows 98
o windows XP (32 and 64 bits)
o windows server 32 and 64 bits
o windows Vista (32 and 64 bits)
>
It even runs under windows ME!
No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.
Come on, W98 does not run on a '486, it merely crawls there like a
lame dog.
It runs fine. Some applications don't.

Notepad ?

Look, maybe you do not know the history of this. Chuck has been telling
this since more than 6 years. I find his position tragic somehow,
because it represents the views of many people here, that insist on
living in the past.

There is a positive side to that too, the refusal to follow the fads,
the refusal to accept this eternally bloated hardware and software,
the refusal to always use more, consume more, use the fastest machine,
be current with your OS.

Somehow I am like that too in some ways. I stay with a simple language,
I prefer simpler software. That is why I have always tried to argue with
Chuck even if he has gotten into a position so extreme that is a
caricature of mine. But it is a valid position, and if I would have the
time I *would* satisfy him. Maybe I will do it some day.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Oct 4 '07 #76
jacob navia wrote:
Charlie Gordon wrote:
>"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
47************* **@yahoo.com...
>>Charlie Gordon wrote:
"CBFalcone r" <cb********@yah oo.coma écrit dans le message de news:
jacob navia wrote:
<snip>
>>>>>lcc-win runs under
>o windows 2000
>o windows 98
>o windows XP (32 and 64 bits)
>o windows server 32 and 64 bits
>o windows Vista (32 and 64 bits)
>>
>It even runs under windows ME!
No it doesn't. I can't speak for other combinations, but W98 runs
on a '486. lcc-win32 does not.
Come on, W98 does not run on a '486, it merely crawls there like a
lame dog.
It runs fine. Some applications don't.

Notepad ?
Look, maybe you do not know the history of this. Chuck has been telling
this since more than 6 years. I find his position tragic somehow,
because it represents the views of many people here, that insist on
living in the past.
I think if you mentioned on what processors lcc-win32 ran on, there would be
no need for anyone to provide such corrections and the consequent debates.

It my understanding that the command-line tools of the lcc-win32 package
will run on all platforms where a conforming C implementation is available,
while the IDE and the debugger need at least a Pentium processor.

Is this right?

Oct 4 '07 #77
"CBFalconer " <cb********@yah oo.coma écrit dans le message de news:
47************* **@yahoo.com...
Charlie Gordon wrote:
>>
... snip ...
>>
Personally, I would prefer if Standard C mandated 2s-complement
and defined the behaviour of shifting signed integer types left
and right. Maybe we should define a new language, Real-C where
these awkward historical detail would be removed...

Horrors. Then Real-C might even become popular, and all sorts of
code written in it by eager neophytes, which code can no longer be
made to run on older or newer machines, which in turn take
advantage of one or more of the known (or presently unknown)
advantages of sign-magnitude or 1's complement.
In your dreams.

Support for saturated arithmetics is a more likely exension.

--
Chqrlie.
Oct 5 '07 #78

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

Similar topics

9
3272
by: w3r3w0lf | last post by:
hello! I have a following situation: I have a byte array where at a certain location are stored 4 bytes, and these should be "put" into long variable (or any other 4 byte one). ie: byte a={0x0,0x0,0xfe,0x30,0x9e,0x2,0x66,0,0} and the bytes 0xfe,0x30,0x9e,0x2 should be put into long variable which should then contain 43921662 how to achieve this?
235
11787
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could stay with C and still be able to produce Java byte code for platform independent apps. Also, old programs (with some tweaking) could be re-compiled and ported to the JVM. We have been developing such a tool over the last 2 years and currently...
16
9224
by: Samuel Thomas | last post by:
Hello Friends, I understand(could be wrong) that the smallest chunk of memory is called a word. If that is correct, that means if I am using a 32 bit OS a word is 4 bytes. So that's why the size of an int is 4 bytes. How is it that a char then gets 1 byte. Shouldn't it also get 4 bytes even though it might be able to store only 256 values? Is the OS doing some sort of trimming? Thanks
47
16564
by: Kapil Khosla | last post by:
Hi, I am trying to reverse a byte eg. 11010000 should look like 00001011 Plz note, it is not a homework problem and I do not need the c code for it. Just give me an idea how should I proceed about it. I know basic bit manipulation , shifting left, right and have done
4
1859
by: s.subbarayan | last post by:
Dear all, I would like to know the easiest efficient way to set or inject a particular value in the given word or byte?The problem is: I have to implement a function which will set a value from position "n" to "n+x" where n and x are passed dynamically,where n is start position of the bit from which i will be setting a value and x is the position where I will be finishing the setting.In short it looks like this:
33
3415
by: Benjamin M. Stocks | last post by:
Hello all, I've heard differing opinions on this and would like a definitive answer on this once and for all. If I have an array of 4 1-byte values where index 0 is the least signficant byte of a 4-byte value. Can I use the arithmatic shift operators to hide the endian-ness of the underlying processor when assembling a native 4-byte value like follows: unsigned int integerValue; unsigned char byteArray;
96
4973
by: david ullua | last post by:
I am reading "Joel on Software" these days, and am in stuck with the question of "how to calculate bitsize of a byte" which is listed as one of the basic interview questions in Joel's book. Anyone could give some ideas?I am expecting your reply. David.
14
1918
by: rsood | last post by:
Hi I'm developing a program, and naturally I want it to be as portable as possible. I need to be able to access specific numbers of bytes in it, but as far as I know, there is no keyword in the c language such as 'byte'. Is it always okay to assume that the char data type is always 1 byte, or is there some other way to be sure you are getting 1 byte that is not processor/OS dependent that is better, or is there no way to be both...
20
3529
by: quantumred | last post by:
I found the following code floating around somewhere and I'd like to get some comments. unsigned char a1= { 5,10,15,20}; unsigned char a2= { 25,30,35,40}; *(unsigned int *)a1=*(unsigned int *)a2; // now a1=a2, a1=a2, etc.
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9837
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.